1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
6 * This file is part of gmidimonitor
8 * Copyright (C) 2005,2006,2007,2008 Nedko Arnaudov <nedko@arnaudov.name>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23 *****************************************************************************/
27 #include <glade/glade.h>
33 glade_signal_connect_func(
34 const gchar
*cb_name
, GObject
*obj
,
35 const gchar
*signal_name
, const gchar
*signal_data
,
36 GObject
*conn_obj
, gboolean conn_after
,
39 /** Module with all the symbols of the program */
40 static GModule
*mod_self
= NULL
;
41 gpointer handler_func
;
43 /* initialize gmodule */
46 mod_self
= g_module_open(NULL
, 0);
47 g_assert(mod_self
!= NULL
);
48 /* g_warning("%p", mod_self); */
51 /* g_print("glade_signal_connect_func:" */
52 /* " cb_name = '%s', signal_name = '%s', " */
53 /* "signal_data = '%s', obj = 0x%08X, conn_after = %s\n", */
54 /* cb_name, signal_name, */
55 /* signal_data, (unsigned int)obj, conn_after?"true":"false"); */
57 /* g_warning("%s", g_module_name(mod_self)); */
59 if (!g_module_symbol(mod_self
, cb_name
, &handler_func
))
61 g_warning("callback function not found: %s", cb_name
);
70 g_signal_connect_object(
79 g_signal_connect_object(
89 /* no conn_obj; use standard connect */
96 g_signal_connect_after(
114 construct_glade_widget(
117 gchar
* glade_filename
;
121 glade_filename
= path_get_data_filename("gmidimonitor.glade");
122 if (glade_filename
== NULL
)
124 g_warning("Cannot find glade UI description file.");
128 /* load the interface */
129 xml
= glade_xml_new(glade_filename
, id
, NULL
);
131 g_free(glade_filename
);
133 widget
= glade_xml_get_widget(xml
, id
);
135 /* connect the signals in the interface */
136 glade_xml_signal_autoconnect_full(
138 (GladeXMLConnectFunc
)glade_signal_connect_func
,
145 get_glade_widget_child(
152 xml
= glade_get_widget_tree(root
);
154 widget
= glade_xml_get_widget(xml
, id
);