diff options
author | Matthias Clasen <maclas@gmx.de> | 2003-09-15 19:51:55 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2003-09-15 19:51:55 +0000 |
commit | caf380c793789e868458e32fbb64a33b5ef1d852 (patch) | |
tree | ee65930936942b62c28d6ae7a5de24905059e906 /gtk/gtkactiongroup.h | |
parent | b14b12f9d2b5ba0b554b7d8ec2a3c90a8cd78d4f (diff) | |
download | gtk+-caf380c793789e868458e32fbb64a33b5ef1d852.tar.gz |
Add value parameter to allow setting the currently selected group member
2003-09-15 Matthias Clasen <maclas@gmx.de>
* gtk/gtkactiongroup.[hc]: (gtk_action_group_add_radio_actions):
(gtk_action_group_add_radio_actions_full): Add value parameter to allow
setting the currently selected group member before connecting signals.
(GtkToggleActionEntry): Separate struct for constructing toggle actions,
including a boolean to initialize the action state before connecting
signals.
(gtk_action_group_add_toggle_actions):
(gtk_action_group_add_toggle_actions_full): New functions to construct
toggle actions from an array of GtkToggleActionEntries.
* demos/gtk-demo/appwindow.c:
* tests/testactions.c:
* tests/testmerge.c: Adjust to new action group API.
* gtk/gtk-sections.txt: Add gtk_action_group_add_toggle_actions[_full].
Diffstat (limited to 'gtk/gtkactiongroup.h')
-rw-r--r-- | gtk/gtkactiongroup.h | 117 |
1 files changed, 66 insertions, 51 deletions
diff --git a/gtk/gtkactiongroup.h b/gtk/gtkactiongroup.h index f3a01b5375..22d99f48dc 100644 --- a/gtk/gtkactiongroup.h +++ b/gtk/gtkactiongroup.h @@ -44,6 +44,7 @@ typedef struct _GtkActionGroup GtkActionGroup; typedef struct _GtkActionGroupPrivate GtkActionGroupPrivate; typedef struct _GtkActionGroupClass GtkActionGroupClass; typedef struct _GtkActionEntry GtkActionEntry; +typedef struct _GtkToggleActionEntry GtkToggleActionEntry; typedef struct _GtkRadioActionEntry GtkRadioActionEntry; struct _GtkActionGroup @@ -71,15 +72,23 @@ struct _GtkActionGroupClass struct _GtkActionEntry { - gchar *name; - gchar *stock_id; - gchar *label; - gchar *accelerator; - gchar *tooltip; - - GCallback callback; + gchar *name; + gchar *stock_id; + gchar *label; + gchar *accelerator; + gchar *tooltip; + GCallback callback; +}; - gboolean is_toggle; +struct _GtkToggleActionEntry +{ + gchar *name; + gchar *stock_id; + gchar *label; + gchar *accelerator; + gchar *tooltip; + GCallback callback; + gboolean is_active; }; struct _GtkRadioActionEntry @@ -89,50 +98,56 @@ struct _GtkRadioActionEntry gchar *label; gchar *accelerator; gchar *tooltip; - - gint value; + gint value; }; -GType gtk_action_group_get_type (void); - -GtkActionGroup *gtk_action_group_new (const gchar *name); - -const gchar *gtk_action_group_get_name (GtkActionGroup *action_group); -GtkAction *gtk_action_group_get_action (GtkActionGroup *action_group, - const gchar *action_name); -GList *gtk_action_group_list_actions (GtkActionGroup *action_group); -void gtk_action_group_add_action (GtkActionGroup *action_group, - GtkAction *action); -void gtk_action_group_remove_action (GtkActionGroup *action_group, - GtkAction *action); - -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, - gpointer data, - GtkDestroyNotify notify); - -void gtk_action_group_set_translation_domain (GtkActionGroup *action_group, - const gchar *domain); +GType gtk_action_group_get_type (void); +GtkActionGroup *gtk_action_group_new (const gchar *name); +const gchar *gtk_action_group_get_name (GtkActionGroup *action_group); +GtkAction *gtk_action_group_get_action (GtkActionGroup *action_group, + const gchar *action_name); +GList *gtk_action_group_list_actions (GtkActionGroup *action_group); +void gtk_action_group_add_action (GtkActionGroup *action_group, + GtkAction *action); +void gtk_action_group_remove_action (GtkActionGroup *action_group, + GtkAction *action); +void gtk_action_group_add_actions (GtkActionGroup *action_group, + GtkActionEntry *entries, + guint n_entries, + gpointer user_data); +void gtk_action_group_add_toggle_actions (GtkActionGroup *action_group, + GtkToggleActionEntry *entries, + guint n_entries, + gpointer user_data); +void gtk_action_group_add_radio_actions (GtkActionGroup *action_group, + GtkRadioActionEntry *entries, + guint n_entries, + gint value, + 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_toggle_actions_full (GtkActionGroup *action_group, + GtkToggleActionEntry *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, + gint value, + GCallback on_change, + gpointer user_data, + GDestroyNotify destroy); +void gtk_action_group_set_translate_func (GtkActionGroup *action_group, + GtkTranslateFunc func, + gpointer data, + GtkDestroyNotify notify); +void gtk_action_group_set_translation_domain (GtkActionGroup *action_group, + const gchar *domain); + #endif /* __GTK_ACTION_GROUP_H__ */ |