[Xfce4-commits] [xfce/libxfce4ui] 01/02: Added methods to replace deprecated GtkAction, GtkActionEntry and GtkUiManager in order to keep simple menu creation

noreply at xfce.org noreply at xfce.org
Tue Mar 24 22:31:10 CET 2020


This is an automated email from the git hooks/post-receive script.

a   l   e   x       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/libxfce4ui.

commit 231e57daccb5946379f413ed440629c32025f6f3
Author: Alexander Schwinn <alexxcons at xfce.org>
Date:   Mon Mar 9 23:23:07 2020 +0100

    Added methods to replace deprecated GtkAction, GtkActionEntry and GtkUiManager in order to keep simple menu creation
---
 libxfce4ui/xfce-gtk-extensions.c | 443 +++++++++++++++++++++++++++++++++++++++
 libxfce4ui/xfce-gtk-extensions.h | 129 ++++++++++--
 2 files changed, 554 insertions(+), 18 deletions(-)

diff --git a/libxfce4ui/xfce-gtk-extensions.c b/libxfce4ui/xfce-gtk-extensions.c
index 833fe45..b5e2fd7 100644
--- a/libxfce4ui/xfce-gtk-extensions.c
+++ b/libxfce4ui/xfce-gtk-extensions.c
@@ -50,6 +50,449 @@
 
 
 /**
+ * xfce_gtk_menu_item_fill_base:
+ * @item : #GtkMenuItem which should be filled
+ * @tooltip_text : Tooltip to add on the passed item, or NULL
+ * @accel_path : Unique path, used to identify the accelerator, or NULL
+ * @callback: (scope notified): #GCallback which will be triggered on activation, or NULL
+ * @callback_param : optional callback parameter, or NULL.
+ * @menu_to_append_item : #GtkMenuShell on which the item should be appended, or NULL
+ *
+ * internal Convenience method to fill a menu item.
+ *
+ **/
+static void
+xfce_gtk_menu_item_fill_base (GtkWidget    *item,
+                              const gchar  *tooltip_text,
+                              const gchar  *accel_path,
+                              GCallback     callback,
+                              GObject      *callback_param,
+                              GtkMenuShell *menu_to_append_item)
+{
+  g_return_if_fail (GTK_IS_MENU_ITEM (item));
+
+  if (tooltip_text != NULL)
+    gtk_widget_set_tooltip_text (item, tooltip_text);
+  if (accel_path != NULL)
+    gtk_menu_item_set_accel_path (GTK_MENU_ITEM (item), accel_path);
+  if (callback != NULL)
+    g_signal_connect_swapped (G_OBJECT (item), "activate", callback, callback_param);
+  if (menu_to_append_item != NULL)
+    gtk_menu_shell_append (menu_to_append_item, item);
+  gtk_widget_show (item);
+}
+
+
+
+/**
+ * xfce_gtk_menu_item_new:
+ * @label_text : Label to use for the #GtkMenuItem
+ * @tooltip_text : Tooltip to add on the passed item, or NULL
+ * @accel_path : Unique path, used to identify the accelerator, or NULL
+ * @callback: (scope notified): #GCallback which will be triggered on activation, or NULL
+ * @callback_param : optional callback parameter, or NULL.
+ * @menu_to_append_item : #GtkMenuShell on which the item should be appended, or NULL
+ *
+ * Convenience method to create a #GtkMenuItem and preconfigure it with the passed parameters.
+ *
+ * Return value: (transfer full): A new #GtkMenuItem.
+ *
+ * Since: 4.16
+ **/
+GtkWidget*
+xfce_gtk_menu_item_new (const gchar  *label_text,
+                        const gchar  *tooltip_text,
+                        const gchar  *accel_path,
+                        GCallback     callback,
+                        GObject      *callback_param,
+                        GtkMenuShell  *menu_to_append_item)
+{
+  GtkWidget *item;
+
+  item = gtk_menu_item_new_with_mnemonic (label_text);
+  xfce_gtk_menu_item_fill_base (item, tooltip_text, accel_path, callback, callback_param, menu_to_append_item);
+  return item;
+}
+
+
+
+/**
+ * xfce_gtk_image_menu_item_new_from_icon_name:
+ * @label_text : Label to use for the #GtkImageMenuItem
+ * @tooltip_text : Tooltip to add on the passed item, or NULL
+ * @accel_path : Unique path, used to identify the accelerator, or NULL
+ * @callback: (scope notified): #GCallback which will be triggered on activation, or NULL
+ * @callback_param : optional callback parameter, or NULL.
+ * @icon_name : name of the icon to use for the #GtkImageMenuItem, or NULL
+ * @menu_to_append_item : #GtkMenuShell on which the item should be appended, or NULL
+ *
+ * Convenience method to create a #GtkImageMenuItem and preconfigure it with the passed parameters.
+ *
+ * Return value: (transfer full): A new #GtkImageMenuItem.
+ *
+ * Since: 4.16
+ **/
+GtkWidget*
+xfce_gtk_image_menu_item_new_from_icon_name (const gchar  *label_text,
+                                             const gchar  *tooltip_text,
+                                             const gchar  *accel_path,
+                                             GCallback     callback,
+                                             GObject      *callback_param,
+                                             const gchar  *icon_name,
+                                             GtkMenuShell *menu_to_append_item)
+{
+  GtkWidget *image = NULL;
+
+  image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
+  return xfce_gtk_image_menu_item_new (label_text, tooltip_text, accel_path,
+                                       callback, callback_param, image, menu_to_append_item);
+}
+
+
+
+/**
+ * xfce_gtk_image_menu_item_new:
+ * @label_text : Label to use for the #GtkImageMenuItem
+ * @tooltip_text : Tooltip to add on the passed item, or NULL
+ * @accel_path : Unique path, used to identify the accelerator, or NULL
+ * @callback: (scope notified): #GCallback which will be triggered on activation, or NULL
+ * @callback_param : optional callback parameter, or NULL.
+ * @image : a widget to set as the image for the menu item, or NULL
+ * @menu_to_append_item : #GtkMenuShell on which the item should be appended, or NULL
+ *
+ * Convenience method to create a deprecated #GtkImageMenuItem and preconfigure it with the passed parameters.
+ * In order to prevent G_GNUC_BEGIN_IGNORE_DEPRECATIONS in all xfce projects, this method can be used
+ *
+ * Return value: (transfer full): A new #GtkImageMenuItem.
+ *
+ * Since: 4.16
+ **/
+GtkWidget*
+xfce_gtk_image_menu_item_new (const gchar  *label_text,
+                              const gchar  *tooltip_text,
+                              const gchar  *accel_path,
+                              GCallback     callback,
+                              GObject      *callback_param,
+                              GtkWidget    *image,
+                              GtkMenuShell *menu_to_append_item)
+{
+  GtkWidget *item;
+
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+  item = gtk_image_menu_item_new_with_mnemonic (label_text);
+  G_GNUC_END_IGNORE_DEPRECATIONS
+  xfce_gtk_menu_item_fill_base (item, tooltip_text, accel_path, callback, callback_param, menu_to_append_item);
+  if (image != NULL)
+    {
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+      gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+      G_GNUC_END_IGNORE_DEPRECATIONS
+    }
+  return item;
+}
+
+
+
+/**
+ * xfce_gtk_check_menu_item_new:
+ * @label_text : Label to use for the #GtkCheckMenuItem
+ * @tooltip_text : Tooltip to add on the passed item, or NULL
+ * @accel_path : Unique path, used to identify the accelerator, or NULL
+ * @callback: (scope notified): #GCallback which will be triggered on activation, or NULL
+ * @callback_param : optional callback parameter, or NULL.
+ * @active : boolean value indicating whether the check box is active.
+ * @menu_to_append_item : #GtkMenuShell on which the item should be appended, or NULL
+ *
+ * Convenience method to create a #GtkCheckMenuItem and preconfigure it with the passed parameters.
+ *
+ * Return value: (transfer full): A new #GtkCheckMenuItem.
+ *
+ * Since: 4.16
+ **/
+GtkWidget*
+xfce_gtk_check_menu_item_new (const gchar  *label_text,
+                              const gchar  *tooltip_text,
+                              const gchar  *accel_path,
+                              GCallback     callback,
+                              GObject      *callback_param,
+                              gboolean      active,
+                              GtkMenuShell *menu_to_append_item)
+{
+  GtkWidget *item;
+
+  item = gtk_check_menu_item_new_with_mnemonic (label_text);
+  xfce_gtk_menu_item_fill_base (item, tooltip_text, accel_path, NULL, NULL, menu_to_append_item);
+
+  /* 'gtk_check_menu_item_set_active' has to be done before 'g_signal_connect_swapped', to don't trigger the callback */
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), active);
+  if (callback != NULL)
+    g_signal_connect_swapped (G_OBJECT (item), "toggled", callback, callback_param);
+
+  return item;
+}
+
+
+
+/**
+ * xfce_gtk_radio_menu_item_new:
+ * @label_text : Label to use for the #GtkCheckMenuItem
+ * @tooltip_text : Tooltip to add on the passed item, or NULL
+ * @accel_path : Unique path, used to identify the accelerator, or NULL
+ * @callback: (scope notified): #GCallback which will be triggered on activation, or NULL
+ * @callback_param : optional callback parameter, or NULL.
+ * @active : boolean value indicating whether the check box is active.
+ * @menu_to_append_item : #GtkMenuShell on which the item should be appended, or NULL
+ *
+ * Convenience method to create a #GtkCheckMenuItem and preconfigure it with the passed parameters.
+ * In order to simplify usage, a #GtkCheckMenuItem is created and drawn as radio-item
+ *
+ * Return value: (transfer full): A new #GtkCheckMenuItem.
+ *
+ * Since: 4.16
+ **/
+GtkWidget*
+xfce_gtk_radio_menu_item_new (const gchar  *label_text,
+                              const gchar  *tooltip_text,
+                              const gchar  *accel_path,
+                              GCallback     callback,
+                              GObject      *callback_param,
+                              gboolean      active,
+                              GtkMenuShell *menu_to_append_item)
+{
+  GtkWidget *item;
+
+  /* It's simpler to just use a gtk_check_menu_item and display it with a radio button */
+  item = xfce_gtk_check_menu_item_new (label_text, tooltip_text, accel_path, callback, callback_param, active, menu_to_append_item);
+  gtk_check_menu_item_set_draw_as_radio (GTK_CHECK_MENU_ITEM (item), TRUE);
+
+  return item;
+}
+
+
+
+/**
+ * xfce_gtk_menu_item_new_from_action_entry:
+ * @action_entry : Label to use for the #GtkCheckMenuItem
+ * @callback_param : optional callback parameter, or NULL.
+ * @menu_to_append_item : #GtkMenuShell on which the item should be appended, or NULL
+ *
+ * Method to create a menu item from the passed action entry
+ *
+ * Return value: (transfer full): A new #GtkMenuItem or NULL
+ *
+ * Since: 4.16
+ **/
+GtkWidget*
+xfce_gtk_menu_item_new_from_action_entry (const XfceGtkActionEntry *action_entry,
+                                          GObject                  *callback_param,
+                                          GtkMenuShell             *menu_to_append_item)
+{
+  if (action_entry->menu_item_type == XFCE_GTK_IMAGE_MENU_ITEM)
+    {
+      return xfce_gtk_image_menu_item_new_from_icon_name (action_entry->menu_item_label_text, action_entry->menu_item_tooltip_text,
+                                                          action_entry->accel_path, action_entry->callback,
+                                                          callback_param, action_entry->menu_item_icon_name, menu_to_append_item);
+    }
+  if (action_entry->menu_item_type == XFCE_GTK_MENU_ITEM)
+    {
+      return xfce_gtk_menu_item_new (action_entry->menu_item_label_text, action_entry->menu_item_tooltip_text,
+                                     action_entry->accel_path, action_entry->callback,
+                                     callback_param, menu_to_append_item);
+    }
+  g_warning ("xfce_gtk_menu_item_new_from_action_entry: Unknown item_type");
+  return NULL;
+}
+
+
+
+/**
+ * xfce_gtk_toggle_menu_item_new_from_action_entry:
+ * @action_entry : Label to use for the #GtkCheckMenuItem
+ * @callback_param : optional callback parameter, or NULL.
+ * @menu_to_append_item : #GtkMenuShell on which the item should be appended, or NULL
+ *
+ * Method to create a toggle menu item from the passed action entry
+ *
+ * Return value: (transfer full): A new #GtkMenuItem or NULL
+ *
+ * Since: 4.16
+ **/
+GtkWidget*
+xfce_gtk_toggle_menu_item_new_from_action_entry (const XfceGtkActionEntry *action_entry,
+                                                 GObject                  *callback_param,
+                                                 gboolean                  active,
+                                                 GtkMenuShell             *menu_to_append_item)
+{
+  if (action_entry->menu_item_type == XFCE_GTK_CHECK_MENU_ITEM)
+    {
+      return xfce_gtk_check_menu_item_new (action_entry->menu_item_label_text, action_entry->menu_item_tooltip_text,
+                                           action_entry->accel_path, action_entry->callback,
+                                           callback_param, active, menu_to_append_item);
+    }
+  if (action_entry->menu_item_type == XFCE_GTK_RADIO_MENU_ITEM)
+    {
+      return xfce_gtk_radio_menu_item_new (action_entry->menu_item_label_text, action_entry->menu_item_tooltip_text,
+                                           action_entry->accel_path, action_entry->callback,
+                                           callback_param, active, menu_to_append_item);
+    }
+  g_warning ("xfce_gtk_toggle_menu_item_new_from_action_entry: Unknown item_type");
+  return NULL;
+}
+
+
+
+/**
+ * xfce_gtk_tool_button_new_from_action_entry:
+ * @action_entry : Label to use for the #GtkTolButton
+ * @callback_param : optional callback parameter, or NULL.
+ * @toolbar_to_append_item : #GtkToolBar on which the item should be appended
+ *
+ * Method to create a toolbar button from the passed action entry
+ *
+ * Return value: (transfer full): A new #GtkTolButton
+ *
+ * Since: 4.16
+ **/
+GtkWidget*
+xfce_gtk_tool_button_new_from_action_entry (const XfceGtkActionEntry *action_entry,
+                                            GObject                  *callback_param,
+                                            GtkToolbar               *toolbar_to_append_item)
+{
+  GtkToolItem *tool_item;
+  GtkWidget   *image;
+
+  image = gtk_image_new_from_icon_name (action_entry->menu_item_icon_name, GTK_ICON_SIZE_LARGE_TOOLBAR);
+  tool_item = gtk_tool_button_new (image, action_entry->menu_item_label_text);
+  g_signal_connect_swapped (G_OBJECT (tool_item), "clicked", action_entry->callback, callback_param);
+  gtk_widget_set_tooltip_text (GTK_WIDGET (tool_item), action_entry->menu_item_tooltip_text);
+  gtk_widget_show (GTK_WIDGET (tool_item));
+  gtk_widget_show (image);
+  gtk_toolbar_insert (toolbar_to_append_item, tool_item, -1);
+  return GTK_WIDGET (tool_item);
+}
+
+
+
+/**
+ * xfce_gtk_menu_append_seperator:
+ * @menu : #GtkMenuShell on which the separator should be appended
+ *
+ * Convenience method do add separators, used to prevent code duplication
+ *
+ * Since: 4.16
+ **/
+void
+xfce_gtk_menu_append_seperator (GtkMenuShell *menu)
+{
+  GtkWidget *item;
+
+  g_return_if_fail (GTK_IS_MENU_SHELL (menu));
+
+  item = gtk_separator_menu_item_new ();
+  gtk_menu_shell_append (menu, item);
+  gtk_widget_show (item);
+}
+
+
+
+/**
+ * xfce_gtk_accel_group_append:
+ * @accel_group : The #GtkAccelGroup to which the passed action_entries should be appended
+ * @action_entries : array of action_entries to be added
+ * @n_action_entries : size of the action_entries array
+ * @callback_data : callback data which should be passed if the accelerator is activated
+ *
+ * Connects the accel_pathes of the passed action_entries to the accel_group
+ * and adds the default key of each ActionEntry to the accel_map, if no key was defined for the related accel_path so far.
+ *
+ * Return value: (transfer none): The #GtkAccelGroup to which the passed action_entries were appended
+ *
+ * Since: 4.16
+ **/
+GtkAccelGroup*
+xfce_gtk_accel_group_append (GtkAccelGroup            *accel_group,
+                             const XfceGtkActionEntry *action_entries,
+                             guint                     n_action_entries,
+                             gpointer                  callback_data)
+{
+  GtkAccelKey key;
+  GClosure   *closure = NULL;
+
+  g_return_val_if_fail (GTK_IS_ACCEL_GROUP (accel_group), NULL);
+
+  for (size_t i = 0; i < n_action_entries; i++)
+    {
+      if (action_entries[i].accel_path == NULL || g_strcmp0 (action_entries[i].accel_path, "") == 0)
+        continue;
+
+      /* If the accel path was not loaded to the acel_map via file, we add the default key for it to the accel_map */
+      if (gtk_accel_map_lookup_entry (action_entries[i].accel_path, &key) == FALSE)
+        {
+          gtk_accelerator_parse (action_entries[i].default_accelerator, &key.accel_key, &key.accel_mods);
+          gtk_accel_map_add_entry (action_entries[i].accel_path, key.accel_key, key.accel_mods);
+        }
+      if (action_entries[i].callback != NULL)
+        {
+          closure = g_cclosure_new_swap (action_entries[i].callback, callback_data, NULL);
+          gtk_accel_group_connect_by_path (accel_group, action_entries[i].accel_path, closure);
+        }
+    }
+  return accel_group;
+}
+
+
+
+/**
+ * xfce_gtk_get_action_entry_by_id:
+ * @action_entries : array of action_entries to be searched
+ * @n_action_entries : size of the action_entries array
+ * @id : id of the action entry (usually enum values are used)
+ *
+ * Convenience method to find a specific action_entry from an array of action_entries
+ *
+ * Return value: (transfer none): The matching #XfceGtkActionEntry or NULL if not found
+ *
+ * Since: 4.16
+ **/
+const XfceGtkActionEntry*
+xfce_gtk_get_action_entry_by_id (const XfceGtkActionEntry *action_entries,
+                                 guint                     n_action_entries,
+                                 guint                     id)
+{
+  for (size_t i = 0; i <  n_action_entries; i++)
+    {
+      if( action_entries[i].id == id )
+          return &(action_entries[i]);
+    }
+  g_error ("There is no action with the id '%i'.", id);
+  return NULL;
+}
+
+
+
+/**
+ * xfce_gtk_translate_action_entries:
+ * @action_entries : array of action_entries to be translated
+ * @n_action_entries : size of the action_entries array
+ *
+ * Convenience method to translate the label text and tooltip text of an array of action_entries
+ *
+ * Since: 4.16
+ **/
+void
+xfce_gtk_translate_action_entries (XfceGtkActionEntry *action_entries,
+                                   guint               n_action_entries)
+{
+  for (size_t i = 0; i <  n_action_entries; i++)
+    {
+      action_entries[i].menu_item_label_text = g_strdup( g_dgettext (NULL, action_entries[i].menu_item_label_text));
+      action_entries[i].menu_item_tooltip_text = g_strdup( g_dgettext (NULL, action_entries[i].menu_item_tooltip_text));
+    }
+}
+
+
+
+/**
  * xfce_gtk_button_new_mixed:
  * @stock_id : the name of the stock item.
  * @label    : the text of the button, with an underscore in front of
diff --git a/libxfce4ui/xfce-gtk-extensions.h b/libxfce4ui/xfce-gtk-extensions.h
index cbc0af4..2ae5f79 100644
--- a/libxfce4ui/xfce-gtk-extensions.h
+++ b/libxfce4ui/xfce-gtk-extensions.h
@@ -28,31 +28,124 @@
 
 G_BEGIN_DECLS
 
-GtkWidget   *xfce_gtk_button_new_mixed               (const gchar        *stock_id,
-                                                      const gchar        *label) G_GNUC_MALLOC;
+/*
+ * List of item types which are supported by the XfceGtkActionEntry
+ * To be extended if required
+*/
+typedef enum
+{
+  XFCE_GTK_MENU_ITEM,
+  XFCE_GTK_IMAGE_MENU_ITEM,
+  XFCE_GTK_CHECK_MENU_ITEM,
+  XFCE_GTK_RADIO_MENU_ITEM,
+} XfceGtkMenuItem;
+
+/*
+ * Replacement for the deprecated GtkActionEntry
+ * The idea is to provide a fixed list of XfceGtkActionEntrys
+ * - use 'xfce_gtk_translate_action_entries' once to translate the list
+ * - use 'xfce_gtk_accel_group_append' once to register the provided accelerators
+ * - use 'xfce_gtk_get_action_entry_by_id' to find a single entry, e.g. by using a enumeration
+ * - use 'xfce_gtk_***_new_from_action_entry' to create the specific menu- or tool-items from the entry
+*/
+typedef struct
+{
+  guint            id;                     /* unique identifier for instances of this structure (you might want to use a enum) */
+  const gchar     *accel_path;             /* The unique path, used to identify the accelerator */
+  const gchar     *default_accelerator;    /* The default key and modifier to trigger the callback linked to the entry */
+
+  /* menu_item data is optional, only relevant if there exists a menu_item for that accelerator */
+  XfceGtkMenuItem  menu_item_type;         /* The type of the item which should be used for creation */
+  gchar           *menu_item_label_text;   /* text which should be shown in the menu */
+  gchar           *menu_item_tooltip_text; /* optional tooltip of the item */
+  const gchar     *menu_item_icon_name;    /* optional icon name which will be used to find a image for the item */
+
+  GCallback        callback;               /* The callback which will be triggered on activation */
+
+} XfceGtkActionEntry;
+
+
+
+GtkWidget                *xfce_gtk_menu_item_new                          (const gchar              *label_text,
+                                                                           const gchar              *tooltip_text,
+                                                                           const gchar              *accel_path,
+                                                                           GCallback                 callback,
+                                                                           GObject                  *callback_param,
+                                                                           GtkMenuShell             *menu_to_append_item);
+GtkWidget                *xfce_gtk_image_menu_item_new                    (const gchar              *label_text,
+                                                                           const gchar              *tooltip_text,
+                                                                           const gchar              *accel_path,
+                                                                           GCallback                 callback,
+                                                                           GObject                  *callback_param,
+                                                                           GtkWidget                *image,
+                                                                           GtkMenuShell             *menu_to_append_item);
+GtkWidget                *xfce_gtk_image_menu_item_new_from_icon_name     (const gchar              *label_text,
+                                                                           const gchar              *tooltip_text,
+                                                                           const gchar              *accel_path,
+                                                                           GCallback                 callback,
+                                                                           GObject                  *callback_param,
+                                                                           const gchar              *icon_name,
+                                                                           GtkMenuShell             *menu_to_append_item);
+GtkWidget                *xfce_gtk_check_menu_item_new                    (const gchar              *label_text,
+                                                                           const gchar              *tooltip_text,
+                                                                           const gchar              *accel_path,
+                                                                           GCallback                 callback,
+                                                                           GObject                  *callback_param,
+                                                                           gboolean                  active,
+                                                                           GtkMenuShell             *menu_to_append_item);
+GtkWidget                *xfce_gtk_radio_menu_item_new                    (const gchar              *label_text,
+                                                                           const gchar              *tooltip_text,
+                                                                           const gchar              *accel_path,
+                                                                           GCallback                 callback,
+                                                                           GObject                  *callback_param,
+                                                                           gboolean                  active,
+                                                                           GtkMenuShell             *menu_to_append_item);
+GtkWidget                *xfce_gtk_menu_item_new_from_action_entry        (const XfceGtkActionEntry *action_entry,
+                                                                           GObject                  *callback_param,
+                                                                           GtkMenuShell             *menu_to_append_item);
+GtkWidget                *xfce_gtk_toggle_menu_item_new_from_action_entry (const XfceGtkActionEntry *action_entry,
+                                                                           GObject                  *callback_param,
+                                                                           gboolean                  active,
+                                                                           GtkMenuShell             *menu_to_append_item);
+GtkWidget                *xfce_gtk_tool_button_new_from_action_entry      (const XfceGtkActionEntry *action_entry,
+                                                                           GObject                  *callback_param,
+                                                                           GtkToolbar               *toolbar_to_append_item);
+GtkAccelGroup            *xfce_gtk_accel_group_append                     (GtkAccelGroup            *accel_group,
+                                                                           const XfceGtkActionEntry *action_entries,
+                                                                           guint                     n_action_entries,
+                                                                           gpointer                  callback_data);
+const XfceGtkActionEntry *xfce_gtk_get_action_entry_by_id                 (const XfceGtkActionEntry *action_entries,
+                                                                           guint                     n_action_entries,
+                                                                           guint                     id);
+void                      xfce_gtk_translate_action_entries               (XfceGtkActionEntry       *action_entries,
+                                                                           guint                     n_action_entries);
+void                      xfce_gtk_menu_append_seperator                  (GtkMenuShell             *menu);
+
+GtkWidget                *xfce_gtk_button_new_mixed                       (const gchar              *stock_id,
+                                                                           const gchar              *label) G_GNUC_MALLOC;
 
-GtkWidget   *xfce_gtk_frame_box_new                  (const gchar        *label,
-                                                      GtkWidget         **container_return) G_GNUC_MALLOC;
+GtkWidget                *xfce_gtk_frame_box_new                          (const gchar              *label,
+                                                                           GtkWidget               **container_return) G_GNUC_MALLOC;
 
-GtkWidget   *xfce_gtk_frame_box_new_with_content     (const gchar         *label,
-                                                      GtkWidget           *content) G_GNUC_MALLOC;
+GtkWidget                *xfce_gtk_frame_box_new_with_content             (const gchar               *label,
+                                                                           GtkWidget                 *content) G_GNUC_MALLOC;
 
-void         xfce_gtk_window_center_on_active_screen (GtkWindow           *window);
+void                      xfce_gtk_window_center_on_active_screen         (GtkWindow                 *window);
 
-gboolean     xfce_gtk_menu_popup_until_mapped        (GtkMenu             *menu,
-                                                      GtkWidget           *parent_menu_shell,
-                                                      GtkWidget           *parent_menu_item,
-                                                      GtkMenuPositionFunc  func,
-                                                      gpointer             data,
-                                                      guint                button,
-                                                      guint32              activate_time);
+gboolean                  xfce_gtk_menu_popup_until_mapped                (GtkMenu                   *menu,
+                                                                           GtkWidget                 *parent_menu_shell,
+                                                                           GtkWidget                 *parent_menu_item,
+                                                                           GtkMenuPositionFunc        func,
+                                                                           gpointer                   data,
+                                                                           guint                      button,
+                                                                           guint32                    activate_time);
 
-gboolean     xfce_widget_reparent                    (GtkWidget           *widget,
-                                                      GtkWidget           *new_parent);
+gboolean                  xfce_widget_reparent                            (GtkWidget                 *widget,
+                                                                           GtkWidget                 *new_parent);
 
-const gchar *xfce_icon_name_from_desktop_id          (const gchar         *desktop_id);
+const gchar              *xfce_icon_name_from_desktop_id                  (const gchar               *desktop_id);
 
-GIcon       *xfce_gicon_from_name                    (const gchar         *name);
+GIcon                    *xfce_gicon_from_name                            (const gchar               *name);
 
 G_END_DECLS
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list