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 libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC.
31 * (c) Copyright 1987, 1988, 1989, 1990, 1993, 1994 HEWLETT-PACKARD COMPANY
32 * (c) Copyright 1993, 1994 International Business Machines Corp.
33 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
34 * (c) Copyright 1993, 1994 Novell, Inc.
42 #include "WmResNames.h"
44 #define MWM_NEED_IIMAGE
45 #include "WmIBitmap.h"
50 #include <Xm/RowColumn.h>
51 #include <Xm/ScreenP.h> /* for XmGetXmScreen and screen.moveOpaque */
54 * include extern functions
56 #include "WmResource.h"
58 #include "WmGraphics.h"
60 #include "WmResParse.h"
61 #include "WmBackdrop.h"
62 #include "WmIconBox.h"
63 #include "WmWrkspace.h"
64 #include <Dt/GetDispRes.h>
65 #define cfileP (wmGD.pWmPB->pFile) /* fopen'ed configuration file or NULL */
69 * Function Declarations:
71 XmColorData *_WmGetDefaultColors ();
73 void _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value);
74 void _WmIconImageFDefault (Widget widget, int offset, XrmValue *value);
75 void _WmIconImageBDefault (Widget widget, int offset, XrmValue *value);
76 void _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value);
77 void _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value);
78 void _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value);
79 void _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value);
80 void _WmMatteFDefault (Widget widget, int offset, XrmValue *value);
81 void _WmMatteBDefault (Widget widget, int offset, XrmValue *value);
82 void _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value);
83 void _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value);
84 void _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value);
85 void _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value);
86 void _WmBackgroundDefault (Widget widget, int offset, XrmValue *value);
87 void _WmForegroundDefault (Widget widget, int offset, XrmValue *value);
88 void _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value);
89 void _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value);
90 void _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value);
91 void _WmABackgroundDefault (Widget widget, int offset, XrmValue *value);
92 void _WmAForegroundDefault (Widget widget, int offset, XrmValue *value);
93 void _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value);
94 void _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value);
95 void _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value);
96 void _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value);
97 void _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value);
98 void _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value);
99 void ProcessWmResources (void);
100 void ProcessGlobalScreenResources (void);
101 void SetStdGlobalResourceValues (void);
102 void ProcessScreenListResource (void);
103 void ProcessAppearanceResources (WmScreenData *pSD);
104 void MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources);
105 void GetAppearanceGCs (WmScreenData *pSD, Pixel fg, Pixel bg, XFontStruct *font, Pixmap bg_pixmap, Pixel ts_color, Pixmap ts_pixmap, Pixel bs_color, Pixmap bs_pixmap, GC *pGC, GC *ptsGC, GC *pbsGC);
106 void ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName);
107 void ProcessWorkspaceResources (WmWorkspaceData *pWS);
108 void ProcessClientResources (ClientData *pCD);
109 void SetStdClientResourceValues (ClientData *pCD);
110 void SetStdScreenResourceValues (WmScreenData *pSD);
111 GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap);
112 static void WriteOutXrmColors (WmScreenData *pSD);
113 void ProcessPresenceResources (WmScreenData *pSD);
114 void ProcessDefaultBackdropImages (WmScreenData *pSD);
115 void _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value);
116 void _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value);
117 void _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value);
118 void _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value);
119 void _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value);
120 int DefaultWsColorSetId (WmWorkspaceData *pWS);
121 void _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value);
122 Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2);
130 /* builtin window menu specification */
132 #ifndef NO_MESSAGE_CATALOG
134 * Use the same name as builtin to let the message catalog menu
135 * take precedence over any menus that might match in sys.mwmrc
137 char defaultSystemMenuName[] = "_MwmWindowMenu_";
139 char defaultSystemMenuName[] = "DefaultWindowMenu";
140 #endif /* NO_MESSAGE_CATALOG */
141 char builtinSystemMenuName[] = "_MwmWindowMenu_";
143 #define BUILTINSYSTEMMENU "_MwmWindowMenu_\n\
145 Restore _R Alt<Key>F5 f.restore\n\
146 Move _M Alt<Key>F7 f.move\n\
147 Size _S Alt<Key>F8 f.resize\n\
148 Minimize _n Alt<Key>F9 f.minimize\n\
149 Maximize _x Alt<Key>F10 f.maximize\n\
150 Lower _L Alt<Key>F3 f.lower\n\
151 no-label f.separator\n\
152 Close _C Alt<Key>F4 f.kill\n\
154 #ifdef NO_MESSAGE_CATALOG
155 char builtinSystemMenu[] = BUILTINSYSTEMMENU;
156 #else /* !defined(NO_MESSAGE_CATALOG)*/
157 char *builtinSystemMenu = BUILTINSYSTEMMENU;
159 #define DEFAULT_DTWM_SYSTEMMENU "_MwmWindowMenu_\n\
161 Restore _R f.restore\n\
164 Minimize _n f.minimize\n\
165 Maximize _x f.maximize\n\
167 no-label f.separator\n\
168 \"Occupy Workspace...\" _O f.workspace_presence\n\
169 \"Occupy All Workspaces\" _A f.occupy_all\n\
170 \"Unoccupy Workspace\" _U f.remove\n\
171 no-label f.separator\n\
172 Close _C Alt<Key>F4 f.kill\n\
175 void InitBuiltinSystemMenu(void)
178 char *ResString = NULL;
179 char *MovString = NULL;
180 char *SizString = NULL;
181 char *MinString = NULL;
182 char *MaxString = NULL;
183 char *LowString = NULL;
184 char *OcpString = NULL;
185 char *OcaString = NULL;
186 char *RemString = NULL;
187 char *CloString = NULL;
189 char dsmtemp[sizeof(dsm)];
195 tmpString = ((char *)GETMESSAGE(62, 60, "Restore _R Alt<Key>F5 f.restore"));
197 tmpString = ((char *)GETMESSAGE(62, 49, "Restore _R f.restore"));
200 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
202 Warning (((char *)GETMESSAGE(62, 2, "Insufficient memory for local default menu.")));
207 strcpy(ResString, tmpString);
213 tmpString = ((char *)GETMESSAGE(62, 61, "Move _M Alt<Key>F7 f.move"));
215 tmpString = ((char *)GETMESSAGE(62, 50, "Move _M f.move"));
218 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
220 Warning (((char *)GETMESSAGE(62, 4, "Insufficient memory for local default menu.")));
225 strcpy(MovString, tmpString);
231 tmpString = ((char *)GETMESSAGE(62, 62, "Size _S Alt<Key>F8 f.resize"));
233 tmpString = ((char *)GETMESSAGE(62, 51, "Size _S f.resize"));
236 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
238 Warning (((char *)GETMESSAGE(62, 6, "Insufficient memory for local default menu.")));
243 strcpy(SizString, tmpString);
249 tmpString = ((char *)GETMESSAGE(62, 63, "Minimize _n Alt<Key>F9 f.minimize"));
251 tmpString = ((char *)GETMESSAGE(62, 52, "Minimize _n f.minimize"));
254 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
256 Warning (((char *)GETMESSAGE(62, 8, "Insufficient memory for local default menu.")));
261 strcpy(MinString, tmpString);
267 tmpString = ((char *)GETMESSAGE(62, 64, "Maximize _x Alt<Key>F10 f.maximize"));
269 tmpString = ((char *)GETMESSAGE(62, 53, "Maximize _x f.maximize"));
272 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
274 Warning (((char *)GETMESSAGE(62, 10, "Insufficient memory for local default menu.")));
279 strcpy(MaxString, tmpString);
285 tmpString = ((char *)GETMESSAGE(62, 65, "Lower _L Alt<Key>F3 f.lower"));
287 tmpString = ((char *)GETMESSAGE(62, 54, "Lower _L f.lower"));
290 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
292 Warning (((char *)GETMESSAGE(62, 12, "Insufficient memory for local default menu.")));
297 strcpy(LowString, tmpString);
305 tmpString = ((char *)GETMESSAGE(62, 55, "Occupy\\ Workspace\\.\\.\\. _O f.workspace_presence"));
307 (char *)XtMalloc ((unsigned int)
308 (strlen(tmpString) + 1))) == NULL)
310 Warning (((char *)GETMESSAGE(62, 14, "Insufficient memory for local default menu.")));
315 strcpy(OcpString, tmpString);
320 tmpString = ((char *)GETMESSAGE(62, 56, "Occupy\\ All\\ Workspaces _A f.occupy_all"));
322 (char *)XtMalloc ((unsigned int)
323 (strlen(tmpString) + 1))) == NULL)
325 Warning (((char *)GETMESSAGE(62, 16, "Insufficient memory for local default menu.")));
330 strcpy(OcaString, tmpString);
335 tmpString = ((char *)GETMESSAGE(62, 57, "Unoccupy\\ Workspace _U f.remove"));
337 (char *)XtMalloc ((unsigned int)
338 (strlen(tmpString) + 1))) == NULL)
340 Warning (((char *)GETMESSAGE(62, 18, "Insufficient memory for local default menu.")));
345 strcpy(RemString, tmpString);
352 tmpString = ((char *)GETMESSAGE(62, 48, "Close _C Alt<Key>F4 f.kill"));
354 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
356 Warning (((char *)GETMESSAGE(62, 20, "Insufficient memory for local default menu.")));
361 strcpy(CloString, tmpString);
369 builtinSystemMenu = (char *)
370 XtNewString((String)DEFAULT_DTWM_SYSTEMMENU);
374 builtinSystemMenu = (char *)
375 XtNewString((String)BUILTINSYSTEMMENU);
380 /* put it together */
381 snprintf(dsm, sizeof(dsm), "%s\n{\n%s\n%s\n%s\n%s\n%s\n%s\n no-label f.separator\n",
382 defaultSystemMenuName, ResString, MovString,
383 SizString, MinString, MaxString, LowString);
386 snprintf(dsmtemp, sizeof(dsmtemp), "%s%s\n%s\n%s\n no-label f.separator\n",
387 dsm, OcpString, OcaString, RemString);
388 strcpy(dsm, dsmtemp);
390 snprintf(dsmtemp, sizeof(dsmtemp), "%s%s\n}", dsm, CloString);
391 strcpy(dsm, dsmtemp);
393 if ((builtinSystemMenu =
394 (char *)XtMalloc ((unsigned int) (strlen(dsm) + 1))) == NULL)
396 Warning (((char *)GETMESSAGE(62, 21, "Insufficient memory for localized default system menu")));
399 builtinSystemMenu = (char *)
400 XtNewString((String)DEFAULT_DTWM_SYSTEMMENU);
404 builtinSystemMenu = (char *)
405 XtNewString((String)BUILTINSYSTEMMENU);
410 strcpy(builtinSystemMenu, dsm);
414 if (ResString != NULL)
416 if (MovString != NULL)
418 if (SizString != NULL)
420 if (MinString != NULL)
422 if (MaxString != NULL)
424 if (LowString != NULL)
426 if (OcpString != NULL)
428 if (OcaString != NULL)
430 if (RemString != NULL)
432 if (CloString != NULL)
435 } /* END OF FUNCTION InitBuiltinSystemMenu */
436 #endif /* NO_MESSAGE_CATALOG */
438 char builtinSystemMenu[];
441 #define HARD_CODED_PRIMARY 3
442 char defaultRootMenuName[] = "DefaultRootMenu";
443 char builtinRootMenuName[] = "_MwmRootMenu_";
445 #define BUILTINROOTMENU "DefaultRootMenu\n\
447 \"Root Menu\" f.title\n\
448 \"New Window\" f.exec \"xterm &\"\n\
449 \"Shuffle Up\" f.circle_up\n\
450 \"Shuffle Down\" f.circle_down\n\
451 \"Refresh\" f.refresh\n\
452 \"Pack Icons\" f.pack_icons\n\
453 no-label f.separator\n\
454 \"Restart...\" f.restart\n\
456 char builtinRootMenu[] = BUILTINROOTMENU
458 char builtinRootMenu[];
462 /* builtin key bindings specification */
464 char defaultKeyBindingsName[] = "DefaultKeyBindings";
465 char builtinKeyBindingsName[] = "_MwmKeyBindings_";
467 #define BUILTINKEYBINDINGS "_MwmKeyBindings_\n\
469 Shift<Key>Escape window|icon f.post_wmenu\n\
470 Alt<Key>space window|icon f.post_wmenu\n\
471 Alt<Key>Tab root|icon|window f.next_key\n\
472 Alt Shift<Key>Tab root|icon|window f.prev_key\n\
473 Alt<Key>Escape root|icon|window f.circle_down\n\
474 Alt Shift<Key>Escape root|icon|window f.circle_up\n\
475 Alt Shift Ctrl<Key>exclam root|icon|window f.set_behavior\n\
476 Alt Ctrl<Key>1 root|icon|window f.set_behavior\n\
477 Alt<Key>F6 window f.next_key transient\n\
478 Alt Shift<Key>F6 window f.prev_key transient\n\
479 Shift<Key>F10 icon f.post_wmenu\n\
481 char builtinKeyBindings[] = BUILTINKEYBINDINGS
484 char builtinKeyBindings[];
488 * NOTE: Default Toggle Behavior key bindings. There are TWO key bindings as
489 * of 1.1.4 and 1.2. Make sure you make any modify builtinKeyBindings (above)
490 * whenever modifying behaviorKeyBindings.
493 char behaviorKeyBindingName[] = "_MwmBehaviorKey_";
495 #define BEHAVIORKEYBINDINGS "_MwmBehaviorKey_\n\
497 Alt Shift Ctrl<Key>exclam root|icon|window f.set_behavior\n\
498 Alt Ctrl<Key>1 root|icon|window f.set_behavior\n\
500 char behaviorKeyBindings[] = BEHAVIORKEYBINDINGS
503 char behaviorKeyBindings[];
507 /* default button bindings specification */
508 /* note - the %s will be replaced by the real DefaultRootMenu */
510 char defaultButtonBindingsName[] = "DefaultButtonBindings";
511 char builtinButtonBindingsName[] = "_MwmButtonBindings_";
513 # define BUILTINBUTTONBINDINGS "_MwmButtonBindings_\n\
515 <Btn1Down> icon|frame f.raise\n\
516 <Btn3Down> icon|frame f.post_wmenu\n\
517 <Btn3Down> root f.menu DefaultRootMenu\n\
519 char builtinButtonBindings[] = BUILTINBUTTONBINDINGS
522 char builtinButtonBindings[];
526 static ClientData *_pCD;
527 static String _defaultBackground;
528 static String _defaultActiveBackground;
529 static AppearanceData *_pAppearanceData;
530 static WmWorkspaceData *pResWS;
531 static WmScreenData *pResSD;
533 static char _defaultColor1HEX[] = "#A8A8A8A8A8A8";
534 static char _defaultColor2HEX[] = "#5F5F92929E9E";
536 static char _defaultColor1[] = "LightGrey";
537 static char _defaultColor2[] = "CadetBlue";
538 #define DEFAULT_COLOR_NONE NULL
540 Const char _foreground[] = "foreground";
541 Const char _75_foreground[] = "75_foreground";
542 Const char _50_foreground[] = "50_foreground";
543 Const char _25_foreground[] = "25_foreground";
544 Const char *_Dither = XmCO_DITHER;
545 Const char *_NoDither = XmCO_NO_DITHER;
546 Const char CLIENT_FRAME_PART[] = "client";
547 Const char ICON_FRAME_PART[] = "icon";
548 Const char FEEDBACK_FRAME_PART[] = "feedback";
549 Const char MENU_ITEM_PART[] = "menu";
551 #define WmBGC XmBACKGROUND
552 #define WmFGC XmFOREGROUND
553 #define WmTSC XmTOP_SHADOW
554 #define WmBSC XmBOTTOM_SHADOW
556 #define MAX_SHORT 0xffff
559 #define BITMAPDIR "/usr/include/X11/bitmaps/"
563 /*************************************<->*************************************
570 * This data structure is used in the processing of mwm general
571 * appearance and behavior resources. These resources are specified
572 * with the following syntax:
574 * "Mwm*<resource_identifier>".
576 *************************************<->***********************************/
579 XtResource wmGlobalResources[] =
587 XtOffsetOf(WmGlobalData, autoKeyFocus),
597 XtOffsetOf(WmGlobalData, autoRaiseDelay),
607 XtOffsetOf(WmGlobalData, bitmapDirectory),
616 XtOffsetOf(WmGlobalData, blinkOnExec),
625 XtOffsetOf(WmGlobalData, frameStyle),
627 (XtPointer)WmRECESSED
635 XtOffsetOf(WmGlobalData, clientAutoPlace),
641 WmNcolormapFocusPolicy,
642 WmCColormapFocusPolicy,
645 XtOffsetOf(WmGlobalData, colormapFocusPolicy),
647 (XtPointer)CMAP_FOCUS_KEYBOARD
655 XtOffsetOf(WmGlobalData, configFile),
665 XtOffsetOf(WmGlobalData, cppCommand),
671 WmNdeiconifyKeyFocus,
672 WmCDeiconifyKeyFocus,
675 XtOffsetOf(WmGlobalData, deiconifyKeyFocus),
685 XtOffsetOf(WmGlobalData, doubleClickTime),
687 (XtPointer)_WmMultiClickTimeDefault
695 XtOffsetOf(WmGlobalData, enableWarp),
705 XtOffsetOf(WmGlobalData, enforceKeyFocus),
711 WmNframeExternalShadowWidth,
712 WmCFrameExternalShadowWidth,
715 XtOffsetOf(WmGlobalData, frameExternalShadowWidth),
725 XtOffsetOf(WmGlobalData, freezeOnConfig),
735 XtOffsetOf(WmGlobalData, useWindowOutline),
745 XtOffsetOf(WmGlobalData, iconAutoPlace),
751 WmNiconExternalShadowWidth,
752 WmCIconExternalShadowWidth,
755 XtOffsetOf(WmGlobalData, iconExternalShadowWidth),
765 XtOffsetOf(WmGlobalData, iconClick),
771 WmNinteractivePlacement,
772 WmCInteractivePlacement,
775 XtOffsetOf(WmGlobalData, interactivePlacement),
781 WmNkeyboardFocusPolicy,
782 WmCKeyboardFocusPolicy,
785 XtOffsetOf(WmGlobalData, keyboardFocusPolicy),
788 (XtPointer)KEYBOARD_FOCUS_POINTER
790 (XtPointer)KEYBOARD_FOCUS_EXPLICIT
799 XtOffsetOf(WmGlobalData, lowerOnIconify),
805 WmNmarqueeSelectGranularity,
806 WmCMarqueeSelectGranularity,
809 XtOffsetOf(WmGlobalData, marqueeSelectGranularity),
819 XtOffsetOf(WmGlobalData, moveThreshold),
829 XtOffsetOf(WmGlobalData, passButtons),
839 XtOffsetOf(WmGlobalData, passSelectButton),
849 XtOffsetOf(WmGlobalData, positionIsFrame),
859 XtOffsetOf(WmGlobalData, positionOnScreen),
869 XtOffsetOf(WmGlobalData, quitTimeout),
879 XtOffsetOf(WmGlobalData, raiseKeyFocus),
885 WmNrefreshByClearing,
886 WmCRefreshByClearing,
889 XtOffsetOf(WmGlobalData, refreshByClearing),
899 XtOffsetOf(WmGlobalData, rootButtonClick),
909 XtOffsetOf(WmGlobalData, showFeedback),
911 (XtPointer)(WM_SHOW_FB_DEFAULT)
919 XtOffsetOf(WmGlobalData, startupKeyFocus),
925 WmNsystemButtonClick,
926 WmCSystemButtonClick,
929 XtOffsetOf(WmGlobalData, systemButtonClick),
935 WmNsystemButtonClick2,
936 WmCSystemButtonClick2,
939 XtOffsetOf(WmGlobalData, systemButtonClick2),
948 XtOffsetOf(WmGlobalData, useFrontPanel),
958 XtOffsetOf(WmGlobalData, helpDirectory),
960 (XtPointer)"DT/Dtwm/"
968 XtOffsetOf(WmGlobalData, dtLite),
972 }; /* END OF wmGlobalResources[] */
976 * These determine the screens to manage at startup.
977 * These are broken out to enhance startup performance.
979 XtResource wmGlobalScreenResources[] =
986 XtOffsetOf(WmGlobalData, multiScreen),
996 XtOffsetOf(WmGlobalData, screenList),
1001 { WmNbackdropDirectories,
1002 WmCBackdropDirectories,
1005 XtOffsetOf(WmGlobalData, backdropDirs),
1007 DEFAULT_BACKDROP_DIR
1013 /******************************<->*************************************
1015 * wmStdGlobalResources
1020 * This data structure is used in the processing of mwm general appearance
1021 * and behavior resources that are not automatically set for the standard
1022 * (default) behavior. These resources are specified with the following
1025 * "Mwm*<resource_identifier>".
1027 ******************************<->***********************************/
1029 XtResource wmStdGlobalResources[] =
1037 XtOffsetOf(WmGlobalData, bitmapDirectory),
1039 (XtPointer)BITMAPDIR
1047 XtOffsetOf(WmGlobalData, configFile),
1056 sizeof (FrameStyle),
1057 XtOffsetOf(WmGlobalData, frameStyle),
1059 (XtPointer)WmRECESSED
1067 XtOffsetOf(WmGlobalData, iconAutoPlace),
1077 XtOffsetOf(WmGlobalData, moveThreshold),
1087 XtOffsetOf(WmGlobalData, positionIsFrame),
1093 WmNpositionOnScreen,
1094 WmCPositionOnScreen,
1097 XtOffsetOf(WmGlobalData, positionOnScreen),
1107 XtOffsetOf(WmGlobalData, quitTimeout),
1117 XtOffsetOf(WmGlobalData, showFeedback),
1119 (XtPointer)(WM_SHOW_FB_DEFAULT)
1125 /******************************<->*************************************
1132 * This data structure is used in the processing of mwm screen specific
1133 * appearance and behavior resources. These resources are specified
1134 * with the following syntax:
1136 * "Mwm*screen<#>*<resource_identifier>".
1138 ******************************<->***********************************/
1140 XtResource wmScreenResources[] =
1147 XtOffsetOf (WmScreenData, buttonBindings),
1149 (XtPointer)defaultButtonBindingsName
1157 XtOffsetOf (WmScreenData, cleanText),
1163 WmNfeedbackGeometry,
1164 WmCFeedbackGeometry,
1167 XtOffsetOf (WmScreenData, feedbackGeometry),
1177 XtOffsetOf (WmScreenData, fadeNormalIcon),
1187 XtOffsetOf (WmScreenData, iconDecoration),
1189 (XtPointer)USE_ICON_DEFAULT_APPEARANCE
1193 WmNiconImageMaximum,
1194 WmCIconImageMaximum,
1197 XtOffsetOf (WmScreenData, iconImageMaximum),
1199 (XtPointer) _WmIconImageMaximumDefault
1203 WmNiconImageMinimum,
1204 WmCIconImageMinimum,
1207 XtOffsetOf (WmScreenData, iconImageMinimum),
1217 XtOffsetOf (WmScreenData, iconPlacement),
1219 (XtPointer)(ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY)
1223 WmNiconPlacementMargin,
1224 WmCIconPlacementMargin,
1227 XtOffsetOf (WmScreenData, iconPlacementMargin),
1237 XtOffsetOf (WmScreenData, keyBindings),
1239 (XtPointer)defaultKeyBindingsName
1243 WmNframeBorderWidth,
1244 WmCFrameBorderWidth,
1247 XtOffsetOf (WmScreenData, frameBorderWidth),
1257 XtOffsetOf (WmScreenData, iconBoxName),
1259 (XtPointer)"iconbox"
1263 WmNiconBoxSBDisplayPolicy,
1264 WmCIconBoxSBDisplayPolicy,
1267 XtOffsetOf (WmScreenData, iconBoxSBDisplayPolicy),
1277 XtOffsetOf (WmScreenData, iconBoxScheme),
1287 XtOffsetOf (WmScreenData, iconBoxTitle),
1297 XtOffsetOf (WmScreenData, limitResize),
1303 WmNmaximumMaximumSize,
1304 WmCMaximumMaximumSize,
1307 XtOffsetOf (WmScreenData, maximumMaximumSize),
1313 WmNresizeBorderWidth,
1314 WmCFrameBorderWidth,
1317 XtOffsetOf (WmScreenData, resizeBorderWidth),
1327 XtOffsetOf (WmScreenData, resizeCursors),
1333 WmNtransientDecoration,
1334 WmCTransientDecoration,
1337 XtOffsetOf (WmScreenData, transientDecoration),
1339 (XtPointer)(WM_DECOR_SYSTEM | WM_DECOR_RESIZEH)
1343 WmNtransientFunctions,
1344 WmCTransientFunctions,
1347 XtOffsetOf (WmScreenData, transientFunctions),
1349 (XtPointer)(WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE))
1353 WmNsubpanelDecoration,
1354 WmCSubpanelDecoration,
1357 XtOffsetOf (WmScreenData, subpanelDecoration),
1359 (XtPointer)(WM_DECOR_SYSTEM)
1363 WmNsubpanelResources,
1364 WmCSubpanelResources,
1367 XtOffsetOf (WmScreenData, subpanelResources),
1377 XtOffsetOf (WmScreenData, useIconBox),
1387 XtOffsetOf (WmScreenData, moveOpaque),
1398 XtOffsetOf (WmScreenData, helpResources),
1404 WmNinitialWorkspace,
1405 WmCInitialWorkspace,
1408 XtOffsetOf (WmScreenData, initialWorkspace),
1418 XtOffsetOf (WmScreenData, workspaceList),
1428 XtOffsetOf (WmScreenData, numWorkspaces),
1436 /******************************<->*************************************
1438 * wmStdScreenResources
1443 * This data structure is used in the processing of mwm screen specific
1444 * appearance and behavior resources that are not automatically set for
1445 * the standard (default) behavior. These resources are specified with
1446 * the following syntax:
1448 * "Mwm*screen<#>*<resource_identifier>".
1450 ******************************<->***********************************/
1452 XtResource wmStdScreenResources[] =
1455 WmNframeBorderWidth,
1456 WmCFrameBorderWidth,
1459 XtOffsetOf (WmScreenData, frameBorderWidth),
1465 WmNiconImageMaximum,
1466 WmCIconImageMaximum,
1469 XtOffsetOf (WmScreenData, iconImageMaximum),
1471 (XtPointer) _WmIconImageMaximumDefault
1475 WmNiconImageMinimum,
1476 WmCIconImageMinimum,
1479 XtOffsetOf (WmScreenData, iconImageMinimum),
1485 WmNiconPlacementMargin,
1486 WmCIconPlacementMargin,
1489 XtOffsetOf (WmScreenData, iconPlacementMargin),
1495 WmNmaximumMaximumSize,
1496 WmCMaximumMaximumSize,
1499 XtOffsetOf (WmScreenData, maximumMaximumSize),
1505 WmNresizeBorderWidth,
1506 WmCFrameBorderWidth,
1509 XtOffsetOf (WmScreenData, resizeBorderWidth),
1517 /******************************<->*************************************
1519 * wmWorkspaceResources
1524 * This data structure is used in the processing of mwm workspace
1525 * specific appearance and behavior resources. These resources are
1526 * specified with the following syntax:
1528 * "Mwm*[screen<#>*]<workspace>*<resource_identifier>".
1530 ******************************<->***********************************/
1531 XtResource wmWorkspaceResources[] =
1538 XtOffsetOf (WmWorkspaceData, iconBoxGeometry),
1548 XtOffsetOf (WmWorkspaceData, title),
1557 /******************************<->*************************************
1559 * wmStdWorkspaceResources
1564 * This data structure is used in the processing of mwm workspace specific
1565 * appearance and behavior resources that are not automatically set for
1566 * the standard (default) behavior. These resources are specified with
1567 * the following syntax:
1569 * "Mwm*[screen<#>*]<workspace>*<resource_identifier>".
1571 *************************************<->***********************************/
1573 XtResource wmStdWorkspaceResources[] =
1580 XtOffsetOf (WmWorkspaceData, title),
1587 /*************************************<->*************************************
1589 * wmBackdropResources
1594 * This data structure is used in the processing of workspace specific
1595 * resources that apply to the backdrop.
1597 * These resources are specified with the following syntax:
1599 * "Mwm*[screen*][workspace*]backdrop*<resource_id>:"
1601 * NOTE: The order of these resources is important for correct
1602 * dynamic processing!!!!
1604 *************************************<->***********************************/
1606 XtResource wmBackdropResources[] =
1613 XtOffsetOf (BackdropData, colorSet),
1615 (XtPointer) _WmBackdropColorSetDefault
1623 XtOffsetOf (BackdropData, background),
1625 (XtPointer) _WmBackdropBgDefault
1633 XtOffsetOf (BackdropData, foreground),
1635 (XtPointer) _WmBackdropFgDefault
1643 XtOffsetOf (BackdropData, image),
1651 /*************************************<->*************************************
1653 * wmWsPresenceResources
1658 * This data structure is used in the processing of specific
1659 * resources that apply to the WorkspacePresence dialog.
1661 * These resources are specified with the following syntax:
1663 * "Mwm*[screen*][workspace*]workspacePresence*<resource_id>:"
1665 *************************************<->***********************************/
1667 XtResource wmWsPresenceResources[] =
1674 XtOffsetOf (WsPresenceData, title),
1680 /*************************************<->*************************************
1687 * This data structure is used in the processing of client specific
1688 * window manager resources. These resources are specified with the
1691 * "Mwm*<client_name_or_class>*<resource_identifier>"
1693 *************************************<->***********************************/
1695 XtResource wmClientResources[] =
1699 WmNabsentMapBehavior,
1700 WmCAbsentMapBehavior,
1701 WmRAbsentMapBehavior,
1703 XtOffsetOf (ClientData, absentMapBehavior),
1705 (XtPointer)(AMAP_BEHAVIOR_ADD)
1709 WmNclientDecoration,
1710 WmCClientDecoration,
1713 XtOffsetOf (ClientData, clientDecoration),
1715 (XtPointer)(WM_DECOR_DEFAULT)
1723 XtOffsetOf (ClientData, clientFunctions),
1725 (XtPointer)(WM_FUNC_DEFAULT)
1733 XtOffsetOf (ClientData, focusAutoRaise),
1735 (XtPointer)_WmFocusAutoRaiseDefault
1743 XtOffsetOf (ClientData, iconImage),
1749 WmNiconImageBackground,
1750 WmCIconImageBackground,
1753 XtOffsetOf (ClientData, iconImageBackground),
1755 (XtPointer)_WmIconImageBDefault
1759 WmNiconImageForeground,
1760 WmCIconImageForeground,
1763 XtOffsetOf (ClientData, iconImageForeground),
1765 (XtPointer)_WmIconImageFDefault
1769 WmNiconImageBottomShadowColor,
1770 WmCIconImageBottomShadowColor,
1773 XtOffsetOf (ClientData, iconImageBottomShadowColor),
1775 (XtPointer)_WmIconImageBSCDefault
1779 WmNiconImageBottomShadowPixmap,
1780 WmCIconImageBottomShadowPixmap,
1783 XtOffsetOf (ClientData, iconImageBottomShadowPStr),
1785 (XtPointer)_WmIconImageBSPDefault
1789 WmNiconImageTopShadowColor,
1790 WmCIconImageTopShadowColor,
1793 XtOffsetOf (ClientData, iconImageTopShadowColor),
1795 (XtPointer)_WmIconImageTSCDefault
1799 WmNiconImageTopShadowPixmap,
1800 WmCIconImageTopShadowPixmap,
1803 XtOffsetOf (ClientData, iconImageTopShadowPStr),
1805 (XtPointer)_WmIconImageTSPDefault
1809 WmNignoreWMSaveHints,
1810 WmCIgnoreWMSaveHints,
1813 XtOffsetOf (ClientData, ignoreWMSaveHints),
1823 XtOffsetOf (ClientData, matteWidth),
1829 WmNmaximumClientSize,
1830 WmCMaximumClientSize,
1833 XtOffsetOf (ClientData, maximumClientSize),
1839 WmNsecondariesOnTop,
1840 WmCSecondariesOnTop,
1843 XtOffsetOf (ClientData, secondariesOnTop),
1845 (XtPointer)_WmSecondariesOnTopDefault
1853 XtOffsetOf (ClientData, systemMenu),
1855 (XtPointer)defaultSystemMenuName
1863 XtOffsetOf (ClientData, useClientIcon),
1873 XtOffsetOf (ClientData, usePPosition),
1875 (XtPointer)(USE_PPOSITION_NONZERO)
1878 }; /* END OF STRUCTURE wmClientResources */
1882 /*************************************<->*************************************
1884 * wmStdClientResources
1889 * This data structure is used in the processing of client specific
1890 * window manager resources that are not automatically set for the standard
1891 * (default) behavior. These resources are specified with the
1894 * "Mwm*<client_name_or_class>*<resource_identifier>"
1896 *************************************<->***********************************/
1898 XtResource wmStdClientResources[] =
1906 XtOffsetOf (ClientData, iconImage),
1912 WmNiconImageBackground,
1913 WmCIconImageBackground,
1916 XtOffsetOf (ClientData, iconImageBackground),
1918 (XtPointer)_WmIconImageBDefault
1922 WmNiconImageForeground,
1923 WmCIconImageForeground,
1926 XtOffsetOf (ClientData, iconImageForeground),
1928 (XtPointer)_WmIconImageFDefault
1932 WmNiconImageBottomShadowColor,
1933 WmCIconImageBottomShadowColor,
1936 XtOffsetOf (ClientData, iconImageBottomShadowColor),
1938 (XtPointer)_WmIconImageBSCDefault
1942 WmNiconImageBottomShadowPixmap,
1943 WmCIconImageBottomShadowPixmap,
1946 XtOffsetOf (ClientData, iconImageBottomShadowPStr),
1948 (XtPointer)_WmIconImageBSPDefault
1952 WmNiconImageTopShadowColor,
1953 WmCIconImageTopShadowColor,
1956 XtOffsetOf (ClientData, iconImageTopShadowColor),
1958 (XtPointer)_WmIconImageTSCDefault
1962 WmNiconImageTopShadowPixmap,
1963 WmCIconImageTopShadowPixmap,
1966 XtOffsetOf (ClientData, iconImageTopShadowPStr),
1968 (XtPointer)_WmIconImageTSPDefault
1976 XtOffsetOf (ClientData, matteWidth),
1982 WmNmaximumClientSize,
1983 WmCMaximumClientSize,
1986 XtOffsetOf (ClientData, maximumClientSize),
1992 WmNsecondariesOnTop,
1993 WmCSecondariesOnTop,
1996 XtOffsetOf (ClientData, secondariesOnTop),
1998 (XtPointer)_WmSecondariesOnTopDefault
2006 XtOffsetOf (ClientData, useClientIcon),
2014 /*************************************<->*************************************
2016 * wmClientResourcesM
2021 * This data structure is used in the processing of client specific
2022 * window manager resources that affect the appearance of the client
2023 * matte. These resources are specified with the following syntax:
2025 * "Mwm*<client_name_or_class>*<resource_identifier>"
2027 *************************************<->***********************************/
2029 XtResource wmClientResourcesM[] =
2036 XtOffsetOf (ClientData, matteBackground),
2038 (XtPointer)_WmMatteBDefault
2046 XtOffsetOf (ClientData, matteForeground),
2048 (XtPointer)_WmMatteFDefault
2052 WmNmatteBottomShadowColor,
2053 WmCMatteBottomShadowColor,
2056 XtOffsetOf (ClientData, matteBottomShadowColor),
2058 (XtPointer)_WmMatteBSCDefault
2062 WmNmatteBottomShadowPixmap,
2063 WmCMatteBottomShadowPixmap,
2066 XtOffsetOf (ClientData, matteBottomShadowPStr),
2068 (XtPointer)_WmMatteBSPDefault
2072 WmNmatteTopShadowColor,
2073 WmCMatteTopShadowColor,
2076 XtOffsetOf (ClientData, matteTopShadowColor),
2078 (XtPointer)_WmMatteTSCDefault
2082 WmNmatteTopShadowPixmap,
2083 WmCMatteTopShadowPixmap,
2086 XtOffsetOf (ClientData, matteTopShadowPStr),
2088 (XtPointer)_WmMatteTSPDefault
2094 /*************************************<->*************************************
2096 * wmAppearanceResources
2101 * This data structure is used in the processing of component appearance
2102 * resources. These resources are specified with the following syntax:
2104 * "Mwm*<resource_identifier>"
2105 * "Mwm*client*<resource_identifier>"
2106 * "Mwm*icon*<resource_identifier>"
2107 * "Mwm*feedback*<resource_identifier>"
2109 *************************************<->***********************************/
2111 XtResource wmAppearanceResources[] =
2118 sizeof (XmFontList),
2119 XtOffsetOf (AppearanceData, fontList),
2129 XtOffsetOf (AppearanceData, saveUnder),
2139 XtOffsetOf (AppearanceData, background),
2141 (XtPointer)_WmBackgroundDefault
2149 XtOffsetOf (AppearanceData, foreground),
2151 (XtPointer)_WmForegroundDefault
2155 XmNbottomShadowColor,
2159 XtOffsetOf (AppearanceData, bottomShadowColor),
2161 (XtPointer)_WmBottomShadowColorDefault
2165 XmNbottomShadowPixmap,
2166 XmCBottomShadowPixmap,
2169 XtOffsetOf (AppearanceData, bottomShadowPStr),
2179 XtOffsetOf (AppearanceData, topShadowColor),
2181 (XtPointer)_WmTopShadowColorDefault
2185 XmNbackgroundPixmap,
2186 XmCBackgroundPixmap,
2189 XtOffsetOf (AppearanceData, backgroundPStr),
2191 (XtPointer)_WmBackgroundPixmapDefault
2199 XtOffsetOf (AppearanceData, topShadowPStr),
2201 (XtPointer)_WmTopShadowPixmapDefault
2205 WmNactiveBackground,
2209 XtOffsetOf (AppearanceData, activeBackground),
2211 (XtPointer)_WmABackgroundDefault
2215 WmNactiveForeground,
2219 XtOffsetOf (AppearanceData, activeForeground),
2221 (XtPointer)_WmAForegroundDefault
2225 WmNactiveBottomShadowColor,
2229 XtOffsetOf (AppearanceData, activeBottomShadowColor),
2231 (XtPointer)_WmABottomShadowColorDefault
2235 WmNactiveBottomShadowPixmap,
2236 XmCBottomShadowPixmap,
2239 XtOffsetOf (AppearanceData, activeBottomShadowPStr),
2245 WmNactiveTopShadowColor,
2249 XtOffsetOf (AppearanceData, activeTopShadowColor),
2251 (XtPointer)_WmATopShadowColorDefault
2255 WmNactiveBackgroundPixmap,
2256 XmCBackgroundPixmap,
2259 XtOffsetOf (AppearanceData, activeBackgroundPStr),
2261 (XtPointer)_WmABackgroundPixmapDefault
2265 WmNactiveTopShadowPixmap,
2269 XtOffsetOf (AppearanceData, activeTopShadowPStr),
2271 (XtPointer)_WmATopShadowPixmapDefault
2278 /*************************************<->*************************************
2280 * _WmIconImageFDefault (widget, offset, value)
2281 * _WmIconImageBDefault (widget, offset, value)
2282 * _WmIconImageBSCDefault (widget, offset, value)
2283 * _WmIconImageBSPDefault (widget, offset, value)
2284 * _WmIconImageTSCDefault (widget, offset, value)
2285 * _WmIconImageTSPDefault (widget, offset, value)
2286 * _WmMatteFDefault (widget, offset, value)
2287 * _WmMatteBDefault (widget, offset, value)
2288 * _WmMatteBSCDefault (widget, offset, value)
2289 * _WmMatteBSPDefault (widget, offset, value)
2290 * _WmMatteTSCDefault (widget, offset, value)
2291 * _WmMatteTSPDefault (widget, offset, value)
2296 * These functions are used to generate dynamic defaults for various
2297 * client-specific appearance related resources.
2302 * widget = this is the parent widget for the wm subpart
2304 * offset = this is the resource offset
2306 * value = this is a pointer to a XrmValue in which to store the result
2308 * _pCD = (static global) pointer to client data associated with resources
2313 * value = default resource value and size
2315 *************************************<->***********************************/
2318 _WmIconImageFDefault (Widget widget, int offset, XrmValue *value)
2320 _WmGetDynamicDefault (widget, WmFGC, 0,
2321 _pCD->iconImageBackground, value);
2323 } /* END OF FUNCTION _WmIconImageFDefault */
2326 _WmIconImageBDefault (Widget widget, int offset, XrmValue *value)
2328 value->addr = (char *)&(_pCD->pSD->iconAppearance.background);
2329 value->size = sizeof (Pixel);
2331 } /* END OF FUNCTION _WmIconImageBDefault */
2335 _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value)
2337 _WmGetDynamicDefault (widget, WmBSC, 0,
2338 _pCD->iconImageBackground, value);
2340 } /* END OF FUNCTION _WmIconImageBSCDefault */
2344 _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value)
2347 value->addr = (char *)_pCD->pSD->iconAppearance.bottomShadowPStr;
2348 value->size = sizeof (String);
2350 } /* END OF FUNCTION _WmIconImageBSCDefault */
2354 _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value)
2356 _WmGetDynamicDefault (widget, WmTSC, 0,
2357 _pCD->iconImageBackground, value);
2359 } /* END OF FUNCTION _WmIconImageTSCDefault */
2363 _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value)
2366 value->addr = (char *)_pCD->pSD->iconAppearance.topShadowPStr;
2367 value->size = sizeof (String);
2369 } /* END OF FUNCTION _WmIconImageTSPDefault */
2373 _WmMatteFDefault (Widget widget, int offset, XrmValue *value)
2375 _WmGetDynamicDefault (widget, WmFGC, 0,
2376 _pCD->matteBackground, value);
2378 } /* END OF FUNCTION _WmMatteFDefault */
2382 _WmMatteBDefault (Widget widget, int offset, XrmValue *value)
2384 value->addr = (char *)&(_pCD->pSD->clientAppearance.background);
2385 value->size = sizeof (Pixel);
2387 } /* END OF FUNCTION _WmMatteBDefault */
2391 _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value)
2393 _WmGetDynamicDefault (widget, WmBSC, 0,
2394 _pCD->matteBackground, value);
2396 } /* END OF FUNCTION _WmMatteBSCDefault */
2400 _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value)
2403 value->addr = (char *)_pCD->pSD->clientAppearance.bottomShadowPStr;
2404 value->size = sizeof (String);
2406 } /* END OF FUNCTION _WmMatteBSCDefault */
2410 _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value)
2412 _WmGetDynamicDefault (widget, WmTSC, 0,
2413 _pCD->matteBackground, value);
2415 } /* END OF FUNCTION _WmMatteTSCDefault */
2419 _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value)
2422 value->addr = (char *)_pCD->pSD->clientAppearance.topShadowPStr;
2423 value->size = sizeof (String);
2425 } /* END OF FUNCTION _WmMatteTSCDefault */
2429 /*************************************<->*************************************
2431 * _WmBackgroundDefault (widget, offset, value)
2432 * _WmForegroundDefault (widget, offset, value)
2433 * _WmBackgroundPixmapDefault (widget, offset, value)
2434 * _WmBottomShadowColorDefault (widget, offset, value)
2435 * _WmTopShadowColorDefault (widget, offset, value)
2436 * _WmTopShadowPixmapDefault (widget, offset, value)
2437 * _WmABackgroundDefault (widget, offset, value)
2438 * _WmAForegroundDefault (widget, offset, value)
2439 * _WmABackgroundPixmapDefault (widget, offset, value)
2440 * _WmABottomShadowColorDefault (widget, offset, value)
2441 * _WmRFBackgroundDefault (widget, offset, value)
2442 * _WmRFForegroundDefault (widget, offset, value)
2443 * _WmATopShadowColorDefault (widget, offset, value)
2444 * _WmATopShadowPixmapDefault (widget, offset, value)
2449 * These functions are used to generate dynamic defaults for various
2450 * component appearance related resources (not client-specific).
2455 * widget = this is the parent widget for the wm subpart
2457 * offset = this is the resource offset
2459 * value = this is a pointer to a XrmValue in which to store the result
2461 * _defaultBackground = (static global) default background color (inactive)
2463 * _defaultActiveBackground = (static global) default bg color (active)
2465 * _pAppearanceData = (static global) pointer to resouce set structure
2470 * value = default resource value and size
2472 *************************************<->***********************************/
2475 _WmBackgroundDefault (Widget widget, int offset, XrmValue *value)
2477 _WmGetDynamicDefault (widget, WmBGC, _defaultBackground, 0, value);
2479 } /* END OF FUNCTION _WmBackgroundDefault */
2483 _WmForegroundDefault (Widget widget, int offset, XrmValue *value)
2485 _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->background,
2488 } /* END OF FUNCTION _WmForegroundDefault */
2492 _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value)
2494 static String string;
2497 if ((Monochrome (XtScreen (widget))) ||
2498 (_pAppearanceData->topShadowColor == _pAppearanceData->background))
2500 string = (String) _25_foreground;
2507 value->addr = (char *)string;
2508 value->size = sizeof (String);
2510 } /* END OF FUNCTION _WmBackgroundPixmapDefault */
2514 _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value)
2516 _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->background,
2519 } /* END OF FUNCTION _WmBottomShadowColorDefault */
2523 _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value)
2525 _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->background,
2528 } /* END OF FUNCTION _WmTopShadowColorDefault */
2532 _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value)
2534 static String string;
2537 if ((Monochrome (XtScreen (widget))) ||
2538 (_pAppearanceData->topShadowColor == _pAppearanceData->background))
2540 /* Fix monochrome 3D appearance */
2541 string = (String) _50_foreground;
2542 if (_pAppearanceData->backgroundPStr != NULL)
2543 if (!strcmp(_pAppearanceData->backgroundPStr, _25_foreground) ||
2544 !strcmp(_pAppearanceData->backgroundPStr, _50_foreground))
2546 string = (String) _foreground;
2554 value->addr = (char *)string;
2555 value->size = sizeof (String);
2557 } /* END OF FUNCTION _WmTopShadowPixmapDefault */
2561 _WmABackgroundDefault (Widget widget, int offset, XrmValue *value)
2563 _WmGetDynamicDefault (widget, WmBGC, _defaultActiveBackground, 0, value);
2565 } /* END OF FUNCTION _WmABackgroundDefault */
2569 _WmAForegroundDefault (Widget widget, int offset, XrmValue *value)
2571 _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->activeBackground,
2574 } /* END OF FUNCTION _WmAForegroundDefault */
2577 _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value)
2579 static String string;
2582 if ((Monochrome (XtScreen (widget))) ||
2583 (_pAppearanceData->activeTopShadowColor ==
2584 _pAppearanceData->activeBackground))
2586 string = (String) _50_foreground;
2593 value->addr = (char *)string;
2594 value->size = sizeof (String);
2596 } /* END OF FUNCTION _WmABackgroundPixmapDefault */
2599 _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value)
2601 _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->activeBackground,
2604 } /* END OF FUNCTION _WmABottomShadowColorDefault */
2608 _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value)
2610 _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->activeBackground,
2613 } /* END OF FUNCTION _WmATopShadowColorDefault */
2617 _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value)
2619 static String string;
2621 if ((Monochrome (XtScreen (widget))) ||
2622 (_pAppearanceData->activeTopShadowColor ==
2623 _pAppearanceData->activeBackground))
2625 /* Fix monochrome 3D appearance */
2626 string = (String) _50_foreground;
2627 if (_pAppearanceData->activeBackgroundPStr != NULL)
2629 (_pAppearanceData->activeBackgroundPStr, _25_foreground) ||
2631 (_pAppearanceData->activeBackgroundPStr, _50_foreground))
2633 string = (String) _foreground;
2641 value->addr = (char *)string;
2642 value->size = sizeof (String);
2644 } /* END OF FUNCTION _WmATopShadowPixmapDefault */
2648 _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value)
2650 static Pixel pixValue;
2651 unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet;
2653 if (wmGD.statusColorServer == CSERVE_NORMAL)
2655 if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS))
2657 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2660 switch (pResWS->pSD->colorUse)
2662 case XmCO_BLACK_WHITE:
2663 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg;
2667 case XmCO_LOW_COLOR:
2668 case XmCO_MEDIUM_COLOR:
2669 case XmCO_HIGH_COLOR:
2670 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bs;
2677 * Color server is unavailable. Has user specified a colorset?
2679 * If not, go monochrome.
2682 pixValue = WhitePixel (DISPLAY, pResWS->pSD->screen);
2685 /* return the dynamic default */
2687 value->addr = (char *) &pixValue;
2688 value->size = sizeof (Pixel);
2690 } /* END OF FUNCTION _WmBackdropBgDefault */
2693 _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value)
2695 static Pixel pixValue;
2696 unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet;
2698 if (wmGD.statusColorServer == CSERVE_NORMAL)
2700 if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS))
2702 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2705 switch (pResWS->pSD->colorUse)
2707 case XmCO_BLACK_WHITE:
2708 pixValue = pResWS->pSD->pPixelData[colorSetId-1].fg;
2712 case XmCO_LOW_COLOR:
2713 case XmCO_MEDIUM_COLOR:
2714 case XmCO_HIGH_COLOR:
2715 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg;
2722 * Color server is unavailable. Has user specified a colorset?
2724 * If not, go monochrome.
2727 pixValue = BlackPixel (DISPLAY, pResWS->pSD->screen);
2729 value->addr = (char *) &pixValue;
2730 value->size = sizeof (Pixel);
2732 } /* END OF FUNCTION _WmBackdropFgDefault */
2735 _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value)
2737 static unsigned int colorSetId;
2739 if (wmGD.statusColorServer == CSERVE_NORMAL)
2741 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2745 colorSetId = 0; /* invalid color set */
2748 value->addr = (char *) &colorSetId;
2749 value->size = sizeof (Pixel);
2751 } /* END OF FUNCTION _WmBackdropColorSetIdDefault */
2754 _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value)
2758 if ((pResSD->displayResolutionType == LOW_RES_DISPLAY) ||
2759 (pResSD->displayResolutionType == VGA_RES_DISPLAY))
2770 value->addr = (char *) &cval;
2771 value->size = sizeof (WHSize);
2773 } /* END OF FUNCTION _WmIconImageMaximumDefault */
2776 /*************************************<->*************************************
2778 * DefaultWsColorSetId (pWS)
2783 * This function returns the default colorSetId for a given workspace
2788 * pWS = ptr to workspace data
2792 * return = default color set ID.
2794 * "active" and "inactive" color sets are not used.
2796 *************************************<->***********************************/
2799 DefaultWsColorSetId (WmWorkspaceData *pWS)
2801 static int _ws_high_color_map[] = { 3, 5, 6, 7 };
2802 #define _WS_HIGH_COLOR_COUNT 4
2812 iIndex = (int) ((unsigned long)(pWS) -
2813 (unsigned long)(pSD->pWS))/sizeof(WmWorkspaceData);
2815 iIndex = 0; /* bad pWS or pSD, shouldn't get here */
2817 switch (pSD->colorUse)
2819 case XmCO_BLACK_WHITE:
2820 case XmCO_LOW_COLOR:
2822 (pSD->pInactivePixelSet-pSD->pPixelData)/sizeof(XmPixelSet);
2825 case XmCO_MEDIUM_COLOR:
2826 rval = HARD_CODED_PRIMARY;
2829 case XmCO_HIGH_COLOR:
2830 i = iIndex % _WS_HIGH_COLOR_COUNT;
2831 rval = _ws_high_color_map[i];
2838 } /* END OF FUNCTION DefaultWsColorSetId */
2843 /*************************************<->*************************************
2845 * _WmFocusAutoRaiseDefault (widget, offset, value)
2850 * This function generates a default value for the focusAutoRaise resource.
2855 * widget = this is the parent widget for the wm subpart
2857 * offset = this is the resource offset
2859 * value = this is a pointer to a XrmValue in which to store the result
2864 * value = default resource value and size
2866 *************************************<->***********************************/
2869 _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value)
2871 static Boolean focusAutoRaise;
2873 if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)
2875 focusAutoRaise = True;
2879 focusAutoRaise = False;
2882 value->addr = (char *)&focusAutoRaise;
2883 value->size = sizeof (Boolean);
2885 } /* END OF FUNCTION _WmFocusAutoRaiseDefault */
2888 /*************************************<->*************************************
2890 * _WmMultiClickTimeDefault (widget, offset, value)
2895 * This function generates a default value for the doubleClickTime resource.
2896 * We dynamically default to the XtR4 multiClickTime value.
2900 * widget = this is the parent widget for the wm subpart
2902 * offset = this is the resource offset
2904 * value = this is a pointer to a XrmValue in which to store the result
2908 * value = default resource value and size
2910 *************************************<->***********************************/
2913 _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value)
2915 static int multiClickTime;
2917 multiClickTime = XtGetMultiClickTime(XtDisplay(widget));
2919 value->addr = (char *)&multiClickTime;
2920 value->size = sizeof (int);
2922 } /* END OF FUNCTION _WmMultiClickTimeDefault */
2925 /*************************************<->*************************************
2927 * _WmSecondariesOnTopDefault (widget, offset, value)
2932 * This function generates a default value for the secondariesOnTop
2937 * widget = this is the parent widget for the wm subpart
2939 * offset = this is the resource offset
2941 * value = this is a pointer to a XrmValue in which to store the result
2945 * value = default resource value and size
2947 *************************************<->***********************************/
2950 _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value)
2952 static Boolean secondariesOnTop;
2955 * Inherit setting from primary window if this window is
2959 if (_pCD->transientLeader != NULL)
2960 secondariesOnTop = _pCD->transientLeader->secondariesOnTop;
2962 secondariesOnTop = True;
2964 value->addr = (char *)&secondariesOnTop;
2965 value->size = sizeof (Boolean);
2967 } /* END OF FUNCTION _WmSecondariesOnTopDefault */
2971 /******************************<->*************************************
2973 * ProcessWmResources ()
2978 * This function is used to retrieve and process window manager resources
2979 * that are not client-specific.
2984 * wmGlobalResources = pointer to wm resource list
2989 * wmGD = (global data filled out with resource values)
2991 *************************************<->***********************************/
2994 ProcessWmResources (void)
2998 * Process the mwm general appearance and behavior resources. Retrieve
2999 * a limited set of resource values if the window manager is starting
3000 * up with the standard behavior.
3003 if (wmGD.useStandardBehavior)
3005 XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD,
3006 wmStdGlobalResources, XtNumber (wmStdGlobalResources), NULL, 0);
3009 * Fill in the standard resource values.
3012 SetStdGlobalResourceValues ();
3016 XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD,
3017 wmGlobalResources, XtNumber (wmGlobalResources), NULL, 0);
3020 if (wmGD.autoRaiseDelay < 0)
3022 wmGD.autoRaiseDelay = 500;
3023 Warning (((char *)GETMESSAGE(62, 66, "Out of range autoRaiseDelay resource value. Must be non-negative")));
3026 } /* END OF FUNCTION ProcessWmResources */
3030 /******************************<->*************************************
3032 * ProcessGlobalScreenResources ()
3037 * This function is used to retrieve window manager resources to
3038 * determine the screens to manage.
3043 * wmGlobalScreenResources = pointer to wm resource list
3048 * wmGD = (global data filled out with resource values)
3050 *************************************<->***********************************/
3053 ProcessGlobalScreenResources (void)
3055 XtGetApplicationResources (wmGD.topLevelW, &wmGD,
3056 wmGlobalScreenResources,
3057 XtNumber (wmGlobalScreenResources), NULL, 0);
3059 if (wmGD.multiScreen)
3061 wmGD.numScreens = ScreenCount(DISPLAY);
3065 wmGD.numScreens = 1;
3068 if (wmGD.screenList != NULL)
3070 ProcessScreenListResource();
3076 /*************************************<->*************************************
3078 * SetStdGlobalResourceValues ()
3083 * This function sets resource data to standard values. This setting
3084 * is done in place of getting the values from the user settings in
3085 * the resource database.
3090 * wmGD = (global data filled out with resource values)
3092 *************************************<->***********************************/
3095 SetStdGlobalResourceValues (void)
3097 wmGD.autoKeyFocus = True;
3098 wmGD.clientAutoPlace = True;
3099 wmGD.colormapFocusPolicy = CMAP_FOCUS_KEYBOARD;
3100 wmGD.deiconifyKeyFocus = True;
3101 wmGD.doubleClickTime = 500;
3102 wmGD.freezeOnConfig = True;
3103 wmGD.iconAutoPlace = True;
3104 wmGD.iconClick = True;
3105 wmGD.interactivePlacement = False;
3106 wmGD.keyboardFocusPolicy = KEYBOARD_FOCUS_EXPLICIT;
3107 wmGD.lowerOnIconify = True;
3108 wmGD.passSelectButton = True;
3109 wmGD.startupKeyFocus = True;
3110 wmGD.systemButtonClick = True;
3111 wmGD.systemButtonClick2 = True;
3112 wmGD.useFrontPanel=False;
3114 } /* END OF FUNCTION SetStdGlobalResourceValues */
3118 /*************************************<->*************************************
3120 * ProcessScreenListResource ()
3125 * This processes the names in the screenList resource.
3130 * wmGlobalResources = pointer to wmGD.screenList
3137 *************************************<->***********************************/
3140 ProcessScreenListResource (void)
3142 unsigned char *lineP;
3143 unsigned char *string;
3147 lineP = (unsigned char *)wmGD.screenList;
3152 while (((string = GetString(&lineP)) != NULL) &&
3153 (sNum < ScreenCount(DISPLAY)))
3155 if (!(wmGD.screenNames[sNum] = (unsigned char *)
3156 WmRealloc ((char*)wmGD.screenNames[sNum], strlen((char*)string)+1)))
3158 ExitWM(WM_ERROR_EXIT_VALUE);
3162 strcpy((char *)wmGD.screenNames[sNum], (char *)string);
3169 * If the number of listed screens (sNum) is < screen count, fill in the
3170 * remaining screen names with the name of the first screen specified,
3175 string = wmGD.screenNames[0]; /* name of the first screen */
3176 while (sNum < ScreenCount(DISPLAY))
3178 if (!(wmGD.screenNames[sNum] = (unsigned char *)
3179 WmRealloc ((char*)wmGD.screenNames[sNum],
3180 strlen((char *)string)+1)))
3182 ExitWM(WM_ERROR_EXIT_VALUE);
3186 strcpy((char *)wmGD.screenNames[sNum], (char *)string);
3193 } /* END OF FUNCTION ProcessScreenListResource */
3196 /******************************<->*************************************
3198 * ProcessWmColors ()
3203 * Retrieve the color sets from the colorserver.
3211 * modifies parts of global pixel sets
3216 ******************************<->***********************************/
3219 ProcessWmColors (WmScreenData *pSD)
3221 short active, inactive, primary, secondary;
3223 if ((pSD->pPixelData = (XmPixelSet *)
3224 XtMalloc (XmCO_NUM_COLORS * sizeof(XmPixelSet))))
3229 * ASSUMPTION: If XmeGetPixelData() returns true,
3230 * we have a good color server at our disposal.
3234 if (XmeGetPixelData (pSD->screen, &pSD->colorUse,
3235 pSD->pPixelData, &active, &inactive,
3236 &primary, &secondary))
3238 pSD->pActivePixelSet = &(pSD->pPixelData[active]);
3239 pSD->pInactivePixelSet = &(pSD->pPixelData[inactive]);
3240 pSD->pPrimaryPixelSet = &(pSD->pPixelData[primary]);
3241 pSD->pSecondaryPixelSet = &(pSD->pPixelData[secondary]);
3243 /* Hack here. The index "4" is the proper array reference. */
3244 /* This is used because XmGetPixelData has not been properly */
3247 pSD->pTextPixelSet = &(pSD->pPixelData[3]);
3249 wmGD.statusColorServer = CSERVE_NORMAL;
3254 XtFree((char *)pSD->pPixelData);
3255 pSD->pPixelData = NULL;
3256 pSD->pActivePixelSet = NULL;
3257 pSD->pInactivePixelSet = NULL;
3258 pSD->pPrimaryPixelSet = NULL;
3259 pSD->pSecondaryPixelSet = NULL;
3260 pSD->pTextPixelSet = NULL;
3265 Warning (((char *)GETMESSAGE(62, 22, "Insufficient memory for color data")));
3266 ExitWM (WM_ERROR_EXIT_VALUE);
3269 } /* END OF FUNCTION ProcessWmColors */
3272 /******************************<->*************************************
3274 * WriteOutXrmColors ()
3279 * Update the XRM database with pixel values from the color server.
3283 * pSD = contains pixel sets
3287 * updated resource database
3291 * N.B. Must change to write out data on a PER-SCREEN basis.
3292 * e.g., "Dtwm*0*background"
3293 ******************************<->***********************************/
3296 WriteOutXrmColors (WmScreenData *pSD)
3300 int thisScreen = pSD->screen;
3301 XmPixelSet *tpixset;
3302 XmPixelSet *spixset;
3309 res_class = WM_RESOURCE_CLASS;
3313 res_class = DT_WM_RESOURCE_CLASS;
3316 screen_name = (String) wmGD.screenNames[pSD->screen];
3318 db = XtScreenDatabase(XScreenOfDisplay(DISPLAY, thisScreen));
3320 /** update the clients database with new colors **/
3321 value.size = sizeof(Pixel);
3325 * WM ACTIVE RESOURCES--e.g., for the active frame
3328 if (pSD->pActivePixelSet)
3330 tpixset = pSD->pActivePixelSet;
3331 spixset = pSD->pSecondaryPixelSet;
3333 if (pSD->colorUse == XmCO_BLACK_WHITE)
3337 * Limit ourselves here to the client (frame)
3342 /* activeForeground */
3343 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3345 XrmPutResource (&db,
3346 ResCat (res_class, screen_name, WmNactiveForeground,
3347 NULL), XtRPixel, &value);
3349 /* activeBackground */
3350 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3352 XrmPutResource (&db,
3353 ResCat (res_class, screen_name, WmNactiveBackground,
3354 NULL), XtRPixel, &value);
3356 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3357 WmNactiveBackgroundPixmap, NULL),
3360 /* activeTopShadow */
3361 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3362 WmNactiveTopShadowPixmap, NULL),
3365 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3366 XrmPutResource (&db,
3367 ResCat (res_class, screen_name, WmNactiveTopShadowColor,
3368 NULL), XtRPixel, &value);
3370 /* activeBottomShadow */
3371 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3372 XrmPutResource (&db,
3373 ResCat (res_class, screen_name,
3374 WmNactiveBottomShadowColor, NULL), XtRPixel, &value);
3376 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3377 WmNactiveBottomShadowPixmap, NULL),
3381 else /* active colors for non-BW systems */
3383 value.addr = (XtPointer) &(tpixset->bg);
3384 XrmPutResource (&db,
3385 ResCat (res_class, screen_name, WmNactiveBackground, NULL),
3388 value.addr = (XtPointer) &(tpixset->fg);
3389 XrmPutResource (&db,
3390 ResCat (res_class, screen_name, WmNactiveForeground, NULL),
3393 value.addr = (XtPointer) &(tpixset->ts);
3394 XrmPutResource (&db,
3395 ResCat (res_class, screen_name, WmNactiveTopShadowColor, NULL),
3398 value.addr = (XtPointer) &(tpixset->bs);
3399 XrmPutResource (&db,
3400 ResCat (res_class, screen_name, WmNactiveBottomShadowColor, NULL),
3403 if (XmCO_DitherTopShadow(DISPLAY, thisScreen, tpixset))
3405 XrmPutStringResource (&db,
3406 ResCat (res_class, screen_name, WmNactiveTopShadowPixmap, NULL),
3411 if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, tpixset))
3413 XrmPutStringResource (&db,
3414 ResCat (res_class, screen_name, WmNactiveBottomShadowPixmap,
3423 * WM INACTIVE colors--e.g., for dialogues
3426 if (pSD->pInactivePixelSet)
3428 tpixset = pSD->pInactivePixelSet;
3429 spixset = pSD->pSecondaryPixelSet;
3431 if (pSD->colorUse == XmCO_BLACK_WHITE)
3436 * Set colors/pixmaps for the frames--leave the
3437 * menus out of it so that their text won't look
3438 * unsatisfactory against a dithered background.
3443 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3445 XrmPutResource (&db,
3446 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3447 WmNforeground), XtRPixel, &value);
3449 XrmPutResource (&db,
3450 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3451 WmNforeground), XtRPixel, &value);
3455 XrmPutStringResource (&db,
3456 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3457 WmNbackgroundPixmap), _Dither);
3459 XrmPutStringResource (&db,
3460 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3461 WmNbackgroundPixmap), _Dither);
3463 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3464 XrmPutResource (&db,
3465 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3466 WmNbackground), XtRPixel, &value);
3468 XrmPutResource (&db,
3469 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3470 WmNbackground), XtRPixel, &value);
3473 XrmPutStringResource (&db,
3474 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3475 WmNtopShadowPixmap), _foreground);
3477 XrmPutStringResource (&db,
3478 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3479 WmNtopShadowPixmap), _foreground);
3481 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3482 XrmPutResource (&db,
3483 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3484 WmNtopShadowColor), XtRPixel, &value);
3486 XrmPutResource (&db,
3487 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3488 WmNtopShadowColor), XtRPixel, &value);
3492 XrmPutStringResource (&db,
3493 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3494 WmNbottomShadowPixmap), _foreground);
3496 XrmPutStringResource (&db,
3497 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3498 WmNbottomShadowPixmap), _foreground);
3500 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3502 XrmPutResource (&db,
3503 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3504 WmNbottomShadowColor), XtRPixel, &value);
3506 XrmPutResource (&db,
3507 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3508 WmNbottomShadowColor), XtRPixel, &value);
3512 * Ensure that the icon images have a black foreground and
3513 * a white background.
3516 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3518 XrmPutResource (&db,
3519 ResCat (res_class, screen_name, WmNiconImageForeground,
3520 NULL), XtRPixel, &value);
3522 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3524 XrmPutResource (&db,
3525 ResCat (res_class, screen_name, WmNiconImageBackground,
3526 NULL), XtRPixel, &value);
3528 /* Now deal with XmCO_BLACK_WHITE Menus */
3530 /* XmCO_BLACK_WHITE menu foreground */
3531 value.addr = (XtPointer) &(tpixset->fg);
3533 XrmPutResource (&db,
3534 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3535 WmNforeground), XtRPixel, &value);
3537 /* XmCO_BLACK_WHITE menu background */
3538 value.addr = (XtPointer) &(tpixset->bg);
3540 XrmPutResource (&db,
3541 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3542 WmNbackground), XtRPixel, &value);
3544 /* XmCO_BLACK_WHITE menu top shadow */
3546 XrmPutStringResource (&db,
3547 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3548 WmNtopShadowPixmap), _50_foreground);
3550 /* use foreground color for this pixmap */
3551 value.addr = (XtPointer) &(tpixset->fg);
3553 XrmPutResource (&db,
3554 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3555 WmNtopShadowColor), XtRPixel, &value);
3557 /* XmCO_BLACK_WHITE menu bottom shadow */
3559 XrmPutStringResource (&db,
3560 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3561 WmNbottomShadowPixmap), _75_foreground);
3563 /* use foreground color for this pixmap */
3564 value.addr = (XtPointer) &(tpixset->fg);
3566 XrmPutResource (&db,
3567 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3568 WmNbottomShadowColor), XtRPixel, &value);
3570 /* Finally, deal with XmCO_BLACK_WHITE Confirm Boxes */
3572 /* XmCO_BLACK_WHITE confirm box foreground */
3573 value.addr = (XtPointer) &(spixset->fg);
3575 XrmPutResource (&db,
3576 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3577 WmNforeground), XtRPixel, &value);
3579 /* XmCO_BLACK_WHITE confirm box background */
3580 value.addr = (XtPointer) &(spixset->bg);
3582 XrmPutResource (&db,
3583 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3584 WmNbackground), XtRPixel, &value);
3586 /* XmCO_BLACK_WHITE confirm box top shadow */
3588 XrmPutStringResource (&db,
3589 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3590 WmNtopShadowPixmap), _50_foreground);
3592 /* use foreground color */
3593 value.addr = (XtPointer) &(spixset->fg);
3595 XrmPutResource (&db,
3596 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3597 WmNtopShadowColor), XtRPixel, &value);
3599 /* XmCO_BLACK_WHITE confirm box bottom shadow */
3601 XrmPutStringResource (&db,
3602 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3603 WmNbottomShadowPixmap), _75_foreground);
3605 /* use foreground color */
3606 value.addr = (XtPointer) &(spixset->fg);
3608 XrmPutResource (&db,
3609 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3610 WmNbottomShadowColor), XtRPixel, &value);
3612 /* use select color for icon box trough color */
3614 value.addr = (XtPointer) &(tpixset->sc);
3616 XrmPutResource (&db,
3617 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3618 XmNtroughColor), XtRPixel, &value);
3620 /* use select color for arm and select colors in dialogs */
3622 value.addr = (XtPointer) &(spixset->sc);
3624 XrmPutResource (&db,
3625 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3626 XmNarmColor), XtRPixel, &value);
3628 XrmPutResource (&db,
3629 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3630 XmNselectColor), XtRPixel, &value);
3632 XrmPutResource (&db,
3633 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3634 XmNtroughColor), XtRPixel, &value);
3636 else /* inactive colors for non-BW systems */
3638 XmPixelSet *fpixset;
3641 * Set mwm component colors
3643 value.addr = (XtPointer) &(tpixset->bg);
3644 XrmPutResource (&db,
3645 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3646 WmNbackground), XtRPixel, &value);
3648 XrmPutResource (&db,
3649 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3650 WmNbackground), XtRPixel, &value);
3652 XrmPutResource (&db,
3653 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3654 WmNbackground), XtRPixel, &value);
3656 value.addr = (XtPointer) &(spixset->bg);
3657 XrmPutResource (&db,
3658 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3659 WmNbackground), XtRPixel, &value);
3661 value.addr = (XtPointer) &(tpixset->ts);
3662 XrmPutResource (&db,
3663 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3664 WmNtopShadowColor), XtRPixel, &value);
3666 XrmPutResource (&db,
3667 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3668 WmNtopShadowColor), XtRPixel, &value);
3670 XrmPutResource (&db,
3671 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3672 WmNtopShadowColor), XtRPixel, &value);
3674 value.addr = (XtPointer) &(spixset->ts);
3675 XrmPutResource (&db,
3676 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3677 WmNtopShadowColor), XtRPixel, &value);
3679 value.addr = (XtPointer) &(tpixset->bs);
3680 XrmPutResource (&db,
3681 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3682 WmNbottomShadowColor), XtRPixel, &value);
3684 XrmPutResource (&db,
3685 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3686 WmNbottomShadowColor), XtRPixel, &value);
3688 XrmPutResource (&db,
3689 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3690 WmNbottomShadowColor), XtRPixel, &value);
3692 value.addr = (XtPointer) &(spixset->bs);
3693 XrmPutResource (&db,
3694 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3695 WmNbottomShadowColor), XtRPixel, &value);
3697 value.addr = (XtPointer) &(tpixset->fg);
3698 XrmPutResource (&db,
3699 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3700 WmNforeground), XtRPixel, &value);
3702 XrmPutResource (&db,
3703 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3704 WmNforeground), XtRPixel, &value);
3706 XrmPutResource (&db,
3707 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3708 WmNforeground), XtRPixel, &value);
3710 value.addr = (XtPointer) &(spixset->fg);
3711 XrmPutResource (&db,
3712 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3713 WmNforeground), XtRPixel, &value);
3716 * Set select color only for menus and feedback mwm
3717 * parts. Client and Icon parts aren't real widgets.
3718 * Set client trough color for icon box.
3720 value.addr = (XtPointer) &(tpixset->sc);
3721 XrmPutResource (&db,
3722 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3723 XmNselectColor), XtRPixel, &value);
3725 XrmPutResource (&db,
3726 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3727 XmNarmColor), XtRPixel, &value);
3729 XrmPutResource (&db,
3730 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3731 XmNtroughColor), XtRPixel, &value);
3733 XrmPutResource (&db,
3734 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3735 XmNtroughColor), XtRPixel, &value);
3737 XrmPutResource (&db,
3738 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3739 XmNselectColor), XtRPixel, &value);
3741 value.addr = (XtPointer) &(spixset->sc);
3742 XrmPutResource (&db,
3743 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3744 XmNarmColor), XtRPixel, &value);
3746 XrmPutResource (&db,
3747 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3748 XmNtroughColor), XtRPixel, &value);
3751 * Set Dtwm dialog colors
3753 fpixset = pSD->pSecondaryPixelSet;
3755 value.addr = (XtPointer) &(fpixset->bg);
3756 XrmPutResource (&db,
3757 ResCat (res_class, screen_name, XmNbackground, NULL),
3760 value.addr = (XtPointer) &(fpixset->fg);
3761 XrmPutResource (&db,
3762 ResCat (res_class, screen_name, XmNforeground, NULL),
3765 value.addr = (XtPointer) &(fpixset->ts);
3766 XrmPutResource (&db,
3767 ResCat (res_class, screen_name, XmNtopShadowColor, NULL),
3770 value.addr = (XtPointer) &(fpixset->bs);
3771 XrmPutResource (&db,
3772 ResCat (res_class, screen_name, XmNbottomShadowColor, NULL),
3777 * Set up the select color, as for buttons in the dialogue
3781 value.addr = (XtPointer) &(fpixset->sc);
3782 XrmPutResource (&db,
3783 ResCat (res_class, screen_name, XmNselectColor, NULL),
3786 /* value.addr = (XtPointer) &(fpixset->sc); */
3787 XrmPutResource (&db,
3788 ResCat (res_class, screen_name, XmNarmColor, NULL),
3791 /* value.addr = (XtPointer) &(fpixset->sc); */
3792 XrmPutResource (&db,
3793 ResCat (res_class, screen_name, XmNtroughColor, NULL),
3796 if (XmCO_DitherTopShadow(DISPLAY, thisScreen, fpixset))
3798 XrmPutStringResource (&db,
3799 ResCat (res_class, screen_name, WmNtopShadowPixmap, NULL),
3802 if (pSD->colorUse == XmCO_BLACK_WHITE)
3804 XrmPutStringResource (&db,
3805 ResCat (res_class, screen_name,
3806 WmNbottomShadowPixmap, NULL),
3812 if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, fpixset))
3814 XrmPutStringResource (&db,
3815 ResCat (res_class, screen_name, WmNbottomShadowPixmap, NULL),
3818 if (pSD->colorUse == XmCO_BLACK_WHITE)
3820 XrmPutStringResource (&db,
3821 ResCat (res_class, screen_name,
3822 WmNtopShadowPixmap, NULL),
3828 if (tpixset->bs != tpixset->ts)
3831 * If the inactive bottomshadow and topshadow are
3832 * different (i.e., valid), then make the icon image
3836 value.addr = (XtPointer) &(tpixset->bs);
3838 XrmPutResource (&db,
3839 ResCat (res_class, screen_name, WmNiconImageForeground,
3840 NULL), XtRPixel, &value);
3842 value.addr = (XtPointer) &(tpixset->ts);
3844 XrmPutResource (&db,
3845 ResCat (res_class, screen_name, WmNiconImageBackground,
3846 NULL), XtRPixel, &value);
3848 value.addr = (XtPointer) &(tpixset->bs);
3850 XrmPutResource (&db,
3851 ResCat (res_class, screen_name,
3852 WmNiconImageBottomShadowColor,
3853 NULL), XtRPixel, &value);
3855 value.addr = (XtPointer) &(tpixset->ts);
3857 XrmPutResource (&db,
3858 ResCat (res_class, screen_name,
3859 WmNiconImageTopShadowColor,
3860 NULL), XtRPixel, &value);
3865 * Ensure that the icon images have a black foreground and
3866 * a white background.
3870 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3872 XrmPutResource (&db,
3873 ResCat (res_class, screen_name, WmNiconImageForeground,
3874 NULL), XtRPixel, &value);
3876 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3878 XrmPutResource (&db,
3879 ResCat (res_class, screen_name, WmNiconImageBackground,
3880 NULL), XtRPixel, &value);
3886 if (pSD->pTextPixelSet)
3888 value.addr = (XtPointer) &(pSD->pTextPixelSet->bg);
3890 XrmPutResource (&db,
3891 ResCat (res_class, screen_name, "XmTextField",
3892 WmNbackground), XtRPixel, &value);
3894 XrmPutResource (&db,
3895 ResCat (res_class, screen_name, "XmText",
3896 WmNbackground), XtRPixel, &value);
3901 /******************************<->*************************************
3903 * ResCat (s1,s2,s3,s4)
3908 * Cats up to four strings together with '*' in between.
3913 * s1...s4 = pointers to Strings or NULL pointers (no string)
3917 * Return = pointer to statically allocated string that has
3918 * the passed in string cat'ed together with '*'s
3923 * Does no limit checking on the static buffer
3925 *************************************<->***********************************/
3928 ResCat (String s1, String s2, String s3, String s4)
3934 Boolean useResourceClass = True;
3936 wmGD.tmpBuffer[0] = '\0';
3942 if ((MwmBehavior) &&
3943 !strcmp (s1, WM_RESOURCE_CLASS))
3946 * if this routine is called with a class name
3947 * ("Mwm" or "Dtwm"), then DON'T use it.
3948 * We want our resources to be written out
3949 * as: *iconImageForeground: <pixel_val>
3951 * as opposed to: Dtwm*iconImageForeground: <pixel_val>
3955 useResourceClass = False;
3957 else if (!strcmp (s1, DT_WM_RESOURCE_CLASS))
3959 useResourceClass = False;
3963 strncat((char *)wmGD.tmpBuffer, s1, count);
3964 count -= strlen(s1);
3967 if (s2 && (count > 0))
3969 strncat ((char *)wmGD.tmpBuffer, "*", count);
3971 strncat ((char *)wmGD.tmpBuffer, s2, count);
3972 count -= strlen (s2);
3974 if (s3 && (count > 0))
3976 strncat ((char *)wmGD.tmpBuffer, "*", count);
3978 strncat ((char *)wmGD.tmpBuffer, s3, count);
3979 count -= strlen (s3);
3983 strncat ((char *)wmGD.tmpBuffer, "*", count);
3985 strncat ((char *)wmGD.tmpBuffer, s4, count);
3990 return ((String) wmGD.tmpBuffer);
3992 } /* END OF FUNCTION ResCat */
3996 /******************************<->*************************************
3998 * CheckForNoDither (pAD)
4003 * Checks for reserved string as pixmap name of dither that indicates
4004 * no dithering and replaces the string with a NULL.
4009 * pAD = pointer to appearance data
4013 * pAD = pointer to appearance data (may be modified)
4017 * This check is done to avoid repeated calls to XmGetPixmap when
4018 * managing windows. XmGetPixmap doesn't cache failures, and the
4019 * NoDither string should fail every time. We want to prevent
4020 * XmGetPixmap from call XtResolvePathName to rummage through
4023 *************************************<->***********************************/
4026 CheckForNoDither (AppearanceData *pAD)
4028 if (pAD->backgroundPStr &&
4029 !strcmp(pAD->backgroundPStr, _NoDither))
4031 pAD->backgroundPStr = NULL;
4033 if (pAD->bottomShadowPStr &&
4034 !strcmp(pAD->bottomShadowPStr, _NoDither))
4036 pAD->bottomShadowPStr = NULL;
4038 if (pAD->topShadowPStr &&
4039 !strcmp(pAD->topShadowPStr, _NoDither))
4041 pAD->topShadowPStr = NULL;
4043 if (pAD->activeBackgroundPStr &&
4044 !strcmp(pAD->activeBackgroundPStr, _NoDither))
4046 pAD->activeBackgroundPStr = NULL;
4048 if (pAD->activeBottomShadowPStr &&
4049 !strcmp(pAD->activeBottomShadowPStr, _NoDither))
4051 pAD->activeBottomShadowPStr = NULL;
4053 if (pAD->activeTopShadowPStr &&
4054 !strcmp(pAD->activeTopShadowPStr, _NoDither))
4056 pAD->activeTopShadowPStr = NULL;
4059 } /* END OF FUNCTION CheckForNoDither */
4064 /******************************<->*************************************
4066 * ProcessAppearanceResources (pSD)
4071 * Retrieve and process the general appearance resources for the mwm
4072 * subparts: "client", "icon", and "feedback"
4077 * pSD = pointer to screen data
4081 * modifies parts of global data wmGD.
4085 * o Changeable GCs are created with XCreateGC. The base GCs used for
4086 * text output will have clip_masks defined for them later.
4089 *************************************<->***********************************/
4092 ProcessAppearanceResources (WmScreenData *pSD)
4094 Widget clientW; /* dummy widget for resource fetching */
4100 * Get the client subpart resources:
4103 /* save info in static globals for dynamic default processing */
4104 _defaultBackground = _defaultColor1;
4105 _defaultActiveBackground = _defaultColor2;
4106 _pAppearanceData = &(pSD->clientAppearance);
4108 (void)XtGetSubresources (pSD->screenTopLevelW,
4109 (XtPointer) &(pSD->clientAppearance),
4110 WmNclient, WmCClient, wmAppearanceResources,
4111 XtNumber (wmAppearanceResources), NULL, 0);
4112 CheckForNoDither (&(pSD->clientAppearance));
4116 * Process the client resource values:
4119 /* make background, top and bottom shadow pixmaps */
4121 MakeAppearanceResources (pSD, &(pSD->clientAppearance), True);
4125 * Get the client.title subpart resources:
4128 /* insert "client" widget in hierarchy */
4131 clientW = XtCreateWidget (WmNclient, xmRowColumnWidgetClass,
4132 pSD->screenTopLevelW, (ArgList) args, i);
4135 /* fetch "client.title" subpart appearance resources */
4137 _pAppearanceData = &(pSD->clientTitleAppearance);
4139 (void)XtGetSubresources (clientW, (XtPointer) &(pSD->clientTitleAppearance),
4140 WmNtitle, WmCTitle, wmAppearanceResources,
4141 XtNumber (wmAppearanceResources), NULL, 0);
4142 CheckForNoDither (&(pSD->clientTitleAppearance));
4146 * Process the client.title resource values:
4151 * check if client title appearance is different from the rest of frame.
4153 if (SimilarAppearanceData (&(pSD->clientAppearance),
4154 &(pSD->clientTitleAppearance)))
4156 /* title bar doesn't need special graphic processing */
4157 pSD->decoupleTitleAppearance = False;
4161 /* make background, top and bottom shadow pixmaps */
4162 MakeAppearanceResources (pSD, &(pSD->clientTitleAppearance), True);
4163 pSD->decoupleTitleAppearance = True;
4166 XtDestroyWidget (clientW); /* all done with dummy widget */
4170 * Get the icon subpart resources:
4173 _pAppearanceData = &(pSD->iconAppearance);
4175 (void)XtGetSubresources (pSD->screenTopLevelW,
4176 (XtPointer) &(pSD->iconAppearance),
4177 WmNicon, WmCIcon, wmAppearanceResources,
4178 XtNumber (wmAppearanceResources), NULL, 0);
4179 CheckForNoDither (&(pSD->iconAppearance));
4183 * Process the icon resource values:
4186 /* make background, top and bottom shadow pixmaps */
4188 MakeAppearanceResources (pSD, &(pSD->iconAppearance), True);
4192 * Get the feedback subpart resources:
4193 * !!! only get "inactive" resources !!!
4196 _defaultBackground = _defaultColor2;
4197 _defaultActiveBackground = _defaultColor2;
4198 _pAppearanceData = &(pSD->feedbackAppearance);
4200 (void)XtGetSubresources (pSD->screenTopLevelW,
4201 (XtPointer) &(pSD->feedbackAppearance),
4202 WmNfeedback, WmCFeedback, wmAppearanceResources,
4203 XtNumber (wmAppearanceResources), NULL, 0);
4204 CheckForNoDither (&(pSD->feedbackAppearance));
4207 * Process the feedback resource values:
4210 /* make background, top and bottom shadow pixmaps */
4212 MakeAppearanceResources (pSD, &(pSD->feedbackAppearance), False);
4215 } /* END OF FUNCTION ProcessAppearanceResources */
4219 /*************************************<->*************************************
4221 * FallbackMakeTitleHeight (pAData)
4226 * This function makes title hight for AppearanceData
4227 * (using XExtentsOfFontSet on pAData->fontList)
4232 * pAData = pointer to appearance data structure containing resource info
4237 * *pAData - pAData->titleHeight is updated
4238 * return = 1 on success, 0 on failure (pAData->titleHeight is intact)
4240 *************************************<->***********************************/
4243 FallbackMakeTitleHeight (AppearanceData *pAData) {
4246 XmFontListEntry entry;
4248 XFontSetExtents *pExtents;
4251 XmFontListInitFontContext ( &fc, pAData->fontList);
4252 pAData->titleHeight = 0;
4253 entry = XmFontListNextEntry (fc);
4256 pFont = XmFontListEntryGetFont (entry, &type);
4259 case XmFONT_IS_FONT:
4260 /* does not really happen since XmeRenderTableGetDefaultFont
4261 seems to fail only on fontsets */
4263 case XmFONT_IS_FONTSET:
4264 if (!(pExtents = XExtentsOfFontSet ((XFontSet) pFont))) {
4267 if (WM_TITLE_BAR_PADDING + pExtents->max_logical_extent.height > pAData->titleHeight) {
4268 pAData->titleHeight = WM_TITLE_BAR_PADDING + pExtents->max_logical_extent.height;
4275 entry = XmFontListNextEntry (fc);
4277 XmFontListFreeFontContext (fc);
4282 /*************************************<->*************************************
4284 * MakeAppearanceResources (pSD, pAData, makeActiveResources)
4289 * This function makes top, bottom and background pixmaps for a window
4290 * manager component. Inactive and active (if specified) GC's are
4296 * pSD = pointer to screen data
4298 * pAData = pointer to appearance data structure containing resource info
4300 * makeActiveResources = if True then make active resources
4304 * *pAData = pixmap and GC fields filled out
4306 *************************************<->***********************************/
4309 MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources)
4314 * Extract a font from the font list.
4317 if (! XmeRenderTableGetDefaultFont(pAData->fontList, &(pAData->font)))
4319 sprintf((char *)wmGD.tmpBuffer, ((char *)GETMESSAGE(62, 23, "failed to load font: %.100s\0")), (char*) pAData->fontList);
4320 Warning((char *)wmGD.tmpBuffer);
4321 #if defined(CSRG_BASED) || defined(__linux__)
4322 /* HACK to try get _some_ font anyway (fontList seems to end up as an empty list on
4323 * some modern systems; investigate) */
4324 pAData->font = XLoadQueryFont(wmGD.display, "fixed");
4325 if (pAData->font == NULL)
4327 ExitWM(WM_ERROR_EXIT_VALUE);
4329 /* try to get right title hight using XExtentsOfFontSet: on UTF-8
4330 * locales XmeRenderTableGetDefaultFont does not return anything
4331 * when font is a compound fontset*/
4332 if (!FallbackMakeTitleHeight(pAData))
4334 /* failed to get height from fontList - falling back to fixed */
4335 pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
4336 + WM_TITLE_BAR_PADDING;
4339 ExitWM(WM_ERROR_EXIT_VALUE);
4342 /* got default font successfully, hack was not needed */
4344 * Calculate title bar's height (using selected font) and store it in pAData.
4346 pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
4347 + WM_TITLE_BAR_PADDING;
4353 * Make standard (inactive) appearance resources.
4356 /* background pixmap */
4358 if (pAData->backgroundPStr)
4360 pAData->backgroundPixmap = XmGetPixmap (
4361 ScreenOfDisplay (DISPLAY,
4363 pAData->backgroundPStr,
4365 pAData->background);
4367 if (pAData->backgroundPixmap == XmUNSPECIFIED_PIXMAP)
4369 pAData->backgroundPixmap = (Pixmap)NULL;
4374 pAData->backgroundPixmap = (Pixmap)NULL;
4377 /* top shadow pixmap */
4379 if (pAData->topShadowPStr)
4382 * Make sure top shadow color is not the same as background
4383 * otherwise the wrong pixmap will be generated.
4385 if (pAData->topShadowColor != pAData->background)
4386 foreground = pAData->topShadowColor;
4388 foreground = pAData->foreground;
4389 pAData->topShadowPixmap = XmGetPixmap (
4390 ScreenOfDisplay (DISPLAY,
4392 pAData->topShadowPStr,
4394 pAData->background);
4396 if (pAData->topShadowPixmap == XmUNSPECIFIED_PIXMAP)
4398 pAData->topShadowPixmap = (Pixmap)NULL;
4403 pAData->topShadowPixmap = (Pixmap)NULL;
4407 /* bottom shadow pixmap */
4409 if (pAData->bottomShadowPStr)
4412 * Make sure bottom shadow color is not the same as background
4413 * otherwise the wrong pixmap will be generated.
4415 if (pAData->bottomShadowColor != pAData->background)
4416 foreground = pAData->bottomShadowColor;
4418 foreground = pAData->foreground;
4419 pAData->bottomShadowPixmap = XmGetPixmap (
4420 ScreenOfDisplay (DISPLAY,
4422 pAData->bottomShadowPStr,
4424 pAData->background);
4426 if (pAData->bottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
4428 pAData->bottomShadowPixmap = (Pixmap)NULL;
4433 pAData->bottomShadowPixmap = (Pixmap)NULL;
4436 /* inactive appearance GC */
4438 GetAppearanceGCs (pSD,
4442 pAData->backgroundPixmap,
4443 pAData->topShadowColor,
4444 pAData->topShadowPixmap,
4445 pAData->bottomShadowColor,
4446 pAData->bottomShadowPixmap,
4447 &(pAData->inactiveGC),
4448 &(pAData->inactiveTopShadowGC),
4449 &(pAData->inactiveBottomShadowGC));
4454 * Make active apppearance resources if specified.
4457 if (!makeActiveResources)
4462 /* active background pixmap */
4464 if (pAData->activeBackgroundPStr)
4466 pAData->activeBackgroundPixmap = XmGetPixmap (
4467 ScreenOfDisplay (DISPLAY,
4469 pAData->activeBackgroundPStr,
4470 pAData->activeForeground,
4471 pAData->activeBackground);
4473 if (pAData->activeBackgroundPixmap == XmUNSPECIFIED_PIXMAP)
4475 pAData->activeBackgroundPixmap = (Pixmap)NULL;
4480 pAData->activeBackgroundPixmap = (Pixmap)NULL;
4483 /* active top shadow pixmap */
4485 if (pAData->activeTopShadowPStr)
4487 pAData->activeTopShadowPixmap = XmGetPixmap (
4488 ScreenOfDisplay (DISPLAY,
4490 pAData->activeTopShadowPStr,
4491 pAData->activeTopShadowColor,
4492 pAData->activeBackground);
4494 if (pAData->activeTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
4496 pAData->activeTopShadowPixmap = (Pixmap)NULL;
4501 pAData->activeTopShadowPixmap = (Pixmap)NULL;
4505 /* active bottom shadow pixmap */
4507 if (pAData->activeBottomShadowPStr)
4509 pAData->activeBottomShadowPixmap = XmGetPixmap (
4510 ScreenOfDisplay (DISPLAY,
4512 pAData->activeBottomShadowPStr,
4513 pAData->activeBottomShadowColor,
4514 pAData->activeBackground);
4516 if (pAData->activeBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
4518 pAData->activeBottomShadowPixmap = (Pixmap)NULL;
4523 pAData->activeBottomShadowPixmap = (Pixmap)NULL;
4526 /* inactive appearance GC */
4528 GetAppearanceGCs (pSD,
4529 pAData->activeForeground,
4530 pAData->activeBackground,
4532 pAData->activeBackgroundPixmap,
4533 pAData->activeTopShadowColor,
4534 pAData->activeTopShadowPixmap,
4535 pAData->activeBottomShadowColor,
4536 pAData->activeBottomShadowPixmap,
4537 &(pAData->activeGC),
4538 &(pAData->activeTopShadowGC),
4539 &(pAData->activeBottomShadowGC));
4542 } /* END OF FUNCTION MakeAppearanceResources */
4546 /*************************************<->*************************************
4548 * GetAppearanceGCs (pSD, fg, bg, font, bg_pixmap, ts_color,
4549 * ts_pixmap, bs_color, bs_pixmap, pGC, ptsGC, pbsGC)
4554 * Creates the appearance GCs for any of the icon, client, or feedback
4560 * pSD - pointer to screen data
4561 * fg - base foreground color
4562 * bg - base background color
4564 * bg_pixmap - background pixmap
4565 * ts_color - top shadow color
4566 * ts_pixmap - top shadow pixmap
4567 * bs_color - bottom shadow color
4568 * bs_pixmap - bottom shadow pixmap
4569 * pGC - pointer to location to receive base GC
4570 * ptsGC - pointer to location to receive top shadow GC
4571 * pbsGC - pointer to location to receive bottom shadow GC
4576 * *ptsGC - top shadow GC
4577 * *pbsGC - bottom shadow GC
4584 *************************************<->***********************************/
4587 GetAppearanceGCs (WmScreenData *pSD, Pixel fg, Pixel bg, XFontStruct *font, Pixmap bg_pixmap, Pixel ts_color, Pixmap ts_pixmap, Pixel bs_color, Pixmap bs_pixmap, GC *pGC, GC *ptsGC, GC *pbsGC)
4597 mask = GCForeground | GCBackground | GCFont;
4598 gcv.foreground = fg;
4599 gcv.background = bg;
4600 gcv.font = font->fid;
4605 gcv.tile = bg_pixmap;
4608 *pGC = XCreateGC (DISPLAY, pSD->rootWindow, mask, &gcv);
4611 * !!! Need GC error detection !!!
4614 *ptsGC = GetHighlightGC (pSD, ts_color, bg, ts_pixmap);
4616 *pbsGC = GetHighlightGC (pSD, bs_color, bg, bs_pixmap);
4618 } /* END OF FUNCTION GetAppearanceGCs */
4623 /*************************************<->*************************************
4625 * ProcessScreenResources (pSD, screenName)
4630 * This function retrieves resources that are screen specific. If the
4631 * window manager is providing standard behavior then retrieve the limited
4632 * set of resources that don't affect standard behavior and set the
4633 * values of the other resources to the standard values.
4638 * pSD = pointer to screen data
4639 * screenName = name of screen
4644 * pSD = resource data for screen is set
4649 * o Gets subresources based on workspace name
4651 *************************************<->***********************************/
4654 ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName)
4656 pResSD = pSD; /* save current screen data for default processing */
4658 * Use the screen name (e.g., "0") as the default resource name.
4661 if (wmGD.useStandardBehavior)
4663 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4664 (String) screenName,
4665 (String) screenName,
4666 wmStdScreenResources,
4667 XtNumber (wmStdScreenResources), NULL, 0);
4670 * Fill in the standard resource values.
4673 SetStdScreenResourceValues (pSD);
4677 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4678 (String)screenName, (String) screenName,
4680 XtNumber (wmScreenResources), NULL, 0);
4682 pSD->moveOpaque = (((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW)))
4683 -> screen.moveOpaque);
4688 * Do some additional processing on the window manager resource values.
4692 if (pSD->iconImageMinimum.width < ICON_IMAGE_MIN_WIDTH)
4694 pSD->iconImageMinimum.width = ICON_IMAGE_MIN_WIDTH;
4696 else if (pSD->iconImageMinimum.width > ICON_IMAGE_MAX_WIDTH)
4698 pSD->iconImageMinimum.width = ICON_IMAGE_MAX_WIDTH;
4701 if (pSD->iconImageMinimum.height < ICON_IMAGE_MIN_HEIGHT)
4703 pSD->iconImageMinimum.height = ICON_IMAGE_MIN_HEIGHT;
4705 else if (pSD->iconImageMinimum.height > ICON_IMAGE_MAX_HEIGHT)
4707 pSD->iconImageMinimum.height = ICON_IMAGE_MAX_HEIGHT;
4710 if (pSD->iconImageMaximum.width < pSD->iconImageMinimum.width)
4712 pSD->iconImageMaximum.width = pSD->iconImageMinimum.width;
4714 else if (pSD->iconImageMaximum.width > ICON_IMAGE_MAX_WIDTH)
4716 pSD->iconImageMaximum.width = ICON_IMAGE_MAX_WIDTH;
4719 if (pSD->iconImageMaximum.height < pSD->iconImageMinimum.height)
4721 pSD->iconImageMaximum.height = pSD->iconImageMinimum.height;
4723 else if (pSD->iconImageMaximum.height > ICON_IMAGE_MAX_HEIGHT)
4725 pSD->iconImageMaximum.height = ICON_IMAGE_MAX_HEIGHT;
4728 if (pSD->iconPlacementMargin > MAXIMUM_ICON_MARGIN)
4730 pSD->iconPlacementMargin = MAXIMUM_ICON_MARGIN;
4733 if (pSD->maximumMaximumSize.width <= 0)
4735 pSD->maximumMaximumSize.width =
4736 2 * DisplayWidth (DISPLAY, pSD->screen);
4739 if (pSD->maximumMaximumSize.height <= 0)
4741 pSD->maximumMaximumSize.height =
4742 2 * DisplayHeight (DISPLAY, pSD->screen);
4746 * Set the icon appearance default based on whether or not the icon box
4750 if (pSD->iconDecoration & USE_ICON_DEFAULT_APPEARANCE)
4752 if (pSD->useIconBox)
4754 pSD->iconDecoration = ICON_APPEARANCE_ICONBOX;
4758 pSD->iconDecoration = ICON_APPEARANCE_STANDALONE;
4763 * If resizeBorderWidth or frameBorderWidth is unset then initialize
4764 * to dynamic defaults.
4767 if ((pSD->resizeBorderWidth == (Dimension)BIGSIZE) ||
4768 (pSD->frameBorderWidth == (Dimension)BIGSIZE))
4770 double xres, yres, avg_res;
4772 xres = (((double) DisplayWidth(DISPLAY, pSD->screen)) /
4773 ((double) DisplayWidthMM(DISPLAY, pSD->screen)));
4774 yres = (((double) DisplayHeight(DISPLAY, pSD->screen)) /
4775 ((double) DisplayHeightMM(DISPLAY, pSD->screen)));
4777 avg_res = (xres + yres) / 2.0;
4779 /* Multiply times width in mm (avg. 7-8 pixels) */
4780 if (pSD->resizeBorderWidth == (Dimension)BIGSIZE)
4782 pSD->resizeBorderWidth = (int) (avg_res * 2.2);
4784 /* limit size because big borders look ugly */
4785 if (pSD->resizeBorderWidth > 6) pSD->resizeBorderWidth = 6;
4788 /* Multiply times width in mm (avg. 5-6 pixels) */
4789 if (pSD->frameBorderWidth == (Dimension)BIGSIZE)
4791 pSD->frameBorderWidth = (int) (avg_res * 1.7);
4793 /* limit size because big borders look ugly */
4794 if (wmGD.frameStyle == WmSLAB)
4796 if (pSD->frameBorderWidth > 4) pSD->frameBorderWidth = 4;
4800 if (pSD->frameBorderWidth > 5) pSD->frameBorderWidth = 5;
4806 pSD->externalBevel = FRAME_EXTERNAL_SHADOW_WIDTH;
4807 pSD->joinBevel = FRAME_INTERNAL_SHADOW_WIDTH;
4808 if (pSD->frameBorderWidth <
4809 (pSD->externalBevel + MIN_INTERNAL_BEVEL))
4811 pSD->frameBorderWidth =
4812 pSD->externalBevel + MIN_INTERNAL_BEVEL;
4814 else if (pSD->frameBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
4816 pSD->frameBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
4819 if (pSD->resizeBorderWidth <
4820 (pSD->externalBevel + MIN_INTERNAL_BEVEL))
4822 pSD->resizeBorderWidth =
4823 (pSD->externalBevel + MIN_INTERNAL_BEVEL);
4825 else if (pSD->resizeBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
4827 pSD->resizeBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
4831 * Update the resource database.
4833 WriteOutXrmColors (pSD);
4836 * Process the component appearance resources for client,
4837 * icon and feedback parts of mwm.
4840 ProcessAppearanceResources (pSD);
4843 * Process the workspace list and name the initial
4847 ProcessWorkspaceList (pSD);
4850 * Process default backdrop images to be used in low-color
4853 ProcessDefaultBackdropImages (pSD);
4856 * Save the default icon pixmap in global data. We'll use it only
4860 pSD->builtinIconPixmap =
4861 XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char *)iImage_bits,
4862 iImage_width, iImage_height);
4864 } /* END OF FUNCTION ProcessScreenResources */
4866 /*************************************<->*************************************
4868 * ProcessDefaultBackdropImages (pSD)
4873 * This function processes the default backdrop images to be used
4874 * in low color or black and white workspaces.
4879 * pSD = pointer to screen data
4884 * pSD = resource data for screen is set
4890 *************************************<->***********************************/
4893 ProcessDefaultBackdropImages (WmScreenData *pSD)
4895 } /* END OF FUNCTION ProcessDefaultBackdropImages */
4899 /*************************************<->*************************************
4901 * ProcessWorkspaceList (pSD)
4906 * This function processes the workspaceCount and workspaceList
4907 * resources for a particular screen. It creates space for the initial
4908 * workspace data structures and adds in names for workspaces.
4913 * pSD = pointer to screen data
4918 * pSD = resource data for screen is set
4923 * NOTE: The workspaceCount resource has precedence over the
4924 * workspaceList resource. workspaceCount determines the number of
4925 * workspaces to create for the screen. Once the number is determined,
4926 * workspaceList is used to fill in the "names." If workspaceList is
4927 * not present or doesn't have enough names, then missing names are
4928 * generated automatically. If workspaceList is present and
4929 * workspaceCount is not present, then the workspaceCount is determined
4930 * by the number of names in workspaceList.
4932 *************************************<->***********************************/
4935 ProcessWorkspaceList (WmScreenData *pSD)
4937 int i, wsNameCount, wsNamesAlloced;
4938 WmWorkspaceData *pwsI;
4939 unsigned char *lineP = NULL;
4940 unsigned char *string;
4941 Boolean bHaveWorkspaceList;
4942 Boolean bHaveWorkspaceCount;
4943 char **ppchWsNames = NULL;
4946 * Validate initial resource settings
4948 bHaveWorkspaceCount = (pSD->numWorkspaces >= 1);
4949 bHaveWorkspaceList = (pSD->workspaceList != NULL);
4951 if (bHaveWorkspaceList)
4954 * Parse out array of workspace names
4956 wsNamesAlloced = WS_ALLOC_AMOUNT;
4957 ppchWsNames = (char **) XtMalloc (wsNamesAlloced * sizeof (char *));
4958 if (pSD->workspaceList)
4960 lineP = (unsigned char *) pSD->workspaceList;
4964 lineP = (unsigned char *)NULL;
4968 while (((string = GetString(&lineP)) != NULL))
4970 ppchWsNames[wsNameCount] = (char *) string;
4972 if (++wsNameCount >= wsNamesAlloced)
4975 * Need to add more workspaces
4977 wsNamesAlloced += WS_ALLOC_AMOUNT;
4978 if (!(ppchWsNames = (char **) XtRealloc
4979 ((char *)ppchWsNames,
4980 wsNamesAlloced * sizeof(char *))))
4982 ExitWM (WM_ERROR_EXIT_VALUE);
4987 if (!bHaveWorkspaceCount)
4989 pSD->numWorkspaces = wsNameCount;
4992 else if (!bHaveWorkspaceCount)
4995 * Neither workspaceCount nor workspaceList specified!!
4996 * Assume one workspace.
4998 pSD->numWorkspaces = 1;
5001 if (pSD->numWorkspaces > MAX_WORKSPACE_COUNT)
5002 pSD->numWorkspaces = MAX_WORKSPACE_COUNT;
5005 * Allocate the array of workspace data
5007 pSD->numWsDataAllocated = (pSD->numWorkspaces + WS_ALLOC_AMOUNT);
5008 pSD->numWsDataAllocated -= pSD->numWsDataAllocated % WS_ALLOC_AMOUNT;
5009 if (!(pSD->pWS = (WmWorkspaceData *)
5010 XtMalloc (pSD->numWsDataAllocated * sizeof(WmWorkspaceData))))
5012 ExitWM (WM_ERROR_EXIT_VALUE);
5017 for (i = 0; i < pSD->numWorkspaces; i++, pwsI++)
5019 if (bHaveWorkspaceList && i < wsNameCount)
5021 string = (unsigned char *) ppchWsNames[i];
5025 string = GenerateWorkspaceName (pSD, i);
5027 if (!(pwsI->name = (String) XtMalloc (1+strlen((char *)string))))
5029 Warning (((char *)GETMESSAGE(62, 27, "Insufficient memory for workspace data")));
5030 ExitWM(WM_ERROR_EXIT_VALUE);
5034 strcpy(pwsI->name, (char *)string);
5038 if (ppchWsNames) XtFree ((char *) ppchWsNames);
5040 } /* END OF FUNCTION ProcessWorkspaceList */
5044 /******************************<->*************************************
5046 * ProcessWorkspaceResources (pWS)
5051 * This function retrieves resources that are workspace specific. If the
5052 * window manager is providing standard behavior then retrieve the limited
5053 * set of resources that don't affect standard behavior and set the
5054 * values of the other resources to the standard values.
5059 * pWS = pointer to workspace data
5064 * pWS = resource data for workspace is set
5069 * o Gets subresources based on workspace name
5071 ******************************<->***********************************/
5074 ProcessWorkspaceResources (WmWorkspaceData *pWS)
5078 * Retrieve workspace specific resources.
5080 pResWS = pWS; /* save current ws for default processing */
5082 if (wmGD.useStandardBehavior)
5084 XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
5085 pWS->name, pWS->name, wmStdWorkspaceResources,
5086 XtNumber (wmStdWorkspaceResources), NULL, 0);
5089 * Fill in the standard resource values.
5091 * (no code for this right now)
5093 pWS->iconBoxGeometry = NULL;
5097 XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
5098 pWS->name, pWS->name, wmWorkspaceResources,
5099 XtNumber (wmWorkspaceResources), NULL, 0);
5101 /* Dup iconbox geometry, it may be free'd later on. */
5103 if (pWS->iconBoxGeometry)
5105 pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
5109 if (pWS->title == NULL)
5112 * Setup default workspace title
5114 pWS->title = XmStringCreateLocalized(pWS->name);
5119 * Copy resource just in case there's a duplicate
5120 * Duplicates point to the same data, freeing on
5121 * rename can cause a crash.
5123 pWS->title = XmStringCopy(pWS->title);
5128 * Dup iconbox geometry, it may be free'd later on.
5130 if (pWS->iconBoxGeometry)
5132 pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
5136 * Get backdrop resources
5138 XtGetSubresources (pWS->workspaceTopLevelW,
5139 (XtPointer) &(pWS->backdrop),
5140 WmNbackdrop, WmCBackdrop, wmBackdropResources,
5141 XtNumber (wmBackdropResources), NULL, 0);
5143 ProcessBackdropResources (pWS, 0);
5145 } /* END OF FUNCTION ProcessWorkspaceResources */
5147 /******************************<->*************************************
5149 * ProcessPresenceResources (pSD)
5154 * This function retrieves resources for the workspace presence
5159 * pSD = pointer to screen data
5164 * pSD = resource data for workspace presence dialog are set
5169 * o Gets subresources
5171 ******************************<->***********************************/
5174 ProcessPresenceResources (WmScreenData *pSD)
5176 #ifndef NO_MESSAGE_CATALOG
5177 static char *default_ws_pres_title = NULL;
5179 static char *default_ws_pres_title = "Workspace Presence";
5183 unsigned char *pch1, *pch2;
5185 #ifndef NO_MESSAGE_CATALOG
5187 * Set up localized default title string on initial time through
5189 if (default_ws_pres_title == NULL)
5193 * catgets returns a pointer to an area that is over written
5194 * on each call to catgets.
5197 tmpString = ((char *)GETMESSAGE(62, 59, "Occupy Workspace"));
5198 if ((default_ws_pres_title =
5199 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
5201 Warning (((char *)GETMESSAGE(62, 31, "Insufficient memory for local message string")));
5202 default_ws_pres_title = "Occupy Workspace";
5206 strcpy(default_ws_pres_title, tmpString);
5211 if (pSD->presence.shellW)
5213 XtGetSubresources (pSD->presence.shellW, (XtPointer) &pSD->presence,
5214 WmNworkspacePresence, WmCWorkspacePresence,
5215 wmWsPresenceResources,
5216 XtNumber (wmWsPresenceResources), NULL, 0);
5220 if (pSD->presence.title)
5222 pch1 = (unsigned char *)
5223 WmXmStringToString (pSD->presence.title);
5225 if (pch1 && (pch2 = (unsigned char *)
5226 XtMalloc (1+strlen((char *)pch1))))
5228 strcpy ((char *)pch2, (char *)pch1);
5234 pch2 = (unsigned char *) default_ws_pres_title;
5238 XtSetArg (args[n], XmNtitle, pch2); n++;
5239 XtSetValues (pSD->presence.shellW, args, n);
5242 } /* END OF FUNCTION ProcessPresenceResources */
5245 /*************************************<->*************************************
5247 * ProcessClientResources (pCD)
5252 * This function retrieves resources that are client specific. If the
5253 * window manager is providing standard behavior then retrieve the limited
5254 * set of resources that don't affect standard behavior and set the
5255 * values of the other resources to the standard values.
5260 * pCD = pointer to client data
5265 * pCD = resource data for client is set
5270 * o Gets subresources based on client name and class.
5271 * o Creates GC for the client Matte, if there is one.
5273 *************************************<->***********************************/
5276 ProcessClientResources (ClientData *pCD)
5280 WmScreenData *pSD = pCD->pSD;
5283 * Retrieve basic client specific resources.
5286 _pCD = pCD; /* save in static global for dynamic default processing */
5287 clientName = (pCD->clientName) ? pCD->clientName : WmNdefaults;
5288 clientClass = (pCD->clientClass) ? pCD->clientClass : WmNdefaults;
5290 if (wmGD.useStandardBehavior)
5292 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5293 clientClass, wmStdClientResources, XtNumber (wmStdClientResources),
5297 * Fill in the standard resource values.
5300 SetStdClientResourceValues (pCD);
5304 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5305 clientClass, wmClientResources, XtNumber (wmClientResources), NULL,
5309 #ifdef NO_MESSAGE_CATALOG
5311 * If (window menu spec is not found) then use the builtin
5315 if ((pCD->systemMenu == defaultSystemMenuName) &&
5316 (pSD->defaultSystemMenuUseBuiltin == TRUE))
5318 pCD->systemMenu = builtinSystemMenuName;
5323 * If the client decorations or client functions have been defaulted
5324 * fix up the fields in the ProcessMwmHints function.
5328 /* make top and bottom shadow pixmaps */
5330 if (pCD->iconImageBottomShadowPStr)
5332 if ((pCD->iconImageBottomShadowPStr ==
5333 pSD->iconAppearance.bottomShadowPStr) &&
5334 (pCD->iconImageBottomShadowColor ==
5335 pSD->iconAppearance.bottomShadowColor) &&
5336 (pCD->iconImageBackground ==
5337 pSD->iconAppearance.background))
5339 pCD->iconImageBottomShadowPixmap =
5340 pSD->iconAppearance.bottomShadowPixmap;
5344 pCD->iconImageBottomShadowPixmap =
5345 XmGetPixmap ( ScreenOfDisplay (DISPLAY,
5347 pCD->iconImageBottomShadowPStr,
5348 pCD->iconImageBottomShadowColor,
5349 pCD->iconImageBackground);
5351 if (pCD->iconImageBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
5353 pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
5359 pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
5362 if (pCD->iconImageTopShadowPStr)
5364 if ((pCD->iconImageTopShadowPStr ==
5365 pSD->iconAppearance.topShadowPStr) &&
5366 (pCD->iconImageTopShadowColor ==
5367 pSD->iconAppearance.topShadowColor) &&
5368 (pCD->iconImageBackground == pSD->iconAppearance.background))
5370 pCD->iconImageTopShadowPixmap =
5371 pSD->iconAppearance.topShadowPixmap;
5375 pCD->iconImageTopShadowPixmap =
5376 XmGetPixmap ( ScreenOfDisplay (DISPLAY,
5378 pCD->iconImageTopShadowPStr,
5379 pCD->iconImageTopShadowColor,
5380 pCD->iconImageBackground);
5382 if (pCD->iconImageTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
5384 pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
5390 pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
5393 if ((pCD->internalBevel < MIN_INTERNAL_BEVEL) ||
5394 (pCD->internalBevel > MAX_INTERNAL_BEVEL))
5396 pCD->internalBevel = MAX_INTERNAL_BEVEL;
5401 * Retrieve matte resources and make internal matte resources.
5404 if (pCD->matteWidth > 0)
5406 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5407 clientClass, wmClientResourcesM, XtNumber (wmClientResourcesM),
5410 /* make top and bottom shadow pixmaps */
5412 if (pCD->matteBottomShadowPStr &&
5413 (!strcmp(pCD->matteBottomShadowPStr, _NoDither)))
5415 pCD->matteBottomShadowPStr = NULL;
5418 if (pCD->matteBottomShadowPStr)
5420 if ((pCD->matteBottomShadowPStr ==
5421 pSD->clientAppearance.bottomShadowPStr) &&
5422 (pCD->matteBottomShadowColor ==
5423 pSD->clientAppearance.bottomShadowColor) &&
5424 (pCD->matteBackground == pSD->clientAppearance.background))
5426 pCD->matteBottomShadowPixmap =
5427 pSD->clientAppearance.bottomShadowPixmap;
5431 pCD->matteBottomShadowPixmap =
5432 XmGetPixmap (ScreenOfDisplay (DISPLAY,
5434 pCD->matteBottomShadowPStr,
5435 pCD->matteBottomShadowColor,
5436 pCD->matteBackground);
5438 if (pCD->matteBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
5440 pCD->matteBottomShadowPixmap = (Pixmap)NULL;
5446 pCD->matteBottomShadowPixmap = (Pixmap)NULL;
5449 if (pCD->matteTopShadowPStr &&
5450 (!strcmp(pCD->matteTopShadowPStr, _NoDither)))
5452 pCD->matteTopShadowPStr = NULL;
5455 if (pCD->matteTopShadowPStr)
5457 if ((pCD->matteTopShadowPStr ==
5458 pSD->clientAppearance.topShadowPStr) &&
5459 (pCD->matteTopShadowColor ==
5460 pSD->clientAppearance.topShadowColor) &&
5461 (pCD->matteBackground == pSD->clientAppearance.background))
5463 pCD->matteTopShadowPixmap =
5464 pSD->clientAppearance.topShadowPixmap;
5468 pCD->matteTopShadowPixmap =
5469 XmGetPixmap (ScreenOfDisplay (DISPLAY,
5471 pCD->matteTopShadowPStr,
5472 pCD->matteTopShadowColor,
5473 pCD->matteBackground);
5475 if (pCD->matteTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
5477 pCD->matteTopShadowPixmap = (Pixmap)NULL;
5483 pCD->matteTopShadowPixmap = (Pixmap)NULL;
5487 /* make top and bottom shadow GC's */
5489 pCD->clientMatteTopShadowGC = GetHighlightGC (pCD->pSD,
5490 pCD->matteTopShadowColor,
5491 pCD->matteBackground,
5492 pCD->matteTopShadowPixmap);
5494 pCD->clientMatteBottomShadowGC = GetHighlightGC (pCD->pSD,
5495 pCD->matteBottomShadowColor,
5496 pCD->matteBackground,
5497 pCD->matteBottomShadowPixmap);
5500 } /* END OF FUNCTION ProcessClientResources */
5504 /*************************************<->*************************************
5506 * SetStdClientResourceValues (pCD)
5511 * This function sets client resource data to standard values. This setting
5512 * is done in place of getting the values from the user settings in
5513 * the resource database.
5517 * pCD = pointer to the client data
5522 * pCD = (client data filled out with resource values)
5524 *************************************<->***********************************/
5527 SetStdClientResourceValues (ClientData *pCD)
5529 pCD->clientDecoration = WM_DECOR_DEFAULT;
5530 pCD->clientFunctions = WM_FUNC_DEFAULT;
5531 pCD->focusAutoRaise = True;
5532 pCD->systemMenu = builtinSystemMenuName;
5533 pCD->usePPosition = USE_PPOSITION_NONZERO;
5534 pCD->ignoreWMSaveHints = True;
5536 } /* END OF FUNCTION SetStdClientResourceValues */
5540 /******************************<->*************************************
5542 * SetStdScreenResourceValues (pSD)
5547 * This function sets screen resource data to standard values. This setting
5548 * is done in place of getting the values from the user settings in
5549 * the resource database.
5553 * pSD = pointer to the screen data
5558 * pSD = (screen data filled out with resource values)
5560 ******************************<->***********************************/
5563 SetStdScreenResourceValues (WmScreenData *pSD)
5565 pSD->buttonBindings = builtinButtonBindingsName;
5566 pSD->cleanText = True;
5567 pSD->iconDecoration =
5568 (ICON_LABEL_PART | ICON_IMAGE_PART | ICON_ACTIVE_LABEL_PART);
5569 pSD->iconPlacement =
5570 (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY);
5571 pSD->keyBindings = builtinKeyBindingsName;
5572 pSD->limitResize = True;
5573 pSD->resizeCursors = True;
5574 pSD->transientDecoration = (WM_DECOR_SYSTEM | WM_DECOR_RESIZEH);
5575 pSD->transientFunctions =
5576 (WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE |
5578 pSD->useIconBox = False;
5580 pSD->feedbackGeometry = NULL;
5581 pSD->moveOpaque = False;
5583 } /* END OF FUNCTION SetStdScreenResourceValues */
5586 /*************************************<->*************************************
5588 * GetHighlightGC (pSD, fg, bg, pixmap)
5593 * Get a graphic context for either drawing top- or bottom-shadow
5599 * pSD = pointer to screen data
5600 * fg = foreground color
5601 * bg = background color
5602 * pixmap = pixmap for highlight
5606 * RETRUN = GC with the input parameters incorporated.
5608 *************************************<->***********************************/
5610 GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap)
5616 mask = GCForeground | GCBackground | GCLineWidth | GCFillStyle;
5617 gcv.background = bg;
5618 gcv.foreground = fg;
5623 mask |= GCFillStyle | GCTile;
5624 gcv.fill_style = FillTiled;
5629 gcv.fill_style = FillSolid;
5634 * NOTE: If additional mask bits are added, modify WmGetGC()
5635 * in WmGraphics.c to check those values for matches.
5638 return (WmGetGC (pSD, mask, &gcv));
5639 #endif /* OLD_CODE */
5641 return (XtGetGC (pSD->screenTopLevelW, mask, &gcv));
5643 } /* END OF FUNCTION GetHighlightGC */
5647 /*************************************<->*************************************
5649 * _WmGetDynamicDefault (widget, type, defaultColor, newBackground, value)
5654 * This function is used to generate a default color of the requested
5655 * type. Default colors are generated for a 3-D appearance.
5660 * widget = this is the widget that is associated with the resource or
5661 * that is the reference widget for the wm subpart.
5663 * type = this is the type of color resource (e.g., top shadow color).
5665 * defaultColor = pointer to default color name/specification.
5667 * newBackground = background pixel for generating 3-D colors.
5672 * value = pointer to the XrmValue in which to store the color
5674 *************************************<->***********************************/
5677 _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value)
5679 static Screen *oldScreen = NULL;
5680 static Screen *newScreen;
5681 static Colormap oldColormap;
5682 static Colormap newColormap;
5683 static Pixel newValue;
5684 static Pixel background;
5685 static String oldDefaultColor = DEFAULT_COLOR_NONE;
5686 static XmColorData colorData;
5688 /* initialize the return value */
5690 value->size = sizeof (newValue);
5691 value->addr = (char *)&newValue;
5695 * Process monochrome defaults first.
5698 newScreen = XtScreen (widget);
5700 if (Monochrome (newScreen))
5704 * Check color server sets for this screen.
5706 if (wmGD.statusColorServer == CSERVE_NORMAL)
5711 for (i = 0; i < wmGD.numScreens; i++)
5713 if (XScreenNumberOfScreen(newScreen) == wmGD.Screens[i].screen)
5715 pSD = &wmGD.Screens[i];
5724 for (i = 0; i < XmCO_MAX_NUM_COLORS; i++)
5726 if (pSD->pPixelData[i].bg == newBackground)
5730 case WmFGC: newValue = pSD->pPixelData[i].fg; break;
5731 case WmBGC: newValue = pSD->pPixelData[i].bg; break;
5732 case WmTSC: newValue = pSD->pPixelData[i].ts; break;
5733 case WmBSC: newValue = pSD->pPixelData[i].bs; break;
5746 case WmFGC: newValue = BlackPixelOfScreen (newScreen); break;
5747 case WmBGC: newValue = WhitePixelOfScreen (newScreen); break;
5748 case WmTSC: newValue = WhitePixelOfScreen (newScreen); break;
5749 case WmBSC: newValue = BlackPixelOfScreen (newScreen); break;
5757 * Check to see if appropriate colors are available from the
5758 * previous request; if the color is a background color then get
5759 * default colors. Generate 3-D colors if necessary. Maintain
5760 * new colors in static variables for later reuse.
5763 newColormap = widget->core.colormap;
5765 if ((oldScreen != NULL) && (oldScreen == newScreen) &&
5766 (oldColormap == newColormap) && (type != WmBGC) &&
5767 (background == newBackground))
5770 else if ((oldScreen == newScreen) && (oldColormap == newColormap) &&
5771 (type == WmBGC) && (oldDefaultColor == defaultColor))
5774 else if (type == WmBGC)
5777 * Find or generate a background color and associated 3-D colors.
5780 oldDefaultColor = defaultColor;
5782 * Fix for CR 5152 - Due to the use of Realloc in the color caches,
5783 * a static pointer is not acceptable. Change it
5784 * to a static structure to maintain the data
5786 colorData = *_WmGetDefaultColors (newScreen, newColormap, defaultColor);
5791 * Find or generate a color based on the associated background color.
5794 oldDefaultColor = DEFAULT_COLOR_NONE;
5795 background = newBackground;
5797 XmGetColors(newScreen, newColormap, background,
5798 &colorData.foreground.pixel,
5799 &colorData.top_shadow.pixel,
5800 &colorData.bottom_shadow.pixel,
5801 &colorData.select.pixel);
5804 oldScreen = newScreen;
5805 oldColormap = newColormap;
5809 * Set up the return value.
5812 colorData.allocated |= type;
5815 case XmBACKGROUND: newValue = colorData.background.pixel; break;
5816 case XmFOREGROUND: newValue = colorData.foreground.pixel; break;
5817 case XmTOP_SHADOW: newValue = colorData.top_shadow.pixel; break;
5818 case XmBOTTOM_SHADOW: newValue = colorData.bottom_shadow.pixel; break;
5819 case XmSELECT: newValue = colorData.select.pixel; break;
5820 default: newValue = colorData.background.pixel; break;
5823 } /* END OF FUNCTION _WmGetDynamicDefault */
5827 /*************************************<->*************************************
5829 * _WmGetDefaultColors (screen, colormap, defaultColor)
5834 * This function is used to find or generate default 3-D colors based on a
5835 * default background color.
5840 * screen = screen for which colors are to be generated.
5842 * colormap = colormap that is to be used to make colors.
5844 * defaultColor = pointer to a default color name/specification.
5849 * RETURN = pointer to WmColorData structure containing 3-D colors.
5851 *************************************<->***********************************/
5853 XmColorData * _WmGetDefaultColors (Screen *screen, Colormap colormap,
5854 String defaultColor)
5856 static XmColorData *defaultSet[2] = {NULL, NULL};
5857 static int defaultCount[2] = {0, 0};
5858 static int defaultSize[2] = {0, 0};
5864 Display *display = DisplayOfScreen (screen);
5868 * Fix for CR 5152 - Due to the use of Realloc with _XmGetColors, it is
5869 * necessary to maintain a separate cache of color
5870 * data. The Realloc may cause the data to be moved,
5871 * and the cache would contain pointers into the heap.
5875 * Look through the cache to see if the defaults are already in the
5876 * cache. There is a list of cached defaults for each default color.
5879 if (defaultColor == _defaultColor2)
5888 set = defaultSet[setId];
5889 count = defaultCount[setId];
5890 size = defaultSize[setId];
5892 for (i = 0; i < count; i++)
5894 if (((set + i)->screen == screen) && ((set + i)->color_map == colormap))
5901 * No match in the cache, make a new entry and generate the colors.
5906 size = (defaultSize[setId] += 10);
5907 set = defaultSet[setId] =
5908 (XmColorData *)WmRealloc ((char *) defaultSet[setId],
5909 sizeof (XmColorData) * size);
5913 * Make the default background color for the resource set.
5916 if(!XParseColor (display, colormap, defaultColor, &colorDef))
5918 if(!(strcmp(defaultColor, _defaultColor1)))
5920 XParseColor (display, colormap, _defaultColor1HEX, &colorDef);
5924 XParseColor (display, colormap, _defaultColor2HEX, &colorDef);
5928 XAllocColor (display, colormap, &colorDef);
5932 * Generate the 3-D colors and save them in the defaults cache.
5935 XmGetColors(screen, colormap, colorDef.pixel,
5936 &set[count].foreground.pixel,
5937 &set[count].top_shadow.pixel,
5938 &set[count].bottom_shadow.pixel,
5939 &set[count].select.pixel);
5941 set[count].background.pixel = colorDef.pixel;
5943 set[count].screen = screen;
5944 set[count].color_map = colormap;
5945 set[count].allocated = True;
5947 XQueryColor(DISPLAY, colormap, &(set[count].background));
5948 XQueryColor(DISPLAY, colormap, &(set[count].foreground));
5949 XQueryColor(DISPLAY, colormap, &(set[count].top_shadow));
5950 XQueryColor(DISPLAY, colormap, &(set[count].bottom_shadow));
5951 XQueryColor(DISPLAY, colormap, &(set[count].select));
5953 (defaultCount[setId])++;
5955 return (set + count);
5958 } /* END OF FUNCTION _WmGetDefaultColors */
5962 /*************************************<->*************************************
5964 * WmRealloc (ptr, size)
5969 * This function is used reallocate a block of storage that has been
5975 * ptr = pointer to storage that is to be realloc'ed; if NULL malloc an
5976 * initial block of storage.
5978 * size = size of new storage
5982 * RETURN = pointer to realloc'ed block of storage
5984 *************************************<->***********************************/
5986 char * WmRealloc (char *ptr, unsigned size)
5990 ptr = (char *)XtRealloc (ptr, size);
5994 ptr = (char *)XtMalloc (size);
5999 Warning (((char *)GETMESSAGE(62, 37, "Insufficient memory for window manager data")));
6004 } /* END OF FUNCTION WmRealloc */
6008 /*************************************<->*************************************
6010 * WmMalloc (ptr, size)
6015 * This function is used malloc a block of storage. If a previous block
6016 * of storage is being replace the old block is free'd.
6021 * ptr = pointer to storage that is to be replaced (free'd).
6023 * size = size of new storage
6027 * RETURN = pointer to malloc'ed block of storage
6029 *************************************<->***********************************/
6031 char * WmMalloc (char *ptr, unsigned size)
6038 ptr = (char *)XtMalloc (size);
6042 Warning (((char *)GETMESSAGE(62, 38, "Insufficient memory for window manager data")));
6047 } /* END OF FUNCTION WmMalloc */
6051 /*************************************<->*************************************
6053 * SetupDefaultResources (pSD)
6058 * This function is used to setup default (builtin) resources for the
6064 * pSD = pointer to screen data
6065 * wmGD = (defaultKeyBindingsString, ...)
6067 * builtinKeyBindingsName = name of default key bindings set
6074 *************************************<->***********************************/
6077 SetupDefaultResources (WmScreenData *pSD)
6079 KeySpec *nextKeySpec;
6085 * If (using DefaultBindings mechanism and bindings are not found in .mwmrc)
6086 * then use the builtin bindings.
6088 if (!pSD->keySpecs && !wmGD.useStandardBehavior)
6091 * Print warning if user is NOT using "DefaultKeyBindings".
6093 if (strcmp (pSD->keyBindings, defaultKeyBindingsName))
6095 MWarning (((char *)GETMESSAGE(62, 67, "Key bindings %s not found, using builtin key bindings\n")),
6098 pSD->keyBindings = builtinKeyBindingsName;
6101 if (!pSD->buttonSpecs && !wmGD.useStandardBehavior)
6104 * Print warning if user is NOT using "DefaultButtonBindings".
6106 if (strcmp (pSD->buttonBindings, defaultButtonBindingsName))
6108 MWarning (((char *)GETMESSAGE(62, 68, "Button bindings %s not found, using builtin button bindings\n")),
6109 pSD->buttonBindings);
6111 pSD->buttonBindings = builtinButtonBindingsName;
6114 if (pSD->keyBindings == builtinKeyBindingsName)
6117 * Default key specifications are to be used and no default
6118 * set has been provided by the user. Make the built-in default
6122 ParseKeyStr (pSD, (unsigned char *)builtinKeyBindings);
6127 * Add the switch behavior key binding to the front of the list
6128 * of user specified key bindings that have been parsed.
6131 nextKeySpec = pSD->keySpecs;
6132 keyBindings = pSD->keyBindings;
6133 pSD->keyBindings = behaviorKeyBindingName;
6134 pSD->keySpecs = NULL;
6136 ParseKeyStr (pSD, (unsigned char *)behaviorKeyBindings);
6140 /* Skip past the TWO key definitions (1.2 & 1.1.4) */
6141 pSD->keySpecs->nextKeySpec->nextKeySpec = nextKeySpec;
6145 pSD->keySpecs = nextKeySpec;
6147 pSD->keyBindings = keyBindings;
6150 if (pSD->buttonBindings == builtinButtonBindingsName)
6153 * Default button specifications are to be used and no default
6154 * set has been provided by the user. Make the built-in default
6158 ParseButtonStr (pSD, (unsigned char *)builtinButtonBindings);
6161 #ifdef NO_MESSAGE_CATALOG
6163 * Set defaultSystemMenuUseBuiltin to FALSE if DefaultWindowMenu spec
6167 menuSpec = pSD->menuSpecs;
6170 if (!strcmp(menuSpec->name, defaultSystemMenuName))
6172 pSD->defaultSystemMenuUseBuiltin = FALSE;
6175 menuSpec = menuSpec->nextMenuSpec;
6179 } /* END OF FUNCTION SetupDefaultResources */
6183 /*************************************<->*************************************
6185 * SimilarAppearanceData (pAD1, pAD2)
6190 * This function returns True if the two passed sets of AppearanceData
6191 * are similar. This is designed to compare appearance data before
6192 * creation of the GCs.
6197 * pAD1 pointer to AppearanceData 1
6198 * pAD2 pointer to AppearanceData 2
6203 * Function returns True if similar, False otherwise.
6207 * This function is only used to compare the client
6208 * and client*title appearance data.
6209 *************************************<->***********************************/
6211 Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2)
6216 if ((pAD1->fontList == pAD2->fontList) &&
6217 (pAD1->background == pAD2->background) &&
6218 (pAD1->foreground == pAD2->foreground) &&
6219 (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
6220 (pAD1->backgroundPixmap == pAD2->backgroundPixmap) &&
6221 (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
6222 (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
6223 (pAD1->bottomShadowPixmap == pAD2->bottomShadowPixmap) &&
6224 (pAD1->topShadowColor == pAD2->topShadowColor) &&
6225 (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
6226 (pAD1->topShadowPixmap == pAD2->topShadowPixmap) &&
6227 (pAD1->activeBackground == pAD2->activeBackground) &&
6228 (pAD1->activeForeground == pAD2->activeForeground) &&
6229 (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
6230 (pAD1->activeBackgroundPixmap == pAD2->activeBackgroundPixmap) &&
6231 (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
6232 (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
6233 (pAD1->activeBottomShadowPixmap == pAD2->activeBottomShadowPixmap) &&
6234 (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
6235 (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) &&
6236 (pAD1->activeTopShadowPixmap == pAD2->activeTopShadowPixmap) )
6239 * !!! Should find out why all the Pixmap resources are unset !!!
6242 if ((pAD1->fontList == pAD2->fontList) &&
6243 (pAD1->background == pAD2->background) &&
6244 (pAD1->foreground == pAD2->foreground) &&
6245 (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
6246 (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
6247 (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
6248 (pAD1->topShadowColor == pAD2->topShadowColor) &&
6249 (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
6250 (pAD1->activeBackground == pAD2->activeBackground) &&
6251 (pAD1->activeForeground == pAD2->activeForeground) &&
6252 (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
6253 (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
6254 (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
6255 (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
6256 (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) )
6268 } /* END OF FUNCTION SimilarAppearanceData */
6270 /*************************************<->*************************************
6272 * Monochrome (screen)
6277 * This function returns True if the screen passed it to be treated
6278 * as monochrome for the purpose of assigning default resources.
6283 * screen pointer to Screen
6288 * Function returns True if monochrome (or Static Gray), False otherwise.
6290 *************************************<->***********************************/
6293 Monochrome (Screen *screen)
6299 if (wmGD.statusColorServer == CSERVE_NORMAL)
6301 for (scr = 0; scr < wmGD.numScreens; scr++)
6303 pSD = &(wmGD.Screens[scr]);
6307 if (XScreenOfDisplay (DISPLAY, pSD->screen) == screen)
6309 if (pSD->colorUse == XmCO_BLACK_WHITE)
6322 * If we don't know the answer to our question by now,
6323 * fall back to the old mwm way of determining monochromicity.
6327 return ((DefaultDepthOfScreen(screen) == 1));
6328 } /* END OF FUNCTION Monochrome */
6330 /**************************** eof ***************************/