class Core::Portable::Graphics

#include <coregraphics.h>

class Graphics: public Core::Portable::TypedObject
{
public:
    // enums

    enum Direction;
    enum Modes;

    // methods

    virtual DECLARE_CORE_CLASS('Grph', Graphics, TypedObject) = 0;
    virtual bool setClip(RectRef rect) = 0;
    virtual int setMode(int mode) = 0;
    virtual bool fillRect(RectRef rect, ColorRef color) = 0;
    virtual bool drawRect(RectRef rect, ColorRef color) = 0;

    virtual bool drawLinearGradient(
        PointRef startPoint,
        PointRef endPoint,
        ColorRef startColor,
        ColorRef endColor,
        Direction direction
    ) = 0;

    virtual bool drawLine(PointRef p1, PointRef p2, ColorRef color) = 0;

    virtual bool drawString(
        RectRef rect,
        CStringPtr text,
        ColorRef color,
        CStringPtr fontName = nullptr,
        int alignment = Alignment::kLeftCenter
    ) = 0;

    virtual bool drawMultiLineString(
        RectRef rect,
        CStringPtr text,
        ColorRef color,
        CStringPtr fontName = nullptr,
        int alignment = Alignment::kLeftCenter
    ) = 0;

    virtual int getStringWidth(CStringPtr text, CStringPtr fontName = nullptr) const = 0;

    virtual bool drawBitmap(
        PointRef pos,
        Bitmap& bitmap,
        RectRef srcRect,
        const BitmapMode* mode = nullptr
    ) = 0;

    virtual const BitmapFont* getFont(CStringPtr fontName) const = 0;
    bool drawBitmap(PointRef pos, Bitmap& bitmap, const BitmapMode* mode = nullptr);
};

// direct descendants

class GraphicsRenderer;

Inherited Members

public:
    // typedefs

    typedef int32 TypeID;

    // methods

    virtual void* castTo(TypeID typeId) = 0;
    virtual void* castTo(TypeID typeId);