]> code.delx.au - gnu-emacs/blob - lwlib/xlwmenuP.h
9937aa174ef894d2b9e5b9fd81e75c67f3847409
[gnu-emacs] / lwlib / xlwmenuP.h
1 /* Internals of a lightweight menubar widget.
2 Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
3
4 This file is part of the Lucid Widget Library.
5
6 The Lucid Widget Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 The Lucid Widget Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 #ifndef _XlwMenuP_h
22 #define _XlwMenuP_h
23
24 #include "xlwmenu.h"
25 #include <X11/CoreP.h>
26
27 /* Elements in the stack arrays. */
28 typedef struct _window_state
29 {
30 Window window;
31 Position x;
32 Position y;
33 Dimension width;
34 Dimension height;
35 Dimension label_width;
36
37 /* Width of toggle buttons or radio buttons. */
38 Dimension button_width;
39 } window_state;
40
41
42 /* New fields for the XlwMenu widget instance record */
43 typedef struct _XlwMenu_part
44 {
45 /* slots set by the resources */
46 #ifdef HAVE_X_I18N
47 XFontSet font;
48 XFontSetExtents *font_extents;
49 #else
50 XFontStruct* font;
51 #endif
52 Pixel foreground;
53 Pixel disabled_foreground;
54 Pixel button_foreground;
55 Dimension margin;
56 Dimension horizontal_spacing;
57 Dimension vertical_spacing;
58 Dimension arrow_spacing;
59 Dimension shadow_thickness;
60 Pixel top_shadow_color;
61 Pixel bottom_shadow_color;
62 Pixmap top_shadow_pixmap;
63 Pixmap bottom_shadow_pixmap;
64 Cursor cursor_shape;
65 XtCallbackList open;
66 XtCallbackList select, highlight;
67 widget_value* contents;
68 int horizontal;
69
70 /* True means top_shadow_color and/or bottom_shadow_color must be freed. */
71 unsigned free_top_shadow_color_p : 1;
72 unsigned free_bottom_shadow_color_p : 1;
73
74 /* State of the XlwMenu */
75 int top_depth;
76 int old_depth;
77 widget_value** old_stack;
78 int old_stack_length;
79
80 /* New state after the user moved */
81 int new_depth;
82 widget_value** new_stack;
83 int new_stack_length;
84
85 /* Window resources */
86 window_state* windows;
87 int windows_length;
88
89 /* Internal part, set by the XlwMenu */
90 GC foreground_gc;
91 GC button_gc;
92 GC background_gc;
93 GC disabled_gc;
94 GC inactive_button_gc;
95 GC shadow_top_gc;
96 GC shadow_bottom_gc;
97 Cursor cursor;
98 Boolean popped_up;
99 Pixmap gray_pixmap;
100 } XlwMenuPart;
101
102 /* Full instance record declaration */
103 typedef struct _XlwMenuRec
104 {
105 CorePart core;
106 XlwMenuPart menu;
107 } XlwMenuRec;
108
109 /* New fields for the XlwMenu widget class record */
110 typedef struct
111 {
112 int dummy;
113 } XlwMenuClassPart;
114
115 /* Full class record declaration. */
116 typedef struct _XlwMenuClassRec
117 {
118 CoreClassPart core_class;
119 XlwMenuClassPart menu_class;
120 } XlwMenuClassRec;
121
122 /* Class pointer. */
123 extern XlwMenuClassRec xlwMenuClassRec;
124
125 #endif /* _XlwMenuP_h */
126
127 /* arch-tag: 18d7fc41-ffa0-47a3-a49f-3469900c7a25
128 (do not change this comment) */