Fix crash on NextStep terminal (Bug#5837)
[bpt/emacs.git] / lwlib / xlwmenuP.h
CommitLineData
44862e8e 1/* Internals of a lightweight menubar widget.
016c80c3 2Copyright (C) 1992 Lucid, Inc.
114f9c96 3Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
016c80c3 4 Free Software Foundation, Inc.
44862e8e
SM
5
6This file is part of the Lucid Widget Library.
7
8The Lucid Widget Library is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License as published by
569305b2 10the Free Software Foundation; either version 1, or (at your option)
44862e8e
SM
11any later version.
12
13The Lucid Widget Library is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU Emacs; see the file COPYING. If not, write to the
364c38d3
LK
20Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21Boston, 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. */
33typedef struct _window_state
34{
35 Window window;
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 52typedef 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
60 String faceName;
61 int default_face;
62 XftFont* xft_font;
63 XftColor xft_fg, xft_bg, xft_disabled_fg;
423a3f59 64#endif
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 119typedef struct _XlwMenuRec
07c30a5c
RS
120{
121 CorePart core;
122 XlwMenuPart menu;
123} XlwMenuRec;
124
125/* New fields for the XlwMenu widget class record */
ba755702 126typedef struct
07c30a5c
RS
127{
128 int dummy;
129} XlwMenuClassPart;
130
131/* Full class record declaration. */
ba755702 132typedef struct _XlwMenuClassRec
07c30a5c
RS
133{
134 CoreClassPart core_class;
135 XlwMenuClassPart menu_class;
136} XlwMenuClassRec;
137
138/* Class pointer. */
139extern XlwMenuClassRec xlwMenuClassRec;
140
141#endif /* _XlwMenuP_h */
ab5796a9
MB
142
143/* arch-tag: 18d7fc41-ffa0-47a3-a49f-3469900c7a25
144 (do not change this comment) */