GladeWidgetAdaptor

GladeWidgetAdaptor — Adaptor base class to add runtime support for each widget class.

Functions

#define GWA_IS_TOPLEVEL()
#define GWA_USE_PLACEHOLDERS()
#define GWA_DEFAULT_WIDTH()
#define GWA_DEFAULT_HEIGHT()
#define GWA_GET_CLASS()
#define GWA_GET_OCLASS()
#define GWA_SCROLLABLE_WIDGET()
#define GLADE_VALID_CREATE_REASON()
void (*GladeActionActivateFunc) ()
GtkWidget * (*GladeActionSubmenuFunc) ()
void (*GladeAddChildFunc) ()
gboolean (*GladeAddChildVerifyFunc) ()
void (*GladeChildActionActivateFunc) ()
void (*GladeChildGetPropertyFunc) ()
void (*GladeChildSetPropertyFunc) ()
gboolean (*GladeChildVerifyPropertyFunc) ()
GObject * (*GladeConstructObjectFunc) ()
GladeEditable * (*GladeCreateEditableFunc) ()
GladeEditorProperty * (*GladeCreateEPropFunc) ()
GladeWidget * (*GladeCreateWidgetFunc) ()
gboolean (*GladeDependsFunc) ()
void (*GladeDestroyObjectFunc) ()
GList * (*GladeGetChildrenFunc) ()
GObject * (*GladeGetInternalFunc) ()
void (*GladeGetPropertyFunc) ()
void (*GladePostCreateFunc) ()
void (*GladeReadWidgetFunc) ()
void (*GladeRemoveChildFunc) ()
void (*GladeReplaceChildFunc) ()
void (*GladeSetPropertyFunc) ()
gchar * (*GladeStringFromValueFunc) ()
gboolean (*GladeVerifyPropertyFunc) ()
void (*GladeWriteWidgetFunc) ()
#define glade_widget_adaptor_create_widget()
GladeEditorProperty * glade_widget_adaptor_create_eprop ()
GladeWidgetAdaptor * glade_widget_adaptor_from_pspec ()
GladeWidgetAdaptor * glade_widget_adaptor_from_catalog ()
void glade_widget_adaptor_register ()
GladeWidget * glade_widget_adaptor_create_internal ()
GladeWidget * glade_widget_adaptor_create_widget_real ()
GladeWidgetAdaptor * glade_widget_adaptor_get_by_name ()
GladeWidgetAdaptor * glade_widget_adaptor_get_by_type ()
GladePropertyDef * glade_widget_adaptor_get_property_def ()
GladePropertyDef * glade_widget_adaptor_get_pack_property_def ()
GParameter * glade_widget_adaptor_default_params ()
void glade_widget_adaptor_post_create ()
GObject * glade_widget_adaptor_get_internal_child ()
void glade_widget_adaptor_set_property ()
void glade_widget_adaptor_get_property ()
gboolean glade_widget_adaptor_verify_property ()
void glade_widget_adaptor_add ()
void glade_widget_adaptor_remove ()
GList * glade_widget_adaptor_get_children ()
gboolean glade_widget_adaptor_has_child ()
void glade_widget_adaptor_child_set_property ()
void glade_widget_adaptor_child_get_property ()
gboolean glade_widget_adaptor_child_verify_property ()
void glade_widget_adaptor_replace_child ()
void glade_widget_adaptor_read_child ()
void glade_widget_adaptor_read_widget ()
void glade_widget_adaptor_write_child ()
void glade_widget_adaptor_write_widget ()
gboolean glade_widget_adaptor_query ()
const gchar * glade_widget_adaptor_get_packing_default ()
gboolean glade_widget_adaptor_is_container ()
gboolean glade_widget_adaptor_action_add ()
gboolean glade_widget_adaptor_pack_action_add ()
gboolean glade_widget_adaptor_action_remove ()
gboolean glade_widget_adaptor_pack_action_remove ()
GList * glade_widget_adaptor_pack_actions_new ()
void glade_widget_adaptor_action_activate ()
void glade_widget_adaptor_child_action_activate ()
gchar * glade_widget_adaptor_string_from_value ()
GtkWidget * glade_widget_adaptor_action_submenu ()
GList * glade_widget_adaptor_actions_new ()
gboolean glade_widget_adaptor_add_verify ()
GObject * glade_widget_adaptor_construct_object ()
GladeEditable * glade_widget_adaptor_create_editable ()
GladeEditorProperty * glade_widget_adaptor_create_eprop_by_name ()
gboolean glade_widget_adaptor_depends ()
void glade_widget_adaptor_destroy_object ()
const gchar * glade_widget_adaptor_get_book ()
const gchar * glade_widget_adaptor_get_catalog ()
const gchar * glade_widget_adaptor_get_display_name ()
const gchar * glade_widget_adaptor_get_generic_name ()
const gchar * glade_widget_adaptor_get_icon_name ()
const gchar * glade_widget_adaptor_get_missing_icon ()
const gchar * glade_widget_adaptor_get_name ()
GType glade_widget_adaptor_get_object_type ()
const GList * glade_widget_adaptor_get_packing_props ()
GladeWidgetAdaptor * glade_widget_adaptor_get_parent_adaptor ()
const GList * glade_widget_adaptor_get_properties ()
GladeSignalDef * glade_widget_adaptor_get_signal_def ()
const GList * glade_widget_adaptor_get_signals ()
const gchar * glade_widget_adaptor_get_title ()
gboolean glade_widget_adaptor_has_internal_children ()
GList * glade_widget_adaptor_list_adaptors ()
void glade_widget_adaptor_write_widget_after ()

Properties

gchar * book Read / Write / Construct Only
gchar * catalog Read / Write / Construct Only
gpointer cursor Read
gchar * generic-name Read / Write / Construct Only
gchar * icon-name Read / Write / Construct Only
gchar * name Read / Write / Construct Only
gboolean query Read / Write
gchar * special-child-type Read / Write / Construct Only
gchar * title Read / Write
GType * type Read / Write / Construct Only

Object Hierarchy

    GObject
    ╰── GladeWidgetAdaptor

Description

The GladeWidgetAdaptor object is a proxy for widget class support in Glade. it is automatically generated from the xml and allows you to override its methods in the plugin library for fine grained support on how you load/save widgets and handle their properties in the runtime and more.

Functions

GWA_IS_TOPLEVEL()

#define             GWA_IS_TOPLEVEL(obj)

Checks whether this widget class has been marked as a toplevel one.

Parameters


GWA_USE_PLACEHOLDERS()

#define             GWA_USE_PLACEHOLDERS(obj)

Checks whether this widget class has been marked to use placeholders in child widget operations

Parameters


GWA_DEFAULT_WIDTH()

#define             GWA_DEFAULT_WIDTH(obj)

Parameters

Returns

the default width to be used when this widget is toplevel in the GladeDesignLayout


GWA_DEFAULT_HEIGHT()

#define             GWA_DEFAULT_HEIGHT(obj)

Parameters

Returns

the default width to be used when this widget is toplevel in the GladeDesignLayout


GWA_GET_CLASS()

#define             GWA_GET_CLASS(type)

Shorthand for referencing glade adaptor classes from the plugin eg. GWA_GET_CLASS (GTK_TYPE_CONTAINER)->post_create (adaptor...

Parameters

type

A GType

 

GWA_GET_OCLASS()

#define GWA_GET_OCLASS(type) ((GObjectClass*)GWA_GET_CLASS(type))

Same as GWA_GET_CLASS but casted to GObjectClass

Parameters

type

A GType.

 

GWA_SCROLLABLE_WIDGET()

#define             GWA_SCROLLABLE_WIDGET(obj)

Checks whether this is a GtkWidgetClass with scrolling capabilities.

Parameters


GLADE_VALID_CREATE_REASON()

#define GLADE_VALID_CREATE_REASON(reason) (reason >= 0 && reason < GLADE_CREATE_REASONS)

GladeActionActivateFunc ()

void
(*GladeActionActivateFunc) (GladeWidgetAdaptor *adaptor,
                            GObject *object,
                            const gchar *action_path);

This delegate function is used to catch actions from the core.

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

action_path

The action path

 

GladeActionSubmenuFunc ()

GtkWidget *
(*GladeActionSubmenuFunc) (GladeWidgetAdaptor *adaptor,
                           GObject *object,
                           const gchar *action_path);

This delegate function is used to create dynamically customized submenus. Called only for actions that don't have children.

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

action_path

The action path

 

GladeAddChildFunc ()

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

Called to add child to container .

Parameters

adaptor

A GladeWidgetAdaptor

 

container

A GObject parent container

 

child

A GObject child

 

GladeAddChildVerifyFunc ()

gboolean
(*GladeAddChildVerifyFunc) (GladeWidgetAdaptor *adaptor,
                            GObject *container,
                            GObject *child,
                            gboolean user_feedback);

Checks whether child can be added to container .

If user_feedback is TRUE and child cannot be added then this shows a notification dialog to the user explaining why.

Parameters

adaptor

A GladeWidgetAdaptor

 

container

A GObject container

 

child

A GObject child

 

user_feedback

whether a notification dialog should be presented in the case that the child cannot not be added.

 

Returns

whether child can be added to container .


GladeChildActionActivateFunc ()

void
(*GladeChildActionActivateFunc) (GladeWidgetAdaptor *adaptor,
                                 GObject *container,
                                 GObject *object,
                                 const gchar *action_path);

This delegate function is used to catch packing actions from the core.

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GtkContainer

 

object

The GObject

 

action_path

The action path

 

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 .

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

child

The GObject child

 

property_name

The property name

 

value

The GValue

 

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 .

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

child

The GObject child

 

property_name

The property name

 

value

The GValue

 

GladeChildVerifyPropertyFunc ()

gboolean
(*GladeChildVerifyPropertyFunc) (GladeWidgetAdaptor *adaptor,
                                 GObject *container,
                                 GObject *child,
                                 const gchar *property_name,
                                 const GValue *value);

This delegate function is always called whenever setting any properties with the exception of load time, and copy/paste time (basically the two places where we recreate a hierarchy that we already know "works") its basically an optional backend provided boundary checker for properties.

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

child

The GObject child

 

property_name

The property name

 

value

The GValue

 

Returns

whether or not its OK to set value on object


GladeConstructObjectFunc ()

GObject *
(*GladeConstructObjectFunc) (GladeWidgetAdaptor *adaptor,
                             guint n_parameters,
                             GParameter *parameters);

This function is called to construct a GObject instance. (for language bindings that may need to construct a wrapper object).

Parameters

adaptor

A GladeWidgetAdaptor

 

n_parameters

amount of construct parameters

 

parameters

array of construct GParameter args to create the new object with.

 

Returns

A newly created GObject


GladeCreateEditableFunc ()

GladeEditable *
(*GladeCreateEditableFunc) (GladeWidgetAdaptor *adaptor,
                            GladeEditorPageType type);

This is used to allow the backend to override the way an editor page is layed out (note that editor widgets are created on demand and not at startup).

Parameters

adaptor

A GladeWidgetAdaptor

 

type

The GladeEditorPageType

 

Returns

A new GladeEditable widget


GladeCreateEPropFunc ()

GladeEditorProperty *
(*GladeCreateEPropFunc) (GladeWidgetAdaptor *adaptor,
                         GladePropertyDef *def,
                         gboolean use_command);

Creates a GladeEditorProperty to edit klass

Parameters

adaptor

A GladeWidgetAdaptor

 

def

The GladePropertyDef to be edited

 

use_command

whether to use the GladeCommand interface to commit property changes

 

Returns

A newly created GladeEditorProperty


GladeCreateWidgetFunc ()

GladeWidget *
(*GladeCreateWidgetFunc) (GladeWidgetAdaptor *adaptor,
                          const gchar *first_property_name,
                          va_list var_args);

This entry point allows the backend to create a specialized GladeWidget derived object for handling instances in the core.

Parameters

adaptor

A GladeWidgetAdaptor

 

first_property_name

the name of the first property

 

var_args

the value of the first property, followed optionally by more name/value pairs, followed by NULL

 

Returns

A newly created GladeWidget for the said adaptor.


GladeDependsFunc ()

gboolean
(*GladeDependsFunc) (GladeWidgetAdaptor *adaptor,
                     GladeWidget *widget,
                     GladeWidget *another);

Checks whether widget depends on another to be placed earlier in the glade file.

Parameters

adaptor

A GladeWidgetAdaptor

 

widget

A GladeWidget of the adaptor

 

another

another GladeWidget

 

Returns

whether widget depends on another being parsed first in the resulting glade file.


GladeDestroyObjectFunc ()

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

This function is called to break any additional references to a GObject instance. Note that this function is not responsible for calling g_object_unref() on object , the reference count of object belongs to it's GladeWidget wrapper.

The GtkWidget adaptor will call gtk_widget_destroy() before chaining up in this function.

If your adaptor adds any references in any way at GladePostCreateFunc time or GladeConstructObjectFunc time, then this function must be implemented to also remove that reference.

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject to destroy

 

GladeGetChildrenFunc ()

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

A function called to get containers children.

Parameters

adaptor

A GladeWidgetAdaptor

 

container

A GObject container

 

Returns

A GList of GObject children.


GladeGetInternalFunc ()

GObject *
(*GladeGetInternalFunc) (GladeWidgetAdaptor *adaptor,
                         GObject *object,
                         const gchar *internal_name);

Called to lookup child in composite object parent by internal_name .

Parameters

adaptor

A GladeWidgetAdaptor

 

object

A GObject composite object

 

internal_name

A string identifier

 

Returns

The specified internal widget.


GladeGetPropertyFunc ()

void
(*GladeGetPropertyFunc) (GladeWidgetAdaptor *adaptor,
                         GObject *object,
                         const gchar *property_name,
                         GValue *value);

Gets value on object for a given GladePropertyDef

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

property_name

The property identifier

 

value

The GValue

 

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.

Parameters

adaptor

A GladeWidgetAdaptor

 

object

a GObject

 

reason

a GladeCreateReason

 

GladeReadWidgetFunc ()

void
(*GladeReadWidgetFunc) (GladeWidgetAdaptor *adaptor,
                        GladeWidget *widget,
                        GladeXmlNode *node);

This function is called to update widget from node .

Parameters

adaptor

A GladeWidgetAdaptor

 

widget

The GladeWidget

 

node

The GladeXmlNode

 

GladeRemoveChildFunc ()

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

Called to remove child from container .

Parameters

adaptor

A GladeWidgetAdaptor

 

container

A GObject parent 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.

Parameters

adaptor

A GladeWidgetAdaptor

 

container

A GObject container

 

old_obj

The old GObject child

 

new_obj

The new GObject child to take its place

 

GladeSetPropertyFunc ()

void
(*GladeSetPropertyFunc) (GladeWidgetAdaptor *adaptor,
                         GObject *object,
                         const gchar *property_name,
                         const GValue *value);

This delegate function is used to apply the property value on the runtime object.

Sets value on object for a given GladePropertyDef

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

property_name

The property identifier

 

value

The GValue

 

GladeStringFromValueFunc ()

gchar *
(*GladeStringFromValueFunc) (GladeWidgetAdaptor *adaptor,
                             GladePropertyDef *def,
                             const GValue *value);

For normal properties this is used to serialize property values, for custom properties (only when new pspecs are introduced) its needed for value comparisons in boxed pspecs and also to update the UI for undo/redo items etc.

Parameters

adaptor

A GladeWidgetAdaptor

 

def

The GladePropertyDef

 

value

The GValue to convert to a string

 

Returns

A newly allocated string representation of value


GladeVerifyPropertyFunc ()

gboolean
(*GladeVerifyPropertyFunc) (GladeWidgetAdaptor *adaptor,
                            GObject *object,
                            const gchar *property_name,
                            const GValue *value);

This delegate function is always called whenever setting any properties with the exception of load time, and copy/paste time (basically the two places where we recreate a hierarchy that we already know "works") its basically an optional backend provided boundary checker for properties.

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

property_name

The property identifier

 

value

The GValue

 

Returns

whether or not its OK to set value on object


GladeWriteWidgetFunc ()

void
(*GladeWriteWidgetFunc) (GladeWidgetAdaptor *adaptor,
                         GladeWidget *widget,
                         GladeXmlContext *context,
                         GladeXmlNode *node);

This function is called to fill in node from widget .

Parameters

adaptor

A GladeWidgetAdaptor

 

widget

The GladeWidget

 

context

The GladeXmlContext

 

node

The GladeXmlNode

 

glade_widget_adaptor_create_widget()

#define             glade_widget_adaptor_create_widget(adaptor, query, ...)

This factory function returns a new GladeWidget of the correct type/class with the properties defined in @... and queries the user if nescisary.

The resulting object will have all default properties applied to it including the overrides specified in the catalog, unless the catalog has specified 'ignore' for that property.

Note that the widget class must be fed twice; once as the leading arg... and also as the property for the GladeWidget

Parameters

adaptor

a GladeWidgetAdaptor

 

query

whether to display query dialogs if applicable to the class

 

...

a NULL terminated list of string/value pairs of GladeWidget properties

 

Returns

the newly created GladeWidget.

[transfer full]


glade_widget_adaptor_create_eprop ()

GladeEditorProperty *
glade_widget_adaptor_create_eprop (GladeWidgetAdaptor *adaptor,
                                   GladePropertyDef *def,
                                   gboolean use_command);

Creates a GladeEditorProperty to edit def

Parameters

adaptor

A GladeWidgetAdaptor

 

def

The GladePropertyDef to be edited

 

use_command

whether to use the GladeCommand interface to commit property changes

 

Returns

A newly created GladeEditorProperty.

[transfer full]


glade_widget_adaptor_from_pspec ()

GladeWidgetAdaptor *
glade_widget_adaptor_from_pspec (GladeWidgetAdaptor *adaptor,
                                 GParamSpec *pspec);

Assumes pspec is a property in an object class wrapped by adaptor , this function will search for the specific parent adaptor class which originally introduced pspec .

Parameters

adaptor

a GladeWidgetAdaptor

 

pspec

a GParamSpec

 

Returns

the closest GladeWidgetAdaptor in the ancestry to adaptor which is responsable for introducing pspec .

[transfer none]


glade_widget_adaptor_from_catalog ()

GladeWidgetAdaptor *
glade_widget_adaptor_from_catalog (GladeCatalog *catalog,
                                   GladeXmlNode *class_node,
                                   GModule *module);

Dynamically creates a subclass of GladeWidgetAdaptor and subclasses the closest parent adaptor (parent class adapters must be created/registered prior to child classes, otherwise inheritance wont work) and parses in the relevant catalog info.

Parameters

catalog

A GladeCatalog

 

class_node

the GladeXmlNode to load

 

module

the plugin GModule.

 

Returns

a newly allocated GladeWidgetAdaptor.

[transfer full]


glade_widget_adaptor_register ()

void
glade_widget_adaptor_register (GladeWidgetAdaptor *adaptor);

Registers adaptor into the Glade core (every supported object type must have a registered adaptor).

Parameters

adaptor

A GladeWidgetAdaptor

 

glade_widget_adaptor_create_internal ()

GladeWidget *
glade_widget_adaptor_create_internal (GladeWidget *parent,
                                      GObject *internal_object,
                                      const gchar *internal_name,
                                      const gchar *parent_name,
                                      gboolean anarchist,
                                      GladeCreateReason reason);

A convenience function to create a GladeWidget of the prescribed type for internal widgets.

Parameters

parent

The parent GladeWidget, or NULL for children outside of the hierarchy.

 

internal_object

the GObject

 

internal_name

a string identifier for this internal widget.

 

parent_name

the generic name of the parent used for fancy child names.

 

anarchist

Whether or not this widget is a widget outside of the parent's hierarchy (like a popup window)

 

reason

The GladeCreateReason for which this internal widget was created (usually just pass the reason from the post_create function; note also this is used only by the plugin code so pass something useful here).

 

Returns

a freshly created GladeWidget wrapper object for the internal_object of name internal_name .

[transfer full]


glade_widget_adaptor_create_widget_real ()

GladeWidget *
glade_widget_adaptor_create_widget_real
                               (gboolean query,
                                const gchar *first_property,
                                ...);

The macro glade_widget_adaptor_create_widget() uses this function glade_widget_adaptor_create_widget_real(query , "adaptor", adaptor, @...)

Use glade_widget_adaptor_create_widget() in C as this function is mostly available for languages where macros are not available.

Parameters

query

whether to display query dialogs if applicable to the class

 

first_property

the first property of @...

 

...

a NULL terminated list of string/value pairs of GladeWidget properties

 

Returns

the newly created GladeWidget.

[transfer full]


glade_widget_adaptor_get_by_name ()

GladeWidgetAdaptor *
glade_widget_adaptor_get_by_name (const gchar *name);

Parameters

name

name of the widget class (for instance: GtkButton)

 

Returns

an existing GladeWidgetAdaptor with the name equaling name , or NULL if such a class doesn't exist.

[transfer none][nullable]


glade_widget_adaptor_get_by_type ()

GladeWidgetAdaptor *
glade_widget_adaptor_get_by_type (GType type);

Parameters

type

the GType of an object class

 

Returns

an existing GladeWidgetAdaptor with the type equaling type , or NULL if such a class doesn't exist.

[transfer none][nullable]


glade_widget_adaptor_get_property_def ()

GladePropertyDef *
glade_widget_adaptor_get_property_def (GladeWidgetAdaptor *adaptor,
                                       const gchar *name);

Retrieves the GladePropertyDef for name in adaptor

Parameters

adaptor

a GladeWidgetAdaptor

 

name

a string

 

Returns

A GladePropertyDef object.

[transfer none][nullable]


glade_widget_adaptor_get_pack_property_def ()

GladePropertyDef *
glade_widget_adaptor_get_pack_property_def
                               (GladeWidgetAdaptor *adaptor,
                                const gchar *name);

Retrieves the GladePropertyDef for name in adaptor 's child properties

Parameters

adaptor

a GladeWidgetAdaptor

 

name

a string

 

Returns

A GladePropertyDef object.

[transfer none][nullable]


glade_widget_adaptor_default_params ()

GParameter *
glade_widget_adaptor_default_params (GladeWidgetAdaptor *adaptor,
                                     gboolean construct,
                                     guint *n_params);

glade_widget_adaptor_post_create ()

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

An adaptor function to be called after the object is created

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

reason

The GladeCreateReason that object was created for

 

glade_widget_adaptor_get_internal_child ()

GObject *
glade_widget_adaptor_get_internal_child
                               (GladeWidgetAdaptor *adaptor,
                                GObject *object,
                                const gchar *internal_name);

Retrieves the internal object internal_name from object

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

internal_name

The string identifier of the internal object

 

Returns

The internal GObject.

[transfer none][nullable]


glade_widget_adaptor_set_property ()

void
glade_widget_adaptor_set_property (GladeWidgetAdaptor *adaptor,
                                   GObject *object,
                                   const gchar *property_name,
                                   const GValue *value);

This delegate function is used to apply the property value on the runtime object.

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

property_name

The property identifier

 

value

The GValue

 

glade_widget_adaptor_get_property ()

void
glade_widget_adaptor_get_property (GladeWidgetAdaptor *adaptor,
                                   GObject *object,
                                   const gchar *property_name,
                                   GValue *value);

Gets value of property_name on object .

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

property_name

The property identifier

 

value

The GValue

 

glade_widget_adaptor_verify_property ()

gboolean
glade_widget_adaptor_verify_property (GladeWidgetAdaptor *adaptor,
                                      GObject *object,
                                      const gchar *property_name,
                                      const GValue *value);

This delegate function is always called whenever setting any properties with the exception of load time, and copy/paste time (basically the two places where we recreate a hierarchy that we already know "works") its basically an optional backend provided boundary checker for properties.

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

property_name

The property identifier

 

value

The GValue

 

Returns

whether or not its OK to set value on object , this function will silently return TRUE if the class did not provide a verify function.


glade_widget_adaptor_add ()

void
glade_widget_adaptor_add (GladeWidgetAdaptor *adaptor,
                          GObject *container,
                          GObject *child);

Adds child to container .

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

child

The GObject child

 

glade_widget_adaptor_remove ()

void
glade_widget_adaptor_remove (GladeWidgetAdaptor *adaptor,
                             GObject *container,
                             GObject *child);

Removes child from container .

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

child

The GObject child

 

glade_widget_adaptor_get_children ()

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

Lists the children of container .

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

Returns

A GList of children.

[transfer container][element-type GObject]


glade_widget_adaptor_has_child ()

gboolean
glade_widget_adaptor_has_child (GladeWidgetAdaptor *adaptor,
                                GObject *container,
                                GObject *child);

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

child

The GObject child

 

Returns

whether child is infact inside container .


glade_widget_adaptor_child_set_property ()

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

Sets child 's packing property identified by property_name to value .

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

child

The GObject child

 

property_name

The id of the property

 

value

The GValue

 

glade_widget_adaptor_child_get_property ()

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

Gets child 's packing property identified by property_name .

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

child

The GObject child

 

property_name

The id of the property

 

value

The GValue

 

glade_widget_adaptor_child_verify_property ()

gboolean
glade_widget_adaptor_child_verify_property
                               (GladeWidgetAdaptor *adaptor,
                                GObject *container,
                                GObject *child,
                                const gchar *property_name,
                                const GValue *value);

This delegate function is always called whenever setting any properties with the exception of load time, and copy/paste time (basically the two places where we recreate a hierarchy that we already know "works") its basically an optional backend provided boundary checker for properties.

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

child

The GObject child

 

property_name

The id of the property

 

value

The GValue

 

Returns

whether or not its OK to set value on object , this function will silently return TRUE if the class did not provide a verify function.


glade_widget_adaptor_replace_child ()

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

Replaces old_obj with new_obj in container while positioning new_obj where old_obj was and assigning it appropriate packing property values.

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

old_obj

The old GObject child

 

new_obj

The new GObject child

 

glade_widget_adaptor_read_child ()

void
glade_widget_adaptor_read_child (GladeWidgetAdaptor *adaptor,
                                 GladeWidget *widget,
                                 GladeXmlNode *node);

This function is called to update load a child widget from node when loading xml files (will recurse into glade_widget_read())

Parameters

adaptor

A GladeWidgetAdaptor

 

widget

The GladeWidget

 

node

The GladeXmlNode

 

glade_widget_adaptor_read_widget ()

void
glade_widget_adaptor_read_widget (GladeWidgetAdaptor *adaptor,
                                  GladeWidget *widget,
                                  GladeXmlNode *node);

This function is called to update widget from node when loading xml files.

Parameters

adaptor

A GladeWidgetAdaptor

 

widget

The GladeWidget

 

node

The GladeXmlNode

 

glade_widget_adaptor_write_child ()

void
glade_widget_adaptor_write_child (GladeWidgetAdaptor *adaptor,
                                  GladeWidget *widget,
                                  GladeXmlContext *context,
                                  GladeXmlNode *node);

This function is called to write the child widget to node when writing xml files (takes care of packing and recurses into glade_widget_write())

Parameters

adaptor

A GladeWidgetAdaptor

 

widget

The GladeWidget

 

context

The GladeXmlContext

 

node

The GladeXmlNode

 

glade_widget_adaptor_write_widget ()

void
glade_widget_adaptor_write_widget (GladeWidgetAdaptor *adaptor,
                                   GladeWidget *widget,
                                   GladeXmlContext *context,
                                   GladeXmlNode *node);

This function is called to write widget to node when writing xml files.

Parameters

adaptor

A GladeWidgetAdaptor

 

widget

The GladeWidget

 

context

The GladeXmlContext

 

node

The GladeXmlNode

 

glade_widget_adaptor_query ()

gboolean
glade_widget_adaptor_query (GladeWidgetAdaptor *adaptor);

Parameters

adaptor

A GladeWidgetAdaptor

 

Returns

whether the user needs to be queried for certain properties upon creation of this class.


glade_widget_adaptor_get_packing_default ()

const gchar *
glade_widget_adaptor_get_packing_default
                               (GladeWidgetAdaptor *child_adaptor,
                                GladeWidgetAdaptor *container_adaptor,
                                const gchar *id);

Gets the default value for property_id on a widget governed by child_adaptor when parented in a widget governed by parent_adaptor

Parameters

child_adaptor

A GladeWidgetAdaptor

 

container_adaptor

The GladeWidgetAdaptor for the parent object

 

id

The string property identifier

 

Returns

a string representing the default value for property_id


glade_widget_adaptor_is_container ()

gboolean
glade_widget_adaptor_is_container (GladeWidgetAdaptor *adaptor);

Checks whether or not this adaptor has support to interface with child objects.

Parameters

adaptor

A GladeWidgetAdaptor

 

Returns

whether or not adaptor is a container


glade_widget_adaptor_action_add ()

gboolean
glade_widget_adaptor_action_add (GladeWidgetAdaptor *adaptor,
                                 const gchar *action_path,
                                 const gchar *label,
                                 const gchar *stock,
                                 gboolean important);

Add an action to adaptor . If the action is present then it overrides label and stock

Parameters

adaptor

A GladeWidgetAdaptor

 

action_path

The identifier of this action in the action tree

 

label

A translated label to show in the UI for this action

 

stock

If set, this stock item will be shown in the UI along side the label.

 

important

if this action is important.

 

Returns

whether or not the action was added/updated.


glade_widget_adaptor_pack_action_add ()

gboolean
glade_widget_adaptor_pack_action_add (GladeWidgetAdaptor *adaptor,
                                      const gchar *action_path,
                                      const gchar *label,
                                      const gchar *stock,
                                      gboolean important);

Add a packing action to adaptor . If the action is present then it overrides label and stock

Parameters

adaptor

A GladeWidgetAdaptor

 

action_path

The identifier of this action in the action tree

 

label

A translated label to show in the UI for this action

 

stock

If set, this stock item will be shown in the UI along side the label.

 

important

if this action is important.

 

Returns

whether or not the action was added/updated.


glade_widget_adaptor_action_remove ()

gboolean
glade_widget_adaptor_action_remove (GladeWidgetAdaptor *adaptor,
                                    const gchar *action_path);

Remove an adaptor 's action.

Parameters

adaptor

A GladeWidgetAdaptor

 

action_path

The identifier of this action in the action tree

 

Returns

whether or not the action was removed.


glade_widget_adaptor_pack_action_remove ()

gboolean
glade_widget_adaptor_pack_action_remove
                               (GladeWidgetAdaptor *adaptor,
                                const gchar *action_path);

Remove an adaptor 's packing action.

Parameters

adaptor

A GladeWidgetAdaptor

 

action_path

The identifier of this action in the action tree

 

Returns

whether or not the action was removed.


glade_widget_adaptor_pack_actions_new ()

GList *
glade_widget_adaptor_pack_actions_new (GladeWidgetAdaptor *adaptor);

Create a list of packing actions.

Parameters

adaptor

A GladeWidgetAdaptor

 

Returns

a new list of GladeWidgetAction.

[transfer full][element-type GladeWidgetAction]


glade_widget_adaptor_action_activate ()

void
glade_widget_adaptor_action_activate (GladeWidgetAdaptor *adaptor,
                                      GObject *object,
                                      const gchar *action_path);

An adaptor function to be called on widget actions.

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

action_path

The action identifier in the action tree

 

glade_widget_adaptor_child_action_activate ()

void
glade_widget_adaptor_child_action_activate
                               (GladeWidgetAdaptor *adaptor,
                                GObject *container,
                                GObject *object,
                                const gchar *action_path);

An adaptor function to be called on widget actions.

Parameters

adaptor

A GladeWidgetAdaptor

 

container

The GObject container

 

object

The GObject

 

action_path

The action identifier in the action tree

 

glade_widget_adaptor_string_from_value ()

gchar *
glade_widget_adaptor_string_from_value
                               (GladeWidgetAdaptor *adaptor,
                                GladePropertyDef *def,
                                const GValue *value);

For normal properties this is used to serialize property values, for custom properties its still needed to update the UI for undo/redo items etc.

Parameters

adaptor

A GladeWidgetAdaptor

 

def

The GladePropertyDef

 

value

The GValue to convert to a string

 

Returns

A newly allocated string representation of value


glade_widget_adaptor_action_submenu ()

GtkWidget *
glade_widget_adaptor_action_submenu (GladeWidgetAdaptor *adaptor,
                                     GObject *object,
                                     const gchar *action_path);

This delegate function is used to create dynamically customized submenus. Called only for actions that don't have children.

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The GObject

 

action_path

The action identifier in the action tree

 

Returns

A newly created GtkMenu or NULL.

[transfer full][nullable]


glade_widget_adaptor_actions_new ()

GList *
glade_widget_adaptor_actions_new (GladeWidgetAdaptor *adaptor);

Create a list of actions.

Parameters

adaptor

A GladeWidgetAdaptor

 

Returns

a new list of GladeWidgetAction.

[transfer full][element-type GladeWidgetAction]


glade_widget_adaptor_add_verify ()

gboolean
glade_widget_adaptor_add_verify (GladeWidgetAdaptor *adaptor,
                                 GObject *container,
                                 GObject *child,
                                 gboolean user_feedback);

Checks whether child can be added to parent .

If user_feedback is TRUE and child cannot be added then this shows a notification dialog to the user explaining why.

Parameters

adaptor

A GladeWidgetAdaptor

 

container

A GObject container

 

child

A GObject child

 

user_feedback

whether a notification dialog should be presented in the case that the child cannot not be added.

 

Returns

whether child can be added to parent .


glade_widget_adaptor_construct_object ()

GObject *
glade_widget_adaptor_construct_object (GladeWidgetAdaptor *adaptor,
                                       guint n_parameters,
                                       GParameter *parameters);

This function is called to construct a GObject instance for a GladeWidget of the said adaptor . (provided for language bindings that may need to construct a wrapper object).

Parameters

adaptor

A GladeWidgetAdaptor

 

n_parameters

amount of construct parameters

 

parameters

array of construct GParameter args to create the new object with.

 

Returns

A newly created GObject.

[transfer full]


glade_widget_adaptor_create_editable ()

GladeEditable *
glade_widget_adaptor_create_editable (GladeWidgetAdaptor *adaptor,
                                      GladeEditorPageType type);

This is used to allow the backend to override the way an editor page is layed out (note that editor widgets are created on demand and not at startup).

Parameters

adaptor

A GladeWidgetAdaptor

 

type

The GladeEditorPageType

 

Returns

A new GladeEditable widget.

[transfer full]


glade_widget_adaptor_create_eprop_by_name ()

GladeEditorProperty *
glade_widget_adaptor_create_eprop_by_name
                               (GladeWidgetAdaptor *adaptor,
                                const gchar *property_id,
                                gboolean packing,
                                gboolean use_command);

Creates a GladeEditorProperty to edit GladePropertyDef name in adaptor

Parameters

adaptor

A GladeWidgetAdaptor

 

property_id

the string if of the corresponding GladePropertyDef to be edited

 

packing

whether this refers to a packing property

 

use_command

whether to use the GladeCommand interface to commit property changes

 

Returns

A newly created GladeEditorProperty.

[transfer full]


glade_widget_adaptor_depends ()

gboolean
glade_widget_adaptor_depends (GladeWidgetAdaptor *adaptor,
                              GladeWidget *widget,
                              GladeWidget *another);

glade_widget_adaptor_depends has been deprecated since version 3.18 and should not be used in newly-written code.

Checks whether widget depends on another to be placed earlier in the glade file.

Parameters

adaptor

A GladeWidgetAdaptor

 

widget

A GladeWidget of the adaptor

 

another

another GladeWidget

 

Returns

whether widget depends on another being parsed first in the resulting glade file.


glade_widget_adaptor_destroy_object ()

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

This function is called to destroy a GObject instance.

Parameters

adaptor

A GladeWidgetAdaptor

 

object

The object to destroy

 

glade_widget_adaptor_get_book ()

const gchar *
glade_widget_adaptor_get_book (GladeWidgetAdaptor *adaptor);

glade_widget_adaptor_get_catalog ()

const gchar *
glade_widget_adaptor_get_catalog (GladeWidgetAdaptor *adaptor);

glade_widget_adaptor_get_display_name ()

const gchar *
glade_widget_adaptor_get_display_name (GladeWidgetAdaptor *adaptor);

Parameters

adaptor

a GladeWidgetAdaptor

 

Returns

the name of the adaptor without GLADE_WIDGET_ADAPTOR_INSTANTIABLE_PREFIX


glade_widget_adaptor_get_generic_name ()

const gchar *
glade_widget_adaptor_get_generic_name (GladeWidgetAdaptor *adaptor);

glade_widget_adaptor_get_icon_name ()

const gchar *
glade_widget_adaptor_get_icon_name (GladeWidgetAdaptor *adaptor);

glade_widget_adaptor_get_missing_icon ()

const gchar *
glade_widget_adaptor_get_missing_icon (GladeWidgetAdaptor *adaptor);

glade_widget_adaptor_get_name ()

const gchar *
glade_widget_adaptor_get_name (GladeWidgetAdaptor *adaptor);

glade_widget_adaptor_get_object_type ()

GType
glade_widget_adaptor_get_object_type (GladeWidgetAdaptor *adaptor);

glade_widget_adaptor_get_packing_props ()

const GList *
glade_widget_adaptor_get_packing_props
                               (GladeWidgetAdaptor *adaptor);

Parameters

adaptor

A GladeWidgetAdaptor

 

Returns

a list of GladePropertyDef.

[transfer none][element-type GladePropertyDef]


glade_widget_adaptor_get_parent_adaptor ()

GladeWidgetAdaptor *
glade_widget_adaptor_get_parent_adaptor
                               (GladeWidgetAdaptor *adaptor);

Parameters

adaptor

a GladeWidgetAdaptor

 

Returns

the parent GladeWidgetAdaptor according to adaptor type.

[transfer none]


glade_widget_adaptor_get_properties ()

const GList *
glade_widget_adaptor_get_properties (GladeWidgetAdaptor *adaptor);

Parameters

adaptor

A GladeWidgetAdaptor

 

Returns

a list of GladePropertyDef.

[transfer none][element-type GladePropertyDef]


glade_widget_adaptor_get_signal_def ()

GladeSignalDef *
glade_widget_adaptor_get_signal_def (GladeWidgetAdaptor *adaptor,
                                     const gchar *name);

Looks up signal class name on adaptor .

Parameters

adaptor

A GladeWidgetAdaptor

 

name

the name of the signal class.

 

Returns

a GladeSignalDef or NULL.

[nullable][transfer none]


glade_widget_adaptor_get_signals ()

const GList *
glade_widget_adaptor_get_signals (GladeWidgetAdaptor *adaptor);

Parameters

adaptor

A GladeWidgetAdaptor

 

Returns

a list of GladeSignalDef.

[transfer none][element-type GladeSignalDef]


glade_widget_adaptor_get_title ()

const gchar *
glade_widget_adaptor_get_title (GladeWidgetAdaptor *adaptor);

glade_widget_adaptor_has_internal_children ()

gboolean
glade_widget_adaptor_has_internal_children
                               (GladeWidgetAdaptor *adaptor);

glade_widget_adaptor_list_adaptors ()

GList *
glade_widget_adaptor_list_adaptors (void);

Compiles a list of all registered adaptors.

Returns

A newly allocated GList which must be freed with g_list_free().

[transfer container][element-type GladeWidgetAdaptor]


glade_widget_adaptor_write_widget_after ()

void
glade_widget_adaptor_write_widget_after
                               (GladeWidgetAdaptor *adaptor,
                                GladeWidget *widget,
                                GladeXmlContext *context,
                                GladeXmlNode *node);

This function is called to write widget to node when writing xml files (after writing children)

Parameters

adaptor

A GladeWidgetAdaptor

 

widget

The GladeWidget

 

context

The GladeXmlContext

 

node

The GladeXmlNode

 

Types and Values

enum GladeCreateReason

These are the reasons your GladePostCreateFunc can be called.

Members

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.

 

GLADE_TYPE_CREATE_REASON

#define GLADE_TYPE_CREATE_REASON (glade_create_reason_get_type ())

GLADE_WIDGET_ADAPTOR_INSTANTIABLE_PREFIX

#define GLADE_WIDGET_ADAPTOR_INSTANTIABLE_PREFIX "GladeInstantiable"

Class prefix used for abstract classes (ie GtkBin -> GladeInstantiableGtkBin)


GladeWidgetAdaptor

typedef struct _GladeWidgetAdaptor GladeWidgetAdaptor;

Property Details

The “book” property

  “book”                     gchar *

DevHelp search namespace for this widget class.

Owner: GladeWidgetAdaptor

Flags: Read / Write / Construct Only

Default value: NULL


The “catalog” property

  “catalog”                  gchar *

The name of the widget catalog this class was declared by.

Owner: GladeWidgetAdaptor

Flags: Read / Write / Construct Only

Default value: NULL


The “cursor” property

  “cursor”                   gpointer

A cursor for inserting widgets in the UI.

Owner: GladeWidgetAdaptor

Flags: Read


The “generic-name” property

  “generic-name”             gchar *

Used to generate names of new widgets.

Owner: GladeWidgetAdaptor

Flags: Read / Write / Construct Only

Default value: NULL


The “icon-name” property

  “icon-name”                gchar *

The icon name.

Owner: GladeWidgetAdaptor

Flags: Read / Write / Construct Only

Default value: "widget-gtk-frame"


The “name” property

  “name”                     gchar *

Name of the class.

Owner: GladeWidgetAdaptor

Flags: Read / Write / Construct Only

Default value: NULL


The “query” property

  “query”                    gboolean

Whether the adaptor should query the use or not.

Owner: GladeWidgetAdaptor

Flags: Read / Write

Default value: FALSE


The “special-child-type” property

  “special-child-type”       gchar *

Holds the name of the packing property to depict special children for this container class.

Owner: GladeWidgetAdaptor

Flags: Read / Write / Construct Only

Default value: NULL


The “title” property

  “title”                    gchar *

Translated title for the class used in the glade UI.

Owner: GladeWidgetAdaptor

Flags: Read / Write

Default value: NULL


The “type” property

  “type”                     GType *

GType of the class.

Owner: GladeWidgetAdaptor

Flags: Read / Write / Construct Only

Allowed values: void