GladeWidgetClass

GladeWidgetClass — Object Class-wide metadata

Synopsis


#include <glade.h>


            GladeWidgetClass;
enum        GladeCreateReason;
void        (*GladePostCreateFunc)          (GObject *object,
                                             GladeCreateReason reason);
void        (*GladeChildSetPropertyFunc)    (GObject *container,
                                             GObject *child,
                                             const gchar *property_name,
                                             const GValue *value);
void        (*GladeChildGetPropertyFunc)    (GObject *container,
                                             GObject *child,
                                             const gchar *property_name,
                                             GValue *value);
GList*      (*GladeGetChildrenFunc)         (GObject *container);
void        (*GladeAddChildFunc)            (GObject *parent,
                                             GObject *child);
void        (*GladeRemoveChildFunc)         (GObject *parent,
                                             GObject *child);
void        (*GladeReplaceChildFunc)        (GObject *container,
                                             GObject *old,
                                             GObject *new);
void        (*GladeGetInternalFunc)         (GObject *parent,
                                             const gchar *name,
                                             GObject **child);
void        (*GladeEditorLaunchFunc)        (GObject *object);
GladeWidgetClass* glade_widget_class_new    (GladeXmlNode *class_node,
                                             const gchar *catname,
                                             const gchar *library,
                                             const gchar *domain);
void        glade_widget_class_free         (GladeWidgetClass *widget_class);
GladeWidgetClass* glade_widget_class_get_by_name
                                            (const char *name);
GladeWidgetClass* glade_widget_class_get_by_type
                                            (GType type);
GList*      glade_widget_class_get_derived_types
                                            (GType type);
void        glade_widget_class_dump_param_specs
                                            (GladeWidgetClass *class);
GladePropertyClass* glade_widget_class_get_property_class
                                            (GladeWidgetClass *class,
                                             const gchar *name);
GladeSupportedChild* glade_widget_class_get_child_support
                                            (GladeWidgetClass *class,
                                             GType child_type);
void        glade_widget_class_container_add
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *child);
void        glade_widget_class_container_remove
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *child);
gboolean    glade_widget_class_container_has_child
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *child);
GList*      glade_widget_class_container_get_children
                                            (GladeWidgetClass *class,
                                             GObject *container);
void        glade_widget_class_container_set_property
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *child,
                                             const gchar *property_name,
                                             const GValue *value);
void        glade_widget_class_container_get_property
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *child,
                                             const gchar *property_name,
                                             GValue *value);
void        glade_widget_class_container_replace_child
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *old,
                                             GObject *new);
gboolean    glade_widget_class_contains_extra
                                            (GladeWidgetClass *class);
GladePackingDefault* glade_widget_class_get_packing_default
                                            (GladeWidgetClass *child_class,
                                             GladeWidgetClass *container_class,
                                             const gchar *propert_id);


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 {
	GType type;          /* GType of the widget */

	gchar *name;         /* Name of the widget, for example GtkButton */

	gchar *catalog;      /* The name of the widget catalog this class
			      * was declared by.
			      */

	GdkPixbuf *icon;     /* The GdkPixbuf icon for the widget */

	gchar *generic_name; /* Use to generate names of new widgets, for
			      * example "button" so that we generate button1,
			      * button2, buttonX ..
			      */

	gchar *palette_name; /* Name used in the palette */

	GList *properties;   /* List of GladePropertyClass objects.
			      * [see glade-property.h ] this list contains
			      * properties about the widget that we are going
			      * to modify. Like "title", "label", "rows" .
			      * Each property creates an input in the propety
			      * editor.
			      */

	GList *signals;     /* List of GladeWidgetClassSignal objects */


	GList *children;    /* List of GladeSupportedChild objects */

        GList *child_packings; /* Default packing property values */

	GModule *module;	/* Module with the (optional) special functions
				 * needed for placeholder_replace, post_create_function
				 * and the set & get functions of the properties
				 * of this class.
				 */

	/* Executed after widget creation: it takes care of creating the
	 * GladeWidgets associated with internal children. It's also the place
	 * to set sane defaults, e.g. set the size of a window.
	 */
	GladePostCreateFunc           post_create_function;

	/* Retrieves the the internal child of the given name.
	 */
	GladeGetInternalFunc          get_internal_child;

	/* Entry point for custom editors.
	 */
	GladeEditorLaunchFunc         launch_editor;
} GladeWidgetClass;


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)          (GObject *object,
                                             GladeCreateReason reason);

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

object : a GObject
reason : a GladeCreateReason

GladeChildSetPropertyFunc ()

void        (*GladeChildSetPropertyFunc)    (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.

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

GladeChildGetPropertyFunc ()

void        (*GladeChildGetPropertyFunc)    (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.

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

GladeGetChildrenFunc ()

GList*      (*GladeGetChildrenFunc)         (GObject *container);

A function called to get containers children.

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

GladeAddChildFunc ()

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

Called to add child to parent.

parent : A GObject container
child : A GObject child

GladeRemoveChildFunc ()

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

Called to remove child from parent.

parent : A GObject container
child : A GObject child

GladeReplaceChildFunc ()

void        (*GladeReplaceChildFunc)        (GObject *container,
                                             GObject *old,
                                             GObject *new);

Called to swap placeholders with project objects in containers.

container : A GObject container
old : The old GObject child
new : The new GObject child to take its place

GladeGetInternalFunc ()

void        (*GladeGetInternalFunc)         (GObject *parent,
                                             const gchar *name,
                                             GObject **child);

Called to lookup child in composite object parent by name.

parent : A GObject composite object
name : A string identifier
child : A return location for a GObject

GladeEditorLaunchFunc ()

void        (*GladeEditorLaunchFunc)        (GObject *object);

Called to launch a custom editor for object

object : A GObject

glade_widget_class_new ()

GladeWidgetClass* glade_widget_class_new    (GladeXmlNode *class_node,
                                             const gchar *catname,
                                             const gchar *library,
                                             const gchar *domain);

class_node :
catname :
library :
domain :
Returns :

glade_widget_class_free ()

void        glade_widget_class_free         (GladeWidgetClass *widget_class);

Frees widget_class and its associated memory.

widget_class : a GladeWidgetClass

glade_widget_class_get_by_name ()

GladeWidgetClass* glade_widget_class_get_by_name
                                            (const char *name);

name : name of the widget class (for instance: GtkButton)
Returns : an existing GladeWidgetClass with the name equaling name, or NULL if such a class doesn't exist

glade_widget_class_get_by_type ()

GladeWidgetClass* glade_widget_class_get_by_type
                                            (GType type);

type :
Returns :

glade_widget_class_get_derived_types ()

GList*      glade_widget_class_get_derived_types
                                            (GType type);

type :
Returns :

glade_widget_class_dump_param_specs ()

void        glade_widget_class_dump_param_specs
                                            (GladeWidgetClass *class);

Dump to the console the properties of class as specified by gtk+. You can also run glade3 with : "glade-3 --dump GtkWindow" to get dump a widget class properties.

class : a GladeWidgetClass

glade_widget_class_get_property_class ()

GladePropertyClass* glade_widget_class_get_property_class
                                            (GladeWidgetClass *class,
                                             const gchar *name);

class : a GladeWidgetClass
name : a string
Returns : The GladePropertyClass object if there is one associated to this widget class.

glade_widget_class_get_child_support ()

GladeSupportedChild* glade_widget_class_get_child_support
                                            (GladeWidgetClass *class,
                                             GType child_type);

class : a GladeWidgetClass
child_type : a GType
Returns : The GladeSupportedChild object appropriate to use for container vfuncs for this child_type if this child type is supported, otherwise NULL.

glade_widget_class_container_add ()

void        glade_widget_class_container_add
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *child);

class :
container :
child :

glade_widget_class_container_remove ()

void        glade_widget_class_container_remove
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *child);

class :
container :
child :

glade_widget_class_container_has_child ()

gboolean    glade_widget_class_container_has_child
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *child);

class :
container :
child :
Returns :

glade_widget_class_container_get_children ()

GList*      glade_widget_class_container_get_children
                                            (GladeWidgetClass *class,
                                             GObject *container);

class :
container :
Returns :

glade_widget_class_container_set_property ()

void        glade_widget_class_container_set_property
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *child,
                                             const gchar *property_name,
                                             const GValue *value);

class :
container :
child :
property_name :
value :

glade_widget_class_container_get_property ()

void        glade_widget_class_container_get_property
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *child,
                                             const gchar *property_name,
                                             GValue *value);

class :
container :
child :
property_name :
value :

glade_widget_class_container_replace_child ()

void        glade_widget_class_container_replace_child
                                            (GladeWidgetClass *class,
                                             GObject *container,
                                             GObject *old,
                                             GObject *new);

class :
container :
old :
new :

glade_widget_class_contains_extra ()

gboolean    glade_widget_class_contains_extra
                                            (GladeWidgetClass *class);

class :
Returns :

glade_widget_class_get_packing_default ()

GladePackingDefault* glade_widget_class_get_packing_default
                                            (GladeWidgetClass *child_class,
                                             GladeWidgetClass *container_class,
                                             const gchar *propert_id);

child_class :
container_class :
propert_id :
Returns :