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),
856 (XtPointer)KEYBOARD_FOCUS_POINTER
858 (XtPointer)KEYBOARD_FOCUS_EXPLICIT
867 XtOffsetOf(WmGlobalData, lowerOnIconify),
874 WmNmarqueeSelectGranularity,
875 WmCMarqueeSelectGranularity,
878 XtOffsetOf(WmGlobalData, marqueeSelectGranularity),
889 XtOffsetOf(WmGlobalData, moveThreshold),
899 XtOffsetOf(WmGlobalData, passButtons),
909 XtOffsetOf(WmGlobalData, passSelectButton),
919 XtOffsetOf(WmGlobalData, positionIsFrame),
929 XtOffsetOf(WmGlobalData, positionOnScreen),
939 XtOffsetOf(WmGlobalData, quitTimeout),
949 XtOffsetOf(WmGlobalData, raiseKeyFocus),
956 WmNrefreshByClearing,
957 WmCRefreshByClearing,
960 XtOffsetOf(WmGlobalData, refreshByClearing),
970 XtOffsetOf(WmGlobalData, rootButtonClick),
982 XtOffsetOf(WmGlobalData, sessionClientDB),
993 XtOffsetOf(WmGlobalData, showFeedback),
995 (XtPointer)(WM_SHOW_FB_DEFAULT)
1003 XtOffsetOf(WmGlobalData, startupKeyFocus),
1009 WmNsystemButtonClick,
1010 WmCSystemButtonClick,
1013 XtOffsetOf(WmGlobalData, systemButtonClick),
1019 WmNsystemButtonClick2,
1020 WmCSystemButtonClick2,
1023 XtOffsetOf(WmGlobalData, systemButtonClick2),
1027 #if defined(PANELIST)
1033 XtOffsetOf(WmGlobalData, useFrontPanel),
1037 #endif /* PANELIST */
1044 XtOffsetOf(WmGlobalData, helpDirectory),
1046 (XtPointer)"DT/Dtwm/"
1056 XtOffsetOf(WmGlobalData, dtLite),
1060 #endif /* MINIMAL_DT */
1061 }; /* END OF wmGlobalResources[] */
1065 * These determine the screens to manage at startup.
1066 * These are broken out to enhance startup performance.
1068 XtResource wmGlobalScreenResources[] =
1075 XtOffsetOf(WmGlobalData, multiScreen),
1089 XtOffsetOf(WmGlobalData, screenList),
1094 { WmNbackdropDirectories,
1095 WmCBackdropDirectories,
1098 XtOffsetOf(WmGlobalData, backdropDirs),
1100 DEFAULT_BACKDROP_DIR
1107 /******************************<->*************************************
1109 * wmStdGlobalResources
1114 * This data structure is used in the processing of mwm general appearance
1115 * and behavior resources that are not automatically set for the standard
1116 * (default) behavior. These resources are specified with the following
1119 * "Mwm*<resource_identifier>".
1121 ******************************<->***********************************/
1123 XtResource wmStdGlobalResources[] =
1131 XtOffsetOf(WmGlobalData, bitmapDirectory),
1133 (XtPointer)BITMAPDIR
1141 XtOffsetOf(WmGlobalData, configFile),
1150 sizeof (FrameStyle),
1151 XtOffsetOf(WmGlobalData, frameStyle),
1153 (XtPointer)WmRECESSED
1161 XtOffsetOf(WmGlobalData, iconAutoPlace),
1171 XtOffsetOf(WmGlobalData, moveThreshold),
1181 XtOffsetOf(WmGlobalData, positionIsFrame),
1187 WmNpositionOnScreen,
1188 WmCPositionOnScreen,
1191 XtOffsetOf(WmGlobalData, positionOnScreen),
1201 XtOffsetOf(WmGlobalData, quitTimeout),
1211 XtOffsetOf(WmGlobalData, showFeedback),
1213 (XtPointer)(WM_SHOW_FB_DEFAULT)
1219 /******************************<->*************************************
1226 * This data structure is used in the processing of mwm screen specific
1227 * appearance and behavior resources. These resources are specified
1228 * with the following syntax:
1230 * "Mwm*screen<#>*<resource_identifier>".
1232 ******************************<->***********************************/
1234 XtResource wmScreenResources[] =
1241 XtOffsetOf (WmScreenData, buttonBindings),
1243 (XtPointer)defaultButtonBindingsName
1251 XtOffsetOf (WmScreenData, cleanText),
1257 WmNfeedbackGeometry,
1258 WmCFeedbackGeometry,
1261 XtOffsetOf (WmScreenData, feedbackGeometry),
1271 XtOffsetOf (WmScreenData, fadeNormalIcon),
1281 XtOffsetOf (WmScreenData, iconDecoration),
1283 (XtPointer)USE_ICON_DEFAULT_APPEARANCE
1288 WmNiconImageMaximum,
1289 WmCIconImageMaximum,
1292 XtOffsetOf (WmScreenData, iconImageMaximum),
1294 (XtPointer) _WmIconImageMaximumDefault
1298 WmNiconImageMaximum,
1299 WmCIconImageMaximum,
1302 XtOffsetOf (WmScreenData, iconImageMaximum),
1309 WmNiconImageMinimum,
1310 WmCIconImageMinimum,
1313 XtOffsetOf (WmScreenData, iconImageMinimum),
1323 XtOffsetOf (WmScreenData, iconPlacement),
1325 (XtPointer)(ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY)
1329 WmNiconPlacementMargin,
1330 WmCIconPlacementMargin,
1333 XtOffsetOf (WmScreenData, iconPlacementMargin),
1343 XtOffsetOf (WmScreenData, keyBindings),
1345 (XtPointer)defaultKeyBindingsName
1349 WmNframeBorderWidth,
1350 WmCFrameBorderWidth,
1353 XtOffsetOf (WmScreenData, frameBorderWidth),
1364 XtOffsetOf (WmScreenData, iconBoxGeometry),
1375 XtOffsetOf (WmScreenData, iconBoxName),
1377 (XtPointer)"iconbox"
1381 WmNiconBoxSBDisplayPolicy,
1382 WmCIconBoxSBDisplayPolicy,
1385 XtOffsetOf (WmScreenData, iconBoxSBDisplayPolicy),
1395 XtOffsetOf (WmScreenData, iconBoxScheme),
1405 XtOffsetOf (WmScreenData, iconBoxTitle),
1415 XtOffsetOf (WmScreenData, limitResize),
1421 WmNmaximumMaximumSize,
1422 WmCMaximumMaximumSize,
1425 XtOffsetOf (WmScreenData, maximumMaximumSize),
1431 WmNresizeBorderWidth,
1432 WmCFrameBorderWidth,
1435 XtOffsetOf (WmScreenData, resizeBorderWidth),
1445 XtOffsetOf (WmScreenData, resizeCursors),
1450 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
1456 XtOffsetOf (WmScreenData, rootMenu),
1458 (XtPointer)builtinRootMenuName
1460 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
1463 WmNtransientDecoration,
1464 WmCTransientDecoration,
1467 XtOffsetOf (WmScreenData, transientDecoration),
1469 (XtPointer)(WM_DECOR_SYSTEM | WM_DECOR_RESIZEH)
1473 WmNtransientFunctions,
1474 WmCTransientFunctions,
1477 XtOffsetOf (WmScreenData, transientFunctions),
1479 (XtPointer)(WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE))
1484 WmNsubpanelDecoration,
1485 WmCSubpanelDecoration,
1488 XtOffsetOf (WmScreenData, subpanelDecoration),
1490 (XtPointer)(WM_DECOR_SYSTEM)
1494 WmNsubpanelResources,
1495 WmCSubpanelResources,
1498 XtOffsetOf (WmScreenData, subpanelResources),
1502 #endif /* PANELIST */
1509 XtOffsetOf (WmScreenData, useIconBox),
1519 XtOffsetOf (WmScreenData, moveOpaque),
1531 XtOffsetOf (WmScreenData, helpResources),
1537 WmNinitialWorkspace,
1538 WmCInitialWorkspace,
1541 XtOffsetOf (WmScreenData, initialWorkspace),
1551 XtOffsetOf (WmScreenData, workspaceList),
1561 XtOffsetOf (WmScreenData, numWorkspaces),
1570 /******************************<->*************************************
1572 * wmStdScreenResources
1577 * This data structure is used in the processing of mwm screen specific
1578 * appearance and behavior resources that are not automatically set for
1579 * the standard (default) behavior. These resources are specified with
1580 * the following syntax:
1582 * "Mwm*screen<#>*<resource_identifier>".
1584 ******************************<->***********************************/
1586 XtResource wmStdScreenResources[] =
1589 WmNframeBorderWidth,
1590 WmCFrameBorderWidth,
1593 XtOffsetOf (WmScreenData, frameBorderWidth),
1600 WmNiconImageMaximum,
1601 WmCIconImageMaximum,
1604 XtOffsetOf (WmScreenData, iconImageMaximum),
1606 (XtPointer) _WmIconImageMaximumDefault
1610 WmNiconImageMaximum,
1611 WmCIconImageMaximum,
1614 XtOffsetOf (WmScreenData, iconImageMaximum),
1621 WmNiconImageMinimum,
1622 WmCIconImageMinimum,
1625 XtOffsetOf (WmScreenData, iconImageMinimum),
1631 WmNiconPlacementMargin,
1632 WmCIconPlacementMargin,
1635 XtOffsetOf (WmScreenData, iconPlacementMargin),
1641 WmNmaximumMaximumSize,
1642 WmCMaximumMaximumSize,
1645 XtOffsetOf (WmScreenData, maximumMaximumSize),
1651 WmNresizeBorderWidth,
1652 WmCFrameBorderWidth,
1655 XtOffsetOf (WmScreenData, resizeBorderWidth),
1663 /******************************<->*************************************
1665 * wmWorkspaceResources
1670 * This data structure is used in the processing of mwm workspace
1671 * specific appearance and behavior resources. These resources are
1672 * specified with the following syntax:
1674 * "Mwm*[screen<#>*]<workspace>*<resource_identifier>".
1676 ******************************<->***********************************/
1678 XtResource wmWorkspaceResources[] =
1685 XtOffsetOf (WmWorkspaceData, iconBoxGeometry),
1695 XtOffsetOf (WmWorkspaceData, title),
1702 XtResource *wmWorkspaceResources = NULL;
1707 /******************************<->*************************************
1709 * wmStdWorkspaceResources
1714 * This data structure is used in the processing of mwm workspace specific
1715 * appearance and behavior resources that are not automatically set for
1716 * the standard (default) behavior. These resources are specified with
1717 * the following syntax:
1719 * "Mwm*[screen<#>*]<workspace>*<resource_identifier>".
1721 *************************************<->***********************************/
1724 XtResource wmStdWorkspaceResources[] =
1731 XtOffsetOf (WmWorkspaceData, title),
1737 XtResource *wmStdWorkspaceResources = NULL;
1742 /*************************************<->*************************************
1744 * wmBackdropResources
1749 * This data structure is used in the processing of workspace specific
1750 * resources that apply to the backdrop.
1752 * These resources are specified with the following syntax:
1754 * "Mwm*[screen*][workspace*]backdrop*<resource_id>:"
1756 * NOTE: The order of these resources is important for correct
1757 * dynamic processing!!!!
1759 *************************************<->***********************************/
1761 XtResource wmBackdropResources[] =
1768 XtOffsetOf (BackdropData, colorSet),
1770 (XtPointer) _WmBackdropColorSetDefault
1778 XtOffsetOf (BackdropData, background),
1780 (XtPointer) _WmBackdropBgDefault
1788 XtOffsetOf (BackdropData, foreground),
1790 (XtPointer) _WmBackdropFgDefault
1798 XtOffsetOf (BackdropData, image),
1806 /*************************************<->*************************************
1808 * wmWsPresenceResources
1813 * This data structure is used in the processing of specific
1814 * resources that apply to the WorkspacePresence dialog.
1816 * These resources are specified with the following syntax:
1818 * "Mwm*[screen*][workspace*]workspacePresence*<resource_id>:"
1820 *************************************<->***********************************/
1822 XtResource wmWsPresenceResources[] =
1829 XtOffsetOf (WsPresenceData, title),
1837 /*************************************<->*************************************
1844 * This data structure is used in the processing of client specific
1845 * window manager resources. These resources are specified with the
1848 * "Mwm*<client_name_or_class>*<resource_identifier>"
1850 *************************************<->***********************************/
1852 XtResource wmClientResources[] =
1857 WmNabsentMapBehavior,
1858 WmCAbsentMapBehavior,
1859 WmRAbsentMapBehavior,
1861 XtOffsetOf (ClientData, absentMapBehavior),
1863 (XtPointer)(AMAP_BEHAVIOR_ADD)
1867 WmNclientDecoration,
1868 WmCClientDecoration,
1871 XtOffsetOf (ClientData, clientDecoration),
1873 (XtPointer)(WM_DECOR_DEFAULT)
1881 XtOffsetOf (ClientData, clientFunctions),
1883 (XtPointer)(WM_FUNC_DEFAULT)
1891 XtOffsetOf (ClientData, focusAutoRaise),
1893 (XtPointer)_WmFocusAutoRaiseDefault
1901 XtOffsetOf (ClientData, iconImage),
1907 WmNiconImageBackground,
1908 WmCIconImageBackground,
1911 XtOffsetOf (ClientData, iconImageBackground),
1913 (XtPointer)_WmIconImageBDefault
1917 WmNiconImageForeground,
1918 WmCIconImageForeground,
1921 XtOffsetOf (ClientData, iconImageForeground),
1923 (XtPointer)_WmIconImageFDefault
1927 WmNiconImageBottomShadowColor,
1928 WmCIconImageBottomShadowColor,
1931 XtOffsetOf (ClientData, iconImageBottomShadowColor),
1933 (XtPointer)_WmIconImageBSCDefault
1937 WmNiconImageBottomShadowPixmap,
1938 WmCIconImageBottomShadowPixmap,
1941 XtOffsetOf (ClientData, iconImageBottomShadowPStr),
1943 (XtPointer)_WmIconImageBSPDefault
1947 WmNiconImageTopShadowColor,
1948 WmCIconImageTopShadowColor,
1951 XtOffsetOf (ClientData, iconImageTopShadowColor),
1953 (XtPointer)_WmIconImageTSCDefault
1957 WmNiconImageTopShadowPixmap,
1958 WmCIconImageTopShadowPixmap,
1961 XtOffsetOf (ClientData, iconImageTopShadowPStr),
1963 (XtPointer)_WmIconImageTSPDefault
1967 WmNignoreWMSaveHints,
1968 WmCIgnoreWMSaveHints,
1971 XtOffsetOf (ClientData, ignoreWMSaveHints),
1981 XtOffsetOf (ClientData, matteWidth),
1987 WmNmaximumClientSize,
1988 WmCMaximumClientSize,
1991 XtOffsetOf (ClientData, maximumClientSize),
1998 WmNsecondariesOnTop,
1999 WmCSecondariesOnTop,
2002 XtOffsetOf (ClientData, secondariesOnTop),
2004 (XtPointer)_WmSecondariesOnTopDefault
2013 XtOffsetOf (ClientData, systemMenu),
2015 (XtPointer)defaultSystemMenuName
2023 XtOffsetOf (ClientData, useClientIcon),
2037 XtOffsetOf (ClientData, usePPosition),
2039 (XtPointer)(USE_PPOSITION_NONZERO)
2042 }; /* END OF STRUCTURE wmClientResources */
2046 /*************************************<->*************************************
2048 * wmStdClientResources
2053 * This data structure is used in the processing of client specific
2054 * window manager resources that are not automatically set for the standard
2055 * (default) behavior. These resources are specified with the
2058 * "Mwm*<client_name_or_class>*<resource_identifier>"
2060 *************************************<->***********************************/
2062 XtResource wmStdClientResources[] =
2070 XtOffsetOf (ClientData, iconImage),
2076 WmNiconImageBackground,
2077 WmCIconImageBackground,
2080 XtOffsetOf (ClientData, iconImageBackground),
2082 (XtPointer)_WmIconImageBDefault
2086 WmNiconImageForeground,
2087 WmCIconImageForeground,
2090 XtOffsetOf (ClientData, iconImageForeground),
2092 (XtPointer)_WmIconImageFDefault
2096 WmNiconImageBottomShadowColor,
2097 WmCIconImageBottomShadowColor,
2100 XtOffsetOf (ClientData, iconImageBottomShadowColor),
2102 (XtPointer)_WmIconImageBSCDefault
2106 WmNiconImageBottomShadowPixmap,
2107 WmCIconImageBottomShadowPixmap,
2110 XtOffsetOf (ClientData, iconImageBottomShadowPStr),
2112 (XtPointer)_WmIconImageBSPDefault
2116 WmNiconImageTopShadowColor,
2117 WmCIconImageTopShadowColor,
2120 XtOffsetOf (ClientData, iconImageTopShadowColor),
2122 (XtPointer)_WmIconImageTSCDefault
2126 WmNiconImageTopShadowPixmap,
2127 WmCIconImageTopShadowPixmap,
2130 XtOffsetOf (ClientData, iconImageTopShadowPStr),
2132 (XtPointer)_WmIconImageTSPDefault
2140 XtOffsetOf (ClientData, matteWidth),
2146 WmNmaximumClientSize,
2147 WmCMaximumClientSize,
2150 XtOffsetOf (ClientData, maximumClientSize),
2156 WmNsecondariesOnTop,
2157 WmCSecondariesOnTop,
2160 XtOffsetOf (ClientData, secondariesOnTop),
2162 (XtPointer)_WmSecondariesOnTopDefault
2171 XtOffsetOf (ClientData, useClientIcon),
2179 /*************************************<->*************************************
2181 * wmClientResourcesM
2186 * This data structure is used in the processing of client specific
2187 * window manager resources that affect the appearance of the client
2188 * matte. These resources are specified with the following syntax:
2190 * "Mwm*<client_name_or_class>*<resource_identifier>"
2192 *************************************<->***********************************/
2194 XtResource wmClientResourcesM[] =
2201 XtOffsetOf (ClientData, matteBackground),
2203 (XtPointer)_WmMatteBDefault
2211 XtOffsetOf (ClientData, matteForeground),
2213 (XtPointer)_WmMatteFDefault
2217 WmNmatteBottomShadowColor,
2218 WmCMatteBottomShadowColor,
2221 XtOffsetOf (ClientData, matteBottomShadowColor),
2223 (XtPointer)_WmMatteBSCDefault
2227 WmNmatteBottomShadowPixmap,
2228 WmCMatteBottomShadowPixmap,
2231 XtOffsetOf (ClientData, matteBottomShadowPStr),
2233 (XtPointer)_WmMatteBSPDefault
2237 WmNmatteTopShadowColor,
2238 WmCMatteTopShadowColor,
2241 XtOffsetOf (ClientData, matteTopShadowColor),
2243 (XtPointer)_WmMatteTSCDefault
2247 WmNmatteTopShadowPixmap,
2248 WmCMatteTopShadowPixmap,
2251 XtOffsetOf (ClientData, matteTopShadowPStr),
2253 (XtPointer)_WmMatteTSPDefault
2259 /*************************************<->*************************************
2261 * wmAppearanceResources
2266 * This data structure is used in the processing of component appearance
2267 * resources. These resources are specified with the following syntax:
2269 * "Mwm*<resource_identifier>"
2270 * "Mwm*client*<resource_identifier>"
2271 * "Mwm*icon*<resource_identifier>"
2272 * "Mwm*feedback*<resource_identifier>"
2274 *************************************<->***********************************/
2276 XtResource wmAppearanceResources[] =
2283 sizeof (XmFontList),
2284 XtOffsetOf (AppearanceData, fontList),
2294 XtOffsetOf (AppearanceData, saveUnder),
2304 XtOffsetOf (AppearanceData, background),
2306 (XtPointer)_WmBackgroundDefault
2314 XtOffsetOf (AppearanceData, foreground),
2316 (XtPointer)_WmForegroundDefault
2320 XmNbottomShadowColor,
2324 XtOffsetOf (AppearanceData, bottomShadowColor),
2326 (XtPointer)_WmBottomShadowColorDefault
2330 XmNbottomShadowPixmap,
2331 XmCBottomShadowPixmap,
2334 XtOffsetOf (AppearanceData, bottomShadowPStr),
2344 XtOffsetOf (AppearanceData, topShadowColor),
2346 (XtPointer)_WmTopShadowColorDefault
2350 XmNbackgroundPixmap,
2351 XmCBackgroundPixmap,
2354 XtOffsetOf (AppearanceData, backgroundPStr),
2356 (XtPointer)_WmBackgroundPixmapDefault
2364 XtOffsetOf (AppearanceData, topShadowPStr),
2366 (XtPointer)_WmTopShadowPixmapDefault
2370 WmNactiveBackground,
2374 XtOffsetOf (AppearanceData, activeBackground),
2376 (XtPointer)_WmABackgroundDefault
2380 WmNactiveForeground,
2384 XtOffsetOf (AppearanceData, activeForeground),
2386 (XtPointer)_WmAForegroundDefault
2390 WmNactiveBottomShadowColor,
2394 XtOffsetOf (AppearanceData, activeBottomShadowColor),
2396 (XtPointer)_WmABottomShadowColorDefault
2400 WmNactiveBottomShadowPixmap,
2401 XmCBottomShadowPixmap,
2404 XtOffsetOf (AppearanceData, activeBottomShadowPStr),
2410 WmNactiveTopShadowColor,
2414 XtOffsetOf (AppearanceData, activeTopShadowColor),
2416 (XtPointer)_WmATopShadowColorDefault
2420 WmNactiveBackgroundPixmap,
2421 XmCBackgroundPixmap,
2424 XtOffsetOf (AppearanceData, activeBackgroundPStr),
2426 (XtPointer)_WmABackgroundPixmapDefault
2430 WmNactiveTopShadowPixmap,
2434 XtOffsetOf (AppearanceData, activeTopShadowPStr),
2436 (XtPointer)_WmATopShadowPixmapDefault
2443 /*************************************<->*************************************
2445 * _WmIconImageFDefault (widget, offset, value)
2446 * _WmIconImageBDefault (widget, offset, value)
2447 * _WmIconImageBSCDefault (widget, offset, value)
2448 * _WmIconImageBSPDefault (widget, offset, value)
2449 * _WmIconImageTSCDefault (widget, offset, value)
2450 * _WmIconImageTSPDefault (widget, offset, value)
2451 * _WmMatteFDefault (widget, offset, value)
2452 * _WmMatteBDefault (widget, offset, value)
2453 * _WmMatteBSCDefault (widget, offset, value)
2454 * _WmMatteBSPDefault (widget, offset, value)
2455 * _WmMatteTSCDefault (widget, offset, value)
2456 * _WmMatteTSPDefault (widget, offset, value)
2461 * These functions are used to generate dynamic defaults for various
2462 * client-specific appearance related resources.
2467 * widget = this is the parent widget for the wm subpart
2469 * offset = this is the resource offset
2471 * value = this is a pointer to a XrmValue in which to store the result
2473 * _pCD = (static global) pointer to client data associated with resources
2478 * value = default resource value and size
2480 *************************************<->***********************************/
2483 _WmIconImageFDefault (Widget widget, int offset, XrmValue *value)
2485 _WmGetDynamicDefault (widget, WmFGC, 0,
2486 _pCD->iconImageBackground, value);
2488 } /* END OF FUNCTION _WmIconImageFDefault */
2491 _WmIconImageBDefault (Widget widget, int offset, XrmValue *value)
2493 value->addr = (char *)&(_pCD->pSD->iconAppearance.background);
2494 value->size = sizeof (Pixel);
2496 } /* END OF FUNCTION _WmIconImageBDefault */
2500 _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value)
2502 _WmGetDynamicDefault (widget, WmBSC, 0,
2503 _pCD->iconImageBackground, value);
2505 } /* END OF FUNCTION _WmIconImageBSCDefault */
2509 _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value)
2512 value->addr = (char *)_pCD->pSD->iconAppearance.bottomShadowPStr;
2513 value->size = sizeof (String);
2515 } /* END OF FUNCTION _WmIconImageBSCDefault */
2519 _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value)
2521 _WmGetDynamicDefault (widget, WmTSC, 0,
2522 _pCD->iconImageBackground, value);
2524 } /* END OF FUNCTION _WmIconImageTSCDefault */
2528 _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value)
2531 value->addr = (char *)_pCD->pSD->iconAppearance.topShadowPStr;
2532 value->size = sizeof (String);
2534 } /* END OF FUNCTION _WmIconImageTSPDefault */
2538 _WmMatteFDefault (Widget widget, int offset, XrmValue *value)
2540 _WmGetDynamicDefault (widget, WmFGC, 0,
2541 _pCD->matteBackground, value);
2543 } /* END OF FUNCTION _WmMatteFDefault */
2547 _WmMatteBDefault (Widget widget, int offset, XrmValue *value)
2549 value->addr = (char *)&(_pCD->pSD->clientAppearance.background);
2550 value->size = sizeof (Pixel);
2552 } /* END OF FUNCTION _WmMatteBDefault */
2556 _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value)
2558 _WmGetDynamicDefault (widget, WmBSC, 0,
2559 _pCD->matteBackground, value);
2561 } /* END OF FUNCTION _WmMatteBSCDefault */
2565 _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value)
2568 value->addr = (char *)_pCD->pSD->clientAppearance.bottomShadowPStr;
2569 value->size = sizeof (String);
2571 } /* END OF FUNCTION _WmMatteBSCDefault */
2575 _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value)
2577 _WmGetDynamicDefault (widget, WmTSC, 0,
2578 _pCD->matteBackground, value);
2580 } /* END OF FUNCTION _WmMatteTSCDefault */
2584 _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value)
2587 value->addr = (char *)_pCD->pSD->clientAppearance.topShadowPStr;
2588 value->size = sizeof (String);
2590 } /* END OF FUNCTION _WmMatteTSCDefault */
2594 /*************************************<->*************************************
2596 * _WmBackgroundDefault (widget, offset, value)
2597 * _WmForegroundDefault (widget, offset, value)
2598 * _WmBackgroundPixmapDefault (widget, offset, value)
2599 * _WmBottomShadowColorDefault (widget, offset, value)
2600 * _WmTopShadowColorDefault (widget, offset, value)
2601 * _WmTopShadowPixmapDefault (widget, offset, value)
2602 * _WmABackgroundDefault (widget, offset, value)
2603 * _WmAForegroundDefault (widget, offset, value)
2604 * _WmABackgroundPixmapDefault (widget, offset, value)
2605 * _WmABottomShadowColorDefault (widget, offset, value)
2606 * _WmRFBackgroundDefault (widget, offset, value)
2607 * _WmRFForegroundDefault (widget, offset, value)
2608 * _WmATopShadowColorDefault (widget, offset, value)
2609 * _WmATopShadowPixmapDefault (widget, offset, value)
2614 * These functions are used to generate dynamic defaults for various
2615 * component appearance related resources (not client-specific).
2620 * widget = this is the parent widget for the wm subpart
2622 * offset = this is the resource offset
2624 * value = this is a pointer to a XrmValue in which to store the result
2626 * _defaultBackground = (static global) default background color (inactive)
2628 * _defaultActiveBackground = (static global) default bg color (active)
2630 * _pAppearanceData = (static global) pointer to resouce set structure
2635 * value = default resource value and size
2637 *************************************<->***********************************/
2640 _WmBackgroundDefault (Widget widget, int offset, XrmValue *value)
2642 _WmGetDynamicDefault (widget, WmBGC, _defaultBackground, 0, value);
2644 } /* END OF FUNCTION _WmBackgroundDefault */
2648 _WmForegroundDefault (Widget widget, int offset, XrmValue *value)
2650 _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->background,
2653 } /* END OF FUNCTION _WmForegroundDefault */
2657 _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value)
2659 static String string;
2662 if ((Monochrome (XtScreen (widget))) ||
2663 (_pAppearanceData->topShadowColor == _pAppearanceData->background))
2665 string = (String) _25_foreground;
2672 value->addr = (char *)string;
2673 value->size = sizeof (String);
2675 } /* END OF FUNCTION _WmBackgroundPixmapDefault */
2679 _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value)
2681 _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->background,
2684 } /* END OF FUNCTION _WmBottomShadowColorDefault */
2688 _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value)
2690 _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->background,
2693 } /* END OF FUNCTION _WmTopShadowColorDefault */
2697 _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value)
2699 static String string;
2702 if ((Monochrome (XtScreen (widget))) ||
2703 (_pAppearanceData->topShadowColor == _pAppearanceData->background))
2705 /* Fix monochrome 3D appearance */
2706 string = (String) _50_foreground;
2707 if (_pAppearanceData->backgroundPStr != NULL)
2708 if (!strcmp(_pAppearanceData->backgroundPStr, _25_foreground) ||
2709 !strcmp(_pAppearanceData->backgroundPStr, _50_foreground))
2711 string = (String) _foreground;
2719 value->addr = (char *)string;
2720 value->size = sizeof (String);
2722 } /* END OF FUNCTION _WmTopShadowPixmapDefault */
2726 _WmABackgroundDefault (Widget widget, int offset, XrmValue *value)
2728 _WmGetDynamicDefault (widget, WmBGC, _defaultActiveBackground, 0, value);
2730 } /* END OF FUNCTION _WmABackgroundDefault */
2734 _WmAForegroundDefault (Widget widget, int offset, XrmValue *value)
2736 _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->activeBackground,
2739 } /* END OF FUNCTION _WmAForegroundDefault */
2742 _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value)
2744 static String string;
2747 if ((Monochrome (XtScreen (widget))) ||
2748 (_pAppearanceData->activeTopShadowColor ==
2749 _pAppearanceData->activeBackground))
2751 string = (String) _50_foreground;
2758 value->addr = (char *)string;
2759 value->size = sizeof (String);
2761 } /* END OF FUNCTION _WmABackgroundPixmapDefault */
2764 _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value)
2766 _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->activeBackground,
2769 } /* END OF FUNCTION _WmABottomShadowColorDefault */
2773 _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value)
2775 _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->activeBackground,
2778 } /* END OF FUNCTION _WmATopShadowColorDefault */
2782 _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value)
2784 static String string;
2786 if ((Monochrome (XtScreen (widget))) ||
2787 (_pAppearanceData->activeTopShadowColor ==
2788 _pAppearanceData->activeBackground))
2790 /* Fix monochrome 3D appearance */
2791 string = (String) _50_foreground;
2792 if (_pAppearanceData->activeBackgroundPStr != NULL)
2794 (_pAppearanceData->activeBackgroundPStr, _25_foreground) ||
2796 (_pAppearanceData->activeBackgroundPStr, _50_foreground))
2798 string = (String) _foreground;
2806 value->addr = (char *)string;
2807 value->size = sizeof (String);
2809 } /* END OF FUNCTION _WmATopShadowPixmapDefault */
2814 _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value)
2816 static Pixel pixValue;
2817 unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet;
2819 if (wmGD.statusColorServer == CSERVE_NORMAL)
2821 if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS))
2823 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2826 switch (pResWS->pSD->colorUse)
2828 case XmCO_BLACK_WHITE:
2829 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg;
2833 case XmCO_LOW_COLOR:
2834 case XmCO_MEDIUM_COLOR:
2835 case XmCO_HIGH_COLOR:
2836 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bs;
2843 * Color server is unavailable. Has user specified a colorset?
2845 * If not, go monochrome.
2848 pixValue = WhitePixel (DISPLAY, pResWS->pSD->screen);
2851 /* return the dynamic default */
2853 value->addr = (char *) &pixValue;
2854 value->size = sizeof (Pixel);
2856 } /* END OF FUNCTION _WmBackdropBgDefault */
2859 _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value)
2861 static Pixel pixValue;
2862 unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet;
2864 if (wmGD.statusColorServer == CSERVE_NORMAL)
2866 if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS))
2868 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2871 switch (pResWS->pSD->colorUse)
2873 case XmCO_BLACK_WHITE:
2874 pixValue = pResWS->pSD->pPixelData[colorSetId-1].fg;
2878 case XmCO_LOW_COLOR:
2879 case XmCO_MEDIUM_COLOR:
2880 case XmCO_HIGH_COLOR:
2881 pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg;
2888 * Color server is unavailable. Has user specified a colorset?
2890 * If not, go monochrome.
2893 pixValue = BlackPixel (DISPLAY, pResWS->pSD->screen);
2895 value->addr = (char *) &pixValue;
2896 value->size = sizeof (Pixel);
2898 } /* END OF FUNCTION _WmBackdropFgDefault */
2901 _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value)
2903 static unsigned int colorSetId;
2905 if (wmGD.statusColorServer == CSERVE_NORMAL)
2907 colorSetId = (unsigned int) DefaultWsColorSetId (pResWS);
2911 colorSetId = 0; /* invalid color set */
2914 value->addr = (char *) &colorSetId;
2915 value->size = sizeof (Pixel);
2917 } /* END OF FUNCTION _WmBackdropColorSetIdDefault */
2920 _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value)
2924 if ((pResSD->displayResolutionType == LOW_RES_DISPLAY) ||
2925 (pResSD->displayResolutionType == VGA_RES_DISPLAY))
2936 value->addr = (char *) &cval;
2937 value->size = sizeof (WHSize);
2939 } /* END OF FUNCTION _WmIconImageMaximumDefault */
2942 /*************************************<->*************************************
2944 * DefaultWsColorSetId (pWS)
2949 * This function returns the default colorSetId for a given workspace
2954 * pWS = ptr to workspace data
2958 * return = default color set ID.
2960 * "active" and "inactive" color sets are not used.
2962 *************************************<->***********************************/
2965 DefaultWsColorSetId (WmWorkspaceData *pWS)
2967 static int _ws_high_color_map[] = { 3, 5, 6, 7 };
2968 #define _WS_HIGH_COLOR_COUNT 4
2978 iIndex = (int) ((unsigned long)(pWS) -
2979 (unsigned long)(pSD->pWS))/sizeof(WmWorkspaceData);
2981 iIndex = 0; /* bad pWS or pSD, shouldn't get here */
2983 switch (pSD->colorUse)
2985 case XmCO_BLACK_WHITE:
2986 case XmCO_LOW_COLOR:
2988 (pSD->pInactivePixelSet-pSD->pPixelData)/sizeof(XmPixelSet);
2991 case XmCO_MEDIUM_COLOR:
2992 rval = HARD_CODED_PRIMARY;
2995 case XmCO_HIGH_COLOR:
2996 i = iIndex % _WS_HIGH_COLOR_COUNT;
2997 rval = _ws_high_color_map[i];
3004 } /* END OF FUNCTION DefaultWsColorSetId */
3010 /*************************************<->*************************************
3012 * _WmFocusAutoRaiseDefault (widget, offset, value)
3017 * This function generates a default value for the focusAutoRaise resource.
3022 * widget = this is the parent widget for the wm subpart
3024 * offset = this is the resource offset
3026 * value = this is a pointer to a XrmValue in which to store the result
3031 * value = default resource value and size
3033 *************************************<->***********************************/
3036 _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value)
3038 static Boolean focusAutoRaise;
3040 if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)
3042 focusAutoRaise = True;
3046 focusAutoRaise = False;
3049 value->addr = (char *)&focusAutoRaise;
3050 value->size = sizeof (Boolean);
3052 } /* END OF FUNCTION _WmFocusAutoRaiseDefault */
3055 /*************************************<->*************************************
3057 * _WmMultiClickTimeDefault (widget, offset, value)
3062 * This function generates a default value for the doubleClickTime resource.
3063 * We dynamically default to the XtR4 multiClickTime value.
3067 * widget = this is the parent widget for the wm subpart
3069 * offset = this is the resource offset
3071 * value = this is a pointer to a XrmValue in which to store the result
3075 * value = default resource value and size
3077 *************************************<->***********************************/
3080 _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value)
3082 static int multiClickTime;
3084 multiClickTime = XtGetMultiClickTime(XtDisplay(widget));
3086 value->addr = (char *)&multiClickTime;
3087 value->size = sizeof (int);
3089 } /* END OF FUNCTION _WmMultiClickTimeDefault */
3093 /*************************************<->*************************************
3095 * _WmSecondariesOnTopDefault (widget, offset, value)
3100 * This function generates a default value for the secondariesOnTop
3105 * widget = this is the parent widget for the wm subpart
3107 * offset = this is the resource offset
3109 * value = this is a pointer to a XrmValue in which to store the result
3113 * value = default resource value and size
3115 *************************************<->***********************************/
3118 _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value)
3120 static Boolean secondariesOnTop;
3123 * Inherit setting from primary window if this window is
3127 if (_pCD->transientLeader != NULL)
3128 secondariesOnTop = _pCD->transientLeader->secondariesOnTop;
3130 secondariesOnTop = True;
3132 value->addr = (char *)&secondariesOnTop;
3133 value->size = sizeof (Boolean);
3135 } /* END OF FUNCTION _WmSecondariesOnTopDefault */
3140 /******************************<->*************************************
3142 * ProcessWmResources ()
3147 * This function is used to retrieve and process window manager resources
3148 * that are not client-specific.
3153 * wmGlobalResources = pointer to wm resource list
3158 * wmGD = (global data filled out with resource values)
3160 *************************************<->***********************************/
3163 ProcessWmResources (void)
3167 * Process the mwm general appearance and behavior resources. Retrieve
3168 * a limited set of resource values if the window manager is starting
3169 * up with the standard behavior.
3172 if (wmGD.useStandardBehavior)
3174 XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD,
3175 wmStdGlobalResources, XtNumber (wmStdGlobalResources), NULL, 0);
3178 * Fill in the standard resource values.
3181 SetStdGlobalResourceValues ();
3185 XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD,
3186 wmGlobalResources, XtNumber (wmGlobalResources), NULL, 0);
3189 if (wmGD.autoRaiseDelay < 0)
3191 wmGD.autoRaiseDelay = 500;
3192 Warning (((char *)GETMESSAGE(62, 66, "Out of range autoRaiseDelay resource value. Must be non-negative")));
3195 } /* END OF FUNCTION ProcessWmResources */
3199 /******************************<->*************************************
3201 * ProcessGlobalScreenResources ()
3206 * This function is used to retrieve window manager resources to
3207 * determine the screens to manage.
3212 * wmGlobalScreenResources = pointer to wm resource list
3217 * wmGD = (global data filled out with resource values)
3219 *************************************<->***********************************/
3222 ProcessGlobalScreenResources (void)
3224 XtGetApplicationResources (wmGD.topLevelW, &wmGD,
3225 wmGlobalScreenResources,
3226 XtNumber (wmGlobalScreenResources), NULL, 0);
3228 if (wmGD.multiScreen)
3230 wmGD.numScreens = ScreenCount(DISPLAY);
3234 wmGD.numScreens = 1;
3237 if (wmGD.screenList != NULL)
3239 ProcessScreenListResource();
3245 /*************************************<->*************************************
3247 * SetStdGlobalResourceValues ()
3252 * This function sets resource data to standard values. This setting
3253 * is done in place of getting the values from the user settings in
3254 * the resource database.
3259 * wmGD = (global data filled out with resource values)
3261 *************************************<->***********************************/
3264 SetStdGlobalResourceValues (void)
3266 wmGD.autoKeyFocus = True;
3267 wmGD.clientAutoPlace = True;
3268 wmGD.colormapFocusPolicy = CMAP_FOCUS_KEYBOARD;
3269 wmGD.deiconifyKeyFocus = True;
3270 wmGD.doubleClickTime = 500;
3271 wmGD.freezeOnConfig = True;
3272 wmGD.iconAutoPlace = True;
3273 wmGD.iconClick = True;
3274 wmGD.interactivePlacement = False;
3275 wmGD.keyboardFocusPolicy = KEYBOARD_FOCUS_EXPLICIT;
3276 wmGD.lowerOnIconify = True;
3277 wmGD.passSelectButton = True;
3278 wmGD.startupKeyFocus = True;
3279 wmGD.systemButtonClick = True;
3280 wmGD.systemButtonClick2 = True;
3281 #if defined(PANELIST)
3282 wmGD.useFrontPanel=False;
3283 #endif /* PANELIST */
3285 } /* END OF FUNCTION SetStdGlobalResourceValues */
3289 /*************************************<->*************************************
3291 * ProcessScreenListResource ()
3296 * This processes the names in the screenList resource.
3301 * wmGlobalResources = pointer to wmGD.screenList
3308 *************************************<->***********************************/
3311 ProcessScreenListResource (void)
3313 unsigned char *lineP;
3314 unsigned char *string;
3318 lineP = (unsigned char *)wmGD.screenList;
3323 while (((string = GetString(&lineP)) != NULL) &&
3324 (sNum < ScreenCount(DISPLAY)))
3326 if (!(wmGD.screenNames[sNum] = (unsigned char *)
3327 WmRealloc ((char*)wmGD.screenNames[sNum], strlen((char*)string)+1)))
3329 ExitWM(WM_ERROR_EXIT_VALUE);
3333 strcpy((char *)wmGD.screenNames[sNum], (char *)string);
3340 * If the number of listed screens (sNum) is < screen count, fill in the
3341 * remaining screen names with the name of the first screen specified,
3346 string = wmGD.screenNames[0]; /* name of the first screen */
3347 while (sNum < ScreenCount(DISPLAY))
3349 if (!(wmGD.screenNames[sNum] = (unsigned char *)
3350 WmRealloc ((char*)wmGD.screenNames[sNum],
3351 strlen((char *)string)+1)))
3353 ExitWM(WM_ERROR_EXIT_VALUE);
3357 strcpy((char *)wmGD.screenNames[sNum], (char *)string);
3364 } /* END OF FUNCTION ProcessScreenListResource */
3368 /******************************<->*************************************
3370 * ProcessWmColors ()
3375 * Retrieve the color sets from the colorserver.
3383 * modifies parts of global pixel sets
3388 ******************************<->***********************************/
3391 ProcessWmColors (WmScreenData *pSD)
3393 short active, inactive, primary, secondary;
3395 if ((pSD->pPixelData = (XmPixelSet *)
3396 XtMalloc (XmCO_NUM_COLORS * sizeof(XmPixelSet))))
3401 * ASSUMPTION: If XmeGetPixelData() returns true,
3402 * we have a good color server at our disposal.
3406 if (XmeGetPixelData (pSD->screen, &pSD->colorUse,
3407 pSD->pPixelData, &active, &inactive,
3408 &primary, &secondary))
3410 pSD->pActivePixelSet = &(pSD->pPixelData[active]);
3411 pSD->pInactivePixelSet = &(pSD->pPixelData[inactive]);
3412 pSD->pPrimaryPixelSet = &(pSD->pPixelData[primary]);
3413 pSD->pSecondaryPixelSet = &(pSD->pPixelData[secondary]);
3415 /* Hack here. The index "4" is the proper array reference. */
3416 /* This is used because XmGetPixelData has not been properly */
3419 pSD->pTextPixelSet = &(pSD->pPixelData[3]);
3421 wmGD.statusColorServer = CSERVE_NORMAL;
3426 XtFree((char *)pSD->pPixelData);
3427 pSD->pPixelData = NULL;
3428 pSD->pActivePixelSet = NULL;
3429 pSD->pInactivePixelSet = NULL;
3430 pSD->pPrimaryPixelSet = NULL;
3431 pSD->pSecondaryPixelSet = NULL;
3432 pSD->pTextPixelSet = NULL;
3437 Warning (((char *)GETMESSAGE(62, 22, "Insufficient memory for color data")));
3438 ExitWM (WM_ERROR_EXIT_VALUE);
3441 } /* END OF FUNCTION ProcessWmColors */
3444 /******************************<->*************************************
3446 * WriteOutXrmColors ()
3451 * Update the XRM database with pixel values from the color server.
3455 * pSD = contains pixel sets
3459 * updated resource database
3463 * N.B. Must change to write out data on a PER-SCREEN basis.
3464 * e.g., "Dtwm*0*background"
3465 ******************************<->***********************************/
3468 WriteOutXrmColors (WmScreenData *pSD)
3472 int thisScreen = pSD->screen;
3473 XmPixelSet *tpixset;
3474 XmPixelSet *spixset;
3481 res_class = WM_RESOURCE_CLASS;
3485 res_class = DT_WM_RESOURCE_CLASS;
3488 screen_name = (String) wmGD.screenNames[pSD->screen];
3490 db = XtScreenDatabase(XScreenOfDisplay(DISPLAY, thisScreen));
3492 /** update the clients database with new colors **/
3493 value.size = sizeof(Pixel);
3497 * WM ACTIVE RESOURCES--e.g., for the active frame
3500 if (pSD->pActivePixelSet)
3502 tpixset = pSD->pActivePixelSet;
3503 spixset = pSD->pSecondaryPixelSet;
3505 if (pSD->colorUse == XmCO_BLACK_WHITE)
3509 * Limit ourselves here to the client (frame)
3514 /* activeForeground */
3515 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3517 XrmPutResource (&db,
3518 ResCat (res_class, screen_name, WmNactiveForeground,
3519 NULL), XtRPixel, &value);
3521 /* activeBackground */
3522 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3524 XrmPutResource (&db,
3525 ResCat (res_class, screen_name, WmNactiveBackground,
3526 NULL), XtRPixel, &value);
3528 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3529 WmNactiveBackgroundPixmap, NULL),
3532 /* activeTopShadow */
3533 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3534 WmNactiveTopShadowPixmap, NULL),
3537 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3538 XrmPutResource (&db,
3539 ResCat (res_class, screen_name, WmNactiveTopShadowColor,
3540 NULL), XtRPixel, &value);
3542 /* activeBottomShadow */
3543 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3544 XrmPutResource (&db,
3545 ResCat (res_class, screen_name,
3546 WmNactiveBottomShadowColor, NULL), XtRPixel, &value);
3548 XrmPutStringResource (&db, ResCat (res_class, screen_name,
3549 WmNactiveBottomShadowPixmap, NULL),
3553 else /* active colors for non-BW systems */
3555 value.addr = (XtPointer) &(tpixset->bg);
3556 XrmPutResource (&db,
3557 ResCat (res_class, screen_name, WmNactiveBackground, NULL),
3560 value.addr = (XtPointer) &(tpixset->fg);
3561 XrmPutResource (&db,
3562 ResCat (res_class, screen_name, WmNactiveForeground, NULL),
3565 value.addr = (XtPointer) &(tpixset->ts);
3566 XrmPutResource (&db,
3567 ResCat (res_class, screen_name, WmNactiveTopShadowColor, NULL),
3570 value.addr = (XtPointer) &(tpixset->bs);
3571 XrmPutResource (&db,
3572 ResCat (res_class, screen_name, WmNactiveBottomShadowColor, NULL),
3575 if (XmCO_DitherTopShadow(DISPLAY, thisScreen, tpixset))
3577 XrmPutStringResource (&db,
3578 ResCat (res_class, screen_name, WmNactiveTopShadowPixmap, NULL),
3583 if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, tpixset))
3585 XrmPutStringResource (&db,
3586 ResCat (res_class, screen_name, WmNactiveBottomShadowPixmap,
3595 * WM INACTIVE colors--e.g., for dialogues
3598 if (pSD->pInactivePixelSet)
3600 tpixset = pSD->pInactivePixelSet;
3601 spixset = pSD->pSecondaryPixelSet;
3603 if (pSD->colorUse == XmCO_BLACK_WHITE)
3608 * Set colors/pixmaps for the frames--leave the
3609 * menus out of it so that their text won't look
3610 * unsatisfactory against a dithered background.
3615 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3617 XrmPutResource (&db,
3618 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3619 WmNforeground), XtRPixel, &value);
3621 XrmPutResource (&db,
3622 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3623 WmNforeground), XtRPixel, &value);
3627 XrmPutStringResource (&db,
3628 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3629 WmNbackgroundPixmap), _Dither);
3631 XrmPutStringResource (&db,
3632 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3633 WmNbackgroundPixmap), _Dither);
3635 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3636 XrmPutResource (&db,
3637 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3638 WmNbackground), XtRPixel, &value);
3640 XrmPutResource (&db,
3641 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3642 WmNbackground), XtRPixel, &value);
3645 XrmPutStringResource (&db,
3646 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3647 WmNtopShadowPixmap), _foreground);
3649 XrmPutStringResource (&db,
3650 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3651 WmNtopShadowPixmap), _foreground);
3653 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3654 XrmPutResource (&db,
3655 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3656 WmNtopShadowColor), XtRPixel, &value);
3658 XrmPutResource (&db,
3659 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3660 WmNtopShadowColor), XtRPixel, &value);
3664 XrmPutStringResource (&db,
3665 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3666 WmNbottomShadowPixmap), _foreground);
3668 XrmPutStringResource (&db,
3669 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3670 WmNbottomShadowPixmap), _foreground);
3672 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3674 XrmPutResource (&db,
3675 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3676 WmNbottomShadowColor), XtRPixel, &value);
3678 XrmPutResource (&db,
3679 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3680 WmNbottomShadowColor), XtRPixel, &value);
3684 * Ensure that the icon images have a black foreground and
3685 * a white background.
3688 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
3690 XrmPutResource (&db,
3691 ResCat (res_class, screen_name, WmNiconImageForeground,
3692 NULL), XtRPixel, &value);
3694 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
3696 XrmPutResource (&db,
3697 ResCat (res_class, screen_name, WmNiconImageBackground,
3698 NULL), XtRPixel, &value);
3700 /* Now deal with XmCO_BLACK_WHITE Menus */
3702 /* XmCO_BLACK_WHITE menu foreground */
3703 value.addr = (XtPointer) &(tpixset->fg);
3705 XrmPutResource (&db,
3706 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3707 WmNforeground), XtRPixel, &value);
3709 /* XmCO_BLACK_WHITE menu background */
3710 value.addr = (XtPointer) &(tpixset->bg);
3712 XrmPutResource (&db,
3713 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3714 WmNbackground), XtRPixel, &value);
3716 /* XmCO_BLACK_WHITE menu top shadow */
3718 XrmPutStringResource (&db,
3719 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3720 WmNtopShadowPixmap), _50_foreground);
3722 /* use foreground color for this pixmap */
3723 value.addr = (XtPointer) &(tpixset->fg);
3725 XrmPutResource (&db,
3726 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3727 WmNtopShadowColor), XtRPixel, &value);
3729 /* XmCO_BLACK_WHITE menu bottom shadow */
3731 XrmPutStringResource (&db,
3732 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3733 WmNbottomShadowPixmap), _75_foreground);
3735 /* use foreground color for this pixmap */
3736 value.addr = (XtPointer) &(tpixset->fg);
3738 XrmPutResource (&db,
3739 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3740 WmNbottomShadowColor), XtRPixel, &value);
3742 /* Finally, deal with XmCO_BLACK_WHITE Confirm Boxes */
3744 /* XmCO_BLACK_WHITE confirm box foreground */
3745 value.addr = (XtPointer) &(spixset->fg);
3747 XrmPutResource (&db,
3748 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3749 WmNforeground), XtRPixel, &value);
3751 /* XmCO_BLACK_WHITE confirm box background */
3752 value.addr = (XtPointer) &(spixset->bg);
3754 XrmPutResource (&db,
3755 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3756 WmNbackground), XtRPixel, &value);
3758 /* XmCO_BLACK_WHITE confirm box top shadow */
3760 XrmPutStringResource (&db,
3761 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3762 WmNtopShadowPixmap), _50_foreground);
3764 /* use foreground color */
3765 value.addr = (XtPointer) &(spixset->fg);
3767 XrmPutResource (&db,
3768 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3769 WmNtopShadowColor), XtRPixel, &value);
3771 /* XmCO_BLACK_WHITE confirm box bottom shadow */
3773 XrmPutStringResource (&db,
3774 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3775 WmNbottomShadowPixmap), _75_foreground);
3777 /* use foreground color */
3778 value.addr = (XtPointer) &(spixset->fg);
3780 XrmPutResource (&db,
3781 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3782 WmNbottomShadowColor), XtRPixel, &value);
3784 /* use select color for icon box trough color */
3786 value.addr = (XtPointer) &(tpixset->sc);
3788 XrmPutResource (&db,
3789 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3790 XmNtroughColor), XtRPixel, &value);
3792 /* use select color for arm and select colors in dialogs */
3794 value.addr = (XtPointer) &(spixset->sc);
3796 XrmPutResource (&db,
3797 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3798 XmNarmColor), XtRPixel, &value);
3800 XrmPutResource (&db,
3801 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3802 XmNselectColor), XtRPixel, &value);
3804 XrmPutResource (&db,
3805 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3806 XmNtroughColor), XtRPixel, &value);
3808 else /* inactive colors for non-BW systems */
3810 XmPixelSet *fpixset;
3813 * Set mwm component colors
3815 value.addr = (XtPointer) &(tpixset->bg);
3816 XrmPutResource (&db,
3817 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3818 WmNbackground), XtRPixel, &value);
3820 XrmPutResource (&db,
3821 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3822 WmNbackground), XtRPixel, &value);
3824 XrmPutResource (&db,
3825 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3826 WmNbackground), XtRPixel, &value);
3828 value.addr = (XtPointer) &(spixset->bg);
3829 XrmPutResource (&db,
3830 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3831 WmNbackground), XtRPixel, &value);
3833 value.addr = (XtPointer) &(tpixset->ts);
3834 XrmPutResource (&db,
3835 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3836 WmNtopShadowColor), XtRPixel, &value);
3838 XrmPutResource (&db,
3839 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3840 WmNtopShadowColor), XtRPixel, &value);
3842 XrmPutResource (&db,
3843 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3844 WmNtopShadowColor), XtRPixel, &value);
3846 value.addr = (XtPointer) &(spixset->ts);
3847 XrmPutResource (&db,
3848 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3849 WmNtopShadowColor), XtRPixel, &value);
3851 value.addr = (XtPointer) &(tpixset->bs);
3852 XrmPutResource (&db,
3853 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3854 WmNbottomShadowColor), XtRPixel, &value);
3856 XrmPutResource (&db,
3857 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3858 WmNbottomShadowColor), XtRPixel, &value);
3860 XrmPutResource (&db,
3861 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3862 WmNbottomShadowColor), XtRPixel, &value);
3864 value.addr = (XtPointer) &(spixset->bs);
3865 XrmPutResource (&db,
3866 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3867 WmNbottomShadowColor), XtRPixel, &value);
3869 value.addr = (XtPointer) &(tpixset->fg);
3870 XrmPutResource (&db,
3871 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3872 WmNforeground), XtRPixel, &value);
3874 XrmPutResource (&db,
3875 ResCat (res_class, screen_name, (char *)ICON_FRAME_PART,
3876 WmNforeground), XtRPixel, &value);
3878 XrmPutResource (&db,
3879 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3880 WmNforeground), XtRPixel, &value);
3882 value.addr = (XtPointer) &(spixset->fg);
3883 XrmPutResource (&db,
3884 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3885 WmNforeground), XtRPixel, &value);
3888 * Set select color only for menus and feedback mwm
3889 * parts. Client and Icon parts aren't real widgets.
3890 * Set client trough color for icon box.
3892 value.addr = (XtPointer) &(tpixset->sc);
3893 XrmPutResource (&db,
3894 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3895 XmNselectColor), XtRPixel, &value);
3897 XrmPutResource (&db,
3898 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3899 XmNarmColor), XtRPixel, &value);
3901 XrmPutResource (&db,
3902 ResCat (res_class, screen_name, (char *)MENU_ITEM_PART,
3903 XmNtroughColor), XtRPixel, &value);
3905 XrmPutResource (&db,
3906 ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART,
3907 XmNtroughColor), XtRPixel, &value);
3909 XrmPutResource (&db,
3910 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3911 XmNselectColor), XtRPixel, &value);
3913 value.addr = (XtPointer) &(spixset->sc);
3914 XrmPutResource (&db,
3915 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3916 XmNarmColor), XtRPixel, &value);
3918 XrmPutResource (&db,
3919 ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART,
3920 XmNtroughColor), XtRPixel, &value);
3923 * Set Dtwm dialog colors
3925 fpixset = pSD->pSecondaryPixelSet;
3927 value.addr = (XtPointer) &(fpixset->bg);
3928 XrmPutResource (&db,
3929 ResCat (res_class, screen_name, XmNbackground, NULL),
3932 value.addr = (XtPointer) &(fpixset->fg);
3933 XrmPutResource (&db,
3934 ResCat (res_class, screen_name, XmNforeground, NULL),
3937 value.addr = (XtPointer) &(fpixset->ts);
3938 XrmPutResource (&db,
3939 ResCat (res_class, screen_name, XmNtopShadowColor, NULL),
3942 value.addr = (XtPointer) &(fpixset->bs);
3943 XrmPutResource (&db,
3944 ResCat (res_class, screen_name, XmNbottomShadowColor, NULL),
3949 * Set up the select color, as for buttons in the dialogue
3953 value.addr = (XtPointer) &(fpixset->sc);
3954 XrmPutResource (&db,
3955 ResCat (res_class, screen_name, XmNselectColor, NULL),
3958 /* value.addr = (XtPointer) &(fpixset->sc); */
3959 XrmPutResource (&db,
3960 ResCat (res_class, screen_name, XmNarmColor, NULL),
3963 /* value.addr = (XtPointer) &(fpixset->sc); */
3964 XrmPutResource (&db,
3965 ResCat (res_class, screen_name, XmNtroughColor, NULL),
3968 if (XmCO_DitherTopShadow(DISPLAY, thisScreen, fpixset))
3970 XrmPutStringResource (&db,
3971 ResCat (res_class, screen_name, WmNtopShadowPixmap, NULL),
3974 if (pSD->colorUse == XmCO_BLACK_WHITE)
3976 XrmPutStringResource (&db,
3977 ResCat (res_class, screen_name,
3978 WmNbottomShadowPixmap, NULL),
3984 if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, fpixset))
3986 XrmPutStringResource (&db,
3987 ResCat (res_class, screen_name, WmNbottomShadowPixmap, NULL),
3990 if (pSD->colorUse == XmCO_BLACK_WHITE)
3992 XrmPutStringResource (&db,
3993 ResCat (res_class, screen_name,
3994 WmNtopShadowPixmap, NULL),
4000 if (tpixset->bs != tpixset->ts)
4003 * If the inactive bottomshadow and topshadow are
4004 * different (i.e., valid), then make the icon image
4008 value.addr = (XtPointer) &(tpixset->bs);
4010 XrmPutResource (&db,
4011 ResCat (res_class, screen_name, WmNiconImageForeground,
4012 NULL), XtRPixel, &value);
4014 value.addr = (XtPointer) &(tpixset->ts);
4016 XrmPutResource (&db,
4017 ResCat (res_class, screen_name, WmNiconImageBackground,
4018 NULL), XtRPixel, &value);
4020 value.addr = (XtPointer) &(tpixset->bs);
4022 XrmPutResource (&db,
4023 ResCat (res_class, screen_name,
4024 WmNiconImageBottomShadowColor,
4025 NULL), XtRPixel, &value);
4027 value.addr = (XtPointer) &(tpixset->ts);
4029 XrmPutResource (&db,
4030 ResCat (res_class, screen_name,
4031 WmNiconImageTopShadowColor,
4032 NULL), XtRPixel, &value);
4037 * Ensure that the icon images have a black foreground and
4038 * a white background.
4042 value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen));
4044 XrmPutResource (&db,
4045 ResCat (res_class, screen_name, WmNiconImageForeground,
4046 NULL), XtRPixel, &value);
4048 value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen));
4050 XrmPutResource (&db,
4051 ResCat (res_class, screen_name, WmNiconImageBackground,
4052 NULL), XtRPixel, &value);
4058 if (pSD->pTextPixelSet)
4060 value.addr = (XtPointer) &(pSD->pTextPixelSet->bg);
4062 XrmPutResource (&db,
4063 ResCat (res_class, screen_name, "XmTextField",
4064 WmNbackground), XtRPixel, &value);
4066 XrmPutResource (&db,
4067 ResCat (res_class, screen_name, "XmText",
4068 WmNbackground), XtRPixel, &value);
4073 /******************************<->*************************************
4075 * ResCat (s1,s2,s3,s4)
4080 * Cats up to four strings together with '*' in between.
4085 * s1...s4 = pointers to Strings or NULL pointers (no string)
4089 * Return = pointer to statically allocated string that has
4090 * the passed in string cat'ed together with '*'s
4095 * Does no limit checking on the static buffer
4097 *************************************<->***********************************/
4100 ResCat (String s1, String s2, String s3, String s4)
4106 Boolean useResourceClass = True;
4108 wmGD.tmpBuffer[0] = '\0';
4114 if ((MwmBehavior) &&
4115 !strcmp (s1, WM_RESOURCE_CLASS))
4118 * if this routine is called with a class name
4119 * ("Mwm" or "Dtwm"), then DON'T use it.
4120 * We want our resources to be written out
4121 * as: *iconImageForeground: <pixel_val>
4123 * as opposed to: Dtwm*iconImageForeground: <pixel_val>
4127 useResourceClass = False;
4129 else if (!strcmp (s1, DT_WM_RESOURCE_CLASS))
4131 useResourceClass = False;
4135 strncat((char *)wmGD.tmpBuffer, s1, count);
4136 count -= strlen(s1);
4139 if (s2 && (count > 0))
4141 strncat ((char *)wmGD.tmpBuffer, "*", count);
4143 strncat ((char *)wmGD.tmpBuffer, s2, count);
4144 count -= strlen (s2);
4146 if (s3 && (count > 0))
4148 strncat ((char *)wmGD.tmpBuffer, "*", count);
4150 strncat ((char *)wmGD.tmpBuffer, s3, count);
4151 count -= strlen (s3);
4155 strncat ((char *)wmGD.tmpBuffer, "*", count);
4157 strncat ((char *)wmGD.tmpBuffer, s4, count);
4162 return ((String) wmGD.tmpBuffer);
4164 } /* END OF FUNCTION ResCat */
4168 /******************************<->*************************************
4170 * CheckForNoDither (pAD)
4175 * Checks for reserved string as pixmap name of dither that indicates
4176 * no dithering and replaces the string with a NULL.
4181 * pAD = pointer to appearance data
4185 * pAD = pointer to appearance data (may be modified)
4189 * This check is done to avoid repeated calls to XmGetPixmap when
4190 * managing windows. XmGetPixmap doesn't cache failures, and the
4191 * NoDither string should fail every time. We want to prevent
4192 * XmGetPixmap from call XtResolvePathName to rummage through
4195 *************************************<->***********************************/
4198 CheckForNoDither (AppearanceData *pAD)
4200 if (pAD->backgroundPStr &&
4201 !strcmp(pAD->backgroundPStr, _NoDither))
4203 pAD->backgroundPStr = NULL;
4205 if (pAD->bottomShadowPStr &&
4206 !strcmp(pAD->bottomShadowPStr, _NoDither))
4208 pAD->bottomShadowPStr = NULL;
4210 if (pAD->topShadowPStr &&
4211 !strcmp(pAD->topShadowPStr, _NoDither))
4213 pAD->topShadowPStr = NULL;
4215 if (pAD->activeBackgroundPStr &&
4216 !strcmp(pAD->activeBackgroundPStr, _NoDither))
4218 pAD->activeBackgroundPStr = NULL;
4220 if (pAD->activeBottomShadowPStr &&
4221 !strcmp(pAD->activeBottomShadowPStr, _NoDither))
4223 pAD->activeBottomShadowPStr = NULL;
4225 if (pAD->activeTopShadowPStr &&
4226 !strcmp(pAD->activeTopShadowPStr, _NoDither))
4228 pAD->activeTopShadowPStr = NULL;
4231 } /* END OF FUNCTION CheckForNoDither */
4237 /******************************<->*************************************
4239 * ProcessAppearanceResources (pSD)
4244 * Retrieve and process the general appearance resources for the mwm
4245 * subparts: "client", "icon", and "feedback"
4250 * pSD = pointer to screen data
4254 * modifies parts of global data wmGD.
4258 * o Changeable GCs are created with XCreateGC. The base GCs used for
4259 * text output will have clip_masks defined for them later.
4262 *************************************<->***********************************/
4265 ProcessAppearanceResources (WmScreenData *pSD)
4267 Widget clientW; /* dummy widget for resource fetching */
4273 * Get the client subpart resources:
4276 /* save info in static globals for dynamic default processing */
4277 _defaultBackground = _defaultColor1;
4278 _defaultActiveBackground = _defaultColor2;
4279 _pAppearanceData = &(pSD->clientAppearance);
4281 (void)XtGetSubresources (pSD->screenTopLevelW,
4282 (XtPointer) &(pSD->clientAppearance),
4283 WmNclient, WmCClient, wmAppearanceResources,
4284 XtNumber (wmAppearanceResources), NULL, 0);
4286 CheckForNoDither (&(pSD->clientAppearance));
4291 * Process the client resource values:
4294 /* make background, top and bottom shadow pixmaps */
4296 MakeAppearanceResources (pSD, &(pSD->clientAppearance), True);
4300 * Get the client.title subpart resources:
4303 /* insert "client" widget in hierarchy */
4306 clientW = XtCreateWidget (WmNclient, xmRowColumnWidgetClass,
4307 pSD->screenTopLevelW, (ArgList) args, i);
4310 /* fetch "client.title" subpart appearance resources */
4312 _pAppearanceData = &(pSD->clientTitleAppearance);
4314 (void)XtGetSubresources (clientW, (XtPointer) &(pSD->clientTitleAppearance),
4315 WmNtitle, WmCTitle, wmAppearanceResources,
4316 XtNumber (wmAppearanceResources), NULL, 0);
4318 CheckForNoDither (&(pSD->clientTitleAppearance));
4323 * Process the client.title resource values:
4328 * check if client title appearance is different from the rest of frame.
4330 if (SimilarAppearanceData (&(pSD->clientAppearance),
4331 &(pSD->clientTitleAppearance)))
4333 /* title bar doesn't need special graphic processing */
4334 pSD->decoupleTitleAppearance = False;
4338 /* make background, top and bottom shadow pixmaps */
4339 MakeAppearanceResources (pSD, &(pSD->clientTitleAppearance), True);
4340 pSD->decoupleTitleAppearance = True;
4343 XtDestroyWidget (clientW); /* all done with dummy widget */
4347 * Get the icon subpart resources:
4350 _pAppearanceData = &(pSD->iconAppearance);
4352 (void)XtGetSubresources (pSD->screenTopLevelW,
4353 (XtPointer) &(pSD->iconAppearance),
4354 WmNicon, WmCIcon, wmAppearanceResources,
4355 XtNumber (wmAppearanceResources), NULL, 0);
4357 CheckForNoDither (&(pSD->iconAppearance));
4362 * Process the icon resource values:
4365 /* make background, top and bottom shadow pixmaps */
4367 MakeAppearanceResources (pSD, &(pSD->iconAppearance), True);
4371 * Get the feedback subpart resources:
4372 * !!! only get "inactive" resources !!!
4375 _defaultBackground = _defaultColor2;
4376 _defaultActiveBackground = _defaultColor2;
4377 _pAppearanceData = &(pSD->feedbackAppearance);
4379 (void)XtGetSubresources (pSD->screenTopLevelW,
4380 (XtPointer) &(pSD->feedbackAppearance),
4381 WmNfeedback, WmCFeedback, wmAppearanceResources,
4382 XtNumber (wmAppearanceResources), NULL, 0);
4384 CheckForNoDither (&(pSD->feedbackAppearance));
4388 * Process the feedback resource values:
4391 /* make background, top and bottom shadow pixmaps */
4393 MakeAppearanceResources (pSD, &(pSD->feedbackAppearance), False);
4396 } /* END OF FUNCTION ProcessAppearanceResources */
4400 /*************************************<->*************************************
4402 * FallbackMakeTitleHeight (pAData)
4407 * This function makes title hight for AppearanceData
4408 * (using XExtentsOfFontSet on pAData->fontList)
4413 * pAData = pointer to appearance data structure containing resource info
4418 * *pAData - pAData->titleHeight is updated
4419 * return = 1 on success, 0 on failure (pAData->titleHeight is intact)
4421 *************************************<->***********************************/
4424 FallbackMakeTitleHeight (AppearanceData *pAData) {
4427 XmFontListEntry entry;
4429 XFontSetExtents *pExtents;
4432 XmFontListInitFontContext ( &fc, pAData->fontList);
4433 pAData->titleHeight = 0;
4434 entry = XmFontListNextEntry (fc);
4437 pFont = XmFontListEntryGetFont (entry, &type);
4440 case XmFONT_IS_FONT:
4441 /* does not really happen since XmeRenderTableGetDefaultFont
4442 seems to fail only on fontsets */
4444 case XmFONT_IS_FONTSET:
4445 if (!(pExtents = XExtentsOfFontSet ((XFontSet) pFont))) {
4448 if (WM_TITLE_BAR_PADDING + pExtents->max_logical_extent.height > pAData->titleHeight) {
4449 pAData->titleHeight = WM_TITLE_BAR_PADDING + pExtents->max_logical_extent.height;
4456 entry = XmFontListNextEntry (fc);
4458 XmFontListFreeFontContext (fc);
4463 /*************************************<->*************************************
4465 * MakeAppearanceResources (pSD, pAData, makeActiveResources)
4470 * This function makes top, bottom and background pixmaps for a window
4471 * manager component. Inactive and active (if specified) GC's are
4477 * pSD = pointer to screen data
4479 * pAData = pointer to appearance data structure containing resource info
4481 * makeActiveResources = if True then make active resources
4485 * *pAData = pixmap and GC fields filled out
4487 *************************************<->***********************************/
4490 MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources)
4495 * Extract a font from the font list.
4498 if (! XmeRenderTableGetDefaultFont(pAData->fontList, &(pAData->font)))
4500 sprintf((char *)wmGD.tmpBuffer, ((char *)GETMESSAGE(62, 23, "failed to load font: %.100s\0")), (char*) pAData->fontList);
4501 Warning((char *)wmGD.tmpBuffer);
4502 #if defined(CSRG_BASED) || defined(linux)
4503 /* HACK to try get _some_ font anyway (fontList seems to end up as an empty list on
4504 * some modern systems; investigate) */
4505 pAData->font = XLoadQueryFont(wmGD.display, "fixed");
4506 if (pAData->font == NULL)
4508 ExitWM(WM_ERROR_EXIT_VALUE);
4510 /* try to get right title hight using XExtentsOfFontSet: on UTF-8
4511 * locales XmeRenderTableGetDefaultFont does not return anything
4512 * when font is a compound fontset*/
4513 if (!FallbackMakeTitleHeight(pAData))
4515 /* failed to get height from fontList - falling back to fixed */
4516 pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
4517 + WM_TITLE_BAR_PADDING;
4520 ExitWM(WM_ERROR_EXIT_VALUE);
4523 /* got default font successfully, hack was not needed */
4524 #ifndef NO_MULTIBYTE
4526 * Calculate title bar's height (using selected font) and store it in pAData.
4528 pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
4529 + WM_TITLE_BAR_PADDING;
4536 * Make standard (inactive) appearance resources.
4539 /* background pixmap */
4541 if (pAData->backgroundPStr)
4543 pAData->backgroundPixmap = XmGetPixmap (
4544 ScreenOfDisplay (DISPLAY,
4546 pAData->backgroundPStr,
4548 pAData->background);
4550 if (pAData->backgroundPixmap == XmUNSPECIFIED_PIXMAP)
4552 pAData->backgroundPixmap = (Pixmap)NULL;
4557 pAData->backgroundPixmap = (Pixmap)NULL;
4560 /* top shadow pixmap */
4562 if (pAData->topShadowPStr)
4565 * Make sure top shadow color is not the same as background
4566 * otherwise the wrong pixmap will be generated.
4568 if (pAData->topShadowColor != pAData->background)
4569 foreground = pAData->topShadowColor;
4571 foreground = pAData->foreground;
4572 pAData->topShadowPixmap = XmGetPixmap (
4573 ScreenOfDisplay (DISPLAY,
4575 pAData->topShadowPStr,
4577 pAData->background);
4579 if (pAData->topShadowPixmap == XmUNSPECIFIED_PIXMAP)
4581 pAData->topShadowPixmap = (Pixmap)NULL;
4586 pAData->topShadowPixmap = (Pixmap)NULL;
4590 /* bottom shadow pixmap */
4592 if (pAData->bottomShadowPStr)
4595 * Make sure bottom shadow color is not the same as background
4596 * otherwise the wrong pixmap will be generated.
4598 if (pAData->bottomShadowColor != pAData->background)
4599 foreground = pAData->bottomShadowColor;
4601 foreground = pAData->foreground;
4602 pAData->bottomShadowPixmap = XmGetPixmap (
4603 ScreenOfDisplay (DISPLAY,
4605 pAData->bottomShadowPStr,
4607 pAData->background);
4609 if (pAData->bottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
4611 pAData->bottomShadowPixmap = (Pixmap)NULL;
4616 pAData->bottomShadowPixmap = (Pixmap)NULL;
4619 /* inactive appearance GC */
4621 GetAppearanceGCs (pSD,
4625 pAData->backgroundPixmap,
4626 pAData->topShadowColor,
4627 pAData->topShadowPixmap,
4628 pAData->bottomShadowColor,
4629 pAData->bottomShadowPixmap,
4630 &(pAData->inactiveGC),
4631 &(pAData->inactiveTopShadowGC),
4632 &(pAData->inactiveBottomShadowGC));
4637 * Make active apppearance resources if specified.
4640 if (!makeActiveResources)
4645 /* active background pixmap */
4647 if (pAData->activeBackgroundPStr)
4649 pAData->activeBackgroundPixmap = XmGetPixmap (
4650 ScreenOfDisplay (DISPLAY,
4652 pAData->activeBackgroundPStr,
4653 pAData->activeForeground,
4654 pAData->activeBackground);
4656 if (pAData->activeBackgroundPixmap == XmUNSPECIFIED_PIXMAP)
4658 pAData->activeBackgroundPixmap = (Pixmap)NULL;
4663 pAData->activeBackgroundPixmap = (Pixmap)NULL;
4666 /* active top shadow pixmap */
4668 if (pAData->activeTopShadowPStr)
4670 pAData->activeTopShadowPixmap = XmGetPixmap (
4671 ScreenOfDisplay (DISPLAY,
4673 pAData->activeTopShadowPStr,
4674 pAData->activeTopShadowColor,
4675 pAData->activeBackground);
4677 if (pAData->activeTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
4679 pAData->activeTopShadowPixmap = (Pixmap)NULL;
4684 pAData->activeTopShadowPixmap = (Pixmap)NULL;
4688 /* active bottom shadow pixmap */
4690 if (pAData->activeBottomShadowPStr)
4692 pAData->activeBottomShadowPixmap = XmGetPixmap (
4693 ScreenOfDisplay (DISPLAY,
4695 pAData->activeBottomShadowPStr,
4696 pAData->activeBottomShadowColor,
4697 pAData->activeBackground);
4699 if (pAData->activeBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
4701 pAData->activeBottomShadowPixmap = (Pixmap)NULL;
4706 pAData->activeBottomShadowPixmap = (Pixmap)NULL;
4709 /* inactive appearance GC */
4711 GetAppearanceGCs (pSD,
4712 pAData->activeForeground,
4713 pAData->activeBackground,
4715 pAData->activeBackgroundPixmap,
4716 pAData->activeTopShadowColor,
4717 pAData->activeTopShadowPixmap,
4718 pAData->activeBottomShadowColor,
4719 pAData->activeBottomShadowPixmap,
4720 &(pAData->activeGC),
4721 &(pAData->activeTopShadowGC),
4722 &(pAData->activeBottomShadowGC));
4725 } /* END OF FUNCTION MakeAppearanceResources */
4729 /*************************************<->*************************************
4731 * GetAppearanceGCs (pSD, fg, bg, font, bg_pixmap, ts_color,
4732 * ts_pixmap, bs_color, bs_pixmap, pGC, ptsGC, pbsGC)
4737 * Creates the appearance GCs for any of the icon, client, or feedback
4743 * pSD - pointer to screen data
4744 * fg - base foreground color
4745 * bg - base background color
4747 * bg_pixmap - background pixmap
4748 * ts_color - top shadow color
4749 * ts_pixmap - top shadow pixmap
4750 * bs_color - bottom shadow color
4751 * bs_pixmap - bottom shadow pixmap
4752 * pGC - pointer to location to receive base GC
4753 * ptsGC - pointer to location to receive top shadow GC
4754 * pbsGC - pointer to location to receive bottom shadow GC
4759 * *ptsGC - top shadow GC
4760 * *pbsGC - bottom shadow GC
4767 *************************************<->***********************************/
4770 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)
4780 mask = GCForeground | GCBackground | GCFont;
4781 gcv.foreground = fg;
4782 gcv.background = bg;
4783 gcv.font = font->fid;
4788 gcv.tile = bg_pixmap;
4791 *pGC = XCreateGC (DISPLAY, pSD->rootWindow, mask, &gcv);
4794 * !!! Need GC error detection !!!
4797 *ptsGC = GetHighlightGC (pSD, ts_color, bg, ts_pixmap);
4799 *pbsGC = GetHighlightGC (pSD, bs_color, bg, bs_pixmap);
4801 } /* END OF FUNCTION GetAppearanceGCs */
4806 /*************************************<->*************************************
4808 * ProcessScreenResources (pSD, screenName)
4813 * This function retrieves resources that are screen specific. If the
4814 * window manager is providing standard behavior then retrieve the limited
4815 * set of resources that don't affect standard behavior and set the
4816 * values of the other resources to the standard values.
4821 * pSD = pointer to screen data
4822 * screenName = name of screen
4827 * pSD = resource data for screen is set
4832 * o Gets subresources based on workspace name
4834 *************************************<->***********************************/
4837 ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName)
4840 pResSD = pSD; /* save current screen data for default processing */
4842 * Use the screen name (e.g., "0") as the default resource name.
4845 if (wmGD.useStandardBehavior)
4847 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4848 (String) screenName,
4849 (String) screenName,
4850 wmStdScreenResources,
4851 XtNumber (wmStdScreenResources), NULL, 0);
4854 * Fill in the standard resource values.
4857 SetStdScreenResourceValues (pSD);
4861 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4862 (String)screenName, (String) screenName,
4864 XtNumber (wmScreenResources), NULL, 0);
4866 #ifndef MOTIF_ONE_DOT_ONE
4867 pSD->moveOpaque = (((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW)))
4868 -> screen.moveOpaque);
4874 * Retrieve screen specific resources.
4877 if (wmGD.useStandardBehavior)
4879 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4880 (String) screenName, (String)screenName, wmStdScreenResources,
4881 XtNumber (wmStdScreenResources), NULL, 0);
4884 * Fill in the standard resource values.
4887 SetStdScreenResourceValues (pSD);
4891 XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD,
4892 (String)screenName, (String)screenName, wmScreenResources,
4893 XtNumber (wmScreenResources), NULL, 0);
4895 #ifndef MOTIF_ONE_DOT_ONE
4896 pSD->moveOpaque =(((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW)))
4897 -> screen.moveOpaque);
4903 * Do some additional processing on the window manager resource values.
4907 if (pSD->iconImageMinimum.width < ICON_IMAGE_MIN_WIDTH)
4909 pSD->iconImageMinimum.width = ICON_IMAGE_MIN_WIDTH;
4911 else if (pSD->iconImageMinimum.width > ICON_IMAGE_MAX_WIDTH)
4913 pSD->iconImageMinimum.width = ICON_IMAGE_MAX_WIDTH;
4916 if (pSD->iconImageMinimum.height < ICON_IMAGE_MIN_HEIGHT)
4918 pSD->iconImageMinimum.height = ICON_IMAGE_MIN_HEIGHT;
4920 else if (pSD->iconImageMinimum.height > ICON_IMAGE_MAX_HEIGHT)
4922 pSD->iconImageMinimum.height = ICON_IMAGE_MAX_HEIGHT;
4925 if (pSD->iconImageMaximum.width < pSD->iconImageMinimum.width)
4927 pSD->iconImageMaximum.width = pSD->iconImageMinimum.width;
4929 else if (pSD->iconImageMaximum.width > ICON_IMAGE_MAX_WIDTH)
4931 pSD->iconImageMaximum.width = ICON_IMAGE_MAX_WIDTH;
4934 if (pSD->iconImageMaximum.height < pSD->iconImageMinimum.height)
4936 pSD->iconImageMaximum.height = pSD->iconImageMinimum.height;
4938 else if (pSD->iconImageMaximum.height > ICON_IMAGE_MAX_HEIGHT)
4940 pSD->iconImageMaximum.height = ICON_IMAGE_MAX_HEIGHT;
4943 if (pSD->iconPlacementMargin > MAXIMUM_ICON_MARGIN)
4945 pSD->iconPlacementMargin = MAXIMUM_ICON_MARGIN;
4948 if (pSD->maximumMaximumSize.width <= 0)
4950 pSD->maximumMaximumSize.width =
4951 2 * DisplayWidth (DISPLAY, pSD->screen);
4954 if (pSD->maximumMaximumSize.height <= 0)
4956 pSD->maximumMaximumSize.height =
4957 2 * DisplayHeight (DISPLAY, pSD->screen);
4961 * Set the icon appearance default based on whether or not the icon box
4965 if (pSD->iconDecoration & USE_ICON_DEFAULT_APPEARANCE)
4967 if (pSD->useIconBox)
4969 pSD->iconDecoration = ICON_APPEARANCE_ICONBOX;
4973 pSD->iconDecoration = ICON_APPEARANCE_STANDALONE;
4978 * If resizeBorderWidth or frameBorderWidth is unset then initialize
4979 * to dynamic defaults.
4982 if ((pSD->resizeBorderWidth == (Dimension)BIGSIZE) ||
4983 (pSD->frameBorderWidth == (Dimension)BIGSIZE))
4985 double xres, yres, avg_res;
4987 xres = (((double) DisplayWidth(DISPLAY, pSD->screen)) /
4988 ((double) DisplayWidthMM(DISPLAY, pSD->screen)));
4989 yres = (((double) DisplayHeight(DISPLAY, pSD->screen)) /
4990 ((double) DisplayHeightMM(DISPLAY, pSD->screen)));
4992 avg_res = (xres + yres) / 2.0;
4994 /* Multiply times width in mm (avg. 7-8 pixels) */
4995 if (pSD->resizeBorderWidth == (Dimension)BIGSIZE)
4997 pSD->resizeBorderWidth = (int) (avg_res * 2.2);
4999 /* limit size because big borders look ugly */
5001 if (wmGD.frameStyle == WmSLAB)
5004 if (pSD->resizeBorderWidth > 6) pSD->resizeBorderWidth = 6;
5009 if (pSD->resizeBorderWidth > 7) pSD->resizeBorderWidth = 7;
5014 /* Multiply times width in mm (avg. 5-6 pixels) */
5015 if (pSD->frameBorderWidth == (Dimension)BIGSIZE)
5017 pSD->frameBorderWidth = (int) (avg_res * 1.7);
5019 /* limit size because big borders look ugly */
5020 if (wmGD.frameStyle == WmSLAB)
5022 if (pSD->frameBorderWidth > 4) pSD->frameBorderWidth = 4;
5026 if (pSD->frameBorderWidth > 5) pSD->frameBorderWidth = 5;
5032 pSD->externalBevel = FRAME_EXTERNAL_SHADOW_WIDTH;
5033 pSD->joinBevel = FRAME_INTERNAL_SHADOW_WIDTH;
5034 if (pSD->frameBorderWidth <
5035 (pSD->externalBevel + MIN_INTERNAL_BEVEL))
5037 pSD->frameBorderWidth =
5038 pSD->externalBevel + MIN_INTERNAL_BEVEL;
5040 else if (pSD->frameBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
5042 pSD->frameBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
5045 if (pSD->resizeBorderWidth <
5046 (pSD->externalBevel + MIN_INTERNAL_BEVEL))
5048 pSD->resizeBorderWidth =
5049 (pSD->externalBevel + MIN_INTERNAL_BEVEL);
5051 else if (pSD->resizeBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH)
5053 pSD->resizeBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH;
5058 * Update the resource database.
5060 WriteOutXrmColors (pSD);
5065 * Process the component appearance resources for client,
5066 * icon and feedback parts of mwm.
5069 ProcessAppearanceResources (pSD);
5073 * Process the workspace list and name the initial
5077 ProcessWorkspaceList (pSD);
5080 * Process default backdrop images to be used in low-color
5083 ProcessDefaultBackdropImages (pSD);
5087 * Save the default icon pixmap in global data. We'll use it only
5091 pSD->builtinIconPixmap =
5092 XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char *)iImage_bits,
5093 iImage_width, iImage_height);
5095 } /* END OF FUNCTION ProcessScreenResources */
5099 /*************************************<->*************************************
5101 * ProcessDefaultBackdropImages (pSD)
5106 * This function processes the default backdrop images to be used
5107 * in low color or black and white workspaces.
5112 * pSD = pointer to screen data
5117 * pSD = resource data for screen is set
5123 *************************************<->***********************************/
5126 ProcessDefaultBackdropImages (WmScreenData *pSD)
5128 } /* END OF FUNCTION ProcessDefaultBackdropImages */
5132 /*************************************<->*************************************
5134 * ProcessWorkspaceList (pSD)
5139 * This function processes the workspaceCount and workspaceList
5140 * resources for a particular screen. It creates space for the initial
5141 * workspace data structures and adds in names for workspaces.
5146 * pSD = pointer to screen data
5151 * pSD = resource data for screen is set
5156 * NOTE: The workspaceCount resource has precedence over the
5157 * workspaceList resource. workspaceCount determines the number of
5158 * workspaces to create for the screen. Once the number is determined,
5159 * workspaceList is used to fill in the "names." If workspaceList is
5160 * not present or doesn't have enough names, then missing names are
5161 * generated automatically. If workspaceList is present and
5162 * workspaceCount is not present, then the workspaceCount is determined
5163 * by the number of names in workspaceList.
5165 *************************************<->***********************************/
5168 ProcessWorkspaceList (WmScreenData *pSD)
5170 int i, wsNameCount, wsNamesAlloced;
5171 WmWorkspaceData *pwsI;
5172 unsigned char *lineP = NULL;
5173 unsigned char *string;
5174 Boolean bHaveWorkspaceList;
5175 Boolean bHaveWorkspaceCount;
5176 char **ppchWsNames = NULL;
5179 * Validate initial resource settings
5181 bHaveWorkspaceCount = (pSD->numWorkspaces >= 1);
5182 bHaveWorkspaceList = (pSD->workspaceList != NULL);
5184 if (bHaveWorkspaceList)
5187 * Parse out array of workspace names
5189 wsNamesAlloced = WS_ALLOC_AMOUNT;
5190 ppchWsNames = (char **) XtMalloc (wsNamesAlloced * sizeof (char *));
5191 if (pSD->workspaceList)
5193 lineP = (unsigned char *) pSD->workspaceList;
5197 lineP = (unsigned char *)NULL;
5201 while (((string = GetString(&lineP)) != NULL))
5203 ppchWsNames[wsNameCount] = (char *) string;
5205 if (++wsNameCount >= wsNamesAlloced)
5208 * Need to add more workspaces
5210 wsNamesAlloced += WS_ALLOC_AMOUNT;
5211 if (!(ppchWsNames = (char **) XtRealloc
5212 ((char *)ppchWsNames,
5213 wsNamesAlloced * sizeof(char *))))
5215 ExitWM (WM_ERROR_EXIT_VALUE);
5220 if (!bHaveWorkspaceCount)
5222 pSD->numWorkspaces = wsNameCount;
5225 else if (!bHaveWorkspaceCount)
5228 * Neither workspaceCount nor workspaceList specified!!
5229 * Assume one workspace.
5231 pSD->numWorkspaces = 1;
5234 if (pSD->numWorkspaces > MAX_WORKSPACE_COUNT)
5235 pSD->numWorkspaces = MAX_WORKSPACE_COUNT;
5238 * Allocate the array of workspace data
5240 pSD->numWsDataAllocated = (pSD->numWorkspaces + WS_ALLOC_AMOUNT);
5241 pSD->numWsDataAllocated -= pSD->numWsDataAllocated % WS_ALLOC_AMOUNT;
5242 if (!(pSD->pWS = (WmWorkspaceData *)
5243 XtMalloc (pSD->numWsDataAllocated * sizeof(WmWorkspaceData))))
5245 ExitWM (WM_ERROR_EXIT_VALUE);
5250 for (i = 0; i < pSD->numWorkspaces; i++, pwsI++)
5252 if (bHaveWorkspaceList && i < wsNameCount)
5254 string = (unsigned char *) ppchWsNames[i];
5258 string = GenerateWorkspaceName (pSD, i);
5260 if (!(pwsI->name = (String) XtMalloc (1+strlen((char *)string))))
5262 Warning (((char *)GETMESSAGE(62, 27, "Insufficient memory for workspace data")));
5263 ExitWM(WM_ERROR_EXIT_VALUE);
5267 strcpy(pwsI->name, (char *)string);
5271 if (ppchWsNames) XtFree ((char *) ppchWsNames);
5273 } /* END OF FUNCTION ProcessWorkspaceList */
5278 /******************************<->*************************************
5280 * ProcessWorkspaceResources (pWS)
5285 * This function retrieves resources that are workspace specific. If the
5286 * window manager is providing standard behavior then retrieve the limited
5287 * set of resources that don't affect standard behavior and set the
5288 * values of the other resources to the standard values.
5293 * pWS = pointer to workspace data
5298 * pWS = resource data for workspace is set
5303 * o Gets subresources based on workspace name
5305 ******************************<->***********************************/
5308 ProcessWorkspaceResources (WmWorkspaceData *pWS)
5312 * Retrieve workspace specific resources.
5315 pResWS = pWS; /* save current ws for default processing */
5318 if (wmGD.useStandardBehavior)
5320 XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
5321 pWS->name, pWS->name, wmStdWorkspaceResources,
5322 XtNumber (wmStdWorkspaceResources), NULL, 0);
5325 * Fill in the standard resource values.
5327 * (no code for this right now)
5330 pWS->iconBoxGeometry = NULL;
5335 XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS,
5336 pWS->name, pWS->name, wmWorkspaceResources,
5337 XtNumber (wmWorkspaceResources), NULL, 0);
5340 /* Dup iconbox geometry, it may be free'd later on. */
5342 if (pWS->iconBoxGeometry)
5344 pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
5350 if (pWS->title == NULL)
5353 * Setup default workspace title
5355 pWS->title = XmStringCreateLocalized(pWS->name);
5360 * Copy resource just in case there's a duplicate
5361 * Duplicates point to the same data, freeing on
5362 * rename can cause a crash.
5364 pWS->title = XmStringCopy(pWS->title);
5369 * Dup iconbox geometry, it may be free'd later on.
5371 if (pWS->iconBoxGeometry)
5373 pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry);
5377 * Get backdrop resources
5379 XtGetSubresources (pWS->workspaceTopLevelW,
5380 (XtPointer) &(pWS->backdrop),
5381 WmNbackdrop, WmCBackdrop, wmBackdropResources,
5382 XtNumber (wmBackdropResources), NULL, 0);
5384 ProcessBackdropResources (pWS, 0);
5387 } /* END OF FUNCTION ProcessWorkspaceResources */
5391 /******************************<->*************************************
5393 * ProcessPresenceResources (pSD)
5398 * This function retrieves resources for the workspace presence
5403 * pSD = pointer to screen data
5408 * pSD = resource data for workspace presence dialog are set
5413 * o Gets subresources
5415 ******************************<->***********************************/
5418 ProcessPresenceResources (WmScreenData *pSD)
5420 #ifndef NO_MESSAGE_CATALOG
5421 static char *default_ws_pres_title = NULL;
5423 static char *default_ws_pres_title = "Workspace Presence";
5427 unsigned char *pch1, *pch2;
5429 #ifndef NO_MESSAGE_CATALOG
5431 * Set up localized default title string on initial time through
5433 if (default_ws_pres_title == NULL)
5437 * catgets returns a pointer to an area that is over written
5438 * on each call to catgets.
5441 tmpString = ((char *)GETMESSAGE(62, 59, "Occupy Workspace"));
5442 if ((default_ws_pres_title =
5443 (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL)
5445 Warning (((char *)GETMESSAGE(62, 31, "Insufficient memory for local message string")));
5446 default_ws_pres_title = "Occupy Workspace";
5450 strcpy(default_ws_pres_title, tmpString);
5455 if (pSD->presence.shellW)
5457 XtGetSubresources (pSD->presence.shellW, (XtPointer) &pSD->presence,
5458 WmNworkspacePresence, WmCWorkspacePresence,
5459 wmWsPresenceResources,
5460 XtNumber (wmWsPresenceResources), NULL, 0);
5464 if (pSD->presence.title)
5466 pch1 = (unsigned char *)
5467 WmXmStringToString (pSD->presence.title);
5469 if (pch1 && (pch2 = (unsigned char *)
5470 XtMalloc (1+strlen((char *)pch1))))
5472 strcpy ((char *)pch2, (char *)pch1);
5478 pch2 = (unsigned char *) default_ws_pres_title;
5482 XtSetArg (args[n], XmNtitle, pch2); n++;
5483 XtSetValues (pSD->presence.shellW, args, n);
5486 } /* END OF FUNCTION ProcessPresenceResources */
5490 /*************************************<->*************************************
5492 * ProcessClientResources (pCD)
5497 * This function retrieves resources that are client specific. If the
5498 * window manager is providing standard behavior then retrieve the limited
5499 * set of resources that don't affect standard behavior and set the
5500 * values of the other resources to the standard values.
5505 * pCD = pointer to client data
5510 * pCD = resource data for client is set
5515 * o Gets subresources based on client name and class.
5516 * o Creates GC for the client Matte, if there is one.
5518 *************************************<->***********************************/
5521 ProcessClientResources (ClientData *pCD)
5525 WmScreenData *pSD = pCD->pSD;
5528 * Retrieve basic client specific resources.
5531 _pCD = pCD; /* save in static global for dynamic default processing */
5532 clientName = (pCD->clientName) ? pCD->clientName : WmNdefaults;
5533 clientClass = (pCD->clientClass) ? pCD->clientClass : WmNdefaults;
5535 if (wmGD.useStandardBehavior)
5537 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5538 clientClass, wmStdClientResources, XtNumber (wmStdClientResources),
5542 * Fill in the standard resource values.
5545 SetStdClientResourceValues (pCD);
5549 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5550 clientClass, wmClientResources, XtNumber (wmClientResources), NULL,
5554 #ifdef NO_MESSAGE_CATALOG
5556 * If (window menu spec is not found) then use the builtin
5560 if ((pCD->systemMenu == defaultSystemMenuName) &&
5561 (pSD->defaultSystemMenuUseBuiltin == TRUE))
5563 pCD->systemMenu = builtinSystemMenuName;
5568 * If the client decorations or client functions have been defaulted
5569 * fix up the fields in the ProcessMwmHints function.
5573 /* make top and bottom shadow pixmaps */
5575 if (pCD->iconImageBottomShadowPStr)
5577 if ((pCD->iconImageBottomShadowPStr ==
5578 pSD->iconAppearance.bottomShadowPStr) &&
5579 (pCD->iconImageBottomShadowColor ==
5580 pSD->iconAppearance.bottomShadowColor) &&
5581 (pCD->iconImageBackground ==
5582 pSD->iconAppearance.background))
5584 pCD->iconImageBottomShadowPixmap =
5585 pSD->iconAppearance.bottomShadowPixmap;
5589 pCD->iconImageBottomShadowPixmap =
5590 XmGetPixmap ( ScreenOfDisplay (DISPLAY,
5592 pCD->iconImageBottomShadowPStr,
5593 pCD->iconImageBottomShadowColor,
5594 pCD->iconImageBackground);
5596 if (pCD->iconImageBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
5598 pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
5604 pCD->iconImageBottomShadowPixmap = (Pixmap)NULL;
5607 if (pCD->iconImageTopShadowPStr)
5609 if ((pCD->iconImageTopShadowPStr ==
5610 pSD->iconAppearance.topShadowPStr) &&
5611 (pCD->iconImageTopShadowColor ==
5612 pSD->iconAppearance.topShadowColor) &&
5613 (pCD->iconImageBackground == pSD->iconAppearance.background))
5615 pCD->iconImageTopShadowPixmap =
5616 pSD->iconAppearance.topShadowPixmap;
5620 pCD->iconImageTopShadowPixmap =
5621 XmGetPixmap ( ScreenOfDisplay (DISPLAY,
5623 pCD->iconImageTopShadowPStr,
5624 pCD->iconImageTopShadowColor,
5625 pCD->iconImageBackground);
5627 if (pCD->iconImageTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
5629 pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
5635 pCD->iconImageTopShadowPixmap = (Pixmap)NULL;
5638 if ((pCD->internalBevel < MIN_INTERNAL_BEVEL) ||
5639 (pCD->internalBevel > MAX_INTERNAL_BEVEL))
5641 pCD->internalBevel = MAX_INTERNAL_BEVEL;
5646 * Retrieve matte resources and make internal matte resources.
5649 if (pCD->matteWidth > 0)
5651 XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName,
5652 clientClass, wmClientResourcesM, XtNumber (wmClientResourcesM),
5655 /* make top and bottom shadow pixmaps */
5658 if (pCD->matteBottomShadowPStr &&
5659 (!strcmp(pCD->matteBottomShadowPStr, _NoDither)))
5661 pCD->matteBottomShadowPStr = NULL;
5664 if (pCD->matteBottomShadowPStr)
5666 if ((pCD->matteBottomShadowPStr ==
5667 pSD->clientAppearance.bottomShadowPStr) &&
5668 (pCD->matteBottomShadowColor ==
5669 pSD->clientAppearance.bottomShadowColor) &&
5670 (pCD->matteBackground == pSD->clientAppearance.background))
5672 pCD->matteBottomShadowPixmap =
5673 pSD->clientAppearance.bottomShadowPixmap;
5677 pCD->matteBottomShadowPixmap =
5678 XmGetPixmap (ScreenOfDisplay (DISPLAY,
5680 pCD->matteBottomShadowPStr,
5681 pCD->matteBottomShadowColor,
5682 pCD->matteBackground);
5684 if (pCD->matteBottomShadowPixmap == XmUNSPECIFIED_PIXMAP)
5686 pCD->matteBottomShadowPixmap = (Pixmap)NULL;
5692 pCD->matteBottomShadowPixmap = (Pixmap)NULL;
5696 if (pCD->matteTopShadowPStr &&
5697 (!strcmp(pCD->matteTopShadowPStr, _NoDither)))
5699 pCD->matteTopShadowPStr = NULL;
5702 if (pCD->matteTopShadowPStr)
5704 if ((pCD->matteTopShadowPStr ==
5705 pSD->clientAppearance.topShadowPStr) &&
5706 (pCD->matteTopShadowColor ==
5707 pSD->clientAppearance.topShadowColor) &&
5708 (pCD->matteBackground == pSD->clientAppearance.background))
5710 pCD->matteTopShadowPixmap =
5711 pSD->clientAppearance.topShadowPixmap;
5715 pCD->matteTopShadowPixmap =
5716 XmGetPixmap (ScreenOfDisplay (DISPLAY,
5718 pCD->matteTopShadowPStr,
5719 pCD->matteTopShadowColor,
5720 pCD->matteBackground);
5722 if (pCD->matteTopShadowPixmap == XmUNSPECIFIED_PIXMAP)
5724 pCD->matteTopShadowPixmap = (Pixmap)NULL;
5730 pCD->matteTopShadowPixmap = (Pixmap)NULL;
5734 /* make top and bottom shadow GC's */
5736 pCD->clientMatteTopShadowGC = GetHighlightGC (pCD->pSD,
5737 pCD->matteTopShadowColor,
5738 pCD->matteBackground,
5739 pCD->matteTopShadowPixmap);
5741 pCD->clientMatteBottomShadowGC = GetHighlightGC (pCD->pSD,
5742 pCD->matteBottomShadowColor,
5743 pCD->matteBackground,
5744 pCD->matteBottomShadowPixmap);
5747 } /* END OF FUNCTION ProcessClientResources */
5751 /*************************************<->*************************************
5753 * SetStdClientResourceValues (pCD)
5758 * This function sets client resource data to standard values. This setting
5759 * is done in place of getting the values from the user settings in
5760 * the resource database.
5764 * pCD = pointer to the client data
5769 * pCD = (client data filled out with resource values)
5771 *************************************<->***********************************/
5774 SetStdClientResourceValues (ClientData *pCD)
5776 pCD->clientDecoration = WM_DECOR_DEFAULT;
5777 pCD->clientFunctions = WM_FUNC_DEFAULT;
5778 pCD->focusAutoRaise = True;
5779 pCD->systemMenu = builtinSystemMenuName;
5780 pCD->usePPosition = USE_PPOSITION_NONZERO;
5781 pCD->ignoreWMSaveHints = True;
5783 } /* END OF FUNCTION SetStdClientResourceValues */
5787 /******************************<->*************************************
5789 * SetStdScreenResourceValues (pSD)
5794 * This function sets screen resource data to standard values. This setting
5795 * is done in place of getting the values from the user settings in
5796 * the resource database.
5800 * pSD = pointer to the screen data
5805 * pSD = (screen data filled out with resource values)
5807 ******************************<->***********************************/
5810 SetStdScreenResourceValues (WmScreenData *pSD)
5812 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
5813 pSD->rootMenu = builtinRootMenuName;
5814 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
5815 pSD->buttonBindings = builtinButtonBindingsName;
5816 pSD->cleanText = True;
5817 pSD->iconDecoration =
5818 (ICON_LABEL_PART | ICON_IMAGE_PART | ICON_ACTIVE_LABEL_PART);
5819 pSD->iconPlacement =
5820 (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY);
5821 pSD->keyBindings = builtinKeyBindingsName;
5822 pSD->limitResize = True;
5823 pSD->resizeCursors = True;
5824 pSD->transientDecoration = (WM_DECOR_SYSTEM | WM_DECOR_RESIZEH);
5825 pSD->transientFunctions =
5826 (WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE |
5828 pSD->useIconBox = False;
5830 pSD->feedbackGeometry = NULL;
5831 pSD->moveOpaque = False;
5833 } /* END OF FUNCTION SetStdScreenResourceValues */
5836 /*************************************<->*************************************
5838 * GetHighlightGC (pSD, fg, bg, pixmap)
5843 * Get a graphic context for either drawing top- or bottom-shadow
5849 * pSD = pointer to screen data
5850 * fg = foreground color
5851 * bg = background color
5852 * pixmap = pixmap for highlight
5856 * RETRUN = GC with the input parameters incorporated.
5858 *************************************<->***********************************/
5860 GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap)
5866 mask = GCForeground | GCBackground | GCLineWidth | GCFillStyle;
5867 gcv.background = bg;
5868 gcv.foreground = fg;
5873 mask |= GCFillStyle | GCTile;
5874 gcv.fill_style = FillTiled;
5879 gcv.fill_style = FillSolid;
5884 * NOTE: If additional mask bits are added, modify WmGetGC()
5885 * in WmGraphics.c to check those values for matches.
5888 return (WmGetGC (pSD, mask, &gcv));
5889 #endif /* OLD_CODE */
5891 return (XtGetGC (pSD->screenTopLevelW, mask, &gcv));
5893 } /* END OF FUNCTION GetHighlightGC */
5897 /*************************************<->*************************************
5899 * _WmGetDynamicDefault (widget, type, defaultColor, newBackground, value)
5904 * This function is used to generate a default color of the requested
5905 * type. Default colors are generated for a 3-D appearance.
5910 * widget = this is the widget that is associated with the resource or
5911 * that is the reference widget for the wm subpart.
5913 * type = this is the type of color resource (e.g., top shadow color).
5915 * defaultColor = pointer to default color name/specification.
5917 * newBackground = background pixel for generating 3-D colors.
5922 * value = pointer to the XrmValue in which to store the color
5924 *************************************<->***********************************/
5927 _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value)
5929 static Screen *oldScreen = NULL;
5930 static Screen *newScreen;
5931 static Colormap oldColormap;
5932 static Colormap newColormap;
5933 static Pixel newValue;
5934 static Pixel background;
5935 static String oldDefaultColor = DEFAULT_COLOR_NONE;
5936 static XmColorData colorData;
5938 /* initialize the return value */
5940 value->size = sizeof (newValue);
5941 value->addr = (char *)&newValue;
5945 * Process monochrome defaults first.
5948 newScreen = XtScreen (widget);
5950 if (Monochrome (newScreen))
5955 * Check color server sets for this screen.
5957 if (wmGD.statusColorServer == CSERVE_NORMAL)
5962 for (i = 0; i < wmGD.numScreens; i++)
5964 if (XScreenNumberOfScreen(newScreen) == wmGD.Screens[i].screen)
5966 pSD = &wmGD.Screens[i];
5975 for (i = 0; i < XmCO_MAX_NUM_COLORS; i++)
5977 if (pSD->pPixelData[i].bg == newBackground)
5981 case WmFGC: newValue = pSD->pPixelData[i].fg; break;
5982 case WmBGC: newValue = pSD->pPixelData[i].bg; break;
5983 case WmTSC: newValue = pSD->pPixelData[i].ts; break;
5984 case WmBSC: newValue = pSD->pPixelData[i].bs; break;
5998 case WmFGC: newValue = BlackPixelOfScreen (newScreen); break;
5999 case WmBGC: newValue = WhitePixelOfScreen (newScreen); break;
6000 case WmTSC: newValue = WhitePixelOfScreen (newScreen); break;
6001 case WmBSC: newValue = BlackPixelOfScreen (newScreen); break;
6011 * Check to see if appropriate colors are available from the
6012 * previous request; if the color is a background color then get
6013 * default colors. Generate 3-D colors if necessary. Maintain
6014 * new colors in static variables for later reuse.
6017 newColormap = widget->core.colormap;
6019 if ((oldScreen != NULL) && (oldScreen == newScreen) &&
6020 (oldColormap == newColormap) && (type != WmBGC) &&
6021 (background == newBackground))
6024 else if ((oldScreen == newScreen) && (oldColormap == newColormap) &&
6025 (type == WmBGC) && (oldDefaultColor == defaultColor))
6028 else if (type == WmBGC)
6031 * Find or generate a background color and associated 3-D colors.
6034 oldDefaultColor = defaultColor;
6036 * Fix for CR 5152 - Due to the use of Realloc in the color caches,
6037 * a static pointer is not acceptable. Change it
6038 * to a static structure to maintain the data
6040 colorData = *_WmGetDefaultColors (newScreen, newColormap, defaultColor);
6045 * Find or generate a color based on the associated background color.
6048 oldDefaultColor = DEFAULT_COLOR_NONE;
6049 background = newBackground;
6051 XmGetColors(newScreen, newColormap, background,
6052 &colorData.foreground.pixel,
6053 &colorData.top_shadow.pixel,
6054 &colorData.bottom_shadow.pixel,
6055 &colorData.select.pixel);
6058 oldScreen = newScreen;
6059 oldColormap = newColormap;
6063 * Set up the return value.
6066 colorData.allocated |= type;
6069 case XmBACKGROUND: newValue = colorData.background.pixel; break;
6070 case XmFOREGROUND: newValue = colorData.foreground.pixel; break;
6071 case XmTOP_SHADOW: newValue = colorData.top_shadow.pixel; break;
6072 case XmBOTTOM_SHADOW: newValue = colorData.bottom_shadow.pixel; break;
6073 case XmSELECT: newValue = colorData.select.pixel; break;
6074 default: newValue = colorData.background.pixel; break;
6077 } /* END OF FUNCTION _WmGetDynamicDefault */
6081 /*************************************<->*************************************
6083 * _WmGetDefaultColors (screen, colormap, defaultColor)
6088 * This function is used to find or generate default 3-D colors based on a
6089 * default background color.
6094 * screen = screen for which colors are to be generated.
6096 * colormap = colormap that is to be used to make colors.
6098 * defaultColor = pointer to a default color name/specification.
6103 * RETURN = pointer to WmColorData structure containing 3-D colors.
6105 *************************************<->***********************************/
6107 XmColorData * _WmGetDefaultColors (screen, colormap, defaultColor)
6110 String defaultColor;
6113 static XmColorData *defaultSet[2] = {NULL, NULL};
6114 static int defaultCount[2] = {0, 0};
6115 static int defaultSize[2] = {0, 0};
6117 register XmColorData *set;
6121 Display *display = DisplayOfScreen (screen);
6125 * Fix for CR 5152 - Due to the use of Realloc with _XmGetColors, it is
6126 * necessary to maintain a separate cache of color
6127 * data. The Realloc may cause the data to be moved,
6128 * and the cache would contain pointers into the heap.
6132 * Look through the cache to see if the defaults are already in the
6133 * cache. There is a list of cached defaults for each default color.
6136 if (defaultColor == _defaultColor2)
6145 set = defaultSet[setId];
6146 count = defaultCount[setId];
6147 size = defaultSize[setId];
6149 for (i = 0; i < count; i++)
6151 if (((set + i)->screen == screen) && ((set + i)->color_map == colormap))
6158 * No match in the cache, make a new entry and generate the colors.
6163 size = (defaultSize[setId] += 10);
6164 set = defaultSet[setId] =
6165 (XmColorData *)WmRealloc ((char *) defaultSet[setId],
6166 sizeof (XmColorData) * size);
6170 * Make the default background color for the resource set.
6173 if(!XParseColor (display, colormap, defaultColor, &colorDef))
6175 if(!(strcmp(defaultColor, _defaultColor1)))
6177 XParseColor (display, colormap, _defaultColor1HEX, &colorDef);
6181 XParseColor (display, colormap, _defaultColor2HEX, &colorDef);
6185 XAllocColor (display, colormap, &colorDef);
6189 * Generate the 3-D colors and save them in the defaults cache.
6192 XmGetColors(screen, colormap, colorDef.pixel,
6193 &set[count].foreground.pixel,
6194 &set[count].top_shadow.pixel,
6195 &set[count].bottom_shadow.pixel,
6196 &set[count].select.pixel);
6198 set[count].background.pixel = colorDef.pixel;
6200 set[count].screen = screen;
6201 set[count].color_map = colormap;
6202 set[count].allocated = True;
6204 XQueryColor(DISPLAY, colormap, &(set[count].background));
6205 XQueryColor(DISPLAY, colormap, &(set[count].foreground));
6206 XQueryColor(DISPLAY, colormap, &(set[count].top_shadow));
6207 XQueryColor(DISPLAY, colormap, &(set[count].bottom_shadow));
6208 XQueryColor(DISPLAY, colormap, &(set[count].select));
6210 (defaultCount[setId])++;
6212 return (set + count);
6215 } /* END OF FUNCTION _WmGetDefaultColors */
6219 /*************************************<->*************************************
6221 * WmRealloc (ptr, size)
6226 * This function is used reallocate a block of storage that has been
6232 * ptr = pointer to storage that is to be realloc'ed; if NULL malloc an
6233 * initial block of storage.
6235 * size = size of new storage
6239 * RETURN = pointer to realloc'ed block of storage
6241 *************************************<->***********************************/
6243 char * WmRealloc (ptr, size)
6250 ptr = (char *)XtRealloc (ptr, size);
6254 ptr = (char *)XtMalloc (size);
6259 Warning (((char *)GETMESSAGE(62, 37, "Insufficient memory for window manager data")));
6264 } /* END OF FUNCTION WmRealloc */
6268 /*************************************<->*************************************
6270 * WmMalloc (ptr, size)
6275 * This function is used malloc a block of storage. If a previous block
6276 * of storage is being replace the old block is free'd.
6281 * ptr = pointer to storage that is to be replaced (free'd).
6283 * size = size of new storage
6287 * RETURN = pointer to malloc'ed block of storage
6289 *************************************<->***********************************/
6291 char * WmMalloc (ptr, size)
6301 ptr = (char *)XtMalloc (size);
6305 Warning (((char *)GETMESSAGE(62, 38, "Insufficient memory for window manager data")));
6310 } /* END OF FUNCTION WmMalloc */
6314 /*************************************<->*************************************
6316 * SetupDefaultResources (pSD)
6321 * This function is used to setup default (builtin) resources for the
6327 * pSD = pointer to screen data
6328 * wmGD = (defaultKeyBindingsString, ...)
6330 * builtinKeyBindingsName = name of default key bindings set
6337 *************************************<->***********************************/
6340 SetupDefaultResources (pSD)
6345 KeySpec *nextKeySpec;
6351 * If (using DefaultBindings mechanism and bindings are not found in .mwmrc)
6352 * then use the builtin bindings.
6354 if (!pSD->keySpecs && !wmGD.useStandardBehavior)
6357 * Print warning if user is NOT using "DefaultKeyBindings".
6359 if (strcmp (pSD->keyBindings, defaultKeyBindingsName))
6361 MWarning (((char *)GETMESSAGE(62, 67, "Key bindings %s not found, using builtin key bindings\n")),
6364 pSD->keyBindings = builtinKeyBindingsName;
6367 if (!pSD->buttonSpecs && !wmGD.useStandardBehavior)
6370 * Print warning if user is NOT using "DefaultButtonBindings".
6372 if (strcmp (pSD->buttonBindings, defaultButtonBindingsName))
6374 MWarning (((char *)GETMESSAGE(62, 68, "Button bindings %s not found, using builtin button bindings\n")),
6375 pSD->buttonBindings);
6377 pSD->buttonBindings = builtinButtonBindingsName;
6380 if (pSD->keyBindings == builtinKeyBindingsName)
6383 * Default key specifications are to be used and no default
6384 * set has been provided by the user. Make the built-in default
6388 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
6390 * Before parsing the string, substitute the real name for
6391 * the default rootmenu using the resource rootMenu
6392 * for the %s in the string.
6397 buffer = (char *) XtMalloc(strlen(builtinKeyBindings) +
6398 strlen(pSD->rootMenu) + 1);
6399 sprintf(buffer, builtinKeyBindings, pSD->rootMenu);
6401 ParseKeyStr (pSD, (unsigned char *)buffer);
6403 ParseKeyStr (pSD, (unsigned char *)builtinKeyBindings);
6404 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
6409 * Add the switch behavior key binding to the front of the list
6410 * of user specified key bindings that have been parsed.
6413 nextKeySpec = pSD->keySpecs;
6414 keyBindings = pSD->keyBindings;
6415 pSD->keyBindings = behaviorKeyBindingName;
6416 pSD->keySpecs = NULL;
6418 ParseKeyStr (pSD, (unsigned char *)behaviorKeyBindings);
6422 /* Skip past the TWO key definitions (1.2 & 1.1.4) */
6423 pSD->keySpecs->nextKeySpec->nextKeySpec = nextKeySpec;
6427 pSD->keySpecs = nextKeySpec;
6429 pSD->keyBindings = keyBindings;
6432 if (pSD->buttonBindings == builtinButtonBindingsName)
6435 * Default button specifications are to be used and no default
6436 * set has been provided by the user. Make the built-in default
6440 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL))
6442 * Before parsing the string, substitute the real name for
6443 * the default rootmenu using the resource rootMenu
6444 * for the %s in the string.
6449 buffer = (char *) XtMalloc(strlen(builtinButtonBindings) +
6450 strlen(pSD->rootMenu) + 1);
6451 sprintf(buffer, builtinButtonBindings, pSD->rootMenu);
6453 ParseButtonStr (pSD, (unsigned char *)buffer);
6455 ParseButtonStr (pSD, (unsigned char *)builtinButtonBindings);
6456 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */
6459 #ifdef NO_MESSAGE_CATALOG
6461 * Set defaultSystemMenuUseBuiltin to FALSE if DefaultWindowMenu spec
6465 menuSpec = pSD->menuSpecs;
6468 if (!strcmp(menuSpec->name, defaultSystemMenuName))
6470 pSD->defaultSystemMenuUseBuiltin = FALSE;
6473 menuSpec = menuSpec->nextMenuSpec;
6477 } /* END OF FUNCTION SetupDefaultResources */
6481 /*************************************<->*************************************
6483 * SimilarAppearanceData (pAD1, pAD2)
6488 * This function returns True if the two passed sets of AppearanceData
6489 * are similar. This is designed to compare appearance data before
6490 * creation of the GCs.
6495 * pAD1 pointer to AppearanceData 1
6496 * pAD2 pointer to AppearanceData 2
6501 * Function returns True if similar, False otherwise.
6505 * This function is only used to compare the client
6506 * and client*title appearance data.
6507 *************************************<->***********************************/
6509 Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2)
6514 if ((pAD1->fontList == pAD2->fontList) &&
6515 (pAD1->background == pAD2->background) &&
6516 (pAD1->foreground == pAD2->foreground) &&
6517 (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
6518 (pAD1->backgroundPixmap == pAD2->backgroundPixmap) &&
6519 (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
6520 (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
6521 (pAD1->bottomShadowPixmap == pAD2->bottomShadowPixmap) &&
6522 (pAD1->topShadowColor == pAD2->topShadowColor) &&
6523 (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
6524 (pAD1->topShadowPixmap == pAD2->topShadowPixmap) &&
6525 (pAD1->activeBackground == pAD2->activeBackground) &&
6526 (pAD1->activeForeground == pAD2->activeForeground) &&
6527 (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
6528 (pAD1->activeBackgroundPixmap == pAD2->activeBackgroundPixmap) &&
6529 (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
6530 (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
6531 (pAD1->activeBottomShadowPixmap == pAD2->activeBottomShadowPixmap) &&
6532 (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
6533 (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) &&
6534 (pAD1->activeTopShadowPixmap == pAD2->activeTopShadowPixmap) )
6537 * !!! Should find out why all the Pixmap resources are unset !!!
6540 if ((pAD1->fontList == pAD2->fontList) &&
6541 (pAD1->background == pAD2->background) &&
6542 (pAD1->foreground == pAD2->foreground) &&
6543 (pAD1->backgroundPStr == pAD2->backgroundPStr) &&
6544 (pAD1->bottomShadowColor == pAD2->bottomShadowColor) &&
6545 (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) &&
6546 (pAD1->topShadowColor == pAD2->topShadowColor) &&
6547 (pAD1->topShadowPStr == pAD2->topShadowPStr) &&
6548 (pAD1->activeBackground == pAD2->activeBackground) &&
6549 (pAD1->activeForeground == pAD2->activeForeground) &&
6550 (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) &&
6551 (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) &&
6552 (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) &&
6553 (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) &&
6554 (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) )
6566 } /* END OF FUNCTION SimilarAppearanceData */
6570 /*************************************<->*************************************
6572 * Monochrome (screen)
6577 * This function returns True if the screen passed it to be treated
6578 * as monochrome for the purpose of assigning default resources.
6583 * screen pointer to Screen
6588 * Function returns True if monochrome (or Static Gray), False otherwise.
6590 *************************************<->***********************************/
6593 Monochrome (Screen *screen)
6599 if (wmGD.statusColorServer == CSERVE_NORMAL)
6601 for (scr = 0; scr < wmGD.numScreens; scr++)
6603 pSD = &(wmGD.Screens[scr]);
6607 if (XScreenOfDisplay (DISPLAY, pSD->screen) == screen)
6609 if (pSD->colorUse == XmCO_BLACK_WHITE)
6622 * If we don't know the answer to our question by now,
6623 * fall back to the old mwm way of determining monochromicity.
6627 return ((DefaultDepthOfScreen(screen) == 1));
6628 } /* END OF FUNCTION Monochrome */
6631 /**************************** eof ***************************/