Commit | Line | Data |
---|---|---|
44862e8e | 1 | /* Internals of a lightweight menubar widget. |
95df8112 | 2 | |
ab422c4d | 3 | Copyright (C) 2002-2013 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 | |
fee0bd5f | 19 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
44862e8e | 20 | |
07c30a5c RS |
21 | #ifndef _XlwMenuP_h |
22 | #define _XlwMenuP_h | |
23 | ||
24 | #include "xlwmenu.h" | |
25 | #include <X11/CoreP.h> | |
99852628 JD |
26 | #ifdef HAVE_XFT |
27 | #include <X11/Xft/Xft.h> | |
28 | #endif | |
07c30a5c RS |
29 | |
30 | /* Elements in the stack arrays. */ | |
31 | typedef struct _window_state | |
32 | { | |
f0bd1598 | 33 | Widget w; |
07c30a5c | 34 | Window window; |
f0bd1598 | 35 | Pixmap pixmap; |
07c30a5c RS |
36 | Position x; |
37 | Position y; | |
38 | Dimension width; | |
39 | Dimension height; | |
40 | Dimension label_width; | |
99852628 | 41 | int max_rest_width; |
7c2eb6d1 GM |
42 | |
43 | /* Width of toggle buttons or radio buttons. */ | |
44 | Dimension button_width; | |
99852628 JD |
45 | #ifdef HAVE_XFT |
46 | XftDraw* xft_draw; | |
47 | #endif | |
07c30a5c RS |
48 | } window_state; |
49 | ||
50 | ||
51 | /* New fields for the XlwMenu widget instance record */ | |
ba755702 | 52 | typedef struct _XlwMenu_part |
07c30a5c RS |
53 | { |
54 | /* slots set by the resources */ | |
423a3f59 | 55 | #ifdef HAVE_X_I18N |
37484540 | 56 | XFontSet fontSet; |
423a3f59 | 57 | XFontSetExtents *font_extents; |
99852628 JD |
58 | #endif |
59 | #ifdef HAVE_XFT | |
99852628 JD |
60 | int default_face; |
61 | XftFont* xft_font; | |
62 | XftColor xft_fg, xft_bg, xft_disabled_fg; | |
423a3f59 | 63 | #endif |
3928f2b6 | 64 | String fontName; |
37484540 | 65 | XFontStruct* font; |
98270d54 | 66 | Pixel foreground; |
ba755702 | 67 | Pixel disabled_foreground; |
07c30a5c RS |
68 | Pixel button_foreground; |
69 | Dimension margin; | |
70 | Dimension horizontal_spacing; | |
71 | Dimension vertical_spacing; | |
72 | Dimension arrow_spacing; | |
73 | Dimension shadow_thickness; | |
74 | Pixel top_shadow_color; | |
75 | Pixel bottom_shadow_color; | |
76 | Pixmap top_shadow_pixmap; | |
77 | Pixmap bottom_shadow_pixmap; | |
98270d54 | 78 | Cursor cursor_shape; |
07c30a5c | 79 | XtCallbackList open; |
ad45c495 | 80 | XtCallbackList select, highlight; |
36bce9a9 | 81 | XtCallbackList enter, leave; |
07c30a5c RS |
82 | widget_value* contents; |
83 | int horizontal; | |
457d47f8 GM |
84 | |
85 | /* True means top_shadow_color and/or bottom_shadow_color must be freed. */ | |
86 | unsigned free_top_shadow_color_p : 1; | |
87 | unsigned free_bottom_shadow_color_p : 1; | |
ba755702 | 88 | |
07c30a5c | 89 | /* State of the XlwMenu */ |
244c93fe | 90 | int top_depth; |
07c30a5c RS |
91 | int old_depth; |
92 | widget_value** old_stack; | |
93 | int old_stack_length; | |
36bce9a9 | 94 | widget_value* inside_entry; |
07c30a5c RS |
95 | |
96 | /* New state after the user moved */ | |
97 | int new_depth; | |
98 | widget_value** new_stack; | |
99 | int new_stack_length; | |
100 | ||
101 | /* Window resources */ | |
102 | window_state* windows; | |
103 | int windows_length; | |
104 | ||
105 | /* Internal part, set by the XlwMenu */ | |
106 | GC foreground_gc; | |
107 | GC button_gc; | |
108 | GC background_gc; | |
ba755702 | 109 | GC disabled_gc; |
07c30a5c RS |
110 | GC inactive_button_gc; |
111 | GC shadow_top_gc; | |
112 | GC shadow_bottom_gc; | |
113 | Cursor cursor; | |
114 | Boolean popped_up; | |
115 | Pixmap gray_pixmap; | |
116 | } XlwMenuPart; | |
117 | ||
118 | /* Full instance record declaration */ | |
ba755702 | 119 | typedef struct _XlwMenuRec |
07c30a5c RS |
120 | { |
121 | CorePart core; | |
122 | XlwMenuPart menu; | |
123 | } XlwMenuRec; | |
124 | ||
125 | /* New fields for the XlwMenu widget class record */ | |
ba755702 | 126 | typedef struct |
07c30a5c RS |
127 | { |
128 | int dummy; | |
129 | } XlwMenuClassPart; | |
130 | ||
131 | /* Full class record declaration. */ | |
ba755702 | 132 | typedef struct _XlwMenuClassRec |
07c30a5c RS |
133 | { |
134 | CoreClassPart core_class; | |
135 | XlwMenuClassPart menu_class; | |
136 | } XlwMenuClassRec; | |
137 | ||
138 | /* Class pointer. */ | |
139 | extern XlwMenuClassRec xlwMenuClassRec; | |
140 | ||
141 | #endif /* _XlwMenuP_h */ |