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: CanvasI.h /main/18 1996/10/21 13:59:51 cde-hp $ */
24 /*************************************<+>*************************************
25 *****************************************************************************
31 ** Description: Public Header file for Canvas.c
33 ** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
35 ** (c) Copyright 1993, 1994 Hewlett-Packard Company
36 ** (c) Copyright 1993, 1994 International Business Machines Corp.
37 ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
38 ** (c) Copyright 1993, 1994 Novell, Inc.
39 *******************************************************************
40 *************************************<+>*************************************/
51 /******** Internal Defines Declarations ********/
52 #define _DtCvLINE_HORZ 0
53 #define _DtCvLINE_VERT 1
55 /******** Internal Enum Declarations ********/
56 enum _dtCvTraversalType
63 /******** Internal Typedef Declarations ********/
65 #if !defined(_DtCvLinkMgrP_h) && !defined(_DtCvLinkMgrI_h)
66 typedef struct _dtCvLinkDb* _DtCvLinkDb;
69 typedef enum _dtCvTraversalType _DtCvTraversalType;
71 /* adding this typedef so that debugging can access the structure */
72 typedef struct _dtCvSegment _DtCvSegmentI;
73 typedef struct _dtCvSegPts _DtCvSegPtsI;
75 /******** Internal Structures Declarations ********/
77 typedef struct _dtCvDspLine {
86 _DtCvSegmentI *seg_ptr;
89 typedef struct _dtCvLineSeg {
100 typedef struct _dtCvPointData {
102 _DtCvUnit y; /* baseline of the line */
107 typedef struct _dtCvMarkData {
109 _DtCvPointer client_data;
114 typedef struct _dtCvTraversalInfo {
116 _DtCvTraversalType type; /* the type of the traversal */
117 int idx; /* the index into the approp. struct */
118 /* either the txt_lst or marks */
119 _DtCvUnit x_pos; /* x pos on the line. */
120 _DtCvUnit y_pos; /* top y pos of bounding box */
121 _DtCvUnit width; /* width of link on 1st line only */
122 _DtCvUnit height; /* height of 1st line bounding box */
123 _DtCvSegmentI *seg_ptr; /* ptr to first seg of link */
124 } _DtCvTraversalInfo;
126 typedef struct _dtCvSearchData {
127 int idx; /* the line index of the search hit */
128 _DtCvDspLine *lst; /* pointer to the text line list */
131 typedef struct _dtCanvasStruct {
133 long txt_cnt; /* maximum used in txt_list */
134 int txt_max; /* maximum in txt_list */
136 int line_cnt; /* maximum used in line_lst */
137 int line_max; /* maximum in line_lst */
138 int mark_cnt; /* mark counter */
139 int mark_max; /* maximum in mark_lst */
141 int trav_cnt; /* maximum used in trav_lst */
142 int trav_max; /* maximum in trav_lst */
143 int cur_trav; /* traversal indicator */
148 int brk_cnt; /* the number of page breaks */
149 int brk_max; /* the maxium entries */
151 short mb_length; /* The maximum length of a char */
153 _DtCvUnit max_x; /* The maximum x position */
154 _DtCvUnit max_y; /* The maximum y position */
155 _DtCvValue constraint; /* Indicates if the right
156 boundary can be breached */
157 _DtCvValue trav_on; /* Indicates if the traversal
159 _DtCvPointer client_data;
160 _DtCvMetrics metrics;
161 _DtCvSpaceMetrics link_info;
162 _DtCvSpaceMetrics traversal_info;
165 _DtCvSegmentI *element_lst;
166 _DtCvDspLine *txt_lst;
167 _DtCvLineSeg *line_lst;
168 _DtCvTraversalInfo *trav_lst;
169 _DtCvLinkDb link_data;
170 _DtCvPointData select_start;
171 _DtCvPointData select_end;
172 _DtCvMarkData *marks;
173 _DtCvSearchData *searchs;
174 _DtCvUnit *pg_breaks;
175 _DtCvVirtualInfo virt_functions;
179 /******** Internal Structure Typedef Declarations ********/
180 typedef struct _dtCvPointData _DtCvSelectData;
182 /******** Internal Macros Declarations ********/
184 #define _DtCvHasTraversal(x) ((x) & _DtCvTRAVERSAL_FLAG)
187 * segment type access
189 #define _DtCvIsTypeNoop(x) \
190 ((((x) & _DtCvPRIMARY_MASK) == _DtCvNOOP) ? 1 : 0)
195 #define _DtCvIsSegVisibleLink(x) _DtCvIsSegHyperText(x)
196 #define _DtCvIsSegALink(x) \
197 (_DtCvIsSegHyperText(x) || _DtCvIsSegGhostLink(x))
199 #define _DtCvIsMarkMaskOn(x) \
200 (((x) & _DtCvACTIVATE_MARK_ON) ? _DtCvTRUE : _DtCvFALSE)
205 #define _DtCvRemoveBeginFlags(x) x &= ~(_DtCvTRAVERSAL_BEGIN | \
209 #define _DtCvSetSearchEnd(x,seg) x |= ((seg)->type & _DtCvSEARCH_END)
210 #define _DtCvSetSearchBegin(x,seg) x |= ((seg)->type & _DtCvSEARCH_BEGIN)
211 #define _DtCvClearSearchFlags(x) x &= ~(_DtCvSEARCH_FLAG | \
212 _DtCvSEARCH_BEGIN | \
215 #define _DtCvClearLinkFlags(x) x &= ~(_DtCvLINK_FLAG | \
219 _DtCvLINK_NEW_WINDOW)
221 #define _DtCvClearProcessed(x) (x).processed = False
222 #define _DtCvSetProcessed(x) (x).processed = True
223 #define _DtCvIsProcessed(x) (x).processed
224 #define _DtCvIsNotProcessed(x) ((False == (x).processed) ? True : False)
225 #define _DtCvStraddlesPt(pt,min,max) ((min) <= (pt) && (pt) <= (max))
227 /******** Internal Function Declarations ********/
228 extern _DtCvUnit _DtCvAdjustForSuperSub(
229 _DtCanvasStruct *canvas,
230 _DtCvSegmentI *p_seg,
233 _DtCvUnit *super_width,
235 _DtCvUnit *sub_width,
237 _DtCvValue *super_flag,
238 _DtCvValue *sub_flag);
239 extern _DtCvUnit _DtCvAdvanceXOfLine (
240 _DtCanvasStruct *canvas,
241 _DtCvSegmentI *p_seg,
244 _DtCvValue *link_flag);
245 extern _DtCvStatus _DtCvCheckInfringement (
250 extern void _DtCvCheckLineMarks (
251 _DtCanvasStruct *canvas,
256 _DtCvFlags check_flags,
259 _DtCvFlags *ret_new);
260 extern void _DtCvClearInternalUse (
263 extern _DtCvUnit _DtCvDrawSegments(
264 _DtCanvasStruct *canvas,
266 _DtCvSegmentI *p_seg,
273 _DtCvUnit *super_width,
275 _DtCvUnit *sub_width,
277 _DtCvValue *last_was_sub,
278 _DtCvValue *last_was_super,
279 _DtCvValue *last_link_vis,
282 _DtCvElemType trav_flag,
283 _DtCvPointer trav_data);
284 extern int _DtCvGetCharIdx(
285 _DtCanvasStruct *canvas,
288 extern _DtCvUnit _DtCvGetStartXOfLine(
290 _DtCvSegmentI **pSeg);
291 extern void _DtCvGetWidthOfSegment(
292 _DtCanvasStruct *canvas,
293 _DtCvSegmentI *p_seg,
298 _DtCvValue *ret_trimmed);
299 extern _DtCvValue _DtCvModifyXpos(
300 _DtCvSpaceMetrics info,
302 _DtCvValue tst_result,
303 _DtCvValue old_result,
306 extern void _DtCvSkipLineChars(
307 _DtCanvasStruct *canvas,
308 _DtCvSegmentI *p_seg,
313 _DtCvSegmentI **ret_seg);
316 } /* Close scope of 'extern "C"' declaration which encloses file. */
319 #endif /* _DtCanvasI_h */
320 /* DON'T ADD ANYTHING AFTER THIS #endif */