dtcreate.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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: dtcreate.h /main/5 1996/09/17 11:01:43 rswiston $ */
  24. /***************************************************************************/
  25. /* */
  26. /* dtcreate.h */
  27. /* */
  28. /***************************************************************************/
  29. #ifndef _DTCREATE_H_INCLUDED
  30. #define _DTCREATE_H_INCLUDED
  31. #define __TOOLTALK
  32. #include <Xm/Xm.h>
  33. #include <nl_types.h>
  34. #include <sys/param.h>
  35. #ifndef STORAGECLASS
  36. #ifdef NOEXTERN
  37. #define STORAGECLASS
  38. #else
  39. #define STORAGECLASS extern
  40. #endif
  41. #endif
  42. /***************************************************************************/
  43. /* */
  44. /* Constant Declarations */
  45. /* */
  46. /***************************************************************************/
  47. #define TRUE 1
  48. #define FALSE 0
  49. #define Psz (char *)
  50. #define MAXFILENAME MAXPATHLEN
  51. #define MAXBUFSIZE 256
  52. /*******************************************************************/
  53. /* Icon Sizes */
  54. /*******************************************************************/
  55. #define CA_LRG_ICON_SIZE 48
  56. #define CA_MED_ICON_SIZE 32
  57. #define CA_SML_ICON_SIZE 24
  58. #define CA_TINY_ICON_SIZE 16
  59. /*******************************************************************/
  60. /* FILE SELECTION WIDGET VALUES */
  61. /*******************************************************************/
  62. #define CA_ACTION_ICONS 1
  63. #define CA_FILETYPE_ICONS 2
  64. #define CA_FILE 3
  65. /*******************************************************************/
  66. /* ActionData fsFlags values */
  67. /*******************************************************************/
  68. #define CA_WT_XWINDOWS 0x0001
  69. #define CA_WT_TERM 0x0002
  70. #define CA_WT_PERMTERM 0x0004
  71. #define CA_WT_SHELLTERM 0x0008
  72. #define CA_DF_ONLYFTFILES 0x0010
  73. /*******************************************************************/
  74. /* Filetype flags. */
  75. /*******************************************************************/
  76. #define CA_FT_CNTSTRING 0x0001
  77. #define CA_FT_CNTBYTE 0x0002
  78. #define CA_FT_CNTSHORT 0x0004
  79. #define CA_FT_CNTLONG 0x0008
  80. /*******************************************************************/
  81. /* Filetype Internal flags */
  82. /*******************************************************************/
  83. #define CA_FT_APPLY 0x0001
  84. #define CA_FT_EDIT 0x0002
  85. /*******************************************************************/
  86. /* Icon filename extensions */
  87. /*******************************************************************/
  88. #define LARGE_EXT ".l"
  89. #define MEDIUM_EXT ".m"
  90. #define SMALL_EXT ".t"
  91. #define TINY_EXT ".t"
  92. #define PIXMAP_EXT ".pm"
  93. #define BITMAP_EXT ".bm"
  94. #define MAX_EXT_SIZE 5
  95. #define EXT_DELIMITER '.'
  96. #define ICON_BORDER_WIDTH 1
  97. #define ICON_NUMBER 5
  98. /*******************************************************************/
  99. /* Help Ids */
  100. /*******************************************************************/
  101. #define HELP_OVERVIEW 1
  102. #define HELP_TASKS 2
  103. #define HELP_REFERENCE 3
  104. #define HELP_USING 4
  105. #define HELP_ABOUT 5
  106. #define HELP_ONITEM 6
  107. #define HELP_ADDFILETYPE 10
  108. #define HELP_FILECHAR 20
  109. #define HELP_ICONSELECTOR 30
  110. #define HELP_OPENFILE 40
  111. /*****************************************************************************/
  112. /* */
  113. /* enums */
  114. /* */
  115. /*****************************************************************************/
  116. enum icon_size_range {None_Selected, Large_Icon, Medium_Icon, Small_Icon, Tiny_Icon};
  117. enum icon_data_range {CA_LRG, CA_MED, CA_TINY, AF_MED, AF_TINY};
  118. /***************************************************************************/
  119. /* */
  120. /* Structure Declarations */
  121. /* */
  122. /***************************************************************************/
  123. typedef struct _FiletypeData *pFiletypeData;
  124. typedef struct _FiletypeData {
  125. char *pszName;
  126. char *pszIcon;
  127. char *pszMedPmIcon;
  128. char *pszMedBmIcon;
  129. char *pszTinyPmIcon;
  130. char *pszTinyBmIcon;
  131. char *pszHelp;
  132. char *pszOpenCmd;
  133. char *pszPrintCmd;
  134. char *pszPattern;
  135. char *pszPermissions;
  136. char *pszContents;
  137. int sStart;
  138. int sEnd;
  139. ushort fsFlags;
  140. ushort fsInternal;
  141. } FiletypeData;
  142. typedef struct _ActionData *pActionData;
  143. typedef struct _ActionData {
  144. char *pszName;
  145. char *pszIcon;
  146. char *pszCmd;
  147. char *pszHelp;
  148. char *pszPrompt;
  149. FiletypeData **papFiletypes;
  150. short cFiletypes;
  151. ushort fsFlags;
  152. } ActionData;
  153. typedef struct {
  154. char *pszSessionFile;
  155. Boolean useSession;
  156. Boolean showExpert;
  157. int iconicState;
  158. Position x, y;
  159. Dimension width, height;
  160. char workspaces[256];
  161. } SessionData, *SessionDataPtr;
  162. typedef struct {
  163. Widget wid;
  164. char *pmMsgID;
  165. char *bmMsgID;
  166. char pmFileName[MAXPATHLEN];
  167. char bmFileName[MAXPATHLEN];
  168. Boolean pmDirtyBit;
  169. Boolean bmDirtyBit;
  170. enum icon_size_range size;
  171. } IconData, *IconDataPtr;
  172. /***************************************************************************/
  173. /* */
  174. /* Macro Declarations */
  175. /* */
  176. /***************************************************************************/
  177. #define GETMESSAGE(set, number, defstr) catgets(nlmsg_fd, set, number, defstr)
  178. /***************************************************************************/
  179. /* */
  180. /* Global Variable Declarations */
  181. /* */
  182. /***************************************************************************/
  183. /*******************************************************************/
  184. /* Global variables that are not being initialized. */
  185. /*******************************************************************/
  186. STORAGECLASS ActionData AD;
  187. STORAGECLASS ActionData *pMyCopyAD;
  188. STORAGECLASS char *pszFileToEdit;
  189. STORAGECLASS Cursor watch_cursor;
  190. STORAGECLASS Widget widEditSource;
  191. STORAGECLASS Boolean bIconEditorDisplayed;
  192. STORAGECLASS nl_catd nlmsg_fd;
  193. STORAGECLASS char *pszExecName;
  194. STORAGECLASS Widget widSelectedIcon;
  195. STORAGECLASS Boolean bLowRes;
  196. STORAGECLASS IconData *IconDataList[ICON_NUMBER];
  197. /**********************************************************/
  198. /* CreateActionAppShell globals. */
  199. /**********************************************************/
  200. STORAGECLASS Widget CreateActionAppShell;
  201. STORAGECLASS Widget ExpertOption;
  202. STORAGECLASS Widget ColorMonoOption;
  203. STORAGECLASS Widget CA_ActionNameTextField;
  204. STORAGECLASS Widget CA_MED_IconGadget;
  205. STORAGECLASS Widget CA_SML_IconGadget;
  206. STORAGECLASS Widget CA_TINY_IconGadget;
  207. STORAGECLASS Widget CA_LRG_IconGadget;
  208. STORAGECLASS Widget CA_DblClkText;
  209. STORAGECLASS Widget XprtOptionForm;
  210. STORAGECLASS Widget CA_XprtActionOpenText;
  211. STORAGECLASS Widget CA_FiletypesList;
  212. STORAGECLASS Widget CA_WindowTypeArea;
  213. STORAGECLASS Widget CA_WindowType;
  214. STORAGECLASS Widget CA_Expand;
  215. #if 0
  216. STORAGECLASS Widget CA_WindowType_OptionMenuShell;
  217. STORAGECLASS Widget CA_WindowType_Pane;
  218. #endif
  219. STORAGECLASS Widget CA_WinTypeX;
  220. STORAGECLASS Widget CA_WinTypeAutoClose;
  221. STORAGECLASS Widget CA_WinTypeManualClose;
  222. STORAGECLASS Widget CA_WinTypeNoOutput;
  223. STORAGECLASS Widget CA_HelpTextWindow;
  224. STORAGECLASS Widget CA_HelpText;
  225. STORAGECLASS Widget CA_AllFiletypesToggle;
  226. STORAGECLASS Widget CA_FiletypesInListToggle;
  227. /**********************************************************/
  228. /* AddFiletype globals. */
  229. /**********************************************************/
  230. STORAGECLASS Widget AddFiletype;
  231. STORAGECLASS Widget AF_FileTypeNameTextField;
  232. STORAGECLASS Widget AF_IdCharacteristicsText;
  233. STORAGECLASS Widget AF_IdCharacteristicsEdit;
  234. STORAGECLASS Widget AF_FiletypePrintCmdTextField;
  235. STORAGECLASS Widget AF_OpenCmdText;
  236. STORAGECLASS Widget AF_FiletypeHelpText;
  237. STORAGECLASS Widget AF_MED_IconGadget;
  238. STORAGECLASS Widget AF_TINY_IconGadget;
  239. /**********************************************************/
  240. /* FileCharacteristics globals */
  241. /**********************************************************/
  242. STORAGECLASS Widget FileCharacteristics;
  243. STORAGECLASS Widget FC_DirectoryToggle;
  244. STORAGECLASS Widget FC_FileToggle;
  245. STORAGECLASS Widget FC_AndLabel2;
  246. STORAGECLASS Widget FC_ContentsPatternText;
  247. STORAGECLASS Widget FC_StringToggle;
  248. STORAGECLASS Widget FC_ByteToggle;
  249. STORAGECLASS Widget FC_ShortToggle;
  250. STORAGECLASS Widget FC_LongToggle;
  251. STORAGECLASS Widget FC_StartByteTextField;
  252. /*
  253. STORAGECLASS Widget FC_EndByteTextField;
  254. */
  255. STORAGECLASS Widget FC_NameOrPathText;
  256. STORAGECLASS Widget FC_AndLabel1;
  257. STORAGECLASS Widget FC_PermissionForm;
  258. STORAGECLASS Widget FC_ReadToggle;
  259. STORAGECLASS Widget FC_WriteToggle;
  260. STORAGECLASS Widget FC_ExecuteToggle;
  261. STORAGECLASS Widget FC_NamePatternLabel;
  262. STORAGECLASS Widget FC_PermissionLabel;
  263. STORAGECLASS Widget FC_PermissionToggle;
  264. STORAGECLASS Widget FC_ContentsLabel;
  265. STORAGECLASS Widget FC_ContentsBox;
  266. STORAGECLASS Widget FC_TypeRowColumn;
  267. STORAGECLASS Widget FC_StartByteLabel;
  268. STORAGECLASS Widget FC_TypeLabel;
  269. STORAGECLASS Widget FC_ContentsPatternLabel;
  270. /*
  271. STORAGECLASS Widget FC_EndByteLabel;
  272. */
  273. STORAGECLASS Widget FC_ContentsToggle;
  274. STORAGECLASS Widget FC_NameOrPathToggle;
  275. /**********************************************************/
  276. /* icon_selection_dialog globals */
  277. /**********************************************************/
  278. STORAGECLASS Widget ISD_SelectedIconTextField;
  279. /**********************************************************/
  280. /* Other dialog globals */
  281. /**********************************************************/
  282. STORAGECLASS SessionData sessiondata;
  283. /*******************************************************************/
  284. /* Global variables that are being initialized. */
  285. /*******************************************************************/
  286. #ifdef NOEXTERN
  287. STORAGECLASS enum icon_size_range action_icon_size = None_Selected;
  288. STORAGECLASS enum icon_size_range filetype_icon_size = None_Selected;
  289. STORAGECLASS int pidIconEditor = 0;
  290. STORAGECLASS Boolean bShowPixmaps = TRUE;
  291. STORAGECLASS Widget IconSelector = (Widget)NULL;
  292. STORAGECLASS Boolean DbInitDone = FALSE;
  293. STORAGECLASS Widget OpenFile = (Widget)NULL;
  294. STORAGECLASS Widget Confirmed = (Widget)NULL;
  295. STORAGECLASS Widget QuestionDialog = (Widget)NULL;
  296. STORAGECLASS Widget ErrorDialog = (Widget)NULL;
  297. STORAGECLASS Widget last_action_pushed = (Widget)NULL;
  298. STORAGECLASS Widget last_filetype_pushed = (Widget)NULL;
  299. STORAGECLASS const char *ca_icon_default = "Dtactn";
  300. STORAGECLASS const char *ca_full_icon_default = "/usr/dt/appconfig/icons/C/Dtactn";
  301. STORAGECLASS const char *ca_lrg_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.l";
  302. STORAGECLASS const char *ca_med_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.m";
  303. STORAGECLASS const char *ca_sml_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.s";
  304. STORAGECLASS const char *ca_tiny_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.t";
  305. STORAGECLASS const char *af_icon_default = "Dtdata";
  306. STORAGECLASS const char *af_full_icon_default = "/usr/dt/appconfig/icons/C/Dtdata";
  307. STORAGECLASS const char *af_lrg_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.l";
  308. STORAGECLASS const char *af_med_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.m";
  309. STORAGECLASS const char *af_sml_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.s";
  310. STORAGECLASS const char *af_tiny_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.t";
  311. #else /* NOEXTERN */
  312. STORAGECLASS enum icon_size_range action_icon_size;
  313. STORAGECLASS enum icon_size_range filetype_icon_size;
  314. STORAGECLASS int pidIconEditor;
  315. STORAGECLASS Boolean bShowPixmaps;
  316. STORAGECLASS Widget IconSelector;
  317. STORAGECLASS Boolean DbInitDone;
  318. STORAGECLASS Widget OpenFile;
  319. STORAGECLASS Widget Confirmed;
  320. STORAGECLASS Widget QuestionDialog;
  321. STORAGECLASS Widget ErrorDialog;
  322. STORAGECLASS Widget last_action_pushed;
  323. STORAGECLASS Widget last_filetype_pushed;
  324. STORAGECLASS const char *ca_icon_default;
  325. STORAGECLASS const char *ca_full_icon_default;
  326. STORAGECLASS const char *ca_lrg_icon_default;
  327. STORAGECLASS const char *ca_med_icon_default;
  328. STORAGECLASS const char *ca_sml_icon_default;
  329. STORAGECLASS const char *ca_tiny_icon_default;
  330. STORAGECLASS const char *af_icon_default;
  331. STORAGECLASS const char *af_full_icon_default;
  332. STORAGECLASS const char *af_lrg_icon_default;
  333. STORAGECLASS const char *af_med_icon_default;
  334. STORAGECLASS const char *af_sml_icon_default;
  335. STORAGECLASS const char *af_tiny_icon_default;
  336. #endif /* NOEXTERN */
  337. #endif /* _DTCREATE_H_INCLUDED */