1 /*****************************************************************************/
2 /** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
3 /** Salt Lake City, Utah **/
4 /** Portions Copyright 1989 by the Massachusetts Institute of Technology **/
5 /** Cambridge, Massachusetts **/
7 /** All Rights Reserved **/
9 /** Permission to use, copy, modify, and distribute this software and **/
10 /** its documentation for any purpose and without fee is hereby **/
11 /** granted, provided that the above copyright notice appear in all **/
12 /** copies and that both that copyright notice and this permis- **/
13 /** sion notice appear in supporting documentation, and that the **/
14 /** names of Evans & Sutherland and M.I.T. not be used in advertising **/
15 /** in publicity pertaining to distribution of the software without **/
16 /** specific, written prior permission. **/
18 /** EVANS & SUTHERLAND AND M.I.T. DISCLAIM ALL WARRANTIES WITH REGARD **/
19 /** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
20 /** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND OR **/
21 /** M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
22 /** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
23 /** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
24 /** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
25 /** OR PERFORMANCE OF THIS SOFTWARE. **/
26 /*****************************************************************************/
29 /***********************************************************************
31 * $XConsortium: menus.h,v 1.24 89/12/10 17:46:26 jim Exp $
33 * twm menus include file
35 * 17-Nov-87 Thomas E. LaStrange File created
37 ***********************************************************************/
42 #define TWM_ROOT "bLoB_GoOp" /* my private root menu */
44 #define TWM_WINDOWS "TwmWindows" /* for f.menu "TwmWindows" */
47 #define VTWM_WINDOWS "VTWM Windows" /* for f.menu "VTWM Windows" */
49 #define MAX_FILE_SIZE 4096 /* max chars to read from file for cut */
51 typedef struct MenuItem
53 struct MenuItem *next; /* next menu item */
54 struct MenuItem *prev; /* prev menu item */
55 struct MenuRoot *sub; /* MenuRoot of a pull right menu */
56 struct MenuRoot *root; /* back pointer to my MenuRoot */
57 char *item; /* the character string displayed */
58 char *action; /* action to be performed */
61 Pixel fore; * foreground color *
62 Pixel back; * background color *
63 Pixel hi_fore; * highlight foreground *
64 Pixel hi_back; * highlight background *
66 ColorPair normal; /* unhiglight colors */
67 ColorPair highlight; /* highlight colors */
69 short item_num; /* item number of this menu */
70 short x; /* x coordinate for text */
71 short func; /* twm built in function */
72 short state; /* video state, 0 = normal, 1 = reversed */
73 short strlen; /* strlen(item) */
74 short user_colors; /* colors were specified */
77 short separated; /* separated from the next item */
81 typedef struct MenuRoot
83 struct MenuItem *first; /* first item in menu */
84 struct MenuItem *last; /* last item in menu */
85 struct MenuRoot *prev; /* previous root menu if pull right */
86 struct MenuRoot *next; /* next in list of root menus */
87 char *name; /* name of root */
88 Window w; /* the window of the menu */
89 Window shadow; /* the shadow window */
92 Pixel hi_fore; * highlight foreground *
93 Pixel hi_back; * highlight background *
95 ColorPair highlight; /* highlight colors */
97 short mapped; /* NEVER_MAPPED, UNMAPPED, or MAPPED */
98 short height; /* height of the menu */
99 short width; /* width of the menu */
100 short items; /* number of items in the menu */
101 short pull; /* is there a pull right entry? */
102 short entered; /* EnterNotify following pop up */
103 short real_menu; /* this is a real menu */
105 /* djhjr - 5/22/00 */
106 short too_tall; /* menu taller than display? */
107 short top; /* first item displayed */
110 #define NEVER_MAPPED 0 /* constants for mapped field of MenuRoot */
115 typedef struct MouseButton
117 int func; /* the function number */
118 int mask; /* modifier mask */
119 MenuRoot *menu; /* menu if func is F_MENU */
120 MenuItem *item; /* action to perform if func != F_MENU */
123 typedef struct FuncButton
125 struct FuncButton *next; /* next in the list of function buttons */
126 int num; /* button number */
127 int cont; /* context */
128 int mods; /* modifiers */
129 int func; /* the function number */
130 MenuRoot *menu; /* menu if func is F_MENU */
131 MenuItem *item; /* action to perform if func != F_MENU */
134 typedef struct FuncKey
136 struct FuncKey *next; /* next in the list of function keys */
137 char *name; /* key name */
138 KeySym keysym; /* X keysym */
139 KeyCode keycode; /* X keycode */
140 int cont; /* context */
141 int mods; /* modifiers */
142 int func; /* function to perform */
143 char *win_name; /* window name (if any) */
144 char *action; /* action string (if any) */
147 extern int RootFunction;
148 extern MenuRoot *ActiveMenu;
149 extern MenuItem *ActiveItem;
150 extern int MoveFunction;
151 extern int WindowMoved;
152 extern int ConstMove;
153 /* private variables now - djhjr - 10/6/02
154 extern int ConstMoveDir;
155 extern int ConstMoveX;
156 extern int ConstMoveY;
157 extern int ConstMoveXL;
158 extern int ConstMoveXR;
159 extern int ConstMoveYT;
160 extern int ConstMoveYB;
163 #define MAXMENUDEPTH 10 /* max number of nested menus */
164 extern int MenuDepth;
166 #define MOVE_NONE 0 /* modes of constrained move */
170 #define WARPSCREEN_NEXT "next"
171 #define WARPSCREEN_PREV "prev"
172 #define WARPSCREEN_BACK "back"
174 #define COLORMAP_NEXT "next"
175 #define COLORMAP_PREV "prev"
176 #define COLORMAP_DEFAULT "default"
178 extern int InitTitlebarButtons();
179 extern void InitMenus();
180 extern MenuRoot *NewMenuRoot();
181 extern void SetMenuIconPixmap();
182 extern MenuItem *AddToMenu();
183 extern Bool PopUpMenu();
184 extern MenuRoot *FindMenuRoot();
185 extern Bool AddFuncKey();
186 extern int ExecuteFunction();
187 extern int DeferExecution();
188 extern void Execute();
189 extern void FocusOnRoot();
190 extern void SetBorder();
191 extern void ReGrab();
192 extern void WarpToWindow();
193 extern void PaintEntry();
194 extern void DeIconify();
195 extern void SetMapStateProp();
196 extern void Iconify();
197 extern void PopDownMenu();
198 extern void UpdateMenu();
199 extern void SendTakeFocusMessage();
200 extern void PaintEntry();
201 extern void SetBorder();
202 extern int CreateTitleButton();
203 extern void MakeMenus();
204 extern void PaintMenu();
206 /* djhjr - 4/27/96 */
207 extern void DisplayPosition ();
209 /* djhjr - 5/30/00 */
210 extern void WarpWindowOrScreen();
211 extern void WarpInIconMgr();
213 /* djhjr - 10/27/02 */
214 extern void AddWindowToRing();
215 extern void RemoveWindowFromRing();
217 /* djhjr - 6/22/01 */
218 extern void DoAudible();