25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

146 satır
5.8 KiB

  1. /* GTK - The GIMP Toolkit
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. /*
  20. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GTK+ Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  26. #error "Only <gtk/gtk.h> can be included directly."
  27. #endif
  28. #ifndef __GTK_MENU_ITEM_H__
  29. #define __GTK_MENU_ITEM_H__
  30. #include <gtk/gtkitem.h>
  31. G_BEGIN_DECLS
  32. #define GTK_TYPE_MENU_ITEM (gtk_menu_item_get_type ())
  33. #define GTK_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_ITEM, GtkMenuItem))
  34. #define GTK_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_ITEM, GtkMenuItemClass))
  35. #define GTK_IS_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_ITEM))
  36. #define GTK_IS_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_ITEM))
  37. #define GTK_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_ITEM, GtkMenuItemClass))
  38. typedef struct _GtkMenuItem GtkMenuItem;
  39. typedef struct _GtkMenuItemClass GtkMenuItemClass;
  40. struct _GtkMenuItem
  41. {
  42. GtkItem item;
  43. GtkWidget *GSEAL (submenu);
  44. GdkWindow *GSEAL (event_window);
  45. guint16 GSEAL (toggle_size);
  46. guint16 GSEAL (accelerator_width);
  47. gchar *GSEAL (accel_path);
  48. guint GSEAL (show_submenu_indicator) : 1;
  49. guint GSEAL (submenu_placement) : 1;
  50. guint GSEAL (submenu_direction) : 1;
  51. guint GSEAL (right_justify): 1;
  52. guint GSEAL (timer_from_keypress) : 1;
  53. guint GSEAL (from_menubar) : 1;
  54. guint GSEAL (timer);
  55. };
  56. struct _GtkMenuItemClass
  57. {
  58. GtkItemClass parent_class;
  59. /* If the following flag is true, then we should always hide
  60. * the menu when the MenuItem is activated. Otherwise, the
  61. * it is up to the caller. For instance, when navigating
  62. * a menu with the keyboard, <Space> doesn't hide, but
  63. * <Return> does.
  64. */
  65. guint hide_on_activate : 1;
  66. void (* activate) (GtkMenuItem *menu_item);
  67. void (* activate_item) (GtkMenuItem *menu_item);
  68. void (* toggle_size_request) (GtkMenuItem *menu_item,
  69. gint *requisition);
  70. void (* toggle_size_allocate) (GtkMenuItem *menu_item,
  71. gint allocation);
  72. void (* set_label) (GtkMenuItem *menu_item,
  73. const gchar *label);
  74. G_CONST_RETURN gchar *(* get_label) (GtkMenuItem *menu_item);
  75. /* Padding for future expansion */
  76. void (*_gtk_reserved1) (void);
  77. void (*_gtk_reserved2) (void);
  78. };
  79. GType gtk_menu_item_get_type (void) G_GNUC_CONST;
  80. GtkWidget* gtk_menu_item_new (void);
  81. GtkWidget* gtk_menu_item_new_with_label (const gchar *label);
  82. GtkWidget* gtk_menu_item_new_with_mnemonic (const gchar *label);
  83. void gtk_menu_item_set_submenu (GtkMenuItem *menu_item,
  84. GtkWidget *submenu);
  85. GtkWidget* gtk_menu_item_get_submenu (GtkMenuItem *menu_item);
  86. void gtk_menu_item_select (GtkMenuItem *menu_item);
  87. void gtk_menu_item_deselect (GtkMenuItem *menu_item);
  88. void gtk_menu_item_activate (GtkMenuItem *menu_item);
  89. void gtk_menu_item_toggle_size_request (GtkMenuItem *menu_item,
  90. gint *requisition);
  91. void gtk_menu_item_toggle_size_allocate (GtkMenuItem *menu_item,
  92. gint allocation);
  93. void gtk_menu_item_set_right_justified (GtkMenuItem *menu_item,
  94. gboolean right_justified);
  95. gboolean gtk_menu_item_get_right_justified (GtkMenuItem *menu_item);
  96. void gtk_menu_item_set_accel_path (GtkMenuItem *menu_item,
  97. const gchar *accel_path);
  98. G_CONST_RETURN gchar* gtk_menu_item_get_accel_path (GtkMenuItem *menu_item);
  99. void gtk_menu_item_set_label (GtkMenuItem *menu_item,
  100. const gchar *label);
  101. G_CONST_RETURN gchar *gtk_menu_item_get_label (GtkMenuItem *menu_item);
  102. void gtk_menu_item_set_use_underline (GtkMenuItem *menu_item,
  103. gboolean setting);
  104. gboolean gtk_menu_item_get_use_underline (GtkMenuItem *menu_item);
  105. /* private */
  106. void _gtk_menu_item_refresh_accel_path (GtkMenuItem *menu_item,
  107. const gchar *prefix,
  108. GtkAccelGroup *accel_group,
  109. gboolean group_changed);
  110. gboolean _gtk_menu_item_is_selectable (GtkWidget *menu_item);
  111. void _gtk_menu_item_popup_submenu (GtkWidget *menu_item,
  112. gboolean with_delay);
  113. void _gtk_menu_item_popdown_submenu (GtkWidget *menu_item);
  114. #ifndef GTK_DISABLE_DEPRECATED
  115. void gtk_menu_item_remove_submenu (GtkMenuItem *menu_item);
  116. #define gtk_menu_item_right_justify(menu_item) gtk_menu_item_set_right_justified ((menu_item), TRUE)
  117. #endif /* GTK_DISABLE_DEPRECATED */
  118. G_END_DECLS
  119. #endif /* __GTK_MENU_ITEM_H__ */