4
#include <incr.h> /* import base types */
6
#if HAVE_VMALLOC || HAVE_AST
10
typedef struct _vmalloc_s Vmalloc_t;
11
#define vmalloc(arena,request) malloc(request)
12
#define vmfree(arena,ptr) free(ptr)
13
#define vmregion(ptr) 0
16
typedef enum ilcurvetype_e { IL_SPLINE, IL_POLYLINE, IL_NOCURVE } ilcurvetype_t;
18
typedef enum ilshapetype_e {
19
IL_POLYGON, IL_CIRCLE, IL_ELLIPSE, IL_SPLINEGON, IL_NOSHAPE
24
int n; /* must be > 0 */
31
/* this should be ilcurve_t*, but too much code depends ..*/
32
ilcurve_t curve; /* if polygon, splinegon */
33
struct {double radius_a, radius_b;} ellipse;
35
struct ilshape_s *next;
38
ilcoord_t ilcoord(double x, double y);
39
ilcurve_t *il_newcurve(Vmalloc_t *arena, ilcurvetype_t kind, int npts);
40
void il_freecurve(Vmalloc_t *arena, ilcurve_t *curve);
42
ilshape_t *il_newshape(Vmalloc_t *arena, ilcurve_t *contents, ilshape_t *link);
43
ilshape_t *il_copyshape(Vmalloc_t *arena, ilshape_t *shape);
44
void il_freeshape(Vmalloc_t *arena, ilshape_t *shape);
46
ilcurve_t *il_get_bounding_poly(ilshape_t *shape);
47
ilrect_t il_get_bounding_rect(ilshape_t *shape);
48
int il_inshape(ilshape_t *shape, ilcoord_t pt); /* 0,1 predicate */