Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

181 rader
8.1 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_H__
  33. #define __GTK_ACTION_H__
  34. #include <gtk/gtkwidget.h>
  35. G_BEGIN_DECLS
  36. #define GTK_TYPE_ACTION (gtk_action_get_type ())
  37. #define GTK_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACTION, GtkAction))
  38. #define GTK_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACTION, GtkActionClass))
  39. #define GTK_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACTION))
  40. #define GTK_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACTION))
  41. #define GTK_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_ACTION, GtkActionClass))
  42. typedef struct _GtkAction GtkAction;
  43. typedef struct _GtkActionClass GtkActionClass;
  44. typedef struct _GtkActionPrivate GtkActionPrivate;
  45. struct _GtkAction
  46. {
  47. GObject object;
  48. /*< private >*/
  49. GtkActionPrivate *GSEAL (private_data);
  50. };
  51. struct _GtkActionClass
  52. {
  53. GObjectClass parent_class;
  54. /* activation signal */
  55. void (* activate) (GtkAction *action);
  56. GType menu_item_type;
  57. GType toolbar_item_type;
  58. /* widget creation routines (not signals) */
  59. GtkWidget *(* create_menu_item) (GtkAction *action);
  60. GtkWidget *(* create_tool_item) (GtkAction *action);
  61. void (* connect_proxy) (GtkAction *action,
  62. GtkWidget *proxy);
  63. void (* disconnect_proxy) (GtkAction *action,
  64. GtkWidget *proxy);
  65. GtkWidget *(* create_menu) (GtkAction *action);
  66. /* Padding for future expansion */
  67. void (*_gtk_reserved2) (void);
  68. void (*_gtk_reserved3) (void);
  69. void (*_gtk_reserved4) (void);
  70. };
  71. GType gtk_action_get_type (void) G_GNUC_CONST;
  72. GtkAction *gtk_action_new (const gchar *name,
  73. const gchar *label,
  74. const gchar *tooltip,
  75. const gchar *stock_id);
  76. G_CONST_RETURN gchar* gtk_action_get_name (GtkAction *action);
  77. gboolean gtk_action_is_sensitive (GtkAction *action);
  78. gboolean gtk_action_get_sensitive (GtkAction *action);
  79. void gtk_action_set_sensitive (GtkAction *action,
  80. gboolean sensitive);
  81. gboolean gtk_action_is_visible (GtkAction *action);
  82. gboolean gtk_action_get_visible (GtkAction *action);
  83. void gtk_action_set_visible (GtkAction *action,
  84. gboolean visible);
  85. void gtk_action_activate (GtkAction *action);
  86. GtkWidget * gtk_action_create_icon (GtkAction *action,
  87. GtkIconSize icon_size);
  88. GtkWidget * gtk_action_create_menu_item (GtkAction *action);
  89. GtkWidget * gtk_action_create_tool_item (GtkAction *action);
  90. GtkWidget * gtk_action_create_menu (GtkAction *action);
  91. GSList * gtk_action_get_proxies (GtkAction *action);
  92. void gtk_action_connect_accelerator (GtkAction *action);
  93. void gtk_action_disconnect_accelerator (GtkAction *action);
  94. G_CONST_RETURN gchar *gtk_action_get_accel_path (GtkAction *action);
  95. GClosure *gtk_action_get_accel_closure (GtkAction *action);
  96. #ifndef GTK_DISABLE_DEPRECATED
  97. GtkAction *gtk_widget_get_action (GtkWidget *widget);
  98. void gtk_action_connect_proxy (GtkAction *action,
  99. GtkWidget *proxy);
  100. void gtk_action_disconnect_proxy (GtkAction *action,
  101. GtkWidget *proxy);
  102. void gtk_action_block_activate_from (GtkAction *action,
  103. GtkWidget *proxy);
  104. void gtk_action_unblock_activate_from (GtkAction *action,
  105. GtkWidget *proxy);
  106. #endif /* GTK_DISABLE_DEPRECATED */
  107. void gtk_action_block_activate (GtkAction *action);
  108. void gtk_action_unblock_activate (GtkAction *action);
  109. void _gtk_action_add_to_proxy_list (GtkAction *action,
  110. GtkWidget *proxy);
  111. void _gtk_action_remove_from_proxy_list(GtkAction *action,
  112. GtkWidget *proxy);
  113. /* protected ... for use by child actions */
  114. void _gtk_action_emit_activate (GtkAction *action);
  115. /* protected ... for use by action groups */
  116. void gtk_action_set_accel_path (GtkAction *action,
  117. const gchar *accel_path);
  118. void gtk_action_set_accel_group (GtkAction *action,
  119. GtkAccelGroup *accel_group);
  120. void _gtk_action_sync_menu_visible (GtkAction *action,
  121. GtkWidget *proxy,
  122. gboolean empty);
  123. void gtk_action_set_label (GtkAction *action,
  124. const gchar *label);
  125. G_CONST_RETURN gchar *gtk_action_get_label (GtkAction *action);
  126. void gtk_action_set_short_label (GtkAction *action,
  127. const gchar *short_label);
  128. G_CONST_RETURN gchar *gtk_action_get_short_label (GtkAction *action);
  129. void gtk_action_set_tooltip (GtkAction *action,
  130. const gchar *tooltip);
  131. G_CONST_RETURN gchar *gtk_action_get_tooltip (GtkAction *action);
  132. void gtk_action_set_stock_id (GtkAction *action,
  133. const gchar *stock_id);
  134. G_CONST_RETURN gchar *gtk_action_get_stock_id (GtkAction *action);
  135. void gtk_action_set_gicon (GtkAction *action,
  136. GIcon *icon);
  137. GIcon *gtk_action_get_gicon (GtkAction *action);
  138. void gtk_action_set_icon_name (GtkAction *action,
  139. const gchar *icon_name);
  140. G_CONST_RETURN gchar *gtk_action_get_icon_name (GtkAction *action);
  141. void gtk_action_set_visible_horizontal (GtkAction *action,
  142. gboolean visible_horizontal);
  143. gboolean gtk_action_get_visible_horizontal (GtkAction *action);
  144. void gtk_action_set_visible_vertical (GtkAction *action,
  145. gboolean visible_vertical);
  146. gboolean gtk_action_get_visible_vertical (GtkAction *action);
  147. void gtk_action_set_is_important (GtkAction *action,
  148. gboolean is_important);
  149. gboolean gtk_action_get_is_important (GtkAction *action);
  150. void gtk_action_set_always_show_image (GtkAction *action,
  151. gboolean always_show);
  152. gboolean gtk_action_get_always_show_image (GtkAction *action);
  153. G_END_DECLS
  154. #endif /* __GTK_ACTION_H__ */