]> Pileus Git - ~andy/gtk/blob - gtk/gtkmenuprivate.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtkmenuprivate.h
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, see <http://www.gnu.org/licenses/>.
16  */
17
18 /*
19  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
20  * file for a list of people on the GTK+ Team.  See the ChangeLog
21  * files for a list of changes.  These files are distributed with
22  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23  */
24
25 #ifndef __GTK_MENU_PRIVATE_H__
26 #define __GTK_MENU_PRIVATE_H__
27
28 #include <gtk/gtkmenu.h>
29
30 G_BEGIN_DECLS
31
32 /* Directions for submenus */
33 typedef enum
34 {
35   GTK_DIRECTION_LEFT,
36   GTK_DIRECTION_RIGHT
37 } GtkSubmenuDirection;
38
39 /* Placement of submenus */
40 typedef enum
41 {
42   GTK_TOP_BOTTOM,
43   GTK_LEFT_RIGHT
44 } GtkSubmenuPlacement;
45
46
47 struct _GtkMenuPrivate
48 {
49   GtkWidget *parent_menu_item;
50   GtkWidget *old_active_menu_item;
51
52   GtkAccelGroup *accel_group;
53   gchar         *accel_path;
54
55   GtkMenuPositionFunc position_func;
56   gpointer            position_func_data;
57   GDestroyNotify      position_func_data_destroy;
58   gint                position_x;
59   gint                position_y;
60
61   guint toggle_size;
62   guint accel_size;
63
64   /* Do _not_ touch these widgets directly. We hide the reference
65    * count from the toplevel to the menu, so it must be restored
66    * before operating on these widgets
67    */
68   GtkWidget *toplevel;
69
70   GtkWidget     *tearoff_window;
71   GtkWidget     *tearoff_hbox;
72   GtkWidget     *tearoff_scrollbar;
73   GtkAdjustment *tearoff_adjustment;
74
75   GdkWindow *view_window;
76   GdkWindow *bin_window;
77
78   gint scroll_offset;
79   gint saved_scroll_offset;
80   gint scroll_step;
81
82   guint scroll_timeout;
83
84   guint needs_destruction_ref : 1;
85   guint torn_off              : 1;
86   /* The tearoff is active when it is torn off and the not-torn-off
87    * menu is not popped up.
88    */
89   guint tearoff_active        : 1;
90   guint scroll_fast           : 1;
91
92   guint upper_arrow_visible   : 1;
93   guint lower_arrow_visible   : 1;
94   guint upper_arrow_prelight  : 1;
95   guint lower_arrow_prelight  : 1;
96
97   guint have_position         : 1;
98   guint have_layout           : 1;
99   guint seen_item_enter       : 1;
100   guint ignore_button_release : 1;
101   guint no_toggle_size        : 1;
102   guint drag_already_pressed  : 1;
103   guint drag_scroll_started   : 1;
104
105   /* info used for the table */
106   guint *heights;
107   gint heights_length;
108   gint requested_height;
109
110   gboolean initially_pushed_in;
111   gint monitor_num;
112
113   /* Cached layout information */
114   gint n_rows;
115   gint n_columns;
116
117   gchar *title;
118
119  /* Arrow states */
120   GtkStateFlags lower_arrow_state;
121   GtkStateFlags upper_arrow_state;
122
123   /* navigation region */
124   gint navigation_x;
125   gint navigation_y;
126   gint navigation_width;
127   gint navigation_height;
128
129   guint navigation_timeout;
130
131   gdouble drag_start_y;
132   gint initial_drag_offset;
133 };
134
135 G_END_DECLS
136
137 #endif /* __GTK_MENU_PRIVATE_H__ */