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/stretch.e,v 1.28 2011/05/16 16:21:59 william Exp $
19 */
20
21#ifndef _STRETCH_E_
22#define _STRETCH_E_
23
24extern int	stretchableText;
25extern int	compoundObjWithTextStretchableForPSE;
26extern int	rotationIncrement;
27
28extern int	autoRotatePivot;
29extern int	rotatePivotAbsXYValid;
30extern int	rotatePivotAbsX;
31extern int	rotatePivotAbsY;
32
33#ifdef _INCLUDE_FROM_STRETCH_C_
34#undef extern
35#define extern
36#endif /*_INCLUDE_FROM_STRETCH_C_*/
37
38extern int	PtInPolyMark ARGS_DECL((struct ObjRec *, int XOff, int YOff,
39		                        int NumPts, IntPoint *, int *Index));
40extern int	RetractedArrowAttr ARGS_DECL((struct ObjRec *));
41extern int	AutoRetractedArrowAttr ARGS_DECL((struct ObjRec *,
42		                                  int CheckVCount));
43extern int	AutoCenterAttr ARGS_DECL((struct ObjRec *));
44extern void	CenterObjInOBBox ARGS_DECL((struct ObjRec *TextObjPtr,
45                                            struct BBRec OBBox,
46                                            struct BBRec *OBBoxReturn));
47extern struct SelRec	* PtInSelMark ARGS_DECL((int XOff, int YOff,
48			                         int * Corner));
49extern int	HasOnReshape ARGS_DECL((struct ObjRec *, struct AttrRec **));
50extern int	GetVlistIndexFromStretchStructuredSplineInfo ARGS_DECL((
51				StretchStructuredSplineInfo*, int ss_index));
52extern void	SetIPTInfoForStretchPoly ARGS_DECL((int index, int n, IntPoint*,
53				StretchStructuredSplineInfo*));
54extern void	SetIPTInfoForStretchPolygon ARGS_DECL((int index, int n,
55				IntPoint*, StretchStructuredSplineInfo*));
56extern void	SetVsAndVs2ForStretchStructSpline ARGS_DECL((
57				StretchStructuredSplineInfo*, int dx, int dy,
58				int *pn_num_vs, IntPoint *vs, int *pn_num_vs2,
59				IntPoint *vs2));
60extern void	FixUpSmoothAndSmooth2ForStretchStructSpline ARGS_DECL((
61				int num_vs, char *smooth, int num_vs2,
62				char *smooth2));
63extern void	EraseHighLightForHinge ARGS_DECL((StretchStructuredSplineInfo*,
64				int dx, int dy, int draw_dashed_line,
65				int draw_vertices));
66extern void	EraseHighLightForSmooth ARGS_DECL((StretchStructuredSplineInfo*,
67				int dx, int dy, int draw_dashed_line,
68				int draw_vertices));
69extern void	EraseHighLightForStretchStructSpline ARGS_DECL((
70				StretchStructuredSplineInfo*, int dx, int dy,
71				int draw_dashed_line, int draw_vertices));
72extern XPoint	*DupVs ARGS_DECL((int *pn_return, XPoint *vs, int n));
73extern void	MoveATransformedPoint ARGS_DECL((struct ObjRec *, IntPoint*,
74				int abs_dx, int abs_dy));
75extern void	UpdateObjForStretchStructSpline ARGS_DECL((struct ObjRec *,
76				int n, IntPoint *vs, int abs_dx, int abs_dy,
77				StretchStructuredSplineInfo*));
78extern void	ShearObj ARGS_DECL((struct ObjRec *, int Corner, double dXShear,
79		                    double dYShear, double dXScale,
80		                    double dYScale, int *RealLtX,
81		                    int *RealLtY));
82extern void	StretchSel ARGS_DECL((int XGridOff, int YGridOff,
83		                      struct ObjRec *, int Corner));
84extern void	ScaleAnEPSObj ARGS_DECL((struct ObjRec *, float * Scale));
85extern void	ScaleAllSelObj ARGS_DECL((void));
86extern void	PreciseScaleEverything ARGS_DECL((void));
87extern void	ScaleObjLikeScaleEverything ARGS_DECL((struct ObjRec *,
88		                                       double Scale,
89		                                       int Redraw));
90extern void	SizeAllSelObj ARGS_DECL((int AbsW, int AbsH));
91extern void	SizeAnObj ARGS_DECL((struct ObjRec *ObjPtr,
92		                     struct ObjRec *TopOwner,
93		                     int AbsW, int AbsH));
94extern void	SizeAllSelToGivenWidthHeight ARGS_DECL((int AbsW, int AbsH));
95extern void	SizeAllSelToGivenWidth ARGS_DECL((int AbsW));
96extern void	SizeAllSelToGivenHeight ARGS_DECL((int AbsH));
97extern void	FlipObjHorizontal ARGS_DECL((struct ObjRec *));
98extern void	FlipIconHorizontal ARGS_DECL((struct ObjRec *));
99extern void	FlipObjVertical ARGS_DECL((struct ObjRec *));
100extern void	FlipIconVertical ARGS_DECL((struct ObjRec *));
101
102extern void	SetRotatePivot ARGS_DECL((void));
103extern void	SetRotatePivotByObject ARGS_DECL((struct ObjRec *));
104extern void	RotateObjForLayout ARGS_DECL((struct ObjRec *, double, int));
105extern void	RotateObj ARGS_DECL((struct ObjRec *, int Corner,
106		                     int AngleDelta, int *RealLtX,
107		                     int *RealLtY));
108extern void	RotateObjClockWise ARGS_DECL((struct ObjRec *));
109extern void	RotateIconClockWise ARGS_DECL((struct ObjRec *));
110extern void	RotateObjCounter ARGS_DECL((struct ObjRec *));
111extern void	RotateIconCounter ARGS_DECL((struct ObjRec *));
112extern void	FlipHorizontal ARGS_DECL((void));
113extern void	FlipVertical ARGS_DECL((void));
114extern void	RotateClockWise ARGS_DECL((void));
115extern void	RotateCounter ARGS_DECL((void));
116extern void	SetTextRotation ARGS_DECL((char*));
117extern void	SetRotationIncrement ARGS_DECL((char*));
118extern void	SetSelCTM ARGS_DECL((int nTransformed, struct XfrmMtrxRec *));
119extern void	RotateShearSel ARGS_DECL((int XGridOff, int YGridOff,
120		                          struct ObjRec *, int Corner));
121
122extern TgMenu	*CreateFlipRotateMenu ARGS_DECL((TgMenu*, int X, int Y,
123		                                 TgMenuInfo*,
124		                                 int status_str_xlated));
125extern void	HighLightRotatePivot ARGS_DECL((int dir));
126extern int	PtInRotatePivot ARGS_DECL((int mouse_x, int mouse_y));
127extern TgMenu	*CreateMoveStdRotatePivotMenu ARGS_DECL((TgMenu*, int X, int Y,
128				TgMenuInfo*, int status_str_xlated));
129extern void	RefreshAutoRotatePivotMenu ARGS_DECL((TgMenu*));
130extern TgMenu	*CreateAutoRotatePivotMenu ARGS_DECL((TgMenu*, int X, int Y,
131                                                      TgMenuInfo*,
132                                                      int status_str_xlated));
133extern int	AutoRotatePivotMenu ARGS_DECL((int X, int Y, int TrackMenubar));
134
135extern void	ResetRotatePivotValidInfo ARGS_DECL((void));
136extern int	ReadRotatePivotInfo ARGS_DECL((char*));
137extern void	ContinueMoveRotatePivot ARGS_DECL((int OrigX, int OrigY));
138extern void	ToggleAutoRotatePivot ARGS_DECL((void));
139extern void	SpecifyRotatePivot ARGS_DECL((void));
140extern void	ResetRotatePivot ARGS_DECL((void));
141extern void	NextPolyRotationPivot ARGS_DECL((void));
142extern void	MoveRotationPivotToArcCenter ARGS_DECL((void));
143extern void	MoveRotatePivot ARGS_DECL((int Corner));
144extern void	AutoRotatePivotSubMenu ARGS_DECL((int index));
145
146#ifdef _INCLUDE_FROM_STRETCH_C_
147#undef extern
148#ifndef _NO_RECURSIVE_EXTERN
149#define extern extern
150#endif /* ~_NO_RECURSIVE_EXTERN */
151#endif /*_INCLUDE_FROM_STRETCH_C_*/
152
153#endif /*_STRETCH_E_*/
154