annotate lwlib/xlwmenuP.h @ 90130:5c6cb7e043ea

Sync with the main trunk.
author Kenichi Handa <handa@m17n.org>
date Mon, 28 Mar 2005 07:31:49 +0000
parents 13796b0653c7
children 7a3341d65a12
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
60584
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
1 /* Internals of a lightweight menubar widget.
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
2 Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
3
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
4 This file is part of the Lucid Widget Library.
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
5
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
6 The Lucid Widget Library is free software; you can redistribute it and/or
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
7 modify it under the terms of the GNU General Public License as published by
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
9 any later version.
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
10
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
11 The Lucid Widget Library is distributed in the hope that it will be useful,
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
14 GNU General Public License for more details.
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
15
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
16 You should have received a copy of the GNU General Public License
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to the
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
18 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
19 Boston, MA 02111-1307, USA. */
597c62d04dec Add missing copyright and license notice.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 53564
diff changeset
20
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 #ifndef _XlwMenuP_h
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 #define _XlwMenuP_h
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 #include "xlwmenu.h"
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 #include <X11/CoreP.h>
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
60829
583a7eb791dd Temporary #undef HAVE_X_I18N until FontSet for UTF-8
Jan Djärv <jan.h.d@swipnet.se>
parents: 60698
diff changeset
27 /* FIXME: HAVE_X_I18N does not work yet. */
583a7eb791dd Temporary #undef HAVE_X_I18N until FontSet for UTF-8
Jan Djärv <jan.h.d@swipnet.se>
parents: 60698
diff changeset
28 #undef HAVE_X_I18N
583a7eb791dd Temporary #undef HAVE_X_I18N until FontSet for UTF-8
Jan Djärv <jan.h.d@swipnet.se>
parents: 60698
diff changeset
29
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 /* Elements in the stack arrays. */
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 typedef struct _window_state
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 {
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 Window window;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 Position x;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 Position y;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 Dimension width;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 Dimension height;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 Dimension label_width;
25033
584c34c7cf53 (_window_state): Add button_width.
Gerd Moellmann <gerd@gnu.org>
parents: 7360
diff changeset
39
584c34c7cf53 (_window_state): Add button_width.
Gerd Moellmann <gerd@gnu.org>
parents: 7360
diff changeset
40 /* Width of toggle buttons or radio buttons. */
584c34c7cf53 (_window_state): Add button_width.
Gerd Moellmann <gerd@gnu.org>
parents: 7360
diff changeset
41 Dimension button_width;
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 } window_state;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 /* New fields for the XlwMenu widget instance record */
45145
762469b26903 (_XlwMenu_part): Add new member `disabled_foreground'.
Pavel Janík <Pavel@Janik.cz>
parents: 29699
diff changeset
46 typedef struct _XlwMenu_part
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47 {
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 /* slots set by the resources */
60698
3e557e11645e Add support for I18N to Lucid menus.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60584
diff changeset
49 #ifdef HAVE_X_I18N
3e557e11645e Add support for I18N to Lucid menus.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60584
diff changeset
50 XFontSet font;
3e557e11645e Add support for I18N to Lucid menus.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60584
diff changeset
51 XFontSetExtents *font_extents;
3e557e11645e Add support for I18N to Lucid menus.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60584
diff changeset
52 #else
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 XFontStruct* font;
60698
3e557e11645e Add support for I18N to Lucid menus.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60584
diff changeset
54 #endif
7360
cfb65c58eb9a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 7359
diff changeset
55 Pixel foreground;
45145
762469b26903 (_XlwMenu_part): Add new member `disabled_foreground'.
Pavel Janík <Pavel@Janik.cz>
parents: 29699
diff changeset
56 Pixel disabled_foreground;
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 Pixel button_foreground;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 Dimension margin;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 Dimension horizontal_spacing;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 Dimension vertical_spacing;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 Dimension arrow_spacing;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 Dimension shadow_thickness;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 Pixel top_shadow_color;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 Pixel bottom_shadow_color;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 Pixmap top_shadow_pixmap;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 Pixmap bottom_shadow_pixmap;
7360
cfb65c58eb9a entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 7359
diff changeset
67 Cursor cursor_shape;
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 XtCallbackList open;
27340
1d84a7873d7c (_XlwMenu_part): Add `highlight' callback list.
Gerd Moellmann <gerd@gnu.org>
parents: 25033
diff changeset
69 XtCallbackList select, highlight;
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 widget_value* contents;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 int horizontal;
29699
bb36becbd66b (_XlwMenu_part): Add free_top_shadow_color_p and
Gerd Moellmann <gerd@gnu.org>
parents: 27340
diff changeset
72
bb36becbd66b (_XlwMenu_part): Add free_top_shadow_color_p and
Gerd Moellmann <gerd@gnu.org>
parents: 27340
diff changeset
73 /* True means top_shadow_color and/or bottom_shadow_color must be freed. */
bb36becbd66b (_XlwMenu_part): Add free_top_shadow_color_p and
Gerd Moellmann <gerd@gnu.org>
parents: 27340
diff changeset
74 unsigned free_top_shadow_color_p : 1;
bb36becbd66b (_XlwMenu_part): Add free_top_shadow_color_p and
Gerd Moellmann <gerd@gnu.org>
parents: 27340
diff changeset
75 unsigned free_bottom_shadow_color_p : 1;
45145
762469b26903 (_XlwMenu_part): Add new member `disabled_foreground'.
Pavel Janík <Pavel@Janik.cz>
parents: 29699
diff changeset
76
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 /* State of the XlwMenu */
53564
609ef1718642 Changes for lucid popup menus (keyboard traversal enabled) and dialogs
Jan Djärv <jan.h.d@swipnet.se>
parents: 52401
diff changeset
78 int top_depth;
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 int old_depth;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 widget_value** old_stack;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 int old_stack_length;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 /* New state after the user moved */
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 int new_depth;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 widget_value** new_stack;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 int new_stack_length;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 /* Window resources */
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 window_state* windows;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 int windows_length;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 /* Internal part, set by the XlwMenu */
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 GC foreground_gc;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 GC button_gc;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 GC background_gc;
45145
762469b26903 (_XlwMenu_part): Add new member `disabled_foreground'.
Pavel Janík <Pavel@Janik.cz>
parents: 29699
diff changeset
96 GC disabled_gc;
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 GC inactive_button_gc;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 GC shadow_top_gc;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 GC shadow_bottom_gc;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 Cursor cursor;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 Boolean popped_up;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 Pixmap gray_pixmap;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 } XlwMenuPart;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 /* Full instance record declaration */
45145
762469b26903 (_XlwMenu_part): Add new member `disabled_foreground'.
Pavel Janík <Pavel@Janik.cz>
parents: 29699
diff changeset
106 typedef struct _XlwMenuRec
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 {
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 CorePart core;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 XlwMenuPart menu;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 } XlwMenuRec;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 /* New fields for the XlwMenu widget class record */
45145
762469b26903 (_XlwMenu_part): Add new member `disabled_foreground'.
Pavel Janík <Pavel@Janik.cz>
parents: 29699
diff changeset
113 typedef struct
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 {
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 int dummy;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 } XlwMenuClassPart;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 /* Full class record declaration. */
45145
762469b26903 (_XlwMenu_part): Add new member `disabled_foreground'.
Pavel Janík <Pavel@Janik.cz>
parents: 29699
diff changeset
119 typedef struct _XlwMenuClassRec
7359
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 {
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 CoreClassPart core_class;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 XlwMenuClassPart menu_class;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 } XlwMenuClassRec;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 /* Class pointer. */
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 extern XlwMenuClassRec xlwMenuClassRec;
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127
6ab8e21b9b7c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 #endif /* _XlwMenuP_h */
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 45145
diff changeset
129
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 45145
diff changeset
130 /* arch-tag: 18d7fc41-ffa0-47a3-a49f-3469900c7a25
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 45145
diff changeset
131 (do not change this comment) */