1 #ifndef _WmGlobal_h
2 #define _WmGlobal_h
3 
4 #ifdef HAVE_CONFIG_H
5 #include <config.h>
6 #endif
7 
8 
9 /*
10  * Motif
11  *
12  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
13  *
14  * These libraries and programs are free software; you can
15  * redistribute them and/or modify them under the terms of the GNU
16  * Lesser General Public License as published by the Free Software
17  * Foundation; either version 2 of the License, or (at your option)
18  * any later version.
19  *
20  * These libraries and programs are distributed in the hope that
21  * they will be useful, but WITHOUT ANY WARRANTY; without even the
22  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
23  * PURPOSE. See the GNU Lesser General Public License for more
24  * details.
25  *
26  * You should have received a copy of the GNU Lesser General Public
27  * License along with these librararies and programs; if not, write
28  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
29  * Floor, Boston, MA 02110-1301 USA
30 */
31 /*
32  * Motif Release 1.2.4
33 */
34 
35 /* ANSI C definitions,  This should be the first thing in WmGlobal.h */
36 #ifdef __STDC__
37 #define Const const
38 #else
39 #define Const /**/
40 #endif
41 
42 
43 /*
44  * Included Files:
45  */
46 
47 #include <stdio.h>
48 #include <X11/Xlib.h>
49 #include <X11/Xutil.h>
50 #ifndef NO_SHAPE
51 #include <X11/extensions/shape.h>
52 #endif /* NO_SHAPE  */
53 #include <X11/IntrinsicP.h>
54 #include <X11/Intrinsic.h>
55 #include <X11/StringDefs.h>
56 #include <Xm/MwmUtil.h>
57 #include <Xm/Xm.h>
58 #ifdef WSM
59 #include <Xm/ColorObjP.h>
60 #include <Dt/Service.h>
61 #include <Dt/Wsm.h>
62 #include <Dt/WsmP.h>
63 #include "WmParse.h"
64 #ifdef PANELIST
65 #include <Dt/Action.h>
66 #endif /* PANELIST */
67 #endif /* WSM */
68 
69 #if defined(sun) && defined(ALLPLANES)
70 #include <X11/extensions/allplanes.h>
71 #endif /* defined(sun) && defined(ALLPLANES) */
72 
73 /*
74  * Value definitions and macros:
75  */
76 
77 #ifdef MOTIF_ONE_DOT_ONE
78 #define XmFONTLIST_DEFAULT_TAG	"XmSTRING_DEFAULT_CHARSET"
79 #endif
80 #ifdef WSM
81 
82 extern int WmIdentity;
83 
84 /*
85  * Color server defines
86  */
87 #define CSERVE_NORMAL		   0
88 #define CSERVE_NOT_AVAILABLE       1
89 #define CSERVE_FAILURE             2
90 #endif /* WSM */
91 
92 /* window manager name and class used to get resources: */
93 #define	WM_RESOURCE_CLASS	"Mwm"
94 #define WM_RESOURCE_NAME	"mwm"
95 
96 #ifdef WSM
97 #define	DT_WM_RESOURCE_CLASS	"Dtwm"
98 #define DT_WM_RESOURCE_NAME	"dtwm"
99 
100 
101 extern Pixel		FPbackground;
102 extern Pixel		FPforeground;
103 extern Pixel		FPtopshadow;
104 extern Pixel		FPbottomshadow;
105 extern Pixel		FPselectcolor;
106 
107 #define  USE_ACTIVE_PIXELSET		0
108 #define  USE_INACTIVE_PIXELSET		1
109 #define  USE_PRIMARY_PIXELSET		2
110 #define  USE_SECONDARY_PIXELSET		3
111 
112 #define MWM	        	     0
113 #define DT_MWM		 	     1
114 
115 #define MwmBehavior		(WmIdentity == MWM)
116 #define DtwmBehavior		(WmIdentity == DT_MWM)
117 
118 #else
119 #define MwmBehavior		(True)
120 
121 #endif /* WSM */
122 
123 /* ICCC atom names: */
124 
125 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
126 # define _XA_TARGETS		"TARGETS"
127 # define _XA_MULTIPLE		"MULTIPLE"
128 # define _XA_TIMESTAMP		"TIMESTAMP"
129 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
130 
131 #define _XA_WM_STATE		"WM_STATE"
132 #define _XA_WM_PROTOCOLS	"WM_PROTOCOLS"
133 #define _XA_WM_CHANGE_STATE	"WM_CHANGE_STATE"
134 #define _XA_WM_SAVE_YOURSELF	"WM_SAVE_YOURSELF"
135 #define _XA_WM_DELETE_WINDOW	"WM_DELETE_WINDOW"
136 #define _XA_WM_TAKE_FOCUS	"WM_TAKE_FOCUS"
137 #define _XA_WM_COLORMAP_WINDOWS	"WM_COLORMAP_WINDOWS"
138 
139 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
140 /* original set of query targets */
141 # define _XA_MOTIF_WM_CLIENT_WINDOW		"_MOTIF_WM_CLIENT_WINDOW"
142 # define _XA_MOTIF_WM_POINTER_WINDOW		"_MOTIF_WM_POINTER_WINDOW"
143 # define _XA_MOTIF_WM_ALL_CLIENTS		"_MOTIF_WM_ALL_CLIENTS"
144 
145 /* menu command interface support */
146 # define _XA_MOTIF_WM_DEFINE_COMMAND		"_MOTIF_WM_DEFINE_COMMAND"
147 # define _XA_MOTIF_WM_INCLUDE_COMMAND		"_MOTIF_WM_INCLUDE_COMMAND"
148 # define _XA_MOTIF_WM_REMOVE_COMMAND		"_MOTIF_WM_REMOVE_COMMAND"
149 # define _XA_MOTIF_WM_ENABLE_COMMAND		"_MOTIF_WM_ENABLE_COMMAND"
150 # define _XA_MOTIF_WM_DISABLE_COMMAND		"_MOTIF_WM_DISABLE_COMMAND"
151 # define _XA_MOTIF_WM_RENAME_COMMAND		"_MOTIF_WM_RENAME_COMMAND"
152 # define _XA_MOTIF_WM_INVOKE_COMMAND		"_MOTIF_WM_INVOKE_COMMAND"
153 # define _XA_MOTIF_WM_REQUEST_COMMAND		"_MOTIF_WM_REQUEST_COMMAND"
154 # define _XA_MOTIF_WM_WINDOW_FLAGS		"_MOTIF_WM_WINDOW_FLAGS"
155 
156 /* automation support */
157 # define _XA_MOTIF_WM_AUTOMATION 		"_MOTIF_WM_AUTOMATION"
158 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
159 
160 /* window manager exit value on fatal errors: */
161 #define WM_ERROR_EXIT_VALUE	1
162 
163 /* built-in button bindings for window manager actions: */
164 #define SELECT_BUTTON			Button1
165 #define SELECT_BUTTON_MASK		Button1Mask
166 #define SELECT_BUTTON_MOTION_MASK	Button1MotionMask
167 
168 #define FOCUS_SELECT_BUTTON	SELECT_BUTTON
169 #define FOCUS_SELECT_MODIFIERS	0
170 
171 /* direct manipulation button */
172 #define DMANIP_BUTTON			Button2
173 #define DMANIP_BUTTON_MASK		Button2Mask
174 #define DMANIP_BUTTON_MOTION_MASK	Button2MotionMask
175 
176 /* menu button */
177 #define BMENU_BUTTON			Button3
178 #define BMENU_BUTTON_MASK		Button3Mask
179 
180 /* max number of buttons on a mouse */
181 #define NUM_BUTTONS			5
182 
183 /* Needed by PostMenu() to specify key post: */
184 #define NoButton		0
185 
186 /* manage window flags: */
187 #define MANAGEW_WM_STARTUP	(1L << 0)
188 #define MANAGEW_WM_RESTART	(1L << 1)
189 #define MANAGEW_NORMAL		(1L << 2)
190 #define MANAGEW_ICON_BOX	(1L << 3)
191 #define MANAGEW_CONFIRM_BOX	(1L << 4)
192 #define MANAGEW_WM_RESTART_ICON	(1L << 5)
193 
194 #ifdef WSM
195 #define MANAGEW_WM_CLIENTS	(MANAGEW_ICON_BOX | \
196 				 MANAGEW_CONFIRM_BOX )
197 #else /* WSM */
198 #define MANAGEW_WM_CLIENTS	(MANAGEW_ICON_BOX | MANAGEW_CONFIRM_BOX)
199 #endif /* WSM */
200 
201 /* keyboard input focus flag values (for calls to SetKeyboardFocus) */
202 #define ALWAYS_SET_FOCUS	(1L << 0)
203 #define REFRESH_LAST_FOCUS	(1L << 1)
204 #define CLIENT_AREA_FOCUS	(1L << 2)
205 #define SCREEN_SWITCH_FOCUS	(1L << 3)
206 /* special value for use for Do_Focus_Key to set to internal window */
207 #define WORKSPACE_IF_NULL	(1L << 4)
208 
209 /* Menu posting flag values (for calls to PostMenu) */
210 #define POST_AT_XY		(1L << 0)
211 #define POST_TRAVERSAL_ON	(1L << 1)
212 #define POST_STICKY		(1L << 2)
213 
214 /* feedback box styles */
215 #define FB_OFF			(0)
216 #define FB_SIZE			(1L << 0)
217 #define FB_POSITION		(1L << 1)
218 
219 /* confirmbox and waitbox indexes */
220 #define DEFAULT_BEHAVIOR_ACTION		0
221 #define CUSTOM_BEHAVIOR_ACTION		1
222 #define RESTART_ACTION		2
223 #define QUIT_MWM_ACTION		3
224 
225 /* extract text height in pixels from a (XFontStruct *) */
226 #define TEXT_HEIGHT(pfs) (((pfs)->ascent)+((pfs)->descent))
227 
228 /* icon frame shadow widths */
229 #ifdef WSM
230 #define ICON_EXTERNAL_SHADOW_WIDTH	(wmGD.iconExternalShadowWidth)
231 #else /* WSM */
232 #define ICON_EXTERNAL_SHADOW_WIDTH	2
233 #endif /* WSM */
234 #define ICON_INTERNAL_SHADOW_WIDTH	1
235 
236 /* padding widths */
237 #define ICON_IMAGE_TOP_PAD	2
238 #define ICON_IMAGE_BOTTOM_PAD	2
239 #define ICON_IMAGE_LEFT_PAD	2
240 #define ICON_IMAGE_RIGHT_PAD	2
241 
242 /* image offsets */
243 #define ICON_INNER_X_OFFSET	\
244 	    (ICON_IMAGE_LEFT_PAD+ICON_EXTERNAL_SHADOW_WIDTH)
245 #define ICON_INNER_Y_OFFSET	\
246 	    (ICON_IMAGE_TOP_PAD+ICON_EXTERNAL_SHADOW_WIDTH)
247 
248 
249 #define ICON_IMAGE_X_OFFSET ICON_INNER_X_OFFSET+ICON_INTERNAL_SHADOW_WIDTH
250 #define ICON_IMAGE_Y_OFFSET ICON_INNER_Y_OFFSET+ICON_INTERNAL_SHADOW_WIDTH
251 
252 
253 
254 /* number of rectangles to allocate */
255 #define NUM_MATTE_TS_RECTS	(6)
256 #define NUM_MATTE_BS_RECTS	(6)
257 
258 #define NUM_IMAGE_TOP_RECTS	\
259 	    ((2*ICON_EXTERNAL_SHADOW_WIDTH)+(2*ICON_INTERNAL_SHADOW_WIDTH))
260 
261 
262 #define NUM_IMAGE_BOTTOM_RECTS	\
263 	    ((2*ICON_EXTERNAL_SHADOW_WIDTH)+(2*ICON_INTERNAL_SHADOW_WIDTH))
264 
265 
266 #define NUM_LABEL_TOP_RECTS	(2*ICON_EXTERNAL_SHADOW_WIDTH)
267 #define NUM_LABEL_BOTTOM_RECTS	(2*ICON_EXTERNAL_SHADOW_WIDTH)
268 
269 #define NUM_BOTH_TOP_RECTS	\
270 	    ((3*ICON_EXTERNAL_SHADOW_WIDTH)+(3*ICON_INTERNAL_SHADOW_WIDTH))
271 
272 
273 #define NUM_BOTH_BOTTOM_RECTS	\
274 	    ((3*ICON_EXTERNAL_SHADOW_WIDTH)+(3*ICON_INTERNAL_SHADOW_WIDTH))
275 
276 
277 #define NUM_STATIC_TOP_RECTS	(2*ICON_INTERNAL_SHADOW_WIDTH)
278 #define NUM_STATIC_BOTTOM_RECTS	(2*ICON_INTERNAL_SHADOW_WIDTH)
279 
280 
281 /* client frame shadow widths */
282 #ifdef WSM
283 #define FRAME_EXTERNAL_SHADOW_WIDTH	(wmGD.frameExternalShadowWidth)
284 #else /* WSM */
285 #define FRAME_EXTERNAL_SHADOW_WIDTH	2
286 #endif /* WSM */
287 #define FRAME_INTERNAL_SHADOW_WIDTH	1
288 #define FRAME_CLIENT_SHADOW_WIDTH	1
289 #define FRAME_MATTE_SHADOW_WIDTH	1
290 
291 /* padding around text in title bar */
292 #define WM_TOP_TITLE_PADDING	1
293 #define WM_BOTTOM_TITLE_PADDING	1
294 #define WM_TOP_TITLE_SHADOW	FRAME_INTERNAL_SHADOW_WIDTH
295 #define WM_BOTTOM_TITLE_SHADOW	FRAME_INTERNAL_SHADOW_WIDTH
296 
297 #define WM_TITLE_BAR_PADDING	(WM_TOP_TITLE_PADDING \
298 				 +WM_BOTTOM_TITLE_PADDING \
299 				 +WM_TOP_TITLE_SHADOW \
300 				 +WM_BOTTOM_TITLE_SHADOW)
301 
302 /* stretch directions  - (starts at NW and goes clockwise) */
303 #define STRETCH_NO_DIRECTION	-1
304 #define STRETCH_NORTH_WEST	0
305 #define STRETCH_NORTH		1
306 #define STRETCH_NORTH_EAST	2
307 #define STRETCH_EAST		3
308 #define STRETCH_SOUTH_EAST	4
309 #define STRETCH_SOUTH 		5
310 #define STRETCH_SOUTH_WEST	6
311 #define STRETCH_WEST		7
312 
313 #define STRETCH_COUNT		8
314 
315 #ifdef WSM
316 
317 /* Workspace allocation granularity */
318 #define WS_ALLOC_AMOUNT			8
319 
320 /* Window list allocation granularity */
321 #define WINDOW_ALLOC_AMOUNT		16
322 #endif /* WSM */
323 
324 /* function flag masks */
325 #define WM_FUNC_DEFAULT		MWM_FUNC_ALL
326 #define WM_FUNC_NONE		0
327 #define WM_FUNC_ALL		(MWM_FUNC_RESIZE | MWM_FUNC_MOVE |\
328 				 MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE |\
329 				 MWM_FUNC_CLOSE)
330 
331 /* decorations flag masks */
332 #define WM_DECOR_DEFAULT	MWM_DECOR_ALL
333 #define WM_DECOR_NONE		0
334 #define WM_DECOR_BORDER		(MWM_DECOR_BORDER)
335 #define WM_DECOR_TITLE		(MWM_DECOR_TITLE)
336 #define WM_DECOR_SYSTEM		(WM_DECOR_TITLE | MWM_DECOR_MENU)
337 #define WM_DECOR_MINIMIZE	(WM_DECOR_TITLE | MWM_DECOR_MINIMIZE)
338 #define WM_DECOR_MAXIMIZE	(WM_DECOR_TITLE | MWM_DECOR_MAXIMIZE)
339 #define WM_DECOR_TITLEBAR	(WM_DECOR_SYSTEM | WM_DECOR_MINIMIZE |\
340 				 WM_DECOR_MAXIMIZE)
341 #define WM_DECOR_RESIZEH	(WM_DECOR_BORDER | MWM_DECOR_RESIZEH)
342 #define WM_DECOR_RESIZE		(WM_DECOR_RESIZEH)
343 #define WM_DECOR_ALL		(WM_DECOR_TITLEBAR | WM_DECOR_RESIZEH)
344 
345 #ifdef PANELIST
346 #define WM_DECOR_PANEL_DEFAULT	WM_DECOR_BORDER
347 #endif /* PANELIST */
348 
349 /* icon box definitions */
350 #define ICON_BOX_FUNCTIONS	(MWM_FUNC_RESIZE | MWM_FUNC_MOVE |\
351 				 MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE)
352 
353 #ifdef PANELIST
354 /* accessory panel definitions */
355 #define WM_FUNC_PANEL_DEFAULT	(MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE)
356 #define WM_FUNC_SUBPANEL_DEFAULT (MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE|\
357 				MWM_FUNC_CLOSE)
358 #endif /* PANELIST */
359 #ifdef WSM
360 /* workspace controller definitions */
361 #define CONTROL_BOX_FUNCTIONS	(MWM_FUNC_MOVE)
362 
363 /* workspace presence definitions */
364 #define PRESENCE_BOX_FUNCTIONS	(MWM_FUNC_MOVE)
365 #endif /* WSM */
366 
367 /* show feedback definitions */
368 #define WM_SHOW_FB_BEHAVIOR	(1L << 0)
369 #define WM_SHOW_FB_MOVE		(1L << 1)
370 #define WM_SHOW_FB_PLACEMENT	(1L << 2)
371 #define WM_SHOW_FB_RESIZE	(1L << 3)
372 #define WM_SHOW_FB_RESTART	(1L << 4)
373 #define WM_SHOW_FB_QUIT         (1L << 5)
374 #define WM_SHOW_FB_KILL         (1L << 6)
375 
376 #define WM_SHOW_FB_ALL		(WM_SHOW_FB_BEHAVIOR  | WM_SHOW_FB_MOVE    |\
377 				 WM_SHOW_FB_PLACEMENT | WM_SHOW_FB_RESIZE  |\
378 				 WM_SHOW_FB_RESTART   | WM_SHOW_FB_QUIT    |\
379 				 WM_SHOW_FB_KILL)
380 
381 #define WM_SHOW_FB_NONE		0
382 
383 #define WM_SHOW_FB_DEFAULT	WM_SHOW_FB_ALL
384 
385 #ifdef WSM
386 /* flags identifying resources to save */
387 
388 #define WM_RES_WORKSPACE_LIST		(1L << 0)
389 #define WM_RES_BACKDROP_IMAGE		(1L << 1)
390 #define WM_RES_WORKSPACE_TITLE		(1L << 2)
391 #define WM_RES_INITIAL_WORKSPACE	(1L << 3)
392 #define WM_RES_FP_POSITION      	(1L << 4)
393 #define WM_RES_ICONBOX_GEOMETRY      	(1L << 5)
394 #define WM_RES_WORKSPACE_COUNT		(1L << 6)
395 
396 #endif /* WSM */
397 
398 
399 
400 /*************************************<->*************************************
401  *
402  *  Miscellaneous utility window manager data structures ...
403  *
404  *
405  *  Description:
406  *  -----------
407  *  These data structures are used in resource processing, ...
408  *
409  *************************************<->***********************************/
410 
411 typedef struct _WHSize
412 {
413     int		width;
414     int		height;
415 
416 } WHSize;
417 
418 
419 typedef struct _AspectRatio
420 {
421     int		x;
422     int		y;
423 
424 } AspectRatio;
425 
426 
427 typedef struct _WmColorData
428 {
429     Screen *screen;
430     Colormap colormap;
431     Pixel background;
432     Pixel foreground;
433     Pixel top_shadow;
434     Pixel bottom_shadow;
435 
436 } WmColorData;
437 
438 #ifdef WSM
439 typedef Atom WorkspaceID;
440 #endif
441 
442 
443 /*************************************<->*************************************
444  *
445  *  Event processing data structures ...
446  *
447  *
448  *  Description:
449  *  -----------
450  *  These data structures are used in saving button and key
451  *  specifications that are used in processing events that are used to do
452  *  window manager functions (e.g., set the colormap focus).
453  *
454  *************************************<->***********************************/
455 
456 typedef unsigned long Context;
457 typedef unsigned long Behavior;
458 typedef unsigned long GroupArg;
459 
460 typedef Boolean (*WmFunction) ();
461 
462 #define NO_MODIFIER	0		/* value for state field */
463 
464 typedef struct _KeySpec
465 {
466     unsigned int state;
467     KeyCode      keycode;
468     Context	 context;
469     Context	 subContext;
470     WmFunction	 wmFunction;
471     String	 wmFuncArgs;
472     struct _KeySpec *nextKeySpec;
473 
474 } KeySpec;
475 
476 typedef struct _ButtonSpec
477 {
478     unsigned int state;
479     unsigned int button;
480     unsigned int eventType;
481     Boolean	click;
482     Context	context;
483     Context	subContext;
484     WmFunction	wmFunction;
485     String	wmFuncArgs;
486     struct _ButtonSpec *nextButtonSpec;
487 
488 } ButtonSpec;
489 
490 
491 /*
492  * Context field values:
493  */
494 
495 #define F_CONTEXT_NONE		0
496 #define F_CONTEXT_ROOT		(1L << 0)
497 #define F_CONTEXT_ICON		(1L << 1)
498 #define F_CONTEXT_NORMAL	(1L << 2)
499 #define F_CONTEXT_MAXIMIZE	(1L << 3)
500 #define F_CONTEXT_ICONBOX	(1L << 4)
501 #ifdef WSM
502 #define F_CONTEXT_IFKEY		(1L << 7)
503 #endif /* WSM */
504 #define F_CONTEXT_WINDOW	(F_CONTEXT_NORMAL|F_CONTEXT_MAXIMIZE)
505 #define F_CONTEXT_ALL		(F_CONTEXT_ROOT|F_CONTEXT_ICON|F_CONTEXT_WINDOW)
506 
507 
508 /*
509  * context field mark for catching menu recursion
510  *   (tied to F_CONTEXT_... values):
511  */
512 
513 #define CR_MENU_MARK		(1L << 5)
514 
515 
516 /*
517  * Part context defines for event processing.  The part context is used
518  * to make a subcontext mask.
519  */
520 
521 /* window (frame and client) part contexts */
522 #define WINDOW_PART_NONE	0
523 #define FRAME_NONE		WINDOW_PART_NONE
524 #define FRAME_CLIENT		1
525 #define FRAME_SYSTEM		2
526 #define FRAME_TITLE		3
527 #define FRAME_MINIMIZE		4
528 #define FRAME_MAXIMIZE		5
529 #define FRAME_RESIZE_NW		6
530 #define FRAME_RESIZE_N		7
531 #define FRAME_RESIZE_NE		8
532 #define FRAME_RESIZE_E		9
533 #define FRAME_RESIZE_SE		10
534 #define FRAME_RESIZE_S 		11
535 #define FRAME_RESIZE_SW		12
536 #define FRAME_RESIZE_W		13
537 #define FRAME_NBORDER		14
538 #define FRAME_MATTE		15
539 #define FRAME_MISC		FRAME_MATTE
540 #ifdef WSM
541 #define FRAME_TITLEBAR		17
542 #endif /* WSM */
543 
544 /* icon part contexts */
545 #define ICON_PART_NONE		0
546 #define ICON_PART_ALL		16
547 
548 /* root part contexts */
549 #define ROOT_PART_NONE		0
550 #define ROOT_PART_ALL		17
551 
552 /* iconbox part contexts */
553 #define ICONBOX_PART_NONE	0
554 #define ICONBOX_PART_IBOX	18
555 #define ICONBOX_PART_IICON	19
556 #define ICONBOX_PART_WICON	20
557 
558 
559 /*
560  * Subcontext field values:
561  */
562 
563 #define F_SUBCONTEXT_NONE		(1L << WINDOW_PART_NONE)
564 
565 #define F_SUBCONTEXT_I_ALL		(1L << ICON_PART_ALL)
566 
567 #define F_SUBCONTEXT_R_ALL		(1L << ROOT_PART_ALL)
568 
569 
570 #define F_SUBCONTEXT_IB_IBOX		(1L << ICONBOX_PART_IBOX)
571 #define F_SUBCONTEXT_IB_IICON		(1L << ICONBOX_PART_IICON)
572 #define F_SUBCONTEXT_IB_WICON		(1L << ICONBOX_PART_WICON)
573 
574 #define F_SUBCONTEXT_IB_ICONS		(F_SUBCONTEXT_IB_IICON |\
575 					 F_SUBCONTEXT_IB_WICON)
576 
577 #define F_SUBCONTEXT_IB_ALL		(F_SUBCONTEXT_IB_IBOX |\
578 					 F_SUBCONTEXT_IB_IICON |\
579 					 F_SUBCONTEXT_IB_WICON)
580 
581 
582 #define F_SUBCONTEXT_W_CLIENT		(1L << FRAME_CLIENT)
583 #define F_SUBCONTEXT_W_APP		F_SUBCONTEXT_W_CLIENT
584 #define F_SUBCONTEXT_W_SYSTEM		(1L << FRAME_SYSTEM)
585 #define F_SUBCONTEXT_W_TITLE		(1L << FRAME_TITLE)
586 #define F_SUBCONTEXT_W_MINIMIZE		(1L << FRAME_MINIMIZE)
587 #define F_SUBCONTEXT_W_MAXIMIZE		(1L << FRAME_MAXIMIZE)
588 #define F_SUBCONTEXT_W_RESIZE_NW	(1L << FRAME_RESIZE_NW)
589 #define F_SUBCONTEXT_W_RESIZE_N		(1L << FRAME_RESIZE_N)
590 #define F_SUBCONTEXT_W_RESIZE_NE	(1L << FRAME_RESIZE_NE)
591 #define F_SUBCONTEXT_W_RESIZE_E		(1L << FRAME_RESIZE_E)
592 #define F_SUBCONTEXT_W_RESIZE_SE	(1L << FRAME_RESIZE_SE)
593 #define F_SUBCONTEXT_W_RESIZE_S		(1L << FRAME_RESIZE_S)
594 #define F_SUBCONTEXT_W_RESIZE_SW	(1L << FRAME_RESIZE_SW)
595 #define F_SUBCONTEXT_W_RESIZE_W		(1L << FRAME_RESIZE_W)
596 #define F_SUBCONTEXT_W_NBORDER		(1L << FRAME_NBORDER)
597 #define F_SUBCONTEXT_W_MATTE		(1L << FRAME_MATTE)
598 #define F_SUBCONTEXT_W_MISC		F_SUBCONTEXT_W_MATTE
599 
600 
601 #define F_SUBCONTEXT_W_RBORDER		(F_SUBCONTEXT_W_RESIZE_NW |\
602 					 F_SUBCONTEXT_W_RESIZE_N |\
603 					 F_SUBCONTEXT_W_RESIZE_NE |\
604 					 F_SUBCONTEXT_W_RESIZE_E |\
605 					 F_SUBCONTEXT_W_RESIZE_SE |\
606 					 F_SUBCONTEXT_W_RESIZE_S |\
607 					 F_SUBCONTEXT_W_RESIZE_SW |\
608 					 F_SUBCONTEXT_W_RESIZE_W)
609 
610 #define F_SUBCONTEXT_W_BORDER		(F_SUBCONTEXT_W_RBORDER |\
611 					 F_SUBCONTEXT_W_NBORDER)
612 
613 #define F_SUBCONTEXT_W_TITLEBAR		(F_SUBCONTEXT_W_SYSTEM |\
614 					 F_SUBCONTEXT_W_TITLE |\
615 					 F_SUBCONTEXT_W_MINIMIZE |\
616 					 F_SUBCONTEXT_W_MAXIMIZE)
617 
618 #define F_SUBCONTEXT_W_FRAME		(F_SUBCONTEXT_W_BORDER |\
619 					 F_SUBCONTEXT_W_TITLEBAR)
620 
621 #define F_SUBCONTEXT_W_ALL		(F_SUBCONTEXT_W_FRAME |\
622 					 F_SUBCONTEXT_W_MATTE |\
623 					 F_SUBCONTEXT_W_CLIENT)
624 
625 
626 /*
627  * Click / double-click processing data:
628  */
629 
630 typedef struct _ClickData
631 {
632     Boolean	clickPending;
633     Boolean	doubleClickPending;
634 #ifdef WSM
635     Boolean	bReplayed;
636 #endif /* WSM */
637     unsigned int button;
638     unsigned int state;
639     unsigned int releaseState;
640     struct _ClientData *pCD;
641     Context	context;
642     Context	subContext;
643     Context	clickContext;
644     Context	doubleClickContext;
645     Time	time;
646 
647 } ClickData;
648 
649 
650 /*
651  * Frame part identification aids:
652  */
653 
654 typedef struct _Gadget_Rectangle
655 {
656     short	id;
657     XRectangle  rect;
658 
659 } GadgetRectangle;
660 
661 
662 /*
663  * Behavior function argument field values:
664  */
665 
666 #define F_BEHAVIOR_DEFAULT	(1L << 0)
667 #define F_BEHAVIOR_CUSTOM	(1L << 1)
668 #define F_BEHAVIOR_SWITCH	(1L << 2)
669 
670 
671 /*
672  * Window/icon group function argument field values:
673  */
674 
675 #define F_GROUP_WINDOW		(1L << 0)
676 #define F_GROUP_ICON		(1L << 1)
677 #define F_GROUP_DEFAULT		(F_GROUP_WINDOW | F_GROUP_ICON)
678 #define F_GROUP_TRANSIENT	(1L << 2)
679 #define F_GROUP_ALL		(F_GROUP_DEFAULT | F_GROUP_TRANSIENT)
680 #define F_GROUP_GROUP		(1L << 3)
681 
682 #ifdef WSM
683 
684 /*************************************<->*************************************
685  *
686  *  Workspace data structures ...
687  *
688  ***************************************************************************/
689 
690 /*
691  * Specific data for workspacePresence dialog box
692  */
693 
694 typedef struct _WsPresenceData
695 {
696     XmString		title;			/* resource */
697 
698     Widget		shellW;
699     Widget		formW;
700     Widget		windowLabelW;
701     Widget		windowNameW;
702     Widget		workspaceLabelW;
703     Widget		workspaceScrolledListW;
704     Widget		workspaceListW;
705     Widget		allWsW;
706     Widget		sepW;
707     Widget		OkW;
708     Widget		CancelW;
709     Widget		HelpW;
710 
711     struct _ClientData 	*pCDforClient;
712     Context 		contextForClient;
713 
714     Boolean 		*ItemSelected;		/* workspaces in list */
715     XmStringTable 	ItemStrings;		/* workspace names */
716     int 		currentWsItem;
717     Boolean		onScreen;
718     Boolean             userDismissed;
719     int			numWorkspaces;
720 
721 } WsPresenceData;
722 
723 #define NUM_WSP_WIDGETS 	11
724 
725 typedef struct _WsPresenceData *PtrWsPresenceData;
726 
727 
728 #ifdef PANELIST
729 /*
730  * Specific data for top level help dialog
731  */
732 
733 typedef struct _WsDtHelpData
734 {
735     XmString		title;			/* resource */
736     Widget		shell;
737     Widget		dialog;
738     Widget		errorDialog;
739     Position            xPos;
740     Position            yPos;
741     Boolean             restored;
742     Boolean		onScreen;
743     Boolean             userDismissed;
744     Boolean		bMapped;
745     struct _ClientData 	*pCDforClient;
746 } WsDtHelpData;
747 
748 typedef struct _WsDtHelpData *PtrWsDtHelpData;
749 #endif /*  PANELIST */
750 
751 
752 /*************************************<->*************************************
753  *
754  *  DtSessionItems
755  *
756  *
757  *  Description:
758  *  -----------
759  *
760  *************************************<->***********************************/
761 
762 typedef struct _DtSessionItem
763 {
764     Boolean                processed;
765     int                    clientState;
766     String                 workspaces;
767     String                 clientMachine;
768     String                 command;
769     int                    commandArgc;
770     char                   **commandArgv;
771     struct _SessionGeom    *sessionGeom;
772 } DtSessionItem;
773 
774 typedef struct _SessionGeom
775 {
776     int          flags;
777     int          clientX;
778     int          clientY;
779     int          clientWidth;
780     int          clientHeight;
781 } SessionGeom;
782 
783 /*
784  *  Status of Session Manager Contention Management
785  */
786 #define  SM_UNITIALIZED			 0
787 #define  SM_START_ACK			 1
788 #define  SM_STOP_ACK                	 2
789 
790 #endif /* WSM */
791 
792 
793 /*************************************<->*************************************
794  *
795  *  Menu specification data structures ...
796  *
797  *
798  *  Description:
799  *  -----------
800  *  These data structures are used in creating window manager menus that
801  *  are specified using resource files.  A list of menu specifications
802  *  (MenuSpec) is made when the resource files are parsed.  The desktop
803  *  menu and system menus are created as needed using the menu specification
804  *  list.
805  *
806  *************************************<->***********************************/
807 
808 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
809 /*
810  * Used to denote where the separators belong in a pair of separators
811  * used to surround a client command.
812  */
813 
814 enum { TOP_SEPARATOR, BOTTOM_SEPARATOR };
815 
816 /*
817  * Used to denote what kind of change to make to a client command.
818  */
819 typedef enum { ENABLE, DISABLE, REMOVE, RENAME } CmdModifier;
820 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
821 
822 typedef struct _MenuItem
823 {
824     int		 labelType;
825     String	 label;
826     int          labelBitmapIndex;
827     KeySym	 mnemonic;
828     unsigned int accelState;
829     KeyCode      accelKeyCode;
830     String	 accelText;
831     WmFunction	 wmFunction;
832     String	 wmFuncArgs;
833     Context	 greyedContext;
834     long         mgtMask;
835 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
836     String       clientCommandName; /* as specified by the user in
837 				       his .mwmrc file. */
838     CARD32	 clientCommandID;
839 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
840     struct _MenuItem *nextMenuItem;
841 
842 } MenuItem;
843 
844 #ifdef WSM
845 
846 /*
847  * We use the top part of mgtMask for workspace function bits.
848  * When OSF MWM outgrows the lower 16 bits, we'll have to
849  * change how we do things.
850  */
851 
852 #define MWM_MGT_MASK	0x0000FFFF
853 #define DTWM_MGT_MASK	0xFFFF0000
854 
855 #endif /* WSM */
856 
857 typedef struct _MenuButton
858 {
859     MenuItem	*menuItem;
860     Widget	buttonWidget;
861     Boolean     managed;
862 
863 } MenuButton;
864 
865 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
866 typedef struct _MenuExclusion
867 {
868   String                 command_string;
869   struct _MenuExclusion *nextExclusion;
870 } MenuExclusion;
871 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
872 
873 typedef struct _MenuSpec
874 {
875     String	  name;
876     Context	  currentContext;
877     Widget	  menuWidget;      /* RowColumn widget */
878     unsigned int  whichButton;    /* tracks whichButton resource for top menu */
879     unsigned int  height;          /* height of top menu */
880     MenuItem	 *menuItems;       /* linked list of MenuItem structures */
881     MenuButton   *menuButtons;     /* array of MenuButton structures */
882     unsigned int  menuButtonSize;  /* size of menuButtons array */
883     unsigned int  menuButtonCount; /* number of menuButtons elements in use */
884     Context	  accelContext;    /* accelerator context */
885     KeySpec	 *accelKeySpecs;   /* list of accelerator KeySpecs */
886 
887 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
888     MenuExclusion *exclusions;      /* list of client commands to be
889 				       excluded from this menu. */
890     Boolean        clientLocal;     /* this menu is owned by a client and not
891 				       shared with any other clients */
892     CARD32         commandID;       /* if this is a client command, then this
893 				       its id value - globally unique. */
894 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
895 
896     struct _MenuSpec *nextMenuSpec;
897 
898 } MenuSpec;
899 
900 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
901 /* The range to which a client command operation should apply. */
902 typedef enum { SINGLE, ROOT, ALL } OpRange;
903 
904 typedef struct _CmdTree {
905   CARD32           commandID;   /* unique identifier for this command. */
906   CARD32           notifyWindow;/* window to receive InvokeCommand request. */
907   char            *name;        /* name of command refered to in .mwmrc. */
908   char            *defaultName; /* default label of menu. */
909   struct _CmdTree *subTrees;    /* list of child commands or command sets. */
910   struct _CmdTree *next;
911 
912 } CmdTree;
913 
914 
915 typedef struct _matchlist {
916     MenuSpec          *menuspec;
917     MenuItem          *menuitem;
918     String             command_string;
919     CmdTree           *treenode;
920     WmFunction         function;
921     String             funcargs;
922     Context            greyed_context;
923     struct _matchlist *next;
924 
925 } MatchList;
926 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
927 
928 
929 /*************************************<->*************************************
930  *
931  *  Window and function specification data structures ...
932  *
933  *
934  *  Description:
935  *  -----------
936  *
937  *************************************<->***********************************/
938 
939 typedef struct _WindowItem
940 {
941     String              window;
942     struct _WindowItem *nextWindowItem;
943 
944 } WindowItem;
945 
946 typedef struct _WindowSet
947 {
948     String             name;
949     WindowItem        *windowItems;
950     struct _WindowSet *nextWindowSet;
951 
952 } WindowSet;
953 
954 typedef struct _FunctionItem
955 {
956     WmFunction		  wmFunction;
957     String                wmFuncArgs;
958     struct _FunctionItem *nextFunctionItem;
959 
960 } FunctionItem;
961 
962 typedef struct _FunctionSet
963 {
964     String               name;
965     FunctionItem        *functionItems;
966     struct _FunctionSet *nextFunctionSet;
967 
968 } FunctionSet;
969 
970 /*************************************<->*************************************
971  *
972  *  Window manager timer data structure ...
973  *
974  *
975  *  Description:
976  *  -----------
977  *  This data stucture is used to keep track of window manager timers.  Each
978  *  active timer has an instance of the data structure.
979  *
980  *************************************<->***********************************/
981 
982 typedef struct _WmTimer
983 {
984     XtIntervalId	timerId;
985     struct _ClientData	*timerCD;
986     unsigned int	timerType;
987     struct _WmTimer	*nextWmTimer;
988 
989 } WmTimer;
990 
991 /* Timer types: */
992 #define TIMER_NONE		0
993 #define TIMER_QUIT		1
994 #define TIMER_RAISE		2
995 
996 
997 /*************************************<->*************************************
998  *
999  *  Window manager frame component data structures
1000  *
1001  *
1002  *  Description:
1003  *  -----------
1004  *  This data stucture is used for drawing frame component graphics.
1005  *
1006  *************************************<->***********************************/
1007 
1008 typedef struct _RList
1009 {
1010     int		allocated;		/* number of allocated XRectangles */
1011     int		used;			/* number currently in use */
1012     XRectangle	*prect;			/* array of XRectangles */
1013 } RList;
1014 
1015 
1016 
1017 
1018 /*************************************<->*************************************
1019  *
1020  *  Window manager component appearance data structure ...
1021  *
1022  *
1023  *  Description:
1024  *  -----------
1025  *  This structure is used to hold component appearance data for client,
1026  *  icon, and feedback subparts.
1027  *
1028  *************************************<->***********************************/
1029 
1030 
1031 typedef struct _AppearanceData
1032 {
1033     XmFontList	fontList;			/* resource */
1034     XFontStruct	*font;
1035 #ifndef NO_MULTIBYTE
1036     unsigned int	titleHeight;		/* title bar's height */
1037 #endif
1038     Boolean	saveUnder;			/* resource */
1039     Pixel	background;			/* resource */
1040     Pixel	foreground;			/* resource */
1041     String	backgroundPStr;			/* resource */
1042     Pixmap	backgroundPixmap;
1043     Pixel	bottomShadowColor;		/* resource */
1044     String	bottomShadowPStr;		/* resource */
1045     Pixmap	bottomShadowPixmap;
1046     Pixel	topShadowColor;			/* resource */
1047     String	topShadowPStr;			/* resource */
1048     Pixmap	topShadowPixmap;
1049     Pixel	activeBackground;		/* resource */
1050     String	activeBackgroundPStr;		/* resource */
1051     Pixmap	activeBackgroundPixmap;
1052     Pixel	activeBottomShadowColor;	/* resource */
1053     String	activeBottomShadowPStr;		/* resource */
1054     Pixmap	activeBottomShadowPixmap;
1055     Pixel	activeForeground;		/* resource */
1056     Pixel	activeTopShadowColor;		/* resource */
1057     String	activeTopShadowPStr;		/* resource */
1058     Pixmap	activeTopShadowPixmap;
1059 
1060     GC		inactiveGC;
1061     GC		inactiveTopShadowGC;
1062     GC		inactiveBottomShadowGC;
1063     GC		activeGC;
1064     GC		activeTopShadowGC;
1065     GC		activeBottomShadowGC;
1066 
1067 } AppearanceData;
1068 
1069 
1070 typedef struct _AppearanceData *PtrAppearanceData;
1071 
1072 
1073 /*************************************<->*************************************
1074  *
1075  *  IconInfo
1076  *
1077  *
1078  *  Description:
1079  *  -----------
1080  *
1081  *************************************<->***********************************/
1082 
1083 typedef struct _IconInfo
1084 {
1085         Widget theWidget;
1086         struct _ClientData *pCD;
1087 } IconInfo;
1088 
1089 typedef struct _IconInfo *PtrIconInfo;
1090 
1091 
1092 
1093 /*************************************<->*************************************
1094  *
1095  *  IconPlacement
1096  *
1097  *
1098  *  Description:
1099  *  -----------
1100  *
1101  *************************************<->***********************************/
1102 
1103 typedef struct _IconPlacementData
1104 {
1105     Boolean	onRootWindow;		/* true if icons on root window */
1106     unsigned 	iconPlacement;		/* style of placement */
1107     int		placementRows;		/* number of rows in placement space */
1108     int		placementCols;		/* number of cols in placement space */
1109     int		totalPlaces;		/* total number of placment slots */
1110     int		iPlaceW;		/* width increment (to next place) */
1111     int		iPlaceH;		/* height increment (to next place) */
1112     IconInfo	*placeList;		/* list of icon info */
1113     int		placeIconX;
1114     int		placeIconY;
1115     int		*placementRowY;
1116     int		*placementColX;
1117 } IconPlacementData;
1118 
1119 
1120 
1121 /*************************************<->*************************************
1122  *
1123  *  IconBoxData
1124  *
1125  *
1126  *  Description:
1127  *  -----------
1128  *  This structure is used to hold window and widget information for
1129  *  each icon box.
1130  *
1131  *************************************<->***********************************/
1132 
1133 typedef struct _IconBoxData
1134 {
1135     Widget	shellWidget;
1136     Widget	frameWidget;
1137     Widget      scrolledWidget;
1138     Widget	vScrollBar;
1139     Widget	hScrollBar;
1140     Widget      bBoardWidget;
1141     Widget	clipWidget;
1142     int		numberOfIcons;
1143     int		currentRow;
1144     int		currentCol;
1145     int		lastRow;
1146     int		lastCol;
1147 #ifdef WSM
1148     WorkspaceID		wsID;		/* workspace identifier */
1149 #endif /* WSM */
1150     struct _ClientData	*pCD_iconBox;	/* ptr to its own clientdata */
1151     struct _IconBoxData *pNextIconBox;	/* ptr to next icon box */
1152     struct _IconPlacementData IPD;	/* icon placement data */
1153 } IconBoxData;
1154 
1155 typedef struct _IconBoxData *PtrIconBoxData;
1156 
1157 #define IB_SPACING		0
1158 #define IB_MARGIN_HEIGHT	3
1159 #define IB_MARGIN_WIDTH		3
1160 #define IB_HIGHLIGHT_BORDER	3
1161 
1162 
1163 /*************************************<->*************************************
1164  *
1165  *  Bitmap/Pixmap cache data
1166  *
1167  *
1168  *  Description:
1169  *  -----------
1170  *  These structures are used for the bitmap and pixmap caches held
1171  *  on a per-screen basis. (This is per-screen because you can't do
1172  *  XCopyPlane from one pixmap to another when they have different
1173  *  roots.)
1174  *
1175  *************************************<->***********************************/
1176 
1177 #define NO_PIXMAP    0
1178 #define LABEL_PIXMAP 1
1179 #define ICON_PIXMAP  2
1180 
1181 typedef struct _PixmapCache
1182 {
1183    unsigned int  pixmapType;   /* icon or label? */
1184    Pixel         foreground;
1185    Pixel         background;
1186    Pixmap        pixmap;
1187    struct _PixmapCache *next;
1188 
1189 } PixmapCache;
1190 
1191 typedef struct _BitmapCache
1192 {
1193    char         *path;
1194    Pixmap        bitmap;
1195    unsigned int  width;
1196    unsigned int  height;
1197    PixmapCache  *pixmapCache;
1198 
1199 } BitmapCache;
1200 
1201 
1202 
1203 
1204 
1205 /******************************<->*************************************
1206  *
1207  *  Client window list entry data structure ...
1208  *
1209  *
1210  *  Description:
1211  *  -----------
1212  *  This structure provides the data for an entry in the client window list.
1213  *  The client window list has an entry for each non-transient client
1214  *  window and each non-iconbox icon.
1215  *
1216  ******************************<->***********************************/
1217 
1218 typedef struct _ClientListEntry
1219 {
1220     struct _ClientListEntry *nextSibling;
1221     struct _ClientListEntry *prevSibling;
1222     int		type;
1223     struct _ClientData *pCD;
1224 
1225 } ClientListEntry;
1226 
1227 
1228 
1229 /*************************************<->*************************************
1230  *
1231  *  Frame information
1232  *
1233  *
1234  *  Description:
1235  *  -----------
1236  *  This structure contains geometry information for the window manager
1237  *  frame.
1238  *
1239  *************************************<->***********************************/
1240 
1241 typedef struct _FrameInfo
1242 {
1243     int			x;
1244     int			y;
1245     unsigned int	width;
1246     unsigned int	height;
1247     unsigned int	upperBorderWidth;
1248     unsigned int	lowerBorderWidth;
1249     unsigned int	cornerWidth;
1250     unsigned int	cornerHeight;
1251     unsigned int	titleBarHeight;
1252 
1253 } FrameInfo;
1254 
1255 
1256 
1257 /*************************************<->*************************************
1258  *
1259  *  WmScreenData
1260  *
1261  *
1262  *  Description:
1263  *  -----------
1264  *  This is the data structure for holding the window manager's
1265  *  screen data. There is one instantiation of the structure for
1266  *  each screen.
1267  *
1268  *************************************<->***********************************/
1269 
1270 typedef struct _WmScreenData
1271 {
1272     int		dataType;
1273     int		screen;			/* number for this screen */
1274     Boolean	managed;
1275     Window	rootWindow;
1276     Widget	screenTopLevelW;
1277     Widget	screenTopLevelW1;       /* for internal WM components */
1278 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
1279     Widget	utmShell;		/* DrawingArea used for UTM */
1280 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
1281     Widget      confirmboxW[4];
1282 #ifdef PANELIST
1283     Widget	wPanelist;		/* panel object */
1284 #endif /* PANELIST */
1285 #ifdef WSM
1286     WsPresenceData	presence;	/* workspace presence dialog*/
1287     Widget	switcherW;		/* workspace switcher */
1288     Widget	switcherShellW;		/* shell for ws switcher */
1289 #endif /* WSM */
1290     Window	wmWorkspaceWin;		/* holds wm properties */
1291     Window	feedbackWin;
1292     Window	activeIconTextWin;
1293     Window	activeLabelParent;
1294     String	displayString;		/* used for putenv in F_Exec */
1295 #ifdef WSM
1296     int displayResolutionType;
1297 #endif /* WSM */
1298 #ifdef PANELIST
1299     struct _WmFpEmbeddedClientData  *pECD; /* clients living in front panel */
1300     int		numEmbeddedClients;
1301     struct _WmFpPushRecallClientData  *pPRCD; /* push_recall clients */
1302     int		numPushRecallClients;
1303 #endif /* PANELIST */
1304 
1305     /* wm state info: */
1306 
1307     unsigned long clientCounter;
1308     long	focusPriority;
1309     Window	inputScreenWindow;
1310     struct _ClientData	*colormapFocus;
1311     Colormap	workspaceColormap;
1312     Colormap	lastInstalledColormap;
1313     struct _WmWorkspaceData	*pActiveWS;	/* for this screen */
1314 #ifdef WSM
1315     struct _WmWorkspaceData	*pLastWS;	/* previously active WS */
1316 #endif /* WSM */
1317 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
1318     CmdTree     *cciTree;               /* pointer to cci definitions */
1319 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
1320 
1321     /* per screen caches */
1322     BitmapCache *bitmapCache;
1323     unsigned int bitmapCacheSize;
1324     unsigned int bitmapCacheCount;
1325 
1326     /* per screen icon info */
1327     Boolean	fadeNormalIcon;			/* resource */
1328     int		iconPlacement;			/* resource */
1329     int		iconPlacementMargin;		/* resource */
1330     int		iconDecoration;			/* resource */
1331     WHSize	iconImageMaximum;		/* resource */
1332     WHSize	iconImageMinimum;		/* resource */
1333     Pixmap	builtinIconPixmap;
1334     int		iconWidth;
1335     int		iconHeight;
1336     int		iconImageHeight;
1337     int		iconLabelHeight;
1338     GC		shrinkWrapGC;
1339     GC		fadeIconGC;
1340     GC		fadeIconTextGC;
1341 
1342 #ifdef WSM
1343 
1344     /* per screen configuration outline windows */
1345     Window	woN;		/* North outline window */
1346     Window	woS;		/* South outline window */
1347     Window	woE;		/* East outline window */
1348     Window	woW;		/* West outline window */
1349 #endif /* WSM */
1350 
1351     /* per screen feedback data */
1352     unsigned long fbStyle;
1353     unsigned int fbWinWidth;
1354     unsigned int fbWinHeight;
1355     char fbLocation[20];
1356     char fbSize[20];
1357     int fbLocX;
1358     int fbLocY;
1359     int fbSizeX;
1360     int fbSizeY;
1361     int fbLastX;
1362     int fbLastY;
1363     unsigned int fbLastWidth;
1364     unsigned int fbLastHeight;
1365     RList *fbTop;
1366     RList *fbBottom;
1367     int     actionNbr;
1368 
1369     /* resource description file data: */
1370 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
1371     String	rootMenu;			/* resource */
1372 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
1373     String	buttonBindings;			/* resource */
1374     ButtonSpec	*buttonSpecs;
1375     String	keyBindings;			/* resource */
1376     KeySpec	*keySpecs;
1377     MenuSpec   **acceleratorMenuSpecs;
1378     unsigned int acceleratorMenuCount;
1379     MenuSpec	*menuSpecs;
1380 
1381     Boolean	defaultSystemMenuUseBuiltin;
1382 
1383     Pixmap	defaultPixmap;
1384     GC		xorGC;
1385 
1386     /* per screen appearance resources */
1387 
1388     Boolean	cleanText;			/* resource */
1389     Boolean	decoupleTitleAppearance;	/* see clientTitleAppearance */
1390     int		frameBorderWidth;		/* resource */
1391     String	feedbackGeometry;		/* resource */
1392 #ifndef WSM
1393     String	iconBoxGeometry;		/* resource */
1394 #endif /* WSM */
1395     String	iconBoxName;			/* resource */
1396     String      iconBoxSBDisplayPolicy;         /* resource */
1397     int		iconBoxScheme;			/* resource - testing */
1398     XmString    iconBoxTitle;			/* resource */
1399     int		externalBevel;
1400     int		joinBevel;
1401     Boolean	limitResize;			/* resource */
1402     WHSize	maximumMaximumSize;		/* resource */
1403     int		resizeBorderWidth;		/* resource */
1404     Boolean	resizeCursors;			/* resource */
1405     int		transientDecoration;		/* resource */
1406     int		transientFunctions;		/* resource */
1407     Boolean	useIconBox;			/* resource */
1408 #ifdef PANELIST
1409     int		subpanelDecoration;		/* resource */
1410     String      subpanelResources;              /*to restore subpanels */
1411     Boolean	iconBoxControl;			/* FP control for icon box */
1412 #endif /* PANELIST */
1413     Boolean     moveOpaque;                     /* move window not outlines */
1414 
1415 #ifdef WSM
1416 
1417     /* pixel set info (from color object) */
1418     XmPixelSet	*pPixelData;		/* all pixel data */
1419     XmPixelSet	*pActivePixelSet;	/* ptr into pPixelData */
1420     XmPixelSet	*pInactivePixelSet;	/* ptr into pPixelData */
1421     XmPixelSet	*pPrimaryPixelSet;	/* ptr into pPixelData */
1422     XmPixelSet	*pSecondaryPixelSet;	/* ptr into pPixelData */
1423     XmPixelSet	*pTextPixelSet;		/* ptr into pPixelData */
1424     int		colorUse;		/* indication from color obj */
1425 #endif /* WSM */
1426 
1427     /* client frame component appearance resources and data: */
1428 
1429     AppearanceData clientAppearance;		/* resources ... */
1430     AppearanceData clientTitleAppearance;	/* resources ... */
1431     XPoint	transientOffset;
1432     int		Num_Resize_Ts_Elements;
1433     int		Num_Resize_Bs_Elements;
1434     int		Num_Title_Ts_Elements;
1435     int		Num_Title_Bs_Elements;
1436 
1437     /* icon component appearance resources and data: */
1438 
1439     AppearanceData iconAppearance;		/* resources ... */
1440 
1441     /* feedback component appearance resources and data: */
1442 
1443     AppearanceData feedbackAppearance;		/* resources ... */
1444 
1445     /* client list pointers: */
1446 
1447     ClientListEntry 	*clientList;
1448     ClientListEntry 	*lastClient;
1449 
1450 #ifdef WSM
1451     /* DtSessionHints for clients */
1452     struct _DtSessionItem     *pDtSessionItems;
1453     int                        totalSessionItems;
1454     int                        remainingSessionItems;
1455 
1456 
1457     /* workspace list for this screen */
1458     String                      initialWorkspace; /* private resource */
1459     String			workspaceList;    /* resource */
1460     int				numWorkspaces;
1461     int				numWsDataAllocated;
1462     struct _WmWorkspaceData	*pWS;
1463     Window			lastBackdropWin;
1464     struct _WsDtHelpData        dtHelp;
1465     struct _CacheListStruct     *cachedHelp;
1466     String                      helpResources;  /* to restore help */
1467     DtSvcHandle	hWsm;		/* WORKSPACEMGR message handle */
1468     Boolean	bMarqueeSelectionInitialized;
1469 
1470 #else /* WSM */
1471     /* workspace for this screen */
1472 
1473     struct _WmWorkspaceData	*pWS;
1474 #endif /* WSM */
1475 
1476 } WmScreenData;
1477 
1478 typedef struct _WmScreenData *PtrScreenData;
1479 
1480 
1481 /*
1482  * Convenience macros for data access
1483  */
1484 #define ROOT_FOR_CLIENT(pcd) ((pcd)->pSD->rootWindow)
1485 #define SCREEN_FOR_CLIENT(pcd) ((pcd)->pSD->screen)
1486 #define PSD_FOR_CLIENT(pcd) ((pcd)->pSD)
1487 #define BUTTON_SPECS(pcd) ((pcd)->pSD->buttonSpecs)
1488 #define KEY_SPECS(pcd) ((pcd)->pSD->keySpecs)
1489 #define ACCELERATOR_MENU_COUNT(pcd) ((pcd)->pSD->acceleratorMenuCount)
1490 #define ACCELERATOR_MENU_SPECS(pcd) ((pcd)->pSD->acceleratorMenuSpecs)
1491 #define WORKSPACE_COLORMAP(pcd) ((pcd)->pSD->workspaceColormap)
1492 #define FADE_NORMAL_ICON(pcd) ((pcd)->pSD->fadeNormalIcon)
1493 /*
1494 #define ICON_DEFAULT_TITLE(pcd) ((pcd)->iconDefaultTitle)
1495 */
1496 #define ICON_DECORATION(pcd) ((pcd)->pSD->iconDecoration)
1497 #define ICON_HEIGHT(pcd) ((pcd)->pSD->iconHeight)
1498 #define ICON_WIDTH(pcd) ((pcd)->pSD->iconWidth)
1499 #define ICON_IMAGE_HEIGHT(pcd) ((pcd)->pSD->iconImageHeight)
1500 #define ICON_LABEL_HEIGHT(pcd) ((pcd)->pSD->iconLabelHeight)
1501 #define ICON_IMAGE_MAXIMUM(pcd) ((pcd)->pSD->iconImageMaximum)
1502 #define ICON_IMAGE_MINIMUM(pcd) ((pcd)->pSD->iconImageMinimum)
1503 #define SHRINK_WRAP_GC(pcd) ((pcd)->pSD->shrinkWrapGC)
1504 #define FADE_ICON_GC(pcd) ((pcd)->pSD->fadeIconGC)
1505 #define FADE_ICON_TEXT_GC(pcd) ((pcd)->pSD->fadeIconTextGC)
1506 #define DEFAULT_PIXMAP(pcd) ((pcd)->pSD->defaultPixmap)
1507 #ifdef WSM
1508 #define ICON_PLACE(pcd) ((pcd)->pWsList[(pcd)->currentWsc].iconPlace)
1509 #define ICON_X(pcd) ((pcd)->pWsList[(pcd)->currentWsc].iconX)
1510 #define ICON_Y(pcd) ((pcd)->pWsList[(pcd)->currentWsc].iconY)
1511 #define P_ICON_BOX(pcd) ((pcd)->pWsList[(pcd)->currentWsc].pIconBox)
1512 #define ICON_FRAME_WIN(pcd) ((pcd)->pWsList[(pcd)->currentWsc].iconFrameWin)
1513 #else /* WSM */
1514 #define ICON_PLACE(pcd) ((pcd)->iconPlace)
1515 #define ICON_X(pcd) ((pcd)->iconX)
1516 #define ICON_Y(pcd) ((pcd)->iconY)
1517 #define P_ICON_BOX(pcd) ((pcd)->pIconBox)
1518 #define ICON_FRAME_WIN(pcd) ((pcd)->iconFrameWin)
1519 #endif /* WSM */
1520 
1521 #ifdef WSM
1522 /*
1523  * Definitions for Screen data
1524  */
1525 #define MAX_WORKSPACE_COUNT	64
1526 
1527 
1528 
1529 /*************************************<->*************************************
1530  *
1531  *  BackdropData
1532  *
1533  *
1534  *  Description:
1535  *  -----------
1536  *  This structure hold information for the workspace background
1537  *
1538  *************************************<->***********************************/
1539 
1540 typedef struct _WmBackdropData
1541 {
1542     String		image;			/* resource */
1543     Atom		nameAtom;
1544     Pixmap		imagePixmap;
1545     int			colorSet;		/* resource */
1546     Pixel 		background;		/* resource */
1547     Pixel 		foreground;		/* resource */
1548     unsigned int	flags;
1549     Window		window;
1550 } BackdropData;
1551 
1552 
1553 /*
1554  * bit definiton for "flags" member of BackdropData
1555  */
1556 #define BACKDROP_NONE		0
1557 #define BACKDROP_CLIENT		(1L<<1)
1558 #define BACKDROP_BITMAP		(1L<<2)
1559 #define BACKDROP_IMAGE_ALLOCED	(1L<<3)	 /* image string can be freed */
1560 
1561 typedef struct _WmBackdropData *PtrBackdropData;
1562 
1563 #define DEFAULT_BACKDROP_DIR CDE_INSTALLATION_TOP "/backdrops"
1564 
1565 #ifdef PANELIST
1566 /*
1567  * direction for slide-out panels
1568  */
1569 typedef enum _SlideDirection
1570 {
1571     SLIDE_NOT, SLIDE_NORTH, SLIDE_EAST, SLIDE_SOUTH, SLIDE_WEST
1572 } SlideDirection;
1573 
1574 /*
1575  * Slide out record for subpanels
1576  */
1577 typedef struct _SlideOutRec
1578 {
1579     struct _ClientData	*pCD;
1580     Window		coverWin;
1581     Dimension		incWidth;
1582     Dimension		incHeight;
1583     Dimension		currWidth;
1584     Dimension		currHeight;
1585     Position		currX;
1586     Position		currY;
1587     unsigned int	interval;
1588     SlideDirection	direction;
1589     Boolean		mapping;
1590     Widget		wSubpanel;
1591 } SlideOutRec;
1592 
1593 /*
1594  * Data structure for arguments to f.action
1595  */
1596 typedef struct _WmActionArg {
1597     String	  actionName;
1598     int		  numArgs;
1599     DtActionArg * aap;
1600     String	  szExecParms;
1601 } WmActionArg;
1602 
1603 #endif /* PANELIST */
1604 #endif /* WSM */
1605 
1606 
1607 
1608 /*************************************<->*************************************
1609  *
1610  *  WmWorkspaceData
1611  *
1612  *
1613  *  Description:
1614  *  -----------
1615  *  This is the structure for holding the workspace specific data.
1616  *  (This has been broken out in anticipation of possible future
1617  *  enhancements.)
1618  *
1619  *************************************<->***********************************/
1620 
1621 typedef struct _WmWorkspaceData
1622 {
1623     int			dataType;
1624 
1625 #ifdef WSM
1626     WorkspaceID		id;
1627     int         	map_state;
1628     BackdropData	backdrop;
1629     Widget		buttonW;
1630     XmString		title;		/* resource (visible name) */
1631     String	        iconBoxGeometry;/* resource */
1632 #endif /* WSM */
1633     String		name;		/* workspace name */
1634 					/* (used for resource fetching) */
1635 
1636     WmScreenData	*pSD;		/* screen data for this workspace */
1637     IconBoxData 	*pIconBox;	/* icon box data for this workspace */
1638     IconPlacementData 	IPData;
1639 
1640     Widget		workspaceTopLevelW;
1641 
1642     /* workspace state information */
1643 
1644     struct _ClientData	*keyboardFocus;	/* ptr to client with the key focus */
1645     struct _ClientData	*nextKeyboardFocus; /* next client to get focus */
1646 #ifdef WSM
1647     struct _ClientData **ppClients;	/* list of client data ptrs */
1648     unsigned int	numClients; 	/* number of client in list */
1649     unsigned int	sizeClientList;	/* size of client list */
1650 #endif  /* WSM */
1651 
1652 } WmWorkspaceData;
1653 
1654 typedef struct _WmWorkspaceData *PtrWorkspaceData;
1655 
1656 
1657 /*
1658  * Convenience macros for data access
1659  */
1660 #define CLIENT_APPEARANCE(pcd) ((pcd)->pSD->clientAppearance)
1661 #define CLIENT_TITLE_APPEARANCE(pcd) ((pcd)->pSD->clientTitleAppearance)
1662 #define DECOUPLE_TITLE_APPEARANCE(pcd) ((pcd)->pSD->decoupleTitleAppearance)
1663 /*
1664 #define CLIENT_DEFAULT_TITLE(pcd) ((pcd)->pSD->clientDefaultTitle)
1665 */
1666 #define MAX_MAX_SIZE(pcd) ((pcd)->pSD->maximumMaximumSize)
1667 #define SHOW_RESIZE_CURSORS(pcd) ((pcd)->pSD->resizeCursors)
1668 #define JOIN_BEVEL(pcd) ((pcd)->pSD->joinBevel)
1669 #define EXTERNAL_BEVEL(pcd) ((pcd)->pSD->externalBevel)
1670 #define FRAME_BORDER_WIDTH(pcd) ((pcd)->pSD->frameBorderWidth)
1671 #define RESIZE_BORDER_WIDTH(pcd) ((pcd)->pSD->resizeBorderWidth)
1672 #define NUM_TITLE_TS_ELEMENTS(pcd) ((pcd)->pSD->Num_Title_Ts_Elements)
1673 #define NUM_TITLE_BS_ELEMENTS(pcd) ((pcd)->pSD->Num_Title_Bs_Elements)
1674 #define NUM_RESIZE_TS_ELEMENTS(pcd) ((pcd)->pSD->Num_Resize_Ts_Elements)
1675 #define NUM_RESIZE_BS_ELEMENTS(pcd) ((pcd)->pSD->Num_Resize_Bs_Elements)
1676 #define ICON_APPEARANCE(pcd) ((pcd)->pSD->iconAppearance)
1677 
1678 #define ACTIVE_LABEL_PARENT(pcd) ((pcd)->pSD->activeLabelParent)
1679 
1680 #ifndef WSM
1681 #define ICON_BOX_GEOMETRY(pcd) ((pcd)->pSD->iconBoxGeometry)
1682 #endif /* WSM */
1683 #define ICON_BOX_TITLE(pcd) ((pcd)->pSD->iconBoxTitle)
1684 
1685 #define TRANSIENT_DECORATION(pcd) ((pcd)->pSD->transientDecoration)
1686 #define TRANSIENT_FUNCTIONS(pcd) ((pcd)->pSD->transientFunctions)
1687 
1688 
1689 /*************************************<->*************************************
1690  *
1691  *  ClientData
1692  *
1693  *
1694  *  Description:
1695  *  -----------
1696  *  This data structure is instantiated for every client window that is
1697  *  managed by the window manager.  The information that is saved in the
1698  *  data structure is specific to the associated client window.
1699  *
1700  *  ClientData is instantiated at the time a client window is intially
1701  *  managed and is destroyed when the client window is withdrawn from
1702  *  window management (the ClientData may not be destroyed when a
1703  *  client window is withdrawn if frame/icons are cached).
1704  *
1705  *************************************<->***********************************/
1706 
1707 typedef struct _ClientData
1708 {
1709     int		dataType;			/* client data type */
1710 
1711     Window	client;
1712     long	clientFlags;
1713     int		icccVersion;
1714     int		clientState;			/* WM_HINTS field */
1715     int		inputFocusModel;		/* WM_HINTS field */
1716     int		inputMode;
1717     long	focusPriority;
1718     unsigned long clientID;
1719     int		wmUnmapCount;
1720 #ifdef PANELIST
1721     struct _WmFpEmbeddedClientData  *pECD; /* embedded client data */
1722     struct _WmFpPushRecallClientData  *pPRCD; /* embedded client data */
1723 #endif /* PANELIST */
1724 #ifdef WSM
1725     Atom *	paInitialProperties;	/* initial window properties */
1726     int		numInitialProperties;	/* number of initial properties */
1727 #endif /* WSM */
1728 
1729     /* client supported protocols: */
1730 
1731     Atom	*clientProtocols;		/* WM_PROTOCOLS */
1732     int		clientProtocolCount;
1733     long	protocolFlags;
1734     long	*mwmMessages;			/* _MWM_MESSAGES */
1735     int		mwmMessagesCount;
1736 
1737     /* client colormap data: */
1738 
1739     Colormap	clientColormap;			/* selected client colormap */
1740     Window	*cmapWindows;			/* from WM_COLORMAP_WINDOWS */
1741     Colormap	*clientCmapList;
1742     int		clientCmapCount;		/* len of clientCmapList */
1743     int		clientCmapIndex;		/* current cmap in list */
1744 #ifndef OLD_COLORMAP /* colormap */
1745     int		*clientCmapFlags;		/* installed, uninstalled */
1746     Bool	clientCmapFlagsInitialized;	/* Are clientCmapFlags valid? */
1747 #endif
1748 
1749     /* associated window data: */
1750 
1751     ClientListEntry clientEntry;
1752     ClientListEntry iconEntry;
1753     XID		windowGroup;			/* WM_HINTS field */
1754 #ifndef NO_OL_COMPAT
1755     Boolean	bPseudoTransient;		/* transientFor window group */
1756 #endif /* NO_OL_COMPAT */
1757 #ifndef WSM
1758     IconBoxData *pIconBox;			/* icon box for this win */
1759 #endif /* WSM */
1760     IconBoxData *thisIconBox;			/* icon box data for self */
1761     						/*   if this is an icon box */
1762     Context    grabContext;                     /* used to support icon box */
1763                                                 /* icon key, button, menus */
1764     Window	transientFor;			/* transient for another win */
1765     struct _ClientData *transientLeader;	/* trans leader of this win */
1766     struct _ClientData *transientChildren;	/* transients of this win */
1767     struct _ClientData *transientSiblings;	/* related transient win's */
1768 #ifdef WSM
1769     int		primaryStackPosition;		/* stack pos'n of primary */
1770     Boolean	secondariesOnTop;		/* resource */
1771 #endif /* WSM */
1772     int		primaryModalCount;		/* primary modal win count */
1773     int		fullModalCount;			/* full modal win count */
1774 
1775     /* client resource data */
1776 
1777     String	clientClass;			/* WM_CLASS field */
1778     String	clientName;			/* WM_CLASS field */
1779     int		clientDecoration;		/* resource */
1780     int		clientFunctions;		/* resource */
1781     Boolean	focusAutoRaise;			/* resource */
1782     Boolean	focusAutoRaiseDisabled;		/* to support f.lower */
1783     Boolean	focusAutoRaiseDisablePending;	/* to support f.lower */
1784     String	iconImage;			/* resource */
1785     Pixel	iconImageBackground;		/* resource */
1786     Pixel	iconImageBottomShadowColor;	/* resource */
1787     String	iconImageBottomShadowPStr;	/* resource */
1788     Pixmap	iconImageBottomShadowPixmap;
1789     Pixel	iconImageForeground;		/* resource */
1790     Pixel	iconImageTopShadowColor;	/* resource */
1791     String	iconImageTopShadowPStr;		/* resource */
1792     Pixmap	iconImageTopShadowPixmap;
1793     Boolean	ignoreWMSaveHints;		/* resource */
1794     int		internalBevel;			/* resource */
1795     Pixel	matteBackground;		/* resource */
1796     Pixel	matteBottomShadowColor;		/* resource */
1797     String	matteBottomShadowPStr;		/* resource */
1798     Pixmap	matteBottomShadowPixmap;
1799     Pixel	matteForeground;		/* resource */
1800     Pixel	matteTopShadowColor;		/* resource */
1801     String	matteTopShadowPStr;		/* resource */
1802     Pixmap	matteTopShadowPixmap;
1803     int		matteWidth;			/* resource */
1804     WHSize	maximumClientSize;		/* resource */
1805     String	smClientID;			/* SM_CLIENT_ID */
1806     String	systemMenu;			/* resource */
1807     MenuItem    *mwmMenuItems;			/* custom menu items or NULL */
1808     MenuSpec	*systemMenuSpec;
1809     Boolean	useClientIcon;			/* resource */
1810     int		wmSaveHintFlags;		/* WMSAVE_HINT */
1811 
1812     /* client frame data: */
1813 
1814     long	sizeFlags;			/* WM_NORMAL_HINTS field */
1815     long	decor;				/* client decoration*/
1816     long	decorFlags;			/* depressed gadgets flags */
1817     int		minWidth;			/* WM_NORMAL_HINTS field */
1818     int		minHeight;			/* WM_NORMAL_HINTS field */
1819     Boolean	maxConfig;			/* True => use max config */
1820     int		maxX;				/* maximized window X loc */
1821     int		maxY;				/* maximized window Y loc */
1822     int		maxWidthLimit;
1823     int		maxWidth;			/* WM_NORMAL_HINTS field */
1824     int		maxHeightLimit;
1825     int		maxHeight;			/* WM_NORMAL_HINTS field */
1826     int		oldMaxWidth;			/* for good HPterm behavior */
1827     int		oldMaxHeight;			/* for good HPterm behavior */
1828     int		widthInc;			/* WM_NORMAL_HINTS field */
1829     int		heightInc;			/* WM_NORMAL_HINTS field */
1830     AspectRatio	minAspect;			/* WM_NORMAL_HINTS field */
1831     AspectRatio	maxAspect;			/* WM_NORMAL_HINTS field */
1832     int		baseWidth;			/* WM_NORMAL_HINTS field */
1833     int		baseHeight;			/* WM_NORMAL_HINTS field */
1834     int		windowGravity;			/* WM_NORMAL_HINTS field */
1835     int		clientX;			/* normal window X loc */
1836     int		clientY;			/* normal window Y loc */
1837     int		clientWidth;			/* normal window width */
1838     int		clientHeight;			/* normal window height */
1839     XPoint	clientOffset;			/* frame to client window */
1840     XmString	clientTitle;			/* WM_NAME field */
1841     Window	clientFrameWin;			/* top-level, frame window */
1842     Window	clientStretchWin[STRETCH_COUNT];/* for resizing border */
1843     Window	clientTitleWin;			/* for title bar */
1844     Window	clientBaseWin;			/* for matte & reparenting */
1845     int		xBorderWidth;			/* original X border width */
1846     FrameInfo	frameInfo;			/* frame geometry data */
1847 
1848     /* client window frame graphic data: */
1849 
1850     RList	*pclientTopShadows;		/* top shadow areas */
1851     RList	*pclientBottomShadows;		/* bottom shadow areas */
1852 
1853     RList	*pclientTitleTopShadows;	/* top shadow areas */
1854     RList	*pclientTitleBottomShadows;	/* bottom shadow areas */
1855 
1856     RList	*pclientMatteTopShadows;	/* matte top shadows */
1857     RList	*pclientMatteBottomShadows;	/* matte bottom shadows */
1858 
1859     /* rectangles for client frame gadgets */
1860 
1861     XRectangle		titleRectangle;		/* title bar area */
1862     GadgetRectangle	*pTitleGadgets;		/* title bar gadgets */
1863     int			cTitleGadgets;		/* count of title rects */
1864     GadgetRectangle	*pResizeGadgets;	/* resize areas */
1865     XRectangle		matteRectangle;		/* matte / base window area */
1866 
1867     /* client appearance data: */
1868 
1869     GC		clientMatteTopShadowGC;
1870     GC		clientMatteBottomShadowGC;
1871     WmScreenData	*pSD;			/* where visuals come from */
1872 
1873     /* icon data: */
1874 
1875     long	iconFlags;
1876     XmString	iconTitle;			/* WM_ICON_NAME field */
1877 #ifndef WSM
1878     int		iconX;				/* WM_HINTS field */
1879     int		iconY;				/* WM_HINTS field */
1880     int		iconPlace;
1881     Window	iconFrameWin;
1882 #endif /* WSM */
1883     Pixmap	iconPixmap;			/* WM_HINTS field */
1884     Pixmap	iconMask;			/* WM_HINTS field */
1885     Window	iconWindow;			/* WM_HINTS field */
1886 
1887     RList	*piconTopShadows;		/* these change to 	*/
1888     						/* to reflect the 	*/
1889     RList	*piconBottomShadows;		/* depressed icon image */
1890 
1891 #ifdef WSM
1892     /* workspace data */
1893 
1894     int         absentMapBehavior;              /* resource */
1895     int		numInhabited;		/* number of WS's inhabited */
1896     int		sizeWsList;		/* size of wsc data list */
1897     struct _WsClientData *pWsList;	/* list of workspace-client data */
1898     int		currentWsc;		/* index to current wsc data */
1899     WorkspaceID	*pWorkspaceHints;	/* _DT_WORKSPACE_HINTS */
1900     int		numWorkspaceHints;	/* size of pWorkspaceHints */
1901     Boolean	putInAll;		/* persistent window flag */
1902     long	dtwmFunctions;		/* _DT_WM_HINTS */
1903     long	dtwmBehaviors;		/* _DT_WM_HINTS */
1904     Window	attachWindow;		/* _DT_WM_HINTS */
1905 #ifdef PANELIST
1906     SlideDirection	slideDirection;	/* slide-up direction */
1907     SlideOutRec	*pSOR;			/* slide-out record */
1908 #endif /* PANELIST */
1909 #endif /* WSM */
1910 #ifndef NO_SHAPE
1911     short       wShaped;                /* this window has a bounding shape */
1912 #endif /* NO_SHAPE  */
1913 
1914     int		usePPosition;		/* indicate whether to use PPosition */
1915 
1916     long	window_status;			/* used for Tear-off Menus */
1917 
1918 } ClientData;
1919 
1920 typedef struct _ClientData *PtrClientData;
1921 
1922 /* client data convenience macros */
1923 
1924 #define IS_APP_MODALIZED(pcd) \
1925     (((pcd)->primaryModalCount)||((pcd)->fullModalCount))
1926 
1927 #define IS_MAXIMIZE_VERTICAL(pcd) \
1928   ((pcd->maximumClientSize.height == BIGSIZE) && \
1929    (pcd->maximumClientSize.width == 0))
1930 
1931 #define IS_MAXIMIZE_HORIZONTAL(pcd) \
1932   ((pcd->maximumClientSize.width == BIGSIZE) && \
1933    (pcd->maximumClientSize.height == 0))
1934 
1935 /* window management state of client windows (clientState): */
1936 #define WITHDRAWN_STATE		0
1937 #define NORMAL_STATE		1
1938 #define MINIMIZED_STATE		2
1939 #define MAXIMIZED_STATE		3
1940 #ifdef WSM
1941 #define UNSEEN_STATE            8
1942 #endif /* WSM */
1943 
1944 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
1945 # define NO_CHANGE              -1
1946 # define UNSET                   0
1947 # define SET                     1
1948 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
1949 
1950 /* clientFlags field values: */
1951 #define CLIENT_HINTS_TITLE		(1L << 0)
1952 #define CLIENT_REPARENTED		(1L << 1)
1953 #define CLIENT_TRANSIENT		(1L << 2)
1954 #define CLIENT_CONTEXT_SAVED		(1L << 3)
1955 #define CLIENT_IN_SAVE_SET		(1L << 4)
1956 #define USERS_MAX_POSITION		(1L << 5)
1957 #define WM_INITIALIZATION		(1L << 6)
1958 #define CLIENT_DESTROYED		(1L << 7)
1959 #define ICON_REPARENTED			(1L << 8)
1960 #define ICON_IN_SAVE_SET		(1L << 9)
1961 #define CLIENT_TERMINATING		(1L << 10)
1962 #define ICON_BOX                        (1L << 11)  /* one of our icon boxes */
1963 #define CONFIRM_BOX                     (1L << 12)  /* a confirmation box */
1964 
1965 #ifdef PANELIST
1966 #define FRONT_PANEL_BOX                 (1L << 14)  /* a DT 3.0 front panel */
1967 #define GOT_DT_WM_HINTS		(1L << 15)
1968 #endif /* PANELIST */
1969 #ifdef WSM
1970 #define SM_LAUNCHED                     (1L << 17) /* launched by dtsession */
1971 #endif /* WSM */
1972 
1973 #define SM_X                     	(1L << 18) /* X from DB/dtsession */
1974 #define SM_Y                     	(1L << 19) /* Y from DB/dtsession */
1975 #define SM_WIDTH                     	(1L << 20) /* width fm DB/dtsession */
1976 #define SM_HEIGHT                    	(1L << 21) /* height fm DB/dtsession */
1977 #define SM_CLIENT_STATE                	(1L << 22) /* clientState fm DB/dtsession */
1978 #define SM_ICON_X                       (1L << 23) /* icon X from DB */
1979 #define SM_ICON_Y                       (1L << 24) /* icon Y from DB */
1980 
1981 #define CLIENT_WM_CLIENTS		(ICON_BOX | CONFIRM_BOX)
1982 
1983 /* decorFlags bit fields */
1984 #define SYSTEM_DEPRESSED		(1L << 0)
1985 #define TITLE_DEPRESSED			(1L << 1)
1986 #define MINIMIZE_DEPRESSED		(1L << 2)
1987 #define MAXIMIZE_DEPRESSED		(1L << 3)
1988 
1989 /* iconFlags field values: */
1990 #define ICON_HINTS_POSITION		(1L << 0)
1991 #define ICON_HINTS_TITLE		(1L << 1)
1992 #define ICON_HINTS_PIXMAP		(1L << 2)
1993 
1994 /* client protocol flags and sizes: */
1995 #define PROTOCOL_WM_SAVE_YOURSELF	(1L << 0)
1996 #define PROTOCOL_WM_DELETE_WINDOW	(1L << 1)
1997 #define PROTOCOL_WM_TAKE_FOCUS		(1L << 2)
1998 #define PROTOCOL_MWM_MESSAGES		(1L << 3)
1999 #define PROTOCOL_MWM_OFFSET		(1L << 4)
2000 
2001 #define MAX_CLIENT_PROTOCOL_COUNT	40
2002 #define MAX_COLORMAP_WINDOWS_COUNT	40
2003 #define MAX_MWM_MESSAGES_COUNT		40
2004 
2005 /* bevel width limits between window manager frame and client window */
2006 #define MIN_INTERNAL_BEVEL		0
2007 #define MAX_INTERNAL_BEVEL		2
2008 
2009 /* global return buffer */
2010 #define MAXWMPATH				1023
2011 #define MAXBUF				(MAXWMPATH+1)
2012 
2013 #define PIXMAP_IS_VALID(pix) \
2014   ((pix) != XmUNSPECIFIED_PIXMAP && (pix) != None && (pix) != (Pixmap)NULL)
2015 
2016 #ifdef WSM
2017 
2018 /*************************************<->*************************************
2019  *
2020  *  WsClientData
2021  *
2022  *
2023  *  Description:
2024  *  -----------
2025  *  This datum compartmentalizes client data that must be replicated
2026  *  on a per workspace basis.
2027  *
2028  *************************************<->***********************************/
2029 typedef struct _WsClientData
2030 {
2031     WorkspaceID	wsID;			/* workspace identifier */
2032     int		iconPlace;		/* icon placment index */
2033     int		iconX;
2034     int		iconY;
2035     Window	iconFrameWin;
2036     IconBoxData *pIconBox;		/* icon box for this win */
2037 
2038 } WsClientData;
2039 
2040 #endif /* WSM */
2041 
2042 /*
2043  * frame style types
2044  */
2045 typedef enum _FrameStyle
2046 {
2047     WmRECESSED,
2048     WmSLAB
2049 } FrameStyle;
2050 
2051 
2052 /*************************************<->*************************************
2053  *
2054  *  WmGlobalData
2055  *
2056  *
2057  *  Description:
2058  *  -----------
2059  *  This is the main data structure for holding the window manager's
2060  *  global data. There is one instantiation of the structure for
2061  *  the window manager.
2062  *
2063  *************************************<->***********************************/
2064 
2065 typedef struct _WmGlobalData
2066 {
2067     int		dataType;
2068     char	**argv;			/* command line argument vector */
2069     char	**environ;		/* environment vector */
2070     char	*mwmName;		/* name of our executable */
2071     Widget	topLevelW;
2072 #ifdef WSM
2073     Widget	topLevelW1;             /* from which WM components hang */
2074 #endif /* WSM */
2075     Boolean     confirmDialogMapped;    /* confirm dialog is mapped */
2076     XtAppContext	mwmAppContext;	/* application context for mwm */
2077     XContext	windowContextType;	/* window context for XSaveContext */
2078     XContext	screenContextType;	/* screen context for XSaveContext */
2079 #ifndef	IBM_169380
2080     XContext  cmapWindowContextType;  /* list of pCD's in WM_COLORMAP_WINDOWS                                              context for XSaveContext */
2081 #endif
2082 #ifdef WSM
2083     XContext	mwmWindowContextType;	/* mwm win context for XSaveContext */
2084     Window      dtSmWindow;            /* used for contention management */
2085     Window      commandWindow;          /* WM_SAVE_YOURSELF win for dtwm */
2086 #endif /* WSM */
2087 
2088     /* presentation resource id's: */
2089 
2090     String	displayString;		/* used for putenv in F_Exec */
2091     Display	*display;		/* display we are running to */
2092 #ifdef WSM
2093     Display	*display1;		/* second display connection */
2094     int         statusColorServer;      /* CSERVE_NORMAL, CSERVE_NOT_AVAILABLE */
2095     DtWmpParseBuf	*pWmPB;		/* global parse buffer */
2096 #endif /* WSM */
2097     int		numScreens;		/* number of screens */
2098     unsigned char	**screenNames;	/* default names for screens */
2099     WmScreenData	*Screens;	/* array of screen info */
2100 
2101     Cursor	workspaceCursor;		/* basic arrow cursor */
2102     Cursor	stretchCursors[STRETCH_COUNT];
2103     Cursor	configCursor;
2104     Cursor	movePlacementCursor;
2105     Cursor	sizePlacementCursor;
2106 
2107 #ifndef NO_MESSAGE_CATALOG
2108     XmString okLabel;
2109     XmString cancelLabel;
2110     XmString helpLabel;
2111 #endif
2112 
2113 
2114     /* wm state info: */
2115 
2116     WmScreenData *pActiveSD;		/* with keyfocus window */
2117     Boolean	useStandardBehavior;	/* behavior flag */
2118     Boolean	wmRestarted;		/* restart flag */
2119     Boolean	errorFlag;		/* handle on async errors */
2120     XID		errorResource;		/* from XErrorEvent */
2121     unsigned char errorRequestCode;	/* from XErrorEvent */
2122 
2123 		    /* The following are global because pointer is grabbed */
2124     MenuSpec	*menuActive;		/* ptr to currently active menu */
2125     KeySpec	*menuUnpostKeySpec;	/* key to upost current menu */
2126     ClientData	*menuClient;		/* client for which menu is posted */
2127     KeySpec     *F_NextKeySpec;         /* used when travering to windows */
2128     KeySpec     *F_PrevKeySpec;         /* used when travering to windows */
2129 
2130     Context     grabContext;            /* used in GrabWin when no event */
2131 
2132     ClickData	clickData;		/* double-click detection data */
2133     int		configAction;		/* none, resize, move */
2134     unsigned int configButton;		/* button used for config */
2135     unsigned int configPart;		/* resize frame part */
2136     Boolean 	configSet;		/* True if configPart set */
2137     Boolean	movingIcon;		/* True if icon being moved */
2138     Boolean	preMove;		/* move threshold support */
2139     int		preMoveX;
2140     int		preMoveY;
2141     ClientData	*gadgetClient;		/* last client with */
2142     int		gadgetDepressed;	/* depressed gadget */
2143     Boolean	checkHotspot;		/* event hotspot flag */
2144     XRectangle	hotspotRectangle;	/* event hotspot area */
2145     WmTimer	*wmTimers;		/* timer data */
2146     Boolean	passKeysActive;		/* flag for pass keys function */
2147     KeySpec	*passKeysKeySpec;	/* key for pass keys function */
2148     Boolean	activeIconTextDisplayed;	/* True if active label up */
2149     Boolean	queryScreen;		/* True if not sure of active screen */
2150 
2151     /* keyboard focus data: */
2152 
2153     ClientData	*keyboardFocus;		/* ptr to client with the key focus */
2154     ClientData	*nextKeyboardFocus;	/* next client to get focus */
2155     Boolean	systemModalActive;
2156     ClientData	*systemModalClient;
2157     Window	systemModalWindow;
2158 
2159     /* Resource database used to restore client geometries, etc. */
2160     XrmDatabase clientResourceDB;
2161 #ifndef WSM
2162     char	*dbFileName;
2163     String	sessionClientDB;		/* resource */
2164 #endif
2165 
2166     /* atoms used in inter-client communication: */
2167 
2168     Atom	xa_WM_STATE;
2169     Atom	xa_WM_PROTOCOLS;
2170     Atom	xa_WM_CHANGE_STATE;
2171     Atom	xa_WM_SAVE_YOURSELF;
2172     Atom	xa_WM_DELETE_WINDOW;
2173     Atom	xa_WM_TAKE_FOCUS;
2174     Atom	xa_WM_COLORMAP_WINDOWS;
2175     Atom	xa_MWM_HINTS;
2176     Atom	xa_MWM_MESSAGES;
2177     Atom	xa_MWM_MENU;
2178     Atom	xa_MWM_INFO;
2179     Atom	xa_MWM_OFFSET;
2180 
2181 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
2182     Atom       *xa_WM;
2183 
2184     Atom	xa_TARGETS;
2185     Atom	xa_MULTIPLE;
2186     Atom	xa_TIMESTAMP;
2187 
2188     /* original set of query targets */
2189     Atom	_MOTIF_WM_CLIENT_WINDOW;
2190     Atom	_MOTIF_WM_POINTER_WINDOW;
2191     Atom	_MOTIF_WM_ALL_CLIENTS	;
2192 
2193     /* menu command interface support */
2194     Atom	_MOTIF_WM_DEFINE_COMMAND;
2195     Atom	_MOTIF_WM_INCLUDE_COMMAND;
2196     Atom	_MOTIF_WM_REMOVE_COMMAND;
2197     Atom	_MOTIF_WM_ENABLE_COMMAND;
2198     Atom	_MOTIF_WM_DISABLE_COMMAND;
2199     Atom	_MOTIF_WM_RENAME_COMMAND;
2200     Atom	_MOTIF_WM_INVOKE_COMMAND;
2201     Atom	_MOTIF_WM_REQUEST_COMMAND;
2202     Atom	_MOTIF_WM_WINDOW_FLAGS;
2203 
2204     /* automation support */
2205     Atom        _MOTIF_WM_AUTOMATION;
2206 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
2207 
2208     Atom	xa_MOTIF_BINDINGS;
2209     Atom	xa_COMPOUND_TEXT;
2210     Atom	xa_SM_CLIENT_ID;
2211     Atom	xa_WMSAVE_HINT;
2212 
2213 
2214 #ifdef WSM
2215 
2216     /* atoms used for workspace management: */
2217 
2218     Atom	xa_DT_WORKSPACE_HINTS;
2219     Atom	xa_DT_WORKSPACE_PRESENCE;
2220     Atom	xa_DT_WORKSPACE_INFO;
2221     Atom	xa_DT_EMBEDDED_CLIENTS;
2222     Atom	xa_DT_WORKSPACE_LIST;
2223     Atom	xa_DT_WORKSPACE_CURRENT;
2224 
2225     Atom	xa_ALL_WORKSPACES;
2226     Atom        xa_DT_SESSION_HINTS;
2227     Atom	xa_DT_WM_REQUEST;
2228 
2229     Atom        xa_DT_SM_WM_PROTOCOL;
2230     Atom        xa_DT_SM_START_ACK_WINDOWS;
2231     Atom        xa_DT_SM_STOP_ACK_WINDOWS;
2232     Atom        xa_DT_WM_WINDOW_ACK;
2233     Atom        xa_DT_WM_EXIT_SESSION;
2234     Atom        xa_DT_WM_LOCK_DISPLAY;
2235     Atom        xa_DT_WM_READY;
2236 #endif /* WSM */
2237 #ifndef NO_OL_COMPAT
2238     Atom	xa_OL_WIN_ATTR;
2239     Atom	xa_OL_DECOR_RESIZE;
2240     Atom	xa_OL_DECOR_HEADER;
2241     Atom	xa_OL_DECOR_CLOSE;
2242     Atom	xa_OL_DECOR_PIN;
2243     Atom	xa_OL_DECOR_ADD;
2244     Atom	xa_OL_DECOR_DEL;
2245     Atom	xa_OL_WT_BASE;
2246     Atom	xa_OL_WT_COMMAND;
2247     Atom	xa_OL_WT_HELP;
2248     Atom	xa_OL_WT_NOTICE;
2249     Atom	xa_OL_WT_OTHER;
2250     Atom	xa_OL_PIN_IN;
2251     Atom	xa_OL_PIN_OUT;
2252     Atom	xa_OL_MENU_LIMITED;
2253     Atom	xa_OL_MENU_FULL;
2254 #endif /* NO_OL_COMPAT */
2255 
2256     /* mwm specific appearance and behavior resources and data: */
2257 
2258     Boolean	autoKeyFocus;			/* resource */
2259     int		autoRaiseDelay;			/* resource */
2260     String	bitmapDirectory;		/* resource */
2261 #ifdef WSM
2262     String	backdropDirs;			/* resource */
2263 #endif /* WSM */
2264     Boolean	clientAutoPlace;		/* resource */
2265     int		colormapFocusPolicy;		/* resource */
2266     String	configFile;			/* resource */
2267 #ifdef WSM
2268     String	cppCommand;			/* resource */
2269 #endif /* WSM */
2270     Boolean	deiconifyKeyFocus;		/* resource */
2271     int		doubleClickTime;		/* resource */
2272     Boolean	enableWarp;			/* resource */
2273     Boolean	enforceKeyFocus;		/* resource */
2274     Boolean	freezeOnConfig;			/* resource - testing */
2275 #ifdef WSM
2276     Boolean	useWindowOutline;		/* resource */
2277 #endif /* WSM */
2278     Boolean	iconAutoPlace;			/* resource */
2279     Boolean	iconClick;			/* resource */
2280     Boolean	interactivePlacement;		/* resource */
2281     int		keyboardFocusPolicy;		/* resource */
2282     Boolean	lowerOnIconify;			/* resource */
2283     int		moveThreshold;			/* resource */
2284     Boolean     passButtonsCheck; /* used to override passButtons */
2285     Boolean	passButtons;			/* resource */
2286     Boolean	passSelectButton;		/* resource */
2287     Boolean	positionIsFrame;		/* resource */
2288     Boolean	positionOnScreen;		/* resource */
2289     int		quitTimeout;			/* resource */
2290     Boolean     raiseKeyFocus;                  /* resource */
2291     Boolean     multiScreen;                  	/* resource */
2292     String	screenList;			/* resource */
2293     int		showFeedback;			/* resource */
2294 #ifdef WSM
2295     Boolean	refreshByClearing;		/* resource */
2296     Boolean	rootButtonClick;		/* resource */
2297 #endif /* WSM */
2298     Boolean	startupKeyFocus;		/* resource */
2299     Boolean	systemButtonClick;		/* resource */
2300     Boolean	systemButtonClick2;		/* resource */
2301     Boolean	useLargeCursors;
2302 #if  defined(PANELIST)
2303     Boolean	useFrontPanel;			/* resource */
2304 #endif /* PANELIST */
2305 #ifdef WSM
2306     String      helpDirectory;		        /* resource */
2307     Window	requestContextWin;		/* for WmRequest f.fcns */
2308 #endif /* WSM */
2309 #ifdef MINIMAL_DT
2310     Boolean     dtLite;                        /* resource */
2311     Boolean     blinkOnExec;                    /* resource */
2312 #endif /* MINIMAL_DT */
2313 #ifdef PANELIST
2314     WmScreenData *dtSD; /* screen for front panel */
2315     int         iSlideUpsInProgress;
2316 #endif /*PANELIST  */
2317     Boolean	waitForClicks;			/* resource */
2318     FrameStyle	frameStyle;			/* resource */
2319 #ifdef WSM
2320     Dimension	iconExternalShadowWidth;	/* resource */
2321     Dimension	frameExternalShadowWidth;	/* resource */
2322     int		marqueeSelectGranularity;	/* resource */
2323     XButtonEvent evLastButton;			/* for detecting replayed
2324 						   button events */
2325     Boolean	bReplayedButton;		/* true if button replayed */
2326     Boolean	bSuspendSecondaryRestack;	/* overrides transient
2327 						   stacking */
2328 #endif /* WSM */
2329 
2330     XmString	clientDefaultTitle;
2331     XmString	iconDefaultTitle;
2332 
2333     Window	attributesWindow;
2334     XWindowAttributes	windowAttributes;
2335 
2336 #ifndef NO_SHAPE
2337     Boolean     hasShape;                /* server supports Shape extension */
2338     int         shapeEventBase, shapeErrorBase;
2339 #endif /* NO_SHAPE */
2340     /* Need to replay enter notify events on windows with the
2341        pointer that used to be modalized.  This is for pointer focus. */
2342     int         replayEnterEvent;
2343     XEnterWindowEvent savedEnterEvent;
2344 
2345     unsigned int lockingModMask;	/* mask of locking modifier keys */
2346     unsigned int *pLockMaskSequence;
2347 
2348     unsigned char tmpBuffer[MAXBUF];	/* replaces static buffers used */
2349 					/* for large return values */
2350 
2351     int numMouseButtons;		/* num of mouse buttons available */
2352     unsigned int bMenuButton;		/* BMenu binding (button/state) */
2353 #if defined(sun) && defined(ALLPLANES)
2354     Bool	allplanes;		/* is SUN_ALLPLANES available? */
2355 #endif /* defined(sun) && defined(ALLPLANES) */
2356 } WmGlobalData;
2357 
2358 /* quick references to global data: */
2359 #define DISPLAY		wmGD.display
2360 #ifdef WSM
2361 #define DISPLAY1	wmGD.display1
2362 #endif /* WSM */
2363 #define ACTIVE_PSD	(wmGD.pActiveSD)
2364 #define ACTIVE_SCREEN	(wmGD.pActiveSD->screen)
2365 #define ACTIVE_WS	(wmGD.pActiveSD->pActiveWS)
2366 #define ACTIVE_ROOT	(wmGD.pActiveSD->rootWindow)
2367 #define ACTIVE_ICON_TEXT_WIN (wmGD.pActiveSD->activeIconTextWin)
2368 
2369 #define NOLOCKMOD(state)  ((state) & ~wmGD.lockingModMask)
2370 #ifdef WSM
2371 /* absent map behavior policy values (absentMapBehavior): */
2372 #define AMAP_BEHAVIOR_ADD       0
2373 #define AMAP_BEHAVIOR_MOVE      1
2374 #define AMAP_BEHAVIOR_IGNORE    2
2375 #endif /* WSM */
2376 
2377 /* colormap focus policy values (colormapFocus): */
2378 #define CMAP_FOCUS_EXPLICIT	0
2379 #define CMAP_FOCUS_POINTER	1
2380 #define CMAP_FOCUS_KEYBOARD	2
2381 
2382 /* keyboard input focus policy values (keyboardFocus): */
2383 #define KEYBOARD_FOCUS_EXPLICIT	0
2384 #define KEYBOARD_FOCUS_POINTER	1
2385 
2386 /* icon appearance values (iconAppearance): */
2387 #define ICON_LABEL_PART			(1L << 0)
2388 #define ICON_IMAGE_PART			(1L << 1)
2389 #define ICON_ACTIVE_LABEL_PART		(1L << 2)
2390 #define USE_ICON_DEFAULT_APPEARANCE	(1L << 3)
2391 #define ICON_APPEARANCE_STANDALONE	(ICON_LABEL_PART | ICON_IMAGE_PART |\
2392 					 ICON_ACTIVE_LABEL_PART)
2393 #define ICON_APPEARANCE_ICONBOX		(ICON_LABEL_PART | ICON_IMAGE_PART)
2394 
2395 /* icon placement values (iconPlacement, ...): */
2396 #define ICON_PLACE_LEFT_PRIMARY		(1L << 0)
2397 #define ICON_PLACE_RIGHT_PRIMARY	(1L << 1)
2398 #define ICON_PLACE_TOP_PRIMARY		(1L << 2)
2399 #define ICON_PLACE_BOTTOM_PRIMARY	(1L << 3)
2400 #define ICON_PLACE_LEFT_SECONDARY	(1L << 4)
2401 #define ICON_PLACE_RIGHT_SECONDARY	(1L << 5)
2402 #define ICON_PLACE_TOP_SECONDARY	(1L << 6)
2403 #define ICON_PLACE_BOTTOM_SECONDARY	(1L << 7)
2404 #define ICON_PLACE_EDGE			(1L << 8)
2405 #define ICON_PLACE_TIGHT		(1L << 9)
2406 #define ICON_PLACE_RESERVE		(1L << 10)
2407 
2408 #define NO_ICON_PLACE			-1
2409 #define MINIMUM_ICON_SPACING		4
2410 #define MAXIMUM_ICON_MARGIN		128
2411 #define ICON_IMAGE_MAX_WIDTH		128
2412 #define ICON_IMAGE_MAX_HEIGHT		128
2413 #define ICON_IMAGE_MIN_WIDTH		16
2414 #define ICON_IMAGE_MIN_HEIGHT		16
2415 
2416 /*default client window title: */
2417 #define DEFAULT_CLIENT_TITLE	"*****"
2418 #define DEFAULT_ICON_TITLE	DEFAULT_CLIENT_TITLE
2419 
2420 /* client decoration parameters */
2421 #define MAXIMUM_FRAME_BORDER_WIDTH	64
2422 
2423 /* configuration action (configAction): */
2424 #define NO_ACTION			0
2425 #define MOVE_CLIENT			1
2426 #define RESIZE_CLIENT			2
2427 #define PLACE_CLIENT			3
2428 #ifdef WSM
2429 #define MARQUEE_SELECT			4
2430 #endif /* WSM */
2431 
2432 /* Motif input bindings file name */
2433 #define MOTIF_BINDINGS_FILE		".motifbind"
2434 
2435 /* Data type definitions */
2436 #define GLOBAL_DATA_TYPE		1001
2437 #define CLIENT_DATA_TYPE		1002
2438 #define SCREEN_DATA_TYPE		1003
2439 #define WORKSPACE_DATA_TYPE		1004
2440 
2441 #ifndef NO_MESSAGE_CATALOG
2442 /*************************************<->*************************************
2443  *
2444  *  NlsStrings
2445  *
2446  *
2447  *  Description:
2448  *  -----------
2449  *  This structure is used to hold message strings that used to
2450  *  be defines
2451  *
2452  *************************************<->***********************************/
2453 
2454 typedef struct _NlsStrings
2455 {
2456     char *default_icon_box_title;
2457     char *builtinSystemMenu;
2458     char *defaultKeyBindings;
2459     char *builtinKeyBindings;
2460     char *defaultButtonBindings;
2461     char *defaultVersionTitle;
2462     char *defaultDtwmHelpTitle;
2463     char *defaultHelpTitle;
2464 } NlsStrings;
2465 
2466 
2467 extern NlsStrings wmNLS;
2468 
2469 #endif
2470 
2471 /* Stacking functions */
2472 #define STACK_NORMAL			0
2473 #define STACK_WITHIN_FAMILY		1
2474 #define STACK_FREE_FAMILY		2
2475 
2476 /* UsePPosition values */
2477 #define USE_PPOSITION_OFF		0
2478 #define USE_PPOSITION_ON		1
2479 #define USE_PPOSITION_NONZERO		2
2480 
2481 /* Largest dimension for special casing */
2482 #define BIGSIZE 32767
2483 
2484 /*
2485  * External references for global data:
2486  */
2487 
2488 extern WmGlobalData	wmGD;
2489 extern char	defaultSystemMenuName[];
2490 extern char	defaultKeyBindings[];
2491 extern char	defaultKeyBindingsName[];
2492 #ifndef NO_MESSAGE_CATALOG
2493 extern char	*builtinSystemMenu;
2494 #else
2495 extern char	builtinSystemMenu[];
2496 #endif
2497 extern char	builtinKeyBindings[];
2498 
2499 extern Const char	_75_foreground[];
2500 extern Const char	_50_foreground[];
2501 extern Const char	_25_foreground[];
2502 
2503 
2504 extern char *_DtGetMessage(char *filename, int set, int n, char *s);
2505 
2506 /*
2507  * macro to get message catalog strings
2508  */
2509 #ifndef NO_MESSAGE_CATALOG
2510 # ifdef __ultrix
2511 #  define _CLIENT_CAT_NAME "dtwm.cat"
2512 # else  /* __ultrix */
2513 #  define _CLIENT_CAT_NAME "dtwm"
2514 # endif /* __ultrix */
2515 # ifdef WSM
2516 #  define GETMESSAGE(set, number, string)\
2517     _DtGetMessage(_CLIENT_CAT_NAME, set, number, string)
2518 # else
2519 #  define GETMESSAGE(set, number, string) (string)
2520 # endif /* WSM */
2521 #else
2522 # define GETMESSAGE(set, number, string)\
2523     string
2524 #endif
2525 #endif /* _WmGlobal_h */
2526