blob: ff78f96a4f31379893e384b0a8c222101d2707a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#include <glib.h>
// Disable the 'const' function attribute of the get_type() functions.
// GCC would optimize them out because we don't use the return value.
#undef G_GNUC_CONST
#define G_GNUC_CONST /* empty */
#include <libglademm/wrap_init.h>
#include <glibmm/error.h>
#include <glibmm/object.h>
// #include the widget headers so that we can call the get_type() static methods:
#include "xml.h"
extern "C"
{
//Declarations of the *_get_type() functions:
GType glade_xml_get_type(void);
//Declarations of the *_error_quark() functions:
} // extern "C"
//Declarations of the *_Class::wrap_new() methods, instead of including all the private headers:
namespace Gnome { namespace Glade { class Xml_Class { public: static Glib::ObjectBase* wrap_new(GObject*); }; } }
namespace Gnome { namespace Glade {
void wrap_init()
{
// Register Error domains:
// Map gtypes to gtkmm wrapper-creation functions:
Glib::wrap_register(glade_xml_get_type(), &Gnome::Glade::Xml_Class::wrap_new);
// Register the gtkmm gtypes:
Gnome::Glade::Xml::get_type();
} // wrap_init()
} //Glade
} //Gnome
|