+static gboolean
+g_action_group_real_has_action (GActionGroup *action_group,
+ const gchar *action_name)
+{
+ return g_action_group_query_action (action_group, action_name, NULL, NULL, NULL, NULL, NULL);
+}
+
+static gboolean
+g_action_group_real_get_action_enabled (GActionGroup *action_group,
+ const gchar *action_name)
+{
+ gboolean enabled = FALSE;
+
+ g_action_group_query_action (action_group, action_name, &enabled, NULL, NULL, NULL, NULL);
+
+ return enabled;
+}
+
+static const GVariantType *
+g_action_group_real_get_action_parameter_type (GActionGroup *action_group,
+ const gchar *action_name)
+{
+ const GVariantType *type = NULL;
+
+ g_action_group_query_action (action_group, action_name, NULL, &type, NULL, NULL, NULL);
+
+ return type;
+}
+
+static const GVariantType *
+g_action_group_real_get_action_state_type (GActionGroup *action_group,
+ const gchar *action_name)
+{
+ const GVariantType *type = NULL;
+
+ g_action_group_query_action (action_group, action_name, NULL, NULL, &type, NULL, NULL);
+
+ return type;
+}
+
+static GVariant *
+g_action_group_real_get_action_state_hint (GActionGroup *action_group,
+ const gchar *action_name)
+{
+ GVariant *hint = NULL;
+
+ g_action_group_query_action (action_group, action_name, NULL, NULL, NULL, &hint, NULL);
+
+ return hint;
+}
+
+static GVariant *
+g_action_group_real_get_action_state (GActionGroup *action_group,
+ const gchar *action_name)
+{
+ GVariant *state = NULL;
+
+ g_action_group_query_action (action_group, action_name, NULL, NULL, NULL, NULL, &state);
+
+ return state;
+}
+
+static gboolean
+g_action_group_real_query_action (GActionGroup *action_group,
+ const gchar *action_name,
+ gboolean *enabled,
+ const GVariantType **parameter_type,
+ const GVariantType **state_type,
+ GVariant **state_hint,
+ GVariant **state)
+{
+ GActionGroupInterface *iface = G_ACTION_GROUP_GET_IFACE (action_group);
+
+ /* we expect implementations to override this method, but we also
+ * allow for implementations that existed before this method was
+ * introduced to override the individual accessors instead.
+ *
+ * detect the case that neither has happened and report it.
+ */
+ if G_UNLIKELY (iface->has_action == g_action_group_real_has_action ||
+ iface->get_action_enabled == g_action_group_real_get_action_enabled ||
+ iface->get_action_parameter_type == g_action_group_real_get_action_parameter_type ||
+ iface->get_action_state_type == g_action_group_real_get_action_state_type ||
+ iface->get_action_state_hint == g_action_group_real_get_action_state_hint ||
+ iface->get_action_state == g_action_group_real_get_action_state)
+ {
+ g_critical ("Class '%s' implements GActionGroup interface without overriding "
+ "query_action() method -- bailing out to avoid infinite recursion.",
+ G_OBJECT_TYPE_NAME (action_group));
+ return FALSE;
+ }
+
+ if (!(* iface->has_action) (action_group, action_name))
+ return FALSE;
+
+ if (enabled != NULL)
+ *enabled = (* iface->get_action_enabled) (action_group, action_name);
+
+ if (parameter_type != NULL)
+ *parameter_type = (* iface->get_action_parameter_type) (action_group, action_name);
+
+ if (state_type != NULL)
+ *state_type = (* iface->get_action_state_type) (action_group, action_name);
+
+ if (state_hint != NULL)
+ *state_hint = (* iface->get_action_state_hint) (action_group, action_name);
+
+ if (state != NULL)
+ *state = (* iface->get_action_state) (action_group, action_name);
+
+ return TRUE;
+}
+