2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
26 * (c) Copyright 1989, 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC.
32 /* $XConsortium: WmGlobal.h /main/16 1996/10/30 11:55:23 drk $ */
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.
40 /* ANSI C definitions, This should be the first thing in WmGlobal.h */
54 #include <X11/Xutil.h>
56 #include <X11/extensions/shape.h>
58 #include <X11/IntrinsicP.h>
59 #include <X11/Intrinsic.h>
60 #include <X11/StringDefs.h>
61 #include <Xm/MwmUtil.h>
64 #include <Xm/ColorObjP.h>
65 #include <Dt/Service.h>
70 #include <Dt/Action.h>
74 #if defined(sun) && defined(ALLPLANES)
75 #include <X11/extensions/allplanes.h>
76 #endif /* defined(sun) && defined(ALLPLANES) */
79 * Value definitions and macros:
82 #ifdef MOTIF_ONE_DOT_ONE
83 #define XmFONTLIST_DEFAULT_TAG "XmSTRING_DEFAULT_CHARSET"
87 extern int WmIdentity;
90 * Color server defines
92 #define CSERVE_NORMAL 0
93 #define CSERVE_NOT_AVAILABLE 1
94 #define CSERVE_FAILURE 2
97 /* window manager name and class used to get resources: */
98 #define WM_RESOURCE_CLASS "Mwm"
99 #define WM_RESOURCE_NAME "mwm"
102 #define DT_WM_RESOURCE_CLASS "Dtwm"
103 #define DT_WM_RESOURCE_NAME "dtwm"
106 extern Pixel FPbackground;
107 extern Pixel FPforeground;
108 extern Pixel FPtopshadow;
109 extern Pixel FPbottomshadow;
110 extern Pixel FPselectcolor;
112 #define USE_ACTIVE_PIXELSET 0
113 #define USE_INACTIVE_PIXELSET 1
114 #define USE_PRIMARY_PIXELSET 2
115 #define USE_SECONDARY_PIXELSET 3
120 #define MwmBehavior (WmIdentity == MWM)
121 #define DtwmBehavior (WmIdentity == DT_MWM)
124 #define MwmBehavior (True)
128 /* ICCC atom names: */
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) */
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"
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"
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"
161 /* automation support */
162 # define _XA_MOTIF_WM_AUTOMATION "_MOTIF_WM_AUTOMATION"
163 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
165 /* window manager exit value on fatal errors: */
166 #define WM_ERROR_EXIT_VALUE 1
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
173 #define FOCUS_SELECT_BUTTON SELECT_BUTTON
174 #define FOCUS_SELECT_MODIFIERS 0
176 /* direct manipulation button */
177 #define DMANIP_BUTTON Button2
178 #define DMANIP_BUTTON_MASK Button2Mask
179 #define DMANIP_BUTTON_MOTION_MASK Button2MotionMask
182 #define BMENU_BUTTON Button3
183 #define BMENU_BUTTON_MASK Button3Mask
185 /* max number of buttons on a mouse */
186 #define NUM_BUTTONS 5
188 /* Needed by PostMenu() to specify key post: */
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)
200 #define MANAGEW_WM_CLIENTS (MANAGEW_ICON_BOX | \
201 MANAGEW_CONFIRM_BOX )
203 #define MANAGEW_WM_CLIENTS (MANAGEW_ICON_BOX | MANAGEW_CONFIRM_BOX)
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)
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)
219 /* feedback box styles */
221 #define FB_SIZE (1L << 0)
222 #define FB_POSITION (1L << 1)
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
230 /* extract text height in pixels from a (XFontStruct *) */
231 #define TEXT_HEIGHT(pfs) (((pfs)->ascent)+((pfs)->descent))
233 /* icon frame shadow widths */
235 #define ICON_EXTERNAL_SHADOW_WIDTH (wmGD.iconExternalShadowWidth)
237 #define ICON_EXTERNAL_SHADOW_WIDTH 2
239 #define ICON_INTERNAL_SHADOW_WIDTH 1
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
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)
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
259 /* number of rectangles to allocate */
260 #define NUM_MATTE_TS_RECTS (6)
261 #define NUM_MATTE_BS_RECTS (6)
263 #define NUM_IMAGE_TOP_RECTS \
264 ((2*ICON_EXTERNAL_SHADOW_WIDTH)+(2*ICON_INTERNAL_SHADOW_WIDTH))
267 #define NUM_IMAGE_BOTTOM_RECTS \
268 ((2*ICON_EXTERNAL_SHADOW_WIDTH)+(2*ICON_INTERNAL_SHADOW_WIDTH))
271 #define NUM_LABEL_TOP_RECTS (2*ICON_EXTERNAL_SHADOW_WIDTH)
272 #define NUM_LABEL_BOTTOM_RECTS (2*ICON_EXTERNAL_SHADOW_WIDTH)
274 #define NUM_BOTH_TOP_RECTS \
275 ((3*ICON_EXTERNAL_SHADOW_WIDTH)+(3*ICON_INTERNAL_SHADOW_WIDTH))
278 #define NUM_BOTH_BOTTOM_RECTS \
279 ((3*ICON_EXTERNAL_SHADOW_WIDTH)+(3*ICON_INTERNAL_SHADOW_WIDTH))
282 #define NUM_STATIC_TOP_RECTS (2*ICON_INTERNAL_SHADOW_WIDTH)
283 #define NUM_STATIC_BOTTOM_RECTS (2*ICON_INTERNAL_SHADOW_WIDTH)
286 /* client frame shadow widths */
288 #define FRAME_EXTERNAL_SHADOW_WIDTH (wmGD.frameExternalShadowWidth)
290 #define FRAME_EXTERNAL_SHADOW_WIDTH 2
292 #define FRAME_INTERNAL_SHADOW_WIDTH 1
293 #define FRAME_CLIENT_SHADOW_WIDTH 1
294 #define FRAME_MATTE_SHADOW_WIDTH 1
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
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)
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
318 #define STRETCH_COUNT 8
322 /* Workspace allocation granularity */
323 #define WS_ALLOC_AMOUNT 8
325 /* Window list allocation granularity */
326 #define WINDOW_ALLOC_AMOUNT 16
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 |\
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 |\
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)
351 #define WM_DECOR_PANEL_DEFAULT WM_DECOR_BORDER
352 #endif /* PANELIST */
354 /* icon box definitions */
355 #define ICON_BOX_FUNCTIONS (MWM_FUNC_RESIZE | MWM_FUNC_MOVE |\
356 MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE)
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|\
363 #endif /* PANELIST */
365 /* workspace controller definitions */
366 #define CONTROL_BOX_FUNCTIONS (MWM_FUNC_MOVE)
368 /* workspace presence definitions */
369 #define PRESENCE_BOX_FUNCTIONS (MWM_FUNC_MOVE)
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)
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 |\
386 #define WM_SHOW_FB_NONE 0
388 #define WM_SHOW_FB_DEFAULT WM_SHOW_FB_ALL
391 /* flags identifying resources to save */
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)
405 /*************************************<->*************************************
407 * Miscellaneous utility window manager data structures ...
412 * These data structures are used in resource processing, ...
414 *************************************<->***********************************/
416 typedef struct _WHSize
424 typedef struct _AspectRatio
432 typedef struct _WmColorData
444 typedef Atom WorkspaceID;
448 /*************************************<->*************************************
450 * Event processing data structures ...
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).
459 *************************************<->***********************************/
461 typedef unsigned long Context;
462 typedef unsigned long Behavior;
463 typedef unsigned long GroupArg;
465 typedef Boolean (*WmFunction) ();
467 #define NO_MODIFIER 0 /* value for state field */
469 typedef struct _KeySpec
475 WmFunction wmFunction;
477 struct _KeySpec *nextKeySpec;
481 typedef struct _ButtonSpec
485 unsigned int eventType;
489 WmFunction wmFunction;
491 struct _ButtonSpec *nextButtonSpec;
497 * Context field values:
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)
507 #define F_CONTEXT_IFKEY (1L << 7)
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)
514 * context field mark for catching menu recursion
515 * (tied to F_CONTEXT_... values):
518 #define CR_MENU_MARK (1L << 5)
522 * Part context defines for event processing. The part context is used
523 * to make a subcontext mask.
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
546 #define FRAME_TITLEBAR 17
549 /* icon part contexts */
550 #define ICON_PART_NONE 0
551 #define ICON_PART_ALL 16
553 /* root part contexts */
554 #define ROOT_PART_NONE 0
555 #define ROOT_PART_ALL 17
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
565 * Subcontext field values:
568 #define F_SUBCONTEXT_NONE (1L << WINDOW_PART_NONE)
570 #define F_SUBCONTEXT_I_ALL (1L << ICON_PART_ALL)
572 #define F_SUBCONTEXT_R_ALL (1L << ROOT_PART_ALL)
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)
579 #define F_SUBCONTEXT_IB_ICONS (F_SUBCONTEXT_IB_IICON |\
580 F_SUBCONTEXT_IB_WICON)
582 #define F_SUBCONTEXT_IB_ALL (F_SUBCONTEXT_IB_IBOX |\
583 F_SUBCONTEXT_IB_IICON |\
584 F_SUBCONTEXT_IB_WICON)
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
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)
615 #define F_SUBCONTEXT_W_BORDER (F_SUBCONTEXT_W_RBORDER |\
616 F_SUBCONTEXT_W_NBORDER)
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)
623 #define F_SUBCONTEXT_W_FRAME (F_SUBCONTEXT_W_BORDER |\
624 F_SUBCONTEXT_W_TITLEBAR)
626 #define F_SUBCONTEXT_W_ALL (F_SUBCONTEXT_W_FRAME |\
627 F_SUBCONTEXT_W_MATTE |\
628 F_SUBCONTEXT_W_CLIENT)
632 * Click / double-click processing data:
635 typedef struct _ClickData
637 Boolean clickPending;
638 Boolean doubleClickPending;
644 unsigned int releaseState;
645 struct _ClientData *pCD;
648 Context clickContext;
649 Context doubleClickContext;
656 * Frame part identification aids:
659 typedef struct _Gadget_Rectangle
668 * Behavior function argument field values:
671 #define F_BEHAVIOR_DEFAULT (1L << 0)
672 #define F_BEHAVIOR_CUSTOM (1L << 1)
673 #define F_BEHAVIOR_SWITCH (1L << 2)
677 * Window/icon group function argument field values:
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)
689 /*************************************<->*************************************
691 * Workspace data structures ...
693 ***************************************************************************/
696 * Specific data for workspacePresence dialog box
699 typedef struct _WsPresenceData
701 XmString title; /* resource */
707 Widget workspaceLabelW;
708 Widget workspaceScrolledListW;
709 Widget workspaceListW;
716 struct _ClientData *pCDforClient;
717 Context contextForClient;
719 Boolean *ItemSelected; /* workspaces in list */
720 XmStringTable ItemStrings; /* workspace names */
723 Boolean userDismissed;
728 #define NUM_WSP_WIDGETS 11
730 typedef struct _WsPresenceData *PtrWsPresenceData;
735 * Specific data for top level help dialog
738 typedef struct _WsDtHelpData
740 XmString title; /* resource */
748 Boolean userDismissed;
750 struct _ClientData *pCDforClient;
753 typedef struct _WsDtHelpData *PtrWsDtHelpData;
754 #endif /* PANELIST */
757 /*************************************<->*************************************
765 *************************************<->***********************************/
767 typedef struct _DtSessionItem
772 String clientMachine;
776 struct _SessionGeom *sessionGeom;
779 typedef struct _SessionGeom
789 * Status of Session Manager Contention Management
791 #define SM_UNITIALIZED 0
792 #define SM_START_ACK 1
793 #define SM_STOP_ACK 2
798 /*************************************<->*************************************
800 * Menu specification data structures ...
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
811 *************************************<->***********************************/
813 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
815 * Used to denote where the separators belong in a pair of separators
816 * used to surround a client command.
819 enum { TOP_SEPARATOR, BOTTOM_SEPARATOR };
822 * Used to denote what kind of change to make to a client command.
824 typedef enum { ENABLE, DISABLE, REMOVE, RENAME } CmdModifier;
825 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
827 typedef struct _MenuItem
831 int labelBitmapIndex;
833 unsigned int accelState;
834 KeyCode accelKeyCode;
836 WmFunction wmFunction;
838 Context greyedContext;
840 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
841 String clientCommandName; /* as specified by the user in
843 CARD32 clientCommandID;
844 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
845 struct _MenuItem *nextMenuItem;
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.
857 #define MWM_MGT_MASK 0x0000FFFF
858 #define DTWM_MGT_MASK 0xFFFF0000
862 typedef struct _MenuButton
870 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
871 typedef struct _MenuExclusion
873 String command_string;
874 struct _MenuExclusion *nextExclusion;
876 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
878 typedef struct _MenuSpec
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 */
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) */
901 struct _MenuSpec *nextMenuSpec;
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;
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;
920 typedef struct _matchlist {
923 String command_string;
927 Context greyed_context;
928 struct _matchlist *next;
931 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
934 /*************************************<->*************************************
936 * Window and function specification data structures ...
942 *************************************<->***********************************/
944 typedef struct _WindowItem
947 struct _WindowItem *nextWindowItem;
951 typedef struct _WindowSet
954 WindowItem *windowItems;
955 struct _WindowSet *nextWindowSet;
959 typedef struct _FunctionItem
961 WmFunction wmFunction;
963 struct _FunctionItem *nextFunctionItem;
967 typedef struct _FunctionSet
970 FunctionItem *functionItems;
971 struct _FunctionSet *nextFunctionSet;
975 /*************************************<->*************************************
977 * Window manager timer data structure ...
982 * This data stucture is used to keep track of window manager timers. Each
983 * active timer has an instance of the data structure.
985 *************************************<->***********************************/
987 typedef struct _WmTimer
989 XtIntervalId timerId;
990 struct _ClientData *timerCD;
991 unsigned int timerType;
992 struct _WmTimer *nextWmTimer;
999 #define TIMER_RAISE 2
1002 /*************************************<->*************************************
1004 * Window manager frame component data structures
1009 * This data stucture is used for drawing frame component graphics.
1011 *************************************<->***********************************/
1013 typedef struct _RList
1015 int allocated; /* number of allocated XRectangles */
1016 int used; /* number currently in use */
1017 XRectangle *prect; /* array of XRectangles */
1023 /*************************************<->*************************************
1025 * Window manager component appearance data structure ...
1030 * This structure is used to hold component appearance data for client,
1031 * icon, and feedback subparts.
1033 *************************************<->***********************************/
1036 typedef struct _AppearanceData
1038 XmFontList fontList; /* resource */
1040 #ifndef NO_MULTIBYTE
1041 unsigned int titleHeight; /* title bar's height */
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;
1066 GC inactiveTopShadowGC;
1067 GC inactiveBottomShadowGC;
1069 GC activeTopShadowGC;
1070 GC activeBottomShadowGC;
1075 typedef struct _AppearanceData *PtrAppearanceData;
1078 /*************************************<->*************************************
1086 *************************************<->***********************************/
1088 typedef struct _IconInfo
1091 struct _ClientData *pCD;
1094 typedef struct _IconInfo *PtrIconInfo;
1098 /*************************************<->*************************************
1106 *************************************<->***********************************/
1108 typedef struct _IconPlacementData
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 */
1122 } IconPlacementData;
1126 /*************************************<->*************************************
1133 * This structure is used to hold window and widget information for
1136 *************************************<->***********************************/
1138 typedef struct _IconBoxData
1142 Widget scrolledWidget;
1145 Widget bBoardWidget;
1153 WorkspaceID wsID; /* workspace identifier */
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 */
1160 typedef struct _IconBoxData *PtrIconBoxData;
1162 #define IB_SPACING 0
1163 #define IB_MARGIN_HEIGHT 3
1164 #define IB_MARGIN_WIDTH 3
1165 #define IB_HIGHLIGHT_BORDER 3
1168 /*************************************<->*************************************
1170 * Bitmap/Pixmap cache data
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
1180 *************************************<->***********************************/
1183 #define LABEL_PIXMAP 1
1184 #define ICON_PIXMAP 2
1186 typedef struct _PixmapCache
1188 unsigned int pixmapType; /* icon or label? */
1192 struct _PixmapCache *next;
1196 typedef struct _BitmapCache
1201 unsigned int height;
1202 PixmapCache *pixmapCache;
1210 /******************************<->*************************************
1212 * Client window list entry data structure ...
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.
1221 ******************************<->***********************************/
1223 typedef struct _ClientListEntry
1225 struct _ClientListEntry *nextSibling;
1226 struct _ClientListEntry *prevSibling;
1228 struct _ClientData *pCD;
1234 /*************************************<->*************************************
1241 * This structure contains geometry information for the window manager
1244 *************************************<->***********************************/
1246 typedef struct _FrameInfo
1251 unsigned int height;
1252 unsigned int upperBorderWidth;
1253 unsigned int lowerBorderWidth;
1254 unsigned int cornerWidth;
1255 unsigned int cornerHeight;
1256 unsigned int titleBarHeight;
1262 /*************************************<->*************************************
1269 * This is the data structure for holding the window manager's
1270 * screen data. There is one instantiation of the structure for
1273 *************************************<->***********************************/
1275 typedef struct _WmScreenData
1278 int screen; /* number for this screen */
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];
1288 Widget wPanelist; /* panel object */
1289 #endif /* PANELIST */
1291 WsPresenceData presence; /* workspace presence dialog*/
1292 Widget switcherW; /* workspace switcher */
1293 Widget switcherShellW; /* shell for ws switcher */
1295 Window wmWorkspaceWin; /* holds wm properties */
1297 Window activeIconTextWin;
1298 Window activeLabelParent;
1299 String displayString; /* used for putenv in F_Exec */
1301 int displayResolutionType;
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 */
1310 /* wm state info: */
1312 unsigned long clientCounter;
1314 Window inputScreenWindow;
1315 struct _ClientData *colormapFocus;
1316 Colormap workspaceColormap;
1317 Colormap lastInstalledColormap;
1318 struct _WmWorkspaceData *pActiveWS; /* for this screen */
1320 struct _WmWorkspaceData *pLastWS; /* previously active WS */
1322 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
1323 CmdTree *cciTree; /* pointer to cci definitions */
1324 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
1326 /* per screen caches */
1327 BitmapCache *bitmapCache;
1328 unsigned int bitmapCacheSize;
1329 unsigned int bitmapCacheCount;
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;
1341 int iconImageHeight;
1342 int iconLabelHeight;
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 */
1356 /* per screen feedback data */
1357 unsigned long fbStyle;
1358 unsigned int fbWinWidth;
1359 unsigned int fbWinHeight;
1360 char fbLocation[20];
1368 unsigned int fbLastWidth;
1369 unsigned int fbLastHeight;
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 */
1382 MenuSpec **acceleratorMenuSpecs;
1383 unsigned int acceleratorMenuCount;
1384 MenuSpec *menuSpecs;
1386 Boolean defaultSystemMenuUseBuiltin;
1388 Pixmap defaultPixmap;
1391 /* per screen appearance resources */
1393 Boolean cleanText; /* resource */
1394 Boolean decoupleTitleAppearance; /* see clientTitleAppearance */
1395 int frameBorderWidth; /* resource */
1396 String feedbackGeometry; /* resource */
1398 String iconBoxGeometry; /* resource */
1400 String iconBoxName; /* resource */
1401 String iconBoxSBDisplayPolicy; /* resource */
1402 int iconBoxScheme; /* resource - testing */
1403 XmString iconBoxTitle; /* resource */
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 */
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 */
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 */
1432 /* client frame component appearance resources and data: */
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;
1442 /* icon component appearance resources and data: */
1444 AppearanceData iconAppearance; /* resources ... */
1446 /* feedback component appearance resources and data: */
1448 AppearanceData feedbackAppearance; /* resources ... */
1450 /* client list pointers: */
1452 ClientListEntry *clientList;
1453 ClientListEntry *lastClient;
1456 /* DtSessionHints for clients */
1457 struct _DtSessionItem *pDtSessionItems;
1458 int totalSessionItems;
1459 int remainingSessionItems;
1462 /* workspace list for this screen */
1463 String initialWorkspace; /* private resource */
1464 String workspaceList; /* resource */
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;
1476 /* workspace for this screen */
1478 struct _WmWorkspaceData *pWS;
1483 typedef struct _WmScreenData *PtrScreenData;
1487 * Convenience macros for data access
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)
1499 #define ICON_DEFAULT_TITLE(pcd) ((pcd)->iconDefaultTitle)
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)
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)
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)
1528 * Definitions for Screen data
1530 #define MAX_WORKSPACE_COUNT 64
1534 /*************************************<->*************************************
1541 * This structure hold information for the workspace background
1543 *************************************<->***********************************/
1545 typedef struct _WmBackdropData
1547 String image; /* resource */
1550 int colorSet; /* resource */
1551 Pixel background; /* resource */
1552 Pixel foreground; /* resource */
1559 * bit definiton for "flags" member of BackdropData
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 */
1566 typedef struct _WmBackdropData *PtrBackdropData;
1568 #define DEFAULT_BACKDROP_DIR CDE_INSTALLATION_TOP "/backdrops"
1572 * direction for slide-out panels
1574 typedef enum _SlideDirection
1576 SLIDE_NOT, SLIDE_NORTH, SLIDE_EAST, SLIDE_SOUTH, SLIDE_WEST
1580 * Slide out record for subpanels
1582 typedef struct _SlideOutRec
1584 struct _ClientData *pCD;
1587 Dimension incHeight;
1588 Dimension currWidth;
1589 Dimension currHeight;
1592 unsigned int interval;
1593 SlideDirection direction;
1599 * Data structure for arguments to f.action
1601 typedef struct _WmActionArg {
1608 #endif /* PANELIST */
1613 /*************************************<->*************************************
1620 * This is the structure for holding the workspace specific data.
1621 * (This has been broken out in anticipation of possible future
1624 *************************************<->***********************************/
1626 typedef struct _WmWorkspaceData
1633 BackdropData backdrop;
1635 XmString title; /* resource (visible name) */
1636 String iconBoxGeometry;/* resource */
1638 String name; /* workspace name */
1639 /* (used for resource fetching) */
1641 WmScreenData *pSD; /* screen data for this workspace */
1642 IconBoxData *pIconBox; /* icon box data for this workspace */
1643 IconPlacementData IPData;
1645 Widget workspaceTopLevelW;
1647 /* workspace state information */
1649 struct _ClientData *keyboardFocus; /* ptr to client with the key focus */
1650 struct _ClientData *nextKeyboardFocus; /* next client to get focus */
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 */
1659 typedef struct _WmWorkspaceData *PtrWorkspaceData;
1663 * Convenience macros for data access
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)
1669 #define CLIENT_DEFAULT_TITLE(pcd) ((pcd)->pSD->clientDefaultTitle)
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)
1683 #define ACTIVE_LABEL_PARENT(pcd) ((pcd)->pSD->activeLabelParent)
1686 #define ICON_BOX_GEOMETRY(pcd) ((pcd)->pSD->iconBoxGeometry)
1688 #define ICON_BOX_TITLE(pcd) ((pcd)->pSD->iconBoxTitle)
1690 #define TRANSIENT_DECORATION(pcd) ((pcd)->pSD->transientDecoration)
1691 #define TRANSIENT_FUNCTIONS(pcd) ((pcd)->pSD->transientFunctions)
1694 /*************************************<->*************************************
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.
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).
1710 *************************************<->***********************************/
1712 typedef struct _ClientData
1714 int dataType; /* client data type */
1719 int clientState; /* WM_HINTS field */
1720 int inputFocusModel; /* WM_HINTS field */
1723 unsigned long clientID;
1726 struct _WmFpEmbeddedClientData *pECD; /* embedded client data */
1727 struct _WmFpPushRecallClientData *pPRCD; /* embedded client data */
1728 #endif /* PANELIST */
1730 Atom * paInitialProperties; /* initial window properties */
1731 int numInitialProperties; /* number of initial properties */
1734 /* client supported protocols: */
1736 Atom *clientProtocols; /* WM_PROTOCOLS */
1737 int clientProtocolCount;
1739 long *mwmMessages; /* _MWM_MESSAGES */
1740 int mwmMessagesCount;
1742 /* client colormap data: */
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? */
1754 /* associated window data: */
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 */
1763 IconBoxData *pIconBox; /* icon box for this win */
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 */
1774 int primaryStackPosition; /* stack pos'n of primary */
1775 Boolean secondariesOnTop; /* resource */
1777 int primaryModalCount; /* primary modal win count */
1778 int fullModalCount; /* full modal win count */
1780 /* client resource data */
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 */
1817 /* client frame data: */
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 */
1828 int maxWidth; /* WM_NORMAL_HINTS field */
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 */
1853 /* client window frame graphic data: */
1855 RList *pclientTopShadows; /* top shadow areas */
1856 RList *pclientBottomShadows; /* bottom shadow areas */
1858 RList *pclientTitleTopShadows; /* top shadow areas */
1859 RList *pclientTitleBottomShadows; /* bottom shadow areas */
1861 RList *pclientMatteTopShadows; /* matte top shadows */
1862 RList *pclientMatteBottomShadows; /* matte bottom shadows */
1864 /* rectangles for client frame gadgets */
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 */
1872 /* client appearance data: */
1874 GC clientMatteTopShadowGC;
1875 GC clientMatteBottomShadowGC;
1876 WmScreenData *pSD; /* where visuals come from */
1881 XmString iconTitle; /* WM_ICON_NAME field */
1883 int iconX; /* WM_HINTS field */
1884 int iconY; /* WM_HINTS field */
1886 Window iconFrameWin;
1888 Pixmap iconPixmap; /* WM_HINTS field */
1889 Pixmap iconMask; /* WM_HINTS field */
1890 Window iconWindow; /* WM_HINTS field */
1892 RList *piconTopShadows; /* these change to */
1893 /* to reflect the */
1894 RList *piconBottomShadows; /* depressed icon image */
1897 /* workspace data */
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 */
1911 SlideDirection slideDirection; /* slide-up direction */
1912 SlideOutRec *pSOR; /* slide-out record */
1913 #endif /* PANELIST */
1916 short wShaped; /* this window has a bounding shape */
1917 #endif /* NO_SHAPE */
1919 int usePPosition; /* indicate whether to use PPosition */
1921 long window_status; /* used for Tear-off Menus */
1925 typedef struct _ClientData *PtrClientData;
1927 /* client data convenience macros */
1929 #define IS_APP_MODALIZED(pcd) \
1930 (((pcd)->primaryModalCount)||((pcd)->fullModalCount))
1932 #define IS_MAXIMIZE_VERTICAL(pcd) \
1933 ((pcd->maximumClientSize.height == BIGSIZE) && \
1934 (pcd->maximumClientSize.width == 0))
1936 #define IS_MAXIMIZE_HORIZONTAL(pcd) \
1937 ((pcd->maximumClientSize.width == BIGSIZE) && \
1938 (pcd->maximumClientSize.height == 0))
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
1946 #define UNSEEN_STATE 8
1949 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
1950 # define NO_CHANGE -1
1953 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
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 */
1971 #define FRONT_PANEL_BOX (1L << 14) /* a DT 3.0 front panel */
1972 #define GOT_DT_WM_HINTS (1L << 15)
1973 #endif /* PANELIST */
1975 #define SM_LAUNCHED (1L << 17) /* launched by dtsession */
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 */
1986 #define CLIENT_WM_CLIENTS (ICON_BOX | CONFIRM_BOX)
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)
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)
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)
2006 #define MAX_CLIENT_PROTOCOL_COUNT 40
2007 #define MAX_COLORMAP_WINDOWS_COUNT 40
2008 #define MAX_MWM_MESSAGES_COUNT 40
2010 /* bevel width limits between window manager frame and client window */
2011 #define MIN_INTERNAL_BEVEL 0
2012 #define MAX_INTERNAL_BEVEL 2
2014 /* global return buffer */
2015 #define MAXWMPATH 1023
2016 #define MAXBUF (MAXWMPATH+1)
2019 /*************************************<->*************************************
2026 * This datum compartmentalizes client data that must be replicated
2027 * on a per workspace basis.
2029 *************************************<->***********************************/
2030 typedef struct _WsClientData
2032 WorkspaceID wsID; /* workspace identifier */
2033 int iconPlace; /* icon placment index */
2036 Window iconFrameWin;
2037 IconBoxData *pIconBox; /* icon box for this win */
2046 typedef enum _FrameStyle
2053 /*************************************<->*************************************
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.
2064 *************************************<->***********************************/
2066 typedef struct _WmGlobalData
2069 char **argv; /* command line argument vector */
2070 char **environ; /* environment vector */
2071 char *mwmName; /* name of our executable */
2074 Widget topLevelW1; /* from which WM components hang */
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 */
2081 XContext cmapWindowContextType; /* list of pCD's in WM_COLORMAP_WINDOWS context for XSaveContext */
2084 XContext mwmWindowContextType; /* mwm win context for XSaveContext */
2085 Window dtSmWindow; /* used for contention management */
2086 Window commandWindow; /* WM_SAVE_YOURSELF win for dtwm */
2089 /* presentation resource id's: */
2091 String displayString; /* used for putenv in F_Exec */
2092 Display *display; /* display we are running to */
2094 Display *display1; /* second display connection */
2095 int statusColorServer; /* CSERVE_NORMAL, CSERVE_NOT_AVAILABLE */
2096 DtWmpParseBuf *pWmPB; /* global parse buffer */
2098 int numScreens; /* number of screens */
2099 unsigned char **screenNames; /* default names for screens */
2100 WmScreenData *Screens; /* array of screen info */
2102 Cursor workspaceCursor; /* basic arrow cursor */
2103 Cursor stretchCursors[STRETCH_COUNT];
2104 Cursor configCursor;
2105 Cursor movePlacementCursor;
2106 Cursor sizePlacementCursor;
2108 #ifndef NO_MESSAGE_CATALOG
2110 XmString cancelLabel;
2115 /* wm state info: */
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 */
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 */
2131 Context grabContext; /* used in GrabWin when no event */
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 */
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 */
2152 /* keyboard focus data: */
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;
2160 /* Resource database used to restore client geometries, etc. */
2161 XrmDatabase clientResourceDB;
2164 String sessionClientDB; /* resource */
2167 /* atoms used in inter-client communication: */
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;
2177 Atom xa_MWM_MESSAGES;
2182 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
2189 /* original set of query targets */
2190 Atom _MOTIF_WM_CLIENT_WINDOW;
2191 Atom _MOTIF_WM_POINTER_WINDOW;
2192 Atom _MOTIF_WM_ALL_CLIENTS ;
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;
2205 /* automation support */
2206 Atom _MOTIF_WM_AUTOMATION;
2207 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
2209 Atom xa_MOTIF_BINDINGS;
2210 Atom xa_COMPOUND_TEXT;
2211 Atom xa_SM_CLIENT_ID;
2212 Atom xa_WMSAVE_HINT;
2217 /* atoms used for workspace management: */
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;
2226 Atom xa_ALL_WORKSPACES;
2227 Atom xa_DT_SESSION_HINTS;
2228 Atom xa_DT_WM_REQUEST;
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;
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;
2247 Atom xa_OL_WT_COMMAND;
2249 Atom xa_OL_WT_NOTICE;
2250 Atom xa_OL_WT_OTHER;
2253 Atom xa_OL_MENU_LIMITED;
2254 Atom xa_OL_MENU_FULL;
2255 #endif /* NO_OL_COMPAT */
2257 /* mwm specific appearance and behavior resources and data: */
2259 Boolean autoKeyFocus; /* resource */
2260 int autoRaiseDelay; /* resource */
2261 String bitmapDirectory; /* resource */
2263 String backdropDirs; /* resource */
2265 Boolean clientAutoPlace; /* resource */
2266 int colormapFocusPolicy; /* resource */
2267 String configFile; /* resource */
2269 String cppCommand; /* resource */
2271 Boolean deiconifyKeyFocus; /* resource */
2272 int doubleClickTime; /* resource */
2273 Boolean enableWarp; /* resource */
2274 Boolean enforceKeyFocus; /* resource */
2275 Boolean freezeOnConfig; /* resource - testing */
2277 Boolean useWindowOutline; /* resource */
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 */
2296 Boolean refreshByClearing; /* resource */
2297 Boolean rootButtonClick; /* resource */
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 */
2307 String helpDirectory; /* resource */
2308 Window requestContextWin; /* for WmRequest f.fcns */
2311 Boolean dtLite; /* resource */
2312 Boolean blinkOnExec; /* resource */
2313 #endif /* MINIMAL_DT */
2315 WmScreenData *dtSD; /* screen for front panel */
2316 int iSlideUpsInProgress;
2317 #endif /*PANELIST */
2318 Boolean waitForClicks; /* resource */
2319 FrameStyle frameStyle; /* resource */
2321 Dimension iconExternalShadowWidth; /* resource */
2322 Dimension frameExternalShadowWidth; /* resource */
2323 int marqueeSelectGranularity; /* resource */
2324 XButtonEvent evLastButton; /* for detecting replayed
2326 Boolean bReplayedButton; /* true if button replayed */
2327 Boolean bSuspendSecondaryRestack; /* overrides transient
2331 XmString clientDefaultTitle;
2332 XmString iconDefaultTitle;
2334 Window attributesWindow;
2335 XWindowAttributes windowAttributes;
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;
2346 unsigned int lockingModMask; /* mask of locking modifier keys */
2347 unsigned int *pLockMaskSequence;
2349 unsigned char tmpBuffer[MAXBUF]; /* replaces static buffers used */
2350 /* for large return values */
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) */
2359 /* quick references to global data: */
2360 #define DISPLAY wmGD.display
2362 #define DISPLAY1 wmGD.display1
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)
2370 #define NOLOCKMOD(state) ((state) & ~wmGD.lockingModMask)
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
2378 /* colormap focus policy values (colormapFocus): */
2379 #define CMAP_FOCUS_EXPLICIT 0
2380 #define CMAP_FOCUS_POINTER 1
2381 #define CMAP_FOCUS_KEYBOARD 2
2383 /* keyboard input focus policy values (keyboardFocus): */
2384 #define KEYBOARD_FOCUS_EXPLICIT 0
2385 #define KEYBOARD_FOCUS_POINTER 1
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)
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)
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
2417 /*default client window title: */
2418 #define DEFAULT_CLIENT_TITLE "*****"
2419 #define DEFAULT_ICON_TITLE DEFAULT_CLIENT_TITLE
2421 /* client decoration parameters */
2422 #define MAXIMUM_FRAME_BORDER_WIDTH 64
2424 /* configuration action (configAction): */
2426 #define MOVE_CLIENT 1
2427 #define RESIZE_CLIENT 2
2428 #define PLACE_CLIENT 3
2430 #define MARQUEE_SELECT 4
2433 /* Motif input bindings file name */
2434 #define MOTIF_BINDINGS_FILE ".motifbind"
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
2442 #ifndef NO_MESSAGE_CATALOG
2443 /*************************************<->*************************************
2450 * This structure is used to hold message strings that used to
2453 *************************************<->***********************************/
2455 typedef struct _NlsStrings
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;
2468 extern NlsStrings wmNLS;
2472 /* Stacking functions */
2473 #define STACK_NORMAL 0
2474 #define STACK_WITHIN_FAMILY 1
2475 #define STACK_FREE_FAMILY 2
2477 /* UsePPosition values */
2478 #define USE_PPOSITION_OFF 0
2479 #define USE_PPOSITION_ON 1
2480 #define USE_PPOSITION_NONZERO 2
2482 /* Largest dimension for special casing */
2483 #define BIGSIZE 32767
2486 * External references for global data:
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;
2496 extern char builtinSystemMenu[];
2498 extern char builtinKeyBindings[];
2500 extern Const char _75_foreground[];
2501 extern Const char _50_foreground[];
2502 extern Const char _25_foreground[];
2505 extern char *_DtGetMessage(char *filename, int set, int n, char *s);
2508 * macro to get message catalog strings
2510 #ifndef NO_MESSAGE_CATALOG
2512 # define _CLIENT_CAT_NAME "dtwm.cat"
2513 # else /* __ultrix */
2514 # define _CLIENT_CAT_NAME "dtwm"
2515 # endif /* __ultrix */
2517 # define GETMESSAGE(set, number, string)\
2518 _DtGetMessage(_CLIENT_CAT_NAME, set, number, string)
2520 # define GETMESSAGE(set, number, string) (string)
2523 # define GETMESSAGE(set, number, string)\
2526 #endif /* _WmGlobal_h */