summaryrefslogtreecommitdiff
path: root/gtk/gtkactiongroup.h
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2003-08-27 22:22:28 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2003-08-27 22:22:28 +0000
commitcbc20c4dde539ed01dede8356d9cd1dc56479799 (patch)
tree7f01eba754c3806ac3b7c9101f5feb7ed7023f50 /gtk/gtkactiongroup.h
parentbebc663c5a27c63246956ecc10c0c4c953d26ba7 (diff)
downloadgtk+-cbc20c4dde539ed01dede8356d9cd1dc56479799.tar.gz
Change the XML format: <Root> element is replaced by <ui>, <menu> element
2003-08-28 Matthias Clasen <maclas@gmx.de> * gtk/gtkuimanager.c: Change the XML format: <Root> element is replaced by <ui>, <menu> element is replaced by <menubar>, <submenu> element is replaced by <menu>, <dockitem> element is replaced by <toolbar>, <popups> element is gone, verb attribute is replaced by action, name defaults to action or the element name. * gtk/gtkactiongroup.[hc]: Replace GtkActionGroupEntry by GtkActionEntry and GtkRadioActionEntry. GtkActionEntry is simplified by removing the user_data, entry_type and extra_data fields, GtkRadioActionEntry is further simplified by removing the callback. The user_data can now be specified as an argument to gtk_action_group_add_actions(). There is a new method gtk_action_group_add_radio_actions(), which is similar to gtk_action_group_add_actions(), but takes GtkRadioActionEntrys and a callback parameter in addition to the user_data. The callback is connected to the ::changed signal of the first group member. There are _full() variants taking a GDestroyNotify of gtk_action_group_add_[radio_]actions(). * gtk/gtkradioaction.[hc]: Add a ::changed signal which gets emitted on every member of the radio group when the active member is changed. Add an integer property "value", and a getter for the value of "value" on the currently active group member. * tests/testactions.c: * tests/testmerge.c: * tests/merge-[123].ui: * demos/gtk-demo/appwindow.c: Adjust to these changes. * gtk/gtktoolbar.c (gtk_toolbar_append_element): Trivial doc fix.
Diffstat (limited to 'gtk/gtkactiongroup.h')
-rw-r--r--gtk/gtkactiongroup.h52
1 files changed, 36 insertions, 16 deletions
diff --git a/gtk/gtkactiongroup.h b/gtk/gtkactiongroup.h
index 6036f2e0e7..f3a01b5375 100644
--- a/gtk/gtkactiongroup.h
+++ b/gtk/gtkactiongroup.h
@@ -43,7 +43,8 @@
typedef struct _GtkActionGroup GtkActionGroup;
typedef struct _GtkActionGroupPrivate GtkActionGroupPrivate;
typedef struct _GtkActionGroupClass GtkActionGroupClass;
-typedef struct _GtkActionGroupEntry GtkActionGroupEntry;
+typedef struct _GtkActionEntry GtkActionEntry;
+typedef struct _GtkRadioActionEntry GtkRadioActionEntry;
struct _GtkActionGroup
{
@@ -68,26 +69,28 @@ struct _GtkActionGroupClass
void (*_gtk_reserved4) (void);
};
-typedef enum
-{
- GTK_ACTION_NORMAL,
- GTK_ACTION_TOGGLE,
- GTK_ACTION_RADIO
-} GtkActionGroupEntryType;
-
-struct _GtkActionGroupEntry
+struct _GtkActionEntry
{
gchar *name;
- gchar *label;
gchar *stock_id;
+ gchar *label;
gchar *accelerator;
gchar *tooltip;
GCallback callback;
- gpointer user_data;
- GtkActionGroupEntryType entry_type;
- gchar *extra_data;
+ gboolean is_toggle;
+};
+
+struct _GtkRadioActionEntry
+{
+ gchar *name;
+ gchar *stock_id;
+ gchar *label;
+ gchar *accelerator;
+ gchar *tooltip;
+
+ gint value;
};
GType gtk_action_group_get_type (void);
@@ -103,9 +106,26 @@ void gtk_action_group_add_action (GtkActionGroup *action_grou
void gtk_action_group_remove_action (GtkActionGroup *action_group,
GtkAction *action);
-void gtk_action_group_add_actions (GtkActionGroup *action_group,
- GtkActionGroupEntry *entries,
- guint n_entries);
+void gtk_action_group_add_actions (GtkActionGroup *action_group,
+ GtkActionEntry *entries,
+ guint n_entries,
+ gpointer user_data);
+void gtk_action_group_add_radio_actions (GtkActionGroup *action_group,
+ GtkRadioActionEntry *entries,
+ guint n_entries,
+ GCallback on_change,
+ gpointer user_data);
+void gtk_action_group_add_actions_full (GtkActionGroup *action_group,
+ GtkActionEntry *entries,
+ guint n_entries,
+ gpointer user_data,
+ GDestroyNotify destroy);
+void gtk_action_group_add_radio_actions_full (GtkActionGroup *action_group,
+ GtkRadioActionEntry *entries,
+ guint n_entries,
+ GCallback on_change,
+ gpointer user_data,
+ GDestroyNotify destroy);
void gtk_action_group_set_translate_func (GtkActionGroup *action_group,
GtkTranslateFunc func,