1 /* Copyright (C) 1992-1998 The Geometry Center 2 * Copyright (C) 1998-2000 Stuart Levy, Tamara Munzner, Mark Phillips 3 * 4 * This file is part of Geomview. 5 * 6 * Geomview is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU Lesser General Public License as published 8 * by the Free Software Foundation; either version 2, or (at your option) 9 * any later version. 10 * 11 * Geomview is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with Geomview; see the file COPYING. If not, write 18 * to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, 19 * USA, or visit http://www.gnu.org. 20 */ 21 #ifndef LISPEXT_H 22 #define LISPEXT_H 23 24 #include "lisp.h" 25 #include "streampool.h" 26 #include "3d.h" 27 #include "camera.h" 28 #include "geom.h" 29 #include "appearance.h" 30 #include "window.h" 31 #include "transformn.h" 32 #include "lang.h" 33 34 /* All extension objects except the transform objects have the 35 * following structure. 36 */ 37 typedef struct HandleRefStruct 38 { 39 Handle *h; 40 Ref *ref; 41 } HandleRefStruct; 42 43 typedef struct { 44 Handle *h; 45 Camera *cam; 46 } CameraStruct; 47 48 typedef struct { 49 Handle *h; 50 Geom *geom; 51 } GeomStruct; 52 53 typedef struct { 54 Handle *h; 55 Transform tm; 56 } TransformStruct; 57 58 typedef struct { 59 Handle *h; 60 WnWindow *wn; 61 } WindowStruct; 62 63 typedef struct { 64 Handle *h; 65 Appearance *ap; 66 } ApStruct; 67 68 typedef struct { 69 Handle *h; 70 TransformN *tm; 71 } TmNStruct; 72 73 typedef struct 74 { 75 Handle *h; 76 Image *img; 77 } ImgStruct; 78 79 #define LAPVAL(obj) ((ApStruct*) (obj->cell.p)) 80 #define LCAMERAVAL(obj) ((CameraStruct*) (obj->cell.p)) 81 #define LGEOMVAL(obj) ((GeomStruct*) (obj->cell.p)) 82 #define LWINDOWVAL(obj) ((WindowStruct*) (obj->cell.p)) 83 #define LTRANSFORMVAL(obj) ((TransformStruct*)(obj->cell.p)) 84 #define LTRANSFORMNVAL(obj) ((TmNStruct*) (obj->cell.p)) 85 #define LIMAGEVAL(obj) ((ImgStruct*) (obj->cell.p)) 86 87 #define LSTRINGSVAL(obj) LSTRINGVAL(obj) 88 #define LIDVAL(obj) (obj->cell.i) 89 #define LKEYWORDVAL(obj) (obj->cell.i) 90 91 extern LType LApp; 92 extern LType LCamerap; 93 extern LType LGeomp; 94 extern LType LIdp; 95 extern LType LKeywordp; 96 extern LType LStringsp; 97 extern LType LTransformp; 98 extern LType LTransformNp; 99 extern LType LWindowp; 100 extern LType LImagep; 101 extern LType LApp; 102 103 #define LAP (&LApp) 104 #define LCAMERA (&LCamerap) 105 #define LGEOM (&LGeomp) 106 #define LID (&LIdp) 107 #define LKEYWORD (&LKeywordp) 108 #define LSTRINGS (&LStringsp) 109 #define LTRANSFORM (<ransformp) 110 #define LTRANSFORMN (<ransformNp) 111 #define LWINDOW (&LWindowp) 112 #define LIMAGE (&LImagep) 113 114 extern LObject *L0, *L1; 115 116 extern Keyword parse_keyword(char *word); 117 extern void lispext_init(); 118 extern void define_keyword(char *word, Keyword value); 119 char *keywordname(Keyword keyword); 120 121 #endif /* ! LISPEXT_H */ 122 123 /* 124 * Local Variables: *** 125 * mode: c *** 126 * c-basic-offset: 2 *** 127 * End: *** 128 */ 129