iceWing
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Gsession.h
Go to the documentation of this file.
1 /* -*- mode: C; tab-width: 4; c-basic-offset: 4; -*- */
2 
3 /*
4  * Author: Frank Loemker
5  *
6  * Copyright (C) 1999-2009
7  * Frank Loemker, Applied Computer Science, Faculty of Technology,
8  * Bielefeld University, Germany
9  *
10  * This file is part of iceWing, a graphical plugin shell.
11  *
12  * iceWing is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * iceWing is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25  */
26 
27 #ifndef iw_Gsession_H
28 #define iw_Gsession_H
29 
30 #include <gtk/gtk.h>
31 
32 #include "Gpreview.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /*********************************************************************
39  Return name of the default session file. Returned value is a pointer
40  to a static variable.
41 *********************************************************************/
42 char *iw_session_get_name (void);
43 
44 /*********************************************************************
45  Set name of the session file.
46 *********************************************************************/
47 void iw_session_set_name (const char *name);
48 
49 /*********************************************************************
50  Delete the session file and thus clear the session.
51 *********************************************************************/
52 void iw_session_clear (void);
53 
54 /*********************************************************************
55  Save session information for all open windows to file
56  `iw_session_get_name()`.
57 *********************************************************************/
58 void iw_session_save (void);
59 
60 /*********************************************************************
61  Load new (not already loaded) session information from file
62  `iw_session_get_name()`.
63 *********************************************************************/
64 gboolean iw_session_load (void);
65 
66 /*********************************************************************
67  PRIVATE: Apply the session entry for 'title', free the entry
68  afterwards, and add window to the list of session managed windows.
69  set_pos: Set position of window ?
70  set_size: Set size of window ?
71  Return: Session entry for 'title' found and applied?
72 *********************************************************************/
73 gboolean iw_session_set_prev (GtkWidget *window, prevBuffer *buf,
74  const char *title, gboolean set_pos, gboolean set_size);
75 
76 /*********************************************************************
77  Apply the session entry for 'title', free the entry afterwards, and
78  add window to the list of session managed windows.
79  set_pos: Set position of window ?
80  set_size: Set size of window ?
81  Return: Session entry for 'title' found and applied?
82 *********************************************************************/
83 gboolean iw_session_set (GtkWidget *window, const char *title,
84  gboolean set_pos, gboolean set_size);
85 
86 /*********************************************************************
87  Return if a session entry with 'title' was loaded.
88 *********************************************************************/
89 gboolean iw_session_find (const char *title);
90 
91 /*********************************************************************
92  Remove window with 'title' from the list of session managed windows,
93  e.g. if window was closed.
94 *********************************************************************/
95 void iw_session_remove (const char *title);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif /* iw_Gsession_H */