-struct _GActionPrivate
-{
- gchar *name;
- GVariantType *parameter_type;
- guint enabled : 1;
- guint state_set : 1;
- GVariant *state;
-};
-
-enum
-{
- PROP_NONE,
- PROP_NAME,
- PROP_PARAMETER_TYPE,
- PROP_ENABLED,
- PROP_STATE_TYPE,
- PROP_STATE
-};
-
-enum
-{
- SIGNAL_ACTIVATE,
- NR_SIGNALS
-};
-
-static guint g_action_signals[NR_SIGNALS];
-
-static void
-g_action_real_set_state (GAction *action,
- GVariant *value)
-{
- if (action->priv->state == value)
- return;
-
- if (!action->priv->state || !g_variant_equal (action->priv->state, value))
- {
- if (action->priv->state)
- g_variant_unref (action->priv->state);
-
- action->priv->state = g_variant_ref (value);
-
- g_object_notify (G_OBJECT (action), "state");
- }
-}
-
-static GVariant *
-g_action_real_get_state_hint (GAction *action)
-{
- return NULL;
-}
-
-static void
-g_action_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GAction *action = G_ACTION (object);
-
- switch (prop_id)
- {
- case PROP_NAME:
- g_assert (action->priv->name == NULL);
- action->priv->name = g_value_dup_string (value);
- break;
-
- case PROP_PARAMETER_TYPE:
- g_assert (action->priv->parameter_type == NULL);
- action->priv->parameter_type = g_value_dup_boxed (value);
- break;
-
- case PROP_ENABLED:
- g_action_set_enabled (action, g_value_get_boolean (value));
- break;
-
- case PROP_STATE:
- /* PROP_STATE is marked as G_PARAM_CONSTRUCT so we always get a
- * call during object construction, even if it is NULL. We treat
- * that first call differently, for a number of reasons.
- *
- * First, we don't want the value to be rejected by the
- * possibly-overridden .set_state() function. Second, we don't
- * want to be tripped by the assertions in g_action_set_state()
- * that would enforce the catch22 that we only provide a value of
- * the same type as the existing value (when there is not yet an
- * existing value).
- */
- if (action->priv->state_set)
- g_action_set_state (action, g_value_get_variant (value));
-
- else /* this is the special case */
- {
- /* only do it the first time. */
- action->priv->state_set = TRUE;
-
- /* blindly set it. */
- action->priv->state = g_value_dup_variant (value);
- }
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-static void
-g_action_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GAction *action = G_ACTION (object);
-
- switch (prop_id)
- {
- case PROP_NAME:
- g_value_set_string (value, g_action_get_name (action));
- break;
-
- case PROP_PARAMETER_TYPE:
- g_value_set_boxed (value, g_action_get_parameter_type (action));
- break;
-
- case PROP_ENABLED:
- g_value_set_boolean (value, g_action_get_enabled (action));
- break;
-
- case PROP_STATE_TYPE:
- g_value_set_boxed (value, g_action_get_state_type (action));
- break;
-
- case PROP_STATE:
- g_value_take_variant (value, g_action_get_state (action));
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-static void
-g_action_finalize (GObject *object)
-{
- GAction *action = G_ACTION (object);
-
- g_free (action->priv->name);
- if (action->priv->parameter_type)
- g_variant_type_free (action->priv->parameter_type);
- if (action->priv->state)
- g_variant_unref (action->priv->state);
-
- G_OBJECT_CLASS (g_action_parent_class)
- ->finalize (object);
-}
-
-void
-g_action_init (GAction *action)
-{
- action->priv = G_TYPE_INSTANCE_GET_PRIVATE (action,
- G_TYPE_ACTION,
- GActionPrivate);
-}
+/**
+ * GActionInterface:
+ * @get_name: the virtual function pointer for g_action_get_name()
+ * @get_parameter_type: the virtual function pointer for g_action_get_parameter_type()
+ * @get_state_type: the virtual function pointer for g_action_get_state_type()
+ * @get_state_hint: the virtual function pointer for g_action_get_state_hint()
+ * @get_enabled: the virtual function pointer for g_action_get_enabled()
+ * @get_state: the virtual function pointer for g_action_get_state()
+ * @change_state: the virtual function pointer for g_action_change_state()
+ * @activate: the virtual function pointer for g_action_activate(). Note that #GAction does not have an
+ * 'activate' signal but that implementations of it may have one.
+ *
+ * The virtual function table for #GAction.
+ *
+ * Since: 2.28
+ */