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