You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

142 line
5.3 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_SHELL_H__
  29. #define __GTK_MENU_SHELL_H__
  30. #include <gtk/gtkcontainer.h>
  31. G_BEGIN_DECLS
  32. #define GTK_TYPE_MENU_SHELL (gtk_menu_shell_get_type ())
  33. #define GTK_MENU_SHELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_SHELL, GtkMenuShell))
  34. #define GTK_MENU_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_SHELL, GtkMenuShellClass))
  35. #define GTK_IS_MENU_SHELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_SHELL))
  36. #define GTK_IS_MENU_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_SHELL))
  37. #define GTK_MENU_SHELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_SHELL, GtkMenuShellClass))
  38. typedef struct _GtkMenuShell GtkMenuShell;
  39. typedef struct _GtkMenuShellClass GtkMenuShellClass;
  40. struct _GtkMenuShell
  41. {
  42. GtkContainer container;
  43. GList *GSEAL (children);
  44. GtkWidget *GSEAL (active_menu_item);
  45. GtkWidget *GSEAL (parent_menu_shell);
  46. guint GSEAL (button);
  47. guint32 GSEAL (activate_time);
  48. guint GSEAL (active) : 1;
  49. guint GSEAL (have_grab) : 1;
  50. guint GSEAL (have_xgrab) : 1;
  51. guint GSEAL (ignore_leave) : 1; /* unused */
  52. guint GSEAL (menu_flag) : 1; /* unused */
  53. guint GSEAL (ignore_enter) : 1;
  54. guint GSEAL (keyboard_mode) : 1;
  55. };
  56. struct _GtkMenuShellClass
  57. {
  58. GtkContainerClass parent_class;
  59. guint submenu_placement : 1;
  60. void (*deactivate) (GtkMenuShell *menu_shell);
  61. void (*selection_done) (GtkMenuShell *menu_shell);
  62. void (*move_current) (GtkMenuShell *menu_shell,
  63. GtkMenuDirectionType direction);
  64. void (*activate_current) (GtkMenuShell *menu_shell,
  65. gboolean force_hide);
  66. void (*cancel) (GtkMenuShell *menu_shell);
  67. void (*select_item) (GtkMenuShell *menu_shell,
  68. GtkWidget *menu_item);
  69. void (*insert) (GtkMenuShell *menu_shell,
  70. GtkWidget *child,
  71. gint position);
  72. gint (*get_popup_delay) (GtkMenuShell *menu_shell);
  73. gboolean (*move_selected) (GtkMenuShell *menu_shell,
  74. gint distance);
  75. /* Padding for future expansion */
  76. void (*_gtk_reserved1) (void);
  77. void (*_gtk_reserved2) (void);
  78. };
  79. GType gtk_menu_shell_get_type (void) G_GNUC_CONST;
  80. void gtk_menu_shell_append (GtkMenuShell *menu_shell,
  81. GtkWidget *child);
  82. void gtk_menu_shell_prepend (GtkMenuShell *menu_shell,
  83. GtkWidget *child);
  84. void gtk_menu_shell_insert (GtkMenuShell *menu_shell,
  85. GtkWidget *child,
  86. gint position);
  87. void gtk_menu_shell_deactivate (GtkMenuShell *menu_shell);
  88. void gtk_menu_shell_select_item (GtkMenuShell *menu_shell,
  89. GtkWidget *menu_item);
  90. void gtk_menu_shell_deselect (GtkMenuShell *menu_shell);
  91. void gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
  92. GtkWidget *menu_item,
  93. gboolean force_deactivate);
  94. void gtk_menu_shell_select_first (GtkMenuShell *menu_shell,
  95. gboolean search_sensitive);
  96. void _gtk_menu_shell_select_last (GtkMenuShell *menu_shell,
  97. gboolean search_sensitive);
  98. void _gtk_menu_shell_activate (GtkMenuShell *menu_shell);
  99. gint _gtk_menu_shell_get_popup_delay (GtkMenuShell *menu_shell);
  100. void gtk_menu_shell_cancel (GtkMenuShell *menu_shell);
  101. void _gtk_menu_shell_add_mnemonic (GtkMenuShell *menu_shell,
  102. guint keyval,
  103. GtkWidget *target);
  104. void _gtk_menu_shell_remove_mnemonic (GtkMenuShell *menu_shell,
  105. guint keyval,
  106. GtkWidget *target);
  107. gboolean gtk_menu_shell_get_take_focus (GtkMenuShell *menu_shell);
  108. void gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell,
  109. gboolean take_focus);
  110. void _gtk_menu_shell_update_mnemonics (GtkMenuShell *menu_shell);
  111. void _gtk_menu_shell_set_keyboard_mode (GtkMenuShell *menu_shell,
  112. gboolean keyboard_mode);
  113. gboolean _gtk_menu_shell_get_keyboard_mode (GtkMenuShell *menu_shell);
  114. G_END_DECLS
  115. #endif /* __GTK_MENU_SHELL_H__ */