1/*
2 * Author:      William Chia-Wei Cheng (bill.cheng@acm.org)
3 *
4 * Copyright (C) 2001-2009, William Chia-Wei Cheng.
5 *
6 * This file may be distributed under the terms of the Q Public License
7 * as defined by Trolltech AS of Norway and appearing in the file
8 * LICENSE.QPL included in the packaging of this file.
9 *
10 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING
11 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
12 * PURPOSE.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
13 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
14 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
16 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
18 * @(#)$Header: /mm2/home/cvs/bc-src/tgif/rect.e,v 1.6 2011/05/16 16:21:59 william Exp $
19 */
20
21#ifndef _RECT_E_
22#define _RECT_E_
23
24#ifdef _INCLUDE_FROM_RECT_C_
25#undef extern
26#define extern
27#endif /*_INCLUDE_FROM_RECT_C_*/
28
29extern void	DumpRectPath ARGS_DECL((FILE *, int LtX, int LtY, int RbX,
30		                        int RbY, int Indent, int LastLF));
31extern void	SetPoint ARGS_DECL((IntPoint*, int X, int Y));
32extern void	ClipRect ARGS_DECL((struct BBRec *, int W, int H));
33extern int	CompareRect ARGS_DECL((struct BBRec *, struct BBRec *));
34extern void	SetRotateVs ARGS_DECL((XPoint *, int LtX, int LtY, int RbX,
35		                       int RbY));
36extern void	SetBBRec ARGS_DECL((struct BBRec *, int LtX, int LtY, int RbX,
37		                    int RbY));
38extern void	ConcatCTM ARGS_DECL((struct XfrmMtrxRec *ctm,
39		                     struct XfrmMtrxRec *orig_ctm,
40		                     struct XfrmMtrxRec *new_ctm));
41extern void	TransformDoublePointThroughCTM ARGS_DECL((double X, double Y,
42		                                          struct XfrmMtrxRec *,
43		                                          double *NewX,
44		                                          double *NewY));
45extern void	TransformPointThroughCTM ARGS_DECL((int X, int Y,
46		                                    struct XfrmMtrxRec *,
47		                                    int *NewX, int *NewY));
48extern void	ReverseTransformDoublePointThroughCTM ARGS_DECL((double X,
49		                                           double Y,
50		                                           struct XfrmMtrxRec *,
51		                                           double *NewDx,
52		                                           double *NewDy));
53extern void	ReverseTransformPointThroughCTM ARGS_DECL((int X, int Y,
54		                                           struct XfrmMtrxRec *,
55		                                           int *NewX,
56		                                           int *NewY));
57extern void	TransformObjectV ARGS_DECL((struct ObjRec *,
58		                            IntPoint *VIn, IntPoint *VOut));
59extern void	ReversedTransformObjectV ARGS_DECL((struct ObjRec *,
60		                                   IntPoint *VIn,
61		                                   IntPoint *VOut));
62extern void	TransformOffsetBBoxThroughCTM ARGS_DECL((struct BBRec *,
63		                                         struct XfrmMtrxRec *,
64		                                         IntPoint *));
65extern void	GetTransformedOBBoxOffsetVs ARGS_DECL((struct ObjRec *,
66		                                       XPoint *));
67extern void	GetTransformedOBBoxAbsVs ARGS_DECL((struct ObjRec *,
68		                                    IntPoint *));
69extern void	SetCTM ARGS_DECL((struct ObjRec *, struct XfrmMtrxRec *));
70extern void	ExpandExtents ARGS_DECL((struct BBRec *pBBox, int *pnLtX,
71		                         int *pnLtY, int *pnRbX, int *pnRbY));
72extern void	ExpandBBox ARGS_DECL((struct BBRec *pBBox,
73		                      struct BBRec *pBBoxToExpand));
74extern void	InflateBBox ARGS_DECL((struct BBRec *pBBoxIn, int Dx, int Dy,
75		                       struct BBRec *pBBoxOut));
76extern void	OffsetBBox ARGS_DECL((struct BBRec *pBBoxIn, int Dx, int Dy,
77		                      struct BBRec *pBBoxOut));
78extern int	BBoxIntersect ARGS_DECL((struct BBRec BBox1,
79		                         struct BBRec BBox2));
80extern int	IntersectRect ARGS_DECL((struct BBRec BBox1, struct BBRec BBox2,
81		                         struct BBRec *BBox3));
82extern void	UnionRect ARGS_DECL((struct BBRec *BBox1, struct BBRec *BBox2,
83		                     struct BBRec *UnionBBox));
84extern int	Inside ARGS_DECL((struct BBRec Rect1, struct BBRec Rect2));
85extern int	PointInBBox ARGS_DECL((int X, int Y, struct BBRec Rect));
86extern int	PointInIntPolygon ARGS_DECL((int X, int Y, int NumPts,
87		                             IntPoint *));
88extern int	PointInPolygon ARGS_DECL((int X, int Y, int NumPts, XPoint *));
89extern int	PointInPoly ARGS_DECL((int X, int Y, int NumPts, XPoint *,
90		                       int LineWidth));
91extern int	PointOnPoly ARGS_DECL((int X, int Y, int NumPts, XPoint *,
92		                       int LineWidth));
93extern int	FindGoodText ARGS_DECL((int XOff, int YOff, struct ObjRec *));
94extern int	FindGoodXBm ARGS_DECL((int XOff, int YOff, struct ObjRec *));
95extern int	FindGoodXPm ARGS_DECL((int XOff, int YOff, struct ObjRec *));
96extern int	FindGoodBox ARGS_DECL((int XOff, int YOff, struct ObjRec *));
97extern int	FindGoodRCBox ARGS_DECL((int XOff, int YOff, struct ObjRec *));
98extern int	FindGoodOval ARGS_DECL((int XOff, int YOff, struct ObjRec *));
99extern int	FindGoodPoly ARGS_DECL((int XOff, int YOff, struct ObjRec *));
100extern int	FindGoodPolygon ARGS_DECL((int XOff, int YOff,
101		                           struct ObjRec *));
102extern int	FindGoodArc ARGS_DECL((int XOff, int YOff, struct ObjRec *));
103extern int	FindGoodObj ARGS_DECL((int XOff, int YOff, struct ObjRec *First,
104		                       struct ObjRec **SubObj,
105		                       struct ObjRec **ImmediateChildObj));
106
107#ifdef _INCLUDE_FROM_RECT_C_
108#undef extern
109#ifndef _NO_RECURSIVE_EXTERN
110#define extern extern
111#endif /* ~_NO_RECURSIVE_EXTERN */
112#endif /*_INCLUDE_FROM_RECT_C_*/
113
114#endif /*_RECT_E_*/
115