2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: Resource.c /main/6 1996/07/19 10:21:08 pascale $ */
24 /************************************<+>*************************************
25 ****************************************************************************
31 ** Description: Controls the Dtstyle resources
34 ****************************************************************************
35 ************************************<+>*************************************/
37 * (c) Copyright 1996 Digital Equipment Corporation.
38 * (c) Copyright 1990, 1996 Hewlett-Packard Company.
39 * (c) Copyright 1996 International Business Machines Corp.
40 * (c) Copyright 1996 Sun Microsystems, Inc.
41 * (c) Copyright 1996 Novell, Inc.
42 * (c) Copyright 1996 FUJITSU LIMITED.
43 * (c) Copyright 1996 Hitachi.
46 /*+++++++++++++++++++++++++++++++++++++++*/
48 /*+++++++++++++++++++++++++++++++++++++++*/
55 /*+++++++++++++++++++++++++++++++++++++++*/
56 /* include extern functions */
57 /*+++++++++++++++++++++++++++++++++++++++*/
60 /*+++++++++++++++++++++++++++++++++++++++*/
62 /*+++++++++++++++++++++++++++++++++++++++*/
63 #define DEF_FONT "Fixed"
65 #ifndef CDE_INSTALLATION_TOP
66 #define CDE_INSTALLATION_TOP "/opt/dt"
68 /*+++++++++++++++++++++++++++++++++++++++*/
69 /* Internal Functions */
70 /*+++++++++++++++++++++++++++++++++++++++*/
73 /*+++++++++++++++++++++++++++++++++++++++*/
74 /* Internal Variables */
75 /*+++++++++++++++++++++++++++++++++++++++*/
78 /*++++++++++++++++++++++++++++++++++++++*/
79 /* Application Resources */
80 /*++++++++++++++++++++++++++++++++++++++*/
82 XtResource sysFont_resources[] = {
84 {"systemFont1", "SystemFont1", XmRFontList, sizeof (XmFontList),
85 XtOffset(ApplicationDataPtr, fontChoice[0].sysFont), XmRString,
86 "-adobe-helvetica-medium-r-normal--10-*-iso8859-1"
88 {"systemFont2", "SystemFont2", XmRFontList, sizeof (XmFontList),
89 XtOffset(ApplicationDataPtr, fontChoice[1].sysFont), XmRString,
90 "-adobe-helvetica-medium-r-normal--12-*-iso8859-1"
92 {"systemFont3", "SystemFont3", XmRFontList, sizeof (XmFontList),
93 XtOffset(ApplicationDataPtr, fontChoice[2].sysFont), XmRString,
94 "-adobe-helvetica-medium-r-normal--14-*-iso8859-1"
96 {"systemFont4", "SystemFont4", XmRFontList, sizeof (XmFontList),
97 XtOffset(ApplicationDataPtr, fontChoice[3].sysFont), XmRString,
98 "-adobe-helvetica-medium-r-normal--17-*-iso8859-1"
100 {"systemFont5", "SystemFont5", XmRFontList, sizeof (XmFontList),
101 XtOffset(ApplicationDataPtr, fontChoice[4].sysFont), XmRString,
102 "-adobe-helvetica-medium-r-normal--18-*-iso8859-1"
104 {"systemFont6", "SystemFont6", XmRFontList, sizeof (XmFontList),
105 XtOffset(ApplicationDataPtr, fontChoice[5].sysFont), XmRString,
106 "-adobe-helvetica-medium-r-normal--20-*-iso8859-1"
108 {"systemFont7", "SystemFont7", XmRFontList, sizeof (XmFontList),
109 XtOffset(ApplicationDataPtr, fontChoice[6].sysFont), XmRString,
110 "-adobe-helvetica-medium-r-normal--24-*-iso8859-1"
114 XtResource userFont_resources[] = {
116 {"userFont1", "UserFont1", XmRFontList, sizeof (XmFontList),
117 XtOffset(ApplicationDataPtr, fontChoice[0].userFont), XmRString,
118 "-adobe-courier-medium-r-normal--10-*-iso8859-1"
120 {"userFont2", "UserFont2", XmRFontList, sizeof (XmFontList),
121 XtOffset(ApplicationDataPtr, fontChoice[1].userFont), XmRString,
122 "-adobe-courier-medium-r-normal--12-*-iso8859-1"
124 {"userFont3", "UserFont3", XmRFontList, sizeof (XmFontList),
125 XtOffset(ApplicationDataPtr, fontChoice[2].userFont), XmRString,
126 "-adobe-courier-medium-r-normal--14-*-iso8859-1"
128 {"userFont4", "UserFont4", XmRFontList, sizeof (XmFontList),
129 XtOffset(ApplicationDataPtr, fontChoice[3].userFont), XmRString,
130 "-adobe-courier-medium-r-normal--17-*-iso8859-1"
132 {"userFont5", "UserFont5", XmRFontList, sizeof (XmFontList),
133 XtOffset(ApplicationDataPtr, fontChoice[4].userFont), XmRString,
134 "-adobe-courier-medium-r-normal--18-*-iso8859-1"
136 {"userFont6", "UserFont6", XmRFontList, sizeof (XmFontList),
137 XtOffset(ApplicationDataPtr, fontChoice[5].userFont), XmRString,
138 "-adobe-courier-medium-r-normal--20-*-iso8859-1"
140 {"userFont7", "UserFont7", XmRFontList, sizeof (XmFontList),
141 XtOffset(ApplicationDataPtr, fontChoice[6].userFont), XmRString,
142 "-adobe-courier-medium-r-normal--24-*-iso8859-1"
146 XtResource sysStr_resources[] = {
148 {"systemFont1", "SystemFont1", XmRString, sizeof (XmString),
149 XtOffset(ApplicationDataPtr, fontChoice[0].sysStr), XmRString,
150 "-adobe-helvetica-medium-r-normal--10-*-iso8859-1"
152 {"systemFont2", "SystemFont2", XmRString, sizeof (XmString),
153 XtOffset(ApplicationDataPtr, fontChoice[1].sysStr), XmRString,
154 "-adobe-helvetica-medium-r-normal--12-*-iso8859-1"
156 {"systemFont3", "SystemFont3", XmRString, sizeof (XmString),
157 XtOffset(ApplicationDataPtr, fontChoice[2].sysStr), XmRString,
158 "-adobe-helvetica-medium-r-normal--14-*-iso8859-1"
160 {"systemFont4", "SystemFont4", XmRString, sizeof (XmString),
161 XtOffset(ApplicationDataPtr, fontChoice[3].sysStr), XmRString,
162 "-adobe-helvetica-medium-r-normal--17-*-iso8859-1"
164 {"systemFont5", "SystemFont5", XmRString, sizeof (XmString),
165 XtOffset(ApplicationDataPtr, fontChoice[4].sysStr), XmRString,
166 "-adobe-helvetica-medium-r-normal--18-*-iso8859-1"
168 {"systemFont6", "SystemFont6", XmRString, sizeof (XmString),
169 XtOffset(ApplicationDataPtr, fontChoice[5].sysStr), XmRString,
170 "-adobe-helvetica-medium-r-normal--20-*-iso8859-1"
172 {"systemFont7", "SystemFont7", XmRString, sizeof (XmString),
173 XtOffset(ApplicationDataPtr, fontChoice[6].sysStr), XmRString,
174 "-adobe-helvetica-medium-r-normal--24-*-iso8859-1"
178 XtResource userStr_resources[] = {
180 {"userFont1", "UserFont1", XmRString, sizeof (XmString),
181 XtOffset(ApplicationDataPtr, fontChoice[0].userStr), XmRString,
182 "-adobe-courier-medium-r-normal--10-*-iso8859-1"
184 {"userFont2", "UserFont2", XmRString, sizeof (XmString),
185 XtOffset(ApplicationDataPtr, fontChoice[1].userStr), XmRString,
186 "-adobe-courier-medium-r-normal--12-*-iso8859-1"
188 {"userFont3", "UserFont3", XmRString, sizeof (XmString),
189 XtOffset(ApplicationDataPtr, fontChoice[2].userStr), XmRString,
190 "-adobe-courier-medium-r-normal--14-*-iso8859-1"
192 {"userFont4", "UserFont4", XmRString, sizeof (XmString),
193 XtOffset(ApplicationDataPtr, fontChoice[3].userStr), XmRString,
194 "-adobe-courier-medium-r-normal--17-*-iso8859-1"
196 {"userFont5", "UserFont5", XmRString, sizeof (XmString),
197 XtOffset(ApplicationDataPtr, fontChoice[4].userStr), XmRString,
198 "-adobe-courier-medium-r-normal--18-*-iso8859-1"
200 {"userFont6", "UserFont6", XmRString, sizeof (XmString),
201 XtOffset(ApplicationDataPtr, fontChoice[5].userStr), XmRString,
202 "-adobe-courier-medium-r-normal--20-*-iso8859-1"
204 {"userFont7", "UserFont7", XmRString, sizeof (XmString),
205 XtOffset(ApplicationDataPtr, fontChoice[6].userStr), XmRString,
206 "-adobe-courier-medium-r-normal--24-*-iso8859-1"
210 XtResource resources[] = {
212 {"numFonts", "NumFonts", XmRInt, sizeof (int),
213 XtOffset(ApplicationDataPtr, numFonts), XmRImmediate, (caddr_t) 7
215 {"systemFont", "SystemFont", XmRFontList, sizeof (XmFontList),
216 XtOffset(ApplicationDataPtr, systemFont), XmRString, "Fixed"
218 {"userFont", "UserFont", XmRFontList, sizeof (XmFontList),
219 XtOffset(ApplicationDataPtr, userFont), XmRString, "Fixed"
221 {"systemFont", "SystemFont", XmRString, sizeof (XmString),
222 XtOffset(ApplicationDataPtr, systemFontStr), XmRString, DEF_FONT
224 {"userFont", "UserFont", XmRString, sizeof (XmString),
225 XtOffset(ApplicationDataPtr, userFontStr), XmRString, DEF_FONT
228 {"session", "Session", XmRString, sizeof (char *),
229 XtOffset (ApplicationDataPtr, session), XmRImmediate, (XtPointer)NULL,
231 {"backdropDirectories", "BackdropDirectories", XmRString, sizeof(char *),
232 XtOffset(ApplicationDataPtr, backdropDir), XmRString, NULL
234 {"paletteDirectories", "PaletteDirectories", XmRString, sizeof(char *),
235 XtOffset(ApplicationDataPtr, paletteDir), XmRString, NULL
237 {"timeoutScale", "TimeoutScale", XmRString, sizeof (String),
238 XtOffset(ApplicationDataPtr, timeoutScale), XmRString, "10"
240 {"lockoutScale", "LockoutScale", XmRString, sizeof (String),
241 XtOffset(ApplicationDataPtr, lockoutScale), XmRString, "30"
243 {"writeXrdbImmediate", "WriteXrdbImmediate", XmRBoolean, sizeof(Boolean) ,
244 XtOffset(ApplicationDataPtr, writeXrdbImmediate), XmRImmediate, (XtPointer)True
246 {"writeXrdbColors", "WriteXrdbColors", XmRBoolean, sizeof(Boolean) ,
247 XtOffset(ApplicationDataPtr, writeXrdbColors), XmRImmediate, (XtPointer)True
249 {"componentList", "ComponentList", XtRString, sizeof(String) ,
250 XtOffset(ApplicationDataPtr, componentList), XmRImmediate,
251 "Color Font Backdrop Keyboard Mouse Audio Screen Dtwm Startup"
253 {"imServerHosts", "ImServerHosts", XmRXmStringTable, sizeof(XmStringTable) ,
254 XtOffset(ApplicationDataPtr, imServerHosts), XmRImmediate,
257 {"preeditType", "PreeditType", XmRXmStringTable, sizeof(XmStringTable) ,
258 XtOffset(ApplicationDataPtr, preeditType), XmRString,
259 "OnTheSpot,OverTheSpot,OffTheSpot,Root"
261 {"pipeTimeOut", "PipeTimeOut", XmRInt, sizeof (int),
262 XtOffset(ApplicationDataPtr, pipeTimeOut), XmRImmediate, (caddr_t) 100
266 /************************************************************************
267 * GetSysFontResources
271 * This function is used to retrieve the Dtstyle System Font resources
272 ************************************************************************/
274 GetSysFontResource(int i)
276 XtGetApplicationResources(style.shell, &style.xrdb,
277 &sysFont_resources[i],
281 /************************************************************************
282 * GetUserFontResources
286 * This function is used to retrieve the Dtstyle User Font resources
287 ************************************************************************/
289 GetUserFontResource(int i)
291 XtGetApplicationResources(style.shell, &style.xrdb,
292 &userFont_resources[i],
296 /************************************************************************
297 * GetFontStrResources
301 ************************************************************************/
303 GetFontStrResources( void )
307 XtGetApplicationResources(style.shell, &style.xrdb, sysStr_resources,
308 XtNumber(sysStr_resources), NULL, 0);
309 XtGetApplicationResources(style.shell, &style.xrdb, userStr_resources,
310 XtNumber(userStr_resources), NULL, 0);
311 for (i=0; i<style.xrdb.numFonts; i++) {
312 style.xrdb.fontChoice[i].userFont = NULL;
313 style.xrdb.fontChoice[i].sysFont = NULL;
317 /************************************************************************
318 * GetApplicationResources
322 * This function is used to retrieve Dtstyle resources that are
323 * not component-specific.
324 ************************************************************************/
326 GetApplicationResources( void )
328 XtGetApplicationResources(style.shell, &style.xrdb, resources,
329 XtNumber(resources), NULL, 0);
330 GetFontStrResources();