Main.h 8.2 KB

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