~ubuntu-branches/ubuntu/lucid/graphviz/lucid-security

« back to all changes in this revision

Viewing changes to shape/shape.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephen M Moraco
  • Date: 2002-02-05 18:52:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020205185212-8i04c70te00rc40y
Tags: upstream-1.7.16
ImportĀ upstreamĀ versionĀ 1.7.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef ILSHAPE_H
 
2
#define ILSHAPE_H
 
3
#include <assert.h>
 
4
#include <incr.h>               /* import base types */
 
5
 
 
6
#if HAVE_VMALLOC || HAVE_AST
 
7
#include        <vmalloc.h>
 
8
#else
 
9
#include        <stdlib.h>
 
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
 
14
#endif
 
15
 
 
16
typedef enum ilcurvetype_e { IL_SPLINE, IL_POLYLINE, IL_NOCURVE } ilcurvetype_t;
 
17
 
 
18
typedef enum ilshapetype_e {
 
19
        IL_POLYGON, IL_CIRCLE, IL_ELLIPSE, IL_SPLINEGON, IL_NOSHAPE
 
20
} ilshapetype_t;
 
21
 
 
22
struct ilcurve_s {
 
23
        ilcurvetype_t   type;
 
24
        int                             n;              /* must be > 0 */
 
25
        ilcoord_t               *p;
 
26
} ;
 
27
 
 
28
struct ilshape_s {
 
29
        ilshapetype_t   type;
 
30
        union {
 
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;
 
34
        } def;
 
35
        struct ilshape_s *next;
 
36
} ;
 
37
 
 
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);
 
41
 
 
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);
 
45
 
 
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 */
 
49
#endif