2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: DisplayAreaP.h /main/18 1996/08/13 11:35:51 cde-hp $ */
24 /************************************<+>*************************************
25 ****************************************************************************
27 ** File: DisplayAreaP.h
29 ** Project: Cde Help System
31 ** Description: Defines the Display Area structures and defines.
33 ****************************************************************************
34 ************************************<+>*************************************/
36 * (c) Copyright 1996 Digital Equipment Corporation.
37 * (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992,
38 1993, 1994, 1996 Hewlett-Packard Company.
39 * (c) Copyright 1993, 1994, 1996 International Business Machines Corp.
40 * (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc.
41 * (c) Copyright 1993, 1994, 1996 Novell, Inc.
42 * (c) Copyright 1996 FUJITSU LIMITED.
43 * (c) Copyright 1996 Hitachi.
46 #ifndef _DtHelpDisplayAreaP_h
47 #define _DtHelpDisplayAreaP_h
51 #include <Dt/CanvasP.h>
52 #include <DtI/GraphicsP.h>
57 #define _DT_HELP_SHADOW_TRAVERSAL (1 << 0)
58 #define _DT_HELP_NOT_INITIALIZED (1 << 1)
59 #define _DT_HELP_TRAVERSAL_DRAWN (1 << 2)
60 #define _DT_HELP_DRAW_TOC_IND (1 << 3)
61 #define _DT_HELP_CLEAR_TOC_IND (1 << 4)
62 #define _DT_HELP_TOC_ON (1 << 5)
65 * enum states for selection
67 enum _DtHelpSelectState
75 * Whether the display area has the focus or not
77 #define _DT_HELP_FOCUS_FLAG 0x04
87 } DtHelpGraphicStruct;
90 _DtCvPointer font_ptr;
94 typedef struct _dtHelpDAFontMetrics {
95 _DtCvUnit ascent; /* Maximum ascent */
96 _DtCvUnit descent; /* Maximum descent */
97 _DtCvUnit average_width; /* Average width of a character */
98 _DtCvUnit super; /* Offset from baseline for super scripts */
99 _DtCvUnit sub; /* Offset from baseline for sub scripts */
100 } _DtHelpDAFontMetrics;
104 _DtHelpDAFontMetrics fm;
107 typedef struct _DtHelpDAfontInfo {
108 char **exact_fonts; /* the list of fonts specified by the
109 toss element rather than hints. */
110 XrmDatabase def_font_db; /* The default font resource db */
111 XrmDatabase font_idx_db; /* Which font index goes with which
112 set of font resources */
113 XFontStruct **font_structs; /* The font structures opened */
114 XFontSet *font_sets; /* The font sets opened */
115 DtHelpDAFSMetrics *fs_metrics;
117 XrmQuark lang_charset; /* the char set for current lang */
118 int *exact_idx; /* The indexes for the exact fonts */
119 int max_structs; /* the max number of font_structs */
120 int max_sets; /* The max number of font_sets */
121 int struct_cnt; /* the cur number of font_structs */
122 int set_cnt; /* The cur number of font_sets */
123 long def_idx; /* The default index */
127 * SelectionScroll structure
130 int horizontal_reason;
132 } SelectionScrollStruct;
135 * DisplayArea structure
137 typedef struct _dtHelpDispAreaStruct {
138 Widget dispWid; /* The text and graphic area. */
139 Widget vertScrollWid; /* The vertical scroll bar */
140 Widget horzScrollWid; /* The horizontal scroll bar */
141 Boolean vertIsMapped;
142 Boolean horzIsMapped;
143 short neededFlags; /* _DtHelpAS_NEEDED flags */
144 short nl_to_space; /* are newlines in multibyte */
145 /* strings turned into spaces? */
147 Dimension formWidth; /* Pixel width of the parent area */
148 Dimension formHeight; /* Pixel height of the parent area */
149 Dimension dispWidth; /* Pixel width of the display area */
150 Dimension dispHeight; /* Pixel height of the display area */
151 Dimension dispUseHeight; /* Pixel height of the display area
152 minus the decor margin. */
153 Dimension dispUseWidth; /* Pixel width of the display area
154 minus the decor margin. */
155 Dimension marginWidth; /* Pixel padding at the left and
156 right of the display area. */
157 Dimension marginHeight; /* Pixel padding at the top and
158 bottom of the display area. */
160 short decorThickness; /* the shadow thickness plus highlight
161 thickness of the display area */
163 void (*hyperCall)(); /* The hypertext callback */
164 void (*resizeCall)(); /* The resize callback */
165 int (*exec_filter)(); /* The execution filter callback */
166 XtPointer clientData; /* The client's data for the callback */
168 Pixel traversalColor; /* The client's traversal color */
169 Pixel foregroundColor; /* The client's foreground color */
170 Pixel backgroundColor; /* The client's foreground color */
171 Pixel searchColor; /* The client's search hilite color */
175 Pixmap def_pix; /* the default 'missing pixmap' */
176 Dimension def_pix_width; /* the width of the default pixmap */
177 Dimension def_pix_height; /* the height of the default pixmap */
178 _DtGrContext *context; /* image converter context */
180 Colormap colormap; /* The colormap to use */
181 Visual *visual; /* The visual to use */
183 DtHelpDAFontInfo font_info; /* The font information */
185 int depth; /* The depth of the window */
190 long charWidth; /* The average size of a character */
191 int moveThreshold; /* The number of pixels that must
192 be moved before a copy-paste
195 int lineThickness; /* For traversal box and underline */
196 int firstVisible; /* The absolute number of the first
197 line visible in the window. */
198 int nextNonVisible; /* The absolute number of the first
199 line non visible, next to the last
201 int visibleCount; /* The number of lines viewable */
202 int maxYpos; /* Maximum Y positioning */
204 int virtualX; /* The virtual x of the window */
205 int maxX; /* The max virtual x of a line */
207 int max_spc; /* The maximum special characters */
208 int cur_spc; /* The current unused structure */
209 int timerX; /* Used for button clicks/selections */
210 int timerY; /* Used for button clicks/selections */
211 int scr_timer_x; /* Used for button clicks/selections */
212 int scr_timer_y; /* Used for button clicks/selections */
213 int vert_init_scr; /* The initial vert scrolling timeout*/
214 int vert_rep_scr; /* The repeat vert scrolling timeout */
215 int horz_init_scr; /* The initial horz scrolling timeout*/
216 int horz_rep_scr; /* The repeat horz scrolling timeout */
217 _DtCvUnit toc_width; /* The width of the toc indicator */
218 _DtCvUnit toc_height; /* The height of the toc indicator */
219 _DtCvUnit toc_y; /* The y coordinate of the toc */
220 _DtCvUnit toc_base; /* The baseline coordinate of the toc*/
222 Time anchor_time; /* Indicates the primary selection
224 Boolean primary; /* Indicates if this widget has the
226 Boolean text_selected; /* Indicates if the selection has
228 enum _DtHelpSelectState select_state;
229 /* Indicates the state of the current
231 short toc_flag; /* Indicates if the traversal indicator
233 _DtCvPointer toc_indicator; /* The indicator used in the toc */
235 XtIntervalId scr_timer_id;
236 SelectionScrollStruct scr_timer_data;
237 DtHelpSpecialChars *spc_chars; /* Structure containing the spc chars */
239 _DtCvTopicPtr lst_topic;
240 wchar_t *cant_begin_chars; /* characters that cannot */
241 /* begin a line of text */
242 wchar_t *cant_end_chars; /* characters that cannot */
243 /* end a line of text */
245 short dtinfo; /* Indicates if being used by dtinfo */
246 Pixmap stipple; /* stippled pixmap */
248 /* callback to be called whenever you manipulate the display */
249 /* area's vertical scrollbar directly using XtSetValues, */
250 /* because the application (dtinfo) has callbacks on the */
251 /* scrollbar, these do not get called when we adjust it with */
253 void (*vScrollNotify)(void *,unsigned int);
255 /* dtinfo requires this for doing link previews */
256 void (*armCallback)(void*);
258 _DtCvValue honor_size; /* Layout parameter for _DtCvSetTopic */
259 _DtCvRenderType render_type; /* Render type performed on expose */
260 unsigned short media_resolution; /* used for scaling images */
262 } DtHelpDispAreaStruct;
264 #endif /* _DtHelpDisplayAreaP_h */