DzlStateMachine: Dazzle Reference Manual

## DzlStateMachine DzlStateMachine |

## Functions

DzlStateMachine * | dzl_state_machine_new ()
const gchar * | dzl_state_machine_get_state ()
void | dzl_state_machine_set_state ()
gboolean | dzl_state_machine_is_state ()
GAction * | dzl_state_machine_create_action ()
void | dzl_state_machine_add_property ()
void | dzl_state_machine_add_property_valist ()
void | dzl_state_machine_add_propertyv ()
void | dzl_state_machine_add_binding ()
void | dzl_state_machine_add_style ()
void | dzl_state_machine_connect_object ()

## Properties

gchar * | state | Read / Write

## Types and Values

#define | DZL_TYPE_STATE_MACHINE
struct | DzlStateMachineClass
| DzlStateMachine

## Object Hierarchy

        GObject
        ╰── DzlStateMachine

## Implemented Interfaces

DzlStateMachine implements GtkBuildable.

## Description

## Functions

### dzl_state_machine_new ()

    DzlStateMachine *
    dzl_state_machine_new (void);

### dzl_state_machine_get_state ()

    const gchar *
    dzl_state_machine_get_state (DzlStateMachine *self);

Gets the “state” property. This is the name of the current state of the machine.

#### Parameters

self | the DzlStateMachine. |

#### Returns

The current state of the machine.

### dzl_state_machine_set_state ()

    void
    dzl_state_machine_set_state (DzlStateMachine *self,
                                 const gchar *state);

Sets the “state” property.

Registered state transformations will be applied during the state transformation.

If the transition results in a cyclic operation, the state will stop at the last state before the cycle was detected.

#### Parameters

self | the DzlStateMachine `self` : the # |

### dzl_state_machine_is_state ()

    gboolean
    dzl_state_machine_is_state (DzlStateMachine *self,
                                const gchar *state);

Checks to see if the current state of the DzlStateMachine matches `state` .

#### Parameters

self | a DzlStateMachine |
state | the name of the state to check. | [nullable]

#### Returns

`TRUE` if `self` is currently set to `state` .

Since: 3.28

### dzl_state_machine_create_action ()

    GAction *
    dzl_state_machine_create_action (DzlStateMachine *self,
                                     const gchar *name);

Creates a new GAction with the name of `name` .

Setting the state of this action will toggle the state of the state machine. You should use `g_variant_new_string()` or similar to create the state.

#### Parameters

self | An DzlStateMachine |
name | the name of the action. |

#### Returns

A newly created GAction.

[transfer full]

### dzl_state_machine_add_property ()

    void
    dzl_state_machine_add_property (DzlStateMachine *self,
                                    const gchar *state,
                                    gpointer object,
                                    const gchar *property,
                                    ...);

### dzl_state_machine_add_property_valist ()

    void
    dzl_state_machine_add_property_valist (DzlStateMachine *self,
                                           const gchar *state,
                                           gpointer object,
                                           const gchar *property,
                                           va_list var_args);

### dzl_state_machine_add_propertyv ()

    void
    dzl_state_machine_add_propertyv (DzlStateMachine *self,
                                     const gchar *state,
                                     gpointer object,
                                     const gchar *property,
                                     const GValue *value);

### dzl_state_machine_add_binding ()

    void
    dzl_state_machine_add_binding (DzlStateMachine *self,
                                   const gchar *state,
                                   gpointer source_object,
                                   const gchar *source_property,
                                   gpointer target_object,
                                   const gchar *target_property,
                                   GBindingFlags flags);

### dzl_state_machine_add_style ()

    void
    dzl_state_machine_add_style (DzlStateMachine *self,
                                 const gchar *state,
                                 GtkWidget *widget,
                                 const gchar *style);

### dzl_state_machine_connect_object ()

    void
    dzl_state_machine_connect_object (DzlStateMachine *self,
                                      const gchar *state,
                                      gpointer source,
                                      const gchar *detailed_signal,
                                      GCallback callback,
                                      gpointer user_data,
                                      GConnectFlags flags);

Connects to the `detailed_signal` of `source` only when the current state of the state machine is `state` .

[skip]

#### Parameters

self | A DzlStateMachine. |
state | The state the signal connection should exist within |
source | the source object to connect to |
detailed_signal | The detailed signal of `source` to connect. |
callback | The callback to execute upon signal emission. | [scope notified][closure user_data]
user_data | The user data for `callback` . |
flags | signal connection flags. |

## Types and Values

### DZL_TYPE_STATE_MACHINE

    #define DZL_TYPE_STATE_MACHINE  (dzl_state_machine_get_type())

### struct DzlStateMachineClass

    struct DzlStateMachineClass {
      GObjectClass parent;
    };

### DzlStateMachine

    typedef struct _DzlStateMachine DzlStateMachine;

## Property Details

### The `“state”` property

      “state”                    gchar *

The current state of the machine.

Flags: Read / Write

Default value: NULL