Main.h 7.9 KB

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