Merge from emacs-24; up to 2012-12-29T12:57:49Z!fgallina@gnu.org
[bpt/emacs.git] / lwlib / xlwmenuP.h
... / ...
CommitLineData
1/* Internals of a lightweight menubar widget.
2
3Copyright (C) 2002-2013 Free Software Foundation, Inc.
4Copyright (C) 1992 Lucid, Inc.
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
10the Free Software Foundation; either version 1, or (at your option)
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. If not, see <http://www.gnu.org/licenses/>. */
20
21#ifndef _XlwMenuP_h
22#define _XlwMenuP_h
23
24#include "xlwmenu.h"
25#include <X11/CoreP.h>
26#ifdef HAVE_XFT
27#include <X11/Xft/Xft.h>
28#endif
29
30/* Elements in the stack arrays. */
31typedef struct _window_state
32{
33 Widget w;
34 Window window;
35 Pixmap pixmap;
36 Position x;
37 Position y;
38 Dimension width;
39 Dimension height;
40 Dimension label_width;
41 int max_rest_width;
42
43 /* Width of toggle buttons or radio buttons. */
44 Dimension button_width;
45#ifdef HAVE_XFT
46 XftDraw* xft_draw;
47#endif
48} window_state;
49
50
51/* New fields for the XlwMenu widget instance record */
52typedef struct _XlwMenu_part
53{
54 /* slots set by the resources */
55#ifdef HAVE_X_I18N
56 XFontSet fontSet;
57 XFontSetExtents *font_extents;
58#endif
59#ifdef HAVE_XFT
60 int default_face;
61 XftFont* xft_font;
62 XftColor xft_fg, xft_bg, xft_disabled_fg;
63#endif
64 String fontName;
65 XFontStruct* font;
66 Pixel foreground;
67 Pixel disabled_foreground;
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;
78 Cursor cursor_shape;
79 XtCallbackList open;
80 XtCallbackList select, highlight;
81 XtCallbackList enter, leave;
82 widget_value* contents;
83 int horizontal;
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;
88
89 /* State of the XlwMenu */
90 int top_depth;
91 int old_depth;
92 widget_value** old_stack;
93 int old_stack_length;
94 widget_value* inside_entry;
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;
109 GC disabled_gc;
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 */
119typedef struct _XlwMenuRec
120{
121 CorePart core;
122 XlwMenuPart menu;
123} XlwMenuRec;
124
125/* New fields for the XlwMenu widget class record */
126typedef struct
127{
128 int dummy;
129} XlwMenuClassPart;
130
131/* Full class record declaration. */
132typedef struct _XlwMenuClassRec
133{
134 CoreClassPart core_class;
135 XlwMenuClassPart menu_class;
136} XlwMenuClassRec;
137
138/* Class pointer. */
139extern XlwMenuClassRec xlwMenuClassRec;
140
141#endif /* _XlwMenuP_h */