1 /*
2  * FIG : Facility for Interactive Generation of figures
3  * Copyright (c) 1985-1988 by Supoj Sutanthavibul
4  * Parts Copyright (c) 1989-2015 by Brian V. Smith
5  * Parts Copyright (c) 1991 by Paul King
6  * Parts Copyright (c) 2016-2020 by Thomas Loimer
7  *
8  * Any party obtaining a copy of these files is granted, free of charge, a
9  * full and unrestricted irrevocable, world-wide, paid up, royalty-free,
10  * nonexclusive right and license to deal in this software and documentation
11  * files (the "Software"), including without limitation the rights to use,
12  * copy, modify, merge, publish, distribute, sublicense and/or sell copies of
13  * the Software, and to permit persons who receive copies from any such
14  * party to do so, with the only requirement being that the above copyright
15  * and this permission notice remain intact.
16  *
17  */
18 
19 #ifndef U_ELASTIC_H
20 #define U_ELASTIC_H
21 
22 #include <stdint.h>	/* intptr_t */
23 #include <X11/X.h>
24 
25 #include "object.h"
26 
27 #define		MOVE_ARB	0
28 #define		MOVE_HORIZ_VERT 1
29 #define		BOX_SCALE	2
30 #define		BOX_HSTRETCH	3
31 #define		BOX_VSTRETCH	4
32 
33 #define		MSG_RADIUS	0
34 #define		MSG_RADIUS2	1
35 #define		MSG_DIAM	2
36 #define		MSG_LENGTH	3
37 #define		MSG_DIST	4
38 #define		MSG_PNTS_LENGTH	5
39 #define		MSG_DIAM_ANGLE	6
40 #define		MSG_RADIUS_ANGLE 7
41 
42 extern int	constrained;
43 extern float	cur_angle;
44 extern int	work_numsides;
45 extern int	x1off, x2off, y1off, y2off;
46 extern Cursor	cur_latexcursor;
47 extern int	from_x, from_y;
48 extern double	cosa, sina;
49 extern intptr_t	movedpoint_num;
50 extern F_point *left_point, *right_point;
51 
52 extern void	elastic_box(int x1, int y1, int x2, int y2);
53 extern void	elastic_fixedbox(void);
54 extern void	elastic_movebox(void);
55 extern void	resizing_box(int x, int y);
56 extern void	elastic_box_constrained();
57 extern void	constrained_resizing_box(int x, int y);
58 extern void	constrained_resizing_scale_box(int x, int y);
59 extern void	moving_box(int x, int y);
60 
61 extern void	elastic_poly(int x1, int y1, int x2, int y2, int numsides);
62 extern void	resizing_poly(int x, int y);
63 extern void	scaling_compound(int x, int y);
64 extern void	elastic_scalecompound(F_compound *c);
65 extern void	elastic_scale_curcompound(void);
66 
67 extern void	resizing_cbr(int x, int y), elastic_cbr(void), resizing_cbd(int x, int y), elastic_cbd(void);
68 extern void	resizing_ebr(int x, int y), elastic_ebr(void), resizing_ebd(int x, int y), elastic_ebd(void);
69 extern void	constrained_resizing_ebr(int x, int y), constrained_resizing_ebd(int x, int y);
70 extern void	constrained_resizing_cbd(int x, int y);
71 extern void	elastic_moveellipse(void);
72 extern void	moving_ellipse(int x, int y);
73 extern void	elastic_scaleellipse(F_ellipse *e);
74 extern void	scaling_ellipse(int x, int y);
75 extern void	elastic_scale_curellipse(void);
76 
77 extern void	unconstrained_line(int x, int y);
78 extern void	latex_line(int x, int y);
79 extern void	constrainedangle_line(int x, int y);
80 extern void	elastic_moveline(F_point *pts);
81 extern void	elastic_movenewline(void);
82 extern void	elastic_line(void);
83 extern void	elastic_dimension_line();
84 extern void	moving_line(int x, int y);
85 extern void	reshaping_line(int x, int y);
86 extern void	reshaping_latexline();
87 extern void	elastic_linelink(void);
88 extern void	elastic_scalepts(F_point *pts);
89 extern void	scaling_line(int x, int y);
90 extern void	elastic_scale_curline(int x, int y);
91 
92 extern void	arc_point(int x, int y, int numpoint);
93 extern void	moving_arc(int x, int y);
94 extern void	elastic_movearc(F_arc *a);
95 extern void	elastic_movenewarc(void);
96 extern void	reshaping_arc(int x, int y);
97 extern void	elastic_arclink(void);
98 extern void	scaling_arc(int x, int y);
99 extern void	elastic_scalearc(F_arc *a);
100 extern void	elastic_scale_curarc(void);
101 
102 extern void	moving_text(int x, int y);
103 extern void	draw_movingtext();
104 extern void	elastic_movetext(void);
105 
106 extern void	moving_spline(int x, int y);
107 extern void	elastic_movenewspline(void);
108 extern void	scaling_spline(int x, int y);
109 extern void	elastic_scale_curspline(void);
110 
111 extern void	adjust_box_pos(int curs_x, int curs_y, int orig_x, int orig_y, int *ret_x, int *ret_y);
112 extern void	adjust_pos(int curs_x, int curs_y, int orig_x, int orig_y, int *ret_x, int *ret_y);
113 
114 #endif /* U_ELASTIC_H */
115