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 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483
|
/* This file contains the versions of the Plotter methods that (i) take as
arguments, and/or (ii) return integers rather than doubles. */
#include "sys-defines.h"
#include "extern.h"
int
#ifdef _HAVE_PROTOS
_API_arc (R___(Plotter *_plotter) int xc, int yc, int x0, int y0, int x1, int y1)
#else
_API_arc (R___(_plotter) xc, yc, x0, y0, x1, y1)
S___(Plotter *_plotter;)
int xc, yc, x0, y0, x1, y1;
#endif
{
return _API_farc (R___(_plotter)
(double)xc, (double)yc,
(double)x0, (double)y0,
(double)x1, (double)y1);
}
int
#ifdef _HAVE_PROTOS
_API_arcrel (R___(Plotter *_plotter) int dxc, int dyc, int dx0, int dy0, int dx1, int dy1)
#else
_API_arcrel (R___(_plotter) dxc, dyc, dx0, dy0, dx1, dy1)
S___(Plotter *_plotter;)
int dxc, dyc, dx0, dy0, dx1, dy1;
#endif
{
return _API_farcrel (R___(_plotter)
(double)dxc, (double)dyc,
(double)dx0, (double)dy0,
(double)dx1, (double)dy1);
}
int
#ifdef _HAVE_PROTOS
_API_bezier2 (R___(Plotter *_plotter) int xc, int yc, int x0, int y0, int x1, int y1)
#else
_API_bezier2 (R___(_plotter) xc, yc, x0, y0, x1, y1)
S___(Plotter *_plotter;)
int xc, yc, x0, y0, x1, y1;
#endif
{
return _API_fbezier2 (R___(_plotter)
(double)xc, (double)yc,
(double)x0, (double)y0,
(double)x1, (double)y1);
}
int
#ifdef _HAVE_PROTOS
_API_bezier2rel (R___(Plotter *_plotter) int dxc, int dyc, int dx0, int dy0, int dx1, int dy1)
#else
_API_bezier2rel (R___(_plotter) dxc, dyc, dx0, dy0, dx1, dy1)
S___(Plotter *_plotter;)
int dxc, dyc, dx0, dy0, dx1, dy1;
#endif
{
return _API_fbezier2rel (R___(_plotter)
(double)dxc, (double)dyc,
(double)dx0, (double)dy0,
(double)dx1, (double)dy1);
}
int
#ifdef _HAVE_PROTOS
_API_bezier3 (R___(Plotter *_plotter) int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3)
#else
_API_bezier3 (R___(_plotter) x0, y0, x1, y1, x2, y2, x3, y3)
S___(Plotter *_plotter;)
int x0, y0, x1, y1, x2, y2, x3, y3;
#endif
{
return _API_fbezier3 (R___(_plotter)
(double)x0, (double)y0,
(double)x1, (double)y1,
(double)x2, (double)y2,
(double)x3, (double)y3);
}
int
#ifdef _HAVE_PROTOS
_API_bezier3rel (R___(Plotter *_plotter) int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3)
#else
_API_bezier3rel (R___(_plotter) x0, y0, x1, y1, x2, y2, x3, y3)
S___(Plotter *_plotter;)
int x0, y0, x1, y1, x2, y2, x3, y3;
#endif
{
return _API_fbezier3rel (R___(_plotter)
(double)x0, (double)y0,
(double)x1, (double)y1,
(double)x2, (double)y2,
(double)x3, (double)y3);
}
int
#ifdef _HAVE_PROTOS
_API_box (R___(Plotter *_plotter) int x0, int y0, int x1, int y1)
#else
_API_box (R___(_plotter) x0, y0, x1, y1)
S___(Plotter *_plotter;)
int x0, y0, x1, y1;
#endif
{
return _API_fbox (R___(_plotter)
(double)x0, (double)y0, (double)x1, (double)y1);
}
int
#ifdef _HAVE_PROTOS
_API_boxrel (R___(Plotter *_plotter) int dx0, int dy0, int dx1, int dy1)
#else
_API_boxrel (R___(_plotter) dx0, dy0, dx1, dy1)
S___(Plotter *_plotter;)
int dx0, dy0, dx1, dy1;
#endif
{
return _API_fboxrel (R___(_plotter)
(double)dx0, (double)dy0,
(double)dx1, (double)dy1);
}
int
#ifdef _HAVE_PROTOS
_API_circle (R___(Plotter *_plotter) int x, int y, int r)
#else
_API_circle (R___(_plotter) x, y, r)
S___(Plotter *_plotter;)
int x, y, r;
#endif
{
return _API_fcircle (R___(_plotter)
(double)x, (double)y, (double)r);
}
int
#ifdef _HAVE_PROTOS
_API_circlerel (R___(Plotter *_plotter) int dx, int dy, int r)
#else
_API_circlerel (R___(_plotter) dx, dy, r)
S___(Plotter *_plotter;)
int dx, dy, r;
#endif
{
return _API_fcirclerel (R___(_plotter)
(double)dx, (double)dy, (double)r);
}
int
#ifdef _HAVE_PROTOS
_API_cont (R___(Plotter *_plotter) int x, int y)
#else
_API_cont (R___(_plotter) x, y)
S___(Plotter *_plotter;)
int x, y;
#endif
{
return _API_fcont (R___(_plotter)
(double)x, (double)y);
}
int
#ifdef _HAVE_PROTOS
_API_contrel (R___(Plotter *_plotter) int dx, int dy)
#else
_API_contrel (R___(_plotter) dx, dy)
S___(Plotter *_plotter;)
int dx, dy;
#endif
{
return _API_fcontrel (R___(_plotter)
(double)dx, (double)dy);
}
int
#ifdef _HAVE_PROTOS
_API_ellarc (R___(Plotter *_plotter) int xc, int yc, int x0, int y0, int x1, int y1)
#else
_API_ellarc (R___(_plotter) xc, yc, x0, y0, x1, y1)
S___(Plotter *_plotter;)
int xc, yc, x0, y0, x1, y1;
#endif
{
return _API_fellarc (R___(_plotter)
(double)xc, (double)yc,
(double)x0, (double)y0,
(double)x1, (double)y1);
}
int
#ifdef _HAVE_PROTOS
_API_ellarcrel (R___(Plotter *_plotter) int dxc, int dyc, int dx0, int dy0, int dx1, int dy1)
#else
_API_ellarcrel (R___(_plotter) dxc, dyc, dx0, dy0, dx1, dy1)
S___(Plotter *_plotter;)
int dxc, dyc, dx0, dy0, dx1, dy1;
#endif
{
return _API_fellarcrel (R___(_plotter)
(double)dxc, (double)dyc,
(double)dx0, (double)dy0,
(double)dx1, (double)dy1);
}
int
#ifdef _HAVE_PROTOS
_API_ellipse (R___(Plotter *_plotter) int x, int y, int rx, int ry, int angle)
#else
_API_ellipse (R___(_plotter) x, y, rx, ry, angle)
S___(Plotter *_plotter;)
int x, y, rx, ry, angle;
#endif
{
return _API_fellipse (R___(_plotter)
(double)x, (double)y,
(double)rx, (double)ry, (double)angle);
}
int
#ifdef _HAVE_PROTOS
_API_ellipserel (R___(Plotter *_plotter) int dx, int dy, int rx, int ry, int angle)
#else
_API_ellipserel (R___(_plotter) dx, dy, rx, ry, angle)
S___(Plotter *_plotter;)
int dx, dy, rx, ry, angle;
#endif
{
return _API_fellipserel (R___(_plotter)
(double)dx, (double)dy,
(double)rx, (double)ry,
(double)angle);
}
int
#ifdef _HAVE_PROTOS
_API_fontname (R___(Plotter *_plotter) const char *s)
#else
_API_fontname (R___(_plotter) s)
S___(Plotter *_plotter;)
const char *s;
#endif
{
double new_size = _API_ffontname (R___(_plotter) s);
return IROUND(new_size);
}
int
#ifdef _HAVE_PROTOS
_API_fontsize (R___(Plotter *_plotter) int size)
#else
_API_fontsize (R___(_plotter) size)
S___(Plotter *_plotter;)
int size;
#endif
{
double new_size = _API_ffontsize (R___(_plotter) (double)size);
return IROUND(new_size);
}
int
#ifdef _HAVE_PROTOS
_API_line (R___(Plotter *_plotter) int x0, int y0, int x1, int y1)
#else
_API_line (R___(_plotter) x0, y0, x1, y1)
S___(Plotter *_plotter;)
int x0, y0, x1, y1;
#endif
{
return _API_fline (R___(_plotter)
(double)x0, (double)y0,
(double)x1, (double)y1);
}
int
#ifdef _HAVE_PROTOS
_API_linedash (R___(Plotter *_plotter) int n, const int *dashes, int offset)
#else
_API_linedash (R___(_plotter) n, dashes, offset)
S___(Plotter *_plotter;)
int n;
const int *dashes;
int offset;
#endif
{
double *idashes;
int i, retval;
if (!_plotter->data->open)
{
_plotter->error (R___(_plotter)
"linedash: invalid operation");
return -1;
}
/* sanity checks */
if (n < 0 || (n > 0 && dashes == NULL))
return -1;
for (i = 0; i < n; i++)
if (dashes[i] < 0)
return -1;
idashes = (double *)_plot_xmalloc ((unsigned int)n * sizeof(double));
for (i = 0; i < n; i++)
idashes[i] = dashes[i];
retval = _API_flinedash (R___(_plotter)
n, idashes, (double)offset);
free (idashes);
return retval;
}
int
#ifdef _HAVE_PROTOS
_API_linerel (R___(Plotter *_plotter) int dx0, int dy0, int dx1, int dy1)
#else
_API_linerel (R___(_plotter) dx0, dy0, dx1, dy1)
S___(Plotter *_plotter;)
int dx0, dy0, dx1, dy1;
#endif
{
return _API_flinerel (R___(_plotter)
(double)dx0, (double)dy0,
(double)dx1, (double)dy1);
}
int
#ifdef _HAVE_PROTOS
_API_labelwidth (R___(Plotter *_plotter) const char *s)
#else
_API_labelwidth (R___(_plotter) s)
S___(Plotter *_plotter;)
const char *s;
#endif
{
double width = _API_flabelwidth (R___(_plotter) s);
return IROUND(width);
}
int
#ifdef _HAVE_PROTOS
_API_linewidth (R___(Plotter *_plotter) int new_line_width)
#else
_API_linewidth (R___(_plotter) new_line_width)
S___(Plotter *_plotter;)
int new_line_width;
#endif
{
return _API_flinewidth (R___(_plotter) (double)new_line_width);
}
int
#ifdef _HAVE_PROTOS
_API_marker (R___(Plotter *_plotter) int x, int y, int type, int size)
#else
_API_marker (R___(_plotter) x, y, type, size)
S___(Plotter *_plotter;)
int x, y;
int type;
int size;
#endif
{
return _API_fmarker (R___(_plotter)
(double)x, (double)y,
type, (double)size);
}
int
#ifdef _HAVE_PROTOS
_API_markerrel (R___(Plotter *_plotter) int dx, int dy, int type, int size)
#else
_API_markerrel (R___(_plotter) dx, dy, type, size)
S___(Plotter *_plotter;)
int dx, dy;
int type;
int size;
#endif
{
return _API_fmarkerrel (R___(_plotter)
(double)dx, (double)dy,
type, (double)size);
}
int
#ifdef _HAVE_PROTOS
_API_move (R___(Plotter *_plotter) int x, int y)
#else
_API_move (R___(_plotter) x, y)
S___(Plotter *_plotter;)
int x,y;
#endif
{
return _API_fmove (R___(_plotter)
(double)x, (double)y);
}
int
#ifdef _HAVE_PROTOS
_API_moverel (R___(Plotter *_plotter) int x, int y)
#else
_API_moverel (R___(_plotter) x, y)
S___(Plotter *_plotter;)
int x, y;
#endif
{
return _API_fmoverel (R___(_plotter)
(double)x, (double)y);
}
int
#ifdef _HAVE_PROTOS
_API_point (R___(Plotter *_plotter) int x, int y)
#else
_API_point (R___(_plotter) x, y)
S___(Plotter *_plotter;)
int x, y;
#endif
{
return _API_fpoint (R___(_plotter)
(double)x, (double)y);
}
int
#ifdef _HAVE_PROTOS
_API_pointrel (R___(Plotter *_plotter) int dx, int dy)
#else
_API_pointrel (R___(_plotter) dx, dy)
S___(Plotter *_plotter;)
int dx, dy;
#endif
{
return _API_fpointrel (R___(_plotter)
(double)dx, (double)dy);
}
int
#ifdef _HAVE_PROTOS
_API_space (R___(Plotter *_plotter) int x0, int y0, int x1, int y1)
#else
_API_space (R___(_plotter) x0, y0, x1, y1)
S___(Plotter *_plotter;)
int x0, y0, x1, y1;
#endif
{
return _API_fspace (R___(_plotter)
(double)x0, (double)y0,
(double)x1, (double)y1);
}
int
#ifdef _HAVE_PROTOS
_API_space2 (R___(Plotter *_plotter) int x0, int y0, int x1, int y1, int x2, int y2)
#else
_API_space2 (R___(_plotter) x0, y0, x1, y1, x2, y2)
S___(Plotter *_plotter;)
int x0, y0, x1, y1, x2, y2;
#endif
{
return _API_fspace2 (R___(_plotter)
(double)x0, (double)y0,
(double)x1, (double)y1,
(double)x2, (double)y2);
}
int
#ifdef _HAVE_PROTOS
_API_textangle (R___(Plotter *_plotter) int angle)
#else
_API_textangle (R___(_plotter) angle)
S___(Plotter *_plotter;)
int angle;
#endif
{
double new_size = _API_ftextangle (R___(_plotter)
(double)angle);
return IROUND(new_size);
}
|