Merge branch 'master' into cde-next
[oweals/cde.git] / cde / lib / DtHelp / LayoutUtilI.h
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: LayoutUtilI.h /main/13 1996/10/10 12:24:06 cde-hp $ */
24 /************************************<+>*************************************
25  ****************************************************************************
26  **
27  **   File:       LayoutUtilI.h
28  **
29  **   Project:    Cde DtHelp
30  **
31  **   Description:
32  **
33  **  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
34  **
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  **
41  **
42  ****************************************************************************
43  ************************************<+>*************************************/
44 #ifndef _CELayoutUtilI_h
45 #define _CELayoutUtilI_h
46
47
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51
52 /********    Private Defines Declarations    ********/
53 #define _CEFORMAT_ALL   -1
54
55 /********    Private Typedef Declarations    ********/
56
57 /********    Private Structures Declarations    ********/
58 typedef struct  _dtCvLayoutStruct {
59         _DtCvSegmentI   *line_seg;
60         unsigned int     line_start;
61         unsigned int     line_bytes;
62         _DtCvUnit        cur_len;
63         _DtCvUnit        max_x_pos;
64         _DtCvUnit        cur_max_x;
65         _DtCvUnit        y_pos;
66         _DtCvUnit        text_x_pos;
67         _DtCvUnit        leading;
68         int              lst_hyper;
69         int              format_y;
70         int              join_line;
71         _DtCvValue       lst_vis;
72         _DtCvValue       join;
73         _DtCvValue       align_flag;
74         const char      *align_char;
75         _DtCvUnit        align_pos;
76         int             delayed_search_saves;
77 } _DtCvLayoutInfo;
78
79 /*****************************************************************************
80  *                      Private Macro Declarations
81  *****************************************************************************/
82
83 /********    Private Function Declarations    ********/
84
85 extern  void            _DtCvAddSpace (
86                                 _DtCvUnit        number,
87                                 _DtCvUnit       *ret_y);
88 extern  int             _DtCvAddToMarkList(
89                                 _DtCanvasStruct      *canvas,
90                                 _DtCvPointer     client_data,
91                                 _DtCvValue       flag,
92                                 _DtCvSelectData *beg,
93                                 _DtCvSelectData *end);
94 extern  int             _DtCvCalcMarkPos (
95                                 _DtCanvasStruct *canvas,
96                                 int              entry,
97                                 _DtCvUnit       *ret_x,
98                                 _DtCvUnit       *ret_y,
99                                 _DtCvUnit       *ret_width,
100                                 _DtCvUnit       *ret_height);
101 extern  void            _DtCvCheckAddHyperToTravList (
102                                 _DtCanvasStruct *canvas,
103                                 _DtCvSegmentI   *p_seg,
104                                 _DtCvValue       flag,
105                                 _DtCvValue      *lst_vis,
106                                 int             *lst_hyper,
107                                 _DtCvUnit       *cur_len);
108 extern  _DtCvValue      _DtCvCheckLineSyntax (
109                                 _DtCanvasStruct  *canvas,
110                                 _DtCvSegmentI    *pSeg,
111                                 int               start,
112                                 int               str_len,
113                                 _DtCvValue        skip_last_ck);
114 extern  _DtCvValue      _DtCvCheckOneByteCantBeginList (
115                                 char             c,
116                                 char            *cant_begin_list);
117 extern  _DtCvValue      _DtCvCheckOneByteCantEndList (
118                                 char             c,
119                                 char            *cant_end_list);
120 extern  _DtCvStatus     _DtCvCvtSegsToPts (
121                                 _DtCanvasStruct  *canvas,
122                                 _DtCvSegPtsI    **segs,
123                                 _DtCvSelectData  *beg,
124                                 _DtCvSelectData  *end,
125                                 _DtCvUnit        *ret_y1,
126                                 _DtCvUnit        *ret_y2,
127                                 _DtCvSegmentI   **ret_seg);
128 extern  int             _DtCvGetNextTravEntry (
129                                 _DtCanvasStruct  *canvas);
130 extern  int             _DtCvGetNextWidth (
131                                 _DtCanvasStruct  *canvas,
132                                 int               old_type,
133                                 int               lst_hyper,
134                                 _DtCvSegmentI    *pSeg,
135                                 int               start,
136                                 _DtCvSegmentI    *prev_seg,
137                                 _DtCvSegmentI   **nextSeg,
138                                 int              *nextStart,
139                                 int              *widthCount);
140 extern  int             _DtCvGetTraversalWidth (
141                                 _DtCanvasStruct  *canvas,
142                                 _DtCvSegmentI    *p_seg,
143                                 int               lst_hyper);
144 extern  void            _DtCvInitLayoutInfo (
145                                 _DtCanvasStruct  *canvas,
146                                 _DtCvLayoutInfo  *layout);
147 extern  int             _DtCvProcessStringSegment(
148                                 _DtCanvasStruct  *canvas,
149                                 _DtCvLayoutInfo  *lay_info,
150                                 _DtCvUnit         max_width,
151                                 _DtCvUnit         l_margin,
152                                 _DtCvUnit         r_margin,
153                                 _DtCvSegmentI    *cur_seg,
154                                 unsigned int     *cur_start,
155                                 _DtCvFrmtOption   txt_justify,
156                                 _DtCvValue        stat_flag);
157 extern  void            _DtCvSaveInfo (
158                                 _DtCanvasStruct  *canvas,
159                                 _DtCvLayoutInfo  *layout,
160                                 _DtCvUnit         max_width,
161                                 _DtCvUnit         r_margin,
162                                 _DtCvFrmtOption      txt_justify);
163 extern  void            _DtCvSetJoinInfo (
164                                 _DtCvLayoutInfo  *layout,
165                                 _DtCvValue        flag,
166                                 int               txt_ln);
167 extern  int             _DtCvSetTravEntryInfo (
168                               _DtCanvasStruct    *canvas,
169                               int                 entry,
170                               _DtCvTraversalType  type,
171                               _DtCvSegmentI      *p_seg,
172                               int                 line_idx,
173                               _DtCvValue          inc);
174 extern  int             _DtCvSetTravEntryPos (
175                               _DtCanvasStruct    *canvas,
176                               int                 entry,
177                               _DtCvUnit           x,
178                               _DtCvUnit           y,
179                               _DtCvUnit           width,
180                               _DtCvUnit           height);
181 extern  void            _DtCvSortTraversalList (
182                               _DtCanvasStruct    *canvas,
183                               _DtCvValue          retain);
184 extern  int             _DtCvSetSearchEntryInfo (
185                               _DtCanvasStruct* canvas,
186                               int line_idx);
187
188 #ifdef __cplusplus
189 }  /* Close scope of 'extern "C"' declaration which encloses file. */
190 #endif
191
192 #endif /* _CELayoutUtilI_h */
193 /* DON'T ADD ANYTHING AFTER THIS #endif */