1 #include <../../nrnconf.h> 2 #if HAVE_IV // to end of file 4 #include <InterViews/glyph.h> 5 #include <InterViews/session.h> 6 #include <InterViews/style.h> 7 #include <InterViews/canvas.h> 8 #include <InterViews/color.h> 9 #include <InterViews/hit.h> 10 #include <InterViews/brush.h> 11 #include <InterViews/transformer.h> 12 #include <IV-look/kit.h> 63 Style*
s = Session::instance()->style();
65 s->find_attribute(
"default_brush", b);
75 left(l); bottom(b); width(w); height(h);
93 c->rect(x +
left(), y+ bottom(), x +
right(), y + top(),
color(), brush());
100 h.target(depth,
this, 0);
140 c->line(x, y, x + dx_, y + dy_,
color(), brush());
151 c->line_to(x+dx_,y+dy_);
162 Coord y = h.bottom();
170 h.target(depth,
this, 0);
186 Coord w = brush()->width();
187 Coord diameter = radius_ + radius_ + w + w;
200 const Coord r = radius_, x = a.
x(), y = a.
y();
201 const Coord p0 = 1.00000000 * r;
202 const Coord p1 = 0.89657547 * r;
203 const Coord p2 = 0.70710678 * r;
204 const Coord p3 = 0.51763809 * r;
205 const Coord p4 = 0.26794919 * r;
208 c->curve_to(x+p2, y+p2, x+p0, y+p4, x+p1, y+p3);
209 c->curve_to(x, y+p0, x+p3, y+p1, x+p4, y+p0);
210 c->curve_to(x-p2, y+p2, x-p4, y+p0, x-p3, y+p1);
211 c->curve_to(x-p0, y, x-p1, y + p3, x-p0, y+p4);
212 c->curve_to(x-p2, y-p2, x-p0, y-p4, x-p1, y-p3);
213 c->curve_to(x, y-p0, x-p3, y-p1, x-p4, y-p0);
214 c->curve_to(x+p2, y-p2, x+p4, y-p0, x+p3, y-p1);
215 c->curve_to(x+p0, y, x+p1, y-p3, x+p0, y-p4);
220 c->stroke(
color(), brush());
222 IfIdraw(ellipse(c, x, y, r, r,
color(), brush(), filled_));
238 Coord w = brush()->width();
251 const Coord dx = width_/2, dy = height_/2, x = a.
x(), y = a.
y();
254 c->fill_rect(x-dx,y-dy,x+dx,y+dy,
color());
256 c->rect(x-dx,y-dy,x+dx,y+dy,
color(),brush());
258 IfIdraw(rect(c, x-dx, y-dy, x+dx, y+dy,
color(), brush(), filled_));
273 Coord w = brush()->width();
275 Requirement ry((side_ + side_)*1.1547 + w + w, 0, 0, 0.5);
286 const Coord x = a.
x(), y = a.
y();
287 const Coord radius = 1.1547*side_;
290 c->move_to(x, y+radius);
291 c->line_to(x+side_, y-radius);
292 c->line_to(x-side_, y-radius);
297 c->stroke(
color(),brush());
313 IfIdraw(polygon(c, 3, xList, yList,
color(), brush(), filled_));
void merge(const Extension &)
void set(Canvas *, const Allocation &)
virtual void draw(Canvas *, const Allocation &) const
virtual void allocate(Canvas *, const Allocation &, Extension &)
static const Color * default_color()
const Brush * brush() const
virtual void pick(Canvas *, const Allocation &, int depth, Hit &)
virtual void stroke(Canvas *, const Color *, const Brush *)
static bool inside(Coord x, Coord min, Coord max)
virtual void pick(Canvas *, const Allocation &, int depth, Hit &)
virtual void draw(Canvas *, const Allocation &) const
const Color * color() const
static const Color * default_foreground()
static const Brush * default_brush()
virtual void draw(Canvas *, const Allocation &) const
virtual void request(Requisition &) const
virtual void allocate(Canvas *, const Allocation &, Extension &)
virtual void request(Requisition &) const
Line(Coord dx, Coord dy, const Color *color=NULL, const Brush *brush=NULL)
virtual void request(Requisition &) const
static XYView * current_draw_view()
void require_y(const Requirement &)
static void extend(Extension &, Coord)
virtual void draw(Canvas *, const Allocation &) const
virtual void unref() const
virtual void request(Requisition &) const
static bool near_line(Coord x, Coord y, Coord x1, Coord y1, Coord x2, Coord y2, float epsilon)
virtual void request(Requisition &) const
Rectangle(float height, float width, bool filled=false, const Color *color=NULL, const Brush *brush=NULL)
void require_x(const Requirement &)
Rect(Coord left, Coord bottom, Coord width, Coord height, const Color *c=NULL, const Brush *b=NULL)
static char line[MAXLINE]
virtual void allocate(Canvas *, const Allocation &, Extension &)
virtual void allocate(Canvas *, const Allocation &, Extension &)
Triangle(float side, bool filled=false, const Color *color=NULL, const Brush *brush=NULL)
virtual void draw(Canvas *, const Allocation &) const
virtual void allocate(Canvas *, const Allocation &, Extension &)
void require(DimensionName, const Requirement &)
Appear(const Color *color=NULL, const Brush *brush=NULL)
Circle(float radius, bool filled=false, const Color *color=NULL, const Brush *brush=NULL)