1 /*
2  * Copyright (C) 2006, Magnus Hjorth
3  *
4  * This file is part of mhWaveEdit.
5  *
6  * mhWaveEdit is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * mhWaveEdit is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with mhWaveEdit; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 
22 #ifndef SESSION_H_INCLUDED
23 #define SESSION_H_INCLUDED
24 
25 #include <gtk/gtk.h>
26 #include "datasource.h"
27 #include "chunk.h"
28 #include "document.h"
29 #include "mainwindow.h"
30 
31 /* Set up session handling system. */
32 void session_init(int *argc, char **argv);
33 
34 /* If there are old sessions, a dialog will pop up and the user can choose
35  * a session to restore/join. Returns TRUE if session was resumed. */
36 gboolean session_dialog(void);
37 
38 gint session_get_id(void);
39 
40 /* Called periodically from main loop */
41 void session_work(void);
42 
43 /* Dumps session data to disk. Program should exit afterwards. */
44 gboolean session_suspend(void);
45 
46 /* Remove all data for this session */
47 void session_quit(void);
48 
49 /* Logging functions */
50 gboolean session_log_datasource(Datasource *ds);
51 gboolean session_log_chunk(Chunk *c);
52 gboolean session_log_document(Document *d);
53 gboolean session_log_mainwindow(Mainwindow *w);
54 gboolean session_log_clipboard(Chunk *clipboard);
55 
56 #endif
57