1 | LIBGLADE |
---|
2 | ======== |
---|
3 | |
---|
4 | Author: James Henstridge <james@daa.com.au> |
---|
5 | |
---|
6 | This library allows you to load glade interface files in a program at |
---|
7 | runtime. It doesn't require GLADE to be used, but GLADE is by far the |
---|
8 | easiest way to create the interface files. |
---|
9 | |
---|
10 | For an idea of how to use the library, see test-libglade.c and |
---|
11 | glade/glade-xml.h. |
---|
12 | |
---|
13 | To compile, you will need the libxml2 package (aka the gnome-xml |
---|
14 | module in CVS) which can be found on the GNOME FTP site or its |
---|
15 | mirrors. If you want GNOME support, you will also need the gnome-libs |
---|
16 | package installed. |
---|
17 | |
---|
18 | |
---|
19 | LIBGLADE INTERNALS |
---|
20 | ================== |
---|
21 | |
---|
22 | If you are interested in how libglade works, here is a small |
---|
23 | description: |
---|
24 | |
---|
25 | When glade_xml_new is called, the XML file is loaded using libxml. |
---|
26 | Libglade uses the SAX interface because it is faster and allows me to |
---|
27 | store the data in a more compact representation. The data in the XML |
---|
28 | file is cached, so that if you load the interface again, the file does |
---|
29 | not need to be reparsed. If the file has changed though, it will be |
---|
30 | reparsed. |
---|
31 | |
---|
32 | Now glade_xml_build_widget is called for all the toplevel widgets in |
---|
33 | the interface (or if the second argument to glade_xml_new was non |
---|
34 | NULL, the widget it refers to is treated as the toplevel). |
---|
35 | |
---|
36 | For each of these widgets, they are created by a function specific to |
---|
37 | the widget type, and then glade_xml_build_widget is called for each |
---|
38 | child widget, which is then packed into its parent. This is done |
---|
39 | recursively, so the whole interface is constructed. |
---|
40 | |
---|
41 | New widget types are added to the widget class hash with the |
---|
42 | glade_register_widgets function. For an example, see the end of |
---|
43 | glade-gtk.c. |
---|
44 | |
---|
45 | The automatic signal connection system uses the introspective |
---|
46 | capabilities of dynamic linking. By openning a handle on NULL, we can |
---|
47 | get at all the global symbols (global functions, global variables) in |
---|
48 | the executable, and the libraries it is linked against. This is used |
---|
49 | to find the address of a signal handler from its name, so that |
---|
50 | gtk_signal_connect can be called automatically for you. |
---|
51 | |
---|
52 | Of course, there are other ways of connecting the signals if your |
---|
53 | platform doesn't support this feature. |
---|