]> Pileus Git - ~andy/gtk/blob - gtk/gtkmenuprivate.h
Updated Norwegian bokmål translation
[~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, write to the Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
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
26 #ifndef __GTK_MENU_PRIVATE_H__
27 #define __GTK_MENU_PRIVATE_H__
28
29 #include <gtk/gtkmenu.h>
30
31 G_BEGIN_DECLS
32
33 /* Directions for submenus */
34 typedef enum
35 {
36   GTK_DIRECTION_LEFT,
37   GTK_DIRECTION_RIGHT
38 } GtkSubmenuDirection;
39
40 /* Placement of submenus */
41 typedef enum
42 {
43   GTK_TOP_BOTTOM,
44   GTK_LEFT_RIGHT
45 } GtkSubmenuPlacement;
46
47
48 struct _GtkMenuPrivate
49 {
50   GtkWidget *parent_menu_item;
51   GtkWidget *old_active_menu_item;
52
53   GtkAccelGroup *accel_group;
54   gchar         *accel_path;
55
56   GtkMenuPositionFunc position_func;
57   gpointer            position_func_data;
58   GDestroyNotify      position_func_data_destroy;
59   gint                position_x;
60   gint                position_y;
61
62   guint toggle_size;
63   guint accel_size;
64
65   /* Do _not_ touch these widgets directly. We hide the reference
66    * count from the toplevel to the menu, so it must be restored
67    * before operating on these widgets
68    */
69   GtkWidget *toplevel;
70
71   GtkWidget     *tearoff_window;
72   GtkWidget     *tearoff_hbox;
73   GtkWidget     *tearoff_scrollbar;
74   GtkAdjustment *tearoff_adjustment;
75
76   GdkWindow *view_window;
77   GdkWindow *bin_window;
78
79   gint scroll_offset;
80   gint saved_scroll_offset;
81   gint scroll_step;
82
83   guint scroll_timeout;
84
85   guint needs_destruction_ref : 1;
86   guint torn_off              : 1;
87   /* The tearoff is active when it is torn off and the not-torn-off
88    * menu is not popped up.
89    */
90   guint tearoff_active        : 1;
91   guint scroll_fast           : 1;
92
93   guint upper_arrow_visible   : 1;
94   guint lower_arrow_visible   : 1;
95   guint upper_arrow_prelight  : 1;
96   guint lower_arrow_prelight  : 1;
97
98   guint have_position         : 1;
99   guint have_layout           : 1;
100   guint seen_item_enter       : 1;
101   guint ignore_button_release : 1;
102   guint no_toggle_size        : 1;
103
104   /* info used for the table */
105   guint *heights;
106   gint heights_length;
107   gint requested_height;
108
109   gboolean initially_pushed_in;
110   gint monitor_num;
111
112   /* Cached layout information */
113   gint n_rows;
114   gint n_columns;
115
116   gchar *title;
117
118  /* Arrow states */
119   GtkStateFlags lower_arrow_state;
120   GtkStateFlags upper_arrow_state;
121
122   /* navigation region */
123   gint navigation_x;
124   gint navigation_y;
125   gint navigation_width;
126   gint navigation_height;
127
128   guint navigation_timeout;
129 };
130
131 G_END_DECLS
132
133 #endif /* __GTK_MENU_PRIVATE_H__ */