GladeWidget

GladeWidget — An object wrapper for the Glade runtime environment.

Synopsis


#include <glade.h>


struct      GladeWidget;
GladeWidget* glade_widget_new               (GladeWidget *parent,
                                             GladeWidgetClass *klass,
                                             GladeProject *project,
                                             gboolean query);
GladeWidget* glade_widget_new_for_internal_child
                                            (GladeWidget *parent,
                                             GObject *internal_object,
                                             const gchar *internal_name,
                                             const gchar *parent_name,
                                             gboolean anarchist,
                                             GladeCreateReason reason);
void        glade_widget_set_name           (GladeWidget *widget,
                                             const gchar *name);
void        glade_widget_set_internal       (GladeWidget *widget,
                                             const gchar *internal);
void        glade_widget_set_object         (GladeWidget *gwidget,
                                             GObject *new_object);
void        glade_widget_set_project        (GladeWidget *widget,
                                             GladeProject *project);
const gchar* glade_widget_get_name          (GladeWidget *widget);
const gchar* glade_widget_get_internal      (GladeWidget *widget);
GladeWidgetClass* glade_widget_get_class    (GladeWidget *widget);
GladeProject* glade_widget_get_project      (GladeWidget *widget);
GObject*    glade_widget_get_object         (GladeWidget *widget);
void        glade_widget_project_notify     (GladeWidget *widget,
                                             GladeProject *project);
void        glade_widget_show               (GladeWidget *widget);
void        glade_widget_hide               (GladeWidget *widget);
void        glade_widget_copy_properties    (GladeWidget *widget,
                                             GladeWidget *template);
void        glade_widget_set_packing_properties
                                            (GladeWidget *widget,
                                             GladeWidget *container);
void        glade_widget_add_prop_ref       (GladeWidget *widget,
                                             GladeProperty *property);
void        glade_widget_remove_prop_ref    (GladeWidget *widget,
                                             GladeProperty *property);
GladeProperty* glade_widget_get_property    (GladeWidget *widget,
                                             const gchar *id_property);
GladeProperty* glade_widget_get_pack_property
                                            (GladeWidget *widget,
                                             const gchar *id_property);
gboolean    glade_widget_property_get       (GladeWidget *widget,
                                             const gchar *id_property,
                                             ...);
gboolean    glade_widget_property_set       (GladeWidget *widget,
                                             const gchar *id_property,
                                             ...);
gboolean    glade_widget_pack_property_get  (GladeWidget *widget,
                                             const gchar *id_property,
                                             ...);
gboolean    glade_widget_pack_property_set  (GladeWidget *widget,
                                             const gchar *id_property,
                                             ...);
gboolean    glade_widget_property_reset     (GladeWidget *widget,
                                             const gchar *id_property);
gboolean    glade_widget_pack_property_reset
                                            (GladeWidget *widget,
                                             const gchar *id_property);
gboolean    glade_widget_property_default   (GladeWidget *widget,
                                             const gchar *id_property);
gboolean    glade_widget_pack_property_default
                                            (GladeWidget *widget,
                                             const gchar *id_property);
gboolean    glade_widget_property_set_sensitive
                                            (GladeWidget *widget,
                                             const gchar *id_property,
                                             gboolean sensitive,
                                             const gchar *reason);
gboolean    glade_widget_pack_property_set_sensitive
                                            (GladeWidget *widget,
                                             const gchar *id_property,
                                             gboolean sensitive,
                                             const gchar *reason);
gboolean    glade_widget_property_set_enabled
                                            (GladeWidget *widget,
                                             const gchar *id_property,
                                             gboolean enabled);
gboolean    glade_widget_pack_property_set_enabled
                                            (GladeWidget *widget,
                                             const gchar *id_property,
                                             gboolean enabled);
GladeWidget* glade_widget_retrieve_from_position
                                            (GtkWidget *base,
                                             int x,
                                             int y);
gboolean    glade_widget_has_decendant      (GladeWidget *widget,
                                             GType type);
void        glade_widget_replace            (GladeWidget *parent,
                                             GObject *old_object,
                                             GObject *new_object);
void        glade_widget_rebuild            (GladeWidget *glade_widget);
GladeWidget* glade_widget_dup               (GladeWidget *widget);
void        glade_widget_add_signal_handler (GladeWidget *widget,
                                             GladeSignal *signal_handler);
void        glade_widget_remove_signal_handler
                                            (GladeWidget *widget,
                                             GladeSignal *signal_handler);
void        glade_widget_change_signal_handler
                                            (GladeWidget *widget,
                                             GladeSignal *old_signal_handler,
                                             GladeSignal *new_signal_handler);
GPtrArray*  glade_widget_list_signal_handlers
                                            (GladeWidget *widget,
                                             const gchar *signal_name);
GladeWidgetInfo* glade_widget_write         (GladeWidget *widget,
                                             GladeInterface *interface);
GladeWidget* glade_widget_read              (GladeProject *project,
                                             GladeWidgetInfo *info);
gboolean    glade_widget_has_launcher       (GladeWidget *widget);
void        glade_widget_launch_editor      (GladeWidget *widget);
#define     glade_widget_get_from_gobject   (w)
GladeWidget* glade_widget_get_parent        (GladeWidget *widget);
void        glade_widget_set_parent         (GladeWidget *widget,
                                             GladeWidget *parent);
gboolean    glade_widget_is_dupping         (void);

Object Hierarchy


  GObject
   +----GladeWidget

Properties


  "anarchist"            gboolean              : Read / Write / Construct Only
  "class"                gpointer              : Read / Write / Construct Only
  "internal"             gchararray            : Read / Write / Construct
  "name"                 gchararray            : Read / Write / Construct
  "object"               GObject               : Read / Write / Construct
  "parent"               GladeWidget           : Read / Write
  "project"              GladeProject          : Read / Write / Construct
  "properties"           gpointer              : Read / Write / Construct Only

Signals


"add-signal-handler"
            void        user_function      (GladeWidget *gladewidget,
                                            gpointer     arg1,
                                            gpointer     user_data)        : Run last
"change-signal-handler"
            void        user_function      (GladeWidget *gladewidget,
                                            gpointer     arg1,
                                            gpointer     arg2,
                                            gpointer     user_data)        : Run last
"remove-signal-handler"
            void        user_function      (GladeWidget *gladewidget,
                                            gpointer     arg1,
                                            gpointer     user_data)        : Run last

Description

GladeWidget is the proxy between the instantiated runtime object and the Glade core metadata. This api will be mostly usefull for its convenience api for getting and setting properties (mostly from the plugin).

Details

struct GladeWidget

struct GladeWidget;


glade_widget_new ()

GladeWidget* glade_widget_new               (GladeWidget *parent,
                                             GladeWidgetClass *klass,
                                             GladeProject *project,
                                             gboolean query);

Creates a GladeWidget wrapper and the appropriate type of GObject inside and add it to project and parent if specified.

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.

parent : a GladeWidget
klass : a GladeWidgetClass
project : a GladeProject
query : whether or not to query the user for properties that demanded it.
Returns : The newly created GladeWidget

glade_widget_new_for_internal_child ()

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

parent : The parent GladeWidget, or NULL for children outside of the heirarchy.
internal_object : the GObject
internal_name : a string identifier for this internal widget.
parent_name :
anarchist : Whether or not this widget is a widget outside of the parent's heirarchy (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 usefull here).
Returns : a freshly created GladeWidget wrapper object for the internal_object of name internal_name

glade_widget_set_name ()

void        glade_widget_set_name           (GladeWidget *widget,
                                             const gchar *name);

Sets widget's name to name.

widget : a GladeWidget
name : a string

glade_widget_set_internal ()

void        glade_widget_set_internal       (GladeWidget *widget,
                                             const gchar *internal);

TODO: write me

widget :
internal :

glade_widget_set_object ()

void        glade_widget_set_object         (GladeWidget *gwidget,
                                             GObject *new_object);

Set the runtime object for this GladeWidget wrapper (this is used deep in the core and is probably unsafe to use elsewhere).

gwidget : A GladeWidget
new_object : the new GObject for gwidget

glade_widget_set_project ()

void        glade_widget_set_project        (GladeWidget *widget,
                                             GladeProject *project);

Makes widget belong to project.

widget : a GladeWidget
project : a GladeProject

glade_widget_get_name ()

const gchar* glade_widget_get_name          (GladeWidget *widget);

widget : a GladeWidget
Returns : a pointer to widget's name

glade_widget_get_internal ()

const gchar* glade_widget_get_internal      (GladeWidget *widget);

TODO: write me

widget : a GladeWidget
Returns :

glade_widget_get_class ()

GladeWidgetClass* glade_widget_get_class    (GladeWidget *widget);

widget : a GladeWidget
Returns : the GladeWidgetclass of widget

glade_widget_get_project ()

GladeProject* glade_widget_get_project      (GladeWidget *widget);

widget : a GladeWidget
Returns : the GladeProject that widget belongs to

glade_widget_get_object ()

GObject*    glade_widget_get_object         (GladeWidget *widget);

widget : a GladeWidget
Returns : the GObject associated with widget

glade_widget_project_notify ()

void        glade_widget_project_notify     (GladeWidget *widget,
                                             GladeProject *project);

widget :
project :

glade_widget_show ()

void        glade_widget_show               (GladeWidget *widget);

Display widget

widget : A GladeWidget

glade_widget_hide ()

void        glade_widget_hide               (GladeWidget *widget);

Hide widget

widget : A GladeWidget

glade_widget_copy_properties ()

void        glade_widget_copy_properties    (GladeWidget *widget,
                                             GladeWidget *template);

Sets properties in widget based on the values of matching properties in template

widget : a 'dest' GladeWidget
template : a 'src' GladeWidget

glade_widget_set_packing_properties ()

void        glade_widget_set_packing_properties
                                            (GladeWidget *widget,
                                             GladeWidget *container);

Generates the packing_properties list of the widget, given the class of the container we are adding the widget to. If the widget already has packing_properties, but the container has changed, the current list is freed and replaced.

widget : A GladeWidget
container : The parent GladeWidget

glade_widget_add_prop_ref ()

void        glade_widget_add_prop_ref       (GladeWidget *widget,
                                             GladeProperty *property);

widget :
property :

glade_widget_remove_prop_ref ()

void        glade_widget_remove_prop_ref    (GladeWidget *widget,
                                             GladeProperty *property);

widget :
property :

glade_widget_get_property ()

GladeProperty* glade_widget_get_property    (GladeWidget *widget,
                                             const gchar *id_property);

widget : a GladeWidget
id_property : a string naming a GladeProperty
Returns : the GladeProperty in widget named id_property

glade_widget_get_pack_property ()

GladeProperty* glade_widget_get_pack_property
                                            (GladeWidget *widget,
                                             const gchar *id_property);

widget : a GladeWidget
id_property : a string naming a GladeProperty
Returns : the GladeProperty in widget named id_property

glade_widget_property_get ()

gboolean    glade_widget_property_get       (GladeWidget *widget,
                                             const gchar *id_property,
                                             ...);

Gets the value of id_property in widget

widget : a GladeWidget
id_property : a string naming a GladeProperty
... : The return location for the value of the said GladeProperty
Returns : whether id_property was found or not.

glade_widget_property_set ()

gboolean    glade_widget_property_set       (GladeWidget *widget,
                                             const gchar *id_property,
                                             ...);

Sets the value of id_property in widget

widget : a GladeWidget
id_property : a string naming a GladeProperty
... : A value of the correct type for the said GladeProperty
Returns : whether id_property was found or not.

glade_widget_pack_property_get ()

gboolean    glade_widget_pack_property_get  (GladeWidget *widget,
                                             const gchar *id_property,
                                             ...);

Gets the value of id_property in widget packing properties

widget : a GladeWidget
id_property : a string naming a GladeProperty
... : The return location for the value of the said GladeProperty
Returns : whether id_property was found or not.

glade_widget_pack_property_set ()

gboolean    glade_widget_pack_property_set  (GladeWidget *widget,
                                             const gchar *id_property,
                                             ...);

Sets the value of id_property in widget packing properties

widget : a GladeWidget
id_property : a string naming a GladeProperty
... : The return location for the value of the said GladeProperty
Returns : whether id_property was found or not.

glade_widget_property_reset ()

gboolean    glade_widget_property_reset     (GladeWidget *widget,
                                             const gchar *id_property);

Resets id_property in widget to it's default value

widget : a GladeWidget
id_property : a string naming a GladeProperty
Returns : whether id_property was found or not.

glade_widget_pack_property_reset ()

gboolean    glade_widget_pack_property_reset
                                            (GladeWidget *widget,
                                             const gchar *id_property);

Resets id_property in widget's packing properties to it's default value

widget : a GladeWidget
id_property : a string naming a GladeProperty
Returns : whether id_property was found or not.

glade_widget_property_default ()

gboolean    glade_widget_property_default   (GladeWidget *widget,
                                             const gchar *id_property);

widget : a GladeWidget
id_property : a string naming a GladeProperty
Returns : whether whether id_property was found and is currently set to it's default value.

glade_widget_pack_property_default ()

gboolean    glade_widget_pack_property_default
                                            (GladeWidget *widget,
                                             const gchar *id_property);

widget : a GladeWidget
id_property : a string naming a GladeProperty
Returns : whether whether id_property was found and is currently set to it's default value.

glade_widget_property_set_sensitive ()

gboolean    glade_widget_property_set_sensitive
                                            (GladeWidget *widget,
                                             const gchar *id_property,
                                             gboolean sensitive,
                                             const gchar *reason);

Sets the sensitivity of id_property in widget

widget : a GladeWidget
id_property : a string naming a GladeProperty
sensitive : setting sensitive or insensitive
reason : a description of why the user cant edit this property which will be used as a tooltip
Returns : whether id_property was found or not.

glade_widget_pack_property_set_sensitive ()

gboolean    glade_widget_pack_property_set_sensitive
                                            (GladeWidget *widget,
                                             const gchar *id_property,
                                             gboolean sensitive,
                                             const gchar *reason);

Sets the sensitivity of id_property in widget's packing properties.

widget : a GladeWidget
id_property : a string naming a GladeProperty
sensitive : setting sensitive or insensitive
reason : a description of why the user cant edit this property which will be used as a tooltip
Returns : whether id_property was found or not.

glade_widget_property_set_enabled ()

gboolean    glade_widget_property_set_enabled
                                            (GladeWidget *widget,
                                             const gchar *id_property,
                                             gboolean enabled);

Sets the enabled state of id_property in widget; this is used for optional properties.

widget : a GladeWidget
id_property : a string naming a GladeProperty
enabled : setting enabled or disabled
Returns : whether id_property was found or not.

glade_widget_pack_property_set_enabled ()

gboolean    glade_widget_pack_property_set_enabled
                                            (GladeWidget *widget,
                                             const gchar *id_property,
                                             gboolean enabled);

Sets the enabled state of id_property in widget's packing properties; this is used for optional properties.

widget : a GladeWidget
id_property : a string naming a GladeProperty
enabled : setting enabled or disabled
Returns : whether id_property was found or not.

glade_widget_retrieve_from_position ()

GladeWidget* glade_widget_retrieve_from_position
                                            (GtkWidget *base,
                                             int x,
                                             int y);

base : a GtkWidget
x : an int
y : an int
Returns : the real widget that was "clicked over" for a given event (coordinates) and a widget. For example, when a label is clicked the button press event is triggered for its parent, this function takes the event and the widget that got the event and returns the real GladeWidget that was clicked

glade_widget_has_decendant ()

gboolean    glade_widget_has_decendant      (GladeWidget *widget,
                                             GType type);

widget : a GladeWidget
type : a GType
Returns : whether this GladeWidget has any decendants of type type or any decendants that implement the type interface

glade_widget_replace ()

void        glade_widget_replace            (GladeWidget *parent,
                                             GObject *old_object,
                                             GObject *new_object);

Replaces a GObject with another GObject inside a GObject which behaves as a container.

Note that both GObjects must be owned by a GladeWidget.

parent :
old_object : a GObject
new_object : a GObject

glade_widget_rebuild ()

void        glade_widget_rebuild            (GladeWidget *glade_widget);

Replaces the current widget instance with a new one while preserving all properties children and takes care of reparenting.

glade_widget : a GladeWidget

glade_widget_dup ()

GladeWidget* glade_widget_dup               (GladeWidget *widget);

widget :
Returns :

glade_widget_add_signal_handler ()

void        glade_widget_add_signal_handler (GladeWidget *widget,
                                             GladeSignal *signal_handler);

TODO: write me

widget :
signal_handler :

glade_widget_remove_signal_handler ()

void        glade_widget_remove_signal_handler
                                            (GladeWidget *widget,
                                             GladeSignal *signal_handler);

TODO: write me

widget :
signal_handler :

glade_widget_change_signal_handler ()

void        glade_widget_change_signal_handler
                                            (GladeWidget *widget,
                                             GladeSignal *old_signal_handler,
                                             GladeSignal *new_signal_handler);

TODO: write me

widget :
old_signal_handler :
new_signal_handler :

glade_widget_list_signal_handlers ()

GPtrArray*  glade_widget_list_signal_handlers
                                            (GladeWidget *widget,
                                             const gchar *signal_name);

widget :
signal_name :
Returns :

glade_widget_write ()

GladeWidgetInfo* glade_widget_write         (GladeWidget *widget,
                                             GladeInterface *interface);

TODO: write me

widget : a GladeWidget
interface : a GladeInterface
Returns :

glade_widget_read ()

GladeWidget* glade_widget_read              (GladeProject *project,
                                             GladeWidgetInfo *info);

project : a GladeProject
info : a GladeWidgetInfo
Returns : a new GladeWidget for project, based on info

glade_widget_has_launcher ()

gboolean    glade_widget_has_launcher       (GladeWidget *widget);

widget :
Returns :

glade_widget_launch_editor ()

void        glade_widget_launch_editor      (GladeWidget *widget);

Launches a custom editor from the backend for thie widget.

widget : a GladeWidget

glade_widget_get_from_gobject()

#define     glade_widget_get_from_gobject(w)

w :

glade_widget_get_parent ()

GladeWidget* glade_widget_get_parent        (GladeWidget *widget);

widget :
Returns :

glade_widget_set_parent ()

void        glade_widget_set_parent         (GladeWidget *widget,
                                             GladeWidget *parent);

widget :
parent :

glade_widget_is_dupping ()

gboolean    glade_widget_is_dupping         (void);

This is used internally by GladeProperty to avoid calling backend "verify-function"s at dup time.

Returns : whether we are currently duplicating a widget or not

Property Details

The "anarchist" property

  "anarchist"            gboolean              : Read / Write / Construct Only

Whether this composite child is an ancestral child or an anarchist child.

Default value: FALSE


The "class" property

  "class"                gpointer              : Read / Write / Construct Only

The class of the associated gtk+ widget.


The "internal" property

  "internal"             gchararray            : Read / Write / Construct

The internal name of the widget.

Default value: NULL


The "name" property

  "name"                 gchararray            : Read / Write / Construct

The name of the widget.

Default value: NULL


The "object" property

  "object"               GObject               : Read / Write / Construct

The object associated.


The "parent" property

  "parent"               GladeWidget           : Read / Write

A pointer to the parenting GladeWidget.


The "project" property

  "project"              GladeProject          : Read / Write / Construct

The glade project that this widget belongs to.


The "properties" property

  "properties"           gpointer              : Read / Write / Construct Only

A list of GladeProperties.

Signal Details

The "add-signal-handler" signal

void        user_function                  (GladeWidget *gladewidget,
                                            gpointer     arg1,
                                            gpointer     user_data)        : Run last

gladewidget : the GladeWidget which received the signal.
arg1 : the GladeSignal that was added to gladewidget.
user_data : user data set when the signal handler was connected.

The "change-signal-handler" signal

void        user_function                  (GladeWidget *gladewidget,
                                            gpointer     arg1,
                                            gpointer     arg2,
                                            gpointer     user_data)        : Run last

gladewidget : the GladeWidget which received the signal.
arg1 : the old GladeSignal
arg2 : the new GladeSignal
user_data : user data set when the signal handler was connected.

The "remove-signal-handler" signal

void        user_function                  (GladeWidget *gladewidget,
                                            gpointer     arg1,
                                            gpointer     user_data)        : Run last

gladewidget : the GladeWidget which received the signal.
arg1 : the GladeSignal that was removed from gladewidget.
user_data : user data set when the signal handler was connected.