annotate oldXMenu/XMenu.h @ 111870:b47e85affa59

Derive from prog-mode, use derived-mode-p, and fix up various minor style issues in lisp/progmodes. * lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init) (vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable -> make-local-hook. * lisp/progmodes/sh-script.el (sh-require-final-newline): Remove. (sh-set-shell): Don't set require-final-newline since it's already done by prog-mode. * lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column since we never set it. * lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation): Use read-string and standard prompt. * lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration. * lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl. (meta-common-mode-syntax-table): Rename from meta-mode-syntax-table. (meta-common-mode-map): Rename from meta-mode-map. Remove C-m binding, which is a user preference, not mode specific. (meta-common-mode): New major mode; replace meta-common-initialization. * lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing around with font-lock. * lisp/progmodes/etags.el (select-tags-table-mode): Derive from special-mode. * lisp/progmodes/octave-mod.el (octave-mode): * lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode) (gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode) (gdb-frames-mode, gdb-locals-mode, gdb-registers-mode): Let define-derived-mode do its job. * lisp/progmodes/cpp.el (cpp-edit-mode-map): Move initialization into declaration. (cpp-edit-mode): Use define-derived-mode. (cpp-edit-load): Use derived-mode-p. * lisp/progmodes/mixal-mode.el (mixal-mode): * lisp/progmodes/f90.el (f90-mode): * lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting require-final-newline since prog-mode does it already. * lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string. * lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup. * lisp/progmodes/antlr-mode.el: Require cc-mode upfront. (antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in the declaration. (antlr-directory-dependencies, antlr-show-makefile-rules): Use derived-mode-p. (antlr-language-option): Don't assume point-min==1. (antlr-mode): Use define-derived-mode. * lisp/progmodes/ada-mode.el: Use derived-mode-p. (ada-mode): Use define-derived-mode. Use hack-local-variables-hook. * lisp/progmodes/vhdl-mode.el (vhdl-mode): * lisp/progmodes/verilog-mode.el (verilog-mode): * lisp/progmodes/vera-mode.el (vera-mode): * lisp/progmodes/sql.el (sql-mode): * lisp/progmodes/scheme.el (scheme-mode): * lisp/progmodes/perl-mode.el (perl-mode): * lisp/progmodes/octave-inf.el (inferior-octave-mode): * lisp/progmodes/autoconf.el (autoconf-mode): * lisp/progmodes/m4-mode.el (m4-mode): * lisp/progmodes/inf-lisp.el (inferior-lisp-mode): * lisp/progmodes/idlwave.el (idlwave-mode): * lisp/progmodes/icon.el (icon-mode): * lisp/progmodes/idlw-help.el (idlwave-help-mode): * lisp/progmodes/dcl-mode.el (dcl-mode): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode) (ebrowse-member-mode, ebrowse-electric-position-mode): Use define-derived-mode. * lisp/progmodes/xscheme.el (xscheme-start) (local-set-scheme-interaction-buffer, scheme-interaction-mode): * lisp/progmodes/which-func.el (which-function): * lisp/progmodes/vhdl-mode.el (vhdl-set-style): * lisp/progmodes/verilog-mode.el (verilog-set-compile-command) (verilog-modify-compile-command, verilog-error-regexp-add-xemacs) (verilog-set-define, verilog-auto-reeval-locals): * lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode): * lisp/progmodes/simula.el (simula-mode): * lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode): * lisp/progmodes/python.el (python-check, python-mode): * lisp/progmodes/prolog.el (prolog-mode-variables): * lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions): * lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame): * lisp/progmodes/delphi.el (delphi-mode): * lisp/progmodes/cc-styles.el (c-setup-paragraph-variables): * lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init) (c-font-lock-init): Move make-local-variable to their setq. * lisp/progmodes/xscheme.el (exit-scheme-interaction-mode) (xscheme-enter-interaction-mode, xscheme-enter-debugger-mode) (xscheme-debugger-mode-p, xscheme-send-string-1): * lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word) (tcl-load-file, tcl-restart-with-file): * lisp/progmodes/ps-mode.el (ps-run-running): * lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint): * lisp/progmodes/js.el (js--get-all-known-symbols): * lisp/progmodes/inf-lisp.el (inferior-lisp-proc): * lisp/progmodes/idlwave.el (idlwave-beginning-of-statement) (idlwave-template, idlwave-update-buffer-routine-info) (idlwave-update-current-buffer-info) (idlwave-get-routine-info-from-buffers, idlwave-choose) (idlwave-scan-class-info, idlwave-fix-keywords) (idlwave-list-buffer-load-path-shadows): * lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add) (idlwave-toolbar-remove): * lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action) (idlwave-shell-file-name, idlwave-shell-electric-debug-all-off) (idlwave-shell-menu-def): * lisp/progmodes/idlw-complete-structtag.el (idlwave-prepare-structure-tag-completion): * lisp/progmodes/gud.el (gud-set-buffer): * lisp/progmodes/f90.el (f90-backslash-not-special): * lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 10 Dec 2010 15:00:25 -0500
parents e5ec12c5c82f
children ef719132ddfa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
76174
fec5e03aaf59 Remove FSF copyright since file does not differ significantly from X11
Glenn Morris <rgm@gnu.org>
parents: 75348
diff changeset
1 /* Copyright Massachusetts Institute of Technology 1985 */
fec5e03aaf59 Remove FSF copyright since file does not differ significantly from X11
Glenn Morris <rgm@gnu.org>
parents: 75348
diff changeset
2
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
3 #include "copyright.h"
Dave Love <fx@gnu.org>
parents:
diff changeset
4
Dave Love <fx@gnu.org>
parents:
diff changeset
5
Dave Love <fx@gnu.org>
parents:
diff changeset
6 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
7 * XMenu: MIT Project Athena, X Window system menu package
Dave Love <fx@gnu.org>
parents:
diff changeset
8 *
Dave Love <fx@gnu.org>
parents:
diff changeset
9 * XMenu.h - Include file for the MIT Project Athena
Dave Love <fx@gnu.org>
parents:
diff changeset
10 * XMenu X window system menu package.
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 27454
diff changeset
11 *
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
12 * Author: Tony Della Fera, DEC
Dave Love <fx@gnu.org>
parents:
diff changeset
13 * August, 1984
Dave Love <fx@gnu.org>
parents:
diff changeset
14 */
Dave Love <fx@gnu.org>
parents:
diff changeset
15
Dave Love <fx@gnu.org>
parents:
diff changeset
16 #ifndef _XMenu_h_
Dave Love <fx@gnu.org>
parents:
diff changeset
17 #define _XMenu_h_
Dave Love <fx@gnu.org>
parents:
diff changeset
18
109373
e5ec12c5c82f * oldXMenu/XMenu.h: Include <stdlib.h>.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109124
diff changeset
19 #include <stdlib.h>
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
20 #include <X11/Xutil.h>
Dave Love <fx@gnu.org>
parents:
diff changeset
21 #include "X10.h"
Dave Love <fx@gnu.org>
parents:
diff changeset
22
Dave Love <fx@gnu.org>
parents:
diff changeset
23 #define FAILURE -1
Dave Love <fx@gnu.org>
parents:
diff changeset
24 #define SUCCESS 1
Dave Love <fx@gnu.org>
parents:
diff changeset
25 #define POST_ERROR -1
Dave Love <fx@gnu.org>
parents:
diff changeset
26 #define NO_SELECTION -1
Dave Love <fx@gnu.org>
parents:
diff changeset
27
Dave Love <fx@gnu.org>
parents:
diff changeset
28 #define XM_FAILURE -1
Dave Love <fx@gnu.org>
parents:
diff changeset
29 #define XM_SUCCESS 1
Dave Love <fx@gnu.org>
parents:
diff changeset
30 #define XM_NO_SELECT 2
Dave Love <fx@gnu.org>
parents:
diff changeset
31 #define XM_IA_SELECT 3
Dave Love <fx@gnu.org>
parents:
diff changeset
32
Dave Love <fx@gnu.org>
parents:
diff changeset
33 #define XME_CODE_COUNT 17
Dave Love <fx@gnu.org>
parents:
diff changeset
34
Dave Love <fx@gnu.org>
parents:
diff changeset
35 #define XME_NO_ERROR 0
Dave Love <fx@gnu.org>
parents:
diff changeset
36 #define XME_NOT_INIT 1
Dave Love <fx@gnu.org>
parents:
diff changeset
37 #define XME_ARG_BOUNDS 2
Dave Love <fx@gnu.org>
parents:
diff changeset
38 #define XME_P_NOT_FOUND 3
Dave Love <fx@gnu.org>
parents:
diff changeset
39 #define XME_S_NOT_FOUND 4
Dave Love <fx@gnu.org>
parents:
diff changeset
40 #define XME_STYLE_PARAM 5
Dave Love <fx@gnu.org>
parents:
diff changeset
41 #define XME_GRAB_MOUSE 6
Dave Love <fx@gnu.org>
parents:
diff changeset
42 #define XME_INTERP_LOC 7
Dave Love <fx@gnu.org>
parents:
diff changeset
43 #define XME_CALLOC 8
Dave Love <fx@gnu.org>
parents:
diff changeset
44 #define XME_CREATE_ASSOC 9
Dave Love <fx@gnu.org>
parents:
diff changeset
45 #define XME_STORE_BITMAP 10
Dave Love <fx@gnu.org>
parents:
diff changeset
46 #define XME_MAKE_TILES 11
Dave Love <fx@gnu.org>
parents:
diff changeset
47 #define XME_MAKE_PIXMAP 12
Dave Love <fx@gnu.org>
parents:
diff changeset
48 #define XME_CREATE_CURSOR 13
Dave Love <fx@gnu.org>
parents:
diff changeset
49 #define XME_OPEN_FONT 14
Dave Love <fx@gnu.org>
parents:
diff changeset
50 #define XME_CREATE_WINDOW 15
Dave Love <fx@gnu.org>
parents:
diff changeset
51 #define XME_CREATE_TRANSP 16
Dave Love <fx@gnu.org>
parents:
diff changeset
52
Dave Love <fx@gnu.org>
parents:
diff changeset
53 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
54 * XMenu error code and error list definitions.
Dave Love <fx@gnu.org>
parents:
diff changeset
55 */
Dave Love <fx@gnu.org>
parents:
diff changeset
56 extern int _XMErrorCode;
Dave Love <fx@gnu.org>
parents:
diff changeset
57 extern char *_XMErrorList[];
Dave Love <fx@gnu.org>
parents:
diff changeset
58
Dave Love <fx@gnu.org>
parents:
diff changeset
59 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
60 * Define the XMWindow datatypes.
Dave Love <fx@gnu.org>
parents:
diff changeset
61 *
Dave Love <fx@gnu.org>
parents:
diff changeset
62 * An XMWindow is either an XMPane or an XMSelect.
Dave Love <fx@gnu.org>
parents:
diff changeset
63 *
Dave Love <fx@gnu.org>
parents:
diff changeset
64 * XMWindow is wrapper used to identify the constant window
Dave Love <fx@gnu.org>
parents:
diff changeset
65 * information that makes up XMPane and XMSelect objects.
Dave Love <fx@gnu.org>
parents:
diff changeset
66 *
Dave Love <fx@gnu.org>
parents:
diff changeset
67 * An XMPane is a menu pane made up of one or more XMSelect and a label.
Dave Love <fx@gnu.org>
parents:
diff changeset
68 *
Dave Love <fx@gnu.org>
parents:
diff changeset
69 * An XMSelect is a menu selection object with a label and a data pointer.
Dave Love <fx@gnu.org>
parents:
diff changeset
70 */
Dave Love <fx@gnu.org>
parents:
diff changeset
71 typedef enum _xmwintype {PANE, SELECTION, PL_HEADER, SL_HEADER, SEPARATOR} XMWType;
Dave Love <fx@gnu.org>
parents:
diff changeset
72
Dave Love <fx@gnu.org>
parents:
diff changeset
73 typedef struct _xmwindow {
Dave Love <fx@gnu.org>
parents:
diff changeset
74 struct _xmwindow *next; /* Next obj pointer (for emacs_insque). */
Dave Love <fx@gnu.org>
parents:
diff changeset
75 struct _xmwindow *prev; /* Prev obj pointer (for emacs_insque). */
Dave Love <fx@gnu.org>
parents:
diff changeset
76 XMWType type; /* Type of window. */
Dave Love <fx@gnu.org>
parents:
diff changeset
77 Window window; /* X Window Id. */
Dave Love <fx@gnu.org>
parents:
diff changeset
78 int window_x; /* Window upper left X coordinate. */
Dave Love <fx@gnu.org>
parents:
diff changeset
79 int window_y; /* Window upper left y coordinate. */
Dave Love <fx@gnu.org>
parents:
diff changeset
80 int window_w; /* Window width. */
Dave Love <fx@gnu.org>
parents:
diff changeset
81 int window_h; /* Window height. */
Dave Love <fx@gnu.org>
parents:
diff changeset
82 int active; /* Window active? */
Dave Love <fx@gnu.org>
parents:
diff changeset
83 int activated; /* Window activated? */
Dave Love <fx@gnu.org>
parents:
diff changeset
84 int pad_l1; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
85 char *pad_l2; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
86 int pad_l3; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
87 int pad_l4; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
88 int pad_l5; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
89 int pad_l6; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
90 int pad_l7; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
91 int pad_l8; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
92 struct _xmwindow *pad_l9; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
93 char *pad_l10; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
94 struct _xmwindow *pad_l11; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
95 } XMWindow;
Dave Love <fx@gnu.org>
parents:
diff changeset
96
Dave Love <fx@gnu.org>
parents:
diff changeset
97 typedef struct _xmpane {
Dave Love <fx@gnu.org>
parents:
diff changeset
98 struct _xmpane *next; /* Next obj pointer (for emacs_insque). */
Dave Love <fx@gnu.org>
parents:
diff changeset
99 struct _xmpane *prev; /* Prev obj pointer (for emacs_insque). */
Dave Love <fx@gnu.org>
parents:
diff changeset
100 XMWType type; /* Type of window. */
Dave Love <fx@gnu.org>
parents:
diff changeset
101 Window window; /* X Window Id. */
Dave Love <fx@gnu.org>
parents:
diff changeset
102 int window_x; /* Window upper left X coordinate. */
Dave Love <fx@gnu.org>
parents:
diff changeset
103 int window_y; /* Window upper left y coordinate. */
Dave Love <fx@gnu.org>
parents:
diff changeset
104 int window_w; /* Window width. */
Dave Love <fx@gnu.org>
parents:
diff changeset
105 int window_h; /* Window height. */
Dave Love <fx@gnu.org>
parents:
diff changeset
106 int active; /* Window active? */
Dave Love <fx@gnu.org>
parents:
diff changeset
107 int activated; /* Window activated? */
Dave Love <fx@gnu.org>
parents:
diff changeset
108 int serial; /* -- Pane serial number. */
Dave Love <fx@gnu.org>
parents:
diff changeset
109 char *label; /* -- Pane label. */
Dave Love <fx@gnu.org>
parents:
diff changeset
110 int label_width; /* -- Pane label width in pixels. */
Dave Love <fx@gnu.org>
parents:
diff changeset
111 int label_length; /* -- Pane label length in chars. */
Dave Love <fx@gnu.org>
parents:
diff changeset
112 int label_x; /* -- Pane label X offset. */
Dave Love <fx@gnu.org>
parents:
diff changeset
113 int label_uy; /* -- Pane label upper Y offset. */
Dave Love <fx@gnu.org>
parents:
diff changeset
114 int label_ly; /* -- Pane label lower Y offset. */
Dave Love <fx@gnu.org>
parents:
diff changeset
115 int s_count; /* -- Selections in this pane. */
Dave Love <fx@gnu.org>
parents:
diff changeset
116 struct _xmselect *s_list; /* -- Selection window list. */
Dave Love <fx@gnu.org>
parents:
diff changeset
117 char *pad_l10; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
118 struct _xmwindow *pad_l11; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
119 } XMPane;
Dave Love <fx@gnu.org>
parents:
diff changeset
120
Dave Love <fx@gnu.org>
parents:
diff changeset
121 typedef struct _xmselect {
Dave Love <fx@gnu.org>
parents:
diff changeset
122 struct _xmselect *next; /* Next obj pointer (for emacs_insque). */
Dave Love <fx@gnu.org>
parents:
diff changeset
123 struct _xmselect *prev; /* Prev obj pointer (for emacs_insque). */
Dave Love <fx@gnu.org>
parents:
diff changeset
124 XMWType type; /* Type of window. */
Dave Love <fx@gnu.org>
parents:
diff changeset
125 Window window; /* X Window Id. */
Dave Love <fx@gnu.org>
parents:
diff changeset
126 Window parent; /* X Window id of parent window. */
Dave Love <fx@gnu.org>
parents:
diff changeset
127 int window_x; /* Window upper left X coordinate. */
Dave Love <fx@gnu.org>
parents:
diff changeset
128 int window_y; /* Window upper left y coordinate. */
Dave Love <fx@gnu.org>
parents:
diff changeset
129 int window_w; /* Window width. */
Dave Love <fx@gnu.org>
parents:
diff changeset
130 int window_h; /* Window height. */
Dave Love <fx@gnu.org>
parents:
diff changeset
131 int active; /* Window active? */
Dave Love <fx@gnu.org>
parents:
diff changeset
132 int activated; /* Window activated? */
Dave Love <fx@gnu.org>
parents:
diff changeset
133 int serial; /* -- Selection serial number. */
Dave Love <fx@gnu.org>
parents:
diff changeset
134 char *label; /* -- Selection label. */
Dave Love <fx@gnu.org>
parents:
diff changeset
135 int label_width; /* -- Selection label width in pixels. */
Dave Love <fx@gnu.org>
parents:
diff changeset
136 int label_length; /* -- Selection label length in chars. */
Dave Love <fx@gnu.org>
parents:
diff changeset
137 int label_x; /* -- Selection label X offset. */
Dave Love <fx@gnu.org>
parents:
diff changeset
138 int label_y; /* -- Selection label Y offset. */
Dave Love <fx@gnu.org>
parents:
diff changeset
139 int pad_l7; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
140 int pad_l8; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
141 struct _xmwindow *pad_l9; /* ---- */
Dave Love <fx@gnu.org>
parents:
diff changeset
142 char *data; /* -- Selection data pointer. */
Dave Love <fx@gnu.org>
parents:
diff changeset
143 struct _xmpane *parent_p; /* -- Selection parent pane structure. */
27454
60bf61bbd0b3 (XmSelect): Add member `help_string'.
Gerd Moellmann <gerd@gnu.org>
parents: 25858
diff changeset
144 char *help_string; /* Help string or null. */
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
145 } XMSelect;
Dave Love <fx@gnu.org>
parents:
diff changeset
146
Dave Love <fx@gnu.org>
parents:
diff changeset
147
Dave Love <fx@gnu.org>
parents:
diff changeset
148 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
149 * Define the XMStyle datatype.
Dave Love <fx@gnu.org>
parents:
diff changeset
150 *
Dave Love <fx@gnu.org>
parents:
diff changeset
151 * Menu presentation style information.
Dave Love <fx@gnu.org>
parents:
diff changeset
152 *
Dave Love <fx@gnu.org>
parents:
diff changeset
153 */
Dave Love <fx@gnu.org>
parents:
diff changeset
154 typedef enum _xmstyle {
Dave Love <fx@gnu.org>
parents:
diff changeset
155 LEFT, /* Left oriented obejct. */
Dave Love <fx@gnu.org>
parents:
diff changeset
156 RIGHT, /* Right oriented obejct. */
Dave Love <fx@gnu.org>
parents:
diff changeset
157 CENTER /* Center oriented object. */
Dave Love <fx@gnu.org>
parents:
diff changeset
158 } XMStyle;
Dave Love <fx@gnu.org>
parents:
diff changeset
159
Dave Love <fx@gnu.org>
parents:
diff changeset
160
Dave Love <fx@gnu.org>
parents:
diff changeset
161 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
162 * Define the XMMode datatype.
Dave Love <fx@gnu.org>
parents:
diff changeset
163 *
Dave Love <fx@gnu.org>
parents:
diff changeset
164 * Menu presentation mode information.
Dave Love <fx@gnu.org>
parents:
diff changeset
165 *
Dave Love <fx@gnu.org>
parents:
diff changeset
166 */
Dave Love <fx@gnu.org>
parents:
diff changeset
167 typedef enum _xmmode {
Dave Love <fx@gnu.org>
parents:
diff changeset
168 BOX, /* BOXed graphic rendition. */
Dave Love <fx@gnu.org>
parents:
diff changeset
169 INVERT /* INVERTed graphic rendition. */
Dave Love <fx@gnu.org>
parents:
diff changeset
170 } XMMode;
Dave Love <fx@gnu.org>
parents:
diff changeset
171
Dave Love <fx@gnu.org>
parents:
diff changeset
172
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 27454
diff changeset
173 /*
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 27454
diff changeset
174 * Define the XMenu datatype.
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
175 *
Dave Love <fx@gnu.org>
parents:
diff changeset
176 * All dimensions are in pixels unless otherwise noted.
Dave Love <fx@gnu.org>
parents:
diff changeset
177 */
Dave Love <fx@gnu.org>
parents:
diff changeset
178 typedef struct _xmenu {
Dave Love <fx@gnu.org>
parents:
diff changeset
179 /* -------------------- Menu data -------------------- */
Dave Love <fx@gnu.org>
parents:
diff changeset
180 XMStyle menu_style; /* Menu display style. */
Dave Love <fx@gnu.org>
parents:
diff changeset
181 XMMode menu_mode; /* Menu display mode. */
Dave Love <fx@gnu.org>
parents:
diff changeset
182 int freeze; /* Freeze server mode? */
Dave Love <fx@gnu.org>
parents:
diff changeset
183 int aeq; /* Asynchronous Event Queuing mode? */
Dave Love <fx@gnu.org>
parents:
diff changeset
184 int recompute; /* Recompute menu dependencies? */
Dave Love <fx@gnu.org>
parents:
diff changeset
185 Window parent; /* Menu's parent window. */
Dave Love <fx@gnu.org>
parents:
diff changeset
186 int width; /* Overall menu width. */
Dave Love <fx@gnu.org>
parents:
diff changeset
187 int height; /* Overall menu height. */
Dave Love <fx@gnu.org>
parents:
diff changeset
188 int x_pos; /* Oveall menu origin. */
Dave Love <fx@gnu.org>
parents:
diff changeset
189 int y_pos; /* Overall menu origin. */
Dave Love <fx@gnu.org>
parents:
diff changeset
190 Cursor mouse_cursor; /* Mouse cursor raster. */
Dave Love <fx@gnu.org>
parents:
diff changeset
191 XAssocTable *assoc_tab; /* XMWindow association table. */
Dave Love <fx@gnu.org>
parents:
diff changeset
192 XMPane *p_list; /* List of XMPanes. */
Dave Love <fx@gnu.org>
parents:
diff changeset
193 /* -------------------- Pane window data -------------------- */
Dave Love <fx@gnu.org>
parents:
diff changeset
194 XMStyle p_style; /* Pane display style. */
Dave Love <fx@gnu.org>
parents:
diff changeset
195 int p_events; /* Pane window X events. */
Dave Love <fx@gnu.org>
parents:
diff changeset
196 XFontStruct *p_fnt_info; /* Flag font info structure. */
Dave Love <fx@gnu.org>
parents:
diff changeset
197 GC pane_GC; /* Pane graphics context. */
Dave Love <fx@gnu.org>
parents:
diff changeset
198 int p_fnt_pad; /* Fixed flag font padding in pixels. */
Dave Love <fx@gnu.org>
parents:
diff changeset
199 double p_spread; /* Pane spread in flag height fractions. */
Dave Love <fx@gnu.org>
parents:
diff changeset
200 int p_bdr_width; /* Pane border width. */
Dave Love <fx@gnu.org>
parents:
diff changeset
201 int flag_height; /* Flag height. */
Dave Love <fx@gnu.org>
parents:
diff changeset
202 int p_width; /* Menu pane width. */
Dave Love <fx@gnu.org>
parents:
diff changeset
203 int p_height; /* Menu pane height. */
Dave Love <fx@gnu.org>
parents:
diff changeset
204 int p_x_off; /* Pane window X offset. */
Dave Love <fx@gnu.org>
parents:
diff changeset
205 int p_y_off; /* Pane window Y offset. */
Dave Love <fx@gnu.org>
parents:
diff changeset
206 int p_count; /* Number of panes per menu. */
Dave Love <fx@gnu.org>
parents:
diff changeset
207 /* -------------------- Selection window data -------------------- */
Dave Love <fx@gnu.org>
parents:
diff changeset
208 XMStyle s_style; /* Selection display style. */
Dave Love <fx@gnu.org>
parents:
diff changeset
209 int s_events; /* Selection window X events. */
Dave Love <fx@gnu.org>
parents:
diff changeset
210 XFontStruct *s_fnt_info; /* Body font info structure. */
Dave Love <fx@gnu.org>
parents:
diff changeset
211 int s_fnt_pad; /* Fixed body font padding in pixels. */
Dave Love <fx@gnu.org>
parents:
diff changeset
212 double s_spread; /* Select spread in line height fractions. */
Dave Love <fx@gnu.org>
parents:
diff changeset
213 int s_bdr_width; /* Select border width. */
Dave Love <fx@gnu.org>
parents:
diff changeset
214 int s_width; /* Selection window width. */
Dave Love <fx@gnu.org>
parents:
diff changeset
215 int s_height; /* Selection window height. */
Dave Love <fx@gnu.org>
parents:
diff changeset
216 int s_x_off; /* Selection window X offset. */
Dave Love <fx@gnu.org>
parents:
diff changeset
217 int s_y_off; /* Selection window Y offset. */
Dave Love <fx@gnu.org>
parents:
diff changeset
218 int s_count; /* Maximum number of selections per pane. */
Dave Love <fx@gnu.org>
parents:
diff changeset
219 GC normal_select_GC; /* GC used for inactive selections. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 27454
diff changeset
220 GC inverse_select_GC; /* GC used for active (current) selection. */
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
221 GC inact_GC; /* GC used for inactive selections and */
Dave Love <fx@gnu.org>
parents:
diff changeset
222 /* panes headers. */
Dave Love <fx@gnu.org>
parents:
diff changeset
223 /* -------------------- Color data -------------------- */
Dave Love <fx@gnu.org>
parents:
diff changeset
224 unsigned long p_bdr_color; /* Color of pane border pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
225 unsigned long s_bdr_color; /* Color of selection border pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
226 unsigned long p_frg_color; /* Color of pane foreground pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
227 unsigned long s_frg_color; /* Color of selection pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
228 unsigned long bkgnd_color; /* Color of menu background pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
229 /* -------------------- Pixmap data -------------------- */
Dave Love <fx@gnu.org>
parents:
diff changeset
230 Pixmap p_bdr_pixmap; /* Pane border pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
231 Pixmap s_bdr_pixmap; /* Selection border pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
232 Pixmap p_frg_pixmap; /* Pane foreground pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
233 Pixmap s_frg_pixmap; /* Selection foreground pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
234 Pixmap bkgnd_pixmap; /* Menu background pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
235 Pixmap inact_pixmap; /* Menu inactive pixmap. */
Dave Love <fx@gnu.org>
parents:
diff changeset
236 } XMenu;
Dave Love <fx@gnu.org>
parents:
diff changeset
237
109124
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
238 typedef void (*Wait_func)(void*);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
239
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
240 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
241 * XMenu library routine declarations.
Dave Love <fx@gnu.org>
parents:
diff changeset
242 */
109124
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
243 XMenu *XMenuCreate(Display *display, Window parent, register char *def_env);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
244 int XMenuAddPane(Display *display, register XMenu *menu, register char *label, int active);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
245 int XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, char *data, char *label, int active, char *help);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
246 int XMenuInsertPane(register XMenu *menu, register int p_num, char *label, int active);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
247 int XMenuInsertSelection(register XMenu *menu, register int p_num, register int s_num, char *data, char *label, int active);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
248 int XMenuFindPane(register XMenu *menu, register char *label);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
249 int XMenuFindSelection(register XMenu *menu, int p_num, register char *label);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
250 int XMenuChangePane(register XMenu *menu, register int p_num, char *label);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
251 int XMenuChangeSelection(Display *display, register XMenu *menu, register int p_num, register int s_num, char *data, int data_sw, char *label, int label_sw);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
252 int XMenuSetPane(register XMenu *menu, register int p_num, register int active);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
253 int XMenuSetSelection(register XMenu *menu, register int p_num, register int s_num, int active);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
254 int XMenuRecompute(Display *display, register XMenu *menu);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
255 int XMenuEventHandler(int (*handler) (XEvent *)); /* No value actually returned. */
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
256 int XMenuLocate(register Display *display, register XMenu *menu, int p_num, int s_num, int x_pos, int y_pos, int *ul_x, int *ul_y, int *width, int *height);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
257 int XMenuSetFreeze(register XMenu *menu, register int freeze); /* No value actually returned. */
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
258 void XMenuActivateSetWaitFunction(Wait_func func, void *data);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
259 int XMenuActivate(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, unsigned int event_mask, char **data, void (*help_callback) (char *, int, int));
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
260 char *XMenuPost(register Display *display, register XMenu *menu, register int *p_num, register int *s_num, register int x_pos, register int y_pos, int event_mask);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
261 int XMenuDeletePane(register Display *display, register XMenu *menu, register int p_num);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
262 int XMenuDeleteSelection(register Display *display, register XMenu *menu, register int p_num, register int s_num);
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
263 int XMenuDestroy(Display *display, register XMenu *menu); /* No value actually returned. */
5cc91198ffb2 Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 76174
diff changeset
264 char *XMenuError(void);
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
265
Dave Love <fx@gnu.org>
parents:
diff changeset
266 #endif
Dave Love <fx@gnu.org>
parents:
diff changeset
267 /* Don't add after this point. */
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
268
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
269 /* arch-tag: 7e57b5ac-9355-4057-9385-afbe6912d60f
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
270 (do not change this comment) */