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