GladeProperty

GladeProperty — An interface to properties on the GladeWidget

Synopsis


#include <glade.h>


struct              GladeProperty;
GladeProperty*      glade_property_new                  (GladePropertyClass *klass,
                                                         GladeWidget *widget,
                                                         GValue *value);
GladeProperty*      glade_property_dup                  (GladeProperty *template_prop,
                                                         GladeWidget *widget);
void                glade_property_reset                (GladeProperty *property);
gboolean            glade_property_default              (GladeProperty *property);
gboolean            glade_property_equals_value         (GladeProperty *property,
                                                         const GValue *value);
gboolean            glade_property_equals               (GladeProperty *property,
                                                         ...);
void                glade_property_set_value            (GladeProperty *property,
                                                         const GValue *value);
void                glade_property_set_va_list          (GladeProperty *property,
                                                         va_list vl);
void                glade_property_set                  (GladeProperty *property,
                                                         ...);
void                glade_property_get_value            (GladeProperty *property,
                                                         GValue *value);
void                glade_property_get_default          (GladeProperty *property,
                                                         GValue *value);
void                glade_property_get_va_list          (GladeProperty *property,
                                                         va_list vl);
void                glade_property_get                  (GladeProperty *property,
                                                         ...);
void                glade_property_add_object           (GladeProperty *property,
                                                         GObject *object);
void                glade_property_remove_object        (GladeProperty *property,
                                                         GObject *object);
void                glade_property_sync                 (GladeProperty *property);
void                glade_property_load                 (GladeProperty *property);
GValue*             glade_property_read                 (GladeProperty *property,
                                                         GladePropertyClass *pclass,
                                                         GladeProject *project,
                                                         gpointer info,
                                                         gboolean free_value);
gboolean            glade_property_write                (GladeProperty *property,
                                                         GladeInterface *interface,
                                                         GArray *props);
gboolean            glade_property_superuser            (void);
void                glade_property_push_superuser       (void);
void                glade_property_pop_superuser        (void);
const gchar*        glade_property_get_tooltip          (GladeProperty *property);
void                glade_property_set_sensitive        (GladeProperty *property,
                                                         gboolean sensitive,
                                                         const gchar *reason);
gboolean            glade_property_get_sensitive        (GladeProperty *property);
void                glade_property_set_enabled          (GladeProperty *property,
                                                         gboolean enabled);
gboolean            glade_property_get_enabled          (GladeProperty *property);
void                glade_property_i18n_set_comment     (GladeProperty *property,
                                                         const gchar *str);
const gchar*        glade_property_i18n_get_comment     (GladeProperty *property);
void                glade_property_i18n_set_translatable
                                                        (GladeProperty *property,
                                                         gboolean translatable);
gboolean            glade_property_i18n_get_translatable
                                                        (GladeProperty *property);
void                glade_property_i18n_set_has_context (GladeProperty *property,
                                                         gboolean has_context);
gboolean            glade_property_i18n_get_has_context (GladeProperty *property);

Object Hierarchy


  GObject
   +----GladeProperty

Properties


  "enabled"                  gboolean              : Read / Write
  "i18n-comment"             gchararray            : Read / Write
  "i18n-has-context"         gboolean              : Read / Write
  "i18n-translatable"        gboolean              : Read / Write
  "sensitive"                gboolean              : Read / Write

Signals


  "tooltip-changed"                                : Run Last
  "value-changed"                                  : Run Last

Description

Every object property of every GladeWidget in every GladeProject has a GladeProperty to interface with, GladeProperty provides a means to handle properties in the runtime environment.

A GladeProperty can be seen as an instance of a GladePropertyClass, the GladePropertyClass describes how a GladeProperty will function.

Details

struct GladeProperty

struct GladeProperty;


glade_property_new ()

GladeProperty*      glade_property_new                  (GladePropertyClass *klass,
                                                         GladeWidget *widget,
                                                         GValue *value);

Creates a GladeProperty of type klass for widget with value; if value is NULL, then the introspected default value for that property will be used.

klass : A GladePropertyClass defining this property
widget : The GladeWidget this property is created for
value : The initial GValue of the property or NULL (the GladeProperty will assume ownership of value)
Returns : The newly created GladeProperty

glade_property_dup ()

GladeProperty*      glade_property_dup                  (GladeProperty *template_prop,
                                                         GladeWidget *widget);

template_prop : A GladeProperty
widget : A GladeWidget
Returns : A newly duplicated property based on the new widget

glade_property_reset ()

void                glade_property_reset                (GladeProperty *property);

Resets this property to its default value

property : A GladeProperty

glade_property_default ()

gboolean            glade_property_default              (GladeProperty *property);

property : A GladeProperty
Returns : Whether this property is at its default value

glade_property_equals_value ()

gboolean            glade_property_equals_value         (GladeProperty *property,
                                                         const GValue *value);

property : a GladeProperty
value : a GValue
Returns : Whether this property is equal to the value provided

glade_property_equals ()

gboolean            glade_property_equals               (GladeProperty *property,
                                                         ...);

property : a GladeProperty
... : a provided property value
Returns : Whether this property is equal to the value provided

glade_property_set_value ()

void                glade_property_set_value            (GladeProperty *property,
                                                         const GValue *value);

Sets the property's value

property : a GladeProperty
value : a GValue

glade_property_set_va_list ()

void                glade_property_set_va_list          (GladeProperty *property,
                                                         va_list vl);

Sets the property's value

property : a GladeProperty
vl : a va_list with value to set

glade_property_set ()

void                glade_property_set                  (GladeProperty *property,
                                                         ...);

Sets the property's value (in a convenient way)

property : a GladeProperty
... : the value to set

glade_property_get_value ()

void                glade_property_get_value            (GladeProperty *property,
                                                         GValue *value);

Retrieve the property value

property : a GladeProperty
value : a GValue

glade_property_get_default ()

void                glade_property_get_default          (GladeProperty *property,
                                                         GValue *value);

Retrieve the default property value

property : a GladeProperty
value : a GValue

glade_property_get_va_list ()

void                glade_property_get_va_list          (GladeProperty *property,
                                                         va_list vl);

Retrieve the property value

property : a GladeProperty
vl : a va_list

glade_property_get ()

void                glade_property_get                  (GladeProperty *property,
                                                         ...);

Retrieve the property value

property : a GladeProperty
... : An address to store the value

glade_property_add_object ()

void                glade_property_add_object           (GladeProperty *property,
                                                         GObject *object);

Adds object to the object list in property.

Note: This function expects property to be a GladeParamSpecObjects or GParamSpecObject type property.

property : a GladeProperty
object : The GObject to add

glade_property_remove_object ()

void                glade_property_remove_object        (GladeProperty *property,
                                                         GObject *object);

Removes object from the object list in property.

Note: This function expects property to be a GladeParamSpecObjects or GParamSpecObject type property.

property : a GladeProperty
object : The GObject to add

glade_property_sync ()

void                glade_property_sync                 (GladeProperty *property);

Synchronize the object with this property

property : a GladeProperty

glade_property_load ()

void                glade_property_load                 (GladeProperty *property);

Loads the value of property from the coresponding object instance

property : a GladeProperty

glade_property_read ()

GValue*             glade_property_read                 (GladeProperty *property,
                                                         GladePropertyClass *pclass,
                                                         GladeProject *project,
                                                         gpointer info,
                                                         gboolean free_value);

Read the value and any attributes for property from info, assumes property is being loaded for project

property : a GladeProperty or NULL
pclass : the GladePropertyClass
project : the GladeProject
info : a GladeWidgetInfo struct or a GladeChildInfo struct if a packing property is passed.
free_value : Whether the return value should be freed after applying it to the property or if it should be returned in tact.
Returns : The newly created GValue if successfull (and if free_value == FALSE) Note that object values will only be resolved after the project is completely loaded

glade_property_write ()

gboolean            glade_property_write                (GladeProperty *property,
                                                         GladeInterface *interface,
                                                         GArray *props);

Write this property to the GladeInterface metadata

property : a GladeProperty
interface : a GladeInterface
props : a GArray of GladePropInfo
Returns :

glade_property_superuser ()

gboolean            glade_property_superuser            (void);

Returns :

glade_property_push_superuser ()

void                glade_property_push_superuser       (void);


glade_property_pop_superuser ()

void                glade_property_pop_superuser        (void);


glade_property_get_tooltip ()

const gchar*        glade_property_get_tooltip          (GladeProperty *property);

property : a GladeProperty
Returns : The appropriate tooltip for the editor

glade_property_set_sensitive ()

void                glade_property_set_sensitive        (GladeProperty *property,
                                                         gboolean sensitive,
                                                         const gchar *reason);

property :
sensitive :
reason :

glade_property_get_sensitive ()

gboolean            glade_property_get_sensitive        (GladeProperty *property);

property :
Returns :

glade_property_set_enabled ()

void                glade_property_set_enabled          (GladeProperty *property,
                                                         gboolean enabled);

property :
enabled :

glade_property_get_enabled ()

gboolean            glade_property_get_enabled          (GladeProperty *property);

property :
Returns :

glade_property_i18n_set_comment ()

void                glade_property_i18n_set_comment     (GladeProperty *property,
                                                         const gchar *str);

property :
str :

glade_property_i18n_get_comment ()

const gchar*        glade_property_i18n_get_comment     (GladeProperty *property);

property :
Returns :

glade_property_i18n_set_translatable ()

void                glade_property_i18n_set_translatable
                                                        (GladeProperty *property,
                                                         gboolean translatable);

property :
translatable :

glade_property_i18n_get_translatable ()

gboolean            glade_property_i18n_get_translatable
                                                        (GladeProperty *property);

property :
Returns :

glade_property_i18n_set_has_context ()

void                glade_property_i18n_set_has_context (GladeProperty *property,
                                                         gboolean has_context);

property :
has_context :

glade_property_i18n_get_has_context ()

gboolean            glade_property_i18n_get_has_context (GladeProperty *property);

property :
Returns :

Property Details

The "enabled" property

  "enabled"                  gboolean              : Read / Write

If the property is optional, this is its enabled state.

Default value: TRUE


The "i18n-comment" property

  "i18n-comment"             gchararray            : Read / Write

Comment for translators.

Default value: NULL


The "i18n-has-context" property

  "i18n-has-context"         gboolean              : Read / Write

Whether or not the translatable string has a context prefix.

Default value: FALSE


The "i18n-translatable" property

  "i18n-translatable"        gboolean              : Read / Write

Whether this property is translatable or not.

Default value: TRUE


The "sensitive" property

  "sensitive"                gboolean              : Read / Write

This gives backends control to set property sensitivity.

Default value: TRUE

Signal Details

The "tooltip-changed" signal

void                user_function                      (GladeProperty *gladeproperty,
                                                        gpointer       arg1,
                                                        gpointer       user_data)          : Run Last

gladeproperty : the object which received the signal.
arg1 :
user_data : user data set when the signal handler was connected.

The "value-changed" signal

void                user_function                      (GladeProperty *gladeproperty,
                                                        gpointer       arg1,
                                                        gpointer       arg2,
                                                        gpointer       user_data)          : Run Last

gladeproperty : the object which received the signal.
arg1 :
Param3 :
user_data : user data set when the signal handler was connected.