NEURON
idraw.h
Go to the documentation of this file.
1 #ifndef ocidraw_h
2 #define ocidraw_h
3 /*
4 Hooks for special processing make use of the request() method in Glyphs.
5 */
6 #include <ivstream.h>
7 
8 class Canvas;
9 class Transformer;
10 class Font;
11 class Color;
12 class Brush;
13 
14 class OcIdraw {
15  public:
16  static void prologue();
17  static void epilog();
18  static void pict();
19  static void pict(const Transformer&);
20  static void end();
21  static void text(Canvas*,
22  const char*,
23  const Transformer&,
24  const Font* f = NULL,
25  const Color* c = NULL);
26  static void mline(Canvas*,
27  int count,
28  const Coord* x,
29  const Coord* y,
30  const Color* c = NULL,
31  const Brush* b = NULL);
32  static void polygon(Canvas*,
33  int count,
34  const Coord* x,
35  const Coord* y,
36  const Color* c = NULL,
37  const Brush* b = NULL,
38  bool fill = false);
39  static void rect(Canvas*,
40  Coord x1,
41  Coord y1,
42  Coord x2,
43  Coord y2,
44  const Color* c = NULL,
45  const Brush* b = NULL,
46  bool fill = false);
47  static void line(Canvas*,
48  Coord x1,
49  Coord y1,
50  Coord x2,
51  Coord y2,
52  const Color* c = NULL,
53  const Brush* b = NULL);
54  static void ellipse(Canvas*,
55  Coord x1,
56  Coord y1,
57  Coord width,
58  Coord height,
59  const Color* c = NULL,
60  const Brush* b = NULL,
61  bool fill = false);
62 
63  static void new_path();
64  static void move_to(Coord x, Coord y);
65  static void line_to(Coord x, Coord y);
66  static void curve_to(Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2);
67  static void close_path();
68  static void stroke(Canvas*, const Color*, const Brush*);
69  static void fill(Canvas*, const Color*);
70  static void bspl(Canvas*,
71  int count,
72  const Coord* x,
73  const Coord* y,
74  const Color* c = NULL,
75  const Brush* b = NULL);
76  static void cbspl(Canvas*,
77  int count,
78  const Coord* x,
79  const Coord* y,
80  const Color* c = NULL,
81  const Brush* b = NULL,
82  bool fill = false);
83 
84  public:
85  static ostream* idraw_stream;
86 
87  private:
88  static void rcurve(int level, Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2);
89  static void poly(int count,
90  const Coord* x,
91  const Coord* y,
92  const Color* c = NULL,
93  const Brush* b = NULL,
94  bool fill = false);
95  static void add(Coord, Coord);
96  static void brush(const Brush*);
97  static void ifill(const Color*, bool);
98  static bool closed_;
99  static bool curved_;
100  static Coord *xpath_, *ypath_;
101  static int ipath_, capacity_;
102 };
103 
104 #define IfIdraw(arg) \
105  if (OcIdraw::idraw_stream) { \
106  OcIdraw::arg; \
107  }
108 
109 
110 #endif
#define Color
Definition: _defines.h:74
#define Transformer
Definition: _defines.h:316
#define Canvas
Definition: _defines.h:65
#define Coord
Definition: _defines.h:19
#define Brush
Definition: _defines.h:59
#define Font
Definition: _defines.h:120
Definition: idraw.h:14
static void curve_to(Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2)
static int ipath_
Definition: idraw.h:101
static void mline(Canvas *, int count, const Coord *x, const Coord *y, const Color *c=NULL, const Brush *b=NULL)
static void poly(int count, const Coord *x, const Coord *y, const Color *c=NULL, const Brush *b=NULL, bool fill=false)
static void bspl(Canvas *, int count, const Coord *x, const Coord *y, const Color *c=NULL, const Brush *b=NULL)
static void rcurve(int level, Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2)
static int capacity_
Definition: idraw.h:101
static ostream * idraw_stream
Definition: idraw.h:85
static void close_path()
static void add(Coord, Coord)
static void move_to(Coord x, Coord y)
static bool curved_
Definition: idraw.h:99
static Coord * ypath_
Definition: idraw.h:100
static void pict()
static bool closed_
Definition: idraw.h:98
static void line(Canvas *, Coord x1, Coord y1, Coord x2, Coord y2, const Color *c=NULL, const Brush *b=NULL)
static void polygon(Canvas *, int count, const Coord *x, const Coord *y, const Color *c=NULL, const Brush *b=NULL, bool fill=false)
static void text(Canvas *, const char *, const Transformer &, const Font *f=NULL, const Color *c=NULL)
static void brush(const Brush *)
static void prologue()
static void line_to(Coord x, Coord y)
static void stroke(Canvas *, const Color *, const Brush *)
static void new_path()
static void rect(Canvas *, Coord x1, Coord y1, Coord x2, Coord y2, const Color *c=NULL, const Brush *b=NULL, bool fill=false)
static void cbspl(Canvas *, int count, const Coord *x, const Coord *y, const Color *c=NULL, const Brush *b=NULL, bool fill=false)
static void end()
static void pict(const Transformer &)
static void ellipse(Canvas *, Coord x1, Coord y1, Coord width, Coord height, const Color *c=NULL, const Brush *b=NULL, bool fill=false)
static Coord * xpath_
Definition: idraw.h:100
static void ifill(const Color *, bool)
static void epilog()
static void fill(Canvas *, const Color *)
#define c
#define NULL
Definition: sptree.h:16