1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
8 * GNU GENERAL PUBLIC LICENSE version 2
10 *****************************************************************************/
14 #include <glade/glade.h>
20 glade_signal_connect_func(
21 const gchar
*cb_name
, GObject
*obj
,
22 const gchar
*signal_name
, const gchar
*signal_data
,
23 GObject
*conn_obj
, gboolean conn_after
,
26 /** Module with all the symbols of the program */
27 static GModule
*mod_self
= NULL
;
28 gpointer handler_func
;
30 /* initialize gmodule */
33 mod_self
= g_module_open(NULL
, 0);
34 g_assert(mod_self
!= NULL
);
37 /* g_print("glade_signal_connect_func:" */
38 /* " cb_name = '%s', signal_name = '%s', " */
39 /* "signal_data = '%s', obj = 0x%08X, conn_after = %s\n", */
40 /* cb_name, signal_name, */
41 /* signal_data, (unsigned int)obj, conn_after?"true":"false"); */
43 if (g_module_symbol(mod_self
, cb_name
, &handler_func
))
50 g_signal_connect_object(
59 g_signal_connect_object(
69 /* no conn_obj; use standard connect */
76 g_signal_connect_after(
94 g_warning("callback function not found: %s", cb_name
);
99 construct_glade_widget(
102 gchar
* glade_filename
;
106 glade_filename
= path_get_data_filename("gmidimonitor.glade");
107 if (glade_filename
== NULL
)
109 g_warning("Cannot find glade UI description file.");
113 /* load the interface */
114 xml
= glade_xml_new(glade_filename
, id
, NULL
);
116 g_free(glade_filename
);
118 widget
= glade_xml_get_widget(xml
, id
);
120 /* connect the signals in the interface */
121 glade_xml_signal_autoconnect_full(
123 (GladeXMLConnectFunc
)glade_signal_connect_func
,
130 get_glade_widget_child(
137 xml
= glade_get_widget_tree(root
);
139 widget
= glade_xml_get_widget(xml
, id
);