view doodle/tk/drawing.d @ 76:78bc2046256e

And some more
author "David Bryant <bagnose@gmail.com>"
date Sun, 15 Aug 2010 01:21:14 +0930
parents 6f2525e170f2
children 024a5608087f
line wrap: on
line source

module doodle.tk.drawing;

public {
    import doodle.tk.geometry;
}

interface Drawable {
    enum LineStyle {
        SOLID,
        DASHED,
        DOTTED
    }

    void setLineStyle(LineStyle style);
    void setLineThickness(in double thickness);
    //void setLineColor(in Color color);
    //void setFillColor(in Color color);

    void drawRectangle(in Rectangle rectangle, bool fill);
    void drawEllipse(in Rectangle rectangle, bool fill);
    void drawSegment(in Segment segment);
    void drawHLine(in double y0, in double x0, in double x1);
    void drawVLine(in double x0, in double y0, in double y1);
    void drawPoly(in Point[] points, bool fill);

    void pushState();           // Copies all of current state
    void popState();            // Restores all of previous state

    void translate(in Vector v);
    void translate(in Point p);
    void scale(in Vector v);
    void zoom(in double z);

    //void setFontFace;
    //void setFontSize;
    void drawText(in string text);

    // How to fit fonts, metrics, etc in here?
}