Commit | Line | Data |
---|---|---|
44862e8e | 1 | /* Internals of a lightweight menubar widget. |
95df8112 GM |
2 | |
3 | Copyright (C) 2002-2011 Free Software Foundation, Inc. | |
016c80c3 | 4 | Copyright (C) 1992 Lucid, Inc. |
44862e8e SM |
5 | |
6 | This file is part of the Lucid Widget Library. | |
7 | ||
8 | The Lucid Widget Library is free software; you can redistribute it and/or | |
9 | modify it under the terms of the GNU General Public License as published by | |
569305b2 | 10 | the Free Software Foundation; either version 1, or (at your option) |
44862e8e SM |
11 | any later version. |
12 | ||
13 | The Lucid Widget Library is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with GNU Emacs; see the file COPYING. If not, write to the | |
364c38d3 LK |
20 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 | Boston, MA 02110-1301, USA. */ | |
44862e8e | 22 | |
07c30a5c RS |
23 | #ifndef _XlwMenuP_h |
24 | #define _XlwMenuP_h | |
25 | ||
26 | #include "xlwmenu.h" | |
27 | #include <X11/CoreP.h> | |
99852628 JD |
28 | #ifdef HAVE_XFT |
29 | #include <X11/Xft/Xft.h> | |
30 | #endif | |
07c30a5c RS |
31 | |
32 | /* Elements in the stack arrays. */ | |
33 | typedef struct _window_state | |
34 | { | |
f0bd1598 | 35 | Widget w; |
07c30a5c | 36 | Window window; |
f0bd1598 | 37 | Pixmap pixmap; |
07c30a5c RS |
38 | Position x; |
39 | Position y; | |
40 | Dimension width; | |
41 | Dimension height; | |
42 | Dimension label_width; | |
99852628 | 43 | int max_rest_width; |
7c2eb6d1 GM |
44 | |
45 | /* Width of toggle buttons or radio buttons. */ | |
46 | Dimension button_width; | |
99852628 JD |
47 | #ifdef HAVE_XFT |
48 | XftDraw* xft_draw; | |
49 | #endif | |
07c30a5c RS |
50 | } window_state; |
51 | ||
52 | ||
53 | /* New fields for the XlwMenu widget instance record */ | |
ba755702 | 54 | typedef struct _XlwMenu_part |
07c30a5c RS |
55 | { |
56 | /* slots set by the resources */ | |
423a3f59 | 57 | #ifdef HAVE_X_I18N |
37484540 | 58 | XFontSet fontSet; |
423a3f59 | 59 | XFontSetExtents *font_extents; |
99852628 JD |
60 | #endif |
61 | #ifdef HAVE_XFT | |
99852628 JD |
62 | int default_face; |
63 | XftFont* xft_font; | |
64 | XftColor xft_fg, xft_bg, xft_disabled_fg; | |
423a3f59 | 65 | #endif |
3928f2b6 | 66 | String fontName; |
37484540 | 67 | XFontStruct* font; |
98270d54 | 68 | Pixel foreground; |
ba755702 | 69 | Pixel disabled_foreground; |
07c30a5c RS |
70 | Pixel button_foreground; |
71 | Dimension margin; | |
72 | Dimension horizontal_spacing; | |
73 | Dimension vertical_spacing; | |
74 | Dimension arrow_spacing; | |
75 | Dimension shadow_thickness; | |
76 | Pixel top_shadow_color; | |
77 | Pixel bottom_shadow_color; | |
78 | Pixmap top_shadow_pixmap; | |
79 | Pixmap bottom_shadow_pixmap; | |
98270d54 | 80 | Cursor cursor_shape; |
07c30a5c | 81 | XtCallbackList open; |
ad45c495 | 82 | XtCallbackList select, highlight; |
36bce9a9 | 83 | XtCallbackList enter, leave; |
07c30a5c RS |
84 | widget_value* contents; |
85 | int horizontal; | |
457d47f8 GM |
86 | |
87 | /* True means top_shadow_color and/or bottom_shadow_color must be freed. */ | |
88 | unsigned free_top_shadow_color_p : 1; | |
89 | unsigned free_bottom_shadow_color_p : 1; | |
ba755702 | 90 | |
07c30a5c | 91 | /* State of the XlwMenu */ |
244c93fe | 92 | int top_depth; |
07c30a5c RS |
93 | int old_depth; |
94 | widget_value** old_stack; | |
95 | int old_stack_length; | |
36bce9a9 | 96 | widget_value* inside_entry; |
07c30a5c RS |
97 | |
98 | /* New state after the user moved */ | |
99 | int new_depth; | |
100 | widget_value** new_stack; | |
101 | int new_stack_length; | |
102 | ||
103 | /* Window resources */ | |
104 | window_state* windows; | |
105 | int windows_length; | |
106 | ||
107 | /* Internal part, set by the XlwMenu */ | |
108 | GC foreground_gc; | |
109 | GC button_gc; | |
110 | GC background_gc; | |
ba755702 | 111 | GC disabled_gc; |
07c30a5c RS |
112 | GC inactive_button_gc; |
113 | GC shadow_top_gc; | |
114 | GC shadow_bottom_gc; | |
115 | Cursor cursor; | |
116 | Boolean popped_up; | |
117 | Pixmap gray_pixmap; | |
118 | } XlwMenuPart; | |
119 | ||
120 | /* Full instance record declaration */ | |
ba755702 | 121 | typedef struct _XlwMenuRec |
07c30a5c RS |
122 | { |
123 | CorePart core; | |
124 | XlwMenuPart menu; | |
125 | } XlwMenuRec; | |
126 | ||
127 | /* New fields for the XlwMenu widget class record */ | |
ba755702 | 128 | typedef struct |
07c30a5c RS |
129 | { |
130 | int dummy; | |
131 | } XlwMenuClassPart; | |
132 | ||
133 | /* Full class record declaration. */ | |
ba755702 | 134 | typedef struct _XlwMenuClassRec |
07c30a5c RS |
135 | { |
136 | CoreClassPart core_class; | |
137 | XlwMenuClassPart menu_class; | |
138 | } XlwMenuClassRec; | |
139 | ||
140 | /* Class pointer. */ | |
141 | extern XlwMenuClassRec xlwMenuClassRec; | |
142 | ||
143 | #endif /* _XlwMenuP_h */ | |
ab5796a9 | 144 |