Libglade SAX Parser

Name

Libglade SAX Parser -- Declarations and routines for accessing the SAX based parser.

Synopsis


#include <glade/glade-widget-tree.h>


                    GladeWidgetTree;
                    GladeStyleInfo;
                    GladeWidgetInfo;
                    GladeAttribute;
                    GladeSignalInfo;
                    GladeAcceleratorInfo;

GladeWidgetTree*    glade_widget_tree_parse_file        (const char *file);
GladeWidgetTree*    glade_widget_tree_parse_memory      (char *buffer,
                                                         int size);
GladeWidgetTree*    glade_widget_tree_ref               (GladeWidgetTree *tree);
void                glade_widget_tree_unref             (GladeWidgetTree *tree);
void                glade_widget_tree_print             (GladeWidgetTree *tree);

Description

The structures described here are the output of libglade's XML parser. These structures are really only useful for people who are extending libglade to handle other widget sets, but it could also be useful for other applications that need to read glade XML files.

If you only wish to use libglade, you don't need to worry about these functions and structures.

Details

GladeWidgetTree

typedef struct {
    guint ref;
    GTime mtime;
    GList *styles;
    GList *widgets;
    GHashTable *names;
} GladeWidgetTree;


GladeStyleInfo

typedef struct {
    gchar *name;
    gchar *rc_name;
    gboolean local : 1;
} GladeStyleInfo;


GladeWidgetInfo

typedef struct {
    GladeWidgetInfo *parent;

    gchar *class;
    gchar *name;
    gchar *tooltip;

    gint width, height;
    gint border_width;

    /* bit field */
    gboolean visible : 1;
    gboolean sensitive : 1;
    gboolean can_default : 1;
    gboolean can_focus : 1;
    gboolean has_default : 1;
    gboolean has_focus : 1;

    GladeStyleInfo *style;

    /* lists of GladeAttribute's */
    GList *attributes;
    GList *child_attributes; /* for the <child></child> section */

    GList *signals;
    GList *accelerators;

    GList *children;
} GladeWidgetInfo;


GladeAttribute

typedef struct {
    gchar *name;
    gchar *value;
} GladeAttribute;


GladeSignalInfo

typedef struct {
    gchar *name;
    gchar *handler;
    gchar *data;
    gchar *object; /* NULL if this isn't a connect_object signal */
    gboolean after : 1;
} GladeSignalInfo;


GladeAcceleratorInfo

typedef struct {
    guint key;
    GdkModifierType modifiers;
    gchar *signal;
} GladeAcceleratorInfo;


glade_widget_tree_parse_file ()

GladeWidgetTree*    glade_widget_tree_parse_file        (const char *file);

This routine will parse a file containing Glade XML, and produce a GladeWidgetTree structure containing the information in this file.

file :

the filename of the XML file to parse.

Returns :

the GladeWidgetTree structure, or NULL on error.


glade_widget_tree_parse_memory ()

GladeWidgetTree*    glade_widget_tree_parse_memory      (char *buffer,
                                                         int size);

This routine will parse an in memory buffer containing Glade XML, and produce a GladeWidgetTree structure containing the information in this buffer.

buffer :

the in memory buffer holding the XML document

size :

the size of the buffer

Returns :

the GladeWidgetTree structure, or NULL on error.


glade_widget_tree_ref ()

GladeWidgetTree*    glade_widget_tree_ref               (GladeWidgetTree *tree);

Increment the reference count of a GladeWidgetTree structure.

tree :

the GladeWidgetTree structure

Returns :

the tree argument.


glade_widget_tree_unref ()

void                glade_widget_tree_unref             (GladeWidgetTree *tree);

Decrement the reference count of a GladeWidgetTree structure.

tree :

the GladeWidgetTree structure


glade_widget_tree_print ()

void                glade_widget_tree_print             (GladeWidgetTree *tree);

Prints out the information stored in the GladeWidgetTree structure. This is mainly for debugging to make sure that the parser is producing correct output.

tree :

the widget tree.