[gtk] widget: Teach query_action about property actions



commit 1f0904d3df088299f1366bbc1b479c76d508c81d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 22 20:42:45 2019 +0000

    widget: Teach query_action about property actions
    
    This might be useful for documentation purposes.

 gtk/gtkwidget.c | 9 ++++++---
 gtk/gtkwidget.h | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index d1394613f6..944cf85d18 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -13595,7 +13595,7 @@ gtk_widget_action_set_enabled (GtkWidget  *widget,
  * @owner: the type where the action was defined
  * @action_name: return location for the action name
  * @parameter_type: return location for the parameter type
- * @state_type: return location for the state type
+ * @property_name: return location for the property name
  *
  * Queries the actions that have been installed for
  * a widget class using gtk_widget_class_install_action()
@@ -13614,7 +13614,7 @@ gtk_widget_class_query_action (GtkWidgetClass      *widget_class,
                                GType               *owner,
                                const char         **action_name,
                                const GVariantType **parameter_type,
-                               const GVariantType **state_type)
+                               const char         **property_name)
 {
   GtkWidgetClassPrivate *priv = widget_class->priv;
 
@@ -13625,7 +13625,10 @@ gtk_widget_class_query_action (GtkWidgetClass      *widget_class,
       *owner = action->owner;
       *action_name = action->name;
       *parameter_type = action->parameter_type;
-      *state_type = action->state_type;
+      if (action->pspec)
+        *property_name = action->pspec->name;
+      else
+        *property_name = NULL;
 
       return TRUE;
     }
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 11ffe96a6b..e2cec9400a 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -1055,7 +1055,7 @@ gboolean               gtk_widget_class_query_action  (GtkWidgetClass      *widg
                                                        GType               *owner,
                                                        const char         **action_name,
                                                        const GVariantType **parameter_type,
-                                                       const GVariantType **state_type);
+                                                       const char         **property_name);
 
 GDK_AVAILABLE_IN_ALL
 void                    gtk_widget_action_set_enabled (GtkWidget  *widget,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]