Add missing AUTHORS and ChangeLog.
[gnt.git] / gntws.h
blob262178a9ea9dd8965dae0e42b7c066356510315e
1 /**
2 * @file gntws.h Workspace API
3 * @ingroup gnt
4 */
5 /*
6 * GNT - The GLib Ncurses Toolkit
8 * GNT is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
12 * This library 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.
17 * This program 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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
27 #ifndef GNTWS_H
28 #define GNTWS_H
30 #include "gntwidget.h"
32 #include <panel.h>
34 #define GNT_TYPE_WS (gnt_ws_get_gtype())
35 #define GNT_WS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WS, GntWS))
36 #define GNT_IS_WS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_WS))
37 #define GNT_IS_WS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_WS))
38 #define GNT_WS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_WS, GntWSClass))
40 typedef struct _GntWS GntWS;
42 struct _GntWS
44 GntBindable inherit;
45 char *name;
46 GList *list;
47 GList *ordered;
48 gpointer ui_data;
50 void *res1;
51 void *res2;
52 void *res3;
53 void *res4;
56 typedef struct _GntWSClass GntWSClass;
58 struct _GntWSClass
60 GntBindableClass parent;
62 void (*draw_taskbar)(GntWS *ws, gboolean );
64 void (*res1)(void);
65 void (*res2)(void);
66 void (*res3)(void);
67 void (*res4)(void);
70 G_BEGIN_DECLS
72 /**
73 * @return The GType for GntWS.
75 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
77 GType gnt_ws_get_gtype(void);
79 /**
80 * Create a new workspace with the specified name.
82 * @param name The desired name of the workspace, or @c NULL.
84 * @return The newly created workspace.
86 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
88 GntWS *gnt_ws_new(const char *name);
90 /**
91 * Set the name of a workspace.
93 * @param ws The workspace to rename.
94 * @param name The new name of the workspace.
96 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
98 void gnt_ws_set_name(GntWS *ws, const gchar *name);
101 * Add a widget to a workspace.
103 * @param ws The workspace.
104 * @param widget The widget to add.
106 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
108 void gnt_ws_add_widget(GntWS *ws, GntWidget *widget);
111 * Remove a widget from a workspace.
113 * @param ws The workspace
114 * @param widget The widget to remove from the workspace.
116 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
118 void gnt_ws_remove_widget(GntWS *ws, GntWidget *widget);
121 * Hide a widget in a workspace.
123 * @param widget The widget to hide.
124 * @param nodes A hashtable containing information about the widgets.
126 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
128 void gnt_ws_widget_hide(GntWidget *widget, GHashTable *nodes);
131 * Show a widget in a workspace.
133 * @param widget The widget to show.
134 * @param nodes A hashtable containing information about the widgets.
136 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
138 void gnt_ws_widget_show(GntWidget *widget, GHashTable *nodes);
141 * Draw the taskbar in a workspace.
143 * @param ws The workspace.
144 * @param reposition Whether the workspace should reposition the taskbar.
146 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
148 void gnt_ws_draw_taskbar(GntWS *ws, gboolean reposition);
151 * Hide a workspace.
153 * @param ws The workspace to hide.
154 * @param table A hashtable containing information about the widgets.
156 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
158 void gnt_ws_hide(GntWS *ws, GHashTable *table);
161 * Show a workspace.
163 * @param ws The workspace to hide.
164 * @param table A hashtable containing information about the widgets.
166 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
168 void gnt_ws_show(GntWS *ws, GHashTable *table);
171 * Get the name of a workspace.
173 * @param ws The workspace.
174 * @return The name of the workspace (can be @c NULL).
176 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
178 const char * gnt_ws_get_name(GntWS *ws);
180 #endif