Fixes for OpenBSD
[oweals/cde.git] / cde / programs / dtstyle / Main.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
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
22  */
23 /* $XConsortium: Main.h /main/8 1996/10/15 08:02:10 pascale $ */
24 /************************************<+>*************************************
25  ****************************************************************************
26  **
27  **   File:        Main.h
28  **
29  **   Project:     SUI
30  **
31  **   Description: defines and typedefs for DtStyle 
32  **
33  **
34  ****************************************************************************
35  ************************************<+>*************************************/
36 /*
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.
44  */
45
46 #ifndef _main_h
47 #define _main_h
48  
49 /* 
50  *  #include statements 
51  */
52
53 #include <stdint.h>
54 #include <Xm/Xm.h>
55 #include <Xm/XmP.h>
56 #include "Font.h"
57 #include <Dt/DtP.h>
58 #include <Dt/SessionM.h>
59 #include <Dt/SessionP.h>
60
61 /*
62  * Copied from Xm/BaseClassI.h
63  */
64 extern XmWidgetExtData _XmGetWidgetExtData( 
65                         Widget widget,
66 #if NeedWidePrototypes
67                         unsigned int extType) ;
68 #else
69                         unsigned char extType) ;
70 #endif /* NeedWidePrototypes */
71
72 /* 
73  *  #define statements 
74  */
75
76 #define MAX_ARGS         20
77 #define CMPSTR(str)      XmStringCreateLocalized (str)
78 #define XMCLASS          "Dtstyle"
79 #define DIALOG_MWM_FUNC  MWM_FUNC_MOVE | MWM_FUNC_CLOSE 
80
81 #define COLOR    "Color"
82 #define FONT     "Font"
83 #define BACKDROP "Backdrop"
84 #define KEYBOARD "Keyboard"
85 #define MOUSE    "Mouse"
86 #define BEEP     "Beep"
87 #define SCREEN   "Screen"
88 #define DTWM     "Dtwm"
89 #define STARTUP  "Startup"
90 #define I18N     "I18N"
91
92 #define COLOR_ICON    "DtColor"
93 #define FONT_ICON     "DtFont"
94 #define BACKDROP_ICON "DtBkdrp"
95 #define KEYBOARD_ICON "DtKeybd"
96 #define MOUSE_ICON    "DtMouse"
97 #define BEEP_ICON     "DtBeep"
98 #define SCREEN_ICON   "DtScrn"
99 #define DTWM_ICON     "DtDtwm"
100 #define STARTUP_ICON  "DtStart"
101 #define I18N_ICON     "DtI18N"
102
103
104 /* help files */
105 #define KB_TRAV_HELP           "vs_keys"
106 #define BACKDROP_HELP          "vs_back"
107 #define AUDIO_HELP             "vs_beep"
108 #define PALETTE_HELP           "vs_colo"
109 #define COLOR_EDIT_HELP        "vs_dtd"
110 #define ADD_PALETTE_HELP       "vs_coad"
111 #define DELETE_PALETTE_HELP    "vs_code"
112 #define FONT_HELP              "vs_font"
113 #define HOST_HELP              "vs_host"
114 #define KEYBOARD_HELP          "vs_keyb"
115 #define MOUSE_HELP             "vs_mous"
116 #define PASSWORD_HELP          "vs_pass"
117 #define SCREEN_HELP            "vs_scre"
118 #define STARTUP_HELP           "vs_star"
119 #define I18N_HELP              "vs_i18n"
120 #define STYLE_HELP             "vs_wind"
121
122 /* DialogBoxDialog label #defines */
123 #define OK_BUTTON             1
124 #define CANCEL_BUTTON         2
125 #define HELP_BUTTON           3
126 #define NUM_LABELS            3
127
128 /* geometry */
129 #define LB_MARGIN_HEIGHT      2
130 #define LB_MARGIN_WIDTH       12
131 #define SCALE_HIGHLIGHT_THICKNESS  (Dimension) 2
132
133 /* 
134  * typedef statements 
135  */
136
137 typedef struct {
138     int        numFonts;
139     XmFontList userFont,
140                systemFont;
141     String     userFontStr,
142                systemFontStr;
143     Fontset    fontChoice[10];
144     String     session,
145                backdropDir,
146                paletteDir,
147                timeoutScale, lockoutScale;
148     Boolean    writeXrdbImmediate;
149     Boolean    writeXrdbColors;
150     String     componentList;
151     XmStringTable   imServerHosts;
152     XmStringTable   preeditType;
153     int        pipeTimeOut;
154 } ApplicationData, *ApplicationDataPtr;
155
156 typedef struct {
157     Boolean     restoreFlag;
158     int         poscnt;
159     Arg         posArgs[MAX_ARGS];
160 } saveRestore;
161
162 typedef struct {
163     Display         *display;
164     Screen          *screen;
165     int              screenNum;
166     Window           root;
167     Colormap         colormap;
168     Boolean          useMultiColorIcons;
169     Pixel            tgSelectColor,
170                      secSelectColor,              /** for editable text bg **/
171                      primTSCol, primBSCol,        /** TS and BS colors are **/
172                      secTSCol, secBSCol,          /** for icon fg and bg   **/
173                      secBgCol;
174     ApplicationData  xrdb;
175     char            *home;
176     char            *execName;
177     SmStateInfo      smState;
178     SmSaverInfo      smSaver; 
179     Boolean          longfilename;
180     Widget           shell,
181                      mainWindow,
182                      colorDialog,
183                      backdropDialog,
184                      fontDialog,
185                      kbdDialog,
186                      mouseDialog,
187                      audioDialog,
188                      screenDialog,
189                      startupDialog,
190                      dtwmDialog,
191                      i18nDialog,
192                      buttonsForm;
193     XmString         tmpXmStr;
194     Widget           errDialog, errParent;
195     char             tmpBigStr[1024];
196     int              fontSize, timeoutscale;
197     short            count;
198     Boolean          colorSrv;
199     Boolean          dynamicColor;
200     Boolean          workProcs;
201     int              horizontalSpacing, verticalSpacing;
202         int              visualClass;
203 } Style;
204
205 /*
206  *  External variables  
207  */
208
209 extern Style style;
210 extern char  *progName;
211 extern XrmDatabase sys_pl_DB;
212 extern XrmDatabase adm_pl_DB;
213 extern XrmDatabase hm_pl_DB;
214 extern XrmDatabase pl_DB;
215
216 /*  
217  *  External Interface  
218  */
219
220 extern int local_xerror( Display *dpy, XErrorEvent *rep) ; /* defined in hostBB.c for 
221                                                                 historical reasons*/
222
223
224 extern char *_DtGetMessage( 
225                         char *filename,
226                         int set, 
227                         int n, 
228                         char *s );
229 extern void raiseWindow(
230                         Window dialogWin) ;
231 extern void CenterMsgCB( 
232                         Widget w,
233                         XtPointer client_data,
234                         XtPointer call_data) ;
235 extern void ErrDialog( 
236                         char *errString,
237                         Widget visualParent) ;
238 extern void InfoDialog( 
239                         char *infoString,
240                         Widget parent,
241                         Boolean unmapParent) ;
242 extern void putDialog( 
243                         Widget parent,
244                         Widget dialog) ;
245 extern void smStateCB( 
246                         DtString fields[],
247                         XtPointer client_data,
248                         int num_fields) ;
249 extern void HandleStopMsg( 
250                         DtString fields[],
251                         XtPointer client_data,
252                         int num_words) ;
253 extern void LoadDatabase(void);
254
255 /*
256  * macro to get message catalog strings
257  */
258 #ifndef NO_MESSAGE_CATALOG
259 # ifdef DT_LITE
260 #  define GETMESSAGE(set, number, string)\
261     _DtGetMessage(set, number, "")
262 # else /*  DT_LITE*/
263 #  define CLIENT_MESSAGE_CAT_NAME       "dtstyle"
264 #  define GETMESSAGE(set, number, string)\
265     _DtGetMessage(CLIENT_MESSAGE_CAT_NAME, set, number, string)
266 # endif /* DT_LITE */
267 #else
268 # define GETMESSAGE(set, number, string)\
269     string
270 #endif
271
272 #endif /* _main_h */
273 /* DON'T ADD ANYTHING AFTER THIS #endif */
274