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
23 /* $TOG: OWsync.c /main/4 1998/07/23 18:11:12 mgreess $ */
24 /*******************************************************************************
28 ** Implements functions to synchronize CDE and OpenWindows resources.
30 ** Copyright 1995 Sun Microsystems, Inc. All rights reserved.
32 *******************************************************************************/
39 * Include the appropriate header for the ColorSet structure
41 #if defined(dtsession)
43 #elif defined(dtstyle)
44 #include "ColorMain.h"
48 * Sync OW Color resources with CDE color object values
57 int winChip, dataChip, wsChip;
59 switch (monitorType) {
61 winChip = 4; dataChip = 3; wsChip = 7;
63 case XmCO_MEDIUM_COLOR:
64 winChip = 1; dataChip = 3; wsChip = 1;
67 case XmCO_BLACK_WHITE:
68 winChip = 1; dataChip = 1; wsChip = 1;
75 "*background:\t#%04X%04X%04X\n\
76 *foreground:\t#%04X%04X%04X\n\
77 OpenWindows.WindowColor:\t#%04X%04X%04X\n\
78 OpenWindows.WindowForeground:\t#%04X%04X%04X\n\
79 OpenWindows.WorkspaceColor:\t#%04X%04X%04X\n\
80 OpenWindows.DataBackground:\t#%04X%04X%04X\n\
81 OpenWindows.DataForeground:\t#%04X%04X%04X\n\
82 Window.Color.Background:\t#%04X%04X%04X\n\
83 Window.Color.Foreground:\t#%04X%04X%04X\n",
84 colors[winChip].bg.red,
85 colors[winChip].bg.green,
86 colors[winChip].bg.blue,
87 colors[winChip].fg.red,
88 colors[winChip].fg.green,
89 colors[winChip].fg.blue,
90 colors[winChip].bg.red,
91 colors[winChip].bg.green,
92 colors[winChip].bg.blue,
93 colors[winChip].fg.red,
94 colors[winChip].fg.green,
95 colors[winChip].fg.blue,
96 colors[wsChip].bg.red,
97 colors[wsChip].bg.green,
98 colors[wsChip].bg.blue,
99 colors[dataChip].bg.red,
100 colors[dataChip].bg.green,
101 colors[dataChip].bg.blue,
102 colors[dataChip].fg.red,
103 colors[dataChip].fg.green,
104 colors[dataChip].fg.blue,
105 colors[dataChip].bg.red,
106 colors[dataChip].bg.green,
107 colors[dataChip].bg.blue,
108 colors[dataChip].fg.red,
109 colors[dataChip].fg.green,
110 colors[dataChip].fg.blue);
113 fprintf(stderr,"OWsyncColorResource: setting\n%s\n",colorRes);
116 _DtAddToResource(display, colorRes);
120 * Sync OW locale resources with CDE's use of the LANG environment variable
123 OWsyncLocaleResources(
129 lang = getenv("LANG");
130 if (lang == NULL || *lang == 0)
133 localeRes = XtMalloc(BUFSIZ);
136 "OpenWindows.BasicLocale:\t%s\n\
137 OpenWindows.InputLang:\t%s\n\
138 OpenWindows.DisplayLang:\t%s\n\
139 OpenWindows.TimeFormat:\t%s\n\
140 OpenWindows.NumericFormat:\t%s\n",
141 lang, lang, lang, lang, lang);
144 fprintf(stderr,"OWsyncLocaleResource: setting\n%s\n",localeRes);
147 _DtAddToResource(display, localeRes);