選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

185 行
8.0 KiB

  1. /*
  2. * GTK - The GIMP Toolkit
  3. * Copyright (C) 1998, 1999 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * This Library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public License as
  8. * published by the Free Software Foundation; either version 2 of the
  9. * License, or (at your option) any later version.
  10. *
  11. * This Library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with the Gnome Library; see the file COPYING.LIB. If not,
  18. * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. /*
  22. * Author: James Henstridge <james@daa.com.au>
  23. *
  24. * Modified by the GTK+ Team and others 2003. See the AUTHORS
  25. * file for a list of people on the GTK+ Team. See the ChangeLog
  26. * files for a list of changes. These files are distributed with
  27. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  28. */
  29. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  30. #error "Only <gtk/gtk.h> can be included directly."
  31. #endif
  32. #ifndef __GTK_ACTION_GROUP_H__
  33. #define __GTK_ACTION_GROUP_H__
  34. #include <gtk/gtkaction.h>
  35. #include <gtk/gtktypeutils.h> /* for GtkTranslateFunc */
  36. G_BEGIN_DECLS
  37. #define GTK_TYPE_ACTION_GROUP (gtk_action_group_get_type ())
  38. #define GTK_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACTION_GROUP, GtkActionGroup))
  39. #define GTK_ACTION_GROUP_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), GTK_TYPE_ACTION_GROUP, GtkActionGroupClass))
  40. #define GTK_IS_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACTION_GROUP))
  41. #define GTK_IS_ACTION_GROUP_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_TYPE_ACTION_GROUP))
  42. #define GTK_ACTION_GROUP_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), GTK_TYPE_ACTION_GROUP, GtkActionGroupClass))
  43. typedef struct _GtkActionGroup GtkActionGroup;
  44. typedef struct _GtkActionGroupPrivate GtkActionGroupPrivate;
  45. typedef struct _GtkActionGroupClass GtkActionGroupClass;
  46. typedef struct _GtkActionEntry GtkActionEntry;
  47. typedef struct _GtkToggleActionEntry GtkToggleActionEntry;
  48. typedef struct _GtkRadioActionEntry GtkRadioActionEntry;
  49. struct _GtkActionGroup
  50. {
  51. GObject parent;
  52. /*< private >*/
  53. GtkActionGroupPrivate *GSEAL (private_data);
  54. };
  55. struct _GtkActionGroupClass
  56. {
  57. GObjectClass parent_class;
  58. GtkAction *(* get_action) (GtkActionGroup *action_group,
  59. const gchar *action_name);
  60. /* Padding for future expansion */
  61. void (*_gtk_reserved1) (void);
  62. void (*_gtk_reserved2) (void);
  63. void (*_gtk_reserved3) (void);
  64. void (*_gtk_reserved4) (void);
  65. };
  66. struct _GtkActionEntry
  67. {
  68. const gchar *name;
  69. const gchar *stock_id;
  70. const gchar *label;
  71. const gchar *accelerator;
  72. const gchar *tooltip;
  73. GCallback callback;
  74. };
  75. struct _GtkToggleActionEntry
  76. {
  77. const gchar *name;
  78. const gchar *stock_id;
  79. const gchar *label;
  80. const gchar *accelerator;
  81. const gchar *tooltip;
  82. GCallback callback;
  83. gboolean is_active;
  84. };
  85. struct _GtkRadioActionEntry
  86. {
  87. const gchar *name;
  88. const gchar *stock_id;
  89. const gchar *label;
  90. const gchar *accelerator;
  91. const gchar *tooltip;
  92. gint value;
  93. };
  94. GType gtk_action_group_get_type (void) G_GNUC_CONST;
  95. GtkActionGroup *gtk_action_group_new (const gchar *name);
  96. G_CONST_RETURN gchar *gtk_action_group_get_name (GtkActionGroup *action_group);
  97. gboolean gtk_action_group_get_sensitive (GtkActionGroup *action_group);
  98. void gtk_action_group_set_sensitive (GtkActionGroup *action_group,
  99. gboolean sensitive);
  100. gboolean gtk_action_group_get_visible (GtkActionGroup *action_group);
  101. void gtk_action_group_set_visible (GtkActionGroup *action_group,
  102. gboolean visible);
  103. GtkAction *gtk_action_group_get_action (GtkActionGroup *action_group,
  104. const gchar *action_name);
  105. GList *gtk_action_group_list_actions (GtkActionGroup *action_group);
  106. void gtk_action_group_add_action (GtkActionGroup *action_group,
  107. GtkAction *action);
  108. void gtk_action_group_add_action_with_accel (GtkActionGroup *action_group,
  109. GtkAction *action,
  110. const gchar *accelerator);
  111. void gtk_action_group_remove_action (GtkActionGroup *action_group,
  112. GtkAction *action);
  113. void gtk_action_group_add_actions (GtkActionGroup *action_group,
  114. const GtkActionEntry *entries,
  115. guint n_entries,
  116. gpointer user_data);
  117. void gtk_action_group_add_toggle_actions (GtkActionGroup *action_group,
  118. const GtkToggleActionEntry *entries,
  119. guint n_entries,
  120. gpointer user_data);
  121. void gtk_action_group_add_radio_actions (GtkActionGroup *action_group,
  122. const GtkRadioActionEntry *entries,
  123. guint n_entries,
  124. gint value,
  125. GCallback on_change,
  126. gpointer user_data);
  127. void gtk_action_group_add_actions_full (GtkActionGroup *action_group,
  128. const GtkActionEntry *entries,
  129. guint n_entries,
  130. gpointer user_data,
  131. GDestroyNotify destroy);
  132. void gtk_action_group_add_toggle_actions_full (GtkActionGroup *action_group,
  133. const GtkToggleActionEntry *entries,
  134. guint n_entries,
  135. gpointer user_data,
  136. GDestroyNotify destroy);
  137. void gtk_action_group_add_radio_actions_full (GtkActionGroup *action_group,
  138. const GtkRadioActionEntry *entries,
  139. guint n_entries,
  140. gint value,
  141. GCallback on_change,
  142. gpointer user_data,
  143. GDestroyNotify destroy);
  144. void gtk_action_group_set_translate_func (GtkActionGroup *action_group,
  145. GtkTranslateFunc func,
  146. gpointer data,
  147. GDestroyNotify notify);
  148. void gtk_action_group_set_translation_domain (GtkActionGroup *action_group,
  149. const gchar *domain);
  150. G_CONST_RETURN gchar *gtk_action_group_translate_string (GtkActionGroup *action_group,
  151. const gchar *string);
  152. /* Protected for use by GtkAction */
  153. void _gtk_action_group_emit_connect_proxy (GtkActionGroup *action_group,
  154. GtkAction *action,
  155. GtkWidget *proxy);
  156. void _gtk_action_group_emit_disconnect_proxy (GtkActionGroup *action_group,
  157. GtkAction *action,
  158. GtkWidget *proxy);
  159. void _gtk_action_group_emit_pre_activate (GtkActionGroup *action_group,
  160. GtkAction *action);
  161. void _gtk_action_group_emit_post_activate (GtkActionGroup *action_group,
  162. GtkAction *action);
  163. G_END_DECLS
  164. #endif /* __GTK_ACTION_GROUP_H__ */