GladeWidgetClass

GladeWidgetClass — Object Class-wide metadata

Synopsis


#include <glade.h>


            GladeWidgetClass;
            GladeSignalClass;
enum        GladeCreateReason;
void        (*GladePostCreateFunc)          (GladeWidgetAdaptor *adaptor,
                                             GObject *object,
                                             GladeCreateReason reason);
void        (*GladeChildSetPropertyFunc)    (GladeWidgetAdaptor *adaptor,
                                             GObject *container,
                                             GObject *child,
                                             const gchar *property_name,
                                             const GValue *value);
void        (*GladeChildGetPropertyFunc)    (GladeWidgetAdaptor *adaptor,
                                             GObject *container,
                                             GObject *child,
                                             const gchar *property_name,
                                             GValue *value);
GList*      (*GladeGetChildrenFunc)         (GladeWidgetAdaptor *adaptor,
                                             GObject *container);
void        (*GladeAddChildFunc)            (GladeWidgetAdaptor *adaptor,
                                             GObject *parent,
                                             GObject *child);
void        (*GladeRemoveChildFunc)         (GladeWidgetAdaptor *adaptor,
                                             GObject *parent,
                                             GObject *child);
void        (*GladeReplaceChildFunc)        (GladeWidgetAdaptor *adaptor,
                                             GObject *container,
                                             GObject *old_obj,
                                             GObject *new_obj);
GObject*    (*GladeGetInternalFunc)         (GladeWidgetAdaptor *adaptor,
                                             GObject *parent,
                                             const gchar *name);
void        (*GladeEditorLaunchFunc)        (GladeWidgetAdaptor *adaptor,
                                             GObject *object);


Description

GladeWidgetClass is a structure based on a GType and parameters from the Glade catalog files and is the central metadata for object classes; it also provides an abstraction later to container apis.

Details

GladeWidgetClass

typedef struct {
	GObjectClass parent_class;

	void         (*add_child)               (GladeWidget *, GladeWidget *, gboolean);
	void         (*remove_child)            (GladeWidget *, GladeWidget *);
	void         (*replace_child)           (GladeWidget *, GObject *, GObject *);

	void         (*add_signal_handler)	(GladeWidget *, GladeSignal *);
	void         (*remove_signal_handler)	(GladeWidget *, GladeSignal *);
	void         (*change_signal_handler)	(GladeWidget *, GladeSignal *, GladeSignal *);
	gboolean     (*action_activated)        (GladeWidget *, const gchar *);
	
	gint         (*button_press_event)      (GladeWidget *, GdkEvent *);
	gint         (*button_release_event)    (GladeWidget *, GdkEvent *);
	gint         (*motion_notify_event)     (GladeWidget *, GdkEvent *);

	gboolean     (*event)                   (GladeWidget *, GdkEvent *);
} GladeWidgetClass;


GladeSignalClass

typedef struct {
	GSignalQuery query;

	const gchar *name;         /* Name of the signal, eg clicked */
	gchar       *type;         /* Name of the object class that this signal belongs to
				    * eg GtkButton */
} GladeSignalClass;


enum GladeCreateReason

typedef enum _GladeCreateReason
{
	GLADE_CREATE_USER = 0,
	GLADE_CREATE_COPY,
	GLADE_CREATE_LOAD,
	GLADE_CREATE_REBUILD,
	GLADE_CREATE_REASONS
} GladeCreateReason;

These are the reasons your GladePostCreateFunc can be called.

GLADE_CREATE_USER Was created at the user's request (this is a good time to set any properties or add children to the project; like GtkFrame's label for example).
GLADE_CREATE_COPY Was created as a result of the copy/paste mechanism, at this point you can count on glade to follow up with properties and children on its own.
GLADE_CREATE_LOAD Was created during the load process.
GLADE_CREATE_REBUILD Was created as a replacement for another project object; this only happens when the user is changing a property that is marked by the type system as G_PARAM_SPEC_CONSTRUCT_ONLY.
GLADE_CREATE_REASONS Never used.

GladePostCreateFunc ()

void        (*GladePostCreateFunc)          (GladeWidgetAdaptor *adaptor,
                                             GObject *object,
                                             GladeCreateReason reason);

This function is called exactly once for any project object instance and can be for any GladeCreateReason.

adaptor :
object : a GObject
reason : a GladeCreateReason

GladeChildSetPropertyFunc ()

void        (*GladeChildSetPropertyFunc)    (GladeWidgetAdaptor *adaptor,
                                             GObject *container,
                                             GObject *child,
                                             const gchar *property_name,
                                             const GValue *value);

Called to set the packing property property_name to value on the child object of container.

adaptor : A GladeWidgetAdaptor
container : The GObject container
child : The GObject child
property_name : The property name
value : The GValue

GladeChildGetPropertyFunc ()

void        (*GladeChildGetPropertyFunc)    (GladeWidgetAdaptor *adaptor,
                                             GObject *container,
                                             GObject *child,
                                             const gchar *property_name,
                                             GValue *value);

Called to get the packing property property_name on the child object of container into value.

adaptor : A GladeWidgetAdaptor
container : The GObject container
child : The GObject child
property_name : The property name
value : The GValue

GladeGetChildrenFunc ()

GList*      (*GladeGetChildrenFunc)         (GladeWidgetAdaptor *adaptor,
                                             GObject *container);

A function called to get containers children.

adaptor :
container : A GObject container
Returns : A GList of GObject children.

GladeAddChildFunc ()

void        (*GladeAddChildFunc)            (GladeWidgetAdaptor *adaptor,
                                             GObject *parent,
                                             GObject *child);

Called to add child to parent.

adaptor :
parent : A GObject container
child : A GObject child

GladeRemoveChildFunc ()

void        (*GladeRemoveChildFunc)         (GladeWidgetAdaptor *adaptor,
                                             GObject *parent,
                                             GObject *child);

Called to remove child from parent.

adaptor :
parent : A GObject container
child : A GObject child

GladeReplaceChildFunc ()

void        (*GladeReplaceChildFunc)        (GladeWidgetAdaptor *adaptor,
                                             GObject *container,
                                             GObject *old_obj,
                                             GObject *new_obj);

Called to swap placeholders with project objects in containers.

adaptor :
container : A GObject container
old_obj :
new_obj :

GladeGetInternalFunc ()

GObject*    (*GladeGetInternalFunc)         (GladeWidgetAdaptor *adaptor,
                                             GObject *parent,
                                             const gchar *name);

Called to lookup child in composite object parent by name.

adaptor :
parent : A GObject composite object
name : A string identifier
Returns :

GladeEditorLaunchFunc ()

void        (*GladeEditorLaunchFunc)        (GladeWidgetAdaptor *adaptor,
                                             GObject *object);

Called to launch a custom editor for object

adaptor :
object : A GObject