GActionGroup

GActionGroup — a group of actions

Synopsis

                    GActionGroup;

gboolean            g_action_group_has_action           (GActionGroup *action_group,
                                                         const gchar *action_name);
gchar **            g_action_group_list_actions         (GActionGroup *action_group);

gboolean            g_action_group_get_action_enabled   (GActionGroup *action_group,
                                                         const gchar *action_name);
const GVariantType * g_action_group_get_action_parameter_type
                                                        (GActionGroup *action_group,
                                                         const gchar *action_name);
const GVariantType * g_action_group_get_action_state_type
                                                        (GActionGroup *action_group,
                                                         const gchar *action_name);
GVariant *          g_action_group_get_action_state_hint
                                                        (GActionGroup *action_group,
                                                         const gchar *action_name);

GVariant *          g_action_group_get_action_state     (GActionGroup *action_group,
                                                         const gchar *action_name);
void                g_action_group_change_action_state  (GActionGroup *action_group,
                                                         const gchar *action_name,
                                                         GVariant *value);

void                g_action_group_activate_action      (GActionGroup *action_group,
                                                         const gchar *action_name,
                                                         GVariant *parameter);

void                g_action_group_action_added         (GActionGroup *action_group,
                                                         const gchar *action_name);
void                g_action_group_action_removed       (GActionGroup *action_group,
                                                         const gchar *action_name);
void                g_action_group_action_enabled_changed
                                                        (GActionGroup *action_group,
                                                         const gchar *action_name,
                                                         gboolean enabled);
void                g_action_group_action_state_changed (GActionGroup *action_group,
                                                         const gchar *action_name,
                                                         GVariant *state);

Object Hierarchy

  GInterface
   +----GActionGroup

Prerequisites

GActionGroup requires GObject.

Known Implementations

GActionGroup is implemented by GApplication and GSimpleActionGroup.

Signals

  "action-added"                                   : Run Last / Has Details
  "action-enabled-changed"                         : Run Last / Has Details
  "action-removed"                                 : Run Last / Has Details
  "action-state-changed"                           : Run Last / Has Details

Description

GActionGroup represents a group of actions.

Each action in the group has a unique name (which is a string). All method calls, except g_action_group_list_actions() take the name of an action as an argument.

The GActionGroup API is meant to be the 'public' API to the action group. The calls here are exactly the interaction that 'external forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have with actions. 'Internal' APIs (ie: ones meant only to be accessed by the action group implementation) are found on subclasses. This is why you will find -- for example -- g_action_group_get_enabled() but not an equivalent set() call.

Signals are emitted on the action group in response to state changes on individual actions.

Details

GActionGroup

typedef struct _GActionGroup GActionGroup;


g_action_group_has_action ()

gboolean            g_action_group_has_action           (GActionGroup *action_group,
                                                         const gchar *action_name);

Checks if the named action exists within action_group.

action_group :

a GActionGroup

action_name :

the name of the action to check for

Returns :

whether the named action exists

Since 2.28


g_action_group_list_actions ()

gchar **            g_action_group_list_actions         (GActionGroup *action_group);

Lists the actions contained within action_group.

The caller is responsible for freeing the list with g_strfreev() when it is no longer required.

action_group :

a GActionGroup

Returns :

a NULL-terminated array of the names of the actions in the groupb. [transfer full]

Since 2.28


g_action_group_get_action_enabled ()

gboolean            g_action_group_get_action_enabled   (GActionGroup *action_group,
                                                         const gchar *action_name);

action_group :

action_name :

Returns :


g_action_group_get_action_parameter_type ()

const GVariantType * g_action_group_get_action_parameter_type
                                                        (GActionGroup *action_group,
                                                         const gchar *action_name);

action_group :

action_name :

Returns :


g_action_group_get_action_state_type ()

const GVariantType * g_action_group_get_action_state_type
                                                        (GActionGroup *action_group,
                                                         const gchar *action_name);

action_group :

action_name :

Returns :


g_action_group_get_action_state_hint ()

GVariant *          g_action_group_get_action_state_hint
                                                        (GActionGroup *action_group,
                                                         const gchar *action_name);

action_group :

action_name :

Returns :


g_action_group_get_action_state ()

GVariant *          g_action_group_get_action_state     (GActionGroup *action_group,
                                                         const gchar *action_name);

action_group :

action_name :

Returns :


g_action_group_change_action_state ()

void                g_action_group_change_action_state  (GActionGroup *action_group,
                                                         const gchar *action_name,
                                                         GVariant *value);

action_group :

action_name :

value :


g_action_group_activate_action ()

void                g_action_group_activate_action      (GActionGroup *action_group,
                                                         const gchar *action_name,
                                                         GVariant *parameter);

action_group :

action_name :

parameter :


g_action_group_action_added ()

void                g_action_group_action_added         (GActionGroup *action_group,
                                                         const gchar *action_name);

Emits the "action-added" signal on action_group.

This function should only be called by GActionGroup implementations.

action_group :

a GActionGroup

action_name :

the name of an action in the group

Since 2.28


g_action_group_action_removed ()

void                g_action_group_action_removed       (GActionGroup *action_group,
                                                         const gchar *action_name);

Emits the "action-removed" signal on action_group.

This function should only be called by GActionGroup implementations.

action_group :

a GActionGroup

action_name :

the name of an action in the group

Since 2.28


g_action_group_action_enabled_changed ()

void                g_action_group_action_enabled_changed
                                                        (GActionGroup *action_group,
                                                         const gchar *action_name,
                                                         gboolean enabled);

Emits the "action-enabled-changed" signal on action_group.

This function should only be called by GActionGroup implementations.

action_group :

a GActionGroup

action_name :

the name of an action in the group

enabled :

whether or not the action is now enabled

Since 2.28


g_action_group_action_state_changed ()

void                g_action_group_action_state_changed (GActionGroup *action_group,
                                                         const gchar *action_name,
                                                         GVariant *state);

Emits the "action-state-changed" signal on action_group.

This function should only be called by GActionGroup implementations.

action_group :

a GActionGroup

action_name :

the name of an action in the group

state :

the new state of the named action

Since 2.28

Signal Details

The "action-added" signal

void                user_function                      (GActionGroup *action_group,
                                                        gchar        *action_name,
                                                        gpointer      user_data)         : Run Last / Has Details

Signals that a new action was just added to the group. This signal is emitted after the action has been added and is now visible.

action_group :

the GActionGroup that changed

action_name :

the name of the action in action_group

user_data :

user data set when the signal handler was connected.

Since 2.28


The "action-enabled-changed" signal

void                user_function                      (GActionGroup *action_group,
                                                        gchar        *action_name,
                                                        gboolean      enabled,
                                                        gpointer      user_data)         : Run Last / Has Details

Signals that the enabled status of the named action has changed.

action_group :

the GActionGroup that changed

action_name :

the name of the action in action_group

enabled :

whether the action is enabled or not

user_data :

user data set when the signal handler was connected.

Since 2.28


The "action-removed" signal

void                user_function                      (GActionGroup *action_group,
                                                        gchar        *action_name,
                                                        gpointer      user_data)         : Run Last / Has Details

Signals that an action is just about to be removed from the group. This signal is emitted before the action is removed, so the action is still visible and can be queried from the signal handler.

action_group :

the GActionGroup that changed

action_name :

the name of the action in action_group

user_data :

user data set when the signal handler was connected.

Since 2.28


The "action-state-changed" signal

void                user_function                      (GActionGroup *action_group,
                                                        gchar        *action_name,
                                                        GVariant      value,
                                                        gpointer      user_data)         : Run Last / Has Details

Signals that the state of the named action has changed.

action_group :

the GActionGroup that changed

action_name :

the name of the action in action_group

value :

the new value of the state

user_data :

user data set when the signal handler was connected.

Since 2.28