1 /*
2 * This file is a part of the Cairo-Dock project
3 *
4 * Copyright : (C) see the 'copyright' file.
5 * E-mail    : see the 'copyright' file.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef __CAIRO_DOCK_WIDGET__
21 #define  __CAIRO_DOCK_WIDGET__
22 
23 #include <gtk/gtk.h>
24 #include "cairo-dock-struct.h"
25 G_BEGIN_DECLS
26 
27 
28 typedef struct _CDWidget CDWidget;
29 
30 typedef enum {
31 	WIDGET_UNKNOWN,
32 	WIDGET_CONFIG_GROUP,
33 	WIDGET_CONFIG,
34 	WIDGET_ITEMS,
35 	WIDGET_MODULE,
36 	WIDGET_PLUGINS,
37 	WIDGET_SHORTKEYS,
38 	WIDGET_THEMES,
39 	WIDGET_NB_TYPES,
40 } CDWidgetType;
41 
42 struct _CDWidget {
43 	CDWidgetType iType;
44 	GtkWidget *pWidget;
45 	void (*apply) (CDWidget *pWidget);
46 	void (*reset) (CDWidget *pWidget);
47 	void (*reload) (CDWidget *pWidget);  // reload, possibly destroying the GTK widget.
48 	//gboolean (*represents_module_instance) (GldiModuleInstance *pInstance);
49 	//CairoDockGroupKeyWidget* (*get_widget_from_name) (GldiModuleInstance *pInstance, const gchar *cGroupName, const gchar *cKeyName);
50 	GSList *pWidgetList;
51 	GPtrArray *pDataGarbage;
52 };
53 
54 #define CD_WIDGET(w) ((CDWidget*)(w))
55 
56 
57 void cairo_dock_widget_apply (CDWidget *pCdWidget);
58 
59 
60 gboolean cairo_dock_widget_can_apply (CDWidget *pCdWidget);
61 
62 
63 void cairo_dock_widget_reload (CDWidget *pCdWidget);
64 
65 
66 void cairo_dock_widget_free (CDWidget *pCdWidget);
67 
68 
69 void cairo_dock_widget_destroy_widget (CDWidget *pCdWidget);
70 
71 
72 G_END_DECLS
73 #endif
74