gtk+ r22153 - in trunk: . docs/reference docs/reference/gtk gtk



Author: matthiasc
Date: Wed Jan 21 02:53:45 2009
New Revision: 22153
URL: http://svn.gnome.org/viewvc/gtk+?rev=22153&view=rev

Log:
        * gtk/gtk.symbols:
        * gtk/gtkaction.[hc]: Add setters and getters for GtkAction
        properties, in preparation for bug 560228.



Modified:
   trunk/ChangeLog
   trunk/docs/reference/ChangeLog
   trunk/docs/reference/gtk/gtk-sections.txt
   trunk/gtk/gtk.symbols
   trunk/gtk/gtkaction.c
   trunk/gtk/gtkaction.h

Modified: trunk/docs/reference/gtk/gtk-sections.txt
==============================================================================
--- trunk/docs/reference/gtk/gtk-sections.txt	(original)
+++ trunk/docs/reference/gtk/gtk-sections.txt	Wed Jan 21 02:53:45 2009
@@ -194,6 +194,25 @@
 gtk_action_set_accel_path
 gtk_action_get_accel_closure
 gtk_action_set_accel_group
+gtk_action_set_label
+gtk_action_get_label
+gtk_action_set_short_label
+gtk_action_get_short_label
+gtk_action_set_tooltip
+gtk_action_get_tooltip
+gtk_action_set_stock_id
+gtk_action_get_stock_id
+gtk_action_set_gicon
+gtk_action_get_gicon
+gtk_action_set_icon_name
+gtk_action_get_icon_name
+gtk_action_set_visible_horizontal
+gtk_action_get_visible_horizontal
+gtk_action_set_visible_vertical
+gtk_action_get_visible_vertical
+gtk_action_set_is_important
+gtk_action_get_is_important
+
 <SUBSECTION Standard>
 GTK_TYPE_ACTION
 GTK_ACTION

Modified: trunk/gtk/gtk.symbols
==============================================================================
--- trunk/gtk/gtk.symbols	(original)
+++ trunk/gtk/gtk.symbols	Wed Jan 21 02:53:45 2009
@@ -169,6 +169,24 @@
 gtk_action_set_sensitive
 gtk_action_set_visible
 gtk_action_unblock_activate_from
+gtk_action_set_label
+gtk_action_get_label
+gtk_action_set_short_label
+gtk_action_get_short_label
+gtk_action_set_tooltip
+gtk_action_get_tooltip
+gtk_action_set_stock_id
+gtk_action_get_stock_id
+gtk_action_set_gicon
+gtk_action_get_gicon
+gtk_action_set_icon_name
+gtk_action_get_icon_name
+gtk_action_set_visible_horizontal
+gtk_action_get_visible_horizontal
+gtk_action_set_visible_vertical
+gtk_action_get_visible_vertical
+gtk_action_set_is_important
+gtk_action_get_is_important
 #endif
 #endif
 

Modified: trunk/gtk/gtkaction.c
==============================================================================
--- trunk/gtk/gtkaction.c	(original)
+++ trunk/gtk/gtkaction.c	Wed Jan 21 02:53:45 2009
@@ -135,26 +135,8 @@
 				     GParamSpec      *pspec);
 static void gtk_action_set_action_group (GtkAction	*action,
 					 GtkActionGroup *action_group);
-static void gtk_action_set_is_important (GtkAction	*action,
-					 gboolean        is_important);
-static void gtk_action_set_label        (GtkAction	*action,
-					 const gchar    *label);
-static void gtk_action_set_short_label  (GtkAction	*action,
-					 const gchar    *label);
-static void gtk_action_set_visible_horizontal (GtkAction *action,
-					       gboolean   visible_horizontal);
-static void gtk_action_set_visible_vertical   (GtkAction *action,
-					       gboolean   visible_vertical);
-static void gtk_action_set_tooltip      (GtkAction	*action,
-					 const gchar    *tooltip);
-static void gtk_action_set_stock_id     (GtkAction	*action,
-					 const gchar    *stock_id);
-static void gtk_action_set_icon_name     (GtkAction	*action,
-					 const gchar    *icon_name);
 static void gtk_action_sync_tooltip     (GtkAction      *action,
 					 GtkWidget      *proxy);
-static void gtk_action_set_gicon        (GtkAction *action,
-                                         GIcon     *icon);
 
 static GtkWidget *create_menu_item    (GtkAction *action);
 static GtkWidget *create_tool_item    (GtkAction *action);
@@ -221,6 +203,12 @@
 							   "that activate this action."),
 							NULL,
 							GTK_PARAM_READWRITE));
+
+  /**
+   * GtkAction:short-label:
+   *
+   * A shorter label that may be used on toolbar buttons.
+   */
   g_object_class_install_property (gobject_class,
 				   PROP_SHORT_LABEL,
 				   g_param_spec_string ("short-label",
@@ -228,6 +216,8 @@
 							P_("A shorter label that may be used on toolbar buttons."),
 							NULL,
 							GTK_PARAM_READWRITE));
+
+
   g_object_class_install_property (gobject_class,
 				   PROP_TOOLTIP,
 				   g_param_spec_string ("tooltip",
@@ -235,6 +225,12 @@
 							P_("A tooltip for this action."),
 							NULL,
 							GTK_PARAM_READWRITE));
+
+  /**
+   * GtkAction:stock-id:
+   *
+   * The stock icon displayed in widgets representing this action.
+   */
   g_object_class_install_property (gobject_class,
 				   PROP_STOCK_ID,
 				   g_param_spec_string ("stock-id",
@@ -1363,14 +1359,26 @@
       g_object_notify (G_OBJECT (action), "visible");
     }
 }
-
-static void 
+/**
+ * gtk_action_set_is_important:
+ * @action: the action object
+ * @is_important: %TRUE to make the action important
+ *
+ * Sets whether the action is important, this attribute is used
+ * primarily by toolbar items to decide whether to show a label
+ * or not.
+ *
+ * Since: 2.16
+ */
+void 
 gtk_action_set_is_important (GtkAction *action,
 			     gboolean   is_important)
 {
   GSList *p;
   GtkWidget *proxy;
 
+  g_return_if_fail (GTK_IS_ACTION (action));
+
   is_important = is_important != FALSE;
   
   if (action->private_data->is_important != is_important)
@@ -1390,7 +1398,34 @@
     }  
 }
 
-static void 
+/**
+ * gtk_action_get_is_important:
+ * @action: a #GtkAction
+ *
+ * Checks whether @action is important or not
+ *
+ * Returns: whether @action is important
+ *
+ * Since: 2.16
+ */
+gboolean
+gtk_action_get_is_important (GtkAction *action)
+{
+  g_return_val_if_fail (GTK_IS_ACTION (action), FALSE);
+
+  return action->private_data->is_important;
+}
+
+/**
+ * gtk_action_set_label:
+ * @action: a #GtkAction
+ * @label: the label text to set
+ *
+ * Sets the label of @action.
+ *
+ * Since: 2.16
+ */
+void 
 gtk_action_set_label (GtkAction	  *action,
 		      const gchar *label)
 {
@@ -1398,6 +1433,8 @@
   GtkWidget *proxy, *child;
   gchar *tmp;
   
+  g_return_if_fail (GTK_IS_ACTION (action));
+  
   tmp = action->private_data->label;
   action->private_data->label = g_strdup (label);
   g_free (tmp);
@@ -1435,7 +1472,34 @@
     }
 }
 
-static void 
+/**
+ * gtk_action_get_label:
+ * @action: a #GtkAction
+ *
+ * Gets the label text of @action.
+ *
+ * Returns: the label text
+ *
+ * Since: 2.16
+ */
+G_CONST_RETURN gchar *
+gtk_action_get_label (GtkAction *action)
+{
+  g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
+
+  return action->private_data->label;
+}
+
+/**
+ * gtk_action_set_short_label:
+ * @action: a #GtkAction
+ * @label: the label text to set
+ *
+ * Sets a shorter label on @action.
+ *
+ * Since: 2.16
+ */
+void 
 gtk_action_set_short_label (GtkAction	*action,
 			    const gchar *label)
 {
@@ -1443,6 +1507,8 @@
   GtkWidget *proxy, *child;
   gchar *tmp;
 
+  g_return_if_fail (GTK_IS_ACTION (action));
+
   tmp = action->private_data->short_label;
   action->private_data->short_label = g_strdup (label);
   g_free (tmp);
@@ -1477,13 +1543,42 @@
   g_object_notify (G_OBJECT (action), "short-label");
 }
 
-static void 
+/**
+ * gtk_action_get_short_label:
+ * @action: a #GtkAction
+ * @label: the label text to set
+ *
+ * Sets a shorter label on @action.
+ *
+ * Since: 2.16
+ */
+G_CONST_RETURN gchar *
+gtk_action_get_short_label (GtkAction *action)
+{
+  g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
+
+  g_object_notify (G_OBJECT (action), "short-label");
+  return action->private_data->short_label;
+}
+
+/**
+ * gtk_action_set_visible_horizontal:
+ * @action: a #GtkAction
+ * @visible_horizontal: whether the action is visible horizontally
+ *
+ * Sets whether @action is visible when horizontal
+ *
+ * Since: 2.16
+ */
+void 
 gtk_action_set_visible_horizontal (GtkAction *action,
 				   gboolean   visible_horizontal)
 {
   GSList *p;
   GtkWidget *proxy;
 
+  g_return_if_fail (GTK_IS_ACTION (action));
+
   visible_horizontal = visible_horizontal != FALSE;
   
   if (action->private_data->visible_horizontal != visible_horizontal)
@@ -1503,13 +1598,42 @@
     }  
 }
 
-static void 
+/**
+ * gtk_action_get_visible_horizontal:
+ * @action: a #GtkAction
+ *
+ * Checks whether @action is visible when horizontal
+ *
+ * Returns: whether @action is visible when horizontal
+ *
+ * Since: 2.16
+ */
+gboolean
+gtk_action_get_visible_horizontal (GtkAction *action)
+{
+  g_return_val_if_fail (GTK_IS_ACTION (action), FALSE);
+
+  return action->private_data->visible_horizontal;
+}
+
+/**
+ * gtk_action_set_visible_vertical:
+ * @action: a #GtkAction
+ * @visible_vertical: whether the action is visible vertically
+ *
+ * Sets whether @action is visible when vertical
+ *
+ * Since: 2.16
+ */
+void 
 gtk_action_set_visible_vertical (GtkAction *action,
 				 gboolean   visible_vertical)
 {
   GSList *p;
   GtkWidget *proxy;
 
+  g_return_if_fail (GTK_IS_ACTION (action));
+
   visible_vertical = visible_vertical != FALSE;
   
   if (action->private_data->visible_vertical != visible_vertical)
@@ -1529,6 +1653,24 @@
     }  
 }
 
+/**
+ * gtk_action_get_visible_vertical:
+ * @action: a #GtkAction
+ *
+ * Checks whether @action is visible when horizontal
+ *
+ * Returns: whether @action is visible when horizontal
+ *
+ * Since: 2.16
+ */
+gboolean
+gtk_action_get_visible_vertical (GtkAction *action)
+{
+  g_return_val_if_fail (GTK_IS_ACTION (action), FALSE);
+
+  return action->private_data->visible_vertical;
+}
+
 static void 
 gtk_action_sync_tooltip (GtkAction *action,
 			 GtkWidget *proxy)
@@ -1537,7 +1679,16 @@
 				  action->private_data->tooltip);
 }
 
-static void 
+/**
+ * gtk_action_set_tooltip:
+ * @action: a #GtkAction
+ * @tooltip: the tooltip text
+ *
+ * Sets the tooltip text on @action
+ *
+ * Since: 2.16
+ */
+void 
 gtk_action_set_tooltip (GtkAction   *action,
 			const gchar *tooltip)
 {
@@ -1545,6 +1696,8 @@
   GtkWidget *proxy;
   gchar *tmp;
 
+  g_return_if_fail (GTK_IS_ACTION (action));
+
   tmp = action->private_data->tooltip;
   action->private_data->tooltip = g_strdup (tooltip);
   g_free (tmp);
@@ -1560,7 +1713,34 @@
   g_object_notify (G_OBJECT (action), "tooltip");
 }
 
-static void 
+/**
+ * gtk_action_get_tooltip:
+ * @action: a #GtkAction
+ *
+ * Gets the tooltip text of @action.
+ *
+* Returns: the tooltip text
+ *
+ * Since: 2.16
+ */
+G_CONST_RETURN gchar *
+gtk_action_get_tooltip (GtkAction *action)
+{
+  g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
+
+  return action->private_data->tooltip;
+}
+
+/**
+ * gtk_action_set_stock_id:
+ * @action: a #GtkAction
+ * @tooltip: the tooltip text
+ *
+ * Sets the stock id on @action
+ *
+ * Since: 2.16
+ */
+void 
 gtk_action_set_stock_id (GtkAction   *action,
 			 const gchar *stock_id)
 {
@@ -1568,6 +1748,8 @@
   GtkWidget *proxy, *image;
   gchar *tmp;
   
+  g_return_if_fail (GTK_IS_ACTION (action));
+
   tmp = action->private_data->stock_id;
   action->private_data->stock_id = g_strdup (stock_id);
   g_free (tmp);
@@ -1615,7 +1797,34 @@
     }
 }
 
-static void 
+/**
+ * gtk_action_get_stock_id:
+ * @action: a #GtkAction
+ *
+ * Gets the stock id of @action.
+ *
+ * Returns: the stock id
+ *
+ * Since: 2.16
+ */
+G_CONST_RETURN gchar *
+gtk_action_get_stock_id (GtkAction *action)
+{
+  g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
+
+  return action->private_data->stock_id;
+}
+
+/**
+ * gtk_action_set_icon_name:
+ * @action: a #GtkAction
+ * @tooltip: the icon name to set
+ *
+ * Sets the icon name on @action
+ *
+ * Since: 2.16
+ */
+void 
 gtk_action_set_icon_name (GtkAction   *action,
 			  const gchar *icon_name)
 {
@@ -1623,6 +1832,8 @@
   GtkWidget *proxy, *image;
   gchar *tmp;
   
+  g_return_if_fail (GTK_IS_ACTION (action));
+
   tmp = action->private_data->icon_name;
   action->private_data->icon_name = g_strdup (icon_name);
   g_free (tmp);
@@ -1662,7 +1873,34 @@
   g_object_notify (G_OBJECT (action), "icon-name");
 }
 
-static void
+/**
+ * gtk_action_get_icon_name:
+ * @action: a #GtkAction
+ *
+ * Gets the icon name of @action.
+ *
+ * Returns: the icon name
+ *
+ * Since: 2.16
+ */
+G_CONST_RETURN gchar *
+gtk_action_get_icon_name (GtkAction *action)
+{
+  g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
+
+  return action->private_data->icon_name;
+}
+
+/**
+ * gtk_action_set_gicon:
+ * @action: a #GtkAction
+ * @icon: the #GIcon to set
+ *
+ * Sets the icon of @action.
+ *
+ * Since: 2.16
+ */
+void
 gtk_action_set_gicon (GtkAction *action,
                       GIcon     *icon)
 {
@@ -1671,6 +1909,8 @@
   GtkIconSize icon_size;
   gboolean has_stock_icon;
   
+  g_return_if_fail (GTK_IS_ACTION (action));
+
   if (action->private_data->gicon)
     g_object_unref (action->private_data->gicon);
 
@@ -1725,6 +1965,24 @@
 }
 
 /**
+ * gtk_action_get_gicon:
+ * @action: a #GtkAction
+ *
+ * Gets the gicon of @action.
+ *
+ * Returns: The action's #GIcon if one is set.
+ *
+ * Since: 2.16
+ */
+GIcon *
+gtk_action_get_gicon (GtkAction *action)
+{
+  g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
+
+  return action->private_data->gicon;
+}
+
+/**
  * gtk_action_block_activate_from:
  * @action: the action object
  * @proxy: a proxy widget

Modified: trunk/gtk/gtkaction.h
==============================================================================
--- trunk/gtk/gtkaction.h	(original)
+++ trunk/gtk/gtkaction.h	Wed Jan 21 02:53:45 2009
@@ -134,6 +134,35 @@
 						GtkWidget     *proxy,
 						gboolean       empty);
 
+void                  gtk_action_set_label              (GtkAction   *action,
+                                                         const gchar *label);
+G_CONST_RETURN gchar *gtk_action_get_label              (GtkAction   *action);
+void                  gtk_action_set_short_label        (GtkAction   *action,
+                                                         const gchar *short_label);
+G_CONST_RETURN gchar *gtk_action_get_short_label        (GtkAction   *action);
+void                  gtk_action_set_tooltip            (GtkAction   *action,
+                                                         const gchar *tooltip);
+G_CONST_RETURN gchar *gtk_action_get_tooltip            (GtkAction   *action);
+void                  gtk_action_set_stock_id           (GtkAction   *action,
+                                                         const gchar *stock_id);
+G_CONST_RETURN gchar *gtk_action_get_stock_id           (GtkAction   *action);
+void                  gtk_action_set_gicon              (GtkAction   *action,
+                                                         GIcon       *icon);
+GIcon                *gtk_action_get_gicon              (GtkAction   *action);
+void                  gtk_action_set_icon_name          (GtkAction   *action,
+                                                         const gchar *icon_name);
+G_CONST_RETURN gchar *gtk_action_get_icon_name          (GtkAction   *action);
+void                  gtk_action_set_visible_horizontal (GtkAction   *action,
+                                                         gboolean     visible_horizontal);
+gboolean              gtk_action_get_visible_horizontal (GtkAction   *action);
+void                  gtk_action_set_visible_vertical   (GtkAction   *action,
+                                                         gboolean     visible_vertical);
+gboolean              gtk_action_get_visible_vertical   (GtkAction   *action);
+void                  gtk_action_set_is_important       (GtkAction   *action,
+                                                         gboolean     is_important);
+gboolean              gtk_action_get_is_important       (GtkAction   *action);
+
+
 G_END_DECLS
 
 #endif  /* __GTK_ACTION_H__ */



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