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