]> Pileus Git - ~andy/gtk/commitdiff
New function to get the action for a proxy. (#326288)
authorMatthias Clasen <mclasen@redhat.com>
Mon, 9 Jan 2006 18:07:14 +0000 (18:07 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 9 Jan 2006 18:07:14 +0000 (18:07 +0000)
2006-01-09  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtk.symbols:
* gtk/gtkaction.h:
* gtk/gtkaction.c (gtk_widget_get_action): New function to
get the action for a proxy.  (#326288)

ChangeLog
ChangeLog.pre-2-10
docs/reference/ChangeLog
docs/reference/gtk/gtk-sections.txt
gtk/gtk.symbols
gtk/gtkaction.c
gtk/gtkaction.h

index 73f011464415c8ca747631bcc54108624336a572..b42283bb20744bec4b1e13c73e792fbdbc094296 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-01-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtk.symbols:
+       * gtk/gtkaction.h: 
+       * gtk/gtkaction.c (gtk_widget_get_action): New function to
+       get the action for a proxy.  (#326288)
+
        * gtk/gtkaction.c: Go back to the old key for attaching the
        action to the proxy.  (#326288, Diego González)
 
index 73f011464415c8ca747631bcc54108624336a572..b42283bb20744bec4b1e13c73e792fbdbc094296 100644 (file)
@@ -1,5 +1,10 @@
 2006-01-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtk.symbols:
+       * gtk/gtkaction.h: 
+       * gtk/gtkaction.c (gtk_widget_get_action): New function to
+       get the action for a proxy.  (#326288)
+
        * gtk/gtkaction.c: Go back to the old key for attaching the
        action to the proxy.  (#326288, Diego González)
 
index 3f7a9ceaff2e9439a006c73e875ee2ff53d4e147..3c8e92767d5f2fcaccd9ce402d795cae0e3b946c 100644 (file)
@@ -1,3 +1,7 @@
+2006-01-09  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk-sections.txt: Add gtk_widget_get_action
+
 2005-12-30  Matthias Clasen  <mclasen@redhat.com>
 
        * gdk/gdk-sections.txt: Add gdk_cairo_set_source_pixmap
index 05f801413331291a21f97a318796b5e9972bab94..e02cb5e56d97d68f920160d55fdc1d0143f4a7f7 100644 (file)
@@ -4728,6 +4728,7 @@ gtk_widget_get_no_show_all
 gtk_widget_list_mnemonic_labels
 gtk_widget_add_mnemonic_label
 gtk_widget_remove_mnemonic_label
+gtk_widget_get_action
 <SUBSECTION>
 gtk_requisition_copy
 gtk_requisition_free
index e9413cac42d42b137acfa5cd8699e58237efde0c..4fcfd20108ccbe5d36ebae7dd11c2ec3cea6f1d4 100644 (file)
@@ -146,6 +146,7 @@ gtk_action_get_accel_closure
 gtk_action_get_accel_path
 gtk_action_get_name
 gtk_action_get_proxies
+gtk_widget_get_action
 gtk_action_get_sensitive
 gtk_action_get_type G_GNUC_CONST
 gtk_action_get_visible
index 06b4f8054a6de7f0c0af26eb008715056fa18acf..efaf18ce91645d075190661d7c683588feb9ca09 100644 (file)
@@ -980,9 +980,10 @@ gtk_action_disconnect_proxy (GtkAction *action,
  * @action: the action object
  * 
  * Returns the proxy widgets for an action.
+ * See also gtk_widget_get_action().
  * 
- * Return value: a #GSList of proxy widgets. The list is owned by the action and
- * must not be modified.
+ * Return value: a #GSList of proxy widgets. The list is owned by GTK+
+ * and must not be modified.
  *
  * Since: 2.4
  **/
@@ -995,6 +996,27 @@ gtk_action_get_proxies (GtkAction *action)
 }
 
 
+/**
+ * gtk_widget_get_action:
+ * @widget: a #GtkWidget
+ *
+ * Returns the #GtkAction that @widget is a proxy for. 
+ * See also gtk_action_get_proxies().
+ *
+ * Returns: the action that a widget is a proxy for, or
+ *  %NULL, if it is not attached to an action.
+ *
+ * Since: 2.10
+ */
+GtkAction*
+gtk_widget_get_action (GtkWidget *widget)
+{
+  g_return_val_if_fail (GTK_IS_WIDGET (action), NULL);
+  
+  return g_object_get_qdata (G_OBJECT (widget), quark_gtk_action_proxy);
+}
+
+
 /**
  * gtk_action_get_name:
  * @action: the action object
index f7f4c04bfda002845228ee1157f634df07c66a9f..e1f3b128788bbb5ef76af41eab1de433427acbe3 100644 (file)
@@ -104,6 +104,7 @@ void         gtk_action_connect_proxy          (GtkAction     *action,
 void         gtk_action_disconnect_proxy       (GtkAction     *action,
                                                GtkWidget     *proxy);
 GSList*      gtk_action_get_proxies            (GtkAction     *action);
+GtkAction   *gtk_widget_get_action             (GtkWidget     *widget);
 void         gtk_action_connect_accelerator    (GtkAction     *action);
 void         gtk_action_disconnect_accelerator (GtkAction     *action);
 G_CONST_RETURN gchar *gtk_action_get_accel_path (GtkAction     *action);