File: g_relative.c

package info (click to toggle)
plotutils 2.4.1-15
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 11,072 kB
  • ctags: 6,952
  • sloc: ansic: 76,305; cpp: 12,402; sh: 8,475; yacc: 2,604; makefile: 894; lex: 144
file content (199 lines) | stat: -rw-r--r-- 5,494 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/* This file contains the libplot methods that take floating-point relative
   coordinates as arguments. */

#include "sys-defines.h"
#include "extern.h"

int
#ifdef _HAVE_PROTOS
_API_farcrel (R___(Plotter *_plotter) double dxc, double dyc, double dx0, double dy0, double dx1, double dy1)
#else
_API_farcrel (R___(_plotter) dxc, dyc, dx0, dy0, dx1, dy1)
     S___(Plotter *_plotter;)
     double dxc, dyc, dx0, dy0, dx1, dy1;
#endif
{
  return _API_farc (R___(_plotter) 
		    _plotter->drawstate->pos.x + dxc, 
		    _plotter->drawstate->pos.y + dyc,
		    _plotter->drawstate->pos.x + dx0, 
		    _plotter->drawstate->pos.y + dy0,
		    _plotter->drawstate->pos.x + dx1, 
		    _plotter->drawstate->pos.y + dy1);
}

int
#ifdef _HAVE_PROTOS
_API_fbezier2rel (R___(Plotter *_plotter) double dxc, double dyc, double dx0, double dy0, double dx1, double dy1)
#else
_API_fbezier2rel (R___(_plotter) dxc, dyc, dx0, dy0, dx1, dy1)
     S___(Plotter *_plotter;)
     double dxc, dyc, dx0, dy0, dx1, dy1;
#endif
{
  return _API_fbezier2 (R___(_plotter) 
			_plotter->drawstate->pos.x + dxc, 
			_plotter->drawstate->pos.y + dyc,
			_plotter->drawstate->pos.x + dx0, 
			_plotter->drawstate->pos.y + dy0,
			_plotter->drawstate->pos.x + dx1, 
			_plotter->drawstate->pos.y + dy1);
}

int
#ifdef _HAVE_PROTOS
_API_fbezier3rel (R___(Plotter *_plotter) double dx0, double dy0, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3)
#else
_API_fbezier3rel (R___(_plotter) dx0, dy0, dx1, dy1, dx2, dy2, dx3, dy3)
     S___(Plotter *_plotter;)
     double dx0, dy0, dx1, dy1, dx2, dy2, dx3, dy3;
#endif
{
  return _API_fbezier3 (R___(_plotter) 
			_plotter->drawstate->pos.x + dx0, 
			_plotter->drawstate->pos.y + dy0,
			_plotter->drawstate->pos.x + dx1, 
			_plotter->drawstate->pos.y + dy1,
			_plotter->drawstate->pos.x + dx2,
			_plotter->drawstate->pos.y + dy2,
			_plotter->drawstate->pos.x + dx3, 
			_plotter->drawstate->pos.y + dy3);
}

int
#ifdef _HAVE_PROTOS
_API_fellarcrel (R___(Plotter *_plotter) double dxc, double dyc, double dx0, double dy0, double dx1, double dy1)
#else
_API_fellarcrel (R___(_plotter) dxc, dyc, dx0, dy0, dx1, dy1)
     S___(Plotter *_plotter;)
     double dxc, dyc, dx0, dy0, dx1, dy1;
#endif
{
  return _API_fellarc (R___(_plotter) 
		       _plotter->drawstate->pos.x + dxc, 
		       _plotter->drawstate->pos.y + dyc,
		       _plotter->drawstate->pos.x + dx0, 
		       _plotter->drawstate->pos.y + dy0,
		       _plotter->drawstate->pos.x + dx1, 
		       _plotter->drawstate->pos.y + dy1);
}

int
#ifdef _HAVE_PROTOS
_API_fboxrel (R___(Plotter *_plotter) double dx0, double dy0, double dx1, double dy1)
#else
_API_fboxrel (R___(_plotter) dx0, dy0, dx1, dy1)
     S___(Plotter *_plotter;)
     double dx0, dy0, dx1, dy1;
#endif
{
  return _API_fbox (R___(_plotter) 
		    _plotter->drawstate->pos.x + dx0, 
		    _plotter->drawstate->pos.y + dy0,
		    _plotter->drawstate->pos.x + dx1, 
		    _plotter->drawstate->pos.y + dy1);
}

int
#ifdef _HAVE_PROTOS
_API_fcirclerel (R___(Plotter *_plotter) double dx, double dy, double r)
#else
_API_fcirclerel (R___(_plotter) dx, dy, r)
     S___(Plotter *_plotter;)
     double dx, dy, r;
#endif
{
  return _API_fcircle (R___(_plotter) 
		       _plotter->drawstate->pos.x + dx, 
		       _plotter->drawstate->pos.y + dy, r);
}

int
#ifdef _HAVE_PROTOS
_API_fellipserel (R___(Plotter *_plotter) double dx, double dy, double rx, double ry, double angle)
#else
_API_fellipserel (R___(_plotter) dx, dy, rx, ry, angle)
     S___(Plotter *_plotter;)
     double dx, dy, rx, ry, angle;
#endif
{
  return _API_fellipse (R___(_plotter) 
			_plotter->drawstate->pos.x + dx, 
			_plotter->drawstate->pos.y + dy, 
			rx, ry, angle);
}

int
#ifdef _HAVE_PROTOS
_API_fcontrel (R___(Plotter *_plotter) double dx, double dy)
#else
_API_fcontrel (R___(_plotter) dx, dy)
     S___(Plotter *_plotter;)
     double dx, dy;
#endif
{
  return _API_fcont (R___(_plotter) 
		     _plotter->drawstate->pos.x + dx, 
		     _plotter->drawstate->pos.y + dy);
}

int
#ifdef _HAVE_PROTOS
_API_flinerel (R___(Plotter *_plotter) double dx0, double dy0, double dx1, double dy1)
#else
_API_flinerel (R___(_plotter) dx0, dy0, dx1, dy1)
     S___(Plotter *_plotter;)
     double dx0, dy0, dx1, dy1;
#endif
{
  return _API_fline (R___(_plotter) 
		     _plotter->drawstate->pos.x + dx0, 
		     _plotter->drawstate->pos.y + dy0,
		     _plotter->drawstate->pos.x + dx1, 
		     _plotter->drawstate->pos.y + dy1);
}

int
#ifdef _HAVE_PROTOS
_API_fmarkerrel (R___(Plotter *_plotter) double dx, double dy, int type, double size)
#else
_API_fmarkerrel (R___(_plotter) dx, dy, type, size)
     S___(Plotter *_plotter;)
     double dx, dy;
     int type;
     double size;
#endif
{
  return _API_fmarker (R___(_plotter) 
		       _plotter->drawstate->pos.x + dx, 
		       _plotter->drawstate->pos.y + dy, 
		       type, size);
}

int
#ifdef _HAVE_PROTOS
_API_fmoverel (R___(Plotter *_plotter) double x, double y)
#else
_API_fmoverel (R___(_plotter) x, y)
     S___(Plotter *_plotter;)
     double x, y;
#endif
{
  return _API_fmove (R___(_plotter) 
		     _plotter->drawstate->pos.x + x, 
		     _plotter->drawstate->pos.y + y);
}

int
#ifdef _HAVE_PROTOS
_API_fpointrel (R___(Plotter *_plotter) double dx, double dy)
#else
_API_fpointrel (R___(_plotter) dx, dy)
     S___(Plotter *_plotter;)
     double dx, dy;
#endif
{
  return _API_fpoint (R___(_plotter) 
		      _plotter->drawstate->pos.x + dx, 
		      _plotter->drawstate->pos.y + dy);
}