Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 1 | /* |
| 2 | Input used to generate the Python module "glmodule.c". |
| 3 | The stub generator is a Python script called "cgen". |
| 4 | |
| 5 | Each definition must be contained on one line: |
| 6 | |
| 7 | <returntype> <name> <type> <arg> <type> <arg> |
| 8 | |
| 9 | <returntype> can be: void, short, long (XXX maybe others?) |
| 10 | |
| 11 | <type> can be: char, string, short, float, long, or double |
| 12 | string indicates a null terminated string; |
| 13 | if <type> is char and <arg> begins with a *, the * is stripped |
| 14 | and <type> is changed into string |
| 15 | |
| 16 | <arg> has the form <mode> or <mode>[<subscript>] |
| 17 | where <mode> can be |
| 18 | s: arg is sent |
| 19 | r: arg is received (arg is a pointer) |
| 20 | and <subscript> can be (N and I are numbers): |
| 21 | N |
| 22 | argI |
| 23 | retval |
| 24 | N*argI |
| 25 | N*retval |
| 26 | */ |
| 27 | |
| 28 | #include <stdio.h> |
| 29 | #include <gl.h> |
| 30 | #include <device.h> |
| 31 | #include "PROTO.h" |
| 32 | #include "object.h" |
| 33 | #include "intobject.h" |
| 34 | #include "floatobject.h" |
| 35 | #include "listobject.h" |
| 36 | #include "tupleobject.h" |
| 37 | #include "dictobject.h" |
| 38 | #include "methodobject.h" |
| 39 | #include "moduleobject.h" |
| 40 | #include "objimpl.h" |
| 41 | #include "import.h" |
| 42 | #include "sigtype.h" |
| 43 | #include "modsupport.h" |
| 44 | #include "cgensupport.h" |
| 45 | #include "errors.h" |
| 46 | |
| 47 | /* |
| 48 | Some stubs are too complicated for the stub generator. |
| 49 | We can include manually written versions of them here. |
| 50 | A line starting with '%' gives the name of the function so the stub |
| 51 | generator can include it in the table of functions. |
| 52 | */ |
| 53 | |
| 54 | /* |
| 55 | varray -- an array of v.. calls. |
| 56 | The argument is an array (maybe list or tuple) of points. |
| 57 | Each point must be a tuple or list of coordinates (x, y, z). |
| 58 | The points may be 2- or 3-dimensional but must all have the |
| 59 | same dimension. Float and int values may be mixed however. |
| 60 | The points are always converted to 3D double precision points |
| 61 | by assuming z=0.0 if necessary (as indicated in the man page), |
| 62 | and for each point v3d() is called. |
| 63 | */ |
| 64 | |
| 65 | % varray |
| 66 | |
| 67 | static object * |
| 68 | gl_varray(self, args) |
| 69 | object *self; |
| 70 | object *args; |
| 71 | { |
| 72 | object *v, *w; |
| 73 | int i, n, width; |
| 74 | double vec[3]; |
| 75 | object * (*getitem) FPROTO((object *, int)); |
| 76 | |
| 77 | if (!getiobjectarg(args, 1, 0, &v)) |
| 78 | return NULL; |
| 79 | |
| 80 | if (is_listobject(v)) { |
| 81 | n = getlistsize(v); |
| 82 | getitem = getlistitem; |
| 83 | } |
| 84 | else if (is_tupleobject(v)) { |
| 85 | n = gettuplesize(v); |
| 86 | getitem = gettupleitem; |
| 87 | } |
| 88 | else { |
| 89 | err_badarg(); |
| 90 | return NULL; |
| 91 | } |
| 92 | |
| 93 | if (n == 0) { |
| 94 | INCREF(None); |
| 95 | return None; |
| 96 | } |
| 97 | if (n > 0) |
| 98 | w = (*getitem)(v, 0); |
| 99 | |
| 100 | width = 0; |
| 101 | if (w == NULL) { |
| 102 | } |
| 103 | else if (is_listobject(w)) { |
| 104 | width = getlistsize(w); |
| 105 | } |
| 106 | else if (is_tupleobject(w)) { |
| 107 | width = gettuplesize(w); |
| 108 | } |
| 109 | |
| 110 | switch (width) { |
| 111 | case 2: |
| 112 | vec[2] = 0.0; |
| 113 | /* Fall through */ |
| 114 | case 3: |
| 115 | break; |
| 116 | default: |
| 117 | err_badarg(); |
| 118 | return NULL; |
| 119 | } |
| 120 | |
| 121 | for (i = 0; i < n; i++) { |
| 122 | w = (*getitem)(v, i); |
| 123 | if (!getidoublearray(w, 1, 0, width, vec)) |
| 124 | return NULL; |
| 125 | v3d(vec); |
| 126 | } |
| 127 | |
| 128 | INCREF(None); |
| 129 | return None; |
| 130 | } |
| 131 | |
| 132 | /* |
| 133 | vnarray, nvarray -- an array of n3f and v3f calls. |
| 134 | The argument is an array (list or tuple) of pairs of points and normals. |
| 135 | Each pair is a tuple (NOT a list) of a point and a normal for that point. |
| 136 | Each point or normal must be a tuple (NOT a list) of coordinates (x, y, z). |
| 137 | Three coordinates must be given. Float and int values may be mixed. |
| 138 | For each pair, n3f() is called for the normal, and then v3f() is called |
| 139 | for the vector. |
| 140 | |
| 141 | vnarray and nvarray differ only in the order of the vector and normal in |
| 142 | the pair: vnarray expects (v, n) while nvarray expects (n, v). |
| 143 | */ |
| 144 | |
| 145 | static object *gen_nvarray(); /* Forward */ |
| 146 | |
| 147 | % nvarray |
| 148 | |
| 149 | static object * |
| 150 | gl_nvarray(self, args) |
| 151 | object *self; |
| 152 | object *args; |
| 153 | { |
| 154 | return gen_nvarray(args, 0); |
| 155 | } |
| 156 | |
| 157 | % vnarray |
| 158 | |
| 159 | static object * |
| 160 | gl_vnarray(self, args) |
| 161 | object *self; |
| 162 | object *args; |
| 163 | { |
| 164 | return gen_nvarray(args, 1); |
| 165 | } |
| 166 | |
| 167 | /* Generic, internal version of {nv,nv}array: inorm indicates the |
| 168 | argument order, 0: normal first, 1: vector first. */ |
| 169 | |
| 170 | static object * |
| 171 | gen_nvarray(args, inorm) |
| 172 | object *args; |
| 173 | int inorm; |
| 174 | { |
| 175 | object *v, *w, *wnorm, *wvec; |
| 176 | int i, n; |
| 177 | float norm[3], vec[3]; |
| 178 | object * (*getitem) FPROTO((object *, int)); |
| 179 | |
| 180 | if (!getiobjectarg(args, 1, 0, &v)) |
| 181 | return NULL; |
| 182 | |
| 183 | if (is_listobject(v)) { |
| 184 | n = getlistsize(v); |
| 185 | getitem = getlistitem; |
| 186 | } |
| 187 | else if (is_tupleobject(v)) { |
| 188 | n = gettuplesize(v); |
| 189 | getitem = gettupleitem; |
| 190 | } |
| 191 | else { |
| 192 | err_badarg(); |
| 193 | return NULL; |
| 194 | } |
| 195 | |
| 196 | for (i = 0; i < n; i++) { |
| 197 | w = (*getitem)(v, i); |
| 198 | if (!is_tupleobject(w) || gettuplesize(w) != 2) { |
| 199 | err_badarg(); |
| 200 | return NULL; |
| 201 | } |
| 202 | wnorm = gettupleitem(w, inorm); |
| 203 | wvec = gettupleitem(w, 1 - inorm); |
| 204 | if (!getifloatarray(wnorm, 1, 0, 3, norm) || |
| 205 | !getifloatarray(wvec, 1, 0, 3, vec)) |
| 206 | return NULL; |
| 207 | n3f(norm); |
| 208 | v3f(vec); |
| 209 | } |
| 210 | |
| 211 | INCREF(None); |
| 212 | return None; |
| 213 | } |
| 214 | |
| 215 | /* nurbssurface(s_knots[], t_knots[], ctl[][], s_order, t_order, type). |
| 216 | The dimensions of ctl[] are computed as follows: |
| 217 | [len(s_knots) - s_order], [len(t_knots) - t_order] |
| 218 | */ |
| 219 | |
| 220 | % nurbssurface |
| 221 | |
| 222 | static object * |
| 223 | gl_nurbssurface(self, args) |
| 224 | object *self; |
| 225 | object *args; |
| 226 | { |
| 227 | long arg1 ; |
| 228 | double * arg2 ; |
| 229 | long arg3 ; |
| 230 | double * arg4 ; |
| 231 | double *arg5 ; |
| 232 | long arg6 ; |
| 233 | long arg7 ; |
| 234 | long arg8 ; |
| 235 | long ncoords; |
| 236 | long s_byte_stride, t_byte_stride; |
| 237 | long s_nctl, t_nctl; |
| 238 | long s, t; |
| 239 | object *v, *w, *pt; |
| 240 | double *pnext; |
| 241 | if (!getilongarraysize(args, 6, 0, &arg1)) |
| 242 | return NULL; |
| 243 | if ((arg2 = NEW(double, arg1 )) == NULL) { |
| 244 | return err_nomem(); |
| 245 | } |
| 246 | if (!getidoublearray(args, 6, 0, arg1 , arg2)) |
| 247 | return NULL; |
| 248 | if (!getilongarraysize(args, 6, 1, &arg3)) |
| 249 | return NULL; |
| 250 | if ((arg4 = NEW(double, arg3 )) == NULL) { |
| 251 | return err_nomem(); |
| 252 | } |
| 253 | if (!getidoublearray(args, 6, 1, arg3 , arg4)) |
| 254 | return NULL; |
| 255 | if (!getilongarg(args, 6, 3, &arg6)) |
| 256 | return NULL; |
| 257 | if (!getilongarg(args, 6, 4, &arg7)) |
| 258 | return NULL; |
| 259 | if (!getilongarg(args, 6, 5, &arg8)) |
| 260 | return NULL; |
| 261 | if (arg8 == N_XYZ) |
| 262 | ncoords = 3; |
| 263 | else if (arg8 == N_XYZW) |
| 264 | ncoords = 4; |
| 265 | else { |
| 266 | err_badarg(); |
| 267 | return NULL; |
| 268 | } |
| 269 | s_nctl = arg1 - arg6; |
| 270 | t_nctl = arg3 - arg7; |
| 271 | if (!getiobjectarg(args, 6, 2, &v)) |
| 272 | return NULL; |
| 273 | if (!is_listobject(v) || getlistsize(v) != s_nctl) { |
| 274 | err_badarg(); |
| 275 | return NULL; |
| 276 | } |
| 277 | if ((arg5 = NEW(double, s_nctl*t_nctl*ncoords )) == NULL) { |
| 278 | return err_nomem(); |
| 279 | } |
| 280 | pnext = arg5; |
| 281 | for (s = 0; s < s_nctl; s++) { |
| 282 | w = getlistitem(v, s); |
| 283 | if (w == NULL || !is_listobject(w) || |
| 284 | getlistsize(w) != t_nctl) { |
| 285 | err_badarg(); |
| 286 | return NULL; |
| 287 | } |
| 288 | for (t = 0; t < t_nctl; t++) { |
| 289 | pt = getlistitem(w, t); |
| 290 | if (!getidoublearray(pt, 1, 0, ncoords, pnext)) |
| 291 | return NULL; |
| 292 | pnext += ncoords; |
| 293 | } |
| 294 | } |
| 295 | s_byte_stride = sizeof(double) * ncoords; |
| 296 | t_byte_stride = s_byte_stride * s_nctl; |
| 297 | nurbssurface( arg1 , arg2 , arg3 , arg4 , |
| 298 | s_byte_stride , t_byte_stride , arg5 , arg6 , arg7 , arg8 ); |
| 299 | DEL(arg2); |
| 300 | DEL(arg4); |
| 301 | DEL(arg5); |
| 302 | INCREF(None); |
| 303 | return None; |
| 304 | } |
| 305 | |
| 306 | /* nurbscurve(knots, ctlpoints, order, type). |
| 307 | The length of ctlpoints is len(knots)-order. */ |
| 308 | |
| 309 | %nurbscurve |
| 310 | |
| 311 | static object * |
| 312 | gl_nurbscurve(self, args) |
| 313 | object *self; |
| 314 | object *args; |
| 315 | { |
| 316 | long arg1 ; |
| 317 | double * arg2 ; |
| 318 | long arg3 ; |
| 319 | double * arg4 ; |
| 320 | long arg5 ; |
| 321 | long arg6 ; |
| 322 | int ncoords, npoints; |
| 323 | int i; |
| 324 | object *v; |
| 325 | double *pnext; |
| 326 | if (!getilongarraysize(args, 4, 0, &arg1)) |
| 327 | return NULL; |
| 328 | if ((arg2 = NEW(double, arg1 )) == NULL) { |
| 329 | return err_nomem(); |
| 330 | } |
| 331 | if (!getidoublearray(args, 4, 0, arg1 , arg2)) |
| 332 | return NULL; |
| 333 | if (!getilongarg(args, 4, 2, &arg5)) |
| 334 | return NULL; |
| 335 | if (!getilongarg(args, 4, 3, &arg6)) |
| 336 | return NULL; |
| 337 | if (arg6 == N_ST) |
| 338 | ncoords = 2; |
| 339 | else if (arg6 == N_STW) |
| 340 | ncoords = 3; |
| 341 | else { |
| 342 | err_badarg(); |
| 343 | return NULL; |
| 344 | } |
| 345 | npoints = arg1 - arg5; |
| 346 | if (!getiobjectarg(args, 4, 1, &v)) |
| 347 | return NULL; |
| 348 | if (!is_listobject(v) || getlistsize(v) != npoints) { |
| 349 | err_badarg(); |
| 350 | return NULL; |
| 351 | } |
| 352 | if ((arg4 = NEW(double, npoints*ncoords )) == NULL) { |
| 353 | return err_nomem(); |
| 354 | } |
| 355 | pnext = arg4; |
| 356 | for (i = 0; i < npoints; i++) { |
| 357 | if (!getidoublearray(getlistitem(v, i), 1, 0, ncoords, pnext)) |
| 358 | return NULL; |
| 359 | pnext += ncoords; |
| 360 | } |
| 361 | arg3 = (sizeof(double)) * ncoords; |
| 362 | nurbscurve( arg1 , arg2 , arg3 , arg4 , arg5 , arg6 ); |
| 363 | DEL(arg2); |
| 364 | DEL(arg4); |
| 365 | INCREF(None); |
| 366 | return None; |
| 367 | } |
| 368 | |
| 369 | /* pwlcurve(points, type). |
| 370 | Points is a list of points. Type must be N_ST. */ |
| 371 | |
| 372 | %pwlcurve |
| 373 | |
| 374 | static object * |
| 375 | gl_pwlcurve(self, args) |
| 376 | object *self; |
| 377 | object *args; |
| 378 | { |
| 379 | object *v; |
| 380 | long type; |
| 381 | double *data, *pnext; |
| 382 | long npoints, ncoords; |
| 383 | int i; |
| 384 | if (!getiobjectarg(args, 2, 0, &v)) |
| 385 | return NULL; |
| 386 | if (!getilongarg(args, 2, 1, &type)) |
| 387 | return NULL; |
| 388 | if (!is_listobject(v)) { |
| 389 | err_badarg(); |
| 390 | return NULL; |
| 391 | } |
| 392 | npoints = getlistsize(v); |
| 393 | if (type == N_ST) |
| 394 | ncoords = 2; |
| 395 | else { |
| 396 | err_badarg(); |
| 397 | return NULL; |
| 398 | } |
| 399 | if ((data = NEW(double, npoints*ncoords)) == NULL) { |
| 400 | return err_nomem(); |
| 401 | } |
| 402 | pnext = data; |
| 403 | for (i = 0; i < npoints; i++) { |
| 404 | if (!getidoublearray(getlistitem(v, i), 1, 0, ncoords, pnext)) |
| 405 | return NULL; |
| 406 | pnext += ncoords; |
| 407 | } |
| 408 | pwlcurve(npoints, data, sizeof(double)*ncoords, type); |
| 409 | DEL(data); |
| 410 | INCREF(None); |
| 411 | return None; |
| 412 | } |
| 413 | |
| 414 | |
| 415 | /* Picking and Selecting */ |
| 416 | |
| 417 | static short *pickbuffer = NULL; |
| 418 | static long pickbuffersize; |
| 419 | |
| 420 | static object * |
| 421 | pick_select(args, func) |
| 422 | object *args; |
| 423 | void (*func)(); |
| 424 | { |
| 425 | if (!getilongarg(args, 1, 0, &pickbuffersize)) |
| 426 | return NULL; |
| 427 | if (pickbuffer != NULL) { |
| 428 | err_setstr(RuntimeError, |
| 429 | "pick/gselect: already picking/selecting"); |
| 430 | return NULL; |
| 431 | } |
| 432 | if ((pickbuffer = NEW(short, pickbuffersize)) == NULL) { |
| 433 | return err_nomem(); |
| 434 | } |
| 435 | (*func)(pickbuffer, pickbuffersize); |
| 436 | INCREF(None); |
| 437 | return None; |
| 438 | } |
| 439 | |
| 440 | static object * |
| 441 | endpick_select(args, func) |
| 442 | object *args; |
| 443 | long (*func)(); |
| 444 | { |
| 445 | object *v, *w; |
| 446 | int i, nhits, n; |
| 447 | if (!getnoarg(args)) |
| 448 | return NULL; |
| 449 | if (pickbuffer == NULL) { |
| 450 | err_setstr(RuntimeError, |
| 451 | "endpick/endselect: not in pick/select mode"); |
| 452 | return NULL; |
| 453 | } |
| 454 | nhits = (*func)(pickbuffer); |
| 455 | if (nhits < 0) { |
| 456 | nhits = -nhits; /* How to report buffer overflow otherwise? */ |
| 457 | } |
| 458 | /* Scan the buffer to see how many integers */ |
| 459 | n = 0; |
| 460 | for (; nhits > 0; nhits--) { |
| 461 | n += 1 + pickbuffer[n]; |
| 462 | } |
| 463 | v = newlistobject(n); |
| 464 | if (v == NULL) |
| 465 | return NULL; |
| 466 | /* XXX Could do it nicer and interpret the data structure here, |
| 467 | returning a list of lists. But this can be done in Python... */ |
| 468 | for (i = 0; i < n; i++) { |
| 469 | w = newintobject((long)pickbuffer[i]); |
| 470 | if (w == NULL) { |
| 471 | DECREF(v); |
| 472 | return NULL; |
| 473 | } |
| 474 | setlistitem(v, i, w); |
| 475 | } |
| 476 | DEL(pickbuffer); |
| 477 | pickbuffer = NULL; |
| 478 | return v; |
| 479 | } |
| 480 | |
| 481 | extern void pick(), gselect(); |
| 482 | extern long endpick(), endselect(); |
| 483 | |
| 484 | %pick |
| 485 | static object *gl_pick(self, args) object *self, *args; { |
| 486 | return pick_select(args, pick); |
| 487 | } |
| 488 | |
| 489 | %endpick |
| 490 | static object *gl_endpick(self, args) object *self, *args; { |
| 491 | return endpick_select(args, endpick); |
| 492 | } |
| 493 | |
| 494 | %gselect |
| 495 | static object *gl_gselect(self, args) object *self, *args; { |
| 496 | return pick_select(args, gselect); |
| 497 | } |
| 498 | |
| 499 | %endselect |
| 500 | static object *gl_endselect(self, args) object *self, *args; { |
| 501 | return endpick_select(args, endselect); |
| 502 | } |
| 503 | |
| 504 | |
| 505 | /* XXX The generator botches this one. Here's a quick hack to fix it. */ |
| 506 | |
| 507 | % getmatrix float r[16] |
| 508 | |
| 509 | static object * |
| 510 | gl_getmatrix(self, args) |
| 511 | object *self; |
| 512 | object *args; |
| 513 | { |
| 514 | float arg1 [ 16 ] ; |
| 515 | object *v, *w; |
| 516 | int i; |
| 517 | getmatrix( arg1 ); |
| 518 | v = newlistobject(16); |
| 519 | if (v == NULL) { |
| 520 | return err_nomem(); |
| 521 | } |
| 522 | for (i = 0; i < 16; i++) { |
| 523 | w = mknewfloatobject(arg1[i]); |
| 524 | if (w == NULL) { |
| 525 | DECREF(v); |
| 526 | return NULL; |
| 527 | } |
| 528 | setlistitem(v, i, w); |
| 529 | } |
| 530 | return v; |
| 531 | } |
| 532 | |
| 533 | /* End of manually written stubs */ |
| 534 | |
| 535 | %% |
| 536 | |
| 537 | long getshade |
| 538 | void devport short s long s |
| 539 | void rdr2i long s long s |
| 540 | void rectfs short s short s short s short s |
| 541 | void rects short s short s short s short s |
| 542 | void rmv2i long s long s |
| 543 | void noport |
| 544 | void popviewport |
| 545 | void clear |
| 546 | void clearhitcode |
| 547 | void closeobj |
| 548 | void cursoff |
| 549 | void curson |
| 550 | void doublebuffer |
| 551 | void finish |
| 552 | void gconfig |
| 553 | void ginit |
| 554 | void greset |
| 555 | void multimap |
| 556 | void onemap |
| 557 | void popattributes |
| 558 | void popmatrix |
| 559 | void pushattributes |
| 560 | void pushmatrix |
| 561 | void pushviewport |
| 562 | void qreset |
| 563 | void RGBmode |
| 564 | void singlebuffer |
| 565 | void swapbuffers |
| 566 | void gsync |
| 567 | void tpon |
| 568 | void tpoff |
| 569 | void clkon |
| 570 | void clkoff |
| 571 | void ringbell |
| 572 | #void callfunc |
| 573 | void gbegin |
| 574 | void textinit |
| 575 | void initnames |
| 576 | void pclos |
| 577 | void popname |
| 578 | void spclos |
| 579 | void zclear |
| 580 | void screenspace |
| 581 | void reshapeviewport |
| 582 | void winpush |
| 583 | void winpop |
| 584 | void foreground |
| 585 | void endfullscrn |
| 586 | void endpupmode |
| 587 | void fullscrn |
| 588 | void pupmode |
| 589 | void winconstraints |
| 590 | void pagecolor short s |
| 591 | void textcolor short s |
| 592 | void color short s |
| 593 | void curveit short s |
| 594 | void font short s |
| 595 | void linewidth short s |
| 596 | void setlinestyle short s |
| 597 | void setmap short s |
| 598 | void swapinterval short s |
| 599 | void writemask short s |
| 600 | void textwritemask short s |
| 601 | void qdevice short s |
| 602 | void unqdevice short s |
| 603 | void curvebasis short s |
| 604 | void curveprecision short s |
| 605 | void loadname short s |
| 606 | void passthrough short s |
| 607 | void pushname short s |
| 608 | void setmonitor short s |
| 609 | void setshade short s |
| 610 | void setpattern short s |
| 611 | void pagewritemask short s |
| 612 | # |
| 613 | void callobj long s |
| 614 | void delobj long s |
| 615 | void editobj long s |
| 616 | void makeobj long s |
| 617 | void maketag long s |
| 618 | void chunksize long s |
| 619 | void compactify long s |
| 620 | void deltag long s |
| 621 | void lsrepeat long s |
| 622 | void objinsert long s |
| 623 | void objreplace long s |
| 624 | void winclose long s |
| 625 | void blanktime long s |
| 626 | void freepup long s |
| 627 | # This is not in the library!? |
| 628 | ###void pupcolor long s |
| 629 | # |
| 630 | void backbuffer long s |
| 631 | void frontbuffer long s |
| 632 | void lsbackup long s |
| 633 | void resetls long s |
| 634 | void lampon long s |
| 635 | void lampoff long s |
| 636 | void setbell long s |
| 637 | void blankscreen long s |
| 638 | void depthcue long s |
| 639 | void zbuffer long s |
| 640 | void backface long s |
| 641 | # |
| 642 | void cmov2i long s long s |
| 643 | void draw2i long s long s |
| 644 | void move2i long s long s |
| 645 | void pnt2i long s long s |
| 646 | void patchbasis long s long s |
| 647 | void patchprecision long s long s |
| 648 | void pdr2i long s long s |
| 649 | void pmv2i long s long s |
| 650 | void rpdr2i long s long s |
| 651 | void rpmv2i long s long s |
| 652 | void xfpt2i long s long s |
| 653 | void objdelete long s long s |
| 654 | void patchcurves long s long s |
| 655 | void minsize long s long s |
| 656 | void maxsize long s long s |
| 657 | void keepaspect long s long s |
| 658 | void prefsize long s long s |
| 659 | void stepunit long s long s |
| 660 | void fudge long s long s |
| 661 | void winmove long s long s |
| 662 | # |
| 663 | void attachcursor short s short s |
| 664 | void deflinestyle short s short s |
| 665 | void noise short s short s |
| 666 | void picksize short s short s |
| 667 | void qenter short s short s |
| 668 | void setdepth short s short s |
| 669 | void cmov2s short s short s |
| 670 | void draw2s short s short s |
| 671 | void move2s short s short s |
| 672 | void pdr2s short s short s |
| 673 | void pmv2s short s short s |
| 674 | void pnt2s short s short s |
| 675 | void rdr2s short s short s |
| 676 | void rmv2s short s short s |
| 677 | void rpdr2s short s short s |
| 678 | void rpmv2s short s short s |
| 679 | void xfpt2s short s short s |
| 680 | # |
| 681 | void cmov2 float s float s |
| 682 | void draw2 float s float s |
| 683 | void move2 float s float s |
| 684 | void pnt2 float s float s |
| 685 | void pdr2 float s float s |
| 686 | void pmv2 float s float s |
| 687 | void rdr2 float s float s |
| 688 | void rmv2 float s float s |
| 689 | void rpdr2 float s float s |
| 690 | void rpmv2 float s float s |
| 691 | void xfpt2 float s float s |
| 692 | # |
| 693 | void loadmatrix float s[16] |
| 694 | void multmatrix float s[16] |
| 695 | void crv float s[16] |
| 696 | void rcrv float s[16] |
| 697 | # |
| 698 | # Methods that have strings. |
| 699 | # |
| 700 | void addtopup long s char *s long s |
| 701 | void charstr char *s |
| 702 | void getport char *s |
| 703 | long strwidth char *s |
| 704 | long winopen char *s |
| 705 | void wintitle char *s |
| 706 | # |
| 707 | # Methods that have 1 long (# of elements) and an array |
| 708 | # |
| 709 | void polf long s float s[3*arg1] |
| 710 | void polf2 long s float s[2*arg1] |
| 711 | void poly long s float s[3*arg1] |
| 712 | void poly2 long s float s[2*arg1] |
| 713 | void crvn long s float s[3*arg1] |
| 714 | void rcrvn long s float s[4*arg1] |
| 715 | # |
| 716 | void polf2i long s long s[2*arg1] |
| 717 | void polfi long s long s[3*arg1] |
| 718 | void poly2i long s long s[2*arg1] |
| 719 | void polyi long s long s[3*arg1] |
| 720 | # |
| 721 | void polf2s long s short s[2*arg1] |
| 722 | void polfs long s short s[3*arg1] |
| 723 | void polys long s short s[3*arg1] |
| 724 | void poly2s long s short s[2*arg1] |
| 725 | # |
| 726 | void defcursor short s short s[16] |
| 727 | void writepixels short s short s[arg1] |
| 728 | void defbasis long s float s[16] |
| 729 | void gewrite short s short s[arg1] |
| 730 | # |
| 731 | void rotate short s char s |
| 732 | # This is not in the library!? |
| 733 | ###void setbutton short s char s |
| 734 | void rot float s char s |
| 735 | # |
| 736 | void circfi long s long s long s |
| 737 | void circi long s long s long s |
| 738 | void cmovi long s long s long s |
| 739 | void drawi long s long s long s |
| 740 | void movei long s long s long s |
| 741 | void pnti long s long s long s |
| 742 | void newtag long s long s long s |
| 743 | void pdri long s long s long s |
| 744 | void pmvi long s long s long s |
| 745 | void rdri long s long s long s |
| 746 | void rmvi long s long s long s |
| 747 | void rpdri long s long s long s |
| 748 | void rpmvi long s long s long s |
| 749 | void xfpti long s long s long s |
| 750 | # |
| 751 | void circ float s float s float s |
| 752 | void circf float s float s float s |
| 753 | void cmov float s float s float s |
| 754 | void draw float s float s float s |
| 755 | void move float s float s float s |
| 756 | void pnt float s float s float s |
| 757 | void scale float s float s float s |
| 758 | void translate float s float s float s |
| 759 | void pdr float s float s float s |
| 760 | void pmv float s float s float s |
| 761 | void rdr float s float s float s |
| 762 | void rmv float s float s float s |
| 763 | void rpdr float s float s float s |
| 764 | void rpmv float s float s float s |
| 765 | void xfpt float s float s float s |
| 766 | # |
| 767 | void RGBcolor short s short s short s |
| 768 | void RGBwritemask short s short s short s |
| 769 | void setcursor short s short s short s |
| 770 | void tie short s short s short s |
| 771 | void circfs short s short s short s |
| 772 | void circs short s short s short s |
| 773 | void cmovs short s short s short s |
| 774 | void draws short s short s short s |
| 775 | void moves short s short s short s |
| 776 | void pdrs short s short s short s |
| 777 | void pmvs short s short s short s |
| 778 | void pnts short s short s short s |
| 779 | void rdrs short s short s short s |
| 780 | void rmvs short s short s short s |
| 781 | void rpdrs short s short s short s |
| 782 | void rpmvs short s short s short s |
| 783 | void xfpts short s short s short s |
| 784 | void curorigin short s short s short s |
| 785 | void cyclemap short s short s short s |
| 786 | # |
| 787 | void patch float s[16] float s[16] float s[16] |
| 788 | void splf long s float s[3*arg1] short s[arg1] |
| 789 | void splf2 long s float s[2*arg1] short s[arg1] |
| 790 | void splfi long s long s[3*arg1] short s[arg1] |
| 791 | void splf2i long s long s[2*arg1] short s[arg1] |
| 792 | void splfs long s short s[3*arg1] short s[arg1] |
| 793 | void splf2s long s short s[2*arg1] short s[arg1] |
| 794 | void defpattern short s short s short s[arg2*arg2/16] |
| 795 | # |
| 796 | void rpatch float s[16] float s[16] float s[16] float s[16] |
| 797 | # |
| 798 | # routines that send 4 floats |
| 799 | # |
| 800 | void ortho2 float s float s float s float s |
| 801 | void rect float s float s float s float s |
| 802 | void rectf float s float s float s float s |
| 803 | void xfpt4 float s float s float s float s |
| 804 | # |
| 805 | void textport short s short s short s short s |
| 806 | void mapcolor short s short s short s short s |
| 807 | void scrmask short s short s short s short s |
| 808 | void setvaluator short s short s short s short s |
| 809 | void viewport short s short s short s short s |
| 810 | void shaderange short s short s short s short s |
| 811 | void xfpt4s short s short s short s short s |
| 812 | void rectfi long s long s long s long s |
| 813 | void recti long s long s long s long s |
| 814 | void xfpt4i long s long s long s long s |
| 815 | void prefposition long s long s long s long s |
| 816 | # |
| 817 | void arc float s float s float s short s short s |
| 818 | void arcf float s float s float s short s short s |
| 819 | void arcfi long s long s long s short s short s |
| 820 | void arci long s long s long s short s short s |
| 821 | # |
| 822 | void bbox2 short s short s float s float s float s float s |
| 823 | void bbox2i short s short s long s long s long s long s |
| 824 | void bbox2s short s short s short s short s short s short s |
| 825 | void blink short s short s short s short s short s |
| 826 | void ortho float s float s float s float s float s float s |
| 827 | void window float s float s float s float s float s float s |
| 828 | void lookat float s float s float s float s float s float s short s |
| 829 | # |
| 830 | void perspective short s float s float s float s |
| 831 | void polarview float s short s short s short s |
| 832 | # XXX getichararray not supported |
| 833 | #void writeRGB short s char s[arg1] char s[arg1] char s[arg1] |
| 834 | # |
| 835 | void arcfs short s short s short s short s short s |
| 836 | void arcs short s short s short s short s short s |
| 837 | void rectcopy short s short s short s short s short s short s |
| 838 | void RGBcursor short s short s short s short s short s short s short s |
| 839 | # |
| 840 | long getbutton short s |
| 841 | long getcmmode |
| 842 | long getlsbackup |
| 843 | long getresetls |
| 844 | long getdcm |
| 845 | long getzbuffer |
| 846 | long ismex |
| 847 | long isobj long s |
| 848 | long isqueued short s |
| 849 | long istag long s |
| 850 | # |
| 851 | long genobj |
| 852 | long gentag |
| 853 | long getbuffer |
| 854 | long getcolor |
| 855 | long getdisplaymode |
| 856 | long getfont |
| 857 | long getheight |
| 858 | long gethitcode |
| 859 | long getlstyle |
| 860 | long getlwidth |
| 861 | long getmap |
| 862 | long getplanes |
| 863 | long getwritemask |
| 864 | long qtest |
| 865 | long getlsrepeat |
| 866 | long getmonitor |
| 867 | long getopenobj |
| 868 | long getpattern |
| 869 | long winget |
| 870 | long winattach |
| 871 | long getothermonitor |
| 872 | long newpup |
| 873 | # |
| 874 | long getvaluator short s |
| 875 | void winset long s |
| 876 | long dopup long s |
| 877 | void getdepth short r short r |
| 878 | void getcpos short r short r |
| 879 | void getsize long r long r |
| 880 | void getorigin long r long r |
| 881 | void getviewport short r short r short r short r |
| 882 | void gettp short r short r short r short r |
| 883 | void getgpos float r float r float r float r |
| 884 | void winposition long s long s long s long s |
| 885 | void gRGBcolor short r short r short r |
| 886 | void gRGBmask short r short r short r |
| 887 | void getscrmask short r short r short r short r |
| 888 | void gRGBcursor short r short r short r short r short r short r short r short r long * |
| 889 | void getmcolor short s short r short r short r |
| 890 | void mapw long s short s short s float r float r float r float r float r float r |
| 891 | void mapw2 long s short s short s float r float r |
| 892 | void defrasterfont short s short s short s Fontchar s[arg3] short s short s[4*arg5] |
| 893 | long qread short r |
| 894 | void getcursor short r short r short r long r |
| 895 | # |
| 896 | # For these we receive arrays of stuff |
| 897 | # |
| 898 | void getdev long s short s[arg1] short r[arg1] |
| 899 | #XXX not generated correctly yet |
| 900 | #void getmatrix float r[16] |
| 901 | long readpixels short s short r[retval] |
| 902 | long readRGB short s char r[retval] char r[retval] char r[retval] |
| 903 | long blkqread short s short r[arg1] |
| 904 | # |
| 905 | # New 4D routines |
| 906 | # |
| 907 | void cmode |
| 908 | void concave long s |
| 909 | void curstype long s |
| 910 | void drawmode long s |
| 911 | void gammaramp short s[256] short s[256] short s[256] |
| 912 | long getbackface |
| 913 | long getdescender |
| 914 | long getdrawmode |
| 915 | long getmmode |
| 916 | long getsm |
| 917 | long getvideo long s |
| 918 | void imakebackground |
| 919 | void lmbind short s short s |
| 920 | void lmdef long s long s long s float s[arg3] |
| 921 | void mmode long s |
| 922 | void normal float s[3] |
| 923 | void overlay long s |
| 924 | void RGBrange short s short s short s short s short s short s short s short s |
| 925 | void setvideo long s long s |
| 926 | void shademodel long s |
| 927 | void underlay long s |
| 928 | # |
| 929 | # New Personal Iris/GT Routines |
| 930 | # |
| 931 | void bgnclosedline |
| 932 | void bgnline |
| 933 | void bgnpoint |
| 934 | void bgnpolygon |
| 935 | void bgnsurface |
| 936 | void bgntmesh |
| 937 | void bgntrim |
| 938 | void endclosedline |
| 939 | void endline |
| 940 | void endpoint |
| 941 | void endpolygon |
| 942 | void endsurface |
| 943 | void endtmesh |
| 944 | void endtrim |
| 945 | void blendfunction long s long s |
| 946 | void c3f float s[3] |
| 947 | void c3i long s[3] |
| 948 | void c3s short s[3] |
| 949 | void c4f float s[4] |
| 950 | void c4i long s[4] |
| 951 | void c4s short s[4] |
| 952 | void colorf float s |
| 953 | void cpack long s |
| 954 | void czclear long s long s |
| 955 | void dglclose long s |
| 956 | long dglopen char *s long s |
| 957 | long getgdesc long s |
| 958 | void getnurbsproperty long s float r |
| 959 | void glcompat long s long s |
| 960 | void iconsize long s long s |
| 961 | void icontitle char *s |
| 962 | void lRGBrange short s short s short s short s short s short s long s long s |
| 963 | void linesmooth long s |
| 964 | void lmcolor long s |
| 965 | void logicop long s |
| 966 | long lrectread short s short s short s short s long r[retval] |
| 967 | void lrectwrite short s short s short s short s long s[(arg2-arg1+1)*(arg4-arg3+1)] |
| 968 | long rectread short s short s short s short s short r[retval] |
| 969 | void rectwrite short s short s short s short s short s[(arg2-arg1+1)*(arg4-arg3+1)] |
| 970 | void lsetdepth long s long s |
| 971 | void lshaderange short s short s long s long s |
| 972 | void n3f float s[3] |
| 973 | void noborder |
| 974 | void pntsmooth long s |
| 975 | void readsource long s |
| 976 | void rectzoom float s float s |
| 977 | void sbox float s float s float s float s |
| 978 | void sboxi long s long s long s long s |
| 979 | void sboxs short s short s short s short s |
| 980 | void sboxf float s float s float s float s |
| 981 | void sboxfi long s long s long s long s |
| 982 | void sboxfs short s short s short s short s |
| 983 | void setnurbsproperty long s float s |
| 984 | void setpup long s long s long s |
| 985 | void smoothline long s |
| 986 | void subpixel long s |
| 987 | void swaptmesh |
| 988 | long swinopen long s |
| 989 | void v2f float s[2] |
| 990 | void v2i long s[2] |
| 991 | void v2s short s[2] |
| 992 | void v3f float s[3] |
| 993 | void v3i long s[3] |
| 994 | void v3s short s[3] |
| 995 | void v4f float s[4] |
| 996 | void v4i long s[4] |
| 997 | void v4s short s[4] |
| 998 | void videocmd long s |
| 999 | long windepth long s |
| 1000 | void wmpack long s |
| 1001 | void zdraw long s |
| 1002 | void zfunction long s |
| 1003 | void zsource long s |
| 1004 | void zwritemask long s |
| 1005 | # |
| 1006 | # uses doubles |
| 1007 | # |
| 1008 | void v2d double s[2] |
| 1009 | void v3d double s[3] |
| 1010 | void v4d double s[4] |