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)))
4320 /* This always prints garbage on failure, which seems to
4321 * always happen at least 1-3 times on startup.
4323 sprintf((char *)wmGD.tmpBuffer,
4324 ((char *)GETMESSAGE(62, 23, "failed to load font: %.100s\0")), (char*) pAData->fontList);
4326 Warning("XmeRenderTableGetDefaultFont() failed, trying a fixed font");
4328 #if defined(CSRG_BASED) || defined(__linux__)
4329 /* HACK to try get _some_ font anyway (fontList seems to end
4330 * up as an empty list on some modern systems; investigate) */
4331 pAData->font = XLoadQueryFont(wmGD.display, "fixed");
4332 if (pAData->font == NULL)
4334 ExitWM(WM_ERROR_EXIT_VALUE);
4336 /* try to get right title hight using XExtentsOfFontSet: on UTF-8
4337 * locales XmeRenderTableGetDefaultFont does not return anything
4338 * when font is a compound fontset*/
4339 if (!FallbackMakeTitleHeight(pAData))
4341 /* failed to get height from fontList - falling back to fixed */
4342 pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
4343 + WM_TITLE_BAR_PADDING;
4346 ExitWM(WM_ERROR_EXIT_VALUE);
4349 /* got default font successfully, hack was not needed */
4351 * Calculate title bar's height (using selected font) and store it in pAData.
4353 pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
4354 + WM_TITLE_BAR_PADDING;
4360 * Make standard (inactive) appearance resources.
4363 /* background pixmap */
4365 if (pAData->backgroundPStr)
4367 pAData->backgroundPixmap = XmGetPixmap (
4368 ScreenOfDisplay (DISPLAY,
4370 pAData->backgroundPStr,
4372 pAData->background);
4374 if (pAData->backgroundPixmap == XmUNSPECIFIED_PIXMAP)
4376 pAData->backgroundPixmap = (Pixmap)NULL;
4381 pAData->backgroundPixmap = (Pixmap)NULL;
4384 /* top shadow pixmap */
4386 if (pAData->topShadowPStr)
4389 * Make sure top shadow color is not the same as background
4390 * otherwise the wrong pixmap will be generated.
4392 if (pAData->topShadowColor != pAData->background)
4393 foreground = pAData->topShadowColor;
4395 foreground = pAData->foreground;
4396 pAData->topShadowPixmap = XmGetPixmap (
4397 ScreenOfDisplay (DISPLAY,
4399 pAData->topShadowPStr,
4401 pAData->background);
4403 if (pAData->topShadowPixmap == XmUNSPECIFIED_PIXMAP)
4405 pAData->topShadowPixmap = (Pixmap)NULL;
4410 pAData->topShadowPixmap = (Pixmap)NULL;
4414 /* bottom shadow pixmap */
4416 if (pAData->bottomShadowPStr)
4419 * Make sure bottom shadow color is not the same as background
4420 * otherwise the wrong pixmap will be generated.
4422 if (pAData->bottomShadowColor != pAData->background)
4423 foreground = pAData->bottomShadowColor;
4425 foreground = pAData->foreground;
4426 pAData->bottomShadowPixmap = XmGetPixmap (
4427 ScreenOfDisplay (DISPLAY,
4429 pAData->bottomShadowPStr,
4431 pAData->background);
4433 if (pAData->bottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
4435 pAData->bottomShadowPixmap = (Pixmap)NULL;
4440 pAData->bottomShadowPixmap = (Pixmap)NULL;
4443 /* inactive appearance GC */
4445 GetAppearanceGCs (pSD,
4449 pAData->backgroundPixmap,
4450 pAData->topShadowColor,
4451 pAData->topShadowPixmap,
4452 pAData->bottomShadowColor,
4453 pAData->bottomShadowPixmap,
4454 &(pAData->inactiveGC),
4455 &(pAData->inactiveTopShadowGC),
4456 &(pAData->inactiveBottomShadowGC));
4461 * Make active apppearance resources if specified.
4464 if (!makeActiveResources)
4469 /* active background pixmap */
4471 if (pAData->activeBackgroundPStr)
4473 pAData->activeBackgroundPixmap = XmGetPixmap (
4474 ScreenOfDisplay (DISPLAY,
4476 pAData->activeBackgroundPStr,
4477 pAData->activeForeground,
4478 pAData->activeBackground);
4480 if (pAData->activeBackgroundPixmap == XmUNSPECIFIED_PIXMAP)
4482 pAData->activeBackgroundPixmap = (Pixmap)NULL;
4487 pAData->activeBackgroundPixmap = (Pixmap)NULL;
4490 /* active top shadow pixmap */
4492 if (pAData->activeTopShadowPStr)
4494 pAData->activeTopShadowPixmap = XmGetPixmap (
4495 ScreenOfDisplay (DISPLAY,
4497 pAData->activeTopShadowPStr,
4498 pAData->activeTopShadowColor,
4499 pAData->activeBackground);
4501 if (pAData->activeTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
4503 pAData->activeTopShadowPixmap = (Pixmap)NULL;
4508 pAData->activeTopShadowPixmap = (Pixmap)NULL;
4512 /* active bottom shadow pixmap */
4514 if (pAData->activeBottomShadowPStr)
4516 pAData->activeBottomShadowPixmap = XmGetPixmap (
4517 ScreenOfDisplay (DISPLAY,
4519 pAData->activeBottomShadowPStr,
4520 pAData->activeBottomShadowColor,
4521 pAData->activeBackground);
4523 if (pAData->activeBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
4525 pAData->activeBottomShadowPixmap = (Pixmap)NULL;
4530 pAData->activeBottomShadowPixmap = (Pixmap)NULL;
4533 /* inactive appearance GC */
4535 GetAppearanceGCs (pSD,
4536 pAData->activeForeground,
4537 pAData->activeBackground,
4539 pAData->activeBackgroundPixmap,
4540 pAData->activeTopShadowColor,
4541 pAData->activeTopShadowPixmap,
4542 pAData->activeBottomShadowColor,
4543 pAData->activeBottomShadowPixmap,
4544 &(pAData->activeGC),
4545 &(pAData->activeTopShadowGC),
4546 &(pAData->activeBottomShadowGC));
4549 } /* END OF FUNCTION MakeAppearanceResources */
4553 /*************************************<->*************************************
4555 * GetAppearanceGCs (pSD, fg, bg, font, bg_pixmap, ts_color,
4556 * ts_pixmap, bs_color, bs_pixmap, pGC, ptsGC, pbsGC)
4561 * Creates the appearance GCs for any of the icon, client, or feedback
4567 * pSD - pointer to screen data
4568 * fg - base foreground color
4569 * bg - base background color
4571 * bg_pixmap - background pixmap
4572 * ts_color - top shadow color
4573 * ts_pixmap - top shadow pixmap
4574 * bs_color - bottom shadow color
4575 * bs_pixmap - bottom shadow pixmap
4576 * pGC - pointer to location to receive base GC
4577 * ptsGC - pointer to location to receive top shadow GC
4578 * pbsGC - pointer to location to receive bottom shadow GC
4583 * *ptsGC - top shadow GC
4584 * *pbsGC - bottom shadow GC
4591 *************************************<->***********************************/
4594 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)
4604 mask = GCForeground | GCBackground | GCFont;
4605 gcv.foreground = fg;
4606 gcv.background = bg;
4607 gcv.font = font->fid;
4612 gcv.tile = bg_pixmap;
4615 *pGC = XCreateGC (DISPLAY, pSD->rootWindow, mask, &gcv);
4618 * !!! Need GC error detection !!!
4621 *ptsGC = GetHighlightGC (pSD, ts_color, bg, ts_pixmap);
4623 *pbsGC = GetHighlightGC (pSD, bs_color, bg, bs_pixmap);
4625 } /* END OF FUNCTION GetAppearanceGCs */
4630 /*************************************<->*************************************
4632 * ProcessScreenResources (pSD, screenName)
4637 * This function retrieves resources that are screen specific. If the
4638 * window manager is providing standard behavior then retrieve the limited
4639 * set of resources that don't affect standard behavior and set the
4640 * values of the other resources to the standard values.
4645 * pSD = pointer to screen data
4646 * screenName = name of screen
4651 * pSD = resource data for screen is set
4656 * o Gets subresources based on workspace name
4658 *************************************<->***********************************/
4661 ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName)
4663 pResSD = pSD; /* save current screen data for default processing */
4665 * Use the screen name (e.g., "0") as the default resource name.
4668 if (wmGD.useStandardBehavior)
4670 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4671 (String) screenName,
4672 (String) screenName,
4673 wmStdScreenResources,
4674 XtNumber (wmStdScreenResources), NULL, 0);
4677 * Fill in the standard resource values.
4680 SetStdScreenResourceValues (pSD);
4684 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4685 (String)screenName, (String) screenName,
4687 XtNumber (wmScreenResources), NULL, 0);
4689 pSD->moveOpaque = (((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW)))
4690 -> screen.moveOpaque);
4695 * Do some additional processing on the window manager resource values.
4699 if (pSD->iconImageMinimum.width < ICON_IMAGE_MIN_WIDTH)
4701 pSD->iconImageMinimum.width = ICON_IMAGE_MIN_WIDTH;
4703 else if (pSD->iconImageMinimum.width > ICON_IMAGE_MAX_WIDTH)
4705 pSD->iconImageMinimum.width = ICON_IMAGE_MAX_WIDTH;
4708 if (pSD->iconImageMinimum.height < ICON_IMAGE_MIN_HEIGHT)
4710 pSD->iconImageMinimum.height = ICON_IMAGE_MIN_HEIGHT;
4712 else if (pSD->iconImageMinimum.height > ICON_IMAGE_MAX_HEIGHT)
4714 pSD->iconImageMinimum.height = ICON_IMAGE_MAX_HEIGHT;
4717 if (pSD->iconImageMaximum.width < pSD->iconImageMinimum.width)
4719 pSD->iconImageMaximum.width = pSD->iconImageMinimum.width;
4721 else if (pSD->iconImageMaximum.width > ICON_IMAGE_MAX_WIDTH)
4723 pSD->iconImageMaximum.width = ICON_IMAGE_MAX_WIDTH;
4726 if (pSD->iconImageMaximum.height < pSD->iconImageMinimum.height)
4728 pSD->iconImageMaximum.height = pSD->iconImageMinimum.height;
4730 else if (pSD->iconImageMaximum.height > ICON_IMAGE_MAX_HEIGHT)
4732 pSD->iconImageMaximum.height = ICON_IMAGE_MAX_HEIGHT;
4735 if (pSD->iconPlacementMargin > MAXIMUM_ICON_MARGIN)
4737 pSD->iconPlacementMargin = MAXIMUM_ICON_MARGIN;
4740 if (pSD->maximumMaximumSize.width <= 0)
4742 pSD->maximumMaximumSize.width =
4743 2 * DisplayWidth (DISPLAY, pSD->screen);
4746 if (pSD->maximumMaximumSize.height <= 0)
4748 pSD->maximumMaximumSize.height =
4749 2 * DisplayHeight (DISPLAY, pSD->screen);
4753 * Set the icon appearance default based on whether or not the icon box
4757 if (pSD->iconDecoration & USE_ICON_DEFAULT_APPEARANCE)
4759 if (pSD->useIconBox)
4761 pSD->iconDecoration = ICON_APPEARANCE_ICONBOX;
4765 pSD->iconDecoration = ICON_APPEARANCE_STANDALONE;
4770 * If resizeBorderWidth or frameBorderWidth is unset then initialize
4771 * to dynamic defaults.
4774 if ((pSD->resizeBorderWidth == (Dimension)BIGSIZE) ||
4775 (pSD->frameBorderWidth == (Dimension)BIGSIZE))
4777 double xres, yres, avg_res;
4779 xres = (((double) DisplayWidth(DISPLAY, pSD->screen)) /
4780 ((double) DisplayWidthMM(DISPLAY, pSD->screen)));
4781 yres = (((double) DisplayHeight(DISPLAY, pSD->screen)) /
4782 ((double) DisplayHeightMM(DISPLAY, pSD->screen)));
4784 avg_res = (xres + yres) / 2.0;
4786 /* Multiply times width in mm (avg. 7-8 pixels) */
4787 if (pSD->resizeBorderWidth == (Dimension)BIGSIZE)
4789 pSD->resizeBorderWidth = (int) (avg_res * 2.2);
4791 /* limit size because big borders look ugly */
4792 if (pSD->resizeBorderWidth > 6) pSD->resizeBorderWidth = 6;
4795 /* Multiply times width in mm (avg. 5-6 pixels) */
4796 if (pSD->frameBorderWidth == (Dimension)BIGSIZE)
4798 pSD->frameBorderWidth = (int) (avg_res * 1.7);
4800 /* limit size because big borders look ugly */
4801 if (wmGD.frameStyle == WmSLAB)
4803 if (pSD->frameBorderWidth > 4) pSD->frameBorderWidth = 4;
4807 if (pSD->frameBorderWidth > 5) pSD->frameBorderWidth = 5;
4813 pSD->externalBevel = FRAME_EXTERNAL_SHADOW_WIDTH;
4814 pSD->joinBevel = FRAME_INTERNAL_SHADOW_WIDTH;
4815 if (pSD->frameBorderWidth <
4816 (pSD->externalBevel + MIN_INTERNAL_BEVEL))
4818 pSD->frameBorderWidth =
4819 pSD->externalBevel + MIN_INTERNAL_BEVEL;
4821 else if (pSD->frameBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
4823 pSD->frameBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
4826 if (pSD->resizeBorderWidth <
4827 (pSD->externalBevel + MIN_INTERNAL_BEVEL))
4829 pSD->resizeBorderWidth =
4830 (pSD->externalBevel + MIN_INTERNAL_BEVEL);
4832 else if (pSD->resizeBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
4834 pSD->resizeBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
4838 * Update the resource database.
4840 WriteOutXrmColors (pSD);
4843 * Process the component appearance resources for client,
4844 * icon and feedback parts of mwm.
4847 ProcessAppearanceResources (pSD);
4850 * Process the workspace list and name the initial
4854 ProcessWorkspaceList (pSD);
4857 * Process default backdrop images to be used in low-color
4860 ProcessDefaultBackdropImages (pSD);
4863 * Save the default icon pixmap in global data. We'll use it only
4867 pSD->builtinIconPixmap =
4868 XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char *)iImage_bits,
4869 iImage_width, iImage_height);
4871 } /* END OF FUNCTION ProcessScreenResources */
4873 /*************************************<->*************************************
4875 * ProcessDefaultBackdropImages (pSD)
4880 * This function processes the default backdrop images to be used
4881 * in low color or black and white workspaces.
4886 * pSD = pointer to screen data
4891 * pSD = resource data for screen is set
4897 *************************************<->***********************************/
4900 ProcessDefaultBackdropImages (WmScreenData *pSD)
4902 } /* END OF FUNCTION ProcessDefaultBackdropImages */
4906 /*************************************<->*************************************
4908 * ProcessWorkspaceList (pSD)
4913 * This function processes the workspaceCount and workspaceList
4914 * resources for a particular screen. It creates space for the initial
4915 * workspace data structures and adds in names for workspaces.
4920 * pSD = pointer to screen data
4925 * pSD = resource data for screen is set
4930 * NOTE: The workspaceCount resource has precedence over the
4931 * workspaceList resource. workspaceCount determines the number of
4932 * workspaces to create for the screen. Once the number is determined,
4933 * workspaceList is used to fill in the "names." If workspaceList is
4934 * not present or doesn't have enough names, then missing names are
4935 * generated automatically. If workspaceList is present and
4936 * workspaceCount is not present, then the workspaceCount is determined
4937 * by the number of names in workspaceList.
4939 *************************************<->***********************************/
4942 ProcessWorkspaceList (WmScreenData *pSD)
4944 int i, wsNameCount, wsNamesAlloced;
4945 WmWorkspaceData *pwsI;
4946 unsigned char *lineP = NULL;
4947 unsigned char *string;
4948 Boolean bHaveWorkspaceList;
4949 Boolean bHaveWorkspaceCount;
4950 char **ppchWsNames = NULL;
4953 * Validate initial resource settings
4955 bHaveWorkspaceCount = (pSD->numWorkspaces >= 1);
4956 bHaveWorkspaceList = (pSD->workspaceList != NULL);
4958 if (bHaveWorkspaceList)
4961 * Parse out array of workspace names
4963 wsNamesAlloced = WS_ALLOC_AMOUNT;
4964 ppchWsNames = (char **) XtMalloc (wsNamesAlloced * sizeof (char *));
4965 if (pSD->workspaceList)
4967 lineP = (unsigned char *) pSD->workspaceList;
4971 lineP = (unsigned char *)NULL;
4975 while (((string = GetString(&lineP)) != NULL))
4977 ppchWsNames[wsNameCount] = (char *) string;
4979 if (++wsNameCount >= wsNamesAlloced)
4982 * Need to add more workspaces
4984 wsNamesAlloced += WS_ALLOC_AMOUNT;
4985 if (!(ppchWsNames = (char **) XtRealloc
4986 ((char *)ppchWsNames,
4987 wsNamesAlloced * sizeof(char *))))
4989 ExitWM (WM_ERROR_EXIT_VALUE);
4994 if (!bHaveWorkspaceCount)
4996 pSD->numWorkspaces = wsNameCount;
4999 else if (!bHaveWorkspaceCount)
5002 * Neither workspaceCount nor workspaceList specified!!
5003 * Assume one workspace.
5005 pSD->numWorkspaces = 1;
5008 if (pSD->numWorkspaces > MAX_WORKSPACE_COUNT)
5009 pSD->numWorkspaces = MAX_WORKSPACE_COUNT;
5012 * Allocate the array of workspace data
5014 pSD->numWsDataAllocated = (pSD->numWorkspaces + WS_ALLOC_AMOUNT);
5015 pSD->numWsDataAllocated -= pSD->numWsDataAllocated % WS_ALLOC_AMOUNT;
5016 if (!(pSD->pWS = (WmWorkspaceData *)
5017 XtMalloc (pSD->numWsDataAllocated * sizeof(WmWorkspaceData))))
5019 ExitWM (WM_ERROR_EXIT_VALUE);
5024 for (i = 0; i < pSD->numWorkspaces; i++, pwsI++)
5026 if (bHaveWorkspaceList && i < wsNameCount)
5028 string = (unsigned char *) ppchWsNames[i];
5032 string = GenerateWorkspaceName (pSD, i);
5034 if (!(pwsI->name = (String) XtMalloc (1+strlen((char *)string))))
5036 Warning (((char *)GETMESSAGE(62, 27, "Insufficient memory for workspace data")));
5037 ExitWM(WM_ERROR_EXIT_VALUE);
5041 strcpy(pwsI->name, (char *)string);
5045 if (ppchWsNames) XtFree ((char *) ppchWsNames);
5047 } /* END OF FUNCTION ProcessWorkspaceList */
5051 /******************************<->*************************************
5053 * ProcessWorkspaceResources (pWS)
5058 * This function retrieves resources that are workspace specific. If the
5059 * window manager is providing standard behavior then retrieve the limited
5060 * set of resources that don't affect standard behavior and set the
5061 * values of the other resources to the standard values.
5066 * pWS = pointer to workspace data
5071 * pWS = resource data for workspace is set
5076 * o Gets subresources based on workspace name
5078 ******************************<->***********************************/
5081 ProcessWorkspaceResources (WmWorkspaceData *pWS)
5085 * Retrieve workspace specific resources.
5087 pResWS = pWS; /* save current ws for default processing */
5089 if (wmGD.useStandardBehavior)
5091 XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
5092 pWS->name, pWS->name, wmStdWorkspaceResources,
5093 XtNumber (wmStdWorkspaceResources), NULL, 0);
5096 * Fill in the standard resource values.
5098 * (no code for this right now)
5100 pWS->iconBoxGeometry = NULL;
5104 XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
5105 pWS->name, pWS->name, wmWorkspaceResources,
5106 XtNumber (wmWorkspaceResources), NULL, 0);
5108 /* Dup iconbox geometry, it may be free'd later on. */
5110 if (pWS->iconBoxGeometry)
5112 pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
5116 if (pWS->title == NULL)
5119 * Setup default workspace title
5121 pWS->title = XmStringCreateLocalized(pWS->name);
5126 * Copy resource just in case there's a duplicate
5127 * Duplicates point to the same data, freeing on
5128 * rename can cause a crash.
5130 pWS->title = XmStringCopy(pWS->title);
5135 * Dup iconbox geometry, it may be free'd later on.
5137 if (pWS->iconBoxGeometry)
5139 pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
5143 * Get backdrop resources
5145 XtGetSubresources (pWS->workspaceTopLevelW,
5146 (XtPointer) &(pWS->backdrop),
5147 WmNbackdrop, WmCBackdrop, wmBackdropResources,
5148 XtNumber (wmBackdropResources), NULL, 0);
5150 ProcessBackdropResources (pWS, 0);
5152 } /* END OF FUNCTION ProcessWorkspaceResources */
5154 /******************************<->*************************************
5156 * ProcessPresenceResources (pSD)
5161 * This function retrieves resources for the workspace presence
5166 * pSD = pointer to screen data
5171 * pSD = resource data for workspace presence dialog are set
5176 * o Gets subresources
5178 ******************************<->***********************************/
5181 ProcessPresenceResources (WmScreenData *pSD)
5183 #ifndef NO_MESSAGE_CATALOG
5184 static char *default_ws_pres_title = NULL;
5186 static char *default_ws_pres_title = "Workspace Presence";
5190 unsigned char *pch1, *pch2;
5192 #ifndef NO_MESSAGE_CATALOG
5194 * Set up localized default title string on initial time through
5196 if (default_ws_pres_title == NULL)
5200 * catgets returns a pointer to an area that is over written
5201 * on each call to catgets.
5204 tmpString = ((char *)GETMESSAGE(62, 59, "Occupy Workspace"));
5205 if ((default_ws_pres_title =
5206 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
5208 Warning (((char *)GETMESSAGE(62, 31, "Insufficient memory for local message string")));
5209 default_ws_pres_title = "Occupy Workspace";
5213 strcpy(default_ws_pres_title, tmpString);
5218 if (pSD->presence.shellW)
5220 XtGetSubresources (pSD->presence.shellW, (XtPointer) &pSD->presence,
5221 WmNworkspacePresence, WmCWorkspacePresence,
5222 wmWsPresenceResources,
5223 XtNumber (wmWsPresenceResources), NULL, 0);
5227 if (pSD->presence.title)
5229 pch1 = (unsigned char *)
5230 WmXmStringToString (pSD->presence.title);
5232 if (pch1 && (pch2 = (unsigned char *)
5233 XtMalloc (1+strlen((char *)pch1))))
5235 strcpy ((char *)pch2, (char *)pch1);
5241 pch2 = (unsigned char *) default_ws_pres_title;
5245 XtSetArg (args[n], XmNtitle, pch2); n++;
5246 XtSetValues (pSD->presence.shellW, args, n);
5249 } /* END OF FUNCTION ProcessPresenceResources */
5252 /*************************************<->*************************************
5254 * ProcessClientResources (pCD)
5259 * This function retrieves resources that are client specific. If the
5260 * window manager is providing standard behavior then retrieve the limited
5261 * set of resources that don't affect standard behavior and set the
5262 * values of the other resources to the standard values.
5267 * pCD = pointer to client data
5272 * pCD = resource data for client is set
5277 * o Gets subresources based on client name and class.
5278 * o Creates GC for the client Matte, if there is one.
5280 *************************************<->***********************************/
5283 ProcessClientResources (ClientData *pCD)
5287 WmScreenData *pSD = pCD->pSD;
5290 * Retrieve basic client specific resources.
5293 _pCD = pCD; /* save in static global for dynamic default processing */
5294 clientName = (pCD->clientName) ? pCD->clientName : WmNdefaults;
5295 clientClass = (pCD->clientClass) ? pCD->clientClass : WmNdefaults;
5297 if (wmGD.useStandardBehavior)
5299 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5300 clientClass, wmStdClientResources, XtNumber (wmStdClientResources),
5304 * Fill in the standard resource values.
5307 SetStdClientResourceValues (pCD);
5311 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5312 clientClass, wmClientResources, XtNumber (wmClientResources), NULL,
5316 #ifdef NO_MESSAGE_CATALOG
5318 * If (window menu spec is not found) then use the builtin
5322 if ((pCD->systemMenu == defaultSystemMenuName) &&
5323 (pSD->defaultSystemMenuUseBuiltin == TRUE))
5325 pCD->systemMenu = builtinSystemMenuName;
5330 * If the client decorations or client functions have been defaulted
5331 * fix up the fields in the ProcessMwmHints function.
5335 /* make top and bottom shadow pixmaps */
5337 if (pCD->iconImageBottomShadowPStr)
5339 if ((pCD->iconImageBottomShadowPStr ==
5340 pSD->iconAppearance.bottomShadowPStr) &&
5341 (pCD->iconImageBottomShadowColor ==
5342 pSD->iconAppearance.bottomShadowColor) &&
5343 (pCD->iconImageBackground ==
5344 pSD->iconAppearance.background))
5346 pCD->iconImageBottomShadowPixmap =
5347 pSD->iconAppearance.bottomShadowPixmap;
5351 pCD->iconImageBottomShadowPixmap =
5352 XmGetPixmap ( ScreenOfDisplay (DISPLAY,
5354 pCD->iconImageBottomShadowPStr,
5355 pCD->iconImageBottomShadowColor,
5356 pCD->iconImageBackground);
5358 if (pCD->iconImageBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
5360 pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
5366 pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
5369 if (pCD->iconImageTopShadowPStr)
5371 if ((pCD->iconImageTopShadowPStr ==
5372 pSD->iconAppearance.topShadowPStr) &&
5373 (pCD->iconImageTopShadowColor ==
5374 pSD->iconAppearance.topShadowColor) &&
5375 (pCD->iconImageBackground == pSD->iconAppearance.background))
5377 pCD->iconImageTopShadowPixmap =
5378 pSD->iconAppearance.topShadowPixmap;
5382 pCD->iconImageTopShadowPixmap =
5383 XmGetPixmap ( ScreenOfDisplay (DISPLAY,
5385 pCD->iconImageTopShadowPStr,
5386 pCD->iconImageTopShadowColor,
5387 pCD->iconImageBackground);
5389 if (pCD->iconImageTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
5391 pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
5397 pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
5400 if ((pCD->internalBevel < MIN_INTERNAL_BEVEL) ||
5401 (pCD->internalBevel > MAX_INTERNAL_BEVEL))
5403 pCD->internalBevel = MAX_INTERNAL_BEVEL;
5408 * Retrieve matte resources and make internal matte resources.
5411 if (pCD->matteWidth > 0)
5413 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5414 clientClass, wmClientResourcesM, XtNumber (wmClientResourcesM),
5417 /* make top and bottom shadow pixmaps */
5419 if (pCD->matteBottomShadowPStr &&
5420 (!strcmp(pCD->matteBottomShadowPStr, _NoDither)))
5422 pCD->matteBottomShadowPStr = NULL;
5425 if (pCD->matteBottomShadowPStr)
5427 if ((pCD->matteBottomShadowPStr ==
5428 pSD->clientAppearance.bottomShadowPStr) &&
5429 (pCD->matteBottomShadowColor ==
5430 pSD->clientAppearance.bottomShadowColor) &&
5431 (pCD->matteBackground == pSD->clientAppearance.background))
5433 pCD->matteBottomShadowPixmap =
5434 pSD->clientAppearance.bottomShadowPixmap;
5438 pCD->matteBottomShadowPixmap =
5439 XmGetPixmap (ScreenOfDisplay (DISPLAY,
5441 pCD->matteBottomShadowPStr,
5442 pCD->matteBottomShadowColor,
5443 pCD->matteBackground);
5445 if (pCD->matteBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
5447 pCD->matteBottomShadowPixmap = (Pixmap)NULL;
5453 pCD->matteBottomShadowPixmap = (Pixmap)NULL;
5456 if (pCD->matteTopShadowPStr &&
5457 (!strcmp(pCD->matteTopShadowPStr, _NoDither)))
5459 pCD->matteTopShadowPStr = NULL;
5462 if (pCD->matteTopShadowPStr)
5464 if ((pCD->matteTopShadowPStr ==
5465 pSD->clientAppearance.topShadowPStr) &&
5466 (pCD->matteTopShadowColor ==
5467 pSD->clientAppearance.topShadowColor) &&
5468 (pCD->matteBackground == pSD->clientAppearance.background))
5470 pCD->matteTopShadowPixmap =
5471 pSD->clientAppearance.topShadowPixmap;
5475 pCD->matteTopShadowPixmap =
5476 XmGetPixmap (ScreenOfDisplay (DISPLAY,
5478 pCD->matteTopShadowPStr,
5479 pCD->matteTopShadowColor,
5480 pCD->matteBackground);
5482 if (pCD->matteTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
5484 pCD->matteTopShadowPixmap = (Pixmap)NULL;
5490 pCD->matteTopShadowPixmap = (Pixmap)NULL;
5494 /* make top and bottom shadow GC's */
5496 pCD->clientMatteTopShadowGC = GetHighlightGC (pCD->pSD,
5497 pCD->matteTopShadowColor,
5498 pCD->matteBackground,
5499 pCD->matteTopShadowPixmap);
5501 pCD->clientMatteBottomShadowGC = GetHighlightGC (pCD->pSD,
5502 pCD->matteBottomShadowColor,
5503 pCD->matteBackground,
5504 pCD->matteBottomShadowPixmap);
5507 } /* END OF FUNCTION ProcessClientResources */
5511 /*************************************<->*************************************
5513 * SetStdClientResourceValues (pCD)
5518 * This function sets client resource data to standard values. This setting
5519 * is done in place of getting the values from the user settings in
5520 * the resource database.
5524 * pCD = pointer to the client data
5529 * pCD = (client data filled out with resource values)
5531 *************************************<->***********************************/
5534 SetStdClientResourceValues (ClientData *pCD)
5536 pCD->clientDecoration = WM_DECOR_DEFAULT;
5537 pCD->clientFunctions = WM_FUNC_DEFAULT;
5538 pCD->focusAutoRaise = True;
5539 pCD->systemMenu = builtinSystemMenuName;
5540 pCD->usePPosition = USE_PPOSITION_NONZERO;
5541 pCD->ignoreWMSaveHints = True;
5543 } /* END OF FUNCTION SetStdClientResourceValues */
5547 /******************************<->*************************************
5549 * SetStdScreenResourceValues (pSD)
5554 * This function sets screen resource data to standard values. This setting
5555 * is done in place of getting the values from the user settings in
5556 * the resource database.
5560 * pSD = pointer to the screen data
5565 * pSD = (screen data filled out with resource values)
5567 ******************************<->***********************************/
5570 SetStdScreenResourceValues (WmScreenData *pSD)
5572 pSD->buttonBindings = builtinButtonBindingsName;
5573 pSD->cleanText = True;
5574 pSD->iconDecoration =
5575 (ICON_LABEL_PART | ICON_IMAGE_PART | ICON_ACTIVE_LABEL_PART);
5576 pSD->iconPlacement =
5577 (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY);
5578 pSD->keyBindings = builtinKeyBindingsName;
5579 pSD->limitResize = True;
5580 pSD->resizeCursors = True;
5581 pSD->transientDecoration = (WM_DECOR_SYSTEM | WM_DECOR_RESIZEH);
5582 pSD->transientFunctions =
5583 (WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE |
5585 pSD->useIconBox = False;
5587 pSD->feedbackGeometry = NULL;
5588 pSD->moveOpaque = False;
5590 } /* END OF FUNCTION SetStdScreenResourceValues */
5593 /*************************************<->*************************************
5595 * GetHighlightGC (pSD, fg, bg, pixmap)
5600 * Get a graphic context for either drawing top- or bottom-shadow
5606 * pSD = pointer to screen data
5607 * fg = foreground color
5608 * bg = background color
5609 * pixmap = pixmap for highlight
5613 * RETRUN = GC with the input parameters incorporated.
5615 *************************************<->***********************************/
5617 GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap)
5623 mask = GCForeground | GCBackground | GCLineWidth | GCFillStyle;
5624 gcv.background = bg;
5625 gcv.foreground = fg;
5630 mask |= GCFillStyle | GCTile;
5631 gcv.fill_style = FillTiled;
5636 gcv.fill_style = FillSolid;
5641 * NOTE: If additional mask bits are added, modify WmGetGC()
5642 * in WmGraphics.c to check those values for matches.
5645 return (WmGetGC (pSD, mask, &gcv));
5646 #endif /* OLD_CODE */
5648 return (XtGetGC (pSD->screenTopLevelW, mask, &gcv));
5650 } /* END OF FUNCTION GetHighlightGC */
5654 /*************************************<->*************************************
5656 * _WmGetDynamicDefault (widget, type, defaultColor, newBackground, value)
5661 * This function is used to generate a default color of the requested
5662 * type. Default colors are generated for a 3-D appearance.
5667 * widget = this is the widget that is associated with the resource or
5668 * that is the reference widget for the wm subpart.
5670 * type = this is the type of color resource (e.g., top shadow color).
5672 * defaultColor = pointer to default color name/specification.
5674 * newBackground = background pixel for generating 3-D colors.
5679 * value = pointer to the XrmValue in which to store the color
5681 *************************************<->***********************************/
5684 _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value)
5686 static Screen *oldScreen = NULL;
5687 static Screen *newScreen;
5688 static Colormap oldColormap;
5689 static Colormap newColormap;
5690 static Pixel newValue;
5691 static Pixel background;
5692 static String oldDefaultColor = DEFAULT_COLOR_NONE;
5693 static XmColorData colorData;
5695 /* initialize the return value */
5697 value->size = sizeof (newValue);
5698 value->addr = (char *)&newValue;
5702 * Process monochrome defaults first.
5705 newScreen = XtScreen (widget);
5707 if (Monochrome (newScreen))
5711 * Check color server sets for this screen.
5713 if (wmGD.statusColorServer == CSERVE_NORMAL)
5718 for (i = 0; i < wmGD.numScreens; i++)
5720 if (XScreenNumberOfScreen(newScreen) == wmGD.Screens[i].screen)
5722 pSD = &wmGD.Screens[i];
5731 for (i = 0; i < XmCO_MAX_NUM_COLORS; i++)
5733 if (pSD->pPixelData[i].bg == newBackground)
5737 case WmFGC: newValue = pSD->pPixelData[i].fg; break;
5738 case WmBGC: newValue = pSD->pPixelData[i].bg; break;
5739 case WmTSC: newValue = pSD->pPixelData[i].ts; break;
5740 case WmBSC: newValue = pSD->pPixelData[i].bs; break;
5753 case WmFGC: newValue = BlackPixelOfScreen (newScreen); break;
5754 case WmBGC: newValue = WhitePixelOfScreen (newScreen); break;
5755 case WmTSC: newValue = WhitePixelOfScreen (newScreen); break;
5756 case WmBSC: newValue = BlackPixelOfScreen (newScreen); break;
5764 * Check to see if appropriate colors are available from the
5765 * previous request; if the color is a background color then get
5766 * default colors. Generate 3-D colors if necessary. Maintain
5767 * new colors in static variables for later reuse.
5770 newColormap = widget->core.colormap;
5772 if ((oldScreen != NULL) && (oldScreen == newScreen) &&
5773 (oldColormap == newColormap) && (type != WmBGC) &&
5774 (background == newBackground))
5777 else if ((oldScreen == newScreen) && (oldColormap == newColormap) &&
5778 (type == WmBGC) && (oldDefaultColor == defaultColor))
5781 else if (type == WmBGC)
5784 * Find or generate a background color and associated 3-D colors.
5787 oldDefaultColor = defaultColor;
5789 * Fix for CR 5152 - Due to the use of Realloc in the color caches,
5790 * a static pointer is not acceptable. Change it
5791 * to a static structure to maintain the data
5793 colorData = *_WmGetDefaultColors (newScreen, newColormap, defaultColor);
5798 * Find or generate a color based on the associated background color.
5801 oldDefaultColor = DEFAULT_COLOR_NONE;
5802 background = newBackground;
5804 XmGetColors(newScreen, newColormap, background,
5805 &colorData.foreground.pixel,
5806 &colorData.top_shadow.pixel,
5807 &colorData.bottom_shadow.pixel,
5808 &colorData.select.pixel);
5811 oldScreen = newScreen;
5812 oldColormap = newColormap;
5816 * Set up the return value.
5819 colorData.allocated |= type;
5822 case XmBACKGROUND: newValue = colorData.background.pixel; break;
5823 case XmFOREGROUND: newValue = colorData.foreground.pixel; break;
5824 case XmTOP_SHADOW: newValue = colorData.top_shadow.pixel; break;
5825 case XmBOTTOM_SHADOW: newValue = colorData.bottom_shadow.pixel; break;
5826 case XmSELECT: newValue = colorData.select.pixel; break;
5827 default: newValue = colorData.background.pixel; break;
5830 } /* END OF FUNCTION _WmGetDynamicDefault */
5834 /*************************************<->*************************************
5836 * _WmGetDefaultColors (screen, colormap, defaultColor)
5841 * This function is used to find or generate default 3-D colors based on a
5842 * default background color.
5847 * screen = screen for which colors are to be generated.
5849 * colormap = colormap that is to be used to make colors.
5851 * defaultColor = pointer to a default color name/specification.
5856 * RETURN = pointer to WmColorData structure containing 3-D colors.
5858 *************************************<->***********************************/
5860 XmColorData * _WmGetDefaultColors (Screen *screen, Colormap colormap,
5861 String defaultColor)
5863 static XmColorData *defaultSet[2] = {NULL, NULL};
5864 static int defaultCount[2] = {0, 0};
5865 static int defaultSize[2] = {0, 0};
5871 Display *display = DisplayOfScreen (screen);
5875 * Fix for CR 5152 - Due to the use of Realloc with _XmGetColors, it is
5876 * necessary to maintain a separate cache of color
5877 * data. The Realloc may cause the data to be moved,
5878 * and the cache would contain pointers into the heap.
5882 * Look through the cache to see if the defaults are already in the
5883 * cache. There is a list of cached defaults for each default color.
5886 if (defaultColor == _defaultColor2)
5895 set = defaultSet[setId];
5896 count = defaultCount[setId];
5897 size = defaultSize[setId];
5899 for (i = 0; i < count; i++)
5901 if (((set + i)->screen == screen) && ((set + i)->color_map == colormap))
5908 * No match in the cache, make a new entry and generate the colors.
5913 size = (defaultSize[setId] += 10);
5914 set = defaultSet[setId] =
5915 (XmColorData *)WmRealloc ((char *) defaultSet[setId],
5916 sizeof (XmColorData) * size);
5920 * Make the default background color for the resource set.
5923 if(!XParseColor (display, colormap, defaultColor, &colorDef))
5925 if(!(strcmp(defaultColor, _defaultColor1)))
5927 XParseColor (display, colormap, _defaultColor1HEX, &colorDef);
5931 XParseColor (display, colormap, _defaultColor2HEX, &colorDef);
5935 XAllocColor (display, colormap, &colorDef);
5939 * Generate the 3-D colors and save them in the defaults cache.
5942 XmGetColors(screen, colormap, colorDef.pixel,
5943 &set[count].foreground.pixel,
5944 &set[count].top_shadow.pixel,
5945 &set[count].bottom_shadow.pixel,
5946 &set[count].select.pixel);
5948 set[count].background.pixel = colorDef.pixel;
5950 set[count].screen = screen;
5951 set[count].color_map = colormap;
5952 set[count].allocated = True;
5954 XQueryColor(DISPLAY, colormap, &(set[count].background));
5955 XQueryColor(DISPLAY, colormap, &(set[count].foreground));
5956 XQueryColor(DISPLAY, colormap, &(set[count].top_shadow));
5957 XQueryColor(DISPLAY, colormap, &(set[count].bottom_shadow));
5958 XQueryColor(DISPLAY, colormap, &(set[count].select));
5960 (defaultCount[setId])++;
5962 return (set + count);
5965 } /* END OF FUNCTION _WmGetDefaultColors */
5969 /*************************************<->*************************************
5971 * WmRealloc (ptr, size)
5976 * This function is used reallocate a block of storage that has been
5982 * ptr = pointer to storage that is to be realloc'ed; if NULL malloc an
5983 * initial block of storage.
5985 * size = size of new storage
5989 * RETURN = pointer to realloc'ed block of storage
5991 *************************************<->***********************************/
5993 char * WmRealloc (char *ptr, unsigned size)
5997 ptr = (char *)XtRealloc (ptr, size);
6001 ptr = (char *)XtMalloc (size);
6006 Warning (((char *)GETMESSAGE(62, 37, "Insufficient memory for window manager data")));
6011 } /* END OF FUNCTION WmRealloc */
6015 /*************************************<->*************************************
6017 * WmMalloc (ptr, size)
6022 * This function is used malloc a block of storage. If a previous block
6023 * of storage is being replace the old block is free'd.
6028 * ptr = pointer to storage that is to be replaced (free'd).
6030 * size = size of new storage
6034 * RETURN = pointer to malloc'ed block of storage
6036 *************************************<->***********************************/
6038 char * WmMalloc (char *ptr, unsigned size)
6045 ptr = (char *)XtMalloc (size);
6049 Warning (((char *)GETMESSAGE(62, 38, "Insufficient memory for window manager data")));
6054 } /* END OF FUNCTION WmMalloc */
6058 /*************************************<->*************************************
6060 * SetupDefaultResources (pSD)
6065 * This function is used to setup default (builtin) resources for the
6071 * pSD = pointer to screen data
6072 * wmGD = (defaultKeyBindingsString, ...)
6074 * builtinKeyBindingsName = name of default key bindings set
6081 *************************************<->***********************************/
6084 SetupDefaultResources (WmScreenData *pSD)
6086 KeySpec *nextKeySpec;
6092 * If (using DefaultBindings mechanism and bindings are not found in .mwmrc)
6093 * then use the builtin bindings.
6095 if (!pSD->keySpecs && !wmGD.useStandardBehavior)
6098 * Print warning if user is NOT using "DefaultKeyBindings".
6100 if (strcmp (pSD->keyBindings, defaultKeyBindingsName))
6102 MWarning (((char *)GETMESSAGE(62, 67, "Key bindings %s not found, using builtin key bindings\n")),
6105 pSD->keyBindings = builtinKeyBindingsName;
6108 if (!pSD->buttonSpecs && !wmGD.useStandardBehavior)
6111 * Print warning if user is NOT using "DefaultButtonBindings".
6113 if (strcmp (pSD->buttonBindings, defaultButtonBindingsName))
6115 MWarning (((char *)GETMESSAGE(62, 68, "Button bindings %s not found, using builtin button bindings\n")),
6116 pSD->buttonBindings);
6118 pSD->buttonBindings = builtinButtonBindingsName;
6121 if (pSD->keyBindings == builtinKeyBindingsName)
6124 * Default key specifications are to be used and no default
6125 * set has been provided by the user. Make the built-in default
6129 ParseKeyStr (pSD, (unsigned char *)builtinKeyBindings);
6134 * Add the switch behavior key binding to the front of the list
6135 * of user specified key bindings that have been parsed.
6138 nextKeySpec = pSD->keySpecs;
6139 keyBindings = pSD->keyBindings;
6140 pSD->keyBindings = behaviorKeyBindingName;
6141 pSD->keySpecs = NULL;
6143 ParseKeyStr (pSD, (unsigned char *)behaviorKeyBindings);
6147 /* Skip past the TWO key definitions (1.2 & 1.1.4) */
6148 pSD->keySpecs->nextKeySpec->nextKeySpec = nextKeySpec;
6152 pSD->keySpecs = nextKeySpec;
6154 pSD->keyBindings = keyBindings;
6157 if (pSD->buttonBindings == builtinButtonBindingsName)
6160 * Default button specifications are to be used and no default
6161 * set has been provided by the user. Make the built-in default
6165 ParseButtonStr (pSD, (unsigned char *)builtinButtonBindings);
6168 #ifdef NO_MESSAGE_CATALOG
6170 * Set defaultSystemMenuUseBuiltin to FALSE if DefaultWindowMenu spec
6174 menuSpec = pSD->menuSpecs;
6177 if (!strcmp(menuSpec->name, defaultSystemMenuName))
6179 pSD->defaultSystemMenuUseBuiltin = FALSE;
6182 menuSpec = menuSpec->nextMenuSpec;
6186 } /* END OF FUNCTION SetupDefaultResources */
6190 /*************************************<->*************************************
6192 * SimilarAppearanceData (pAD1, pAD2)
6197 * This function returns True if the two passed sets of AppearanceData
6198 * are similar. This is designed to compare appearance data before
6199 * creation of the GCs.
6204 * pAD1 pointer to AppearanceData 1
6205 * pAD2 pointer to AppearanceData 2
6210 * Function returns True if similar, False otherwise.
6214 * This function is only used to compare the client
6215 * and client*title appearance data.
6216 *************************************<->***********************************/
6218 Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2)
6223 if ((pAD1->fontList == pAD2->fontList) &&
6224 (pAD1->background == pAD2->background) &&
6225 (pAD1->foreground == pAD2->foreground) &&
6226 (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
6227 (pAD1->backgroundPixmap == pAD2->backgroundPixmap) &&
6228 (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
6229 (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
6230 (pAD1->bottomShadowPixmap == pAD2->bottomShadowPixmap) &&
6231 (pAD1->topShadowColor == pAD2->topShadowColor) &&
6232 (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
6233 (pAD1->topShadowPixmap == pAD2->topShadowPixmap) &&
6234 (pAD1->activeBackground == pAD2->activeBackground) &&
6235 (pAD1->activeForeground == pAD2->activeForeground) &&
6236 (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
6237 (pAD1->activeBackgroundPixmap == pAD2->activeBackgroundPixmap) &&
6238 (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
6239 (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
6240 (pAD1->activeBottomShadowPixmap == pAD2->activeBottomShadowPixmap) &&
6241 (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
6242 (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) &&
6243 (pAD1->activeTopShadowPixmap == pAD2->activeTopShadowPixmap) )
6246 * !!! Should find out why all the Pixmap resources are unset !!!
6249 if ((pAD1->fontList == pAD2->fontList) &&
6250 (pAD1->background == pAD2->background) &&
6251 (pAD1->foreground == pAD2->foreground) &&
6252 (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
6253 (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
6254 (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
6255 (pAD1->topShadowColor == pAD2->topShadowColor) &&
6256 (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
6257 (pAD1->activeBackground == pAD2->activeBackground) &&
6258 (pAD1->activeForeground == pAD2->activeForeground) &&
6259 (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
6260 (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
6261 (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
6262 (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
6263 (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) )
6275 } /* END OF FUNCTION SimilarAppearanceData */
6277 /*************************************<->*************************************
6279 * Monochrome (screen)
6284 * This function returns True if the screen passed it to be treated
6285 * as monochrome for the purpose of assigning default resources.
6290 * screen pointer to Screen
6295 * Function returns True if monochrome (or Static Gray), False otherwise.
6297 *************************************<->***********************************/
6300 Monochrome (Screen *screen)
6306 if (wmGD.statusColorServer == CSERVE_NORMAL)
6308 for (scr = 0; scr < wmGD.numScreens; scr++)
6310 pSD = &(wmGD.Screens[scr]);
6314 if (XScreenOfDisplay (DISPLAY, pSD->screen) == screen)
6316 if (pSD->colorUse == XmCO_BLACK_WHITE)
6329 * If we don't know the answer to our question by now,
6330 * fall back to the old mwm way of determining monochromicity.
6334 return ((DefaultDepthOfScreen(screen) == 1));
6335 } /* END OF FUNCTION Monochrome */
6337 /**************************** eof ***************************/