1 /* $XConsortium: DisplayAreaP.h /main/18 1996/08/13 11:35:51 cde-hp $ */
2 /************************************<+>*************************************
3 ****************************************************************************
5 ** File: DisplayAreaP.h
7 ** Project: Cde Help System
9 ** Description: Defines the Display Area structures and defines.
11 ****************************************************************************
12 ************************************<+>*************************************/
14 * (c) Copyright 1996 Digital Equipment Corporation.
15 * (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992,
16 1993, 1994, 1996 Hewlett-Packard Company.
17 * (c) Copyright 1993, 1994, 1996 International Business Machines Corp.
18 * (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc.
19 * (c) Copyright 1993, 1994, 1996 Novell, Inc.
20 * (c) Copyright 1996 FUJITSU LIMITED.
21 * (c) Copyright 1996 Hitachi.
24 #ifndef _DtHelpDisplayAreaP_h
25 #define _DtHelpDisplayAreaP_h
29 #include <Dt/CanvasP.h>
30 #include <DtI/GraphicsP.h>
35 #define _DT_HELP_SHADOW_TRAVERSAL (1 << 0)
36 #define _DT_HELP_NOT_INITIALIZED (1 << 1)
37 #define _DT_HELP_TRAVERSAL_DRAWN (1 << 2)
38 #define _DT_HELP_DRAW_TOC_IND (1 << 3)
39 #define _DT_HELP_CLEAR_TOC_IND (1 << 4)
40 #define _DT_HELP_TOC_ON (1 << 5)
43 * enum states for selection
45 enum _DtHelpSelectState
53 * Whether the display area has the focus or not
55 #define _DT_HELP_FOCUS_FLAG 0x04
65 } DtHelpGraphicStruct;
68 _DtCvPointer font_ptr;
72 typedef struct _dtHelpDAFontMetrics {
73 _DtCvUnit ascent; /* Maximum ascent */
74 _DtCvUnit descent; /* Maximum descent */
75 _DtCvUnit average_width; /* Average width of a character */
76 _DtCvUnit super; /* Offset from baseline for super scripts */
77 _DtCvUnit sub; /* Offset from baseline for sub scripts */
78 } _DtHelpDAFontMetrics;
82 _DtHelpDAFontMetrics fm;
85 typedef struct _DtHelpDAfontInfo {
86 char **exact_fonts; /* the list of fonts specified by the
87 toss element rather than hints. */
88 XrmDatabase def_font_db; /* The default font resource db */
89 XrmDatabase font_idx_db; /* Which font index goes with which
90 set of font resources */
91 XFontStruct **font_structs; /* The font structures opened */
92 XFontSet *font_sets; /* The font sets opened */
93 DtHelpDAFSMetrics *fs_metrics;
95 XrmQuark lang_charset; /* the char set for current lang */
96 int *exact_idx; /* The indexes for the exact fonts */
97 int max_structs; /* the max number of font_structs */
98 int max_sets; /* The max number of font_sets */
99 int struct_cnt; /* the cur number of font_structs */
100 int set_cnt; /* The cur number of font_sets */
101 int def_idx; /* The default index */
105 * SelectionScroll structure
108 int horizontal_reason;
110 } SelectionScrollStruct;
113 * DisplayArea structure
115 typedef struct _dtHelpDispAreaStruct {
116 Widget dispWid; /* The text and graphic area. */
117 Widget vertScrollWid; /* The vertical scroll bar */
118 Widget horzScrollWid; /* The horizontal scroll bar */
119 Boolean vertIsMapped;
120 Boolean horzIsMapped;
121 short neededFlags; /* _DtHelpAS_NEEDED flags */
122 short nl_to_space; /* are newlines in multibyte */
123 /* strings turned into spaces? */
125 Dimension formWidth; /* Pixel width of the parent area */
126 Dimension formHeight; /* Pixel height of the parent area */
127 Dimension dispWidth; /* Pixel width of the display area */
128 Dimension dispHeight; /* Pixel height of the display area */
129 Dimension dispUseHeight; /* Pixel height of the display area
130 minus the decor margin. */
131 Dimension dispUseWidth; /* Pixel width of the display area
132 minus the decor margin. */
133 Dimension marginWidth; /* Pixel padding at the left and
134 right of the display area. */
135 Dimension marginHeight; /* Pixel padding at the top and
136 bottom of the display area. */
138 short decorThickness; /* the shadow thickness plus highlight
139 thickness of the display area */
141 void (*hyperCall)(); /* The hypertext callback */
142 void (*resizeCall)(); /* The resize callback */
143 int (*exec_filter)(); /* The execution filter callback */
144 XtPointer clientData; /* The client's data for the callback */
146 Pixel traversalColor; /* The client's traversal color */
147 Pixel foregroundColor; /* The client's foreground color */
148 Pixel backgroundColor; /* The client's foreground color */
149 Pixel searchColor; /* The client's search hilite color */
153 Pixmap def_pix; /* the default 'missing pixmap' */
154 Dimension def_pix_width; /* the width of the default pixmap */
155 Dimension def_pix_height; /* the height of the default pixmap */
156 _DtGrContext *context; /* image converter context */
158 Colormap colormap; /* The colormap to use */
159 Visual *visual; /* The visual to use */
161 DtHelpDAFontInfo font_info; /* The font information */
163 int depth; /* The depth of the window */
168 long charWidth; /* The average size of a character */
169 int moveThreshold; /* The number of pixels that must
170 be moved before a copy-paste
173 int lineThickness; /* For traversal box and underline */
174 int firstVisible; /* The absolute number of the first
175 line visible in the window. */
176 int nextNonVisible; /* The absolute number of the first
177 line non visible, next to the last
179 int visibleCount; /* The number of lines viewable */
180 int maxYpos; /* Maximum Y positioning */
182 int virtualX; /* The virtual x of the window */
183 int maxX; /* The max virtual x of a line */
185 int max_spc; /* The maximum special characters */
186 int cur_spc; /* The current unused structure */
187 int timerX; /* Used for button clicks/selections */
188 int timerY; /* Used for button clicks/selections */
189 int scr_timer_x; /* Used for button clicks/selections */
190 int scr_timer_y; /* Used for button clicks/selections */
191 int vert_init_scr; /* The initial vert scrolling timeout*/
192 int vert_rep_scr; /* The repeat vert scrolling timeout */
193 int horz_init_scr; /* The initial horz scrolling timeout*/
194 int horz_rep_scr; /* The repeat horz scrolling timeout */
195 _DtCvUnit toc_width; /* The width of the toc indicator */
196 _DtCvUnit toc_height; /* The height of the toc indicator */
197 _DtCvUnit toc_y; /* The y coordinate of the toc */
198 _DtCvUnit toc_base; /* The baseline coordinate of the toc*/
200 Time anchor_time; /* Indicates the primary selection
202 Boolean primary; /* Indicates if this widget has the
204 Boolean text_selected; /* Indicates if the selection has
206 enum _DtHelpSelectState select_state;
207 /* Indicates the state of the current
209 short toc_flag; /* Indicates if the traversal indicator
211 _DtCvPointer toc_indicator; /* The indicator used in the toc */
213 XtIntervalId scr_timer_id;
214 SelectionScrollStruct scr_timer_data;
215 DtHelpSpecialChars *spc_chars; /* Structure containing the spc chars */
217 _DtCvTopicPtr lst_topic;
218 wchar_t *cant_begin_chars; /* characters that cannot */
219 /* begin a line of text */
220 wchar_t *cant_end_chars; /* characters that cannot */
221 /* end a line of text */
223 short dtinfo; /* Indicates if being used by dtinfo */
224 Pixmap stipple; /* stippled pixmap */
226 /* callback to be called whenever you manipulate the display */
227 /* area's vertical scrollbar directly using XtSetValues, */
228 /* because the application (dtinfo) has callbacks on the */
229 /* scrollbar, these do not get called when we adjust it with */
231 void (*vScrollNotify)(void *,unsigned int);
233 /* dtinfo requires this for doing link previews */
234 void (*armCallback)(void*);
236 _DtCvValue honor_size; /* Layout parameter for _DtCvSetTopic */
237 _DtCvRenderType render_type; /* Render type performed on expose */
238 unsigned short media_resolution; /* used for scaling images */
240 } DtHelpDispAreaStruct;
242 #endif /* _DtHelpDisplayAreaP_h */