Method

GioActionGroupquery_action

Declaration

gboolean
g_action_group_query_action (
  GActionGroup* action_group,
  const gchar* action_name,
  gboolean* enabled,
  const GVariantType** parameter_type,
  const GVariantType** state_type,
  GVariant** state_hint,
  GVariant** state
)

Description

Queries all aspects of the named action within an action_group.

This function acquires the information available from g_action_group_has_action(), g_action_group_get_action_enabled(), g_action_group_get_action_parameter_type(), g_action_group_get_action_state_type(), g_action_group_get_action_state_hint() and g_action_group_get_action_state() with a single function call.

This provides two main benefits.

The first is the improvement in efficiency that comes with not having to perform repeated lookups of the action in order to discover different things about it. The second is that implementing GActionGroup can now be done by only overriding this one virtual function.

The interface provides a default implementation of this function that calls the individual functions, as required, to fetch the information. The interface also provides default implementations of those functions that call this function. All implementations, therefore, must override either this function or all of the others.

If the action exists, TRUE is returned and any of the requested fields (as indicated by having a non-NULL reference passed in) are filled. If the action doesn’t exist, FALSE is returned and the fields may or may not have been modified.

Available since:2.32

Parameters

action_name const gchar*
 

The name of an action in the group.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
enabled gboolean*
 

If the action is presently enabled.

 The argument will be set by the function.
 The instance takes ownership of the data, and is responsible for freeing it.
parameter_type GVariantType
 

The parameter type, or NULL if none needed.

 The argument will be set by the function.
 The argument can be NULL.
 The instance takes ownership of the data, and is responsible for freeing it.
state_type GVariantType
 

The state type, or NULL if stateless.

 The argument will be set by the function.
 The argument can be NULL.
 The instance takes ownership of the data, and is responsible for freeing it.
state_hint GVariant
 

The state hint, or NULL if none.

 The argument will be set by the function.
 The argument can be NULL.
 The instance takes ownership of the data, and is responsible for freeing it.
state GVariant
 

The current state, or NULL if stateless.

 The argument will be set by the function.
 The argument can be NULL.
 The instance takes ownership of the data, and is responsible for freeing it.

Return value

Returns: gboolean
 

TRUE if the action exists, else FALSE.