finch/libgnt/gntws.h

changeset 39360
e7bed293aad5
parent 39302
64aabebb476b
child 39361
a1068caa3600
equal deleted inserted replaced
39302:64aabebb476b 39360:e7bed293aad5
1 /*
2 * GNT - The GLib Ncurses Toolkit
3 *
4 * GNT is the legal property of its developers, whose names are too numerous
5 * to list here. Please refer to the COPYRIGHT file distributed with this
6 * source distribution.
7 *
8 * This library is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
21 */
22
23 #ifndef GNTWS_H
24 #define GNTWS_H
25 /**
26 * SECTION:gntws
27 * @section_id: libgnt-gntws
28 * @short_description: <filename>gntws.h</filename>
29 * @title: Workspace API
30 */
31
32 #include "gntwidget.h"
33
34 #include <panel.h>
35
36 #define GNT_TYPE_WS (gnt_ws_get_type())
37 #define GNT_WS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WS, GntWS))
38 #define GNT_IS_WS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_WS))
39 #define GNT_IS_WS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_WS))
40 #define GNT_WS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_WS, GntWSClass))
41
42 typedef struct _GntWS GntWS;
43
44 struct _GntWS
45 {
46 GntBindable inherit;
47 char *name;
48 GList *list;
49 GList *ordered;
50 gpointer ui_data;
51
52 void *res1;
53 void *res2;
54 void *res3;
55 void *res4;
56 };
57
58 typedef struct _GntWSClass GntWSClass;
59
60 struct _GntWSClass
61 {
62 GntBindableClass parent;
63
64 void (*draw_taskbar)(GntWS *ws, gboolean reposition);
65
66 void (*res1)(void);
67 void (*res2)(void);
68 void (*res3)(void);
69 void (*res4)(void);
70 };
71
72 G_BEGIN_DECLS
73
74 /**
75 * gnt_ws_get_type:
76 *
77 * Returns: The GType for GntWS.
78 *
79 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
80 */
81 GType gnt_ws_get_type(void);
82
83 /**
84 * gnt_ws_new:
85 * @name: The desired name of the workspace, or %NULL.
86 *
87 * Create a new workspace with the specified name.
88 *
89 * Returns: The newly created workspace.
90 *
91 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
92 */
93 GntWS *gnt_ws_new(const char *name);
94
95 /**
96 * gnt_ws_set_name:
97 * @ws: The workspace to rename.
98 * @name: The new name of the workspace.
99 *
100 * Set the name of a workspace.
101 *
102 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
103 */
104 void gnt_ws_set_name(GntWS *ws, const gchar *name);
105
106 /**
107 * gnt_ws_add_widget:
108 * @ws: The workspace.
109 * @widget: The widget to add.
110 *
111 * Add a widget to a workspace.
112 *
113 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
114 */
115 void gnt_ws_add_widget(GntWS *ws, GntWidget *widget);
116
117 /**
118 * gnt_ws_remove_widget:
119 * @ws: The workspace
120 * @widget: The widget to remove from the workspace.
121 *
122 * Remove a widget from a workspace.
123 *
124 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
125 */
126 void gnt_ws_remove_widget(GntWS *ws, GntWidget *widget);
127
128 /**
129 * gnt_ws_widget_hide:
130 * @widget: The widget to hide.
131 * @nodes: A hashtable containing information about the widgets.
132 *
133 * Hide a widget in a workspace.
134 *
135 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
136 */
137 void gnt_ws_widget_hide(GntWidget *widget, GHashTable *nodes);
138
139 /**
140 * gnt_ws_widget_show:
141 * @widget: The widget to show.
142 * @nodes: A hashtable containing information about the widgets.
143 *
144 * Show a widget in a workspace.
145 *
146 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
147 */
148 void gnt_ws_widget_show(GntWidget *widget, GHashTable *nodes);
149
150 /**
151 * gnt_ws_draw_taskbar:
152 * @ws: The workspace.
153 * @reposition: Whether the workspace should reposition the taskbar.
154 *
155 * Draw the taskbar in a workspace.
156 *
157 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
158 */
159 void gnt_ws_draw_taskbar(GntWS *ws, gboolean reposition);
160
161 /**
162 * gnt_ws_hide:
163 * @ws: The workspace to hide.
164 * @table: A hashtable containing information about the widgets.
165 *
166 * Hide a workspace.
167 *
168 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
169 */
170 void gnt_ws_hide(GntWS *ws, GHashTable *table);
171
172 /**
173 * gnt_ws_show:
174 * @ws: The workspace to hide.
175 * @table: A hashtable containing information about the widgets.
176 *
177 * Show a workspace.
178 *
179 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
180 */
181 void gnt_ws_show(GntWS *ws, GHashTable *table);
182
183 /**
184 * gnt_ws_get_name:
185 * @ws: The workspace.
186 *
187 * Get the name of a workspace.
188 *
189 * Returns: The name of the workspace (can be %NULL).
190 *
191 * Since: 2.0.0 (gnt), 2.1.0 (pidgin)
192 */
193 const char * gnt_ws_get_name(GntWS *ws);
194
195 #endif

mercurial