1 /* $XConsortium: HelpDialogP.h /main/6 1996/04/13 11:55:10 ageorge $ */
2 /*************************************<+>*************************************
3 *****************************************************************************
7 ** Project: Cache Creek (Rivers) Project:
9 ** Description: Privite Header file for HelpDialog.c
12 ** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
14 ** (c) Copyright 1993, 1994 Hewlett-Packard Company
15 ** (c) Copyright 1993, 1994 International Business Machines Corp.
16 ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
17 ** (c) Copyright 1993, 1994 Novell, Inc.
19 *******************************************************************
20 *************************************<+>*************************************/
22 #ifndef _DtHelpDialogP_h
23 #define _DtHelpDialogP_h
25 #include <Xm/BulletinBP.h>
27 #include <Dt/HelpDialog.h>
29 #include "FileListUtilsI.h"
30 #include "GlobSearchP.h"
32 #define XmDIALOG_SUFFIX "_popup"
33 #define XmDIALOG_SUFFIX_SIZE 6
36 /* Defines for use in allocation geometry matrix. */
37 #define TB_MAX_WIDGETS_VERT 7
38 #define TB_MAX_NUM_WIDGETS 12
41 /****************************************************************
43 * Topic List Info Structure Definition (History & Jump Back Lists)
45 ****************************************************************/
46 typedef struct _DtTopicListStruct {
48 XmString topicTitleLbl;
53 struct _DtTopicListStruct *pNext;
54 struct _DtTopicListStruct *pPrevious;
58 /****************************************************************
60 * Volume List Info: History Dialog only.
62 ****************************************************************/
63 typedef struct _DtHistoryListStruct {
67 struct _DtHistoryListStruct *pNext;
68 struct _DtTopicListStruct *pTopicHead;
69 struct _DtTopicListStruct *pTopicTale;
70 } DtHistoryListStruct;
73 /****************************************************************
75 * Help Callback return structure
77 ****************************************************************/
78 typedef struct _DtHelpListStruct {
81 struct _DtHelpCommonHelpStuff * help;
82 struct _DtHelpListStruct * pNext;
83 struct _DtHelpListStruct * pPrevious;
88 /****************************************************************
90 * Kewword Search entry structure.
92 ****************************************************************/
96 Boolean matchesFindPattern;
102 /* Class Part Structure Definition */
106 XtPointer extension; /* Pointer to extension record */
107 } DtHelpDialogWidgetClassPart;
112 /* Full class record declaration */
114 typedef struct _DtHelpDialogWidgetClassRec
116 CoreClassPart core_class;
117 CompositeClassPart composite_class;
118 ConstraintClassPart constraint_class;
119 XmManagerClassPart manager_class;
120 XmBulletinBoardClassPart bulletin_board_class;
121 DtHelpDialogWidgetClassPart selection_box_class;
122 } DtHelpDialogWidgetClassRec;
124 externalref DtHelpDialogWidgetClassRec dtHelpDialogWidgetClassRec;
127 typedef struct _DtHelpDisplayWidgetStuff
129 short textColumns; /* Columns Resource Value resource */
130 short textRows; /* Rows Resource Value resource */
131 char * locationId; /* Current Topic String resource */
132 char * helpVolume; /* Current Project File resource */
133 char * manPage; /* man page resource */
134 char * stringData; /* string data resource */
135 char * helpFile; /* help file resource */
136 unsigned char scrollBarPolicy; /* Scrollbar policy resource */
137 unsigned char executionPolicy; /* Link/script exec policy resource */
138 XtCallbackList hyperLinkCallback; /* Hypertext Callback resource */
139 _DtHelpVolumeHdl volumeHandle; /* handle of current volume */
140 unsigned char helpType; /* Current displayed file type resource */
141 char * topicTitleStr; /* title of topic */
142 int count; /* Nonexistent topic title count */
143 XmString topicTitleLbl; /* XmString title of topic */
144 Boolean firstTimePopupFlag; /* False, untel we map the widget */
147 } _DtHelpDisplayWidgetStuff;
149 typedef struct _DtHelpCommonHelpStuff
151 XtPointer pDisplayArea; /* Display widget handle */
153 /* for help on help */
154 char * helpOnHelpVolume; /* help on help volume resource */
155 DtHelpListStruct * pHelpListHead; /* Help List Pointer */
156 Widget onHelpDialog; /* help on help dialog */
158 char * sysVolumeSearchPath; /* system search path */
159 char * userVolumeSearchPath; /* user search path */
161 char * currentHelpFile; /* Current help file */
162 int topicOffset; /* Offset into help file */
164 char * topLevelId; /* Toplevel topic volume displayed */
165 int topLevelTopicOffset;
166 } _DtHelpCommonHelpStuff;
168 typedef struct _DtHelpGeneralHelpStuff
170 char * parentId; /* used for "Up" menu */
172 Boolean volumeFlag; /* set when to process new vol */
174 Widget definitionBox;
175 XtCallbackList closeCallback; /* Window Close Callback */
177 Dimension marginHeight;
178 Dimension marginWidth;
179 } _DtHelpGeneralHelpStuff;
182 typedef struct _DtHelpBrowserStuff
184 int visiblePathCount; /* Number of path lines shown */
185 XtPointer pTocArea; /* Toc area handle */
191 Boolean showTopLevelBtn;
192 Widget btnBoxBackBtn;
193 Widget btnBoxHistoryBtn;
194 Widget btnBoxIndexBtn;
195 Widget btnBoxTopLevelBtn;
196 } _DtHelpBrowserStuff;
198 typedef struct _DtHelpMenuStuff
202 /* Help Dialog Widgets */
220 typedef struct _DtHelpHistoryStuff
222 /* Path Area Variables */
223 DtTopicListStruct * pPathListHead;
224 DtTopicListStruct * pPathListTale;
227 /* History Dialog Widgets & variables */
228 Widget volumeList; /* Scrolled volume list */
229 Widget topicList; /* Scrolled topic list */
230 Widget historyWidget; /* Top Level History Shell */
231 Widget topicsListLabel;
232 DtHistoryListStruct * pHistoryListHead; /* Head pointer to history */
233 } _DtHelpHistoryStuff;
235 typedef struct _DtHelpBacktrackStuff
237 /* Jump List variables */
238 DtTopicListStruct * pJumpListHead;
239 DtTopicListStruct * pJumpListTale;
242 } _DtHelpBacktrackStuff;
244 typedef struct _DtHelpGlobSearchStuff
246 /* search dialog resource (undocumented) */
247 char * hitPrefixFont; /* hit prefix mono-space font resource */
249 /* host application locale settings */
250 char * iconv3Codeset; /* iconv3-ok codeset of app */
251 _DtHelpCeIconvContext iconv3Context; /* from vol to app locale */
253 /* File Selection Dialog font list */
254 XmFontList volTitlesFontList; /*font list req'd by font titles*/
256 /* Search Dialog Widgets & variables */
263 Widget fullIndexRadBtn;
264 Widget containsRadBtn;
271 Widget selectionDlg; /* selectionBox (child of dlg) */
272 char * curVolPath; /* cur vol shown in btn label */
273 char * rawWordStr; /* word as taken from srchWord */
274 char * normWordStr; /* normalized word str */
275 char * localeWordStr; /* after iconv() of NormWordStr */
276 wchar_t wordFieldFirstChar;
278 short statusLineUsage;
279 _DtHelpGlobSrchSources srchSources; /* current state of radio but */
280 _DtHelpFileEntry curSrchVol; /* vol currently being searched */
281 unsigned int hitsFontLoaded:1; /* is font loaded? */
282 unsigned int volScanDone:1; /* is the volume list complete? */
283 unsigned int fullIndex:1; /* state of search */
284 unsigned int readyToStart:1; /* state of search */
285 unsigned int hitsFound:1; /* state of search */
286 unsigned int searchInProgress:1; /* state of search */
287 unsigned int curVolRadBtnSens:1; /* state of curVol sens */
288 short volLeftCnt; /* updated during search */
289 _DtHelpFileList volListHead; /* info on search topics found */
290 XtWorkProcId workProcId; /* ID of search proc */
291 } _DtHelpGlobSearchStuff;
293 typedef struct _DtHelpPrintStuff
295 /* printing resources */
296 char * helpPrint; /* help print command resource */
297 unsigned char paperSize; /* paper size resource */
298 char * printer; /* printer destination resource */
299 char * printVolume; /* volume to print resource */
301 /* Print Dialog widgets & variables */
302 Widget printForm; /* Form inside top level print shell */
303 Widget subject; /* label for subject matter to print */
304 Widget printerField; /* text field for printer */
305 Widget copiesField; /* text field for copies */
306 Widget letterBtn; /* menu item for letter paper */
307 Widget legalBtn; /* menu item for legal paper */
308 Widget execBtn; /* menu item for executive paper */
309 Widget a4Btn; /* menu item for A4 paper */
310 Widget b5Btn; /* menu item for B5 paper */
311 Widget paperSizeOptMenu; /* menu item for A4 paper */
312 Widget topicsFrame; /* frame holding print topic selection */
313 Widget curTopicBtn; /* radio btn for cur topic */
314 Widget subTopicsBtn; /* radio btn for cur & sub topics */
315 Widget tocBtn; /* radio btn for table of contents */
316 Widget allTopicsBtn; /* radio btn for all topics */
317 Widget paperTopicsSeparator; /* hidden sep btwn paper size & topic sel */
318 Widget topicsBtnsSeparator; /* sep between topic sel & btns */
322 /* fields for the GeneralHelp widget record */
325 _DtHelpDisplayWidgetStuff display;
326 _DtHelpCommonHelpStuff help;
327 _DtHelpGeneralHelpStuff ghelp;
328 _DtHelpBrowserStuff browser;
329 _DtHelpMenuStuff menu;
330 _DtHelpHistoryStuff history;
331 _DtHelpBacktrackStuff backtr;
332 _DtHelpGlobSearchStuff srch;
333 _DtHelpPrintStuff print;
334 } DtHelpDialogWidgetPart;
337 /****************************************************************
339 * Full instance record declaration
341 ****************************************************************/
343 typedef struct _DtHelpDialogWidgetRec
346 CompositePart composite;
347 ConstraintPart constraint;
348 XmManagerPart manager;
349 XmBulletinBoardPart bulletin_board;
350 DtHelpDialogWidgetPart help_dialog;
351 } DtHelpDialogWidgetRec;
355 /******** Private Function Declarations ********/
357 extern XmGeoMatrix _DtHelpDialogWidgetGeoMatrixCreate(
360 XtWidgetGeometry *desired) ;
361 extern Boolean _DtHelpDialogWidgetNoGeoRequest(
362 XmGeoMatrix geoSpec) ;
364 /******** End Private Function Declarations ********/
368 #endif /* _XmTemplateBP_h */
369 /* DON'T ADD ANYTHING AFTER THIS #endif */