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*, const char*, const Transformer&,
22  const Font* f=NULL, const Color* c=NULL);
23  static void mline(Canvas*, int count, const Coord* x, const Coord* y,
24  const Color* c=NULL, const Brush* b=NULL);
25  static void polygon(Canvas*, int count, const Coord* x, const Coord* y,
26  const Color* c=NULL, const Brush* b=NULL, bool fill = false);
27  static void rect(Canvas*, Coord x1, Coord y1, Coord x2, Coord y2,
28  const Color* c=NULL, const Brush* b=NULL, bool fill = false);
29  static void line(Canvas*, Coord x1, Coord y1, Coord x2, Coord y2,
30  const Color* c=NULL, const Brush* b=NULL);
31  static void ellipse(Canvas*, Coord x1, Coord y1,
32  Coord width, Coord height,
33  const Color* c=NULL, const Brush* b= NULL, bool fill = false);
34 
35  static void new_path();
36  static void move_to(Coord x, Coord y);
37  static void line_to(Coord x, Coord y);
38  static void curve_to(Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2);
39  static void close_path();
40  static void stroke(Canvas*, const Color*, const Brush*);
41  static void fill(Canvas*, const Color*);
42  static void bspl(Canvas*, int count, const Coord* x, const Coord* y,
43  const Color* c=NULL, const Brush* b=NULL);
44  static void cbspl(Canvas*, int count, const Coord* x, const Coord* y,
45  const Color* c=NULL, const Brush* b=NULL, bool fill = false);
46 public:
47  static ostream* idraw_stream;
48 private:
49  static void rcurve(int level, Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2);
50  static void poly(int count, const Coord* x, const Coord* y,
51  const Color* c=NULL, const Brush* b=NULL, bool fill = false);
52  static void add(Coord, Coord);
53  static void brush(const Brush*);
54  static void ifill(const Color*, bool);
55  static bool closed_;
56  static bool curved_;
57  static Coord *xpath_, *ypath_;
58  static int ipath_, capacity_;
59 };
60 
61 #define IfIdraw(arg) if (OcIdraw::idraw_stream) {OcIdraw::arg;}
62 
63 
64 #endif
static ostream * idraw_stream
Definition: idraw.h:47
static void fill(Canvas *, const Color *)
static void curve_to(Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2)
static void bspl(Canvas *, int count, const Coord *x, const Coord *y, const Color *c=NULL, const Brush *b=NULL)
#define Coord
Definition: _defines.h:19
#define Brush
Definition: _defines.h:59
#define Color
Definition: _defines.h:74
static Coord * ypath_
Definition: idraw.h:57
static int ipath_
Definition: idraw.h:58
static void brush(const Brush *)
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 poly(int count, const Coord *x, const Coord *y, const Color *c=NULL, const Brush *b=NULL, bool fill=false)
#define Font
Definition: _defines.h:120
static Coord * xpath_
Definition: idraw.h:57
#define Canvas
Definition: _defines.h:65
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 ifill(const Color *, bool)
static void close_path()
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 line_to(Coord x, Coord y)
static int capacity_
Definition: idraw.h:58
static void prologue()
static void line(Canvas *, Coord x1, Coord y1, Coord x2, Coord y2, const Color *c=NULL, const Brush *b=NULL)
static void mline(Canvas *, int count, const Coord *x, const Coord *y, const Color *c=NULL, const Brush *b=NULL)
static void move_to(Coord x, Coord y)
#define Transformer
Definition: _defines.h:316
static void pict()
static bool closed_
Definition: idraw.h:55
static void add(Coord, Coord)
#define c
static void rcurve(int level, Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2)
static void text(Canvas *, const char *, const Transformer &, const Font *f=NULL, const Color *c=NULL)
Definition: idraw.h:14
static void end()
static bool curved_
Definition: idraw.h:56
return NULL
Definition: cabcode.cpp:461
static void epilog()
static void stroke(Canvas *, const Color *, const Brush *)
static void ellipse(Canvas *, Coord x1, Coord y1, Coord width, Coord height, const Color *c=NULL, const Brush *b=NULL, bool fill=false)