2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC.
32 static char rcsid[] = "$TOG: WmResource.c /main/14 1997/04/15 10:30:02 dbl $"
36 * (c) Copyright 1987, 1988, 1989, 1990, 1993, 1994 HEWLETT-PACKARD COMPANY
37 * (c) Copyright 1993, 1994 International Business Machines Corp.
38 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
39 * (c) Copyright 1993, 1994 Novell, Inc.
47 #include "WmResNames.h"
49 #define MWM_NEED_IIMAGE
50 #include "WmIBitmap.h"
55 #include <Xm/RowColumn.h>
56 #ifndef MOTIF_ONE_DOT_ONE
57 #include <Xm/ScreenP.h> /* for XmGetXmScreen and screen.moveOpaque */
61 * include extern functions
63 #include "WmResource.h"
65 #include "WmGraphics.h"
67 #include "WmResParse.h"
69 #include "WmBackdrop.h"
70 #include "WmIconBox.h"
71 #include "WmWrkspace.h"
72 #include <Dt/GetDispRes.h>
73 #define cfileP (wmGD.pWmPB->pFile) /* fopen'ed configuration file or NULL */
78 * Function Declarations:
80 XmColorData *_WmGetDefaultColors ();
82 void _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value);
83 void _WmIconImageFDefault (Widget widget, int offset, XrmValue *value);
84 void _WmIconImageBDefault (Widget widget, int offset, XrmValue *value);
85 void _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value);
86 void _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value);
87 void _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value);
88 void _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value);
89 void _WmMatteFDefault (Widget widget, int offset, XrmValue *value);
90 void _WmMatteBDefault (Widget widget, int offset, XrmValue *value);
91 void _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value);
92 void _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value);
93 void _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value);
94 void _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value);
95 void _WmBackgroundDefault (Widget widget, int offset, XrmValue *value);
96 void _WmForegroundDefault (Widget widget, int offset, XrmValue *value);
97 void _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value);
98 void _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value);
99 void _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value);
100 void _WmABackgroundDefault (Widget widget, int offset, XrmValue *value);
101 void _WmAForegroundDefault (Widget widget, int offset, XrmValue *value);
102 void _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value);
103 void _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value);
104 void _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value);
105 void _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value);
106 void _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value);
107 void _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value);
108 void ProcessWmResources (void);
109 void ProcessGlobalScreenResources (void);
110 void SetStdGlobalResourceValues (void);
111 void ProcessScreenListResource (void);
112 void ProcessAppearanceResources (WmScreenData *pSD);
113 void MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources);
114 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);
115 void ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName);
116 void ProcessWorkspaceResources (WmWorkspaceData *pWS);
117 void ProcessClientResources (ClientData *pCD);
118 void SetStdClientResourceValues (ClientData *pCD);
119 void SetStdScreenResourceValues (WmScreenData *pSD);
120 GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap);
122 static void WriteOutXrmColors (WmScreenData *pSD);
125 void ProcessPresenceResources (WmScreenData *pSD);
126 void ProcessDefaultBackdropImages (WmScreenData *pSD);
127 void _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value);
128 void _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value);
129 void _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value);
130 void _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value);
131 void _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value);
132 int DefaultWsColorSetId (WmWorkspaceData *pWS);
134 void _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value);
135 Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2);
143 /* builtin window menu specification */
145 #ifndef NO_MESSAGE_CATALOG
147 * Use the same name as builtin to let the message catalog menu
148 * take precedence over any menus that might match in sys.mwmrc
150 char defaultSystemMenuName[] = "_MwmWindowMenu_";
152 char defaultSystemMenuName[] = "DefaultWindowMenu";
153 #endif /* NO_MESSAGE_CATALOG */
154 char builtinSystemMenuName[] = "_MwmWindowMenu_";
156 #define BUILTINSYSTEMMENU "_MwmWindowMenu_\n\
158 Restore _R Alt<Key>F5 f.restore\n\
159 Move _M Alt<Key>F7 f.move\n\
160 Size _S Alt<Key>F8 f.resize\n\
161 Minimize _n Alt<Key>F9 f.minimize\n\
162 Maximize _x Alt<Key>F10 f.maximize\n\
163 Lower _L Alt<Key>F3 f.lower\n\
164 no-label f.separator\n\
165 Close _C Alt<Key>F4 f.kill\n\
167 #ifdef NO_MESSAGE_CATALOG
168 char builtinSystemMenu[] = BUILTINSYSTEMMENU;
169 #else /* !defined(NO_MESSAGE_CATALOG)*/
170 char *builtinSystemMenu = BUILTINSYSTEMMENU;
172 #define DEFAULT_DTWM_SYSTEMMENU "_MwmWindowMenu_\n\
174 Restore _R f.restore\n\
177 Minimize _n f.minimize\n\
178 Maximize _x f.maximize\n\
180 no-label f.separator\n\
181 \"Occupy Workspace...\" _O f.workspace_presence\n\
182 \"Occupy All Workspaces\" _A f.occupy_all\n\
183 \"Unoccupy Workspace\" _U f.remove\n\
184 no-label f.separator\n\
185 Close _C Alt<Key>F4 f.kill\n\
189 void InitBuiltinSystemMenu(void)
192 char *ResString = NULL;
193 char *MovString = NULL;
194 char *SizString = NULL;
195 char *MinString = NULL;
196 char *MaxString = NULL;
197 char *LowString = NULL;
199 char *OcpString = NULL;
200 char *OcaString = NULL;
201 char *RemString = NULL;
203 char *CloString = NULL;
210 tmpString = ((char *)GETMESSAGE(62, 60, "Restore _R Alt<Key>F5 f.restore"));
212 tmpString = ((char *)GETMESSAGE(62, 49, "Restore _R f.restore"));
215 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
217 Warning (((char *)GETMESSAGE(62, 2, "Insufficient memory for local default menu.")));
222 strcpy(ResString, tmpString);
228 tmpString = ((char *)GETMESSAGE(62, 61, "Move _M Alt<Key>F7 f.move"));
230 tmpString = ((char *)GETMESSAGE(62, 50, "Move _M f.move"));
233 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
235 Warning (((char *)GETMESSAGE(62, 4, "Insufficient memory for local default menu.")));
240 strcpy(MovString, tmpString);
246 tmpString = ((char *)GETMESSAGE(62, 62, "Size _S Alt<Key>F8 f.resize"));
248 tmpString = ((char *)GETMESSAGE(62, 51, "Size _S f.resize"));
251 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
253 Warning (((char *)GETMESSAGE(62, 6, "Insufficient memory for local default menu.")));
258 strcpy(SizString, tmpString);
264 tmpString = ((char *)GETMESSAGE(62, 63, "Minimize _n Alt<Key>F9 f.minimize"));
266 tmpString = ((char *)GETMESSAGE(62, 52, "Minimize _n f.minimize"));
269 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
271 Warning (((char *)GETMESSAGE(62, 8, "Insufficient memory for local default menu.")));
276 strcpy(MinString, tmpString);
282 tmpString = ((char *)GETMESSAGE(62, 64, "Maximize _x Alt<Key>F10 f.maximize"));
284 tmpString = ((char *)GETMESSAGE(62, 53, "Maximize _x f.maximize"));
287 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
289 Warning (((char *)GETMESSAGE(62, 10, "Insufficient memory for local default menu.")));
294 strcpy(MaxString, tmpString);
300 tmpString = ((char *)GETMESSAGE(62, 65, "Lower _L Alt<Key>F3 f.lower"));
302 tmpString = ((char *)GETMESSAGE(62, 54, "Lower _L f.lower"));
305 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
307 Warning (((char *)GETMESSAGE(62, 12, "Insufficient memory for local default menu.")));
312 strcpy(LowString, tmpString);
320 tmpString = ((char *)GETMESSAGE(62, 55, "Occupy\\ Workspace\\.\\.\\. _O f.workspace_presence"));
322 (char *)XtMalloc ((unsigned int)
323 (strlen(tmpString) + 1))) == NULL)
325 Warning (((char *)GETMESSAGE(62, 14, "Insufficient memory for local default menu.")));
330 strcpy(OcpString, tmpString);
335 tmpString = ((char *)GETMESSAGE(62, 56, "Occupy\\ All\\ Workspaces _A f.occupy_all"));
337 (char *)XtMalloc ((unsigned int)
338 (strlen(tmpString) + 1))) == NULL)
340 Warning (((char *)GETMESSAGE(62, 16, "Insufficient memory for local default menu.")));
345 strcpy(OcaString, tmpString);
350 tmpString = ((char *)GETMESSAGE(62, 57, "Unoccupy\\ Workspace _U f.remove"));
352 (char *)XtMalloc ((unsigned int)
353 (strlen(tmpString) + 1))) == NULL)
355 Warning (((char *)GETMESSAGE(62, 18, "Insufficient memory for local default menu.")));
360 strcpy(RemString, tmpString);
367 tmpString = ((char *)GETMESSAGE(62, 48, "Close _C Alt<Key>F4 f.kill"));
369 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
371 Warning (((char *)GETMESSAGE(62, 20, "Insufficient memory for local default menu.")));
376 strcpy(CloString, tmpString);
385 builtinSystemMenu = (char *)
386 XtNewString((String)DEFAULT_DTWM_SYSTEMMENU);
390 builtinSystemMenu = (char *)
391 XtNewString((String)BUILTINSYSTEMMENU);
394 builtinSystemMenu = (char *)
395 XtNewString((String)BUILTINSYSTEMMENU);
400 /* put it together */
401 strcpy(dsm, defaultSystemMenuName);
402 strcat(dsm, "\n{\n");
403 strcat(dsm, ResString);
405 strcat(dsm, MovString);
407 strcat(dsm, SizString);
409 strcat(dsm, MinString);
411 strcat(dsm, MaxString);
413 strcat(dsm, LowString);
415 strcat(dsm, " no-label f.separator\n");
419 strcat(dsm, OcpString);
421 strcat(dsm, OcaString);
423 strcat(dsm, RemString);
425 strcat(dsm, " no-label f.separator\n");
428 strcat(dsm, CloString);
431 if ((builtinSystemMenu =
432 (char *)XtMalloc ((unsigned int) (strlen(dsm) + 1))) == NULL)
434 Warning (((char *)GETMESSAGE(62, 21, "Insufficient memory for localized default system menu")));
438 builtinSystemMenu = (char *)
439 XtNewString((String)DEFAULT_DTWM_SYSTEMMENU);
443 builtinSystemMenu = (char *)
444 XtNewString((String)BUILTINSYSTEMMENU);
447 builtinSystemMenu = (char *)
448 XtNewString((String)BUILTINSYSTEMMENU);
453 strcpy(builtinSystemMenu, dsm);
457 if (ResString != NULL)
459 if (MovString != NULL)
461 if (SizString != NULL)
463 if (MinString != NULL)
465 if (MaxString != NULL)
467 if (LowString != NULL)
470 if (OcpString != NULL)
472 if (OcaString != NULL)
474 if (RemString != NULL)
477 if (CloString != NULL)
480 } /* END OF FUNCTION InitBuiltinSystemMenu */
481 #endif /* NO_MESSAGE_CATALOG */
483 char builtinSystemMenu[];
487 #define HARD_CODED_PRIMARY 3
489 char defaultRootMenuName[] = "DefaultRootMenu";
490 char builtinRootMenuName[] = "_MwmRootMenu_";
492 #define BUILTINROOTMENU "DefaultRootMenu\n\
494 \"Root Menu\" f.title\n\
495 \"New Window\" f.exec \"xterm &\"\n\
496 \"Shuffle Up\" f.circle_up\n\
497 \"Shuffle Down\" f.circle_down\n\
498 \"Refresh\" f.refresh\n\
499 \"Pack Icons\" f.pack_icons\n\
500 no-label f.separator\n\
501 \"Restart...\" f.restart\n\
503 char builtinRootMenu[] = BUILTINROOTMENU
505 char builtinRootMenu[];
509 /* builtin key bindings specification */
511 char defaultKeyBindingsName[] = "DefaultKeyBindings";
512 char builtinKeyBindingsName[] = "_MwmKeyBindings_";
514 #define BUILTINKEYBINDINGS "_MwmKeyBindings_\n\
516 Shift<Key>Escape window|icon f.post_wmenu\n\
517 Alt<Key>space window|icon f.post_wmenu\n\
518 Alt<Key>Tab root|icon|window f.next_key\n\
519 Alt Shift<Key>Tab root|icon|window f.prev_key\n\
520 Alt<Key>Escape root|icon|window f.circle_down\n\
521 Alt Shift<Key>Escape root|icon|window f.circle_up\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\
524 Alt<Key>F6 window f.next_key transient\n\
525 Alt Shift<Key>F6 window f.prev_key transient\n\
526 Shift<Key>F10 icon f.post_wmenu\n\
528 char builtinKeyBindings[] = BUILTINKEYBINDINGS
531 char builtinKeyBindings[];
535 * NOTE: Default Toggle Behavior key bindings. There are TWO key bindings as
536 * of 1.1.4 and 1.2. Make sure you make any modify builtinKeyBindings (above)
537 * whenever modifying behaviorKeyBindings.
540 char behaviorKeyBindingName[] = "_MwmBehaviorKey_";
542 #define BEHAVIORKEYBINDINGS "_MwmBehaviorKey_\n\
544 Alt Shift Ctrl<Key>exclam root|icon|window f.set_behavior\n\
545 Alt Ctrl<Key>1 root|icon|window f.set_behavior\n\
547 char behaviorKeyBindings[] = BEHAVIORKEYBINDINGS
550 char behaviorKeyBindings[];
554 /* default button bindings specification */
555 /* note - the %s will be replaced by the real DefaultRootMenu */
557 char defaultButtonBindingsName[] = "DefaultButtonBindings";
558 char builtinButtonBindingsName[] = "_MwmButtonBindings_";
560 # if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
561 # define BUILTINBUTTONBINDINGS "_MwmButtonBindings_\n\
563 <Btn1Down> icon|frame f.raise\n\
564 <Btn3Down> icon|frame f.post_wmenu\n\
565 <Btn3Down> root f.menu %s\n\
568 # define BUILTINBUTTONBINDINGS "_MwmButtonBindings_\n\
570 <Btn1Down> icon|frame f.raise\n\
571 <Btn3Down> icon|frame f.post_wmenu\n\
572 <Btn3Down> root f.menu DefaultRootMenu\n\
574 # endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
575 char builtinButtonBindings[] = BUILTINBUTTONBINDINGS
578 char builtinButtonBindings[];
582 static ClientData *_pCD;
583 static String _defaultBackground;
584 static String _defaultActiveBackground;
585 static AppearanceData *_pAppearanceData;
587 static WmWorkspaceData *pResWS;
588 static WmScreenData *pResSD;
591 static char _defaultColor1HEX[] = "#A8A8A8A8A8A8";
592 static char _defaultColor2HEX[] = "#5F5F92929E9E";
594 static char _defaultColor1[] = "LightGrey";
595 static char _defaultColor2[] = "CadetBlue";
596 #define DEFAULT_COLOR_NONE NULL
598 Const char _foreground[] = "foreground";
599 Const char _75_foreground[] = "75_foreground";
600 Const char _50_foreground[] = "50_foreground";
601 Const char _25_foreground[] = "25_foreground";
603 Const char *_Dither = XmCO_DITHER;
604 Const char *_NoDither = XmCO_NO_DITHER;
605 Const char CLIENT_FRAME_PART[] = "client";
606 Const char ICON_FRAME_PART[] = "icon";
607 Const char FEEDBACK_FRAME_PART[] = "feedback";
608 Const char MENU_ITEM_PART[] = "menu";
611 #define WmBGC XmBACKGROUND
612 #define WmFGC XmFOREGROUND
613 #define WmTSC XmTOP_SHADOW
614 #define WmBSC XmBOTTOM_SHADOW
616 #define MAX_SHORT 0xffff
619 #define BITMAPDIR "/usr/include/X11/bitmaps/"
623 /*************************************<->*************************************
630 * This data structure is used in the processing of mwm general
631 * appearance and behavior resources. These resources are specified
632 * with the following syntax:
634 * "Mwm*<resource_identifier>".
636 *************************************<->***********************************/
639 XtResource wmGlobalResources[] =
647 XtOffsetOf(WmGlobalData, autoKeyFocus),
657 XtOffsetOf(WmGlobalData, autoRaiseDelay),
667 XtOffsetOf(WmGlobalData, bitmapDirectory),
677 XtOffsetOf(WmGlobalData, blinkOnExec),
681 #endif /* MINIMAL_DT */
687 XtOffsetOf(WmGlobalData, frameStyle),
689 (XtPointer)WmRECESSED
697 XtOffsetOf(WmGlobalData, clientAutoPlace),
703 WmNcolormapFocusPolicy,
704 WmCColormapFocusPolicy,
707 XtOffsetOf(WmGlobalData, colormapFocusPolicy),
709 (XtPointer)CMAP_FOCUS_KEYBOARD
717 XtOffsetOf(WmGlobalData, configFile),
728 XtOffsetOf(WmGlobalData, cppCommand),
735 WmNdeiconifyKeyFocus,
736 WmCDeiconifyKeyFocus,
739 XtOffsetOf(WmGlobalData, deiconifyKeyFocus),
749 XtOffsetOf(WmGlobalData, doubleClickTime),
751 (XtPointer)_WmMultiClickTimeDefault
759 XtOffsetOf(WmGlobalData, enableWarp),
769 XtOffsetOf(WmGlobalData, enforceKeyFocus),
775 WmNframeExternalShadowWidth,
776 WmCFrameExternalShadowWidth,
779 XtOffsetOf(WmGlobalData, frameExternalShadowWidth),
790 XtOffsetOf(WmGlobalData, freezeOnConfig),
801 XtOffsetOf(WmGlobalData, useWindowOutline),
812 XtOffsetOf(WmGlobalData, iconAutoPlace),
818 WmNiconExternalShadowWidth,
819 WmCIconExternalShadowWidth,
822 XtOffsetOf(WmGlobalData, iconExternalShadowWidth),
833 XtOffsetOf(WmGlobalData, iconClick),
839 WmNinteractivePlacement,
840 WmCInteractivePlacement,
843 XtOffsetOf(WmGlobalData, interactivePlacement),
849 WmNkeyboardFocusPolicy,
850 WmCKeyboardFocusPolicy,
853 XtOffsetOf(WmGlobalData, keyboardFocusPolicy),
855 (XtPointer)KEYBOARD_FOCUS_EXPLICIT
863 XtOffsetOf(WmGlobalData, lowerOnIconify),
870 WmNmarqueeSelectGranularity,
871 WmCMarqueeSelectGranularity,
874 XtOffsetOf(WmGlobalData, marqueeSelectGranularity),
885 XtOffsetOf(WmGlobalData, moveThreshold),
895 XtOffsetOf(WmGlobalData, passButtons),
905 XtOffsetOf(WmGlobalData, passSelectButton),
915 XtOffsetOf(WmGlobalData, positionIsFrame),
925 XtOffsetOf(WmGlobalData, positionOnScreen),
935 XtOffsetOf(WmGlobalData, quitTimeout),
945 XtOffsetOf(WmGlobalData, raiseKeyFocus),
952 WmNrefreshByClearing,
953 WmCRefreshByClearing,
956 XtOffsetOf(WmGlobalData, refreshByClearing),
966 XtOffsetOf(WmGlobalData, rootButtonClick),
978 XtOffsetOf(WmGlobalData, sessionClientDB),
989 XtOffsetOf(WmGlobalData, showFeedback),
991 (XtPointer)(WM_SHOW_FB_DEFAULT)
999 XtOffsetOf(WmGlobalData, startupKeyFocus),
1005 WmNsystemButtonClick,
1006 WmCSystemButtonClick,
1009 XtOffsetOf(WmGlobalData, systemButtonClick),
1015 WmNsystemButtonClick2,
1016 WmCSystemButtonClick2,
1019 XtOffsetOf(WmGlobalData, systemButtonClick2),
1023 #if defined(PANELIST)
1029 XtOffsetOf(WmGlobalData, useFrontPanel),
1033 #endif /* PANELIST */
1040 XtOffsetOf(WmGlobalData, helpDirectory),
1042 (XtPointer)"DT/Dtwm/"
1052 XtOffsetOf(WmGlobalData, dtLite),
1056 #endif /* MINIMAL_DT */
1057 }; /* END OF wmGlobalResources[] */
1061 * These determine the screens to manage at startup.
1062 * These are broken out to enhance startup performance.
1064 XtResource wmGlobalScreenResources[] =
1071 XtOffsetOf(WmGlobalData, multiScreen),
1085 XtOffsetOf(WmGlobalData, screenList),
1090 { WmNbackdropDirectories,
1091 WmCBackdropDirectories,
1094 XtOffsetOf(WmGlobalData, backdropDirs),
1096 DEFAULT_BACKDROP_DIR
1103 /******************************<->*************************************
1105 * wmStdGlobalResources
1110 * This data structure is used in the processing of mwm general appearance
1111 * and behavior resources that are not automatically set for the standard
1112 * (default) behavior. These resources are specified with the following
1115 * "Mwm*<resource_identifier>".
1117 ******************************<->***********************************/
1119 XtResource wmStdGlobalResources[] =
1127 XtOffsetOf(WmGlobalData, bitmapDirectory),
1129 (XtPointer)BITMAPDIR
1137 XtOffsetOf(WmGlobalData, configFile),
1146 sizeof (FrameStyle),
1147 XtOffsetOf(WmGlobalData, frameStyle),
1149 (XtPointer)WmRECESSED
1157 XtOffsetOf(WmGlobalData, iconAutoPlace),
1167 XtOffsetOf(WmGlobalData, moveThreshold),
1177 XtOffsetOf(WmGlobalData, positionIsFrame),
1183 WmNpositionOnScreen,
1184 WmCPositionOnScreen,
1187 XtOffsetOf(WmGlobalData, positionOnScreen),
1197 XtOffsetOf(WmGlobalData, quitTimeout),
1207 XtOffsetOf(WmGlobalData, showFeedback),
1209 (XtPointer)(WM_SHOW_FB_DEFAULT)
1215 /******************************<->*************************************
1222 * This data structure is used in the processing of mwm screen specific
1223 * appearance and behavior resources. These resources are specified
1224 * with the following syntax:
1226 * "Mwm*screen<#>*<resource_identifier>".
1228 ******************************<->***********************************/
1230 XtResource wmScreenResources[] =
1237 XtOffsetOf (WmScreenData, buttonBindings),
1239 (XtPointer)defaultButtonBindingsName
1247 XtOffsetOf (WmScreenData, cleanText),
1253 WmNfeedbackGeometry,
1254 WmCFeedbackGeometry,
1257 XtOffsetOf (WmScreenData, feedbackGeometry),
1267 XtOffsetOf (WmScreenData, fadeNormalIcon),
1277 XtOffsetOf (WmScreenData, iconDecoration),
1279 (XtPointer)USE_ICON_DEFAULT_APPEARANCE
1284 WmNiconImageMaximum,
1285 WmCIconImageMaximum,
1288 XtOffsetOf (WmScreenData, iconImageMaximum),
1290 (XtPointer) _WmIconImageMaximumDefault
1294 WmNiconImageMaximum,
1295 WmCIconImageMaximum,
1298 XtOffsetOf (WmScreenData, iconImageMaximum),
1305 WmNiconImageMinimum,
1306 WmCIconImageMinimum,
1309 XtOffsetOf (WmScreenData, iconImageMinimum),
1319 XtOffsetOf (WmScreenData, iconPlacement),
1321 (XtPointer)(ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY)
1325 WmNiconPlacementMargin,
1326 WmCIconPlacementMargin,
1329 XtOffsetOf (WmScreenData, iconPlacementMargin),
1339 XtOffsetOf (WmScreenData, keyBindings),
1341 (XtPointer)defaultKeyBindingsName
1345 WmNframeBorderWidth,
1346 WmCFrameBorderWidth,
1349 XtOffsetOf (WmScreenData, frameBorderWidth),
1360 XtOffsetOf (WmScreenData, iconBoxGeometry),
1371 XtOffsetOf (WmScreenData, iconBoxName),
1373 (XtPointer)"iconbox"
1377 WmNiconBoxSBDisplayPolicy,
1378 WmCIconBoxSBDisplayPolicy,
1381 XtOffsetOf (WmScreenData, iconBoxSBDisplayPolicy),
1391 XtOffsetOf (WmScreenData, iconBoxScheme),
1401 XtOffsetOf (WmScreenData, iconBoxTitle),
1411 XtOffsetOf (WmScreenData, limitResize),
1417 WmNmaximumMaximumSize,
1418 WmCMaximumMaximumSize,
1421 XtOffsetOf (WmScreenData, maximumMaximumSize),
1427 WmNresizeBorderWidth,
1428 WmCFrameBorderWidth,
1431 XtOffsetOf (WmScreenData, resizeBorderWidth),
1441 XtOffsetOf (WmScreenData, resizeCursors),
1446 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
1452 XtOffsetOf (WmScreenData, rootMenu),
1454 (XtPointer)builtinRootMenuName
1456 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
1459 WmNtransientDecoration,
1460 WmCTransientDecoration,
1463 XtOffsetOf (WmScreenData, transientDecoration),
1465 (XtPointer)(WM_DECOR_SYSTEM | WM_DECOR_RESIZEH)
1469 WmNtransientFunctions,
1470 WmCTransientFunctions,
1473 XtOffsetOf (WmScreenData, transientFunctions),
1475 (XtPointer)(WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE))
1480 WmNsubpanelDecoration,
1481 WmCSubpanelDecoration,
1484 XtOffsetOf (WmScreenData, subpanelDecoration),
1486 (XtPointer)(WM_DECOR_SYSTEM)
1490 WmNsubpanelResources,
1491 WmCSubpanelResources,
1494 XtOffsetOf (WmScreenData, subpanelResources),
1498 #endif /* PANELIST */
1505 XtOffsetOf (WmScreenData, useIconBox),
1515 XtOffsetOf (WmScreenData, moveOpaque),
1527 XtOffsetOf (WmScreenData, helpResources),
1533 WmNinitialWorkspace,
1534 WmCInitialWorkspace,
1537 XtOffsetOf (WmScreenData, initialWorkspace),
1547 XtOffsetOf (WmScreenData, workspaceList),
1557 XtOffsetOf (WmScreenData, numWorkspaces),
1566 /******************************<->*************************************
1568 * wmStdScreenResources
1573 * This data structure is used in the processing of mwm screen specific
1574 * appearance and behavior resources that are not automatically set for
1575 * the standard (default) behavior. These resources are specified with
1576 * the following syntax:
1578 * "Mwm*screen<#>*<resource_identifier>".
1580 ******************************<->***********************************/
1582 XtResource wmStdScreenResources[] =
1585 WmNframeBorderWidth,
1586 WmCFrameBorderWidth,
1589 XtOffsetOf (WmScreenData, frameBorderWidth),
1596 WmNiconImageMaximum,
1597 WmCIconImageMaximum,
1600 XtOffsetOf (WmScreenData, iconImageMaximum),
1602 (XtPointer) _WmIconImageMaximumDefault
1606 WmNiconImageMaximum,
1607 WmCIconImageMaximum,
1610 XtOffsetOf (WmScreenData, iconImageMaximum),
1617 WmNiconImageMinimum,
1618 WmCIconImageMinimum,
1621 XtOffsetOf (WmScreenData, iconImageMinimum),
1627 WmNiconPlacementMargin,
1628 WmCIconPlacementMargin,
1631 XtOffsetOf (WmScreenData, iconPlacementMargin),
1637 WmNmaximumMaximumSize,
1638 WmCMaximumMaximumSize,
1641 XtOffsetOf (WmScreenData, maximumMaximumSize),
1647 WmNresizeBorderWidth,
1648 WmCFrameBorderWidth,
1651 XtOffsetOf (WmScreenData, resizeBorderWidth),
1659 /******************************<->*************************************
1661 * wmWorkspaceResources
1666 * This data structure is used in the processing of mwm workspace
1667 * specific appearance and behavior resources. These resources are
1668 * specified with the following syntax:
1670 * "Mwm*[screen<#>*]<workspace>*<resource_identifier>".
1672 ******************************<->***********************************/
1674 XtResource wmWorkspaceResources[] =
1681 XtOffsetOf (WmWorkspaceData, iconBoxGeometry),
1691 XtOffsetOf (WmWorkspaceData, title),
1698 XtResource *wmWorkspaceResources = NULL;
1703 /******************************<->*************************************
1705 * wmStdWorkspaceResources
1710 * This data structure is used in the processing of mwm workspace specific
1711 * appearance and behavior resources that are not automatically set for
1712 * the standard (default) behavior. These resources are specified with
1713 * the following syntax:
1715 * "Mwm*[screen<#>*]<workspace>*<resource_identifier>".
1717 *************************************<->***********************************/
1720 XtResource wmStdWorkspaceResources[] =
1727 XtOffsetOf (WmWorkspaceData, title),
1733 XtResource *wmStdWorkspaceResources = NULL;
1738 /*************************************<->*************************************
1740 * wmBackdropResources
1745 * This data structure is used in the processing of workspace specific
1746 * resources that apply to the backdrop.
1748 * These resources are specified with the following syntax:
1750 * "Mwm*[screen*][workspace*]backdrop*<resource_id>:"
1752 * NOTE: The order of these resources is important for correct
1753 * dynamic processing!!!!
1755 *************************************<->***********************************/
1757 XtResource wmBackdropResources[] =
1764 XtOffsetOf (BackdropData, colorSet),
1766 (XtPointer) _WmBackdropColorSetDefault
1774 XtOffsetOf (BackdropData, background),
1776 (XtPointer) _WmBackdropBgDefault
1784 XtOffsetOf (BackdropData, foreground),
1786 (XtPointer) _WmBackdropFgDefault
1794 XtOffsetOf (BackdropData, image),
1802 /*************************************<->*************************************
1804 * wmWsPresenceResources
1809 * This data structure is used in the processing of specific
1810 * resources that apply to the WorkspacePresence dialog.
1812 * These resources are specified with the following syntax:
1814 * "Mwm*[screen*][workspace*]workspacePresence*<resource_id>:"
1816 *************************************<->***********************************/
1818 XtResource wmWsPresenceResources[] =
1825 XtOffsetOf (WsPresenceData, title),
1833 /*************************************<->*************************************
1840 * This data structure is used in the processing of client specific
1841 * window manager resources. These resources are specified with the
1844 * "Mwm*<client_name_or_class>*<resource_identifier>"
1846 *************************************<->***********************************/
1848 XtResource wmClientResources[] =
1853 WmNabsentMapBehavior,
1854 WmCAbsentMapBehavior,
1855 WmRAbsentMapBehavior,
1857 XtOffsetOf (ClientData, absentMapBehavior),
1859 (XtPointer)(AMAP_BEHAVIOR_ADD)
1863 WmNclientDecoration,
1864 WmCClientDecoration,
1867 XtOffsetOf (ClientData, clientDecoration),
1869 (XtPointer)(WM_DECOR_DEFAULT)
1877 XtOffsetOf (ClientData, clientFunctions),
1879 (XtPointer)(WM_FUNC_DEFAULT)
1887 XtOffsetOf (ClientData, focusAutoRaise),
1889 (XtPointer)_WmFocusAutoRaiseDefault
1897 XtOffsetOf (ClientData, iconImage),
1903 WmNiconImageBackground,
1904 WmCIconImageBackground,
1907 XtOffsetOf (ClientData, iconImageBackground),
1909 (XtPointer)_WmIconImageBDefault
1913 WmNiconImageForeground,
1914 WmCIconImageForeground,
1917 XtOffsetOf (ClientData, iconImageForeground),
1919 (XtPointer)_WmIconImageFDefault
1923 WmNiconImageBottomShadowColor,
1924 WmCIconImageBottomShadowColor,
1927 XtOffsetOf (ClientData, iconImageBottomShadowColor),
1929 (XtPointer)_WmIconImageBSCDefault
1933 WmNiconImageBottomShadowPixmap,
1934 WmCIconImageBottomShadowPixmap,
1937 XtOffsetOf (ClientData, iconImageBottomShadowPStr),
1939 (XtPointer)_WmIconImageBSPDefault
1943 WmNiconImageTopShadowColor,
1944 WmCIconImageTopShadowColor,
1947 XtOffsetOf (ClientData, iconImageTopShadowColor),
1949 (XtPointer)_WmIconImageTSCDefault
1953 WmNiconImageTopShadowPixmap,
1954 WmCIconImageTopShadowPixmap,
1957 XtOffsetOf (ClientData, iconImageTopShadowPStr),
1959 (XtPointer)_WmIconImageTSPDefault
1963 WmNignoreWMSaveHints,
1964 WmCIgnoreWMSaveHints,
1967 XtOffsetOf (ClientData, ignoreWMSaveHints),
1977 XtOffsetOf (ClientData, matteWidth),
1983 WmNmaximumClientSize,
1984 WmCMaximumClientSize,
1987 XtOffsetOf (ClientData, maximumClientSize),
1994 WmNsecondariesOnTop,
1995 WmCSecondariesOnTop,
1998 XtOffsetOf (ClientData, secondariesOnTop),
2000 (XtPointer)_WmSecondariesOnTopDefault
2009 XtOffsetOf (ClientData, systemMenu),
2011 (XtPointer)defaultSystemMenuName
2019 XtOffsetOf (ClientData, useClientIcon),
2033 XtOffsetOf (ClientData, usePPosition),
2035 (XtPointer)(USE_PPOSITION_NONZERO)
2038 }; /* END OF STRUCTURE wmClientResources */
2042 /*************************************<->*************************************
2044 * wmStdClientResources
2049 * This data structure is used in the processing of client specific
2050 * window manager resources that are not automatically set for the standard
2051 * (default) behavior. These resources are specified with the
2054 * "Mwm*<client_name_or_class>*<resource_identifier>"
2056 *************************************<->***********************************/
2058 XtResource wmStdClientResources[] =
2066 XtOffsetOf (ClientData, iconImage),
2072 WmNiconImageBackground,
2073 WmCIconImageBackground,
2076 XtOffsetOf (ClientData, iconImageBackground),
2078 (XtPointer)_WmIconImageBDefault
2082 WmNiconImageForeground,
2083 WmCIconImageForeground,
2086 XtOffsetOf (ClientData, iconImageForeground),
2088 (XtPointer)_WmIconImageFDefault
2092 WmNiconImageBottomShadowColor,
2093 WmCIconImageBottomShadowColor,
2096 XtOffsetOf (ClientData, iconImageBottomShadowColor),
2098 (XtPointer)_WmIconImageBSCDefault
2102 WmNiconImageBottomShadowPixmap,
2103 WmCIconImageBottomShadowPixmap,
2106 XtOffsetOf (ClientData, iconImageBottomShadowPStr),
2108 (XtPointer)_WmIconImageBSPDefault
2112 WmNiconImageTopShadowColor,
2113 WmCIconImageTopShadowColor,
2116 XtOffsetOf (ClientData, iconImageTopShadowColor),
2118 (XtPointer)_WmIconImageTSCDefault
2122 WmNiconImageTopShadowPixmap,
2123 WmCIconImageTopShadowPixmap,
2126 XtOffsetOf (ClientData, iconImageTopShadowPStr),
2128 (XtPointer)_WmIconImageTSPDefault
2136 XtOffsetOf (ClientData, matteWidth),
2142 WmNmaximumClientSize,
2143 WmCMaximumClientSize,
2146 XtOffsetOf (ClientData, maximumClientSize),
2152 WmNsecondariesOnTop,
2153 WmCSecondariesOnTop,
2156 XtOffsetOf (ClientData, secondariesOnTop),
2158 (XtPointer)_WmSecondariesOnTopDefault
2167 XtOffsetOf (ClientData, useClientIcon),
2175 /*************************************<->*************************************
2177 * wmClientResourcesM
2182 * This data structure is used in the processing of client specific
2183 * window manager resources that affect the appearance of the client
2184 * matte. These resources are specified with the following syntax:
2186 * "Mwm*<client_name_or_class>*<resource_identifier>"
2188 *************************************<->***********************************/
2190 XtResource wmClientResourcesM[] =
2197 XtOffsetOf (ClientData, matteBackground),
2199 (XtPointer)_WmMatteBDefault
2207 XtOffsetOf (ClientData, matteForeground),
2209 (XtPointer)_WmMatteFDefault
2213 WmNmatteBottomShadowColor,
2214 WmCMatteBottomShadowColor,
2217 XtOffsetOf (ClientData, matteBottomShadowColor),
2219 (XtPointer)_WmMatteBSCDefault
2223 WmNmatteBottomShadowPixmap,
2224 WmCMatteBottomShadowPixmap,
2227 XtOffsetOf (ClientData, matteBottomShadowPStr),
2229 (XtPointer)_WmMatteBSPDefault
2233 WmNmatteTopShadowColor,
2234 WmCMatteTopShadowColor,
2237 XtOffsetOf (ClientData, matteTopShadowColor),
2239 (XtPointer)_WmMatteTSCDefault
2243 WmNmatteTopShadowPixmap,
2244 WmCMatteTopShadowPixmap,
2247 XtOffsetOf (ClientData, matteTopShadowPStr),
2249 (XtPointer)_WmMatteTSPDefault
2255 /*************************************<->*************************************
2257 * wmAppearanceResources
2262 * This data structure is used in the processing of component appearance
2263 * resources. These resources are specified with the following syntax:
2265 * "Mwm*<resource_identifier>"
2266 * "Mwm*client*<resource_identifier>"
2267 * "Mwm*icon*<resource_identifier>"
2268 * "Mwm*feedback*<resource_identifier>"
2270 *************************************<->***********************************/
2272 XtResource wmAppearanceResources[] =
2279 sizeof (XmFontList),
2280 XtOffsetOf (AppearanceData, fontList),
2290 XtOffsetOf (AppearanceData, saveUnder),
2300 XtOffsetOf (AppearanceData, background),
2302 (XtPointer)_WmBackgroundDefault
2310 XtOffsetOf (AppearanceData, foreground),
2312 (XtPointer)_WmForegroundDefault
2316 XmNbottomShadowColor,
2320 XtOffsetOf (AppearanceData, bottomShadowColor),
2322 (XtPointer)_WmBottomShadowColorDefault
2326 XmNbottomShadowPixmap,
2327 XmCBottomShadowPixmap,
2330 XtOffsetOf (AppearanceData, bottomShadowPStr),
2340 XtOffsetOf (AppearanceData, topShadowColor),
2342 (XtPointer)_WmTopShadowColorDefault
2346 XmNbackgroundPixmap,
2347 XmCBackgroundPixmap,
2350 XtOffsetOf (AppearanceData, backgroundPStr),
2352 (XtPointer)_WmBackgroundPixmapDefault
2360 XtOffsetOf (AppearanceData, topShadowPStr),
2362 (XtPointer)_WmTopShadowPixmapDefault
2366 WmNactiveBackground,
2370 XtOffsetOf (AppearanceData, activeBackground),
2372 (XtPointer)_WmABackgroundDefault
2376 WmNactiveForeground,
2380 XtOffsetOf (AppearanceData, activeForeground),
2382 (XtPointer)_WmAForegroundDefault
2386 WmNactiveBottomShadowColor,
2390 XtOffsetOf (AppearanceData, activeBottomShadowColor),
2392 (XtPointer)_WmABottomShadowColorDefault
2396 WmNactiveBottomShadowPixmap,
2397 XmCBottomShadowPixmap,
2400 XtOffsetOf (AppearanceData, activeBottomShadowPStr),
2406 WmNactiveTopShadowColor,
2410 XtOffsetOf (AppearanceData, activeTopShadowColor),
2412 (XtPointer)_WmATopShadowColorDefault
2416 WmNactiveBackgroundPixmap,
2417 XmCBackgroundPixmap,
2420 XtOffsetOf (AppearanceData, activeBackgroundPStr),
2422 (XtPointer)_WmABackgroundPixmapDefault
2426 WmNactiveTopShadowPixmap,
2430 XtOffsetOf (AppearanceData, activeTopShadowPStr),
2432 (XtPointer)_WmATopShadowPixmapDefault
2439 /*************************************<->*************************************
2441 * _WmIconImageFDefault (widget, offset, value)
2442 * _WmIconImageBDefault (widget, offset, value)
2443 * _WmIconImageBSCDefault (widget, offset, value)
2444 * _WmIconImageBSPDefault (widget, offset, value)
2445 * _WmIconImageTSCDefault (widget, offset, value)
2446 * _WmIconImageTSPDefault (widget, offset, value)
2447 * _WmMatteFDefault (widget, offset, value)
2448 * _WmMatteBDefault (widget, offset, value)
2449 * _WmMatteBSCDefault (widget, offset, value)
2450 * _WmMatteBSPDefault (widget, offset, value)
2451 * _WmMatteTSCDefault (widget, offset, value)
2452 * _WmMatteTSPDefault (widget, offset, value)
2457 * These functions are used to generate dynamic defaults for various
2458 * client-specific appearance related resources.
2463 * widget = this is the parent widget for the wm subpart
2465 * offset = this is the resource offset
2467 * value = this is a pointer to a XrmValue in which to store the result
2469 * _pCD = (static global) pointer to client data associated with resources
2474 * value = default resource value and size
2476 *************************************<->***********************************/
2479 _WmIconImageFDefault (Widget widget, int offset, XrmValue *value)
2481 _WmGetDynamicDefault (widget, WmFGC, 0,
2482 _pCD->iconImageBackground, value);
2484 } /* END OF FUNCTION _WmIconImageFDefault */
2487 _WmIconImageBDefault (Widget widget, int offset, XrmValue *value)
2489 value->addr = (char *)&(_pCD->pSD->iconAppearance.background);
2490 value->size = sizeof (Pixel);
2492 } /* END OF FUNCTION _WmIconImageBDefault */
2496 _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value)
2498 _WmGetDynamicDefault (widget, WmBSC, 0,
2499 _pCD->iconImageBackground, value);
2501 } /* END OF FUNCTION _WmIconImageBSCDefault */
2505 _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value)
2508 value->addr = (char *)_pCD->pSD->iconAppearance.bottomShadowPStr;
2509 value->size = sizeof (String);
2511 } /* END OF FUNCTION _WmIconImageBSCDefault */
2515 _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value)
2517 _WmGetDynamicDefault (widget, WmTSC, 0,
2518 _pCD->iconImageBackground, value);
2520 } /* END OF FUNCTION _WmIconImageTSCDefault */
2524 _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value)
2527 value->addr = (char *)_pCD->pSD->iconAppearance.topShadowPStr;
2528 value->size = sizeof (String);
2530 } /* END OF FUNCTION _WmIconImageTSPDefault */
2534 _WmMatteFDefault (Widget widget, int offset, XrmValue *value)
2536 _WmGetDynamicDefault (widget, WmFGC, 0,
2537 _pCD->matteBackground, value);
2539 } /* END OF FUNCTION _WmMatteFDefault */
2543 _WmMatteBDefault (Widget widget, int offset, XrmValue *value)
2545 value->addr = (char *)&(_pCD->pSD->clientAppearance.background);
2546 value->size = sizeof (Pixel);
2548 } /* END OF FUNCTION _WmMatteBDefault */
2552 _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value)
2554 _WmGetDynamicDefault (widget, WmBSC, 0,
2555 _pCD->matteBackground, value);
2557 } /* END OF FUNCTION _WmMatteBSCDefault */
2561 _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value)
2564 value->addr = (char *)_pCD->pSD->clientAppearance.bottomShadowPStr;
2565 value->size = sizeof (String);
2567 } /* END OF FUNCTION _WmMatteBSCDefault */
2571 _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value)
2573 _WmGetDynamicDefault (widget, WmTSC, 0,
2574 _pCD->matteBackground, value);
2576 } /* END OF FUNCTION _WmMatteTSCDefault */
2580 _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value)
2583 value->addr = (char *)_pCD->pSD->clientAppearance.topShadowPStr;
2584 value->size = sizeof (String);
2586 } /* END OF FUNCTION _WmMatteTSCDefault */
2590 /*************************************<->*************************************
2592 * _WmBackgroundDefault (widget, offset, value)
2593 * _WmForegroundDefault (widget, offset, value)
2594 * _WmBackgroundPixmapDefault (widget, offset, value)
2595 * _WmBottomShadowColorDefault (widget, offset, value)
2596 * _WmTopShadowColorDefault (widget, offset, value)
2597 * _WmTopShadowPixmapDefault (widget, offset, value)
2598 * _WmABackgroundDefault (widget, offset, value)
2599 * _WmAForegroundDefault (widget, offset, value)
2600 * _WmABackgroundPixmapDefault (widget, offset, value)
2601 * _WmABottomShadowColorDefault (widget, offset, value)
2602 * _WmRFBackgroundDefault (widget, offset, value)
2603 * _WmRFForegroundDefault (widget, offset, value)
2604 * _WmATopShadowColorDefault (widget, offset, value)
2605 * _WmATopShadowPixmapDefault (widget, offset, value)
2610 * These functions are used to generate dynamic defaults for various
2611 * component appearance related resources (not client-specific).
2616 * widget = this is the parent widget for the wm subpart
2618 * offset = this is the resource offset
2620 * value = this is a pointer to a XrmValue in which to store the result
2622 * _defaultBackground = (static global) default background color (inactive)
2624 * _defaultActiveBackground = (static global) default bg color (active)
2626 * _pAppearanceData = (static global) pointer to resouce set structure
2631 * value = default resource value and size
2633 *************************************<->***********************************/
2636 _WmBackgroundDefault (Widget widget, int offset, XrmValue *value)
2638 _WmGetDynamicDefault (widget, WmBGC, _defaultBackground, 0, value);
2640 } /* END OF FUNCTION _WmBackgroundDefault */
2644 _WmForegroundDefault (Widget widget, int offset, XrmValue *value)
2646 _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->background,
2649 } /* END OF FUNCTION _WmForegroundDefault */
2653 _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value)
2655 static String string;
2658 if ((Monochrome (XtScreen (widget))) ||
2659 (_pAppearanceData->topShadowColor == _pAppearanceData->background))
2661 string = (String) _25_foreground;
2668 value->addr = (char *)string;
2669 value->size = sizeof (String);
2671 } /* END OF FUNCTION _WmBackgroundPixmapDefault */
2675 _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value)
2677 _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->background,
2680 } /* END OF FUNCTION _WmBottomShadowColorDefault */
2684 _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value)
2686 _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->background,
2689 } /* END OF FUNCTION _WmTopShadowColorDefault */
2693 _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value)
2695 static String string;
2698 if ((Monochrome (XtScreen (widget))) ||
2699 (_pAppearanceData->topShadowColor == _pAppearanceData->background))
2701 /* Fix monochrome 3D appearance */
2702 string = (String) _50_foreground;
2703 if (_pAppearanceData->backgroundPStr != NULL)
2704 if (!strcmp(_pAppearanceData->backgroundPStr, _25_foreground) ||
2705 !strcmp(_pAppearanceData->backgroundPStr, _50_foreground))
2707 string = (String) _foreground;
2715 value->addr = (char *)string;
2716 value->size = sizeof (String);
2718 } /* END OF FUNCTION _WmTopShadowPixmapDefault */
2722 _WmABackgroundDefault (Widget widget, int offset, XrmValue *value)
2724 _WmGetDynamicDefault (widget, WmBGC, _defaultActiveBackground, 0, value);
2726 } /* END OF FUNCTION _WmABackgroundDefault */
2730 _WmAForegroundDefault (Widget widget, int offset, XrmValue *value)
2732 _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->activeBackground,
2735 } /* END OF FUNCTION _WmAForegroundDefault */
2738 _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value)
2740 static String string;
2743 if ((Monochrome (XtScreen (widget))) ||
2744 (_pAppearanceData->activeTopShadowColor ==
2745 _pAppearanceData->activeBackground))
2747 string = (String) _50_foreground;
2754 value->addr = (char *)string;
2755 value->size = sizeof (String);
2757 } /* END OF FUNCTION _WmABackgroundPixmapDefault */
2760 _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value)
2762 _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->activeBackground,
2765 } /* END OF FUNCTION _WmABottomShadowColorDefault */
2769 _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value)
2771 _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->activeBackground,
2774 } /* END OF FUNCTION _WmATopShadowColorDefault */
2778 _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value)
2780 static String string;
2782 if ((Monochrome (XtScreen (widget))) ||
2783 (_pAppearanceData->activeTopShadowColor ==
2784 _pAppearanceData->activeBackground))
2786 /* Fix monochrome 3D appearance */
2787 string = (String) _50_foreground;
2788 if (_pAppearanceData->activeBackgroundPStr != NULL)
2790 (_pAppearanceData->activeBackgroundPStr, _25_foreground) ||
2792 (_pAppearanceData->activeBackgroundPStr, _50_foreground))
2794 string = (String) _foreground;
2802 value->addr = (char *)string;
2803 value->size = sizeof (String);
2805 } /* END OF FUNCTION _WmATopShadowPixmapDefault */
2810 _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value)
2812 static Pixel pixValue;
2813 unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet;
2815 if (wmGD.statusColorServer == CSERVE_NORMAL)
2817 if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS))
2819 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2822 switch (pResWS->pSD->colorUse)
2824 case XmCO_BLACK_WHITE:
2825 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg;
2829 case XmCO_LOW_COLOR:
2830 case XmCO_MEDIUM_COLOR:
2831 case XmCO_HIGH_COLOR:
2832 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bs;
2839 * Color server is unavailable. Has user specified a colorset?
2841 * If not, go monochrome.
2844 pixValue = WhitePixel (DISPLAY, pResWS->pSD->screen);
2847 /* return the dynamic default */
2849 value->addr = (char *) &pixValue;
2850 value->size = sizeof (Pixel);
2852 } /* END OF FUNCTION _WmBackdropBgDefault */
2855 _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value)
2857 static Pixel pixValue;
2858 unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet;
2860 if (wmGD.statusColorServer == CSERVE_NORMAL)
2862 if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS))
2864 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2867 switch (pResWS->pSD->colorUse)
2869 case XmCO_BLACK_WHITE:
2870 pixValue = pResWS->pSD->pPixelData[colorSetId-1].fg;
2874 case XmCO_LOW_COLOR:
2875 case XmCO_MEDIUM_COLOR:
2876 case XmCO_HIGH_COLOR:
2877 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg;
2884 * Color server is unavailable. Has user specified a colorset?
2886 * If not, go monochrome.
2889 pixValue = BlackPixel (DISPLAY, pResWS->pSD->screen);
2891 value->addr = (char *) &pixValue;
2892 value->size = sizeof (Pixel);
2894 } /* END OF FUNCTION _WmBackdropFgDefault */
2897 _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value)
2899 static unsigned int colorSetId;
2901 if (wmGD.statusColorServer == CSERVE_NORMAL)
2903 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2907 colorSetId = 0; /* invalid color set */
2910 value->addr = (char *) &colorSetId;
2911 value->size = sizeof (Pixel);
2913 } /* END OF FUNCTION _WmBackdropColorSetIdDefault */
2916 _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value)
2920 if ((pResSD->displayResolutionType == LOW_RES_DISPLAY) ||
2921 (pResSD->displayResolutionType == VGA_RES_DISPLAY))
2932 value->addr = (char *) &cval;
2933 value->size = sizeof (WHSize);
2935 } /* END OF FUNCTION _WmIconImageMaximumDefault */
2938 /*************************************<->*************************************
2940 * DefaultWsColorSetId (pWS)
2945 * This function returns the default colorSetId for a given workspace
2950 * pWS = ptr to workspace data
2954 * return = default color set ID.
2956 * "active" and "inactive" color sets are not used.
2958 *************************************<->***********************************/
2961 DefaultWsColorSetId (WmWorkspaceData *pWS)
2963 static int _ws_high_color_map[] = { 3, 5, 6, 7 };
2964 #define _WS_HIGH_COLOR_COUNT 4
2974 iIndex = (int) ((unsigned long)(pWS) -
2975 (unsigned long)(pSD->pWS))/sizeof(WmWorkspaceData);
2977 iIndex = 0; /* bad pWS or pSD, shouldn't get here */
2979 switch (pSD->colorUse)
2981 case XmCO_BLACK_WHITE:
2982 case XmCO_LOW_COLOR:
2984 (pSD->pInactivePixelSet-pSD->pPixelData)/sizeof(XmPixelSet);
2987 case XmCO_MEDIUM_COLOR:
2988 rval = HARD_CODED_PRIMARY;
2991 case XmCO_HIGH_COLOR:
2992 i = iIndex % _WS_HIGH_COLOR_COUNT;
2993 rval = _ws_high_color_map[i];
3000 } /* END OF FUNCTION DefaultWsColorSetId */
3006 /*************************************<->*************************************
3008 * _WmFocusAutoRaiseDefault (widget, offset, value)
3013 * This function generates a default value for the focusAutoRaise resource.
3018 * widget = this is the parent widget for the wm subpart
3020 * offset = this is the resource offset
3022 * value = this is a pointer to a XrmValue in which to store the result
3027 * value = default resource value and size
3029 *************************************<->***********************************/
3032 _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value)
3034 static Boolean focusAutoRaise;
3036 if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)
3038 focusAutoRaise = True;
3042 focusAutoRaise = False;
3045 value->addr = (char *)&focusAutoRaise;
3046 value->size = sizeof (Boolean);
3048 } /* END OF FUNCTION _WmFocusAutoRaiseDefault */
3051 /*************************************<->*************************************
3053 * _WmMultiClickTimeDefault (widget, offset, value)
3058 * This function generates a default value for the doubleClickTime resource.
3059 * We dynamically default to the XtR4 multiClickTime value.
3063 * widget = this is the parent widget for the wm subpart
3065 * offset = this is the resource offset
3067 * value = this is a pointer to a XrmValue in which to store the result
3071 * value = default resource value and size
3073 *************************************<->***********************************/
3076 _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value)
3078 static int multiClickTime;
3080 multiClickTime = XtGetMultiClickTime(XtDisplay(widget));
3082 value->addr = (char *)&multiClickTime;
3083 value->size = sizeof (int);
3085 } /* END OF FUNCTION _WmMultiClickTimeDefault */
3089 /*************************************<->*************************************
3091 * _WmSecondariesOnTopDefault (widget, offset, value)
3096 * This function generates a default value for the secondariesOnTop
3101 * widget = this is the parent widget for the wm subpart
3103 * offset = this is the resource offset
3105 * value = this is a pointer to a XrmValue in which to store the result
3109 * value = default resource value and size
3111 *************************************<->***********************************/
3114 _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value)
3116 static Boolean secondariesOnTop;
3119 * Inherit setting from primary window if this window is
3123 if (_pCD->transientLeader != NULL)
3124 secondariesOnTop = _pCD->transientLeader->secondariesOnTop;
3126 secondariesOnTop = True;
3128 value->addr = (char *)&secondariesOnTop;
3129 value->size = sizeof (Boolean);
3131 } /* END OF FUNCTION _WmSecondariesOnTopDefault */
3136 /******************************<->*************************************
3138 * ProcessWmResources ()
3143 * This function is used to retrieve and process window manager resources
3144 * that are not client-specific.
3149 * wmGlobalResources = pointer to wm resource list
3154 * wmGD = (global data filled out with resource values)
3156 *************************************<->***********************************/
3159 ProcessWmResources (void)
3163 * Process the mwm general appearance and behavior resources. Retrieve
3164 * a limited set of resource values if the window manager is starting
3165 * up with the standard behavior.
3168 if (wmGD.useStandardBehavior)
3170 XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD,
3171 wmStdGlobalResources, XtNumber (wmStdGlobalResources), NULL, 0);
3174 * Fill in the standard resource values.
3177 SetStdGlobalResourceValues ();
3181 XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD,
3182 wmGlobalResources, XtNumber (wmGlobalResources), NULL, 0);
3185 if (wmGD.autoRaiseDelay < 0)
3187 wmGD.autoRaiseDelay = 500;
3188 Warning (((char *)GETMESSAGE(62, 66, "Out of range autoRaiseDelay resource value. Must be non-negative")));
3191 } /* END OF FUNCTION ProcessWmResources */
3195 /******************************<->*************************************
3197 * ProcessGlobalScreenResources ()
3202 * This function is used to retrieve window manager resources to
3203 * determine the screens to manage.
3208 * wmGlobalScreenResources = pointer to wm resource list
3213 * wmGD = (global data filled out with resource values)
3215 *************************************<->***********************************/
3218 ProcessGlobalScreenResources (void)
3220 XtGetApplicationResources (wmGD.topLevelW, &wmGD,
3221 wmGlobalScreenResources,
3222 XtNumber (wmGlobalScreenResources), NULL, 0);
3224 if (wmGD.multiScreen)
3226 wmGD.numScreens = ScreenCount(DISPLAY);
3230 wmGD.numScreens = 1;
3233 if (wmGD.screenList != NULL)
3235 ProcessScreenListResource();
3241 /*************************************<->*************************************
3243 * SetStdGlobalResourceValues ()
3248 * This function sets resource data to standard values. This setting
3249 * is done in place of getting the values from the user settings in
3250 * the resource database.
3255 * wmGD = (global data filled out with resource values)
3257 *************************************<->***********************************/
3260 SetStdGlobalResourceValues (void)
3262 wmGD.autoKeyFocus = True;
3263 wmGD.clientAutoPlace = True;
3264 wmGD.colormapFocusPolicy = CMAP_FOCUS_KEYBOARD;
3265 wmGD.deiconifyKeyFocus = True;
3266 wmGD.doubleClickTime = 500;
3267 wmGD.freezeOnConfig = True;
3268 wmGD.iconAutoPlace = True;
3269 wmGD.iconClick = True;
3270 wmGD.interactivePlacement = False;
3271 wmGD.keyboardFocusPolicy = KEYBOARD_FOCUS_EXPLICIT;
3272 wmGD.lowerOnIconify = True;
3273 wmGD.passSelectButton = True;
3274 wmGD.startupKeyFocus = True;
3275 wmGD.systemButtonClick = True;
3276 wmGD.systemButtonClick2 = True;
3277 #if defined(PANELIST)
3278 wmGD.useFrontPanel=False;
3279 #endif /* PANELIST */
3281 } /* END OF FUNCTION SetStdGlobalResourceValues */
3285 /*************************************<->*************************************
3287 * ProcessScreenListResource ()
3292 * This processes the names in the screenList resource.
3297 * wmGlobalResources = pointer to wmGD.screenList
3304 *************************************<->***********************************/
3307 ProcessScreenListResource (void)
3309 unsigned char *lineP;
3310 unsigned char *string;
3314 lineP = (unsigned char *)wmGD.screenList;
3319 while (((string = GetString(&lineP)) != NULL) &&
3320 (sNum < ScreenCount(DISPLAY)))
3322 if (!(wmGD.screenNames[sNum] = (unsigned char *)
3323 WmRealloc ((char*)wmGD.screenNames[sNum], strlen((char*)string)+1)))
3325 ExitWM(WM_ERROR_EXIT_VALUE);
3329 strcpy((char *)wmGD.screenNames[sNum], (char *)string);
3336 * If the number of listed screens (sNum) is < screen count, fill in the
3337 * remaining screen names with the name of the first screen specified,
3342 string = wmGD.screenNames[0]; /* name of the first screen */
3343 while (sNum < ScreenCount(DISPLAY))
3345 if (!(wmGD.screenNames[sNum] = (unsigned char *)
3346 WmRealloc ((char*)wmGD.screenNames[sNum],
3347 strlen((char *)string)+1)))
3349 ExitWM(WM_ERROR_EXIT_VALUE);
3353 strcpy((char *)wmGD.screenNames[sNum], (char *)string);
3360 } /* END OF FUNCTION ProcessScreenListResource */
3364 /******************************<->*************************************
3366 * ProcessWmColors ()
3371 * Retrieve the color sets from the colorserver.
3379 * modifies parts of global pixel sets
3384 ******************************<->***********************************/
3387 ProcessWmColors (WmScreenData *pSD)
3389 short active, inactive, primary, secondary;
3391 if ((pSD->pPixelData = (XmPixelSet *)
3392 XtMalloc (XmCO_NUM_COLORS * sizeof(XmPixelSet))))
3397 * ASSUMPTION: If XmeGetPixelData() returns true,
3398 * we have a good color server at our disposal.
3402 if (XmeGetPixelData (pSD->screen, &pSD->colorUse,
3403 pSD->pPixelData, &active, &inactive,
3404 &primary, &secondary))
3406 pSD->pActivePixelSet = &(pSD->pPixelData[active]);
3407 pSD->pInactivePixelSet = &(pSD->pPixelData[inactive]);
3408 pSD->pPrimaryPixelSet = &(pSD->pPixelData[primary]);
3409 pSD->pSecondaryPixelSet = &(pSD->pPixelData[secondary]);
3411 /* Hack here. The index "4" is the proper array reference. */
3412 /* This is used because XmGetPixelData has not been properly */
3415 pSD->pTextPixelSet = &(pSD->pPixelData[3]);
3417 wmGD.statusColorServer = CSERVE_NORMAL;
3422 XtFree((char *)pSD->pPixelData);
3423 pSD->pPixelData = NULL;
3424 pSD->pActivePixelSet = NULL;
3425 pSD->pInactivePixelSet = NULL;
3426 pSD->pPrimaryPixelSet = NULL;
3427 pSD->pSecondaryPixelSet = NULL;
3428 pSD->pTextPixelSet = NULL;
3433 Warning (((char *)GETMESSAGE(62, 22, "Insufficient memory for color data")));
3434 ExitWM (WM_ERROR_EXIT_VALUE);
3437 } /* END OF FUNCTION ProcessWmColors */
3440 /******************************<->*************************************
3442 * WriteOutXrmColors ()
3447 * Update the XRM database with pixel values from the color server.
3451 * pSD = contains pixel sets
3455 * updated resource database
3459 * N.B. Must change to write out data on a PER-SCREEN basis.
3460 * e.g., "Dtwm*0*background"
3461 ******************************<->***********************************/
3464 WriteOutXrmColors (WmScreenData *pSD)
3468 int thisScreen = pSD->screen;
3469 XmPixelSet *tpixset;
3470 XmPixelSet *spixset;
3477 res_class = WM_RESOURCE_CLASS;
3481 res_class = DT_WM_RESOURCE_CLASS;
3484 screen_name = (String) wmGD.screenNames[pSD->screen];
3486 db = XtScreenDatabase(XScreenOfDisplay(DISPLAY, thisScreen));
3488 /** update the clients database with new colors **/
3489 value.size = sizeof(Pixel);
3493 * WM ACTIVE RESOURCES--e.g., for the active frame
3496 if (pSD->pActivePixelSet)
3498 tpixset = pSD->pActivePixelSet;
3499 spixset = pSD->pSecondaryPixelSet;
3501 if (pSD->colorUse == XmCO_BLACK_WHITE)
3505 * Limit ourselves here to the client (frame)
3510 /* activeForeground */
3511 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3513 XrmPutResource (&db,
3514 ResCat (res_class, screen_name, WmNactiveForeground,
3515 NULL), XtRPixel, &value);
3517 /* activeBackground */
3518 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3520 XrmPutResource (&db,
3521 ResCat (res_class, screen_name, WmNactiveBackground,
3522 NULL), XtRPixel, &value);
3524 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3525 WmNactiveBackgroundPixmap, NULL),
3528 /* activeTopShadow */
3529 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3530 WmNactiveTopShadowPixmap, NULL),
3533 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3534 XrmPutResource (&db,
3535 ResCat (res_class, screen_name, WmNactiveTopShadowColor,
3536 NULL), XtRPixel, &value);
3538 /* activeBottomShadow */
3539 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3540 XrmPutResource (&db,
3541 ResCat (res_class, screen_name,
3542 WmNactiveBottomShadowColor, NULL), XtRPixel, &value);
3544 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3545 WmNactiveBottomShadowPixmap, NULL),
3549 else /* active colors for non-BW systems */
3551 value.addr = (XtPointer) &(tpixset->bg);
3552 XrmPutResource (&db,
3553 ResCat (res_class, screen_name, WmNactiveBackground, NULL),
3556 value.addr = (XtPointer) &(tpixset->fg);
3557 XrmPutResource (&db,
3558 ResCat (res_class, screen_name, WmNactiveForeground, NULL),
3561 value.addr = (XtPointer) &(tpixset->ts);
3562 XrmPutResource (&db,
3563 ResCat (res_class, screen_name, WmNactiveTopShadowColor, NULL),
3566 value.addr = (XtPointer) &(tpixset->bs);
3567 XrmPutResource (&db,
3568 ResCat (res_class, screen_name, WmNactiveBottomShadowColor, NULL),
3571 if (XmCO_DitherTopShadow(DISPLAY, thisScreen, tpixset))
3573 XrmPutStringResource (&db,
3574 ResCat (res_class, screen_name, WmNactiveTopShadowPixmap, NULL),
3579 if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, tpixset))
3581 XrmPutStringResource (&db,
3582 ResCat (res_class, screen_name, WmNactiveBottomShadowPixmap,
3591 * WM INACTIVE colors--e.g., for dialogues
3594 if (pSD->pInactivePixelSet)
3596 tpixset = pSD->pInactivePixelSet;
3597 spixset = pSD->pSecondaryPixelSet;
3599 if (pSD->colorUse == XmCO_BLACK_WHITE)
3604 * Set colors/pixmaps for the frames--leave the
3605 * menus out of it so that their text won't look
3606 * unsatisfactory against a dithered background.
3611 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3613 XrmPutResource (&db,
3614 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3615 WmNforeground), XtRPixel, &value);
3617 XrmPutResource (&db,
3618 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3619 WmNforeground), XtRPixel, &value);
3623 XrmPutStringResource (&db,
3624 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3625 WmNbackgroundPixmap), _Dither);
3627 XrmPutStringResource (&db,
3628 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3629 WmNbackgroundPixmap), _Dither);
3631 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3632 XrmPutResource (&db,
3633 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3634 WmNbackground), XtRPixel, &value);
3636 XrmPutResource (&db,
3637 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3638 WmNbackground), XtRPixel, &value);
3641 XrmPutStringResource (&db,
3642 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3643 WmNtopShadowPixmap), _foreground);
3645 XrmPutStringResource (&db,
3646 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3647 WmNtopShadowPixmap), _foreground);
3649 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3650 XrmPutResource (&db,
3651 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3652 WmNtopShadowColor), XtRPixel, &value);
3654 XrmPutResource (&db,
3655 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3656 WmNtopShadowColor), XtRPixel, &value);
3660 XrmPutStringResource (&db,
3661 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3662 WmNbottomShadowPixmap), _foreground);
3664 XrmPutStringResource (&db,
3665 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3666 WmNbottomShadowPixmap), _foreground);
3668 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3670 XrmPutResource (&db,
3671 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3672 WmNbottomShadowColor), XtRPixel, &value);
3674 XrmPutResource (&db,
3675 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3676 WmNbottomShadowColor), XtRPixel, &value);
3680 * Ensure that the icon images have a black foreground and
3681 * a white background.
3684 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3686 XrmPutResource (&db,
3687 ResCat (res_class, screen_name, WmNiconImageForeground,
3688 NULL), XtRPixel, &value);
3690 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3692 XrmPutResource (&db,
3693 ResCat (res_class, screen_name, WmNiconImageBackground,
3694 NULL), XtRPixel, &value);
3696 /* Now deal with XmCO_BLACK_WHITE Menus */
3698 /* XmCO_BLACK_WHITE menu foreground */
3699 value.addr = (XtPointer) &(tpixset->fg);
3701 XrmPutResource (&db,
3702 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3703 WmNforeground), XtRPixel, &value);
3705 /* XmCO_BLACK_WHITE menu background */
3706 value.addr = (XtPointer) &(tpixset->bg);
3708 XrmPutResource (&db,
3709 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3710 WmNbackground), XtRPixel, &value);
3712 /* XmCO_BLACK_WHITE menu top shadow */
3714 XrmPutStringResource (&db,
3715 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3716 WmNtopShadowPixmap), _50_foreground);
3718 /* use foreground color for this pixmap */
3719 value.addr = (XtPointer) &(tpixset->fg);
3721 XrmPutResource (&db,
3722 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3723 WmNtopShadowColor), XtRPixel, &value);
3725 /* XmCO_BLACK_WHITE menu bottom shadow */
3727 XrmPutStringResource (&db,
3728 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3729 WmNbottomShadowPixmap), _75_foreground);
3731 /* use foreground color for this pixmap */
3732 value.addr = (XtPointer) &(tpixset->fg);
3734 XrmPutResource (&db,
3735 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3736 WmNbottomShadowColor), XtRPixel, &value);
3738 /* Finally, deal with XmCO_BLACK_WHITE Confirm Boxes */
3740 /* XmCO_BLACK_WHITE confirm box foreground */
3741 value.addr = (XtPointer) &(spixset->fg);
3743 XrmPutResource (&db,
3744 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3745 WmNforeground), XtRPixel, &value);
3747 /* XmCO_BLACK_WHITE confirm box background */
3748 value.addr = (XtPointer) &(spixset->bg);
3750 XrmPutResource (&db,
3751 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3752 WmNbackground), XtRPixel, &value);
3754 /* XmCO_BLACK_WHITE confirm box top shadow */
3756 XrmPutStringResource (&db,
3757 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3758 WmNtopShadowPixmap), _50_foreground);
3760 /* use foreground color */
3761 value.addr = (XtPointer) &(spixset->fg);
3763 XrmPutResource (&db,
3764 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3765 WmNtopShadowColor), XtRPixel, &value);
3767 /* XmCO_BLACK_WHITE confirm box bottom shadow */
3769 XrmPutStringResource (&db,
3770 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3771 WmNbottomShadowPixmap), _75_foreground);
3773 /* use foreground color */
3774 value.addr = (XtPointer) &(spixset->fg);
3776 XrmPutResource (&db,
3777 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3778 WmNbottomShadowColor), XtRPixel, &value);
3780 /* use select color for icon box trough color */
3782 value.addr = (XtPointer) &(tpixset->sc);
3784 XrmPutResource (&db,
3785 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3786 XmNtroughColor), XtRPixel, &value);
3788 /* use select color for arm and select colors in dialogs */
3790 value.addr = (XtPointer) &(spixset->sc);
3792 XrmPutResource (&db,
3793 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3794 XmNarmColor), XtRPixel, &value);
3796 XrmPutResource (&db,
3797 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3798 XmNselectColor), XtRPixel, &value);
3800 XrmPutResource (&db,
3801 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3802 XmNtroughColor), XtRPixel, &value);
3804 else /* inactive colors for non-BW systems */
3806 XmPixelSet *fpixset;
3809 * Set mwm component colors
3811 value.addr = (XtPointer) &(tpixset->bg);
3812 XrmPutResource (&db,
3813 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3814 WmNbackground), XtRPixel, &value);
3816 XrmPutResource (&db,
3817 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3818 WmNbackground), XtRPixel, &value);
3820 XrmPutResource (&db,
3821 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3822 WmNbackground), XtRPixel, &value);
3824 value.addr = (XtPointer) &(spixset->bg);
3825 XrmPutResource (&db,
3826 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3827 WmNbackground), XtRPixel, &value);
3829 value.addr = (XtPointer) &(tpixset->ts);
3830 XrmPutResource (&db,
3831 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3832 WmNtopShadowColor), XtRPixel, &value);
3834 XrmPutResource (&db,
3835 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3836 WmNtopShadowColor), XtRPixel, &value);
3838 XrmPutResource (&db,
3839 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3840 WmNtopShadowColor), XtRPixel, &value);
3842 value.addr = (XtPointer) &(spixset->ts);
3843 XrmPutResource (&db,
3844 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3845 WmNtopShadowColor), XtRPixel, &value);
3847 value.addr = (XtPointer) &(tpixset->bs);
3848 XrmPutResource (&db,
3849 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3850 WmNbottomShadowColor), XtRPixel, &value);
3852 XrmPutResource (&db,
3853 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3854 WmNbottomShadowColor), XtRPixel, &value);
3856 XrmPutResource (&db,
3857 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3858 WmNbottomShadowColor), XtRPixel, &value);
3860 value.addr = (XtPointer) &(spixset->bs);
3861 XrmPutResource (&db,
3862 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3863 WmNbottomShadowColor), XtRPixel, &value);
3865 value.addr = (XtPointer) &(tpixset->fg);
3866 XrmPutResource (&db,
3867 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3868 WmNforeground), XtRPixel, &value);
3870 XrmPutResource (&db,
3871 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3872 WmNforeground), XtRPixel, &value);
3874 XrmPutResource (&db,
3875 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3876 WmNforeground), XtRPixel, &value);
3878 value.addr = (XtPointer) &(spixset->fg);
3879 XrmPutResource (&db,
3880 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3881 WmNforeground), XtRPixel, &value);
3884 * Set select color only for menus and feedback mwm
3885 * parts. Client and Icon parts aren't real widgets.
3886 * Set client trough color for icon box.
3888 value.addr = (XtPointer) &(tpixset->sc);
3889 XrmPutResource (&db,
3890 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3891 XmNselectColor), XtRPixel, &value);
3893 XrmPutResource (&db,
3894 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3895 XmNarmColor), XtRPixel, &value);
3897 XrmPutResource (&db,
3898 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3899 XmNtroughColor), XtRPixel, &value);
3901 XrmPutResource (&db,
3902 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3903 XmNtroughColor), XtRPixel, &value);
3905 XrmPutResource (&db,
3906 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3907 XmNselectColor), XtRPixel, &value);
3909 value.addr = (XtPointer) &(spixset->sc);
3910 XrmPutResource (&db,
3911 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3912 XmNarmColor), XtRPixel, &value);
3914 XrmPutResource (&db,
3915 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3916 XmNtroughColor), XtRPixel, &value);
3919 * Set Dtwm dialog colors
3921 fpixset = pSD->pSecondaryPixelSet;
3923 value.addr = (XtPointer) &(fpixset->bg);
3924 XrmPutResource (&db,
3925 ResCat (res_class, screen_name, XmNbackground, NULL),
3928 value.addr = (XtPointer) &(fpixset->fg);
3929 XrmPutResource (&db,
3930 ResCat (res_class, screen_name, XmNforeground, NULL),
3933 value.addr = (XtPointer) &(fpixset->ts);
3934 XrmPutResource (&db,
3935 ResCat (res_class, screen_name, XmNtopShadowColor, NULL),
3938 value.addr = (XtPointer) &(fpixset->bs);
3939 XrmPutResource (&db,
3940 ResCat (res_class, screen_name, XmNbottomShadowColor, NULL),
3945 * Set up the select color, as for buttons in the dialogue
3949 value.addr = (XtPointer) &(fpixset->sc);
3950 XrmPutResource (&db,
3951 ResCat (res_class, screen_name, XmNselectColor, NULL),
3954 /* value.addr = (XtPointer) &(fpixset->sc); */
3955 XrmPutResource (&db,
3956 ResCat (res_class, screen_name, XmNarmColor, NULL),
3959 /* value.addr = (XtPointer) &(fpixset->sc); */
3960 XrmPutResource (&db,
3961 ResCat (res_class, screen_name, XmNtroughColor, NULL),
3964 if (XmCO_DitherTopShadow(DISPLAY, thisScreen, fpixset))
3966 XrmPutStringResource (&db,
3967 ResCat (res_class, screen_name, WmNtopShadowPixmap, NULL),
3970 if (pSD->colorUse == XmCO_BLACK_WHITE)
3972 XrmPutStringResource (&db,
3973 ResCat (res_class, screen_name,
3974 WmNbottomShadowPixmap, NULL),
3980 if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, fpixset))
3982 XrmPutStringResource (&db,
3983 ResCat (res_class, screen_name, WmNbottomShadowPixmap, NULL),
3986 if (pSD->colorUse == XmCO_BLACK_WHITE)
3988 XrmPutStringResource (&db,
3989 ResCat (res_class, screen_name,
3990 WmNtopShadowPixmap, NULL),
3996 if (tpixset->bs != tpixset->ts)
3999 * If the inactive bottomshadow and topshadow are
4000 * different (i.e., valid), then make the icon image
4004 value.addr = (XtPointer) &(tpixset->bs);
4006 XrmPutResource (&db,
4007 ResCat (res_class, screen_name, WmNiconImageForeground,
4008 NULL), XtRPixel, &value);
4010 value.addr = (XtPointer) &(tpixset->ts);
4012 XrmPutResource (&db,
4013 ResCat (res_class, screen_name, WmNiconImageBackground,
4014 NULL), XtRPixel, &value);
4016 value.addr = (XtPointer) &(tpixset->bs);
4018 XrmPutResource (&db,
4019 ResCat (res_class, screen_name,
4020 WmNiconImageBottomShadowColor,
4021 NULL), XtRPixel, &value);
4023 value.addr = (XtPointer) &(tpixset->ts);
4025 XrmPutResource (&db,
4026 ResCat (res_class, screen_name,
4027 WmNiconImageTopShadowColor,
4028 NULL), XtRPixel, &value);
4033 * Ensure that the icon images have a black foreground and
4034 * a white background.
4038 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
4040 XrmPutResource (&db,
4041 ResCat (res_class, screen_name, WmNiconImageForeground,
4042 NULL), XtRPixel, &value);
4044 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
4046 XrmPutResource (&db,
4047 ResCat (res_class, screen_name, WmNiconImageBackground,
4048 NULL), XtRPixel, &value);
4054 if (pSD->pTextPixelSet)
4056 value.addr = (XtPointer) &(pSD->pTextPixelSet->bg);
4058 XrmPutResource (&db,
4059 ResCat (res_class, screen_name, "XmTextField",
4060 WmNbackground), XtRPixel, &value);
4062 XrmPutResource (&db,
4063 ResCat (res_class, screen_name, "XmText",
4064 WmNbackground), XtRPixel, &value);
4069 /******************************<->*************************************
4071 * ResCat (s1,s2,s3,s4)
4076 * Cats up to four strings together with '*' in between.
4081 * s1...s4 = pointers to Strings or NULL pointers (no string)
4085 * Return = pointer to statically allocated string that has
4086 * the passed in string cat'ed together with '*'s
4091 * Does no limit checking on the static buffer
4093 *************************************<->***********************************/
4096 ResCat (String s1, String s2, String s3, String s4)
4102 Boolean useResourceClass = True;
4104 wmGD.tmpBuffer[0] = '\0';
4110 if ((MwmBehavior) &&
4111 !strcmp (s1, WM_RESOURCE_CLASS))
4114 * if this routine is called with a class name
4115 * ("Mwm" or "Dtwm"), then DON'T use it.
4116 * We want our resources to be written out
4117 * as: *iconImageForeground: <pixel_val>
4119 * as opposed to: Dtwm*iconImageForeground: <pixel_val>
4123 useResourceClass = False;
4125 else if (!strcmp (s1, DT_WM_RESOURCE_CLASS))
4127 useResourceClass = False;
4131 strncat((char *)wmGD.tmpBuffer, s1, count);
4132 count -= strlen(s1);
4135 if (s2 && (count > 0))
4137 strncat ((char *)wmGD.tmpBuffer, "*", count);
4139 strncat ((char *)wmGD.tmpBuffer, s2, count);
4140 count -= strlen (s2);
4142 if (s3 && (count > 0))
4144 strncat ((char *)wmGD.tmpBuffer, "*", count);
4146 strncat ((char *)wmGD.tmpBuffer, s3, count);
4147 count -= strlen (s3);
4151 strncat ((char *)wmGD.tmpBuffer, "*", count);
4153 strncat ((char *)wmGD.tmpBuffer, s4, count);
4158 return ((String) wmGD.tmpBuffer);
4160 } /* END OF FUNCTION ResCat */
4164 /******************************<->*************************************
4166 * CheckForNoDither (pAD)
4171 * Checks for reserved string as pixmap name of dither that indicates
4172 * no dithering and replaces the string with a NULL.
4177 * pAD = pointer to appearance data
4181 * pAD = pointer to appearance data (may be modified)
4185 * This check is done to avoid repeated calls to XmGetPixmap when
4186 * managing windows. XmGetPixmap doesn't cache failures, and the
4187 * NoDither string should fail every time. We want to prevent
4188 * XmGetPixmap from call XtResolvePathName to rummage through
4191 *************************************<->***********************************/
4194 CheckForNoDither (AppearanceData *pAD)
4196 if (pAD->backgroundPStr &&
4197 !strcmp(pAD->backgroundPStr, _NoDither))
4199 pAD->backgroundPStr = NULL;
4201 if (pAD->bottomShadowPStr &&
4202 !strcmp(pAD->bottomShadowPStr, _NoDither))
4204 pAD->bottomShadowPStr = NULL;
4206 if (pAD->topShadowPStr &&
4207 !strcmp(pAD->topShadowPStr, _NoDither))
4209 pAD->topShadowPStr = NULL;
4211 if (pAD->activeBackgroundPStr &&
4212 !strcmp(pAD->activeBackgroundPStr, _NoDither))
4214 pAD->activeBackgroundPStr = NULL;
4216 if (pAD->activeBottomShadowPStr &&
4217 !strcmp(pAD->activeBottomShadowPStr, _NoDither))
4219 pAD->activeBottomShadowPStr = NULL;
4221 if (pAD->activeTopShadowPStr &&
4222 !strcmp(pAD->activeTopShadowPStr, _NoDither))
4224 pAD->activeTopShadowPStr = NULL;
4227 } /* END OF FUNCTION CheckForNoDither */
4233 /******************************<->*************************************
4235 * ProcessAppearanceResources (pSD)
4240 * Retrieve and process the general appearance resources for the mwm
4241 * subparts: "client", "icon", and "feedback"
4246 * pSD = pointer to screen data
4250 * modifies parts of global data wmGD.
4254 * o Changeable GCs are created with XCreateGC. The base GCs used for
4255 * text output will have clip_masks defined for them later.
4258 *************************************<->***********************************/
4261 ProcessAppearanceResources (WmScreenData *pSD)
4263 Widget clientW; /* dummy widget for resource fetching */
4269 * Get the client subpart resources:
4272 /* save info in static globals for dynamic default processing */
4273 _defaultBackground = _defaultColor1;
4274 _defaultActiveBackground = _defaultColor2;
4275 _pAppearanceData = &(pSD->clientAppearance);
4277 (void)XtGetSubresources (pSD->screenTopLevelW,
4278 (XtPointer) &(pSD->clientAppearance),
4279 WmNclient, WmCClient, wmAppearanceResources,
4280 XtNumber (wmAppearanceResources), NULL, 0);
4282 CheckForNoDither (&(pSD->clientAppearance));
4287 * Process the client resource values:
4290 /* make background, top and bottom shadow pixmaps */
4292 MakeAppearanceResources (pSD, &(pSD->clientAppearance), True);
4296 * Get the client.title subpart resources:
4299 /* insert "client" widget in hierarchy */
4302 clientW = XtCreateWidget (WmNclient, xmRowColumnWidgetClass,
4303 pSD->screenTopLevelW, (ArgList) args, i);
4306 /* fetch "client.title" subpart appearance resources */
4308 _pAppearanceData = &(pSD->clientTitleAppearance);
4310 (void)XtGetSubresources (clientW, (XtPointer) &(pSD->clientTitleAppearance),
4311 WmNtitle, WmCTitle, wmAppearanceResources,
4312 XtNumber (wmAppearanceResources), NULL, 0);
4314 CheckForNoDither (&(pSD->clientTitleAppearance));
4319 * Process the client.title resource values:
4324 * check if client title appearance is different from the rest of frame.
4326 if (SimilarAppearanceData (&(pSD->clientAppearance),
4327 &(pSD->clientTitleAppearance)))
4329 /* title bar doesn't need special graphic processing */
4330 pSD->decoupleTitleAppearance = False;
4334 /* make background, top and bottom shadow pixmaps */
4335 MakeAppearanceResources (pSD, &(pSD->clientTitleAppearance), True);
4336 pSD->decoupleTitleAppearance = True;
4339 XtDestroyWidget (clientW); /* all done with dummy widget */
4343 * Get the icon subpart resources:
4346 _pAppearanceData = &(pSD->iconAppearance);
4348 (void)XtGetSubresources (pSD->screenTopLevelW,
4349 (XtPointer) &(pSD->iconAppearance),
4350 WmNicon, WmCIcon, wmAppearanceResources,
4351 XtNumber (wmAppearanceResources), NULL, 0);
4353 CheckForNoDither (&(pSD->iconAppearance));
4358 * Process the icon resource values:
4361 /* make background, top and bottom shadow pixmaps */
4363 MakeAppearanceResources (pSD, &(pSD->iconAppearance), True);
4367 * Get the feedback subpart resources:
4368 * !!! only get "inactive" resources !!!
4371 _defaultBackground = _defaultColor2;
4372 _defaultActiveBackground = _defaultColor2;
4373 _pAppearanceData = &(pSD->feedbackAppearance);
4375 (void)XtGetSubresources (pSD->screenTopLevelW,
4376 (XtPointer) &(pSD->feedbackAppearance),
4377 WmNfeedback, WmCFeedback, wmAppearanceResources,
4378 XtNumber (wmAppearanceResources), NULL, 0);
4380 CheckForNoDither (&(pSD->feedbackAppearance));
4384 * Process the feedback resource values:
4387 /* make background, top and bottom shadow pixmaps */
4389 MakeAppearanceResources (pSD, &(pSD->feedbackAppearance), False);
4392 } /* END OF FUNCTION ProcessAppearanceResources */
4395 /*************************************<->*************************************
4397 * MakeAppearanceResources (pSD, pAData, makeActiveResources)
4402 * This function makes top, bottom and background pixmaps for a window
4403 * manager component. Inactive and active (if specified) GC's are
4409 * pSD = pointer to screen data
4411 * pAData = pointer to appearance data structure containing resource info
4413 * makeActiveResources = if True then make active resources
4417 * *pAData = pixmap and GC fields filled out
4419 *************************************<->***********************************/
4422 MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources)
4427 * Extract a font from the font list.
4430 if (! XmeRenderTableGetDefaultFont(pAData->fontList, &(pAData->font)))
4432 sprintf((char *)wmGD.tmpBuffer, ((char *)GETMESSAGE(62, 23, "failed to load font: %.100s\0")), (char*) pAData->fontList);
4433 Warning((char *)wmGD.tmpBuffer);
4434 #if defined(CSRG_BASED) || defined(linux)
4435 /* HACK to try get _some_ font anyway (fontList seems to end up as an empty list on
4436 * some modern systems; investigate) */
4437 pAData->font = XLoadQueryFont(wmGD.display, "fixed");
4438 if (pAData->font == NULL) {
4439 ExitWM(WM_ERROR_EXIT_VALUE);
4442 ExitWM(WM_ERROR_EXIT_VALUE);
4447 #ifndef NO_MULTIBYTE
4449 * Calculate title bar's height and store it in pAData.
4451 pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
4452 + WM_TITLE_BAR_PADDING;
4457 * Make standard (inactive) appearance resources.
4460 /* background pixmap */
4462 if (pAData->backgroundPStr)
4464 pAData->backgroundPixmap = XmGetPixmap (
4465 ScreenOfDisplay (DISPLAY,
4467 pAData->backgroundPStr,
4469 pAData->background);
4471 if (pAData->backgroundPixmap == XmUNSPECIFIED_PIXMAP)
4473 pAData->backgroundPixmap = (Pixmap)NULL;
4478 pAData->backgroundPixmap = (Pixmap)NULL;
4481 /* top shadow pixmap */
4483 if (pAData->topShadowPStr)
4486 * Make sure top shadow color is not the same as background
4487 * otherwise the wrong pixmap will be generated.
4489 if (pAData->topShadowColor != pAData->background)
4490 foreground = pAData->topShadowColor;
4492 foreground = pAData->foreground;
4493 pAData->topShadowPixmap = XmGetPixmap (
4494 ScreenOfDisplay (DISPLAY,
4496 pAData->topShadowPStr,
4498 pAData->background);
4500 if (pAData->topShadowPixmap == XmUNSPECIFIED_PIXMAP)
4502 pAData->topShadowPixmap = (Pixmap)NULL;
4507 pAData->topShadowPixmap = (Pixmap)NULL;
4511 /* bottom shadow pixmap */
4513 if (pAData->bottomShadowPStr)
4516 * Make sure bottom shadow color is not the same as background
4517 * otherwise the wrong pixmap will be generated.
4519 if (pAData->bottomShadowColor != pAData->background)
4520 foreground = pAData->bottomShadowColor;
4522 foreground = pAData->foreground;
4523 pAData->bottomShadowPixmap = XmGetPixmap (
4524 ScreenOfDisplay (DISPLAY,
4526 pAData->bottomShadowPStr,
4528 pAData->background);
4530 if (pAData->bottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
4532 pAData->bottomShadowPixmap = (Pixmap)NULL;
4537 pAData->bottomShadowPixmap = (Pixmap)NULL;
4540 /* inactive appearance GC */
4542 GetAppearanceGCs (pSD,
4546 pAData->backgroundPixmap,
4547 pAData->topShadowColor,
4548 pAData->topShadowPixmap,
4549 pAData->bottomShadowColor,
4550 pAData->bottomShadowPixmap,
4551 &(pAData->inactiveGC),
4552 &(pAData->inactiveTopShadowGC),
4553 &(pAData->inactiveBottomShadowGC));
4558 * Make active apppearance resources if specified.
4561 if (!makeActiveResources)
4566 /* active background pixmap */
4568 if (pAData->activeBackgroundPStr)
4570 pAData->activeBackgroundPixmap = XmGetPixmap (
4571 ScreenOfDisplay (DISPLAY,
4573 pAData->activeBackgroundPStr,
4574 pAData->activeForeground,
4575 pAData->activeBackground);
4577 if (pAData->activeBackgroundPixmap == XmUNSPECIFIED_PIXMAP)
4579 pAData->activeBackgroundPixmap = (Pixmap)NULL;
4584 pAData->activeBackgroundPixmap = (Pixmap)NULL;
4587 /* active top shadow pixmap */
4589 if (pAData->activeTopShadowPStr)
4591 pAData->activeTopShadowPixmap = XmGetPixmap (
4592 ScreenOfDisplay (DISPLAY,
4594 pAData->activeTopShadowPStr,
4595 pAData->activeTopShadowColor,
4596 pAData->activeBackground);
4598 if (pAData->activeTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
4600 pAData->activeTopShadowPixmap = (Pixmap)NULL;
4605 pAData->activeTopShadowPixmap = (Pixmap)NULL;
4609 /* active bottom shadow pixmap */
4611 if (pAData->activeBottomShadowPStr)
4613 pAData->activeBottomShadowPixmap = XmGetPixmap (
4614 ScreenOfDisplay (DISPLAY,
4616 pAData->activeBottomShadowPStr,
4617 pAData->activeBottomShadowColor,
4618 pAData->activeBackground);
4620 if (pAData->activeBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
4622 pAData->activeBottomShadowPixmap = (Pixmap)NULL;
4627 pAData->activeBottomShadowPixmap = (Pixmap)NULL;
4630 /* inactive appearance GC */
4632 GetAppearanceGCs (pSD,
4633 pAData->activeForeground,
4634 pAData->activeBackground,
4636 pAData->activeBackgroundPixmap,
4637 pAData->activeTopShadowColor,
4638 pAData->activeTopShadowPixmap,
4639 pAData->activeBottomShadowColor,
4640 pAData->activeBottomShadowPixmap,
4641 &(pAData->activeGC),
4642 &(pAData->activeTopShadowGC),
4643 &(pAData->activeBottomShadowGC));
4646 } /* END OF FUNCTION MakeAppearanceResources */
4650 /*************************************<->*************************************
4652 * GetAppearanceGCs (pSD, fg, bg, font, bg_pixmap, ts_color,
4653 * ts_pixmap, bs_color, bs_pixmap, pGC, ptsGC, pbsGC)
4658 * Creates the appearance GCs for any of the icon, client, or feedback
4664 * pSD - pointer to screen data
4665 * fg - base foreground color
4666 * bg - base background color
4668 * bg_pixmap - background pixmap
4669 * ts_color - top shadow color
4670 * ts_pixmap - top shadow pixmap
4671 * bs_color - bottom shadow color
4672 * bs_pixmap - bottom shadow pixmap
4673 * pGC - pointer to location to receive base GC
4674 * ptsGC - pointer to location to receive top shadow GC
4675 * pbsGC - pointer to location to receive bottom shadow GC
4680 * *ptsGC - top shadow GC
4681 * *pbsGC - bottom shadow GC
4688 *************************************<->***********************************/
4691 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)
4701 mask = GCForeground | GCBackground | GCFont;
4702 gcv.foreground = fg;
4703 gcv.background = bg;
4704 gcv.font = font->fid;
4709 gcv.tile = bg_pixmap;
4712 *pGC = XCreateGC (DISPLAY, pSD->rootWindow, mask, &gcv);
4715 * !!! Need GC error detection !!!
4718 *ptsGC = GetHighlightGC (pSD, ts_color, bg, ts_pixmap);
4720 *pbsGC = GetHighlightGC (pSD, bs_color, bg, bs_pixmap);
4722 } /* END OF FUNCTION GetAppearanceGCs */
4727 /*************************************<->*************************************
4729 * ProcessScreenResources (pSD, screenName)
4734 * This function retrieves resources that are screen specific. If the
4735 * window manager is providing standard behavior then retrieve the limited
4736 * set of resources that don't affect standard behavior and set the
4737 * values of the other resources to the standard values.
4742 * pSD = pointer to screen data
4743 * screenName = name of screen
4748 * pSD = resource data for screen is set
4753 * o Gets subresources based on workspace name
4755 *************************************<->***********************************/
4758 ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName)
4761 pResSD = pSD; /* save current screen data for default processing */
4763 * Use the screen name (e.g., "0") as the default resource name.
4766 if (wmGD.useStandardBehavior)
4768 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4769 (String) screenName,
4770 (String) screenName,
4771 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,
4785 XtNumber (wmScreenResources), NULL, 0);
4787 #ifndef MOTIF_ONE_DOT_ONE
4788 pSD->moveOpaque = (((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW)))
4789 -> screen.moveOpaque);
4795 * Retrieve screen specific resources.
4798 if (wmGD.useStandardBehavior)
4800 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4801 (String) screenName, (String)screenName, wmStdScreenResources,
4802 XtNumber (wmStdScreenResources), NULL, 0);
4805 * Fill in the standard resource values.
4808 SetStdScreenResourceValues (pSD);
4812 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4813 (String)screenName, (String)screenName, wmScreenResources,
4814 XtNumber (wmScreenResources), NULL, 0);
4816 #ifndef MOTIF_ONE_DOT_ONE
4817 pSD->moveOpaque =(((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW)))
4818 -> screen.moveOpaque);
4824 * Do some additional processing on the window manager resource values.
4828 if (pSD->iconImageMinimum.width < ICON_IMAGE_MIN_WIDTH)
4830 pSD->iconImageMinimum.width = ICON_IMAGE_MIN_WIDTH;
4832 else if (pSD->iconImageMinimum.width > ICON_IMAGE_MAX_WIDTH)
4834 pSD->iconImageMinimum.width = ICON_IMAGE_MAX_WIDTH;
4837 if (pSD->iconImageMinimum.height < ICON_IMAGE_MIN_HEIGHT)
4839 pSD->iconImageMinimum.height = ICON_IMAGE_MIN_HEIGHT;
4841 else if (pSD->iconImageMinimum.height > ICON_IMAGE_MAX_HEIGHT)
4843 pSD->iconImageMinimum.height = ICON_IMAGE_MAX_HEIGHT;
4846 if (pSD->iconImageMaximum.width < pSD->iconImageMinimum.width)
4848 pSD->iconImageMaximum.width = pSD->iconImageMinimum.width;
4850 else if (pSD->iconImageMaximum.width > ICON_IMAGE_MAX_WIDTH)
4852 pSD->iconImageMaximum.width = ICON_IMAGE_MAX_WIDTH;
4855 if (pSD->iconImageMaximum.height < pSD->iconImageMinimum.height)
4857 pSD->iconImageMaximum.height = pSD->iconImageMinimum.height;
4859 else if (pSD->iconImageMaximum.height > ICON_IMAGE_MAX_HEIGHT)
4861 pSD->iconImageMaximum.height = ICON_IMAGE_MAX_HEIGHT;
4864 if (pSD->iconPlacementMargin > MAXIMUM_ICON_MARGIN)
4866 pSD->iconPlacementMargin = MAXIMUM_ICON_MARGIN;
4869 if (pSD->maximumMaximumSize.width <= 0)
4871 pSD->maximumMaximumSize.width =
4872 2 * DisplayWidth (DISPLAY, pSD->screen);
4875 if (pSD->maximumMaximumSize.height <= 0)
4877 pSD->maximumMaximumSize.height =
4878 2 * DisplayHeight (DISPLAY, pSD->screen);
4882 * Set the icon appearance default based on whether or not the icon box
4886 if (pSD->iconDecoration & USE_ICON_DEFAULT_APPEARANCE)
4888 if (pSD->useIconBox)
4890 pSD->iconDecoration = ICON_APPEARANCE_ICONBOX;
4894 pSD->iconDecoration = ICON_APPEARANCE_STANDALONE;
4899 * If resizeBorderWidth or frameBorderWidth is unset then initialize
4900 * to dynamic defaults.
4903 if ((pSD->resizeBorderWidth == (Dimension)BIGSIZE) ||
4904 (pSD->frameBorderWidth == (Dimension)BIGSIZE))
4906 double xres, yres, avg_res;
4908 xres = (((double) DisplayWidth(DISPLAY, pSD->screen)) /
4909 ((double) DisplayWidthMM(DISPLAY, pSD->screen)));
4910 yres = (((double) DisplayHeight(DISPLAY, pSD->screen)) /
4911 ((double) DisplayHeightMM(DISPLAY, pSD->screen)));
4913 avg_res = (xres + yres) / 2.0;
4915 /* Multiply times width in mm (avg. 7-8 pixels) */
4916 if (pSD->resizeBorderWidth == (Dimension)BIGSIZE)
4918 pSD->resizeBorderWidth = (int) (avg_res * 2.2);
4920 /* limit size because big borders look ugly */
4922 if (wmGD.frameStyle == WmSLAB)
4925 if (pSD->resizeBorderWidth > 6) pSD->resizeBorderWidth = 6;
4930 if (pSD->resizeBorderWidth > 7) pSD->resizeBorderWidth = 7;
4935 /* Multiply times width in mm (avg. 5-6 pixels) */
4936 if (pSD->frameBorderWidth == (Dimension)BIGSIZE)
4938 pSD->frameBorderWidth = (int) (avg_res * 1.7);
4940 /* limit size because big borders look ugly */
4941 if (wmGD.frameStyle == WmSLAB)
4943 if (pSD->frameBorderWidth > 4) pSD->frameBorderWidth = 4;
4947 if (pSD->frameBorderWidth > 5) pSD->frameBorderWidth = 5;
4953 pSD->externalBevel = FRAME_EXTERNAL_SHADOW_WIDTH;
4954 pSD->joinBevel = FRAME_INTERNAL_SHADOW_WIDTH;
4955 if (pSD->frameBorderWidth <
4956 (pSD->externalBevel + MIN_INTERNAL_BEVEL))
4958 pSD->frameBorderWidth =
4959 pSD->externalBevel + MIN_INTERNAL_BEVEL;
4961 else if (pSD->frameBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
4963 pSD->frameBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
4966 if (pSD->resizeBorderWidth <
4967 (pSD->externalBevel + MIN_INTERNAL_BEVEL))
4969 pSD->resizeBorderWidth =
4970 (pSD->externalBevel + MIN_INTERNAL_BEVEL);
4972 else if (pSD->resizeBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
4974 pSD->resizeBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
4979 * Update the resource database.
4981 WriteOutXrmColors (pSD);
4986 * Process the component appearance resources for client,
4987 * icon and feedback parts of mwm.
4990 ProcessAppearanceResources (pSD);
4994 * Process the workspace list and name the initial
4998 ProcessWorkspaceList (pSD);
5001 * Process default backdrop images to be used in low-color
5004 ProcessDefaultBackdropImages (pSD);
5008 * Save the default icon pixmap in global data. We'll use it only
5012 pSD->builtinIconPixmap =
5013 XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char *)iImage_bits,
5014 iImage_width, iImage_height);
5016 } /* END OF FUNCTION ProcessScreenResources */
5020 /*************************************<->*************************************
5022 * ProcessDefaultBackdropImages (pSD)
5027 * This function processes the default backdrop images to be used
5028 * in low color or black and white workspaces.
5033 * pSD = pointer to screen data
5038 * pSD = resource data for screen is set
5044 *************************************<->***********************************/
5047 ProcessDefaultBackdropImages (WmScreenData *pSD)
5049 } /* END OF FUNCTION ProcessDefaultBackdropImages */
5053 /*************************************<->*************************************
5055 * ProcessWorkspaceList (pSD)
5060 * This function processes the workspaceCount and workspaceList
5061 * resources for a particular screen. It creates space for the initial
5062 * workspace data structures and adds in names for workspaces.
5067 * pSD = pointer to screen data
5072 * pSD = resource data for screen is set
5077 * NOTE: The workspaceCount resource has precedence over the
5078 * workspaceList resource. workspaceCount determines the number of
5079 * workspaces to create for the screen. Once the number is determined,
5080 * workspaceList is used to fill in the "names." If workspaceList is
5081 * not present or doesn't have enough names, then missing names are
5082 * generated automatically. If workspaceList is present and
5083 * workspaceCount is not present, then the workspaceCount is determined
5084 * by the number of names in workspaceList.
5086 *************************************<->***********************************/
5089 ProcessWorkspaceList (WmScreenData *pSD)
5091 int i, wsNameCount, wsNamesAlloced;
5092 WmWorkspaceData *pwsI;
5093 unsigned char *lineP = NULL;
5094 unsigned char *string;
5095 Boolean bHaveWorkspaceList;
5096 Boolean bHaveWorkspaceCount;
5097 char **ppchWsNames = NULL;
5100 * Validate initial resource settings
5102 bHaveWorkspaceCount = (pSD->numWorkspaces >= 1);
5103 bHaveWorkspaceList = (pSD->workspaceList != NULL);
5105 if (bHaveWorkspaceList)
5108 * Parse out array of workspace names
5110 wsNamesAlloced = WS_ALLOC_AMOUNT;
5111 ppchWsNames = (char **) XtMalloc (wsNamesAlloced * sizeof (char *));
5112 if (pSD->workspaceList)
5114 lineP = (unsigned char *) pSD->workspaceList;
5118 lineP = (unsigned char *)NULL;
5122 while (((string = GetString(&lineP)) != NULL))
5124 ppchWsNames[wsNameCount] = (char *) string;
5126 if (++wsNameCount >= wsNamesAlloced)
5129 * Need to add more workspaces
5131 wsNamesAlloced += WS_ALLOC_AMOUNT;
5132 if (!(ppchWsNames = (char **) XtRealloc
5133 ((char *)ppchWsNames,
5134 wsNamesAlloced * sizeof(char *))))
5136 ExitWM (WM_ERROR_EXIT_VALUE);
5141 if (!bHaveWorkspaceCount)
5143 pSD->numWorkspaces = wsNameCount;
5146 else if (!bHaveWorkspaceCount)
5149 * Neither workspaceCount nor workspaceList specified!!
5150 * Assume one workspace.
5152 pSD->numWorkspaces = 1;
5155 if (pSD->numWorkspaces > MAX_WORKSPACE_COUNT)
5156 pSD->numWorkspaces = MAX_WORKSPACE_COUNT;
5159 * Allocate the array of workspace data
5161 pSD->numWsDataAllocated = (pSD->numWorkspaces + WS_ALLOC_AMOUNT);
5162 pSD->numWsDataAllocated -= pSD->numWsDataAllocated % WS_ALLOC_AMOUNT;
5163 if (!(pSD->pWS = (WmWorkspaceData *)
5164 XtMalloc (pSD->numWsDataAllocated * sizeof(WmWorkspaceData))))
5166 ExitWM (WM_ERROR_EXIT_VALUE);
5171 for (i = 0; i < pSD->numWorkspaces; i++, pwsI++)
5173 if (bHaveWorkspaceList && i < wsNameCount)
5175 string = (unsigned char *) ppchWsNames[i];
5179 string = GenerateWorkspaceName (pSD, i);
5181 if (!(pwsI->name = (String) XtMalloc (1+strlen((char *)string))))
5183 Warning (((char *)GETMESSAGE(62, 27, "Insufficient memory for workspace data")));
5184 ExitWM(WM_ERROR_EXIT_VALUE);
5188 strcpy(pwsI->name, (char *)string);
5192 if (ppchWsNames) XtFree ((char *) ppchWsNames);
5194 } /* END OF FUNCTION ProcessWorkspaceList */
5199 /******************************<->*************************************
5201 * ProcessWorkspaceResources (pWS)
5206 * This function retrieves resources that are workspace specific. If the
5207 * window manager is providing standard behavior then retrieve the limited
5208 * set of resources that don't affect standard behavior and set the
5209 * values of the other resources to the standard values.
5214 * pWS = pointer to workspace data
5219 * pWS = resource data for workspace is set
5224 * o Gets subresources based on workspace name
5226 ******************************<->***********************************/
5229 ProcessWorkspaceResources (WmWorkspaceData *pWS)
5233 * Retrieve workspace specific resources.
5236 pResWS = pWS; /* save current ws for default processing */
5239 if (wmGD.useStandardBehavior)
5241 XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
5242 pWS->name, pWS->name, wmStdWorkspaceResources,
5243 XtNumber (wmStdWorkspaceResources), NULL, 0);
5246 * Fill in the standard resource values.
5248 * (no code for this right now)
5251 pWS->iconBoxGeometry = NULL;
5256 XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
5257 pWS->name, pWS->name, wmWorkspaceResources,
5258 XtNumber (wmWorkspaceResources), NULL, 0);
5261 /* Dup iconbox geometry, it may be free'd later on. */
5263 if (pWS->iconBoxGeometry)
5265 pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
5271 if (pWS->title == NULL)
5274 * Setup default workspace title
5276 pWS->title = XmStringCreateLocalized(pWS->name);
5281 * Copy resource just in case there's a duplicate
5282 * Duplicates point to the same data, freeing on
5283 * rename can cause a crash.
5285 pWS->title = XmStringCopy(pWS->title);
5290 * Dup iconbox geometry, it may be free'd later on.
5292 if (pWS->iconBoxGeometry)
5294 pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
5298 * Get backdrop resources
5300 XtGetSubresources (pWS->workspaceTopLevelW,
5301 (XtPointer) &(pWS->backdrop),
5302 WmNbackdrop, WmCBackdrop, wmBackdropResources,
5303 XtNumber (wmBackdropResources), NULL, 0);
5305 ProcessBackdropResources (pWS, 0);
5308 } /* END OF FUNCTION ProcessWorkspaceResources */
5312 /******************************<->*************************************
5314 * ProcessPresenceResources (pSD)
5319 * This function retrieves resources for the workspace presence
5324 * pSD = pointer to screen data
5329 * pSD = resource data for workspace presence dialog are set
5334 * o Gets subresources
5336 ******************************<->***********************************/
5339 ProcessPresenceResources (WmScreenData *pSD)
5341 #ifndef NO_MESSAGE_CATALOG
5342 static char *default_ws_pres_title = NULL;
5344 static char *default_ws_pres_title = "Workspace Presence";
5348 unsigned char *pch1, *pch2;
5350 #ifndef NO_MESSAGE_CATALOG
5352 * Set up localized default title string on initial time through
5354 if (default_ws_pres_title == NULL)
5358 * catgets returns a pointer to an area that is over written
5359 * on each call to catgets.
5362 tmpString = ((char *)GETMESSAGE(62, 59, "Occupy Workspace"));
5363 if ((default_ws_pres_title =
5364 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
5366 Warning (((char *)GETMESSAGE(62, 31, "Insufficient memory for local message string")));
5367 default_ws_pres_title = "Occupy Workspace";
5371 strcpy(default_ws_pres_title, tmpString);
5376 if (pSD->presence.shellW)
5378 XtGetSubresources (pSD->presence.shellW, (XtPointer) &pSD->presence,
5379 WmNworkspacePresence, WmCWorkspacePresence,
5380 wmWsPresenceResources,
5381 XtNumber (wmWsPresenceResources), NULL, 0);
5385 if (pSD->presence.title)
5387 pch1 = (unsigned char *)
5388 WmXmStringToString (pSD->presence.title);
5390 if (pch1 && (pch2 = (unsigned char *)
5391 XtMalloc (1+strlen((char *)pch1))))
5393 strcpy ((char *)pch2, (char *)pch1);
5399 pch2 = (unsigned char *) default_ws_pres_title;
5403 XtSetArg (args[n], XmNtitle, pch2); n++;
5404 XtSetValues (pSD->presence.shellW, args, n);
5407 } /* END OF FUNCTION ProcessPresenceResources */
5411 /*************************************<->*************************************
5413 * ProcessClientResources (pCD)
5418 * This function retrieves resources that are client specific. If the
5419 * window manager is providing standard behavior then retrieve the limited
5420 * set of resources that don't affect standard behavior and set the
5421 * values of the other resources to the standard values.
5426 * pCD = pointer to client data
5431 * pCD = resource data for client is set
5436 * o Gets subresources based on client name and class.
5437 * o Creates GC for the client Matte, if there is one.
5439 *************************************<->***********************************/
5442 ProcessClientResources (ClientData *pCD)
5446 WmScreenData *pSD = pCD->pSD;
5449 * Retrieve basic client specific resources.
5452 _pCD = pCD; /* save in static global for dynamic default processing */
5453 clientName = (pCD->clientName) ? pCD->clientName : WmNdefaults;
5454 clientClass = (pCD->clientClass) ? pCD->clientClass : WmNdefaults;
5456 if (wmGD.useStandardBehavior)
5458 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5459 clientClass, wmStdClientResources, XtNumber (wmStdClientResources),
5463 * Fill in the standard resource values.
5466 SetStdClientResourceValues (pCD);
5470 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5471 clientClass, wmClientResources, XtNumber (wmClientResources), NULL,
5475 #ifdef NO_MESSAGE_CATALOG
5477 * If (window menu spec is not found) then use the builtin
5481 if ((pCD->systemMenu == defaultSystemMenuName) &&
5482 (pSD->defaultSystemMenuUseBuiltin == TRUE))
5484 pCD->systemMenu = builtinSystemMenuName;
5489 * If the client decorations or client functions have been defaulted
5490 * fix up the fields in the ProcessMwmHints function.
5494 /* make top and bottom shadow pixmaps */
5496 if (pCD->iconImageBottomShadowPStr)
5498 if ((pCD->iconImageBottomShadowPStr ==
5499 pSD->iconAppearance.bottomShadowPStr) &&
5500 (pCD->iconImageBottomShadowColor ==
5501 pSD->iconAppearance.bottomShadowColor) &&
5502 (pCD->iconImageBackground ==
5503 pSD->iconAppearance.background))
5505 pCD->iconImageBottomShadowPixmap =
5506 pSD->iconAppearance.bottomShadowPixmap;
5510 pCD->iconImageBottomShadowPixmap =
5511 XmGetPixmap ( ScreenOfDisplay (DISPLAY,
5513 pCD->iconImageBottomShadowPStr,
5514 pCD->iconImageBottomShadowColor,
5515 pCD->iconImageBackground);
5517 if (pCD->iconImageBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
5519 pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
5525 pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
5528 if (pCD->iconImageTopShadowPStr)
5530 if ((pCD->iconImageTopShadowPStr ==
5531 pSD->iconAppearance.topShadowPStr) &&
5532 (pCD->iconImageTopShadowColor ==
5533 pSD->iconAppearance.topShadowColor) &&
5534 (pCD->iconImageBackground == pSD->iconAppearance.background))
5536 pCD->iconImageTopShadowPixmap =
5537 pSD->iconAppearance.topShadowPixmap;
5541 pCD->iconImageTopShadowPixmap =
5542 XmGetPixmap ( ScreenOfDisplay (DISPLAY,
5544 pCD->iconImageTopShadowPStr,
5545 pCD->iconImageTopShadowColor,
5546 pCD->iconImageBackground);
5548 if (pCD->iconImageTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
5550 pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
5556 pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
5559 if ((pCD->internalBevel < MIN_INTERNAL_BEVEL) ||
5560 (pCD->internalBevel > MAX_INTERNAL_BEVEL))
5562 pCD->internalBevel = MAX_INTERNAL_BEVEL;
5567 * Retrieve matte resources and make internal matte resources.
5570 if (pCD->matteWidth > 0)
5572 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5573 clientClass, wmClientResourcesM, XtNumber (wmClientResourcesM),
5576 /* make top and bottom shadow pixmaps */
5579 if (pCD->matteBottomShadowPStr &&
5580 (!strcmp(pCD->matteBottomShadowPStr, _NoDither)))
5582 pCD->matteBottomShadowPStr = NULL;
5585 if (pCD->matteBottomShadowPStr)
5587 if ((pCD->matteBottomShadowPStr ==
5588 pSD->clientAppearance.bottomShadowPStr) &&
5589 (pCD->matteBottomShadowColor ==
5590 pSD->clientAppearance.bottomShadowColor) &&
5591 (pCD->matteBackground == pSD->clientAppearance.background))
5593 pCD->matteBottomShadowPixmap =
5594 pSD->clientAppearance.bottomShadowPixmap;
5598 pCD->matteBottomShadowPixmap =
5599 XmGetPixmap (ScreenOfDisplay (DISPLAY,
5601 pCD->matteBottomShadowPStr,
5602 pCD->matteBottomShadowColor,
5603 pCD->matteBackground);
5605 if (pCD->matteBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
5607 pCD->matteBottomShadowPixmap = (Pixmap)NULL;
5613 pCD->matteBottomShadowPixmap = (Pixmap)NULL;
5617 if (pCD->matteTopShadowPStr &&
5618 (!strcmp(pCD->matteTopShadowPStr, _NoDither)))
5620 pCD->matteTopShadowPStr = NULL;
5623 if (pCD->matteTopShadowPStr)
5625 if ((pCD->matteTopShadowPStr ==
5626 pSD->clientAppearance.topShadowPStr) &&
5627 (pCD->matteTopShadowColor ==
5628 pSD->clientAppearance.topShadowColor) &&
5629 (pCD->matteBackground == pSD->clientAppearance.background))
5631 pCD->matteTopShadowPixmap =
5632 pSD->clientAppearance.topShadowPixmap;
5636 pCD->matteTopShadowPixmap =
5637 XmGetPixmap (ScreenOfDisplay (DISPLAY,
5639 pCD->matteTopShadowPStr,
5640 pCD->matteTopShadowColor,
5641 pCD->matteBackground);
5643 if (pCD->matteTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
5645 pCD->matteTopShadowPixmap = (Pixmap)NULL;
5651 pCD->matteTopShadowPixmap = (Pixmap)NULL;
5655 /* make top and bottom shadow GC's */
5657 pCD->clientMatteTopShadowGC = GetHighlightGC (pCD->pSD,
5658 pCD->matteTopShadowColor,
5659 pCD->matteBackground,
5660 pCD->matteTopShadowPixmap);
5662 pCD->clientMatteBottomShadowGC = GetHighlightGC (pCD->pSD,
5663 pCD->matteBottomShadowColor,
5664 pCD->matteBackground,
5665 pCD->matteBottomShadowPixmap);
5668 } /* END OF FUNCTION ProcessClientResources */
5672 /*************************************<->*************************************
5674 * SetStdClientResourceValues (pCD)
5679 * This function sets client resource data to standard values. This setting
5680 * is done in place of getting the values from the user settings in
5681 * the resource database.
5685 * pCD = pointer to the client data
5690 * pCD = (client data filled out with resource values)
5692 *************************************<->***********************************/
5695 SetStdClientResourceValues (ClientData *pCD)
5697 pCD->clientDecoration = WM_DECOR_DEFAULT;
5698 pCD->clientFunctions = WM_FUNC_DEFAULT;
5699 pCD->focusAutoRaise = True;
5700 pCD->systemMenu = builtinSystemMenuName;
5701 pCD->usePPosition = USE_PPOSITION_NONZERO;
5702 pCD->ignoreWMSaveHints = True;
5704 } /* END OF FUNCTION SetStdClientResourceValues */
5708 /******************************<->*************************************
5710 * SetStdScreenResourceValues (pSD)
5715 * This function sets screen resource data to standard values. This setting
5716 * is done in place of getting the values from the user settings in
5717 * the resource database.
5721 * pSD = pointer to the screen data
5726 * pSD = (screen data filled out with resource values)
5728 ******************************<->***********************************/
5731 SetStdScreenResourceValues (WmScreenData *pSD)
5733 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
5734 pSD->rootMenu = builtinRootMenuName;
5735 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
5736 pSD->buttonBindings = builtinButtonBindingsName;
5737 pSD->cleanText = True;
5738 pSD->iconDecoration =
5739 (ICON_LABEL_PART | ICON_IMAGE_PART | ICON_ACTIVE_LABEL_PART);
5740 pSD->iconPlacement =
5741 (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY);
5742 pSD->keyBindings = builtinKeyBindingsName;
5743 pSD->limitResize = True;
5744 pSD->resizeCursors = True;
5745 pSD->transientDecoration = (WM_DECOR_SYSTEM | WM_DECOR_RESIZEH);
5746 pSD->transientFunctions =
5747 (WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE |
5749 pSD->useIconBox = False;
5751 pSD->feedbackGeometry = NULL;
5752 pSD->moveOpaque = False;
5754 } /* END OF FUNCTION SetStdScreenResourceValues */
5757 /*************************************<->*************************************
5759 * GetHighlightGC (pSD, fg, bg, pixmap)
5764 * Get a graphic context for either drawing top- or bottom-shadow
5770 * pSD = pointer to screen data
5771 * fg = foreground color
5772 * bg = background color
5773 * pixmap = pixmap for highlight
5777 * RETRUN = GC with the input parameters incorporated.
5779 *************************************<->***********************************/
5781 GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap)
5787 mask = GCForeground | GCBackground | GCLineWidth | GCFillStyle;
5788 gcv.background = bg;
5789 gcv.foreground = fg;
5794 mask |= GCFillStyle | GCTile;
5795 gcv.fill_style = FillTiled;
5800 gcv.fill_style = FillSolid;
5805 * NOTE: If additional mask bits are added, modify WmGetGC()
5806 * in WmGraphics.c to check those values for matches.
5809 return (WmGetGC (pSD, mask, &gcv));
5810 #endif /* OLD_CODE */
5812 return (XtGetGC (pSD->screenTopLevelW, mask, &gcv));
5814 } /* END OF FUNCTION GetHighlightGC */
5818 /*************************************<->*************************************
5820 * _WmGetDynamicDefault (widget, type, defaultColor, newBackground, value)
5825 * This function is used to generate a default color of the requested
5826 * type. Default colors are generated for a 3-D appearance.
5831 * widget = this is the widget that is associated with the resource or
5832 * that is the reference widget for the wm subpart.
5834 * type = this is the type of color resource (e.g., top shadow color).
5836 * defaultColor = pointer to default color name/specification.
5838 * newBackground = background pixel for generating 3-D colors.
5843 * value = pointer to the XrmValue in which to store the color
5845 *************************************<->***********************************/
5848 _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value)
5850 static Screen *oldScreen = NULL;
5851 static Screen *newScreen;
5852 static Colormap oldColormap;
5853 static Colormap newColormap;
5854 static Pixel newValue;
5855 static Pixel background;
5856 static String oldDefaultColor = DEFAULT_COLOR_NONE;
5857 static XmColorData colorData;
5859 /* initialize the return value */
5861 value->size = sizeof (newValue);
5862 value->addr = (char *)&newValue;
5866 * Process monochrome defaults first.
5869 newScreen = XtScreen (widget);
5871 if (Monochrome (newScreen))
5876 * Check color server sets for this screen.
5878 if (wmGD.statusColorServer == CSERVE_NORMAL)
5883 for (i = 0; i < wmGD.numScreens; i++)
5885 if (XScreenNumberOfScreen(newScreen) == wmGD.Screens[i].screen)
5887 pSD = &wmGD.Screens[i];
5896 for (i = 0; i < XmCO_MAX_NUM_COLORS; i++)
5898 if (pSD->pPixelData[i].bg == newBackground)
5902 case WmFGC: newValue = pSD->pPixelData[i].fg; break;
5903 case WmBGC: newValue = pSD->pPixelData[i].bg; break;
5904 case WmTSC: newValue = pSD->pPixelData[i].ts; break;
5905 case WmBSC: newValue = pSD->pPixelData[i].bs; break;
5919 case WmFGC: newValue = BlackPixelOfScreen (newScreen); break;
5920 case WmBGC: newValue = WhitePixelOfScreen (newScreen); break;
5921 case WmTSC: newValue = WhitePixelOfScreen (newScreen); break;
5922 case WmBSC: newValue = BlackPixelOfScreen (newScreen); break;
5932 * Check to see if appropriate colors are available from the
5933 * previous request; if the color is a background color then get
5934 * default colors. Generate 3-D colors if necessary. Maintain
5935 * new colors in static variables for later reuse.
5938 newColormap = widget->core.colormap;
5940 if ((oldScreen != NULL) && (oldScreen == newScreen) &&
5941 (oldColormap == newColormap) && (type != WmBGC) &&
5942 (background == newBackground))
5945 else if ((oldScreen == newScreen) && (oldColormap == newColormap) &&
5946 (type == WmBGC) && (oldDefaultColor == defaultColor))
5949 else if (type == WmBGC)
5952 * Find or generate a background color and associated 3-D colors.
5955 oldDefaultColor = defaultColor;
5957 * Fix for CR 5152 - Due to the use of Realloc in the color caches,
5958 * a static pointer is not acceptable. Change it
5959 * to a static structure to maintain the data
5961 colorData = *_WmGetDefaultColors (newScreen, newColormap, defaultColor);
5966 * Find or generate a color based on the associated background color.
5969 oldDefaultColor = DEFAULT_COLOR_NONE;
5970 background = newBackground;
5972 XmGetColors(newScreen, newColormap, background,
5973 &colorData.foreground.pixel,
5974 &colorData.top_shadow.pixel,
5975 &colorData.bottom_shadow.pixel,
5976 &colorData.select.pixel);
5979 oldScreen = newScreen;
5980 oldColormap = newColormap;
5984 * Set up the return value.
5987 colorData.allocated |= type;
5990 case XmBACKGROUND: newValue = colorData.background.pixel; break;
5991 case XmFOREGROUND: newValue = colorData.foreground.pixel; break;
5992 case XmTOP_SHADOW: newValue = colorData.top_shadow.pixel; break;
5993 case XmBOTTOM_SHADOW: newValue = colorData.bottom_shadow.pixel; break;
5994 case XmSELECT: newValue = colorData.select.pixel; break;
5995 default: newValue = colorData.background.pixel; break;
5998 } /* END OF FUNCTION _WmGetDynamicDefault */
6002 /*************************************<->*************************************
6004 * _WmGetDefaultColors (screen, colormap, defaultColor)
6009 * This function is used to find or generate default 3-D colors based on a
6010 * default background color.
6015 * screen = screen for which colors are to be generated.
6017 * colormap = colormap that is to be used to make colors.
6019 * defaultColor = pointer to a default color name/specification.
6024 * RETURN = pointer to WmColorData structure containing 3-D colors.
6026 *************************************<->***********************************/
6028 XmColorData * _WmGetDefaultColors (screen, colormap, defaultColor)
6031 String defaultColor;
6034 static XmColorData *defaultSet[2] = {NULL, NULL};
6035 static int defaultCount[2] = {0, 0};
6036 static int defaultSize[2] = {0, 0};
6038 register XmColorData *set;
6042 Display *display = DisplayOfScreen (screen);
6046 * Fix for CR 5152 - Due to the use of Realloc with _XmGetColors, it is
6047 * necessary to maintain a separate cache of color
6048 * data. The Realloc may cause the data to be moved,
6049 * and the cache would contain pointers into the heap.
6053 * Look through the cache to see if the defaults are already in the
6054 * cache. There is a list of cached defaults for each default color.
6057 if (defaultColor == _defaultColor2)
6066 set = defaultSet[setId];
6067 count = defaultCount[setId];
6068 size = defaultSize[setId];
6070 for (i = 0; i < count; i++)
6072 if (((set + i)->screen == screen) && ((set + i)->color_map == colormap))
6079 * No match in the cache, make a new entry and generate the colors.
6084 size = (defaultSize[setId] += 10);
6085 set = defaultSet[setId] =
6086 (XmColorData *)WmRealloc ((char *) defaultSet[setId],
6087 sizeof (XmColorData) * size);
6091 * Make the default background color for the resource set.
6094 if(!XParseColor (display, colormap, defaultColor, &colorDef))
6096 if(!(strcmp(defaultColor, _defaultColor1)))
6098 XParseColor (display, colormap, _defaultColor1HEX, &colorDef);
6102 XParseColor (display, colormap, _defaultColor2HEX, &colorDef);
6106 XAllocColor (display, colormap, &colorDef);
6110 * Generate the 3-D colors and save them in the defaults cache.
6113 XmGetColors(screen, colormap, colorDef.pixel,
6114 &set[count].foreground.pixel,
6115 &set[count].top_shadow.pixel,
6116 &set[count].bottom_shadow.pixel,
6117 &set[count].select.pixel);
6119 set[count].background.pixel = colorDef.pixel;
6121 set[count].screen = screen;
6122 set[count].color_map = colormap;
6123 set[count].allocated = True;
6125 XQueryColor(DISPLAY, colormap, &(set[count].background));
6126 XQueryColor(DISPLAY, colormap, &(set[count].foreground));
6127 XQueryColor(DISPLAY, colormap, &(set[count].top_shadow));
6128 XQueryColor(DISPLAY, colormap, &(set[count].bottom_shadow));
6129 XQueryColor(DISPLAY, colormap, &(set[count].select));
6131 (defaultCount[setId])++;
6133 return (set + count);
6136 } /* END OF FUNCTION _WmGetDefaultColors */
6140 /*************************************<->*************************************
6142 * WmRealloc (ptr, size)
6147 * This function is used reallocate a block of storage that has been
6153 * ptr = pointer to storage that is to be realloc'ed; if NULL malloc an
6154 * initial block of storage.
6156 * size = size of new storage
6160 * RETURN = pointer to realloc'ed block of storage
6162 *************************************<->***********************************/
6164 char * WmRealloc (ptr, size)
6171 ptr = (char *)XtRealloc (ptr, size);
6175 ptr = (char *)XtMalloc (size);
6180 Warning (((char *)GETMESSAGE(62, 37, "Insufficient memory for window manager data")));
6185 } /* END OF FUNCTION WmRealloc */
6189 /*************************************<->*************************************
6191 * WmMalloc (ptr, size)
6196 * This function is used malloc a block of storage. If a previous block
6197 * of storage is being replace the old block is free'd.
6202 * ptr = pointer to storage that is to be replaced (free'd).
6204 * size = size of new storage
6208 * RETURN = pointer to malloc'ed block of storage
6210 *************************************<->***********************************/
6212 char * WmMalloc (ptr, size)
6222 ptr = (char *)XtMalloc (size);
6226 Warning (((char *)GETMESSAGE(62, 38, "Insufficient memory for window manager data")));
6231 } /* END OF FUNCTION WmMalloc */
6235 /*************************************<->*************************************
6237 * SetupDefaultResources (pSD)
6242 * This function is used to setup default (builtin) resources for the
6248 * pSD = pointer to screen data
6249 * wmGD = (defaultKeyBindingsString, ...)
6251 * builtinKeyBindingsName = name of default key bindings set
6258 *************************************<->***********************************/
6261 SetupDefaultResources (pSD)
6266 KeySpec *nextKeySpec;
6272 * If (using DefaultBindings mechanism and bindings are not found in .mwmrc)
6273 * then use the builtin bindings.
6275 if (!pSD->keySpecs && !wmGD.useStandardBehavior)
6278 * Print warning if user is NOT using "DefaultKeyBindings".
6280 if (strcmp (pSD->keyBindings, defaultKeyBindingsName))
6282 MWarning (((char *)GETMESSAGE(62, 67, "Key bindings %s not found, using builtin key bindings\n")),
6285 pSD->keyBindings = builtinKeyBindingsName;
6288 if (!pSD->buttonSpecs && !wmGD.useStandardBehavior)
6291 * Print warning if user is NOT using "DefaultButtonBindings".
6293 if (strcmp (pSD->buttonBindings, defaultButtonBindingsName))
6295 MWarning (((char *)GETMESSAGE(62, 68, "Button bindings %s not found, using builtin button bindings\n")),
6296 pSD->buttonBindings);
6298 pSD->buttonBindings = builtinButtonBindingsName;
6301 if (pSD->keyBindings == builtinKeyBindingsName)
6304 * Default key specifications are to be used and no default
6305 * set has been provided by the user. Make the built-in default
6309 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
6311 * Before parsing the string, substitute the real name for
6312 * the default rootmenu using the resource rootMenu
6313 * for the %s in the string.
6318 buffer = (char *) XtMalloc(strlen(builtinKeyBindings) +
6319 strlen(pSD->rootMenu) + 1);
6320 sprintf(buffer, builtinKeyBindings, pSD->rootMenu);
6322 ParseKeyStr (pSD, (unsigned char *)buffer);
6324 ParseKeyStr (pSD, (unsigned char *)builtinKeyBindings);
6325 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
6330 * Add the switch behavior key binding to the front of the list
6331 * of user specified key bindings that have been parsed.
6334 nextKeySpec = pSD->keySpecs;
6335 keyBindings = pSD->keyBindings;
6336 pSD->keyBindings = behaviorKeyBindingName;
6337 pSD->keySpecs = NULL;
6339 ParseKeyStr (pSD, (unsigned char *)behaviorKeyBindings);
6343 /* Skip past the TWO key definitions (1.2 & 1.1.4) */
6344 pSD->keySpecs->nextKeySpec->nextKeySpec = nextKeySpec;
6348 pSD->keySpecs = nextKeySpec;
6350 pSD->keyBindings = keyBindings;
6353 if (pSD->buttonBindings == builtinButtonBindingsName)
6356 * Default button specifications are to be used and no default
6357 * set has been provided by the user. Make the built-in default
6361 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
6363 * Before parsing the string, substitute the real name for
6364 * the default rootmenu using the resource rootMenu
6365 * for the %s in the string.
6370 buffer = (char *) XtMalloc(strlen(builtinButtonBindings) +
6371 strlen(pSD->rootMenu) + 1);
6372 sprintf(buffer, builtinButtonBindings, pSD->rootMenu);
6374 ParseButtonStr (pSD, (unsigned char *)buffer);
6376 ParseButtonStr (pSD, (unsigned char *)builtinButtonBindings);
6377 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
6380 #ifdef NO_MESSAGE_CATALOG
6382 * Set defaultSystemMenuUseBuiltin to FALSE if DefaultWindowMenu spec
6386 menuSpec = pSD->menuSpecs;
6389 if (!strcmp(menuSpec->name, defaultSystemMenuName))
6391 pSD->defaultSystemMenuUseBuiltin = FALSE;
6394 menuSpec = menuSpec->nextMenuSpec;
6398 } /* END OF FUNCTION SetupDefaultResources */
6402 /*************************************<->*************************************
6404 * SimilarAppearanceData (pAD1, pAD2)
6409 * This function returns True if the two passed sets of AppearanceData
6410 * are similar. This is designed to compare appearance data before
6411 * creation of the GCs.
6416 * pAD1 pointer to AppearanceData 1
6417 * pAD2 pointer to AppearanceData 2
6422 * Function returns True if similar, False otherwise.
6426 * This function is only used to compare the client
6427 * and client*title appearance data.
6428 *************************************<->***********************************/
6430 Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2)
6435 if ((pAD1->fontList == pAD2->fontList) &&
6436 (pAD1->background == pAD2->background) &&
6437 (pAD1->foreground == pAD2->foreground) &&
6438 (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
6439 (pAD1->backgroundPixmap == pAD2->backgroundPixmap) &&
6440 (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
6441 (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
6442 (pAD1->bottomShadowPixmap == pAD2->bottomShadowPixmap) &&
6443 (pAD1->topShadowColor == pAD2->topShadowColor) &&
6444 (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
6445 (pAD1->topShadowPixmap == pAD2->topShadowPixmap) &&
6446 (pAD1->activeBackground == pAD2->activeBackground) &&
6447 (pAD1->activeForeground == pAD2->activeForeground) &&
6448 (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
6449 (pAD1->activeBackgroundPixmap == pAD2->activeBackgroundPixmap) &&
6450 (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
6451 (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
6452 (pAD1->activeBottomShadowPixmap == pAD2->activeBottomShadowPixmap) &&
6453 (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
6454 (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) &&
6455 (pAD1->activeTopShadowPixmap == pAD2->activeTopShadowPixmap) )
6458 * !!! Should find out why all the Pixmap resources are unset !!!
6461 if ((pAD1->fontList == pAD2->fontList) &&
6462 (pAD1->background == pAD2->background) &&
6463 (pAD1->foreground == pAD2->foreground) &&
6464 (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
6465 (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
6466 (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
6467 (pAD1->topShadowColor == pAD2->topShadowColor) &&
6468 (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
6469 (pAD1->activeBackground == pAD2->activeBackground) &&
6470 (pAD1->activeForeground == pAD2->activeForeground) &&
6471 (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
6472 (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
6473 (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
6474 (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
6475 (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) )
6487 } /* END OF FUNCTION SimilarAppearanceData */
6491 /*************************************<->*************************************
6493 * Monochrome (screen)
6498 * This function returns True if the screen passed it to be treated
6499 * as monochrome for the purpose of assigning default resources.
6504 * screen pointer to Screen
6509 * Function returns True if monochrome (or Static Gray), False otherwise.
6511 *************************************<->***********************************/
6514 Monochrome (Screen *screen)
6520 if (wmGD.statusColorServer == CSERVE_NORMAL)
6522 for (scr = 0; scr < wmGD.numScreens; scr++)
6524 pSD = &(wmGD.Screens[scr]);
6528 if (XScreenOfDisplay (DISPLAY, pSD->screen) == screen)
6530 if (pSD->colorUse == XmCO_BLACK_WHITE)
6543 * If we don't know the answer to our question by now,
6544 * fall back to the old mwm way of determining monochromicity.
6548 return ((DefaultDepthOfScreen(screen) == 1));
6549 } /* END OF FUNCTION Monochrome */
6552 /**************************** eof ***************************/