2 * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC.
10 static char rcsid[] = "$TOG: WmResource.c /main/14 1997/04/15 10:30:02 dbl $"
14 * (c) Copyright 1987, 1988, 1989, 1990, 1993, 1994 HEWLETT-PACKARD COMPANY
15 * (c) Copyright 1993, 1994 International Business Machines Corp.
16 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
17 * (c) Copyright 1993, 1994 Novell, Inc.
25 #include "WmResNames.h"
27 #define MWM_NEED_IIMAGE
28 #include "WmIBitmap.h"
33 #include <Xm/RowColumn.h>
34 #ifndef MOTIF_ONE_DOT_ONE
35 #include <Xm/ScreenP.h> /* for XmGetXmScreen and screen.moveOpaque */
39 * include extern functions
41 #include "WmResource.h"
43 #include "WmGraphics.h"
45 #include "WmResParse.h"
47 #include "WmBackdrop.h"
48 #include "WmIconBox.h"
49 #include "WmWrkspace.h"
50 #include <Dt/GetDispRes.h>
51 #define cfileP (wmGD.pWmPB->pFile) /* fopen'ed configuration file or NULL */
56 * Function Declarations:
58 XmColorData *_WmGetDefaultColors ();
60 void _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value);
61 void _WmIconImageFDefault (Widget widget, int offset, XrmValue *value);
62 void _WmIconImageBDefault (Widget widget, int offset, XrmValue *value);
63 void _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value);
64 void _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value);
65 void _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value);
66 void _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value);
67 void _WmMatteFDefault (Widget widget, int offset, XrmValue *value);
68 void _WmMatteBDefault (Widget widget, int offset, XrmValue *value);
69 void _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value);
70 void _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value);
71 void _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value);
72 void _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value);
73 void _WmBackgroundDefault (Widget widget, int offset, XrmValue *value);
74 void _WmForegroundDefault (Widget widget, int offset, XrmValue *value);
75 void _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value);
76 void _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value);
77 void _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value);
78 void _WmABackgroundDefault (Widget widget, int offset, XrmValue *value);
79 void _WmAForegroundDefault (Widget widget, int offset, XrmValue *value);
80 void _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value);
81 void _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value);
82 void _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value);
83 void _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value);
84 void _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value);
85 void _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value);
86 void ProcessWmResources (void);
87 void ProcessGlobalScreenResources (void);
88 void SetStdGlobalResourceValues (void);
89 void ProcessScreenListResource (void);
90 void ProcessAppearanceResources (WmScreenData *pSD);
91 void MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources);
92 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);
93 void ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName);
94 void ProcessWorkspaceResources (WmWorkspaceData *pWS);
95 void ProcessClientResources (ClientData *pCD);
96 void SetStdClientResourceValues (ClientData *pCD);
97 void SetStdScreenResourceValues (WmScreenData *pSD);
98 GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap);
100 static void WriteOutXrmColors (WmScreenData *pSD);
103 void ProcessPresenceResources (WmScreenData *pSD);
104 void ProcessDefaultBackdropImages (WmScreenData *pSD);
105 void _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value);
106 void _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value);
107 void _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value);
108 void _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value);
109 void _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value);
110 int DefaultWsColorSetId (WmWorkspaceData *pWS);
112 void _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value);
113 Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2);
121 /* builtin window menu specification */
123 #ifndef NO_MESSAGE_CATALOG
125 * Use the same name as builtin to let the message catalog menu
126 * take precedence over any menus that might match in sys.mwmrc
128 char defaultSystemMenuName[] = "_MwmWindowMenu_";
130 char defaultSystemMenuName[] = "DefaultWindowMenu";
131 #endif /* NO_MESSAGE_CATALOG */
132 char builtinSystemMenuName[] = "_MwmWindowMenu_";
134 #define BUILTINSYSTEMMENU "_MwmWindowMenu_\n\
136 Restore _R Alt<Key>F5 f.restore\n\
137 Move _M Alt<Key>F7 f.move\n\
138 Size _S Alt<Key>F8 f.resize\n\
139 Minimize _n Alt<Key>F9 f.minimize\n\
140 Maximize _x Alt<Key>F10 f.maximize\n\
141 Lower _L Alt<Key>F3 f.lower\n\
142 no-label f.separator\n\
143 Close _C Alt<Key>F4 f.kill\n\
145 #ifdef NO_MESSAGE_CATALOG
146 char builtinSystemMenu[] = BUILTINSYSTEMMENU;
147 #else /* !defined(NO_MESSAGE_CATALOG)*/
148 char *builtinSystemMenu = BUILTINSYSTEMMENU;
150 #define DEFAULT_DTWM_SYSTEMMENU "_MwmWindowMenu_\n\
152 Restore _R f.restore\n\
155 Minimize _n f.minimize\n\
156 Maximize _x f.maximize\n\
158 no-label f.separator\n\
159 \"Occupy Workspace...\" _O f.workspace_presence\n\
160 \"Occupy All Workspaces\" _A f.occupy_all\n\
161 \"Unoccupy Workspace\" _U f.remove\n\
162 no-label f.separator\n\
163 Close _C Alt<Key>F4 f.kill\n\
167 void InitBuiltinSystemMenu(void)
170 char *ResString = NULL;
171 char *MovString = NULL;
172 char *SizString = NULL;
173 char *MinString = NULL;
174 char *MaxString = NULL;
175 char *LowString = NULL;
177 char *OcpString = NULL;
178 char *OcaString = NULL;
179 char *RemString = NULL;
181 char *CloString = NULL;
188 tmpString = ((char *)GETMESSAGE(62, 60, "Restore _R Alt<Key>F5 f.restore"));
190 tmpString = ((char *)GETMESSAGE(62, 49, "Restore _R f.restore"));
193 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
195 Warning (((char *)GETMESSAGE(62, 2, "Insufficient memory for local default menu.")));
200 strcpy(ResString, tmpString);
206 tmpString = ((char *)GETMESSAGE(62, 61, "Move _M Alt<Key>F7 f.move"));
208 tmpString = ((char *)GETMESSAGE(62, 50, "Move _M f.move"));
211 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
213 Warning (((char *)GETMESSAGE(62, 4, "Insufficient memory for local default menu.")));
218 strcpy(MovString, tmpString);
224 tmpString = ((char *)GETMESSAGE(62, 62, "Size _S Alt<Key>F8 f.resize"));
226 tmpString = ((char *)GETMESSAGE(62, 51, "Size _S f.resize"));
229 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
231 Warning (((char *)GETMESSAGE(62, 6, "Insufficient memory for local default menu.")));
236 strcpy(SizString, tmpString);
242 tmpString = ((char *)GETMESSAGE(62, 63, "Minimize _n Alt<Key>F9 f.minimize"));
244 tmpString = ((char *)GETMESSAGE(62, 52, "Minimize _n f.minimize"));
247 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
249 Warning (((char *)GETMESSAGE(62, 8, "Insufficient memory for local default menu.")));
254 strcpy(MinString, tmpString);
260 tmpString = ((char *)GETMESSAGE(62, 64, "Maximize _x Alt<Key>F10 f.maximize"));
262 tmpString = ((char *)GETMESSAGE(62, 53, "Maximize _x f.maximize"));
265 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
267 Warning (((char *)GETMESSAGE(62, 10, "Insufficient memory for local default menu.")));
272 strcpy(MaxString, tmpString);
278 tmpString = ((char *)GETMESSAGE(62, 65, "Lower _L Alt<Key>F3 f.lower"));
280 tmpString = ((char *)GETMESSAGE(62, 54, "Lower _L f.lower"));
283 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
285 Warning (((char *)GETMESSAGE(62, 12, "Insufficient memory for local default menu.")));
290 strcpy(LowString, tmpString);
298 tmpString = ((char *)GETMESSAGE(62, 55, "Occupy\\ Workspace\\.\\.\\. _O f.workspace_presence"));
300 (char *)XtMalloc ((unsigned int)
301 (strlen(tmpString) + 1))) == NULL)
303 Warning (((char *)GETMESSAGE(62, 14, "Insufficient memory for local default menu.")));
308 strcpy(OcpString, tmpString);
313 tmpString = ((char *)GETMESSAGE(62, 56, "Occupy\\ All\\ Workspaces _A f.occupy_all"));
315 (char *)XtMalloc ((unsigned int)
316 (strlen(tmpString) + 1))) == NULL)
318 Warning (((char *)GETMESSAGE(62, 16, "Insufficient memory for local default menu.")));
323 strcpy(OcaString, tmpString);
328 tmpString = ((char *)GETMESSAGE(62, 57, "Unoccupy\\ Workspace _U f.remove"));
330 (char *)XtMalloc ((unsigned int)
331 (strlen(tmpString) + 1))) == NULL)
333 Warning (((char *)GETMESSAGE(62, 18, "Insufficient memory for local default menu.")));
338 strcpy(RemString, tmpString);
345 tmpString = ((char *)GETMESSAGE(62, 48, "Close _C Alt<Key>F4 f.kill"));
347 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
349 Warning (((char *)GETMESSAGE(62, 20, "Insufficient memory for local default menu.")));
354 strcpy(CloString, tmpString);
363 builtinSystemMenu = (char *)
364 XtNewString((String)DEFAULT_DTWM_SYSTEMMENU);
368 builtinSystemMenu = (char *)
369 XtNewString((String)BUILTINSYSTEMMENU);
372 builtinSystemMenu = (char *)
373 XtNewString((String)BUILTINSYSTEMMENU);
378 /* put it together */
379 strcpy(dsm, defaultSystemMenuName);
380 strcat(dsm, "\n{\n");
381 strcat(dsm, ResString);
383 strcat(dsm, MovString);
385 strcat(dsm, SizString);
387 strcat(dsm, MinString);
389 strcat(dsm, MaxString);
391 strcat(dsm, LowString);
393 strcat(dsm, " no-label f.separator\n");
397 strcat(dsm, OcpString);
399 strcat(dsm, OcaString);
401 strcat(dsm, RemString);
403 strcat(dsm, " no-label f.separator\n");
406 strcat(dsm, CloString);
409 if ((builtinSystemMenu =
410 (char *)XtMalloc ((unsigned int) (strlen(dsm) + 1))) == NULL)
412 Warning (((char *)GETMESSAGE(62, 21, "Insufficient memory for localized default system menu")));
416 builtinSystemMenu = (char *)
417 XtNewString((String)DEFAULT_DTWM_SYSTEMMENU);
421 builtinSystemMenu = (char *)
422 XtNewString((String)BUILTINSYSTEMMENU);
425 builtinSystemMenu = (char *)
426 XtNewString((String)BUILTINSYSTEMMENU);
431 strcpy(builtinSystemMenu, dsm);
435 if (ResString != NULL)
437 if (MovString != NULL)
439 if (SizString != NULL)
441 if (MinString != NULL)
443 if (MaxString != NULL)
445 if (LowString != NULL)
448 if (OcpString != NULL)
450 if (OcaString != NULL)
452 if (RemString != NULL)
455 if (CloString != NULL)
458 } /* END OF FUNCTION InitBuiltinSystemMenu */
459 #endif /* NO_MESSAGE_CATALOG */
461 char builtinSystemMenu[];
465 #define HARD_CODED_PRIMARY 3
467 char defaultRootMenuName[] = "DefaultRootMenu";
468 char builtinRootMenuName[] = "_MwmRootMenu_";
470 #define BUILTINROOTMENU "DefaultRootMenu\n\
472 \"Root Menu\" f.title\n\
473 \"New Window\" f.exec \"xterm &\"\n\
474 \"Shuffle Up\" f.circle_up\n\
475 \"Shuffle Down\" f.circle_down\n\
476 \"Refresh\" f.refresh\n\
477 \"Pack Icons\" f.pack_icons\n\
478 no-label f.separator\n\
479 \"Restart...\" f.restart\n\
481 char builtinRootMenu[] = BUILTINROOTMENU
483 char builtinRootMenu[];
487 /* builtin key bindings specification */
489 char defaultKeyBindingsName[] = "DefaultKeyBindings";
490 char builtinKeyBindingsName[] = "_MwmKeyBindings_";
492 #define BUILTINKEYBINDINGS "_MwmKeyBindings_\n\
494 Shift<Key>Escape window|icon f.post_wmenu\n\
495 Alt<Key>space window|icon f.post_wmenu\n\
496 Alt<Key>Tab root|icon|window f.next_key\n\
497 Alt Shift<Key>Tab root|icon|window f.prev_key\n\
498 Alt<Key>Escape root|icon|window f.circle_down\n\
499 Alt Shift<Key>Escape root|icon|window f.circle_up\n\
500 Alt Shift Ctrl<Key>exclam root|icon|window f.set_behavior\n\
501 Alt Ctrl<Key>1 root|icon|window f.set_behavior\n\
502 Alt<Key>F6 window f.next_key transient\n\
503 Alt Shift<Key>F6 window f.prev_key transient\n\
504 Shift<Key>F10 icon f.post_wmenu\n\
506 char builtinKeyBindings[] = BUILTINKEYBINDINGS
509 char builtinKeyBindings[];
513 * NOTE: Default Toggle Behavior key bindings. There are TWO key bindings as
514 * of 1.1.4 and 1.2. Make sure you make any modify builtinKeyBindings (above)
515 * whenever modifying behaviorKeyBindings.
518 char behaviorKeyBindingName[] = "_MwmBehaviorKey_";
520 #define BEHAVIORKEYBINDINGS "_MwmBehaviorKey_\n\
522 Alt Shift Ctrl<Key>exclam root|icon|window f.set_behavior\n\
523 Alt Ctrl<Key>1 root|icon|window f.set_behavior\n\
525 char behaviorKeyBindings[] = BEHAVIORKEYBINDINGS
528 char behaviorKeyBindings[];
532 /* default button bindings specification */
533 /* note - the %s will be replaced by the real DefaultRootMenu */
535 char defaultButtonBindingsName[] = "DefaultButtonBindings";
536 char builtinButtonBindingsName[] = "_MwmButtonBindings_";
538 # if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
539 # define BUILTINBUTTONBINDINGS "_MwmButtonBindings_\n\
541 <Btn1Down> icon|frame f.raise\n\
542 <Btn3Down> icon|frame f.post_wmenu\n\
543 <Btn3Down> root f.menu %s\n\
546 # define BUILTINBUTTONBINDINGS "_MwmButtonBindings_\n\
548 <Btn1Down> icon|frame f.raise\n\
549 <Btn3Down> icon|frame f.post_wmenu\n\
550 <Btn3Down> root f.menu DefaultRootMenu\n\
552 # endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
553 char builtinButtonBindings[] = BUILTINBUTTONBINDINGS
556 char builtinButtonBindings[];
560 static ClientData *_pCD;
561 static String _defaultBackground;
562 static String _defaultActiveBackground;
563 static AppearanceData *_pAppearanceData;
565 static WmWorkspaceData *pResWS;
566 static WmScreenData *pResSD;
569 static char _defaultColor1HEX[] = "#A8A8A8A8A8A8";
570 static char _defaultColor2HEX[] = "#5F5F92929E9E";
572 static char _defaultColor1[] = "LightGrey";
573 static char _defaultColor2[] = "CadetBlue";
574 #define DEFAULT_COLOR_NONE NULL
576 Const char _foreground[] = "foreground";
577 Const char _75_foreground[] = "75_foreground";
578 Const char _50_foreground[] = "50_foreground";
579 Const char _25_foreground[] = "25_foreground";
581 Const char *_Dither = XmCO_DITHER;
582 Const char *_NoDither = XmCO_NO_DITHER;
583 Const char CLIENT_FRAME_PART[] = "client";
584 Const char ICON_FRAME_PART[] = "icon";
585 Const char FEEDBACK_FRAME_PART[] = "feedback";
586 Const char MENU_ITEM_PART[] = "menu";
589 #define WmBGC XmBACKGROUND
590 #define WmFGC XmFOREGROUND
591 #define WmTSC XmTOP_SHADOW
592 #define WmBSC XmBOTTOM_SHADOW
594 #define MAX_SHORT 0xffff
597 #define BITMAPDIR "/usr/include/X11/bitmaps/"
601 /*************************************<->*************************************
608 * This data structure is used in the processing of mwm general
609 * appearance and behavior resources. These resources are specified
610 * with the following syntax:
612 * "Mwm*<resource_identifier>".
614 *************************************<->***********************************/
617 XtResource wmGlobalResources[] =
625 XtOffsetOf(WmGlobalData, autoKeyFocus),
635 XtOffsetOf(WmGlobalData, autoRaiseDelay),
645 XtOffsetOf(WmGlobalData, bitmapDirectory),
655 XtOffsetOf(WmGlobalData, blinkOnExec),
659 #endif /* MINIMAL_DT */
665 XtOffsetOf(WmGlobalData, frameStyle),
667 (XtPointer)WmRECESSED
675 XtOffsetOf(WmGlobalData, clientAutoPlace),
681 WmNcolormapFocusPolicy,
682 WmCColormapFocusPolicy,
685 XtOffsetOf(WmGlobalData, colormapFocusPolicy),
687 (XtPointer)CMAP_FOCUS_KEYBOARD
695 XtOffsetOf(WmGlobalData, configFile),
706 XtOffsetOf(WmGlobalData, cppCommand),
713 WmNdeiconifyKeyFocus,
714 WmCDeiconifyKeyFocus,
717 XtOffsetOf(WmGlobalData, deiconifyKeyFocus),
727 XtOffsetOf(WmGlobalData, doubleClickTime),
729 (XtPointer)_WmMultiClickTimeDefault
737 XtOffsetOf(WmGlobalData, enableWarp),
747 XtOffsetOf(WmGlobalData, enforceKeyFocus),
753 WmNframeExternalShadowWidth,
754 WmCFrameExternalShadowWidth,
757 XtOffsetOf(WmGlobalData, frameExternalShadowWidth),
768 XtOffsetOf(WmGlobalData, freezeOnConfig),
779 XtOffsetOf(WmGlobalData, useWindowOutline),
790 XtOffsetOf(WmGlobalData, iconAutoPlace),
796 WmNiconExternalShadowWidth,
797 WmCIconExternalShadowWidth,
800 XtOffsetOf(WmGlobalData, iconExternalShadowWidth),
811 XtOffsetOf(WmGlobalData, iconClick),
817 WmNinteractivePlacement,
818 WmCInteractivePlacement,
821 XtOffsetOf(WmGlobalData, interactivePlacement),
827 WmNkeyboardFocusPolicy,
828 WmCKeyboardFocusPolicy,
831 XtOffsetOf(WmGlobalData, keyboardFocusPolicy),
833 (XtPointer)KEYBOARD_FOCUS_EXPLICIT
841 XtOffsetOf(WmGlobalData, lowerOnIconify),
848 WmNmarqueeSelectGranularity,
849 WmCMarqueeSelectGranularity,
852 XtOffsetOf(WmGlobalData, marqueeSelectGranularity),
863 XtOffsetOf(WmGlobalData, moveThreshold),
873 XtOffsetOf(WmGlobalData, passButtons),
883 XtOffsetOf(WmGlobalData, passSelectButton),
893 XtOffsetOf(WmGlobalData, positionIsFrame),
903 XtOffsetOf(WmGlobalData, positionOnScreen),
913 XtOffsetOf(WmGlobalData, quitTimeout),
923 XtOffsetOf(WmGlobalData, raiseKeyFocus),
930 WmNrefreshByClearing,
931 WmCRefreshByClearing,
934 XtOffsetOf(WmGlobalData, refreshByClearing),
944 XtOffsetOf(WmGlobalData, rootButtonClick),
956 XtOffsetOf(WmGlobalData, sessionClientDB),
967 XtOffsetOf(WmGlobalData, showFeedback),
969 (XtPointer)(WM_SHOW_FB_DEFAULT)
977 XtOffsetOf(WmGlobalData, startupKeyFocus),
983 WmNsystemButtonClick,
984 WmCSystemButtonClick,
987 XtOffsetOf(WmGlobalData, systemButtonClick),
993 WmNsystemButtonClick2,
994 WmCSystemButtonClick2,
997 XtOffsetOf(WmGlobalData, systemButtonClick2),
1001 #if defined(PANELIST)
1007 XtOffsetOf(WmGlobalData, useFrontPanel),
1011 #endif /* PANELIST */
1018 XtOffsetOf(WmGlobalData, helpDirectory),
1020 (XtPointer)"DT/Dtwm/"
1030 XtOffsetOf(WmGlobalData, dtLite),
1034 #endif /* MINIMAL_DT */
1035 }; /* END OF wmGlobalResources[] */
1039 * These determine the screens to manage at startup.
1040 * These are broken out to enhance startup performance.
1042 XtResource wmGlobalScreenResources[] =
1049 XtOffsetOf(WmGlobalData, multiScreen),
1063 XtOffsetOf(WmGlobalData, screenList),
1068 { WmNbackdropDirectories,
1069 WmCBackdropDirectories,
1072 XtOffsetOf(WmGlobalData, backdropDirs),
1074 DEFAULT_BACKDROP_DIR
1081 /******************************<->*************************************
1083 * wmStdGlobalResources
1088 * This data structure is used in the processing of mwm general appearance
1089 * and behavior resources that are not automatically set for the standard
1090 * (default) behavior. These resources are specified with the following
1093 * "Mwm*<resource_identifier>".
1095 ******************************<->***********************************/
1097 XtResource wmStdGlobalResources[] =
1105 XtOffsetOf(WmGlobalData, bitmapDirectory),
1107 (XtPointer)BITMAPDIR
1115 XtOffsetOf(WmGlobalData, configFile),
1124 sizeof (FrameStyle),
1125 XtOffsetOf(WmGlobalData, frameStyle),
1127 (XtPointer)WmRECESSED
1135 XtOffsetOf(WmGlobalData, iconAutoPlace),
1145 XtOffsetOf(WmGlobalData, moveThreshold),
1155 XtOffsetOf(WmGlobalData, positionIsFrame),
1161 WmNpositionOnScreen,
1162 WmCPositionOnScreen,
1165 XtOffsetOf(WmGlobalData, positionOnScreen),
1175 XtOffsetOf(WmGlobalData, quitTimeout),
1185 XtOffsetOf(WmGlobalData, showFeedback),
1187 (XtPointer)(WM_SHOW_FB_DEFAULT)
1193 /******************************<->*************************************
1200 * This data structure is used in the processing of mwm screen specific
1201 * appearance and behavior resources. These resources are specified
1202 * with the following syntax:
1204 * "Mwm*screen<#>*<resource_identifier>".
1206 ******************************<->***********************************/
1208 XtResource wmScreenResources[] =
1215 XtOffsetOf (WmScreenData, buttonBindings),
1217 (XtPointer)defaultButtonBindingsName
1225 XtOffsetOf (WmScreenData, cleanText),
1231 WmNfeedbackGeometry,
1232 WmCFeedbackGeometry,
1235 XtOffsetOf (WmScreenData, feedbackGeometry),
1245 XtOffsetOf (WmScreenData, fadeNormalIcon),
1255 XtOffsetOf (WmScreenData, iconDecoration),
1257 (XtPointer)USE_ICON_DEFAULT_APPEARANCE
1262 WmNiconImageMaximum,
1263 WmCIconImageMaximum,
1266 XtOffsetOf (WmScreenData, iconImageMaximum),
1268 (XtPointer) _WmIconImageMaximumDefault
1272 WmNiconImageMaximum,
1273 WmCIconImageMaximum,
1276 XtOffsetOf (WmScreenData, iconImageMaximum),
1283 WmNiconImageMinimum,
1284 WmCIconImageMinimum,
1287 XtOffsetOf (WmScreenData, iconImageMinimum),
1297 XtOffsetOf (WmScreenData, iconPlacement),
1299 (XtPointer)(ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY)
1303 WmNiconPlacementMargin,
1304 WmCIconPlacementMargin,
1307 XtOffsetOf (WmScreenData, iconPlacementMargin),
1317 XtOffsetOf (WmScreenData, keyBindings),
1319 (XtPointer)defaultKeyBindingsName
1323 WmNframeBorderWidth,
1324 WmCFrameBorderWidth,
1327 XtOffsetOf (WmScreenData, frameBorderWidth),
1338 XtOffsetOf (WmScreenData, iconBoxGeometry),
1349 XtOffsetOf (WmScreenData, iconBoxName),
1351 (XtPointer)"iconbox"
1355 WmNiconBoxSBDisplayPolicy,
1356 WmCIconBoxSBDisplayPolicy,
1359 XtOffsetOf (WmScreenData, iconBoxSBDisplayPolicy),
1369 XtOffsetOf (WmScreenData, iconBoxScheme),
1379 XtOffsetOf (WmScreenData, iconBoxTitle),
1389 XtOffsetOf (WmScreenData, limitResize),
1395 WmNmaximumMaximumSize,
1396 WmCMaximumMaximumSize,
1399 XtOffsetOf (WmScreenData, maximumMaximumSize),
1405 WmNresizeBorderWidth,
1406 WmCFrameBorderWidth,
1409 XtOffsetOf (WmScreenData, resizeBorderWidth),
1419 XtOffsetOf (WmScreenData, resizeCursors),
1424 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
1430 XtOffsetOf (WmScreenData, rootMenu),
1432 (XtPointer)builtinRootMenuName
1434 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
1437 WmNtransientDecoration,
1438 WmCTransientDecoration,
1441 XtOffsetOf (WmScreenData, transientDecoration),
1443 (XtPointer)(WM_DECOR_SYSTEM | WM_DECOR_RESIZEH)
1447 WmNtransientFunctions,
1448 WmCTransientFunctions,
1451 XtOffsetOf (WmScreenData, transientFunctions),
1453 (XtPointer)(WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE))
1458 WmNsubpanelDecoration,
1459 WmCSubpanelDecoration,
1462 XtOffsetOf (WmScreenData, subpanelDecoration),
1464 (XtPointer)(WM_DECOR_SYSTEM)
1468 WmNsubpanelResources,
1469 WmCSubpanelResources,
1472 XtOffsetOf (WmScreenData, subpanelResources),
1476 #endif /* PANELIST */
1483 XtOffsetOf (WmScreenData, useIconBox),
1493 XtOffsetOf (WmScreenData, moveOpaque),
1505 XtOffsetOf (WmScreenData, helpResources),
1511 WmNinitialWorkspace,
1512 WmCInitialWorkspace,
1515 XtOffsetOf (WmScreenData, initialWorkspace),
1525 XtOffsetOf (WmScreenData, workspaceList),
1535 XtOffsetOf (WmScreenData, numWorkspaces),
1544 /******************************<->*************************************
1546 * wmStdScreenResources
1551 * This data structure is used in the processing of mwm screen specific
1552 * appearance and behavior resources that are not automatically set for
1553 * the standard (default) behavior. These resources are specified with
1554 * the following syntax:
1556 * "Mwm*screen<#>*<resource_identifier>".
1558 ******************************<->***********************************/
1560 XtResource wmStdScreenResources[] =
1563 WmNframeBorderWidth,
1564 WmCFrameBorderWidth,
1567 XtOffsetOf (WmScreenData, frameBorderWidth),
1574 WmNiconImageMaximum,
1575 WmCIconImageMaximum,
1578 XtOffsetOf (WmScreenData, iconImageMaximum),
1580 (XtPointer) _WmIconImageMaximumDefault
1584 WmNiconImageMaximum,
1585 WmCIconImageMaximum,
1588 XtOffsetOf (WmScreenData, iconImageMaximum),
1595 WmNiconImageMinimum,
1596 WmCIconImageMinimum,
1599 XtOffsetOf (WmScreenData, iconImageMinimum),
1605 WmNiconPlacementMargin,
1606 WmCIconPlacementMargin,
1609 XtOffsetOf (WmScreenData, iconPlacementMargin),
1615 WmNmaximumMaximumSize,
1616 WmCMaximumMaximumSize,
1619 XtOffsetOf (WmScreenData, maximumMaximumSize),
1625 WmNresizeBorderWidth,
1626 WmCFrameBorderWidth,
1629 XtOffsetOf (WmScreenData, resizeBorderWidth),
1637 /******************************<->*************************************
1639 * wmWorkspaceResources
1644 * This data structure is used in the processing of mwm workspace
1645 * specific appearance and behavior resources. These resources are
1646 * specified with the following syntax:
1648 * "Mwm*[screen<#>*]<workspace>*<resource_identifier>".
1650 ******************************<->***********************************/
1652 XtResource wmWorkspaceResources[] =
1659 XtOffsetOf (WmWorkspaceData, iconBoxGeometry),
1669 XtOffsetOf (WmWorkspaceData, title),
1676 XtResource *wmWorkspaceResources = NULL;
1681 /******************************<->*************************************
1683 * wmStdWorkspaceResources
1688 * This data structure is used in the processing of mwm workspace specific
1689 * appearance and behavior resources that are not automatically set for
1690 * the standard (default) behavior. These resources are specified with
1691 * the following syntax:
1693 * "Mwm*[screen<#>*]<workspace>*<resource_identifier>".
1695 *************************************<->***********************************/
1698 XtResource wmStdWorkspaceResources[] =
1705 XtOffsetOf (WmWorkspaceData, title),
1711 XtResource *wmStdWorkspaceResources = NULL;
1716 /*************************************<->*************************************
1718 * wmBackdropResources
1723 * This data structure is used in the processing of workspace specific
1724 * resources that apply to the backdrop.
1726 * These resources are specified with the following syntax:
1728 * "Mwm*[screen*][workspace*]backdrop*<resource_id>:"
1730 * NOTE: The order of these resources is important for correct
1731 * dynamic processing!!!!
1733 *************************************<->***********************************/
1735 XtResource wmBackdropResources[] =
1742 XtOffsetOf (BackdropData, colorSet),
1744 (XtPointer) _WmBackdropColorSetDefault
1752 XtOffsetOf (BackdropData, background),
1754 (XtPointer) _WmBackdropBgDefault
1762 XtOffsetOf (BackdropData, foreground),
1764 (XtPointer) _WmBackdropFgDefault
1772 XtOffsetOf (BackdropData, image),
1780 /*************************************<->*************************************
1782 * wmWsPresenceResources
1787 * This data structure is used in the processing of specific
1788 * resources that apply to the WorkspacePresence dialog.
1790 * These resources are specified with the following syntax:
1792 * "Mwm*[screen*][workspace*]workspacePresence*<resource_id>:"
1794 *************************************<->***********************************/
1796 XtResource wmWsPresenceResources[] =
1803 XtOffsetOf (WsPresenceData, title),
1811 /*************************************<->*************************************
1818 * This data structure is used in the processing of client specific
1819 * window manager resources. These resources are specified with the
1822 * "Mwm*<client_name_or_class>*<resource_identifier>"
1824 *************************************<->***********************************/
1826 XtResource wmClientResources[] =
1831 WmNabsentMapBehavior,
1832 WmCAbsentMapBehavior,
1833 WmRAbsentMapBehavior,
1835 XtOffsetOf (ClientData, absentMapBehavior),
1837 (XtPointer)(AMAP_BEHAVIOR_ADD)
1841 WmNclientDecoration,
1842 WmCClientDecoration,
1845 XtOffsetOf (ClientData, clientDecoration),
1847 (XtPointer)(WM_DECOR_DEFAULT)
1855 XtOffsetOf (ClientData, clientFunctions),
1857 (XtPointer)(WM_FUNC_DEFAULT)
1865 XtOffsetOf (ClientData, focusAutoRaise),
1867 (XtPointer)_WmFocusAutoRaiseDefault
1875 XtOffsetOf (ClientData, iconImage),
1881 WmNiconImageBackground,
1882 WmCIconImageBackground,
1885 XtOffsetOf (ClientData, iconImageBackground),
1887 (XtPointer)_WmIconImageBDefault
1891 WmNiconImageForeground,
1892 WmCIconImageForeground,
1895 XtOffsetOf (ClientData, iconImageForeground),
1897 (XtPointer)_WmIconImageFDefault
1901 WmNiconImageBottomShadowColor,
1902 WmCIconImageBottomShadowColor,
1905 XtOffsetOf (ClientData, iconImageBottomShadowColor),
1907 (XtPointer)_WmIconImageBSCDefault
1911 WmNiconImageBottomShadowPixmap,
1912 WmCIconImageBottomShadowPixmap,
1915 XtOffsetOf (ClientData, iconImageBottomShadowPStr),
1917 (XtPointer)_WmIconImageBSPDefault
1921 WmNiconImageTopShadowColor,
1922 WmCIconImageTopShadowColor,
1925 XtOffsetOf (ClientData, iconImageTopShadowColor),
1927 (XtPointer)_WmIconImageTSCDefault
1931 WmNiconImageTopShadowPixmap,
1932 WmCIconImageTopShadowPixmap,
1935 XtOffsetOf (ClientData, iconImageTopShadowPStr),
1937 (XtPointer)_WmIconImageTSPDefault
1941 WmNignoreWMSaveHints,
1942 WmCIgnoreWMSaveHints,
1945 XtOffsetOf (ClientData, ignoreWMSaveHints),
1955 XtOffsetOf (ClientData, matteWidth),
1961 WmNmaximumClientSize,
1962 WmCMaximumClientSize,
1965 XtOffsetOf (ClientData, maximumClientSize),
1972 WmNsecondariesOnTop,
1973 WmCSecondariesOnTop,
1976 XtOffsetOf (ClientData, secondariesOnTop),
1978 (XtPointer)_WmSecondariesOnTopDefault
1987 XtOffsetOf (ClientData, systemMenu),
1989 (XtPointer)defaultSystemMenuName
1997 XtOffsetOf (ClientData, useClientIcon),
2011 XtOffsetOf (ClientData, usePPosition),
2013 (XtPointer)(USE_PPOSITION_NONZERO)
2016 }; /* END OF STRUCTURE wmClientResources */
2020 /*************************************<->*************************************
2022 * wmStdClientResources
2027 * This data structure is used in the processing of client specific
2028 * window manager resources that are not automatically set for the standard
2029 * (default) behavior. These resources are specified with the
2032 * "Mwm*<client_name_or_class>*<resource_identifier>"
2034 *************************************<->***********************************/
2036 XtResource wmStdClientResources[] =
2044 XtOffsetOf (ClientData, iconImage),
2050 WmNiconImageBackground,
2051 WmCIconImageBackground,
2054 XtOffsetOf (ClientData, iconImageBackground),
2056 (XtPointer)_WmIconImageBDefault
2060 WmNiconImageForeground,
2061 WmCIconImageForeground,
2064 XtOffsetOf (ClientData, iconImageForeground),
2066 (XtPointer)_WmIconImageFDefault
2070 WmNiconImageBottomShadowColor,
2071 WmCIconImageBottomShadowColor,
2074 XtOffsetOf (ClientData, iconImageBottomShadowColor),
2076 (XtPointer)_WmIconImageBSCDefault
2080 WmNiconImageBottomShadowPixmap,
2081 WmCIconImageBottomShadowPixmap,
2084 XtOffsetOf (ClientData, iconImageBottomShadowPStr),
2086 (XtPointer)_WmIconImageBSPDefault
2090 WmNiconImageTopShadowColor,
2091 WmCIconImageTopShadowColor,
2094 XtOffsetOf (ClientData, iconImageTopShadowColor),
2096 (XtPointer)_WmIconImageTSCDefault
2100 WmNiconImageTopShadowPixmap,
2101 WmCIconImageTopShadowPixmap,
2104 XtOffsetOf (ClientData, iconImageTopShadowPStr),
2106 (XtPointer)_WmIconImageTSPDefault
2114 XtOffsetOf (ClientData, matteWidth),
2120 WmNmaximumClientSize,
2121 WmCMaximumClientSize,
2124 XtOffsetOf (ClientData, maximumClientSize),
2130 WmNsecondariesOnTop,
2131 WmCSecondariesOnTop,
2134 XtOffsetOf (ClientData, secondariesOnTop),
2136 (XtPointer)_WmSecondariesOnTopDefault
2145 XtOffsetOf (ClientData, useClientIcon),
2153 /*************************************<->*************************************
2155 * wmClientResourcesM
2160 * This data structure is used in the processing of client specific
2161 * window manager resources that affect the appearance of the client
2162 * matte. These resources are specified with the following syntax:
2164 * "Mwm*<client_name_or_class>*<resource_identifier>"
2166 *************************************<->***********************************/
2168 XtResource wmClientResourcesM[] =
2175 XtOffsetOf (ClientData, matteBackground),
2177 (XtPointer)_WmMatteBDefault
2185 XtOffsetOf (ClientData, matteForeground),
2187 (XtPointer)_WmMatteFDefault
2191 WmNmatteBottomShadowColor,
2192 WmCMatteBottomShadowColor,
2195 XtOffsetOf (ClientData, matteBottomShadowColor),
2197 (XtPointer)_WmMatteBSCDefault
2201 WmNmatteBottomShadowPixmap,
2202 WmCMatteBottomShadowPixmap,
2205 XtOffsetOf (ClientData, matteBottomShadowPStr),
2207 (XtPointer)_WmMatteBSPDefault
2211 WmNmatteTopShadowColor,
2212 WmCMatteTopShadowColor,
2215 XtOffsetOf (ClientData, matteTopShadowColor),
2217 (XtPointer)_WmMatteTSCDefault
2221 WmNmatteTopShadowPixmap,
2222 WmCMatteTopShadowPixmap,
2225 XtOffsetOf (ClientData, matteTopShadowPStr),
2227 (XtPointer)_WmMatteTSPDefault
2233 /*************************************<->*************************************
2235 * wmAppearanceResources
2240 * This data structure is used in the processing of component appearance
2241 * resources. These resources are specified with the following syntax:
2243 * "Mwm*<resource_identifier>"
2244 * "Mwm*client*<resource_identifier>"
2245 * "Mwm*icon*<resource_identifier>"
2246 * "Mwm*feedback*<resource_identifier>"
2248 *************************************<->***********************************/
2250 XtResource wmAppearanceResources[] =
2257 sizeof (XmFontList),
2258 XtOffsetOf (AppearanceData, fontList),
2268 XtOffsetOf (AppearanceData, saveUnder),
2278 XtOffsetOf (AppearanceData, background),
2280 (XtPointer)_WmBackgroundDefault
2288 XtOffsetOf (AppearanceData, foreground),
2290 (XtPointer)_WmForegroundDefault
2294 XmNbottomShadowColor,
2298 XtOffsetOf (AppearanceData, bottomShadowColor),
2300 (XtPointer)_WmBottomShadowColorDefault
2304 XmNbottomShadowPixmap,
2305 XmCBottomShadowPixmap,
2308 XtOffsetOf (AppearanceData, bottomShadowPStr),
2318 XtOffsetOf (AppearanceData, topShadowColor),
2320 (XtPointer)_WmTopShadowColorDefault
2324 XmNbackgroundPixmap,
2325 XmCBackgroundPixmap,
2328 XtOffsetOf (AppearanceData, backgroundPStr),
2330 (XtPointer)_WmBackgroundPixmapDefault
2338 XtOffsetOf (AppearanceData, topShadowPStr),
2340 (XtPointer)_WmTopShadowPixmapDefault
2344 WmNactiveBackground,
2348 XtOffsetOf (AppearanceData, activeBackground),
2350 (XtPointer)_WmABackgroundDefault
2354 WmNactiveForeground,
2358 XtOffsetOf (AppearanceData, activeForeground),
2360 (XtPointer)_WmAForegroundDefault
2364 WmNactiveBottomShadowColor,
2368 XtOffsetOf (AppearanceData, activeBottomShadowColor),
2370 (XtPointer)_WmABottomShadowColorDefault
2374 WmNactiveBottomShadowPixmap,
2375 XmCBottomShadowPixmap,
2378 XtOffsetOf (AppearanceData, activeBottomShadowPStr),
2384 WmNactiveTopShadowColor,
2388 XtOffsetOf (AppearanceData, activeTopShadowColor),
2390 (XtPointer)_WmATopShadowColorDefault
2394 WmNactiveBackgroundPixmap,
2395 XmCBackgroundPixmap,
2398 XtOffsetOf (AppearanceData, activeBackgroundPStr),
2400 (XtPointer)_WmABackgroundPixmapDefault
2404 WmNactiveTopShadowPixmap,
2408 XtOffsetOf (AppearanceData, activeTopShadowPStr),
2410 (XtPointer)_WmATopShadowPixmapDefault
2417 /*************************************<->*************************************
2419 * _WmIconImageFDefault (widget, offset, value)
2420 * _WmIconImageBDefault (widget, offset, value)
2421 * _WmIconImageBSCDefault (widget, offset, value)
2422 * _WmIconImageBSPDefault (widget, offset, value)
2423 * _WmIconImageTSCDefault (widget, offset, value)
2424 * _WmIconImageTSPDefault (widget, offset, value)
2425 * _WmMatteFDefault (widget, offset, value)
2426 * _WmMatteBDefault (widget, offset, value)
2427 * _WmMatteBSCDefault (widget, offset, value)
2428 * _WmMatteBSPDefault (widget, offset, value)
2429 * _WmMatteTSCDefault (widget, offset, value)
2430 * _WmMatteTSPDefault (widget, offset, value)
2435 * These functions are used to generate dynamic defaults for various
2436 * client-specific appearance related resources.
2441 * widget = this is the parent widget for the wm subpart
2443 * offset = this is the resource offset
2445 * value = this is a pointer to a XrmValue in which to store the result
2447 * _pCD = (static global) pointer to client data associated with resources
2452 * value = default resource value and size
2454 *************************************<->***********************************/
2457 _WmIconImageFDefault (Widget widget, int offset, XrmValue *value)
2459 _WmGetDynamicDefault (widget, WmFGC, 0,
2460 _pCD->iconImageBackground, value);
2462 } /* END OF FUNCTION _WmIconImageFDefault */
2465 _WmIconImageBDefault (Widget widget, int offset, XrmValue *value)
2467 value->addr = (char *)&(_pCD->pSD->iconAppearance.background);
2468 value->size = sizeof (Pixel);
2470 } /* END OF FUNCTION _WmIconImageBDefault */
2474 _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value)
2476 _WmGetDynamicDefault (widget, WmBSC, 0,
2477 _pCD->iconImageBackground, value);
2479 } /* END OF FUNCTION _WmIconImageBSCDefault */
2483 _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value)
2486 value->addr = (char *)_pCD->pSD->iconAppearance.bottomShadowPStr;
2487 value->size = sizeof (String);
2489 } /* END OF FUNCTION _WmIconImageBSCDefault */
2493 _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value)
2495 _WmGetDynamicDefault (widget, WmTSC, 0,
2496 _pCD->iconImageBackground, value);
2498 } /* END OF FUNCTION _WmIconImageTSCDefault */
2502 _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value)
2505 value->addr = (char *)_pCD->pSD->iconAppearance.topShadowPStr;
2506 value->size = sizeof (String);
2508 } /* END OF FUNCTION _WmIconImageTSPDefault */
2512 _WmMatteFDefault (Widget widget, int offset, XrmValue *value)
2514 _WmGetDynamicDefault (widget, WmFGC, 0,
2515 _pCD->matteBackground, value);
2517 } /* END OF FUNCTION _WmMatteFDefault */
2521 _WmMatteBDefault (Widget widget, int offset, XrmValue *value)
2523 value->addr = (char *)&(_pCD->pSD->clientAppearance.background);
2524 value->size = sizeof (Pixel);
2526 } /* END OF FUNCTION _WmMatteBDefault */
2530 _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value)
2532 _WmGetDynamicDefault (widget, WmBSC, 0,
2533 _pCD->matteBackground, value);
2535 } /* END OF FUNCTION _WmMatteBSCDefault */
2539 _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value)
2542 value->addr = (char *)_pCD->pSD->clientAppearance.bottomShadowPStr;
2543 value->size = sizeof (String);
2545 } /* END OF FUNCTION _WmMatteBSCDefault */
2549 _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value)
2551 _WmGetDynamicDefault (widget, WmTSC, 0,
2552 _pCD->matteBackground, value);
2554 } /* END OF FUNCTION _WmMatteTSCDefault */
2558 _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value)
2561 value->addr = (char *)_pCD->pSD->clientAppearance.topShadowPStr;
2562 value->size = sizeof (String);
2564 } /* END OF FUNCTION _WmMatteTSCDefault */
2568 /*************************************<->*************************************
2570 * _WmBackgroundDefault (widget, offset, value)
2571 * _WmForegroundDefault (widget, offset, value)
2572 * _WmBackgroundPixmapDefault (widget, offset, value)
2573 * _WmBottomShadowColorDefault (widget, offset, value)
2574 * _WmTopShadowColorDefault (widget, offset, value)
2575 * _WmTopShadowPixmapDefault (widget, offset, value)
2576 * _WmABackgroundDefault (widget, offset, value)
2577 * _WmAForegroundDefault (widget, offset, value)
2578 * _WmABackgroundPixmapDefault (widget, offset, value)
2579 * _WmABottomShadowColorDefault (widget, offset, value)
2580 * _WmRFBackgroundDefault (widget, offset, value)
2581 * _WmRFForegroundDefault (widget, offset, value)
2582 * _WmATopShadowColorDefault (widget, offset, value)
2583 * _WmATopShadowPixmapDefault (widget, offset, value)
2588 * These functions are used to generate dynamic defaults for various
2589 * component appearance related resources (not client-specific).
2594 * widget = this is the parent widget for the wm subpart
2596 * offset = this is the resource offset
2598 * value = this is a pointer to a XrmValue in which to store the result
2600 * _defaultBackground = (static global) default background color (inactive)
2602 * _defaultActiveBackground = (static global) default bg color (active)
2604 * _pAppearanceData = (static global) pointer to resouce set structure
2609 * value = default resource value and size
2611 *************************************<->***********************************/
2614 _WmBackgroundDefault (Widget widget, int offset, XrmValue *value)
2616 _WmGetDynamicDefault (widget, WmBGC, _defaultBackground, 0, value);
2618 } /* END OF FUNCTION _WmBackgroundDefault */
2622 _WmForegroundDefault (Widget widget, int offset, XrmValue *value)
2624 _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->background,
2627 } /* END OF FUNCTION _WmForegroundDefault */
2631 _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value)
2633 static String string;
2636 if ((Monochrome (XtScreen (widget))) ||
2637 (_pAppearanceData->topShadowColor == _pAppearanceData->background))
2639 string = (String) _25_foreground;
2646 value->addr = (char *)string;
2647 value->size = sizeof (String);
2649 } /* END OF FUNCTION _WmBackgroundPixmapDefault */
2653 _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value)
2655 _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->background,
2658 } /* END OF FUNCTION _WmBottomShadowColorDefault */
2662 _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value)
2664 _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->background,
2667 } /* END OF FUNCTION _WmTopShadowColorDefault */
2671 _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value)
2673 static String string;
2676 if ((Monochrome (XtScreen (widget))) ||
2677 (_pAppearanceData->topShadowColor == _pAppearanceData->background))
2679 /* Fix monochrome 3D appearance */
2680 string = (String) _50_foreground;
2681 if (_pAppearanceData->backgroundPStr != NULL)
2682 if (!strcmp(_pAppearanceData->backgroundPStr, _25_foreground) ||
2683 !strcmp(_pAppearanceData->backgroundPStr, _50_foreground))
2685 string = (String) _foreground;
2693 value->addr = (char *)string;
2694 value->size = sizeof (String);
2696 } /* END OF FUNCTION _WmTopShadowPixmapDefault */
2700 _WmABackgroundDefault (Widget widget, int offset, XrmValue *value)
2702 _WmGetDynamicDefault (widget, WmBGC, _defaultActiveBackground, 0, value);
2704 } /* END OF FUNCTION _WmABackgroundDefault */
2708 _WmAForegroundDefault (Widget widget, int offset, XrmValue *value)
2710 _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->activeBackground,
2713 } /* END OF FUNCTION _WmAForegroundDefault */
2716 _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value)
2718 static String string;
2721 if ((Monochrome (XtScreen (widget))) ||
2722 (_pAppearanceData->activeTopShadowColor ==
2723 _pAppearanceData->activeBackground))
2725 string = (String) _50_foreground;
2732 value->addr = (char *)string;
2733 value->size = sizeof (String);
2735 } /* END OF FUNCTION _WmABackgroundPixmapDefault */
2738 _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value)
2740 _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->activeBackground,
2743 } /* END OF FUNCTION _WmABottomShadowColorDefault */
2747 _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value)
2749 _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->activeBackground,
2752 } /* END OF FUNCTION _WmATopShadowColorDefault */
2756 _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value)
2758 static String string;
2760 if ((Monochrome (XtScreen (widget))) ||
2761 (_pAppearanceData->activeTopShadowColor ==
2762 _pAppearanceData->activeBackground))
2764 /* Fix monochrome 3D appearance */
2765 string = (String) _50_foreground;
2766 if (_pAppearanceData->activeBackgroundPStr != NULL)
2768 (_pAppearanceData->activeBackgroundPStr, _25_foreground) ||
2770 (_pAppearanceData->activeBackgroundPStr, _50_foreground))
2772 string = (String) _foreground;
2780 value->addr = (char *)string;
2781 value->size = sizeof (String);
2783 } /* END OF FUNCTION _WmATopShadowPixmapDefault */
2788 _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value)
2790 static Pixel pixValue;
2791 unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet;
2794 if (wmGD.statusColorServer == CSERVE_NORMAL)
2796 if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS))
2798 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2801 switch (pResWS->pSD->colorUse)
2803 case XmCO_BLACK_WHITE:
2804 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg;
2808 case XmCO_LOW_COLOR:
2809 case XmCO_MEDIUM_COLOR:
2810 case XmCO_HIGH_COLOR:
2811 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bs;
2818 * Color server is unavailable. Has user specified a colorset?
2820 * If not, go monochrome.
2823 pixValue = WhitePixel (DISPLAY, pResWS->pSD->screen);
2826 /* return the dynamic default */
2828 value->addr = (char *) &pixValue;
2829 value->size = sizeof (Pixel);
2831 } /* END OF FUNCTION _WmBackdropBgDefault */
2834 _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value)
2836 static Pixel pixValue;
2837 unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet;
2840 if (wmGD.statusColorServer == CSERVE_NORMAL)
2842 if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS))
2844 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2847 switch (pResWS->pSD->colorUse)
2849 case XmCO_BLACK_WHITE:
2850 pixValue = pResWS->pSD->pPixelData[colorSetId-1].fg;
2854 case XmCO_LOW_COLOR:
2855 case XmCO_MEDIUM_COLOR:
2856 case XmCO_HIGH_COLOR:
2857 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg;
2864 * Color server is unavailable. Has user specified a colorset?
2866 * If not, go monochrome.
2869 pixValue = BlackPixel (DISPLAY, pResWS->pSD->screen);
2871 value->addr = (char *) &pixValue;
2872 value->size = sizeof (Pixel);
2874 } /* END OF FUNCTION _WmBackdropFgDefault */
2877 _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value)
2879 static unsigned int colorSetId;
2881 if (wmGD.statusColorServer == CSERVE_NORMAL)
2883 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2887 colorSetId = 0; /* invalid color set */
2890 value->addr = (char *) &colorSetId;
2891 value->size = sizeof (Pixel);
2893 } /* END OF FUNCTION _WmBackdropColorSetIdDefault */
2896 _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value)
2900 if ((pResSD->displayResolutionType == LOW_RES_DISPLAY) ||
2901 (pResSD->displayResolutionType == VGA_RES_DISPLAY))
2912 value->addr = (char *) &cval;
2913 value->size = sizeof (WHSize);
2915 } /* END OF FUNCTION _WmIconImageMaximumDefault */
2918 /*************************************<->*************************************
2920 * DefaultWsColorSetId (pWS)
2925 * This function returns the default colorSetId for a given workspace
2930 * pWS = ptr to workspace data
2934 * return = default color set ID.
2936 * "active" and "inactive" color sets are not used.
2938 *************************************<->***********************************/
2941 DefaultWsColorSetId (WmWorkspaceData *pWS)
2943 static int _ws_high_color_map[] = { 3, 5, 6, 7 };
2944 #define _WS_HIGH_COLOR_COUNT 4
2954 iIndex = (int) ((unsigned long)(pWS) -
2955 (unsigned long)(pSD->pWS))/sizeof(WmWorkspaceData);
2957 iIndex = 0; /* bad pWS or pSD, shouldn't get here */
2959 switch (pSD->colorUse)
2961 case XmCO_BLACK_WHITE:
2962 case XmCO_LOW_COLOR:
2964 (pSD->pInactivePixelSet-pSD->pPixelData)/sizeof(XmPixelSet);
2967 case XmCO_MEDIUM_COLOR:
2968 rval = HARD_CODED_PRIMARY;
2971 case XmCO_HIGH_COLOR:
2972 i = iIndex % _WS_HIGH_COLOR_COUNT;
2973 rval = _ws_high_color_map[i];
2980 } /* END OF FUNCTION DefaultWsColorSetId */
2986 /*************************************<->*************************************
2988 * _WmFocusAutoRaiseDefault (widget, offset, value)
2993 * This function generates a default value for the focusAutoRaise resource.
2998 * widget = this is the parent widget for the wm subpart
3000 * offset = this is the resource offset
3002 * value = this is a pointer to a XrmValue in which to store the result
3007 * value = default resource value and size
3009 *************************************<->***********************************/
3012 _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value)
3014 static Boolean focusAutoRaise;
3016 if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)
3018 focusAutoRaise = True;
3022 focusAutoRaise = False;
3025 value->addr = (char *)&focusAutoRaise;
3026 value->size = sizeof (Boolean);
3028 } /* END OF FUNCTION _WmFocusAutoRaiseDefault */
3031 /*************************************<->*************************************
3033 * _WmMultiClickTimeDefault (widget, offset, value)
3038 * This function generates a default value for the doubleClickTime resource.
3039 * We dynamically default to the XtR4 multiClickTime value.
3043 * widget = this is the parent widget for the wm subpart
3045 * offset = this is the resource offset
3047 * value = this is a pointer to a XrmValue in which to store the result
3051 * value = default resource value and size
3053 *************************************<->***********************************/
3056 _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value)
3058 static int multiClickTime;
3060 multiClickTime = XtGetMultiClickTime(XtDisplay(widget));
3062 value->addr = (char *)&multiClickTime;
3063 value->size = sizeof (int);
3065 } /* END OF FUNCTION _WmMultiClickTimeDefault */
3069 /*************************************<->*************************************
3071 * _WmSecondariesOnTopDefault (widget, offset, value)
3076 * This function generates a default value for the secondariesOnTop
3081 * widget = this is the parent widget for the wm subpart
3083 * offset = this is the resource offset
3085 * value = this is a pointer to a XrmValue in which to store the result
3089 * value = default resource value and size
3091 *************************************<->***********************************/
3094 _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value)
3096 static Boolean secondariesOnTop;
3099 * Inherit setting from primary window if this window is
3103 if (_pCD->transientLeader != NULL)
3104 secondariesOnTop = _pCD->transientLeader->secondariesOnTop;
3106 secondariesOnTop = True;
3108 value->addr = (char *)&secondariesOnTop;
3109 value->size = sizeof (Boolean);
3111 } /* END OF FUNCTION _WmSecondariesOnTopDefault */
3116 /******************************<->*************************************
3118 * ProcessWmResources ()
3123 * This function is used to retrieve and process window manager resources
3124 * that are not client-specific.
3129 * wmGlobalResources = pointer to wm resource list
3134 * wmGD = (global data filled out with resource values)
3136 *************************************<->***********************************/
3139 ProcessWmResources (void)
3143 * Process the mwm general appearance and behavior resources. Retrieve
3144 * a limited set of resource values if the window manager is starting
3145 * up with the standard behavior.
3148 if (wmGD.useStandardBehavior)
3150 XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD,
3151 wmStdGlobalResources, XtNumber (wmStdGlobalResources), NULL, 0);
3154 * Fill in the standard resource values.
3157 SetStdGlobalResourceValues ();
3161 XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD,
3162 wmGlobalResources, XtNumber (wmGlobalResources), NULL, 0);
3165 if (wmGD.autoRaiseDelay < 0)
3167 wmGD.autoRaiseDelay = 500;
3168 Warning (((char *)GETMESSAGE(62, 66, "Out of range autoRaiseDelay resource value. Must be non-negative")));
3171 } /* END OF FUNCTION ProcessWmResources */
3175 /******************************<->*************************************
3177 * ProcessGlobalScreenResources ()
3182 * This function is used to retrieve window manager resources to
3183 * determine the screens to manage.
3188 * wmGlobalScreenResources = pointer to wm resource list
3193 * wmGD = (global data filled out with resource values)
3195 *************************************<->***********************************/
3198 ProcessGlobalScreenResources (void)
3200 XtGetApplicationResources (wmGD.topLevelW, &wmGD,
3201 wmGlobalScreenResources,
3202 XtNumber (wmGlobalScreenResources), NULL, 0);
3204 if (wmGD.multiScreen)
3206 wmGD.numScreens = ScreenCount(DISPLAY);
3210 wmGD.numScreens = 1;
3213 if (wmGD.screenList != NULL)
3215 ProcessScreenListResource();
3221 /*************************************<->*************************************
3223 * SetStdGlobalResourceValues ()
3228 * This function sets resource data to standard values. This setting
3229 * is done in place of getting the values from the user settings in
3230 * the resource database.
3235 * wmGD = (global data filled out with resource values)
3237 *************************************<->***********************************/
3240 SetStdGlobalResourceValues (void)
3242 wmGD.autoKeyFocus = True;
3243 wmGD.clientAutoPlace = True;
3244 wmGD.colormapFocusPolicy = CMAP_FOCUS_KEYBOARD;
3245 wmGD.deiconifyKeyFocus = True;
3246 wmGD.doubleClickTime = 500;
3247 wmGD.freezeOnConfig = True;
3248 wmGD.iconAutoPlace = True;
3249 wmGD.iconClick = True;
3250 wmGD.interactivePlacement = False;
3251 wmGD.keyboardFocusPolicy = KEYBOARD_FOCUS_EXPLICIT;
3252 wmGD.lowerOnIconify = True;
3253 wmGD.passSelectButton = True;
3254 wmGD.startupKeyFocus = True;
3255 wmGD.systemButtonClick = True;
3256 wmGD.systemButtonClick2 = True;
3257 #if defined(PANELIST)
3258 wmGD.useFrontPanel=False;
3259 #endif /* PANELIST */
3261 } /* END OF FUNCTION SetStdGlobalResourceValues */
3265 /*************************************<->*************************************
3267 * ProcessScreenListResource ()
3272 * This processes the names in the screenList resource.
3277 * wmGlobalResources = pointer to wmGD.screenList
3284 *************************************<->***********************************/
3287 ProcessScreenListResource (void)
3289 unsigned char *lineP;
3290 unsigned char *string;
3294 lineP = (unsigned char *)wmGD.screenList;
3299 while (((string = GetString(&lineP)) != NULL) &&
3300 (sNum < ScreenCount(DISPLAY)))
3302 if (!(wmGD.screenNames[sNum] = (unsigned char *)
3303 WmRealloc ((char*)wmGD.screenNames[sNum], strlen((char*)string)+1)))
3305 ExitWM(WM_ERROR_EXIT_VALUE);
3309 strcpy((char *)wmGD.screenNames[sNum], (char *)string);
3316 * If the number of listed screens (sNum) is < screen count, fill in the
3317 * remaining screen names with the name of the first screen specified,
3322 string = wmGD.screenNames[0]; /* name of the first screen */
3323 while (sNum < ScreenCount(DISPLAY))
3325 if (!(wmGD.screenNames[sNum] = (unsigned char *)
3326 WmRealloc ((char*)wmGD.screenNames[sNum],
3327 strlen((char *)string)+1)))
3329 ExitWM(WM_ERROR_EXIT_VALUE);
3333 strcpy((char *)wmGD.screenNames[sNum], (char *)string);
3340 } /* END OF FUNCTION ProcessScreenListResource */
3344 /******************************<->*************************************
3346 * ProcessWmColors ()
3351 * Retrieve the color sets from the colorserver.
3359 * modifies parts of global pixel sets
3364 ******************************<->***********************************/
3367 ProcessWmColors (WmScreenData *pSD)
3369 short active, inactive, primary, secondary;
3371 if ((pSD->pPixelData = (XmPixelSet *)
3372 XtMalloc (XmCO_NUM_COLORS * sizeof(XmPixelSet))))
3377 * ASSUMPTION: If XmeGetPixelData() returns true,
3378 * we have a good color server at our disposal.
3382 if (XmeGetPixelData (pSD->screen, &pSD->colorUse,
3383 pSD->pPixelData, &active, &inactive,
3384 &primary, &secondary))
3386 pSD->pActivePixelSet = &(pSD->pPixelData[active]);
3387 pSD->pInactivePixelSet = &(pSD->pPixelData[inactive]);
3388 pSD->pPrimaryPixelSet = &(pSD->pPixelData[primary]);
3389 pSD->pSecondaryPixelSet = &(pSD->pPixelData[secondary]);
3391 /* Hack here. The index "4" is the proper array reference. */
3392 /* This is used because XmGetPixelData has not been properly */
3395 pSD->pTextPixelSet = &(pSD->pPixelData[3]);
3397 wmGD.statusColorServer = CSERVE_NORMAL;
3402 XtFree((char *)pSD->pPixelData);
3403 pSD->pPixelData = NULL;
3404 pSD->pActivePixelSet = NULL;
3405 pSD->pInactivePixelSet = NULL;
3406 pSD->pPrimaryPixelSet = NULL;
3407 pSD->pSecondaryPixelSet = NULL;
3408 pSD->pTextPixelSet = NULL;
3413 Warning (((char *)GETMESSAGE(62, 22, "Insufficient memory for color data")));
3414 ExitWM (WM_ERROR_EXIT_VALUE);
3417 } /* END OF FUNCTION ProcessWmColors */
3420 /******************************<->*************************************
3422 * WriteOutXrmColors ()
3427 * Update the XRM database with pixel values from the color server.
3431 * pSD = contains pixel sets
3435 * updated resource database
3439 * N.B. Must change to write out data on a PER-SCREEN basis.
3440 * e.g., "Dtwm*0*background"
3441 ******************************<->***********************************/
3444 WriteOutXrmColors (WmScreenData *pSD)
3448 int thisScreen = pSD->screen;
3449 XmPixelSet *tpixset, *ppixset;
3450 XmPixelSet *spixset;
3457 res_class = WM_RESOURCE_CLASS;
3461 res_class = DT_WM_RESOURCE_CLASS;
3464 screen_name = (String) wmGD.screenNames[pSD->screen];
3466 db = XtScreenDatabase(XScreenOfDisplay(DISPLAY, thisScreen));
3468 /** update the clients database with new colors **/
3469 value.size = sizeof(Pixel);
3473 * WM ACTIVE RESOURCES--e.g., for the active frame
3476 if (pSD->pActivePixelSet)
3478 tpixset = pSD->pActivePixelSet;
3479 spixset = pSD->pSecondaryPixelSet;
3481 if (pSD->colorUse == XmCO_BLACK_WHITE)
3485 * Limit ourselves here to the client (frame)
3490 /* activeForeground */
3491 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3493 XrmPutResource (&db,
3494 ResCat (res_class, screen_name, WmNactiveForeground,
3495 NULL), XtRPixel, &value);
3497 /* activeBackground */
3498 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3500 XrmPutResource (&db,
3501 ResCat (res_class, screen_name, WmNactiveBackground,
3502 NULL), XtRPixel, &value);
3504 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3505 WmNactiveBackgroundPixmap, NULL),
3508 /* activeTopShadow */
3509 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3510 WmNactiveTopShadowPixmap, NULL),
3513 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3514 XrmPutResource (&db,
3515 ResCat (res_class, screen_name, WmNactiveTopShadowColor,
3516 NULL), XtRPixel, &value);
3518 /* activeBottomShadow */
3519 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3520 XrmPutResource (&db,
3521 ResCat (res_class, screen_name,
3522 WmNactiveBottomShadowColor, NULL), XtRPixel, &value);
3524 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3525 WmNactiveBottomShadowPixmap, NULL),
3529 else /* active colors for non-BW systems */
3531 value.addr = (XtPointer) &(tpixset->bg);
3532 XrmPutResource (&db,
3533 ResCat (res_class, screen_name, WmNactiveBackground, NULL),
3536 value.addr = (XtPointer) &(tpixset->fg);
3537 XrmPutResource (&db,
3538 ResCat (res_class, screen_name, WmNactiveForeground, NULL),
3541 value.addr = (XtPointer) &(tpixset->ts);
3542 XrmPutResource (&db,
3543 ResCat (res_class, screen_name, WmNactiveTopShadowColor, NULL),
3546 value.addr = (XtPointer) &(tpixset->bs);
3547 XrmPutResource (&db,
3548 ResCat (res_class, screen_name, WmNactiveBottomShadowColor, NULL),
3551 if (XmCO_DitherTopShadow(DISPLAY, thisScreen, tpixset))
3553 XrmPutStringResource (&db,
3554 ResCat (res_class, screen_name, WmNactiveTopShadowPixmap, NULL),
3559 if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, tpixset))
3561 XrmPutStringResource (&db,
3562 ResCat (res_class, screen_name, WmNactiveBottomShadowPixmap,
3571 * WM INACTIVE colors--e.g., for dialogues
3574 if (pSD->pInactivePixelSet)
3576 tpixset = pSD->pInactivePixelSet;
3577 spixset = pSD->pSecondaryPixelSet;
3579 if (pSD->colorUse == XmCO_BLACK_WHITE)
3584 * Set colors/pixmaps for the frames--leave the
3585 * menus out of it so that their text won't look
3586 * unsatisfactory against a dithered background.
3591 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3593 XrmPutResource (&db,
3594 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3595 WmNforeground), XtRPixel, &value);
3597 XrmPutResource (&db,
3598 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3599 WmNforeground), XtRPixel, &value);
3603 XrmPutStringResource (&db,
3604 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3605 WmNbackgroundPixmap), _Dither);
3607 XrmPutStringResource (&db,
3608 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3609 WmNbackgroundPixmap), _Dither);
3611 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3612 XrmPutResource (&db,
3613 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3614 WmNbackground), XtRPixel, &value);
3616 XrmPutResource (&db,
3617 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3618 WmNbackground), XtRPixel, &value);
3621 XrmPutStringResource (&db,
3622 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3623 WmNtopShadowPixmap), _foreground);
3625 XrmPutStringResource (&db,
3626 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3627 WmNtopShadowPixmap), _foreground);
3629 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3630 XrmPutResource (&db,
3631 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3632 WmNtopShadowColor), XtRPixel, &value);
3634 XrmPutResource (&db,
3635 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3636 WmNtopShadowColor), XtRPixel, &value);
3640 XrmPutStringResource (&db,
3641 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3642 WmNbottomShadowPixmap), _foreground);
3644 XrmPutStringResource (&db,
3645 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3646 WmNbottomShadowPixmap), _foreground);
3648 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3650 XrmPutResource (&db,
3651 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3652 WmNbottomShadowColor), XtRPixel, &value);
3654 XrmPutResource (&db,
3655 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3656 WmNbottomShadowColor), XtRPixel, &value);
3660 * Ensure that the icon images have a black foreground and
3661 * a white background.
3664 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3666 XrmPutResource (&db,
3667 ResCat (res_class, screen_name, WmNiconImageForeground,
3668 NULL), XtRPixel, &value);
3670 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3672 XrmPutResource (&db,
3673 ResCat (res_class, screen_name, WmNiconImageBackground,
3674 NULL), XtRPixel, &value);
3676 /* Now deal with XmCO_BLACK_WHITE Menus */
3678 /* XmCO_BLACK_WHITE menu foreground */
3679 value.addr = (XtPointer) &(tpixset->fg);
3681 XrmPutResource (&db,
3682 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3683 WmNforeground), XtRPixel, &value);
3685 /* XmCO_BLACK_WHITE menu background */
3686 value.addr = (XtPointer) &(tpixset->bg);
3688 XrmPutResource (&db,
3689 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3690 WmNbackground), XtRPixel, &value);
3692 /* XmCO_BLACK_WHITE menu top shadow */
3694 XrmPutStringResource (&db,
3695 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3696 WmNtopShadowPixmap), _50_foreground);
3698 /* use foreground color for this pixmap */
3699 value.addr = (XtPointer) &(tpixset->fg);
3701 XrmPutResource (&db,
3702 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3703 WmNtopShadowColor), XtRPixel, &value);
3705 /* XmCO_BLACK_WHITE menu bottom shadow */
3707 XrmPutStringResource (&db,
3708 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3709 WmNbottomShadowPixmap), _75_foreground);
3711 /* use foreground color for this pixmap */
3712 value.addr = (XtPointer) &(tpixset->fg);
3714 XrmPutResource (&db,
3715 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3716 WmNbottomShadowColor), XtRPixel, &value);
3718 /* Finally, deal with XmCO_BLACK_WHITE Confirm Boxes */
3720 /* XmCO_BLACK_WHITE confirm box foreground */
3721 value.addr = (XtPointer) &(spixset->fg);
3723 XrmPutResource (&db,
3724 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3725 WmNforeground), XtRPixel, &value);
3727 /* XmCO_BLACK_WHITE confirm box background */
3728 value.addr = (XtPointer) &(spixset->bg);
3730 XrmPutResource (&db,
3731 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3732 WmNbackground), XtRPixel, &value);
3734 /* XmCO_BLACK_WHITE confirm box top shadow */
3736 XrmPutStringResource (&db,
3737 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3738 WmNtopShadowPixmap), _50_foreground);
3740 /* use foreground color */
3741 value.addr = (XtPointer) &(spixset->fg);
3743 XrmPutResource (&db,
3744 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3745 WmNtopShadowColor), XtRPixel, &value);
3747 /* XmCO_BLACK_WHITE confirm box bottom shadow */
3749 XrmPutStringResource (&db,
3750 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3751 WmNbottomShadowPixmap), _75_foreground);
3753 /* use foreground color */
3754 value.addr = (XtPointer) &(spixset->fg);
3756 XrmPutResource (&db,
3757 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3758 WmNbottomShadowColor), XtRPixel, &value);
3760 /* use select color for icon box trough color */
3762 value.addr = (XtPointer) &(tpixset->sc);
3764 XrmPutResource (&db,
3765 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3766 XmNtroughColor), XtRPixel, &value);
3768 /* use select color for arm and select colors in dialogs */
3770 value.addr = (XtPointer) &(spixset->sc);
3772 XrmPutResource (&db,
3773 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3774 XmNarmColor), XtRPixel, &value);
3776 XrmPutResource (&db,
3777 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3778 XmNselectColor), XtRPixel, &value);
3780 XrmPutResource (&db,
3781 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3782 XmNtroughColor), XtRPixel, &value);
3784 else /* inactive colors for non-BW systems */
3786 XmPixelSet *fpixset;
3789 * Set mwm component colors
3791 value.addr = (XtPointer) &(tpixset->bg);
3792 XrmPutResource (&db,
3793 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3794 WmNbackground), XtRPixel, &value);
3796 XrmPutResource (&db,
3797 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3798 WmNbackground), XtRPixel, &value);
3800 XrmPutResource (&db,
3801 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3802 WmNbackground), XtRPixel, &value);
3804 value.addr = (XtPointer) &(spixset->bg);
3805 XrmPutResource (&db,
3806 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3807 WmNbackground), XtRPixel, &value);
3809 value.addr = (XtPointer) &(tpixset->ts);
3810 XrmPutResource (&db,
3811 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3812 WmNtopShadowColor), XtRPixel, &value);
3814 XrmPutResource (&db,
3815 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3816 WmNtopShadowColor), XtRPixel, &value);
3818 XrmPutResource (&db,
3819 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3820 WmNtopShadowColor), XtRPixel, &value);
3822 value.addr = (XtPointer) &(spixset->ts);
3823 XrmPutResource (&db,
3824 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3825 WmNtopShadowColor), XtRPixel, &value);
3827 value.addr = (XtPointer) &(tpixset->bs);
3828 XrmPutResource (&db,
3829 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3830 WmNbottomShadowColor), XtRPixel, &value);
3832 XrmPutResource (&db,
3833 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3834 WmNbottomShadowColor), XtRPixel, &value);
3836 XrmPutResource (&db,
3837 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3838 WmNbottomShadowColor), XtRPixel, &value);
3840 value.addr = (XtPointer) &(spixset->bs);
3841 XrmPutResource (&db,
3842 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3843 WmNbottomShadowColor), XtRPixel, &value);
3845 value.addr = (XtPointer) &(tpixset->fg);
3846 XrmPutResource (&db,
3847 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3848 WmNforeground), XtRPixel, &value);
3850 XrmPutResource (&db,
3851 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3852 WmNforeground), XtRPixel, &value);
3854 XrmPutResource (&db,
3855 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3856 WmNforeground), XtRPixel, &value);
3858 value.addr = (XtPointer) &(spixset->fg);
3859 XrmPutResource (&db,
3860 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3861 WmNforeground), XtRPixel, &value);
3864 * Set select color only for menus and feedback mwm
3865 * parts. Client and Icon parts aren't real widgets.
3866 * Set client trough color for icon box.
3868 value.addr = (XtPointer) &(tpixset->sc);
3869 XrmPutResource (&db,
3870 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3871 XmNselectColor), XtRPixel, &value);
3873 XrmPutResource (&db,
3874 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3875 XmNarmColor), XtRPixel, &value);
3877 XrmPutResource (&db,
3878 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3879 XmNtroughColor), XtRPixel, &value);
3881 XrmPutResource (&db,
3882 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3883 XmNtroughColor), XtRPixel, &value);
3885 XrmPutResource (&db,
3886 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3887 XmNselectColor), XtRPixel, &value);
3889 value.addr = (XtPointer) &(spixset->sc);
3890 XrmPutResource (&db,
3891 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3892 XmNarmColor), XtRPixel, &value);
3894 XrmPutResource (&db,
3895 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3896 XmNtroughColor), XtRPixel, &value);
3899 * Set Dtwm dialog colors
3901 fpixset = pSD->pSecondaryPixelSet;
3903 value.addr = (XtPointer) &(fpixset->bg);
3904 XrmPutResource (&db,
3905 ResCat (res_class, screen_name, XmNbackground, NULL),
3908 value.addr = (XtPointer) &(fpixset->fg);
3909 XrmPutResource (&db,
3910 ResCat (res_class, screen_name, XmNforeground, NULL),
3913 value.addr = (XtPointer) &(fpixset->ts);
3914 XrmPutResource (&db,
3915 ResCat (res_class, screen_name, XmNtopShadowColor, NULL),
3918 value.addr = (XtPointer) &(fpixset->bs);
3919 XrmPutResource (&db,
3920 ResCat (res_class, screen_name, XmNbottomShadowColor, NULL),
3925 * Set up the select color, as for buttons in the dialogue
3929 value.addr = (XtPointer) &(fpixset->sc);
3930 XrmPutResource (&db,
3931 ResCat (res_class, screen_name, XmNselectColor, NULL),
3934 /* value.addr = (XtPointer) &(fpixset->sc); */
3935 XrmPutResource (&db,
3936 ResCat (res_class, screen_name, XmNarmColor, NULL),
3939 /* value.addr = (XtPointer) &(fpixset->sc); */
3940 XrmPutResource (&db,
3941 ResCat (res_class, screen_name, XmNtroughColor, NULL),
3944 if (XmCO_DitherTopShadow(DISPLAY, thisScreen, fpixset))
3946 XrmPutStringResource (&db,
3947 ResCat (res_class, screen_name, WmNtopShadowPixmap, NULL),
3950 if (pSD->colorUse == XmCO_BLACK_WHITE)
3952 XrmPutStringResource (&db,
3953 ResCat (res_class, screen_name,
3954 WmNbottomShadowPixmap, NULL),
3960 if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, fpixset))
3962 XrmPutStringResource (&db,
3963 ResCat (res_class, screen_name, WmNbottomShadowPixmap, NULL),
3966 if (pSD->colorUse == XmCO_BLACK_WHITE)
3968 XrmPutStringResource (&db,
3969 ResCat (res_class, screen_name,
3970 WmNtopShadowPixmap, NULL),
3976 if (tpixset->bs != tpixset->ts)
3979 * If the inactive bottomshadow and topshadow are
3980 * different (i.e., valid), then make the icon image
3984 value.addr = (XtPointer) &(tpixset->bs);
3986 XrmPutResource (&db,
3987 ResCat (res_class, screen_name, WmNiconImageForeground,
3988 NULL), XtRPixel, &value);
3990 value.addr = (XtPointer) &(tpixset->ts);
3992 XrmPutResource (&db,
3993 ResCat (res_class, screen_name, WmNiconImageBackground,
3994 NULL), XtRPixel, &value);
3996 value.addr = (XtPointer) &(tpixset->bs);
3998 XrmPutResource (&db,
3999 ResCat (res_class, screen_name,
4000 WmNiconImageBottomShadowColor,
4001 NULL), XtRPixel, &value);
4003 value.addr = (XtPointer) &(tpixset->ts);
4005 XrmPutResource (&db,
4006 ResCat (res_class, screen_name,
4007 WmNiconImageTopShadowColor,
4008 NULL), XtRPixel, &value);
4013 * Ensure that the icon images have a black foreground and
4014 * a white background.
4018 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
4020 XrmPutResource (&db,
4021 ResCat (res_class, screen_name, WmNiconImageForeground,
4022 NULL), XtRPixel, &value);
4024 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
4026 XrmPutResource (&db,
4027 ResCat (res_class, screen_name, WmNiconImageBackground,
4028 NULL), XtRPixel, &value);
4034 if (pSD->pTextPixelSet)
4036 value.addr = (XtPointer) &(pSD->pTextPixelSet->bg);
4038 XrmPutResource (&db,
4039 ResCat (res_class, screen_name, "XmTextField",
4040 WmNbackground), XtRPixel, &value);
4042 XrmPutResource (&db,
4043 ResCat (res_class, screen_name, "XmText",
4044 WmNbackground), XtRPixel, &value);
4049 /******************************<->*************************************
4051 * ResCat (s1,s2,s3,s4)
4056 * Cats up to four strings together with '*' in between.
4061 * s1...s4 = pointers to Strings or NULL pointers (no string)
4065 * Return = pointer to statically allocated string that has
4066 * the passed in string cat'ed together with '*'s
4071 * Does no limit checking on the static buffer
4073 *************************************<->***********************************/
4076 ResCat (String s1, String s2, String s3, String s4)
4082 Boolean useResourceClass = True;
4084 wmGD.tmpBuffer[0] = '\0';
4090 if ((MwmBehavior) &&
4091 !strcmp (s1, WM_RESOURCE_CLASS))
4094 * if this routine is called with a class name
4095 * ("Mwm" or "Dtwm"), then DON'T use it.
4096 * We want our resources to be written out
4097 * as: *iconImageForeground: <pixel_val>
4099 * as opposed to: Dtwm*iconImageForeground: <pixel_val>
4103 useResourceClass = False;
4105 else if (!strcmp (s1, DT_WM_RESOURCE_CLASS))
4107 useResourceClass = False;
4111 strncat((char *)wmGD.tmpBuffer, s1, count);
4112 count -= strlen(s1);
4115 if (s2 && (count > 0))
4117 strncat ((char *)wmGD.tmpBuffer, "*", count);
4119 strncat ((char *)wmGD.tmpBuffer, s2, count);
4120 count -= strlen (s2);
4122 if (s3 && (count > 0))
4124 strncat ((char *)wmGD.tmpBuffer, "*", count);
4126 strncat ((char *)wmGD.tmpBuffer, s3, count);
4127 count -= strlen (s3);
4131 strncat ((char *)wmGD.tmpBuffer, "*", count);
4133 strncat ((char *)wmGD.tmpBuffer, s4, count);
4138 return ((String) wmGD.tmpBuffer);
4140 } /* END OF FUNCTION ResCat */
4144 /******************************<->*************************************
4146 * CheckForNoDither (pAD)
4151 * Checks for reserved string as pixmap name of dither that indicates
4152 * no dithering and replaces the string with a NULL.
4157 * pAD = pointer to appearance data
4161 * pAD = pointer to appearance data (may be modified)
4165 * This check is done to avoid repeated calls to XmGetPixmap when
4166 * managing windows. XmGetPixmap doesn't cache failures, and the
4167 * NoDither string should fail every time. We want to prevent
4168 * XmGetPixmap from call XtResolvePathName to rummage through
4171 *************************************<->***********************************/
4174 CheckForNoDither (AppearanceData *pAD)
4176 if (pAD->backgroundPStr &&
4177 !strcmp(pAD->backgroundPStr, _NoDither))
4179 pAD->backgroundPStr = NULL;
4181 if (pAD->bottomShadowPStr &&
4182 !strcmp(pAD->bottomShadowPStr, _NoDither))
4184 pAD->bottomShadowPStr = NULL;
4186 if (pAD->topShadowPStr &&
4187 !strcmp(pAD->topShadowPStr, _NoDither))
4189 pAD->topShadowPStr = NULL;
4191 if (pAD->activeBackgroundPStr &&
4192 !strcmp(pAD->activeBackgroundPStr, _NoDither))
4194 pAD->activeBackgroundPStr = NULL;
4196 if (pAD->activeBottomShadowPStr &&
4197 !strcmp(pAD->activeBottomShadowPStr, _NoDither))
4199 pAD->activeBottomShadowPStr = NULL;
4201 if (pAD->activeTopShadowPStr &&
4202 !strcmp(pAD->activeTopShadowPStr, _NoDither))
4204 pAD->activeTopShadowPStr = NULL;
4207 } /* END OF FUNCTION CheckForNoDither */
4213 /******************************<->*************************************
4215 * ProcessAppearanceResources (pSD)
4220 * Retrieve and process the general appearance resources for the mwm
4221 * subparts: "client", "icon", and "feedback"
4226 * pSD = pointer to screen data
4230 * modifies parts of global data wmGD.
4234 * o Changeable GCs are created with XCreateGC. The base GCs used for
4235 * text output will have clip_masks defined for them later.
4238 *************************************<->***********************************/
4241 ProcessAppearanceResources (WmScreenData *pSD)
4243 Widget clientW; /* dummy widget for resource fetching */
4249 * Get the client subpart resources:
4252 /* save info in static globals for dynamic default processing */
4253 _defaultBackground = _defaultColor1;
4254 _defaultActiveBackground = _defaultColor2;
4255 _pAppearanceData = &(pSD->clientAppearance);
4257 (void)XtGetSubresources (pSD->screenTopLevelW,
4258 (XtPointer) &(pSD->clientAppearance),
4259 WmNclient, WmCClient, wmAppearanceResources,
4260 XtNumber (wmAppearanceResources), NULL, 0);
4262 CheckForNoDither (&(pSD->clientAppearance));
4267 * Process the client resource values:
4270 /* make background, top and bottom shadow pixmaps */
4272 MakeAppearanceResources (pSD, &(pSD->clientAppearance), True);
4276 * Get the client.title subpart resources:
4279 /* insert "client" widget in hierarchy */
4282 clientW = XtCreateWidget (WmNclient, xmRowColumnWidgetClass,
4283 pSD->screenTopLevelW, (ArgList) args, i);
4286 /* fetch "client.title" subpart appearance resources */
4288 _pAppearanceData = &(pSD->clientTitleAppearance);
4290 (void)XtGetSubresources (clientW, (XtPointer) &(pSD->clientTitleAppearance),
4291 WmNtitle, WmCTitle, wmAppearanceResources,
4292 XtNumber (wmAppearanceResources), NULL, 0);
4294 CheckForNoDither (&(pSD->clientTitleAppearance));
4299 * Process the client.title resource values:
4304 * check if client title appearance is different from the rest of frame.
4306 if (SimilarAppearanceData (&(pSD->clientAppearance),
4307 &(pSD->clientTitleAppearance)))
4309 /* title bar doesn't need special graphic processing */
4310 pSD->decoupleTitleAppearance = False;
4314 /* make background, top and bottom shadow pixmaps */
4315 MakeAppearanceResources (pSD, &(pSD->clientTitleAppearance), True);
4316 pSD->decoupleTitleAppearance = True;
4319 XtDestroyWidget (clientW); /* all done with dummy widget */
4323 * Get the icon subpart resources:
4326 _pAppearanceData = &(pSD->iconAppearance);
4328 (void)XtGetSubresources (pSD->screenTopLevelW,
4329 (XtPointer) &(pSD->iconAppearance),
4330 WmNicon, WmCIcon, wmAppearanceResources,
4331 XtNumber (wmAppearanceResources), NULL, 0);
4333 CheckForNoDither (&(pSD->iconAppearance));
4338 * Process the icon resource values:
4341 /* make background, top and bottom shadow pixmaps */
4343 MakeAppearanceResources (pSD, &(pSD->iconAppearance), True);
4347 * Get the feedback subpart resources:
4348 * !!! only get "inactive" resources !!!
4351 _defaultBackground = _defaultColor2;
4352 _defaultActiveBackground = _defaultColor2;
4353 _pAppearanceData = &(pSD->feedbackAppearance);
4355 (void)XtGetSubresources (pSD->screenTopLevelW,
4356 (XtPointer) &(pSD->feedbackAppearance),
4357 WmNfeedback, WmCFeedback, wmAppearanceResources,
4358 XtNumber (wmAppearanceResources), NULL, 0);
4360 CheckForNoDither (&(pSD->feedbackAppearance));
4364 * Process the feedback resource values:
4367 /* make background, top and bottom shadow pixmaps */
4369 MakeAppearanceResources (pSD, &(pSD->feedbackAppearance), False);
4372 } /* END OF FUNCTION ProcessAppearanceResources */
4375 /*************************************<->*************************************
4377 * MakeAppearanceResources (pSD, pAData, makeActiveResources)
4382 * This function makes top, bottom and background pixmaps for a window
4383 * manager component. Inactive and active (if specified) GC's are
4389 * pSD = pointer to screen data
4391 * pAData = pointer to appearance data structure containing resource info
4393 * makeActiveResources = if True then make active resources
4397 * *pAData = pixmap and GC fields filled out
4399 *************************************<->***********************************/
4402 MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources)
4407 * Extract a font from the font list.
4410 if (! XmeRenderTableGetDefaultFont(pAData->fontList, &(pAData->font)))
4412 sprintf((char *)wmGD.tmpBuffer, ((char *)GETMESSAGE(62, 23, "failed to load font: %.100s\0")), (char*) pAData->fontList);
4413 Warning((char *)wmGD.tmpBuffer);
4414 ExitWM(WM_ERROR_EXIT_VALUE);
4417 #ifndef NO_MULTIBYTE
4419 * Calculate title bar's height and store it in pAData.
4421 pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
4422 + WM_TITLE_BAR_PADDING;
4427 * Make standard (inactive) appearance resources.
4430 /* background pixmap */
4432 if (pAData->backgroundPStr)
4434 pAData->backgroundPixmap = XmGetPixmap (
4435 ScreenOfDisplay (DISPLAY,
4437 pAData->backgroundPStr,
4439 pAData->background);
4441 if (pAData->backgroundPixmap == XmUNSPECIFIED_PIXMAP)
4443 pAData->backgroundPixmap = (Pixmap)NULL;
4448 pAData->backgroundPixmap = (Pixmap)NULL;
4451 /* top shadow pixmap */
4453 if (pAData->topShadowPStr)
4456 * Make sure top shadow color is not the same as background
4457 * otherwise the wrong pixmap will be generated.
4459 if (pAData->topShadowColor != pAData->background)
4460 foreground = pAData->topShadowColor;
4462 foreground = pAData->foreground;
4463 pAData->topShadowPixmap = XmGetPixmap (
4464 ScreenOfDisplay (DISPLAY,
4466 pAData->topShadowPStr,
4468 pAData->background);
4470 if (pAData->topShadowPixmap == XmUNSPECIFIED_PIXMAP)
4472 pAData->topShadowPixmap = (Pixmap)NULL;
4477 pAData->topShadowPixmap = (Pixmap)NULL;
4481 /* bottom shadow pixmap */
4483 if (pAData->bottomShadowPStr)
4486 * Make sure bottom shadow color is not the same as background
4487 * otherwise the wrong pixmap will be generated.
4489 if (pAData->bottomShadowColor != pAData->background)
4490 foreground = pAData->bottomShadowColor;
4492 foreground = pAData->foreground;
4493 pAData->bottomShadowPixmap = XmGetPixmap (
4494 ScreenOfDisplay (DISPLAY,
4496 pAData->bottomShadowPStr,
4498 pAData->background);
4500 if (pAData->bottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
4502 pAData->bottomShadowPixmap = (Pixmap)NULL;
4507 pAData->bottomShadowPixmap = (Pixmap)NULL;
4510 /* inactive appearance GC */
4512 GetAppearanceGCs (pSD,
4516 pAData->backgroundPixmap,
4517 pAData->topShadowColor,
4518 pAData->topShadowPixmap,
4519 pAData->bottomShadowColor,
4520 pAData->bottomShadowPixmap,
4521 &(pAData->inactiveGC),
4522 &(pAData->inactiveTopShadowGC),
4523 &(pAData->inactiveBottomShadowGC));
4528 * Make active apppearance resources if specified.
4531 if (!makeActiveResources)
4536 /* active background pixmap */
4538 if (pAData->activeBackgroundPStr)
4540 pAData->activeBackgroundPixmap = XmGetPixmap (
4541 ScreenOfDisplay (DISPLAY,
4543 pAData->activeBackgroundPStr,
4544 pAData->activeForeground,
4545 pAData->activeBackground);
4547 if (pAData->activeBackgroundPixmap == XmUNSPECIFIED_PIXMAP)
4549 pAData->activeBackgroundPixmap = (Pixmap)NULL;
4554 pAData->activeBackgroundPixmap = (Pixmap)NULL;
4557 /* active top shadow pixmap */
4559 if (pAData->activeTopShadowPStr)
4561 pAData->activeTopShadowPixmap = XmGetPixmap (
4562 ScreenOfDisplay (DISPLAY,
4564 pAData->activeTopShadowPStr,
4565 pAData->activeTopShadowColor,
4566 pAData->activeBackground);
4568 if (pAData->activeTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
4570 pAData->activeTopShadowPixmap = (Pixmap)NULL;
4575 pAData->activeTopShadowPixmap = (Pixmap)NULL;
4579 /* active bottom shadow pixmap */
4581 if (pAData->activeBottomShadowPStr)
4583 pAData->activeBottomShadowPixmap = XmGetPixmap (
4584 ScreenOfDisplay (DISPLAY,
4586 pAData->activeBottomShadowPStr,
4587 pAData->activeBottomShadowColor,
4588 pAData->activeBackground);
4590 if (pAData->activeBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
4592 pAData->activeBottomShadowPixmap = (Pixmap)NULL;
4597 pAData->activeBottomShadowPixmap = (Pixmap)NULL;
4600 /* inactive appearance GC */
4602 GetAppearanceGCs (pSD,
4603 pAData->activeForeground,
4604 pAData->activeBackground,
4606 pAData->activeBackgroundPixmap,
4607 pAData->activeTopShadowColor,
4608 pAData->activeTopShadowPixmap,
4609 pAData->activeBottomShadowColor,
4610 pAData->activeBottomShadowPixmap,
4611 &(pAData->activeGC),
4612 &(pAData->activeTopShadowGC),
4613 &(pAData->activeBottomShadowGC));
4616 } /* END OF FUNCTION MakeAppearanceResources */
4620 /*************************************<->*************************************
4622 * GetAppearanceGCs (pSD, fg, bg, font, bg_pixmap, ts_color,
4623 * ts_pixmap, bs_color, bs_pixmap, pGC, ptsGC, pbsGC)
4628 * Creates the appearance GCs for any of the icon, client, or feedback
4634 * pSD - pointer to screen data
4635 * fg - base foreground color
4636 * bg - base background color
4638 * bg_pixmap - background pixmap
4639 * ts_color - top shadow color
4640 * ts_pixmap - top shadow pixmap
4641 * bs_color - bottom shadow color
4642 * bs_pixmap - bottom shadow pixmap
4643 * pGC - pointer to location to receive base GC
4644 * ptsGC - pointer to location to receive top shadow GC
4645 * pbsGC - pointer to location to receive bottom shadow GC
4650 * *ptsGC - top shadow GC
4651 * *pbsGC - bottom shadow GC
4658 *************************************<->***********************************/
4661 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)
4671 mask = GCForeground | GCBackground | GCFont;
4672 gcv.foreground = fg;
4673 gcv.background = bg;
4674 gcv.font = font->fid;
4679 gcv.tile = bg_pixmap;
4682 *pGC = XCreateGC (DISPLAY, pSD->rootWindow, mask, &gcv);
4685 * !!! Need GC error detection !!!
4688 *ptsGC = GetHighlightGC (pSD, ts_color, bg, ts_pixmap);
4690 *pbsGC = GetHighlightGC (pSD, bs_color, bg, bs_pixmap);
4692 } /* END OF FUNCTION GetAppearanceGCs */
4697 /*************************************<->*************************************
4699 * ProcessScreenResources (pSD, screenName)
4704 * This function retrieves resources that are screen specific. If the
4705 * window manager is providing standard behavior then retrieve the limited
4706 * set of resources that don't affect standard behavior and set the
4707 * values of the other resources to the standard values.
4712 * pSD = pointer to screen data
4713 * screenName = name of screen
4718 * pSD = resource data for screen is set
4723 * o Gets subresources based on workspace name
4725 *************************************<->***********************************/
4728 ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName)
4731 pResSD = pSD; /* save current screen data for default processing */
4733 * Use the screen name (e.g., "0") as the default resource name.
4736 if (wmGD.useStandardBehavior)
4738 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4739 (String) screenName,
4740 (String) screenName,
4741 wmStdScreenResources,
4742 XtNumber (wmStdScreenResources), NULL, 0);
4745 * Fill in the standard resource values.
4748 SetStdScreenResourceValues (pSD);
4752 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4753 (String)screenName, (String) screenName,
4755 XtNumber (wmScreenResources), NULL, 0);
4757 #ifndef MOTIF_ONE_DOT_ONE
4758 pSD->moveOpaque = (((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW)))
4759 -> screen.moveOpaque);
4765 * Retrieve screen specific resources.
4768 if (wmGD.useStandardBehavior)
4770 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4771 (String) screenName, (String)screenName, wmStdScreenResources,
4772 XtNumber (wmStdScreenResources), NULL, 0);
4775 * Fill in the standard resource values.
4778 SetStdScreenResourceValues (pSD);
4782 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4783 (String)screenName, (String)screenName, wmScreenResources,
4784 XtNumber (wmScreenResources), NULL, 0);
4786 #ifndef MOTIF_ONE_DOT_ONE
4787 pSD->moveOpaque =(((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW)))
4788 -> screen.moveOpaque);
4794 * Do some additional processing on the window manager resource values.
4798 if (pSD->iconImageMinimum.width < ICON_IMAGE_MIN_WIDTH)
4800 pSD->iconImageMinimum.width = ICON_IMAGE_MIN_WIDTH;
4802 else if (pSD->iconImageMinimum.width > ICON_IMAGE_MAX_WIDTH)
4804 pSD->iconImageMinimum.width = ICON_IMAGE_MAX_WIDTH;
4807 if (pSD->iconImageMinimum.height < ICON_IMAGE_MIN_HEIGHT)
4809 pSD->iconImageMinimum.height = ICON_IMAGE_MIN_HEIGHT;
4811 else if (pSD->iconImageMinimum.height > ICON_IMAGE_MAX_HEIGHT)
4813 pSD->iconImageMinimum.height = ICON_IMAGE_MAX_HEIGHT;
4816 if (pSD->iconImageMaximum.width < pSD->iconImageMinimum.width)
4818 pSD->iconImageMaximum.width = pSD->iconImageMinimum.width;
4820 else if (pSD->iconImageMaximum.width > ICON_IMAGE_MAX_WIDTH)
4822 pSD->iconImageMaximum.width = ICON_IMAGE_MAX_WIDTH;
4825 if (pSD->iconImageMaximum.height < pSD->iconImageMinimum.height)
4827 pSD->iconImageMaximum.height = pSD->iconImageMinimum.height;
4829 else if (pSD->iconImageMaximum.height > ICON_IMAGE_MAX_HEIGHT)
4831 pSD->iconImageMaximum.height = ICON_IMAGE_MAX_HEIGHT;
4834 if (pSD->iconPlacementMargin > MAXIMUM_ICON_MARGIN)
4836 pSD->iconPlacementMargin = MAXIMUM_ICON_MARGIN;
4839 if (pSD->maximumMaximumSize.width <= 0)
4841 pSD->maximumMaximumSize.width =
4842 2 * DisplayWidth (DISPLAY, pSD->screen);
4845 if (pSD->maximumMaximumSize.height <= 0)
4847 pSD->maximumMaximumSize.height =
4848 2 * DisplayHeight (DISPLAY, pSD->screen);
4852 * Set the icon appearance default based on whether or not the icon box
4856 if (pSD->iconDecoration & USE_ICON_DEFAULT_APPEARANCE)
4858 if (pSD->useIconBox)
4860 pSD->iconDecoration = ICON_APPEARANCE_ICONBOX;
4864 pSD->iconDecoration = ICON_APPEARANCE_STANDALONE;
4869 * If resizeBorderWidth or frameBorderWidth is unset then initialize
4870 * to dynamic defaults.
4873 if ((pSD->resizeBorderWidth == (Dimension)BIGSIZE) ||
4874 (pSD->frameBorderWidth == (Dimension)BIGSIZE))
4876 double xres, yres, avg_res;
4878 xres = (((double) DisplayWidth(DISPLAY, pSD->screen)) /
4879 ((double) DisplayWidthMM(DISPLAY, pSD->screen)));
4880 yres = (((double) DisplayHeight(DISPLAY, pSD->screen)) /
4881 ((double) DisplayHeightMM(DISPLAY, pSD->screen)));
4883 avg_res = (xres + yres) / 2.0;
4885 /* Multiply times width in mm (avg. 7-8 pixels) */
4886 if (pSD->resizeBorderWidth == (Dimension)BIGSIZE)
4888 pSD->resizeBorderWidth = (int) (avg_res * 2.2);
4890 /* limit size because big borders look ugly */
4892 if (wmGD.frameStyle == WmSLAB)
4895 if (pSD->resizeBorderWidth > 6) pSD->resizeBorderWidth = 6;
4900 if (pSD->resizeBorderWidth > 7) pSD->resizeBorderWidth = 7;
4905 /* Multiply times width in mm (avg. 5-6 pixels) */
4906 if (pSD->frameBorderWidth == (Dimension)BIGSIZE)
4908 pSD->frameBorderWidth = (int) (avg_res * 1.7);
4910 /* limit size because big borders look ugly */
4911 if (wmGD.frameStyle == WmSLAB)
4913 if (pSD->frameBorderWidth > 4) pSD->frameBorderWidth = 4;
4917 if (pSD->frameBorderWidth > 5) pSD->frameBorderWidth = 5;
4923 pSD->externalBevel = FRAME_EXTERNAL_SHADOW_WIDTH;
4924 pSD->joinBevel = FRAME_INTERNAL_SHADOW_WIDTH;
4925 if (pSD->frameBorderWidth <
4926 (pSD->externalBevel + MIN_INTERNAL_BEVEL))
4928 pSD->frameBorderWidth =
4929 pSD->externalBevel + MIN_INTERNAL_BEVEL;
4931 else if (pSD->frameBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
4933 pSD->frameBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
4936 if (pSD->resizeBorderWidth <
4937 (pSD->externalBevel + MIN_INTERNAL_BEVEL))
4939 pSD->resizeBorderWidth =
4940 (pSD->externalBevel + MIN_INTERNAL_BEVEL);
4942 else if (pSD->resizeBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
4944 pSD->resizeBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
4949 * Update the resource database.
4951 WriteOutXrmColors (pSD);
4956 * Process the component appearance resources for client,
4957 * icon and feedback parts of mwm.
4960 ProcessAppearanceResources (pSD);
4964 * Process the workspace list and name the initial
4968 ProcessWorkspaceList (pSD);
4971 * Process default backdrop images to be used in low-color
4974 ProcessDefaultBackdropImages (pSD);
4978 * Save the default icon pixmap in global data. We'll use it only
4982 pSD->builtinIconPixmap =
4983 XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char *)iImage_bits,
4984 iImage_width, iImage_height);
4986 } /* END OF FUNCTION ProcessScreenResources */
4990 /*************************************<->*************************************
4992 * ProcessDefaultBackdropImages (pSD)
4997 * This function processes the default backdrop images to be used
4998 * in low color or black and white workspaces.
5003 * pSD = pointer to screen data
5008 * pSD = resource data for screen is set
5014 *************************************<->***********************************/
5017 ProcessDefaultBackdropImages (WmScreenData *pSD)
5019 } /* END OF FUNCTION ProcessDefaultBackdropImages */
5023 /*************************************<->*************************************
5025 * ProcessWorkspaceList (pSD)
5030 * This function processes the workspaceCount and workspaceList
5031 * resources for a particular screen. It creates space for the initial
5032 * workspace data structures and adds in names for workspaces.
5037 * pSD = pointer to screen data
5042 * pSD = resource data for screen is set
5047 * NOTE: The workspaceCount resource has precedence over the
5048 * workspaceList resource. workspaceCount determines the number of
5049 * workspaces to create for the screen. Once the number is determined,
5050 * workspaceList is used to fill in the "names." If workspaceList is
5051 * not present or doesn't have enough names, then missing names are
5052 * generated automatically. If workspaceList is present and
5053 * workspaceCount is not present, then the workspaceCount is determined
5054 * by the number of names in workspaceList.
5056 *************************************<->***********************************/
5059 ProcessWorkspaceList (WmScreenData *pSD)
5061 int i, wsNameCount, wsNamesAlloced;
5062 WmWorkspaceData *pwsI;
5063 unsigned char *lineP = NULL;
5064 unsigned char *string;
5065 Boolean bHaveWorkspaceList;
5066 Boolean bHaveWorkspaceCount;
5067 char **ppchWsNames = NULL;
5070 * Validate initial resource settings
5072 bHaveWorkspaceCount = (pSD->numWorkspaces >= 1);
5073 bHaveWorkspaceList = (pSD->workspaceList != NULL);
5075 if (bHaveWorkspaceList)
5078 * Parse out array of workspace names
5080 wsNamesAlloced = WS_ALLOC_AMOUNT;
5081 ppchWsNames = (char **) XtMalloc (wsNamesAlloced * sizeof (char *));
5082 if (pSD->workspaceList)
5084 lineP = (unsigned char *) pSD->workspaceList;
5088 lineP = (unsigned char *)NULL;
5092 while (((string = GetString(&lineP)) != NULL))
5094 ppchWsNames[wsNameCount] = (char *) string;
5096 if (++wsNameCount >= wsNamesAlloced)
5099 * Need to add more workspaces
5101 wsNamesAlloced += WS_ALLOC_AMOUNT;
5102 if (!(ppchWsNames = (char **) XtRealloc
5103 ((char *)ppchWsNames,
5104 wsNamesAlloced * sizeof(char *))))
5106 ExitWM (WM_ERROR_EXIT_VALUE);
5111 if (!bHaveWorkspaceCount)
5113 pSD->numWorkspaces = wsNameCount;
5116 else if (!bHaveWorkspaceCount)
5119 * Neither workspaceCount nor workspaceList specified!!
5120 * Assume one workspace.
5122 pSD->numWorkspaces = 1;
5125 if (pSD->numWorkspaces > MAX_WORKSPACE_COUNT)
5126 pSD->numWorkspaces = MAX_WORKSPACE_COUNT;
5129 * Allocate the array of workspace data
5131 pSD->numWsDataAllocated = (pSD->numWorkspaces + WS_ALLOC_AMOUNT);
5132 pSD->numWsDataAllocated -= pSD->numWsDataAllocated % WS_ALLOC_AMOUNT;
5133 if (!(pSD->pWS = (WmWorkspaceData *)
5134 XtMalloc (pSD->numWsDataAllocated * sizeof(WmWorkspaceData))))
5136 ExitWM (WM_ERROR_EXIT_VALUE);
5141 for (i = 0; i < pSD->numWorkspaces; i++, pwsI++)
5143 if (bHaveWorkspaceList && i < wsNameCount)
5145 string = (unsigned char *) ppchWsNames[i];
5149 string = GenerateWorkspaceName (pSD, i);
5151 if (!(pwsI->name = (String) XtMalloc (1+strlen((char *)string))))
5153 Warning (((char *)GETMESSAGE(62, 27, "Insufficient memory for workspace data")));
5154 ExitWM(WM_ERROR_EXIT_VALUE);
5158 strcpy(pwsI->name, (char *)string);
5162 if (ppchWsNames) XtFree ((char *) ppchWsNames);
5164 } /* END OF FUNCTION ProcessWorkspaceList */
5169 /******************************<->*************************************
5171 * ProcessWorkspaceResources (pWS)
5176 * This function retrieves resources that are workspace specific. If the
5177 * window manager is providing standard behavior then retrieve the limited
5178 * set of resources that don't affect standard behavior and set the
5179 * values of the other resources to the standard values.
5184 * pWS = pointer to workspace data
5189 * pWS = resource data for workspace is set
5194 * o Gets subresources based on workspace name
5196 ******************************<->***********************************/
5199 ProcessWorkspaceResources (WmWorkspaceData *pWS)
5203 * Retrieve workspace specific resources.
5206 pResWS = pWS; /* save current ws for default processing */
5209 if (wmGD.useStandardBehavior)
5211 XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
5212 pWS->name, pWS->name, wmStdWorkspaceResources,
5213 XtNumber (wmStdWorkspaceResources), NULL, 0);
5216 * Fill in the standard resource values.
5218 * (no code for this right now)
5221 pWS->iconBoxGeometry = NULL;
5226 XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
5227 pWS->name, pWS->name, wmWorkspaceResources,
5228 XtNumber (wmWorkspaceResources), NULL, 0);
5231 /* Dup iconbox geometry, it may be free'd later on. */
5233 if (pWS->iconBoxGeometry)
5235 pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
5241 if (pWS->title == NULL)
5244 * Setup default workspace title
5246 pWS->title = XmStringCreateLocalized(pWS->name);
5251 * Copy resource just in case there's a duplicate
5252 * Duplicates point to the same data, freeing on
5253 * rename can cause a crash.
5255 pWS->title = XmStringCopy(pWS->title);
5260 * Dup iconbox geometry, it may be free'd later on.
5262 if (pWS->iconBoxGeometry)
5264 pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
5268 * Get backdrop resources
5270 XtGetSubresources (pWS->workspaceTopLevelW,
5271 (XtPointer) &(pWS->backdrop),
5272 WmNbackdrop, WmCBackdrop, wmBackdropResources,
5273 XtNumber (wmBackdropResources), NULL, 0);
5275 ProcessBackdropResources (pWS, NULL);
5278 } /* END OF FUNCTION ProcessWorkspaceResources */
5282 /******************************<->*************************************
5284 * ProcessPresenceResources (pSD)
5289 * This function retrieves resources for the workspace presence
5294 * pSD = pointer to screen data
5299 * pSD = resource data for workspace presence dialog are set
5304 * o Gets subresources
5306 ******************************<->***********************************/
5309 ProcessPresenceResources (WmScreenData *pSD)
5311 #ifndef NO_MESSAGE_CATALOG
5312 static char *default_ws_pres_title = NULL;
5314 static char *default_ws_pres_title = "Workspace Presence";
5318 unsigned char *pch1, *pch2;
5320 #ifndef NO_MESSAGE_CATALOG
5322 * Set up localized default title string on initial time through
5324 if (default_ws_pres_title == NULL)
5328 * catgets returns a pointer to an area that is over written
5329 * on each call to catgets.
5332 tmpString = ((char *)GETMESSAGE(62, 59, "Occupy Workspace"));
5333 if ((default_ws_pres_title =
5334 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
5336 Warning (((char *)GETMESSAGE(62, 31, "Insufficient memory for local message string")));
5337 default_ws_pres_title = "Occupy Workspace";
5341 strcpy(default_ws_pres_title, tmpString);
5346 if (pSD->presence.shellW)
5348 XtGetSubresources (pSD->presence.shellW, (XtPointer) &pSD->presence,
5349 WmNworkspacePresence, WmCWorkspacePresence,
5350 wmWsPresenceResources,
5351 XtNumber (wmWsPresenceResources), NULL, 0);
5355 if (pSD->presence.title)
5357 pch1 = (unsigned char *)
5358 WmXmStringToString (pSD->presence.title);
5360 if (pch1 && (pch2 = (unsigned char *)
5361 XtMalloc (1+strlen((char *)pch1))))
5363 strcpy ((char *)pch2, (char *)pch1);
5369 pch2 = (unsigned char *) default_ws_pres_title;
5373 XtSetArg (args[n], XmNtitle, pch2); n++;
5374 XtSetValues (pSD->presence.shellW, args, n);
5377 } /* END OF FUNCTION ProcessPresenceResources */
5381 /*************************************<->*************************************
5383 * ProcessClientResources (pCD)
5388 * This function retrieves resources that are client specific. If the
5389 * window manager is providing standard behavior then retrieve the limited
5390 * set of resources that don't affect standard behavior and set the
5391 * values of the other resources to the standard values.
5396 * pCD = pointer to client data
5401 * pCD = resource data for client is set
5406 * o Gets subresources based on client name and class.
5407 * o Creates GC for the client Matte, if there is one.
5409 *************************************<->***********************************/
5412 ProcessClientResources (ClientData *pCD)
5416 WmScreenData *pSD = pCD->pSD;
5419 * Retrieve basic client specific resources.
5422 _pCD = pCD; /* save in static global for dynamic default processing */
5423 clientName = (pCD->clientName) ? pCD->clientName : WmNdefaults;
5424 clientClass = (pCD->clientClass) ? pCD->clientClass : WmNdefaults;
5426 if (wmGD.useStandardBehavior)
5428 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5429 clientClass, wmStdClientResources, XtNumber (wmStdClientResources),
5433 * Fill in the standard resource values.
5436 SetStdClientResourceValues (pCD);
5440 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5441 clientClass, wmClientResources, XtNumber (wmClientResources), NULL,
5445 #ifdef NO_MESSAGE_CATALOG
5447 * If (window menu spec is not found) then use the builtin
5451 if ((pCD->systemMenu == defaultSystemMenuName) &&
5452 (pSD->defaultSystemMenuUseBuiltin == TRUE))
5454 pCD->systemMenu = builtinSystemMenuName;
5459 * If the client decorations or client functions have been defaulted
5460 * fix up the fields in the ProcessMwmHints function.
5464 /* make top and bottom shadow pixmaps */
5466 if (pCD->iconImageBottomShadowPStr)
5468 if ((pCD->iconImageBottomShadowPStr ==
5469 pSD->iconAppearance.bottomShadowPStr) &&
5470 (pCD->iconImageBottomShadowColor ==
5471 pSD->iconAppearance.bottomShadowColor) &&
5472 (pCD->iconImageBackground ==
5473 pSD->iconAppearance.background))
5475 pCD->iconImageBottomShadowPixmap =
5476 pSD->iconAppearance.bottomShadowPixmap;
5480 pCD->iconImageBottomShadowPixmap =
5481 XmGetPixmap ( ScreenOfDisplay (DISPLAY,
5483 pCD->iconImageBottomShadowPStr,
5484 pCD->iconImageBottomShadowColor,
5485 pCD->iconImageBackground);
5487 if (pCD->iconImageBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
5489 pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
5495 pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
5498 if (pCD->iconImageTopShadowPStr)
5500 if ((pCD->iconImageTopShadowPStr ==
5501 pSD->iconAppearance.topShadowPStr) &&
5502 (pCD->iconImageTopShadowColor ==
5503 pSD->iconAppearance.topShadowColor) &&
5504 (pCD->iconImageBackground == pSD->iconAppearance.background))
5506 pCD->iconImageTopShadowPixmap =
5507 pSD->iconAppearance.topShadowPixmap;
5511 pCD->iconImageTopShadowPixmap =
5512 XmGetPixmap ( ScreenOfDisplay (DISPLAY,
5514 pCD->iconImageTopShadowPStr,
5515 pCD->iconImageTopShadowColor,
5516 pCD->iconImageBackground);
5518 if (pCD->iconImageTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
5520 pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
5526 pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
5529 if ((pCD->internalBevel < MIN_INTERNAL_BEVEL) ||
5530 (pCD->internalBevel > MAX_INTERNAL_BEVEL))
5532 pCD->internalBevel = MAX_INTERNAL_BEVEL;
5537 * Retrieve matte resources and make internal matte resources.
5540 if (pCD->matteWidth > 0)
5542 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5543 clientClass, wmClientResourcesM, XtNumber (wmClientResourcesM),
5546 /* make top and bottom shadow pixmaps */
5549 if (pCD->matteBottomShadowPStr &&
5550 (!strcmp(pCD->matteBottomShadowPStr, _NoDither)))
5552 pCD->matteBottomShadowPStr = NULL;
5555 if (pCD->matteBottomShadowPStr)
5557 if ((pCD->matteBottomShadowPStr ==
5558 pSD->clientAppearance.bottomShadowPStr) &&
5559 (pCD->matteBottomShadowColor ==
5560 pSD->clientAppearance.bottomShadowColor) &&
5561 (pCD->matteBackground == pSD->clientAppearance.background))
5563 pCD->matteBottomShadowPixmap =
5564 pSD->clientAppearance.bottomShadowPixmap;
5568 pCD->matteBottomShadowPixmap =
5569 XmGetPixmap (ScreenOfDisplay (DISPLAY,
5571 pCD->matteBottomShadowPStr,
5572 pCD->matteBottomShadowColor,
5573 pCD->matteBackground);
5575 if (pCD->matteBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
5577 pCD->matteBottomShadowPixmap = (Pixmap)NULL;
5583 pCD->matteBottomShadowPixmap = (Pixmap)NULL;
5587 if (pCD->matteTopShadowPStr &&
5588 (!strcmp(pCD->matteTopShadowPStr, _NoDither)))
5590 pCD->matteTopShadowPStr = NULL;
5593 if (pCD->matteTopShadowPStr)
5595 if ((pCD->matteTopShadowPStr ==
5596 pSD->clientAppearance.topShadowPStr) &&
5597 (pCD->matteTopShadowColor ==
5598 pSD->clientAppearance.topShadowColor) &&
5599 (pCD->matteBackground == pSD->clientAppearance.background))
5601 pCD->matteTopShadowPixmap =
5602 pSD->clientAppearance.topShadowPixmap;
5606 pCD->matteTopShadowPixmap =
5607 XmGetPixmap (ScreenOfDisplay (DISPLAY,
5609 pCD->matteTopShadowPStr,
5610 pCD->matteTopShadowColor,
5611 pCD->matteBackground);
5613 if (pCD->matteTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
5615 pCD->matteTopShadowPixmap = (Pixmap)NULL;
5621 pCD->matteTopShadowPixmap = (Pixmap)NULL;
5625 /* make top and bottom shadow GC's */
5627 pCD->clientMatteTopShadowGC = GetHighlightGC (pCD->pSD,
5628 pCD->matteTopShadowColor,
5629 pCD->matteBackground,
5630 pCD->matteTopShadowPixmap);
5632 pCD->clientMatteBottomShadowGC = GetHighlightGC (pCD->pSD,
5633 pCD->matteBottomShadowColor,
5634 pCD->matteBackground,
5635 pCD->matteBottomShadowPixmap);
5638 } /* END OF FUNCTION ProcessClientResources */
5642 /*************************************<->*************************************
5644 * SetStdClientResourceValues (pCD)
5649 * This function sets client resource data to standard values. This setting
5650 * is done in place of getting the values from the user settings in
5651 * the resource database.
5655 * pCD = pointer to the client data
5660 * pCD = (client data filled out with resource values)
5662 *************************************<->***********************************/
5665 SetStdClientResourceValues (ClientData *pCD)
5667 pCD->clientDecoration = WM_DECOR_DEFAULT;
5668 pCD->clientFunctions = WM_FUNC_DEFAULT;
5669 pCD->focusAutoRaise = True;
5670 pCD->systemMenu = builtinSystemMenuName;
5671 pCD->usePPosition = USE_PPOSITION_NONZERO;
5672 pCD->ignoreWMSaveHints = True;
5674 } /* END OF FUNCTION SetStdClientResourceValues */
5678 /******************************<->*************************************
5680 * SetStdScreenResourceValues (pSD)
5685 * This function sets screen resource data to standard values. This setting
5686 * is done in place of getting the values from the user settings in
5687 * the resource database.
5691 * pSD = pointer to the screen data
5696 * pSD = (screen data filled out with resource values)
5698 ******************************<->***********************************/
5701 SetStdScreenResourceValues (WmScreenData *pSD)
5703 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
5704 pSD->rootMenu = builtinRootMenuName;
5705 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
5706 pSD->buttonBindings = builtinButtonBindingsName;
5707 pSD->cleanText = True;
5708 pSD->iconDecoration =
5709 (ICON_LABEL_PART | ICON_IMAGE_PART | ICON_ACTIVE_LABEL_PART);
5710 pSD->iconPlacement =
5711 (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY);
5712 pSD->keyBindings = builtinKeyBindingsName;
5713 pSD->limitResize = True;
5714 pSD->resizeCursors = True;
5715 pSD->transientDecoration = (WM_DECOR_SYSTEM | WM_DECOR_RESIZEH);
5716 pSD->transientFunctions =
5717 (WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE |
5719 pSD->useIconBox = False;
5721 pSD->feedbackGeometry = NULL;
5722 pSD->moveOpaque = False;
5724 } /* END OF FUNCTION SetStdScreenResourceValues */
5727 /*************************************<->*************************************
5729 * GetHighlightGC (pSD, fg, bg, pixmap)
5734 * Get a graphic context for either drawing top- or bottom-shadow
5740 * pSD = pointer to screen data
5741 * fg = foreground color
5742 * bg = background color
5743 * pixmap = pixmap for highlight
5747 * RETRUN = GC with the input parameters incorporated.
5749 *************************************<->***********************************/
5751 GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap)
5757 mask = GCForeground | GCBackground | GCLineWidth | GCFillStyle;
5758 gcv.background = bg;
5759 gcv.foreground = fg;
5764 mask |= GCFillStyle | GCTile;
5765 gcv.fill_style = FillTiled;
5770 gcv.fill_style = FillSolid;
5775 * NOTE: If additional mask bits are added, modify WmGetGC()
5776 * in WmGraphics.c to check those values for matches.
5779 return (WmGetGC (pSD, mask, &gcv));
5780 #endif /* OLD_CODE */
5782 return (XtGetGC (pSD->screenTopLevelW, mask, &gcv));
5784 } /* END OF FUNCTION GetHighlightGC */
5788 /*************************************<->*************************************
5790 * _WmGetDynamicDefault (widget, type, defaultColor, newBackground, value)
5795 * This function is used to generate a default color of the requested
5796 * type. Default colors are generated for a 3-D appearance.
5801 * widget = this is the widget that is associated with the resource or
5802 * that is the reference widget for the wm subpart.
5804 * type = this is the type of color resource (e.g., top shadow color).
5806 * defaultColor = pointer to default color name/specification.
5808 * newBackground = background pixel for generating 3-D colors.
5813 * value = pointer to the XrmValue in which to store the color
5815 *************************************<->***********************************/
5818 _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value)
5820 static Screen *oldScreen = NULL;
5821 static Screen *newScreen;
5822 static Colormap oldColormap;
5823 static Colormap newColormap;
5824 static Pixel newValue;
5825 static Pixel background;
5826 static String oldDefaultColor = DEFAULT_COLOR_NONE;
5827 static XmColorData colorData;
5829 /* initialize the return value */
5831 value->size = sizeof (newValue);
5832 value->addr = (char *)&newValue;
5836 * Process monochrome defaults first.
5839 newScreen = XtScreen (widget);
5841 if (Monochrome (newScreen))
5846 * Check color server sets for this screen.
5848 if (wmGD.statusColorServer == CSERVE_NORMAL)
5853 for (i = 0; i < wmGD.numScreens; i++)
5855 if (XScreenNumberOfScreen(newScreen) == wmGD.Screens[i].screen)
5857 pSD = &wmGD.Screens[i];
5866 for (i = 0; i < XmCO_MAX_NUM_COLORS; i++)
5868 if (pSD->pPixelData[i].bg == newBackground)
5872 case WmFGC: newValue = pSD->pPixelData[i].fg; break;
5873 case WmBGC: newValue = pSD->pPixelData[i].bg; break;
5874 case WmTSC: newValue = pSD->pPixelData[i].ts; break;
5875 case WmBSC: newValue = pSD->pPixelData[i].bs; break;
5889 case WmFGC: newValue = BlackPixelOfScreen (newScreen); break;
5890 case WmBGC: newValue = WhitePixelOfScreen (newScreen); break;
5891 case WmTSC: newValue = WhitePixelOfScreen (newScreen); break;
5892 case WmBSC: newValue = BlackPixelOfScreen (newScreen); break;
5902 * Check to see if appropriate colors are available from the
5903 * previous request; if the color is a background color then get
5904 * default colors. Generate 3-D colors if necessary. Maintain
5905 * new colors in static variables for later reuse.
5908 newColormap = widget->core.colormap;
5910 if ((oldScreen != NULL) && (oldScreen == newScreen) &&
5911 (oldColormap == newColormap) && (type != WmBGC) &&
5912 (background == newBackground))
5915 else if ((oldScreen == newScreen) && (oldColormap == newColormap) &&
5916 (type == WmBGC) && (oldDefaultColor == defaultColor))
5919 else if (type == WmBGC)
5922 * Find or generate a background color and associated 3-D colors.
5925 oldDefaultColor = defaultColor;
5927 * Fix for CR 5152 - Due to the use of Realloc in the color caches,
5928 * a static pointer is not acceptable. Change it
5929 * to a static structure to maintain the data
5931 colorData = *_WmGetDefaultColors (newScreen, newColormap, defaultColor);
5936 * Find or generate a color based on the associated background color.
5939 oldDefaultColor = DEFAULT_COLOR_NONE;
5940 background = newBackground;
5942 XmGetColors(newScreen, newColormap, background,
5943 &colorData.foreground.pixel,
5944 &colorData.top_shadow.pixel,
5945 &colorData.bottom_shadow.pixel,
5946 &colorData.select.pixel);
5949 oldScreen = newScreen;
5950 oldColormap = newColormap;
5954 * Set up the return value.
5957 colorData.allocated |= type;
5960 case XmBACKGROUND: newValue = colorData.background.pixel; break;
5961 case XmFOREGROUND: newValue = colorData.foreground.pixel; break;
5962 case XmTOP_SHADOW: newValue = colorData.top_shadow.pixel; break;
5963 case XmBOTTOM_SHADOW: newValue = colorData.bottom_shadow.pixel; break;
5964 case XmSELECT: newValue = colorData.select.pixel; break;
5965 default: newValue = colorData.background.pixel; break;
5968 } /* END OF FUNCTION _WmGetDynamicDefault */
5972 /*************************************<->*************************************
5974 * _WmGetDefaultColors (screen, colormap, defaultColor)
5979 * This function is used to find or generate default 3-D colors based on a
5980 * default background color.
5985 * screen = screen for which colors are to be generated.
5987 * colormap = colormap that is to be used to make colors.
5989 * defaultColor = pointer to a default color name/specification.
5994 * RETURN = pointer to WmColorData structure containing 3-D colors.
5996 *************************************<->***********************************/
5998 XmColorData * _WmGetDefaultColors (screen, colormap, defaultColor)
6001 String defaultColor;
6004 static XmColorData *defaultSet[2] = {NULL, NULL};
6005 static int defaultCount[2] = {0, 0};
6006 static int defaultSize[2] = {0, 0};
6008 register XmColorData *set;
6012 Display *display = DisplayOfScreen (screen);
6016 * Fix for CR 5152 - Due to the use of Realloc with _XmGetColors, it is
6017 * necessary to maintain a separate cache of color
6018 * data. The Realloc may cause the data to be moved,
6019 * and the cache would contain pointers into the heap.
6023 * Look through the cache to see if the defaults are already in the
6024 * cache. There is a list of cached defaults for each default color.
6027 if (defaultColor == _defaultColor2)
6036 set = defaultSet[setId];
6037 count = defaultCount[setId];
6038 size = defaultSize[setId];
6040 for (i = 0; i < count; i++)
6042 if (((set + i)->screen == screen) && ((set + i)->color_map == colormap))
6049 * No match in the cache, make a new entry and generate the colors.
6054 size = (defaultSize[setId] += 10);
6055 set = defaultSet[setId] =
6056 (XmColorData *)WmRealloc ((char *) defaultSet[setId],
6057 sizeof (XmColorData) * size);
6061 * Make the default background color for the resource set.
6064 if(!XParseColor (display, colormap, defaultColor, &colorDef))
6066 if(!(strcmp(defaultColor, _defaultColor1)))
6068 XParseColor (display, colormap, _defaultColor1HEX, &colorDef);
6072 XParseColor (display, colormap, _defaultColor2HEX, &colorDef);
6076 XAllocColor (display, colormap, &colorDef);
6080 * Generate the 3-D colors and save them in the defaults cache.
6083 XmGetColors(screen, colormap, colorDef.pixel,
6084 &set[count].foreground.pixel,
6085 &set[count].top_shadow.pixel,
6086 &set[count].bottom_shadow.pixel,
6087 &set[count].select.pixel);
6089 set[count].background.pixel = colorDef.pixel;
6091 set[count].screen = screen;
6092 set[count].color_map = colormap;
6093 set[count].allocated = True;
6095 XQueryColor(DISPLAY, colormap, &(set[count].background));
6096 XQueryColor(DISPLAY, colormap, &(set[count].foreground));
6097 XQueryColor(DISPLAY, colormap, &(set[count].top_shadow));
6098 XQueryColor(DISPLAY, colormap, &(set[count].bottom_shadow));
6099 XQueryColor(DISPLAY, colormap, &(set[count].select));
6101 (defaultCount[setId])++;
6103 return (set + count);
6106 } /* END OF FUNCTION _WmGetDefaultColors */
6110 /*************************************<->*************************************
6112 * WmRealloc (ptr, size)
6117 * This function is used reallocate a block of storage that has been
6123 * ptr = pointer to storage that is to be realloc'ed; if NULL malloc an
6124 * initial block of storage.
6126 * size = size of new storage
6130 * RETURN = pointer to realloc'ed block of storage
6132 *************************************<->***********************************/
6134 char * WmRealloc (ptr, size)
6141 ptr = (char *)XtRealloc (ptr, size);
6145 ptr = (char *)XtMalloc (size);
6150 Warning (((char *)GETMESSAGE(62, 37, "Insufficient memory for window manager data")));
6155 } /* END OF FUNCTION WmRealloc */
6159 /*************************************<->*************************************
6161 * WmMalloc (ptr, size)
6166 * This function is used malloc a block of storage. If a previous block
6167 * of storage is being replace the old block is free'd.
6172 * ptr = pointer to storage that is to be replaced (free'd).
6174 * size = size of new storage
6178 * RETURN = pointer to malloc'ed block of storage
6180 *************************************<->***********************************/
6182 char * WmMalloc (ptr, size)
6192 ptr = (char *)XtMalloc (size);
6196 Warning (((char *)GETMESSAGE(62, 38, "Insufficient memory for window manager data")));
6201 } /* END OF FUNCTION WmMalloc */
6205 /*************************************<->*************************************
6207 * SetupDefaultResources (pSD)
6212 * This function is used to setup default (builtin) resources for the
6218 * pSD = pointer to screen data
6219 * wmGD = (defaultKeyBindingsString, ...)
6221 * builtinKeyBindingsName = name of default key bindings set
6228 *************************************<->***********************************/
6231 SetupDefaultResources (pSD)
6236 KeySpec *nextKeySpec;
6242 * If (using DefaultBindings mechanism and bindings are not found in .mwmrc)
6243 * then use the builtin bindings.
6245 if (!pSD->keySpecs && !wmGD.useStandardBehavior)
6248 * Print warning if user is NOT using "DefaultKeyBindings".
6250 if (strcmp (pSD->keyBindings, defaultKeyBindingsName))
6252 MWarning (((char *)GETMESSAGE(62, 67, "Key bindings %s not found, using builtin key bindings\n")),
6255 pSD->keyBindings = builtinKeyBindingsName;
6258 if (!pSD->buttonSpecs && !wmGD.useStandardBehavior)
6261 * Print warning if user is NOT using "DefaultButtonBindings".
6263 if (strcmp (pSD->buttonBindings, defaultButtonBindingsName))
6265 MWarning (((char *)GETMESSAGE(62, 68, "Button bindings %s not found, using builtin button bindings\n")),
6266 pSD->buttonBindings);
6268 pSD->buttonBindings = builtinButtonBindingsName;
6271 if (pSD->keyBindings == builtinKeyBindingsName)
6274 * Default key specifications are to be used and no default
6275 * set has been provided by the user. Make the built-in default
6279 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
6281 * Before parsing the string, substitute the real name for
6282 * the default rootmenu using the resource rootMenu
6283 * for the %s in the string.
6288 buffer = (char *) XtMalloc(strlen(builtinKeyBindings) +
6289 strlen(pSD->rootMenu) + 1);
6290 sprintf(buffer, builtinKeyBindings, pSD->rootMenu);
6292 ParseKeyStr (pSD, (unsigned char *)buffer);
6294 ParseKeyStr (pSD, (unsigned char *)builtinKeyBindings);
6295 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
6300 * Add the switch behavior key binding to the front of the list
6301 * of user specified key bindings that have been parsed.
6304 nextKeySpec = pSD->keySpecs;
6305 keyBindings = pSD->keyBindings;
6306 pSD->keyBindings = behaviorKeyBindingName;
6307 pSD->keySpecs = NULL;
6309 ParseKeyStr (pSD, (unsigned char *)behaviorKeyBindings);
6313 /* Skip past the TWO key definitions (1.2 & 1.1.4) */
6314 pSD->keySpecs->nextKeySpec->nextKeySpec = nextKeySpec;
6318 pSD->keySpecs = nextKeySpec;
6320 pSD->keyBindings = keyBindings;
6323 if (pSD->buttonBindings == builtinButtonBindingsName)
6326 * Default button specifications are to be used and no default
6327 * set has been provided by the user. Make the built-in default
6331 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
6333 * Before parsing the string, substitute the real name for
6334 * the default rootmenu using the resource rootMenu
6335 * for the %s in the string.
6340 buffer = (char *) XtMalloc(strlen(builtinButtonBindings) +
6341 strlen(pSD->rootMenu) + 1);
6342 sprintf(buffer, builtinButtonBindings, pSD->rootMenu);
6344 ParseButtonStr (pSD, (unsigned char *)buffer);
6346 ParseButtonStr (pSD, (unsigned char *)builtinButtonBindings);
6347 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
6350 #ifdef NO_MESSAGE_CATALOG
6352 * Set defaultSystemMenuUseBuiltin to FALSE if DefaultWindowMenu spec
6356 menuSpec = pSD->menuSpecs;
6359 if (!strcmp(menuSpec->name, defaultSystemMenuName))
6361 pSD->defaultSystemMenuUseBuiltin = FALSE;
6364 menuSpec = menuSpec->nextMenuSpec;
6368 } /* END OF FUNCTION SetupDefaultResources */
6372 /*************************************<->*************************************
6374 * SimilarAppearanceData (pAD1, pAD2)
6379 * This function returns True if the two passed sets of AppearanceData
6380 * are similar. This is designed to compare appearance data before
6381 * creation of the GCs.
6386 * pAD1 pointer to AppearanceData 1
6387 * pAD2 pointer to AppearanceData 2
6392 * Function returns True if similar, False otherwise.
6396 * This function is only used to compare the client
6397 * and client*title appearance data.
6398 *************************************<->***********************************/
6400 Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2)
6405 if ((pAD1->fontList == pAD2->fontList) &&
6406 (pAD1->background == pAD2->background) &&
6407 (pAD1->foreground == pAD2->foreground) &&
6408 (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
6409 (pAD1->backgroundPixmap == pAD2->backgroundPixmap) &&
6410 (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
6411 (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
6412 (pAD1->bottomShadowPixmap == pAD2->bottomShadowPixmap) &&
6413 (pAD1->topShadowColor == pAD2->topShadowColor) &&
6414 (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
6415 (pAD1->topShadowPixmap == pAD2->topShadowPixmap) &&
6416 (pAD1->activeBackground == pAD2->activeBackground) &&
6417 (pAD1->activeForeground == pAD2->activeForeground) &&
6418 (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
6419 (pAD1->activeBackgroundPixmap == pAD2->activeBackgroundPixmap) &&
6420 (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
6421 (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
6422 (pAD1->activeBottomShadowPixmap == pAD2->activeBottomShadowPixmap) &&
6423 (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
6424 (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) &&
6425 (pAD1->activeTopShadowPixmap == pAD2->activeTopShadowPixmap) )
6428 * !!! Should find out why all the Pixmap resources are unset !!!
6431 if ((pAD1->fontList == pAD2->fontList) &&
6432 (pAD1->background == pAD2->background) &&
6433 (pAD1->foreground == pAD2->foreground) &&
6434 (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
6435 (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
6436 (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
6437 (pAD1->topShadowColor == pAD2->topShadowColor) &&
6438 (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
6439 (pAD1->activeBackground == pAD2->activeBackground) &&
6440 (pAD1->activeForeground == pAD2->activeForeground) &&
6441 (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
6442 (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
6443 (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
6444 (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
6445 (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) )
6457 } /* END OF FUNCTION SimilarAppearanceData */
6461 /*************************************<->*************************************
6463 * Monochrome (screen)
6468 * This function returns True if the screen passed it to be treated
6469 * as monochrome for the purpose of assigning default resources.
6474 * screen pointer to Screen
6479 * Function returns True if monochrome (or Static Gray), False otherwise.
6481 *************************************<->***********************************/
6484 Monochrome (Screen *screen)
6490 if (wmGD.statusColorServer == CSERVE_NORMAL)
6492 for (scr = 0; scr < wmGD.numScreens; scr++)
6494 pSD = &(wmGD.Screens[scr]);
6498 if (XScreenOfDisplay (DISPLAY, pSD->screen) == screen)
6500 if (pSD->colorUse == XmCO_BLACK_WHITE)
6513 * If we don't know the answer to our question by now,
6514 * fall back to the old mwm way of determining monochromicity.
6518 return ((DefaultDepthOfScreen(screen) == 1));
6519 } /* END OF FUNCTION Monochrome */
6522 /**************************** eof ***************************/