## Libglade SAX Parser

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

## Synopsis

    #include <glade/glade-parser.h>

    struct      GladeInterface;
    struct      GladeWidgetInfo;
    struct      GladeChildInfo;
    struct      GladeProperty;
    struct      GladeSignalInfo;
    struct      GladeAccelInfo;
    struct      GladeAtkActionInfo;
    struct      GladeAtkRelationInfo;

    GladeInterface* glade_parser_parse_file     (const gchar *file,
                                                 const gchar *domain);
    GladeInterface* glade_parser_parse_buffer   (const gchar *buffer,
                                                 gint len,
                                                 const gchar *domain);
    void        glade_interface_destroy         (GladeInterface *interface);
    void        glade_interface_dump            (GladeInterface *interface,
                                                 const gchar *filename);

## 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

### struct GladeInterface

    struct GladeInterface {

        gchar **requires;
        guint n_requires;

        GladeWidgetInfo **toplevels;
        guint n_toplevels;

        GHashTable *names;

        GHashTable *strings;
    };

### struct GladeWidgetInfo

    struct GladeWidgetInfo {

        GladeWidgetInfo *parent;

        gchar *classname;
        gchar *name;

        GladeProperty *properties;
        guint n_properties;

        GladeProperty *atk_props;
        guint n_atk_props;

        GladeSignalInfo *signals;
        guint n_signals;

        GladeAtkActionInfo *atk_actions;
        guint n_atk_actions;

        GladeAtkRelationInfo *relations;
        guint n_relations;

        GladeAccelInfo *accels;
        guint n_accels;

        GladeChildInfo *children;
        guint n_children;
    };

### struct GladeChildInfo

    struct GladeChildInfo {

        GladeProperty *properties;
        guint n_properties;

        GladeWidgetInfo *child;
        gchar *internal_child;
    };

### struct GladeProperty

    struct GladeProperty {

        gchar *name;
        gchar *value;
    };

### struct GladeSignalInfo

    struct GladeSignalInfo {

        gchar *name;
        gchar *handler;
        gchar *object; /* NULL if this isn't a connect_object signal */
        guint after : 1;
    };

### struct GladeAccelInfo

    struct GladeAccelInfo {

        guint key;
        GdkModifierType modifiers;
        gchar *signal;
    };

### struct GladeAtkActionInfo

    struct GladeAtkActionInfo {

        gchar *action_name;
        gchar *description;
    };

### struct GladeAtkRelationInfo

    struct GladeAtkRelationInfo {

        gchar *target;
        gchar *type;
    };

### glade_parser_parse_file ()

    GladeInterface* glade_parser_parse_file     (const gchar *file,
                                                 const gchar *domain);

This function parses a Glade XML interface file to a GladeInterface object (which is libglade's internal representation of the interface data).

Generally, user code won't need to call this function. Instead, it should go through the GladeXML interfaces.

`file` : | the filename of the glade XML file.
`domain` : | the translation domain for the XML file.
Returns : | the GladeInterface structure for the XML file.

### glade_parser_parse_buffer ()

    GladeInterface* glade_parser_parse_buffer   (const gchar *buffer,
                                                 gint len,
                                                 const gchar *domain);

This function is similar to glade_parser_parse_file, except that it parses XML data from a buffer in memory. This could be used to embed an interface into the executable, for instance.

Generally, user code won't need to call this function. Instead, it should go through the GladeXML interfaces.

`buffer` : | a buffer in memory containing XML data.
`len` : | the length of `buffer`.
`domain` : | the translation domain for the XML file.
Returns : | the GladeInterface structure for the XML buffer.

### glade_interface_destroy ()

    void        glade_interface_destroy         (GladeInterface *interface);

Frees a GladeInterface structure.

`interface` : | the GladeInterface structure.

### glade_interface_dump ()

    void        glade_interface_dump            (GladeInterface *interface,
                                                 const gchar *filename);

This function dumps the contents of a GladeInterface into a file as XML. It is intended mainly as a debugging tool.

`interface` : | the GladeInterface
`filename` : | the filename to write the interface data to.