|
|
1.1 root 1: #ifndef lint
2: static char *rcsid_globals_c = "$Header: globals.c,v 10.4 86/11/19 16:25:04 jg Rel $";
3: #endif lint
4:
5: /*
6: * COPYRIGHT 1985, 1986
7: * DIGITAL EQUIPMENT CORPORATION
8: * MAYNARD, MASSACHUSETTS
9: * ALL RIGHTS RESERVED.
10: *
11: * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
12: * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
13: * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITIBILITY OF THIS SOFTWARE FOR
14: * ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
15: *
16: * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS,
17: * APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT
18: * SET FORTH ABOVE.
19: *
20: *
21: * Permission to use, copy, modify, and distribute this software and its
22: * documentation for any purpose and without fee is hereby granted, provided
23: * that the above copyright notice appear in all copies and that both that
24: * copyright notice and this permission notice appear in supporting documentation,
25: * and that the name of Digital Equipment Corporation not be used in advertising
26: * or publicity pertaining to distribution of the software without specific,
27: * written prior permission.
28: *
29: */
30:
31:
32: /*
33: * MODIFICATION HISTORY
34: *
35: * 000 -- M. Gancarz, DEC Ultrix Engineering Group
36: */
37:
38: #ifndef lint
39: static char *sccsid = "@(#)globals.c 3.8 1/24/86";
40: #endif
41: /*
42: * globals.c - window manager global data
43: *
44: */
45:
46: #include "uwm.h"
47:
48: Window Pop; /* Pop up dimension display window. */
49: Window Frozen; /* Contains window id of "gridded" window. */
50: Font IFont; /* Icon text font. */
51: Font PFont; /* Pop-up text font. */
52: Font MFont; /* Menu text font. */
53: FontInfo IFontInfo; /* Icon text font information. */
54: FontInfo PFontInfo; /* Pop-up text font information. */
55: FontInfo MFontInfo; /* Menu text font information. */
56: Pixmap GrayPixmap; /* Gray pixmap. */
57: Pixmap IBorder; /* Icon window border pixmap. */
58: Pixmap IBackground; /* Icon window background pixmap. */
59: Pixmap PBorder; /* Pop-Up Window border pixmap. */
60: Pixmap PBackground; /* Pop-up Window background pixmap. */
61: Pixmap MBorder; /* Menu Window border pixmap. */
62: Pixmap MBackground; /* Menu Window background pixmap. */
63: Cursor ArrowCrossCursor; /* Arrow cross cursor. */
64: Cursor TextCursor; /* Text cursor used in icon windows. */
65: Cursor IconCursor; /* Icon Cursor. */
66: Cursor MenuCursor; /* Menu cursor. */
67: Cursor MenuMaskCursor; /* Menu mask cursor. */
68: Cursor LeftButtonCursor; /* Left button main cursor. */
69: Cursor MiddleButtonCursor; /* Middle button main cursor. */
70: Cursor RightButtonCursor; /* Right button main cursor. */
71: int ScreenWidth; /* Display screen width. */
72: int ScreenHeight; /* Display screen height. */
73: int CursorFunc; /* Mouse cursor function. */
74: int IconCursorFunc; /* Icon Mouse Cursor function. */
75: int ITextForground; /* Icon window text forground color. */
76: int ITextBackground; /* Icon window text background color. */
77: int IBorderWidth; /* Icon window border width. */
78: int PTextForground; /* Pop-up window text forground color. */
79: int PTextBackground; /* Pop-up window text background color. */
80: int MTextForground; /* Menu window text forground color. */
81: int MTextBackground; /* Menu window text background color. */
82: int PWidth; /* Pop-up window width. */
83: int PHeight; /* Pop-up window height. */
84: int PBorderWidth; /* Pop-up window border width. */
85: int PPadding; /* Pop-up window padding. */
86: int MBorderWidth; /* Menu window border width. */
87: int MPadding; /* Menu window padding. */
88: int ButtonMask; /* Global mouse button event mask. */
89: int Delay; /* Delay between clicks of a double click. */
90: int Delta; /* Mouse movement slop. */
91: int HIconPad; /* Icon horizontal padding. */
92: int VIconPad; /* Icon vertical padding. */
93: int HMenuPad; /* Menu horizontal padding. */
94: int VMenuPad; /* Menu vertical padding. */
95: int MaxColors; /* Maximum number of colors to use. */
96: int Pushval; /* Number of pixels to push window by. */
97: int Volume; /* Audible alarm volume. */
98: int status; /* Routine return status. */
99: int Maxfd; /* Maximum file descriptors for select(2). */
100: MenuLink *Menus; /* Linked list of menus. */
101: Binding *Blist; /* Button/key binding list. */
102:
103: Bool Autoselect; /* Warp mouse to default menu selection? */
104: Bool Freeze; /* Freeze server during move/resize? */
105: Bool Grid; /* Should the m/r box contain a 9 seg. grid. */
106: Bool NWindow; /* Normalize windows? */
107: Bool NIcon; /* Normalize icons? */
108: Bool Push; /* Relative=TRUE, Absolute=FALSE. */
109: Bool Reverse; /* Reverse video? */
110: Bool Zap; /* Should the the zap effect be used. */
111:
112: char PText[7] = INIT_PTEXT; /* Pop-up window dummy text. */
113: int PTextSize = sizeof(PText); /* Pop-up window dummy text size. */
114:
115: int Lineno = 1; /* Line count for parser. */
116: Bool Startup_File_Error = FALSE;/* Startup file error flag. */
117: char Startup_File[NAME_LEN] = "";/* Startup file name. */
118: char IFontName[NAME_LEN]; /* Icon font name. */
119: char PFontName[NAME_LEN]; /* Pop-up font name. */
120: char MFontName[NAME_LEN]; /* Menu font name. */
121: char **Argv; /* Pointer to command line parameters. */
122: char **Environ; /* Pointer to environment. */
123:
124: /*
125: * Keyword lookup table for parser.
126: */
127: Keyword KeywordTable[] = {
128: { "autoselect", IsBoolTrue, &Autoselect,0,0,0 },
129: { "delay", IsNumeric, 0,&Delay,0,0 },
130: { "delta", IsNumeric, 0,&Delta,0,0 },
131: { "freeze", IsBoolTrue, &Freeze,0,0,0 },
132: { "iconfont", IsString, 0,0,IFontName,0 },
133: { "f.beep", IsFunction, 0,0,0,Beep },
134: { "f.circledown", IsFunction, 0,0,0,CircleDown },
135: { "f.circleup", IsFunction, 0,0,0,CircleUp },
136: { "f.continue", IsFunction, 0,0,0,Continue },
137: { "f.focus", IsFunction, 0,0,0,Focus },
138: { "f.iconify", IsFunction, 0,0,0,Iconify },
139: { "f.lower", IsFunction, 0,0,0,Lower },
140: { "f.menu", IsMenuMap, 0,0,0,Menu },
141: { "f.move", IsDownFunction, 0,0,0,Move },
142: { "f.moveopaque", IsDownFunction, 0,0,0,MoveOpaque },
143: { "f.newiconify", IsDownFunction, 0,0,0,NewIconify },
144: { "f.pause", IsFunction, 0,0,0,Pause },
145: { "f.pushdown", IsFunction, 0,0,0,PushDown },
146: { "f.pushleft", IsFunction, 0,0,0,PushLeft },
147: { "f.pushright", IsFunction, 0,0,0,PushRight },
148: { "f.pushup", IsFunction, 0,0,0,PushUp },
149: { "f.raise", IsFunction, 0,0,0,Raise },
150: { "f.refresh", IsFunction, 0,0,0,Refresh },
151: { "f.resize", IsDownFunction, 0,0,0,Resize },
152: { "f.restart", IsQuitFunction, 0,0,0,Restart },
153: { "grid", IsBoolTrue, &Grid,0,0,0 },
154: { "hiconpad", IsNumeric, 0,&HIconPad,0,0 },
155: { "hmenupad", IsNumeric, 0,&HMenuPad,0,0 },
156: { "maxcolors", IsNumeric, 0,&MaxColors,0,0 },
157: { "menu", IsMenu, 0,0,0,0 },
158: { "menufont", IsString, 0,0,MFontName,0 },
159: { "noautoselect", IsBoolFalse, &Autoselect,0,0,0 },
160: { "nofreeze", IsBoolFalse, &Freeze,0,0,0 },
161: { "nogrid", IsBoolFalse, &Grid,0,0,0 },
162: { "nonormali", IsBoolFalse, &NIcon,0,0,0 },
163: { "nonormalw", IsBoolFalse, &NWindow,0,0,0 },
164: { "noreverse", IsBoolFalse, &Reverse,0,0,0 },
165: { "normali", IsBoolTrue, &NIcon,0,0,0 },
166: { "normalw", IsBoolTrue, &NWindow,0,0,0 },
167: { "nozap", IsBoolFalse, &Zap,0,0,0 },
168: { "push", IsNumeric, 0,&Pushval,0,0 },
169: { "pushabsolute", IsBoolFalse, &Push,0,0,0 },
170: { "pushrelative", IsBoolTrue, &Push,0,0,0 },
171: { "resetbindings", IsParser, 0,0,0,ResetBindings },
172: { "resetmenus", IsParser, 0,0,0,ResetMenus },
173: { "resetvariables", IsParser, 0,0,0,ResetVariables },
174: { "resizefont", IsString, 0,0,PFontName,0 },
175: { "reverse", IsBoolTrue, &Reverse,0,0,0 },
176: { "viconpad", IsNumeric, 0,&VIconPad,0,0 },
177: { "vmenupad", IsNumeric, 0,&VMenuPad,0,0 },
178: { "volume", IsNumeric, 0,&Volume,0,0 },
179: { "zap", IsBoolTrue, &Zap,0,0,0 },
180: { NULL, NULL, NULL,NULL,NULL,NULL }
181: };
182:
183: /*
184: * Key expression table for parser.
185: */
186: KeyExpr KeyExprTbl[] = {
187: { "ctrl", ControlMask },
188: { "c", ControlMask },
189: { "lock", ShiftLockMask },
190: { "l", ShiftLockMask },
191: { "meta", MetaMask },
192: { "m", MetaMask },
193: { "shift", ShiftMask },
194: { "s", ShiftMask },
195: { NULL, NULL }
196: };
197:
198: /*
199: * Context expression table for parser.
200: */
201: ContExpr ContExprTbl[] = {
202: { "icon", ICON },
203: { "i", ICON },
204: { "root", ROOT },
205: { "r", ROOT },
206: { "window", WINDOW },
207: { "w", WINDOW },
208: { NULL, NULL }
209: };
210:
211: /*
212: * Button expression table for parser.
213: */
214: ButtonModifier ButtModTbl[] = {
215: { "left", LeftMask },
216: { "leftbutton", LeftMask },
217: { "l", LeftMask },
218: { "middle", MiddleMask },
219: { "middlebutton", MiddleMask },
220: { "m", MiddleMask },
221: { "right", RightMask },
222: { "rightbutton", RightMask },
223: { "r", RightMask },
224: /*
225: * The following are for double-clicking the mouse. It's a future!
226: */
227: /***
228: { "double", DoubleClick },
229: { "doubleclick", DoubleClick },
230: { "dclick", DoubleClick },
231: ***/
232: { "move", DeltaMotion },
233: { "motion", DeltaMotion },
234: { "delta", DeltaMotion },
235: { "down", ButtonDown },
236: { "d", ButtonDown },
237: { "up", ButtonUp },
238: { "u", ButtonUp },
239: { NULL, NULL }
240: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.