HelpDialogP.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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: HelpDialogP.h /main/6 1996/04/13 11:55:10 ageorge $ */
  24. /*************************************<+>*************************************
  25. *****************************************************************************
  26. **
  27. ** File: HelpDialogP.h
  28. **
  29. ** Project: Cache Creek (Rivers) Project:
  30. **
  31. ** Description: Privite Header file for HelpDialog.c
  32. ** -----------
  33. **
  34. ** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
  35. **
  36. ** (c) Copyright 1993, 1994 Hewlett-Packard Company
  37. ** (c) Copyright 1993, 1994 International Business Machines Corp.
  38. ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  39. ** (c) Copyright 1993, 1994 Novell, Inc.
  40. **
  41. *******************************************************************
  42. *************************************<+>*************************************/
  43. #ifndef _DtHelpDialogP_h
  44. #define _DtHelpDialogP_h
  45. #include <Xm/BulletinBP.h>
  46. #include <Dt/HelpDialog.h>
  47. #include "FileListUtilsI.h"
  48. #include "GlobSearchP.h"
  49. #define XmDIALOG_SUFFIX "_popup"
  50. #define XmDIALOG_SUFFIX_SIZE 6
  51. /* Defines for use in allocation geometry matrix. */
  52. #define TB_MAX_WIDGETS_VERT 7
  53. #define TB_MAX_NUM_WIDGETS 12
  54. /****************************************************************
  55. *
  56. * Topic List Info Structure Definition (History & Jump Back Lists)
  57. *
  58. ****************************************************************/
  59. typedef struct _DtTopicListStruct {
  60. char *locationId;
  61. XmString topicTitleLbl;
  62. char *helpVolume;
  63. int topicType;
  64. int pathLevel;
  65. int scrollPosition;
  66. struct _DtTopicListStruct *pNext;
  67. struct _DtTopicListStruct *pPrevious;
  68. } DtTopicListStruct;
  69. /****************************************************************
  70. *
  71. * Volume List Info: History Dialog only.
  72. *
  73. ****************************************************************/
  74. typedef struct _DtHistoryListStruct {
  75. XmString itemTitle;
  76. int topicType;
  77. int totalNodes;
  78. struct _DtHistoryListStruct *pNext;
  79. struct _DtTopicListStruct *pTopicHead;
  80. struct _DtTopicListStruct *pTopicTale;
  81. } DtHistoryListStruct;
  82. /****************************************************************
  83. *
  84. * Help Callback return structure
  85. *
  86. ****************************************************************/
  87. typedef struct _DtHelpListStruct {
  88. char * locationId;
  89. Widget widget;
  90. struct _DtHelpCommonHelpStuff * help;
  91. struct _DtHelpListStruct * pNext;
  92. struct _DtHelpListStruct * pPrevious;
  93. } DtHelpListStruct;
  94. /****************************************************************
  95. *
  96. * Kewword Search entry structure.
  97. *
  98. ****************************************************************/
  99. typedef struct {
  100. char * keyWord;
  101. Boolean matchesFindPattern;
  102. } KeyEntry;
  103. /* Class Part Structure Definition */
  104. typedef struct
  105. {
  106. XtPointer extension; /* Pointer to extension record */
  107. } DtHelpDialogWidgetClassPart;
  108. /* Full class record declaration */
  109. typedef struct _DtHelpDialogWidgetClassRec
  110. {
  111. CoreClassPart core_class;
  112. CompositeClassPart composite_class;
  113. ConstraintClassPart constraint_class;
  114. XmManagerClassPart manager_class;
  115. XmBulletinBoardClassPart bulletin_board_class;
  116. DtHelpDialogWidgetClassPart selection_box_class;
  117. } DtHelpDialogWidgetClassRec;
  118. externalref DtHelpDialogWidgetClassRec dtHelpDialogWidgetClassRec;
  119. typedef struct _DtHelpDisplayWidgetStuff
  120. {
  121. short textColumns; /* Columns Resource Value resource */
  122. short textRows; /* Rows Resource Value resource */
  123. char * locationId; /* Current Topic String resource */
  124. char * helpVolume; /* Current Project File resource */
  125. char * manPage; /* man page resource */
  126. char * stringData; /* string data resource */
  127. char * helpFile; /* help file resource */
  128. unsigned char scrollBarPolicy; /* Scrollbar policy resource */
  129. unsigned char executionPolicy; /* Link/script exec policy resource */
  130. XtCallbackList hyperLinkCallback; /* Hypertext Callback resource */
  131. _DtHelpVolumeHdl volumeHandle; /* handle of current volume */
  132. unsigned char helpType; /* Current displayed file type resource */
  133. char * topicTitleStr; /* title of topic */
  134. int count; /* Nonexistent topic title count */
  135. XmString topicTitleLbl; /* XmString title of topic */
  136. Boolean firstTimePopupFlag; /* False, untel we map the widget */
  137. } _DtHelpDisplayWidgetStuff;
  138. typedef struct _DtHelpCommonHelpStuff
  139. {
  140. XtPointer pDisplayArea; /* Display widget handle */
  141. /* for help on help */
  142. char * helpOnHelpVolume; /* help on help volume resource */
  143. DtHelpListStruct * pHelpListHead; /* Help List Pointer */
  144. Widget onHelpDialog; /* help on help dialog */
  145. char * sysVolumeSearchPath; /* system search path */
  146. char * userVolumeSearchPath; /* user search path */
  147. char * currentHelpFile; /* Current help file */
  148. int topicOffset; /* Offset into help file */
  149. char * topLevelId; /* Toplevel topic volume displayed */
  150. int topLevelTopicOffset;
  151. } _DtHelpCommonHelpStuff;
  152. typedef struct _DtHelpGeneralHelpStuff
  153. {
  154. char * parentId; /* used for "Up" menu */
  155. Boolean volumeFlag; /* set when to process new vol */
  156. Widget definitionBox;
  157. XtCallbackList closeCallback; /* Window Close Callback */
  158. Dimension marginHeight;
  159. Dimension marginWidth;
  160. } _DtHelpGeneralHelpStuff;
  161. typedef struct _DtHelpBrowserStuff
  162. {
  163. int visiblePathCount; /* Number of path lines shown */
  164. XtPointer pTocArea; /* Toc area handle */
  165. Widget volumeLabel;
  166. Widget panedWindow;
  167. Widget pathArea;
  168. Boolean showTopLevelBtn;
  169. Widget btnBoxBackBtn;
  170. Widget btnBoxHistoryBtn;
  171. Widget btnBoxIndexBtn;
  172. Widget btnBoxTopLevelBtn;
  173. } _DtHelpBrowserStuff;
  174. typedef struct _DtHelpMenuStuff
  175. {
  176. Boolean showDupBtn;
  177. /* Help Dialog Widgets */
  178. Widget menuBar;
  179. Widget topBtn;
  180. Widget keyBtn;
  181. Widget backBtn;
  182. Widget historyBtn;
  183. Widget printBtn;
  184. Widget closeBtn;
  185. Widget helpBtn;
  186. Widget newWindowBtn;
  187. Widget copyBtn;
  188. Widget popupMenu;
  189. Widget popupBackBtn;
  190. Widget popupTopBtn;
  191. } _DtHelpMenuStuff;
  192. typedef struct _DtHelpHistoryStuff
  193. {
  194. /* Path Area Variables */
  195. DtTopicListStruct * pPathListHead;
  196. DtTopicListStruct * pPathListTale;
  197. int totalPathNodes;
  198. /* History Dialog Widgets & variables */
  199. Widget volumeList; /* Scrolled volume list */
  200. Widget topicList; /* Scrolled topic list */
  201. Widget historyWidget; /* Top Level History Shell */
  202. Widget topicsListLabel;
  203. DtHistoryListStruct * pHistoryListHead; /* Head pointer to history */
  204. } _DtHelpHistoryStuff;
  205. typedef struct _DtHelpBacktrackStuff
  206. {
  207. /* Jump List variables */
  208. DtTopicListStruct * pJumpListHead;
  209. DtTopicListStruct * pJumpListTale;
  210. int totalJumpNodes;
  211. int scrollPosition;
  212. } _DtHelpBacktrackStuff;
  213. typedef struct _DtHelpGlobSearchStuff
  214. {
  215. /* search dialog resource (undocumented) */
  216. char * hitPrefixFont; /* hit prefix mono-space font resource */
  217. /* host application locale settings */
  218. char * iconv3Codeset; /* iconv3-ok codeset of app */
  219. _DtHelpCeIconvContext iconv3Context; /* from vol to app locale */
  220. /* File Selection Dialog font list */
  221. XmFontList volTitlesFontList; /*font list req'd by font titles*/
  222. /* Search Dialog Widgets & variables */
  223. Widget srchForm;
  224. Widget actionBtn;
  225. Widget curVolRadBtn;
  226. Widget allVolRadBtn;
  227. Widget selVolRadBtn;
  228. Widget selectBtn;
  229. Widget fullIndexRadBtn;
  230. Widget containsRadBtn;
  231. Widget wordField;
  232. Widget statusLabel;
  233. Widget resultList;
  234. Widget gotoBtn;
  235. Widget closeBtn;
  236. Widget helpBtn;
  237. Widget selectionDlg; /* selectionBox (child of dlg) */
  238. char * curVolPath; /* cur vol shown in btn label */
  239. char * rawWordStr; /* word as taken from srchWord */
  240. char * normWordStr; /* normalized word str */
  241. char * localeWordStr; /* after iconv() of NormWordStr */
  242. wchar_t wordFieldFirstChar;
  243. short wordFieldLen;
  244. short statusLineUsage;
  245. _DtHelpGlobSrchSources srchSources; /* current state of radio but */
  246. _DtHelpFileEntry curSrchVol; /* vol currently being searched */
  247. unsigned int hitsFontLoaded:1; /* is font loaded? */
  248. unsigned int volScanDone:1; /* is the volume list complete? */
  249. unsigned int fullIndex:1; /* state of search */
  250. unsigned int readyToStart:1; /* state of search */
  251. unsigned int hitsFound:1; /* state of search */
  252. unsigned int searchInProgress:1; /* state of search */
  253. unsigned int curVolRadBtnSens:1; /* state of curVol sens */
  254. short volLeftCnt; /* updated during search */
  255. _DtHelpFileList volListHead; /* info on search topics found */
  256. XtWorkProcId workProcId; /* ID of search proc */
  257. } _DtHelpGlobSearchStuff;
  258. typedef struct _DtHelpPrintStuff
  259. {
  260. /* printing resources */
  261. char * helpPrint; /* help print command resource */
  262. unsigned char paperSize; /* paper size resource */
  263. char * printer; /* printer destination resource */
  264. char * printVolume; /* volume to print resource */
  265. /* Print Dialog widgets & variables */
  266. Widget printForm; /* Form inside top level print shell */
  267. Widget subject; /* label for subject matter to print */
  268. Widget printerField; /* text field for printer */
  269. Widget copiesField; /* text field for copies */
  270. Widget letterBtn; /* menu item for letter paper */
  271. Widget legalBtn; /* menu item for legal paper */
  272. Widget execBtn; /* menu item for executive paper */
  273. Widget a4Btn; /* menu item for A4 paper */
  274. Widget b5Btn; /* menu item for B5 paper */
  275. Widget paperSizeOptMenu; /* menu item for A4 paper */
  276. Widget topicsFrame; /* frame holding print topic selection */
  277. Widget curTopicBtn; /* radio btn for cur topic */
  278. Widget subTopicsBtn; /* radio btn for cur & sub topics */
  279. Widget tocBtn; /* radio btn for table of contents */
  280. Widget allTopicsBtn; /* radio btn for all topics */
  281. Widget paperTopicsSeparator; /* hidden sep btwn paper size & topic sel */
  282. Widget topicsBtnsSeparator; /* sep between topic sel & btns */
  283. } _DtHelpPrintStuff;
  284. /* fields for the GeneralHelp widget record */
  285. typedef struct
  286. {
  287. _DtHelpDisplayWidgetStuff display;
  288. _DtHelpCommonHelpStuff help;
  289. _DtHelpGeneralHelpStuff ghelp;
  290. _DtHelpBrowserStuff browser;
  291. _DtHelpMenuStuff menu;
  292. _DtHelpHistoryStuff history;
  293. _DtHelpBacktrackStuff backtr;
  294. _DtHelpGlobSearchStuff srch;
  295. _DtHelpPrintStuff print;
  296. } DtHelpDialogWidgetPart;
  297. /****************************************************************
  298. *
  299. * Full instance record declaration
  300. *
  301. ****************************************************************/
  302. typedef struct _DtHelpDialogWidgetRec
  303. {
  304. CorePart core;
  305. CompositePart composite;
  306. ConstraintPart constraint;
  307. XmManagerPart manager;
  308. XmBulletinBoardPart bulletin_board;
  309. DtHelpDialogWidgetPart help_dialog;
  310. } DtHelpDialogWidgetRec;
  311. /******** Private Function Declarations ********/
  312. extern XmGeoMatrix _DtHelpDialogWidgetGeoMatrixCreate(
  313. Widget wid,
  314. Widget instigator,
  315. XtWidgetGeometry *desired) ;
  316. extern Boolean _DtHelpDialogWidgetNoGeoRequest(
  317. XmGeoMatrix geoSpec) ;
  318. /******** End Private Function Declarations ********/
  319. #endif /* _XmTemplateBP_h */
  320. /* DON'T ADD ANYTHING AFTER THIS #endif */