DzlPropertiesGroup

DzlPropertiesGroup — A GActionGroup of properties on an object

Functions

Properties

GObject * object Read / Write
GType * object-type Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── DzlPropertiesGroup

Implemented Interfaces

DzlPropertiesGroup implements GActionGroup.

Description

This class is a GActionGroup which provides stateful access to properties in a GObject. This can be useful when you want to expose properties from a GObject as a GAction, espectially with use in GtkApplications.

Call dzl_properties_group_add_property() to setup the mappings for action-name to property-name for the actions you'd like to add.

Not all property types can be supported. What is current supported are properties of type:

G_TYPE_INT G_TYPE_UINT G_TYPE_BOOLEAN G_TYPE_STRING G_TYPE_DOUBLE

Functions

dzl_properties_group_new ()

DzlPropertiesGroup *
dzl_properties_group_new (GObject *object);

This creates a new DzlPropertiesGroup to create stateful actions around properties in object .

Call dzl_properties_group_add_property() to add a property to action name mapping for this group. Until you've called this, no actions are mapped.

Note that DzlPropertiesGroup only holds a weak reference to object and therefore you must keep object alive elsewhere.

Parameters

object

The object containing the properties

 

Returns

A DzlPropertiesGroup.

[transfer full]

Since: 3.26


dzl_properties_group_new_for_type ()

DzlPropertiesGroup *
dzl_properties_group_new_for_type (GType object_type);

This creates a new DzlPropertiesGroup for which the initial object is NULL.

Set object_type to a type of a class which is a GObject-based type.

Parameters

object_type

A GObjectClass based type

 

Returns

A DzlPropertiesGroup.

[transfer none]


dzl_properties_group_add_property ()

void
dzl_properties_group_add_property (DzlPropertiesGroup *self,
                                   const gchar *name,
                                   const gchar *property_name);

Adds a new stateful action named name which maps to the underlying property property_name of “object”.

Parameters

self

a DzlPropertiesGroup

 

name

the name of the action

 

property_name

the name of the property

 

Since: 3.26


dzl_properties_group_add_property_full ()

void
dzl_properties_group_add_property_full
                               (DzlPropertiesGroup *self,
                                const gchar *name,
                                const gchar *property_name,
                                DzlPropertiesFlags flags);

Adds a new stateful action named name which maps to the underlying property property_name of “object”.

Seting flags allows you to tweak some settings about the action.

Parameters

self

a DzlPropertiesGroup

 

name

the name of the action

 

property_name

the name of the property

 

flags

optional flags for the action

 

Since: 3.26


dzl_properties_group_add_all_properties ()

void
dzl_properties_group_add_all_properties
                               (DzlPropertiesGroup *self);

This function will try to add all properties found on the target instance to the group. Only properties that are supported by the DzlPropertiesGroup will be added.

The action name of all added properties will be identical to their property name.

Parameters

self

A DzlPropertiesGroup

 

Since: 3.26


dzl_properties_group_remove ()

void
dzl_properties_group_remove (DzlPropertiesGroup *self,
                             const gchar *name);

Removes an action from self that was previously added with dzl_properties_group_add_property(). name should match the name parameter to that function.

Parameters

self

a DzlPropertiesGroup

 

name

the name of the action

 

Since: 3.26

Types and Values

DZL_TYPE_PROPERTIES_GROUP

#define DZL_TYPE_PROPERTIES_GROUP (dzl_properties_group_get_type())

enum DzlPropertiesFlags

Members

DZL_PROPERTIES_FLAGS_NONE

   

DZL_PROPERTIES_FLAGS_STATEFUL_BOOLEANS

   

DzlPropertiesGroup

typedef struct _DzlPropertiesGroup DzlPropertiesGroup;

Property Details

The “object” property

  “object”                   GObject *

The source object for the properties.

Flags: Read / Write


The “object-type” property

  “object-type”              GType *

A type the object must conform to.

Flags: Read / Write / Construct Only

Allowed values: GObject