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