00001 #ifndef IONFLUX_TOOLS_CAIROCANVAS
00002 #define IONFLUX_TOOLS_CAIROCANVAS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "ionflux/CairoContext.hpp"
00030 #include "ionflux/Canvas.hpp"
00031
00032 namespace Ionflux
00033 {
00034
00035 namespace Tools
00036 {
00037
00043 class CairoCanvas
00044 : public Ionflux::Tools::Cairo::CairoContext, public Canvas
00045 {
00046 private:
00047
00048 protected:
00049
00056 virtual void setTransform(Matrix3* transform = 0);
00057
00058 public:
00063 CairoCanvas();
00064
00071 CairoCanvas(const Ionflux::Tools::Cairo::CairoContext& initCairoContext);
00072
00079 CairoCanvas(cairo_t* initCairoContext);
00080
00087 CairoCanvas(cairo_surface_t* initSurface);
00088
00095 CairoCanvas(Ionflux::Tools::Cairo::Surface& initSurface);
00096
00103 CairoCanvas(const CairoCanvas& initCairoCanvas);
00104
00109 virtual ~CairoCanvas();
00110
00123 virtual void drawLine(double x1, double y1, double x2, double y2, double
00124 width = 0.0, const Color* color = 0, Matrix3* transform = 0);
00125
00139 virtual void drawRectangle(double x, double y, double width, double
00140 height, double strokeWidth = 0.0, const Color* strokeColor = 0, const
00141 Color* fillColor = 0, Matrix3* transform = 0);
00142
00158 virtual void drawArc(double x, double y, double width, double height,
00159 double angle1, double angle2, double strokeWidth = 0.0, const Color*
00160 strokeColor = 0, const Color* fillColor = 0, Matrix3* transform = 0);
00161
00177 virtual void drawArcEc(double xc, double yc, double radius, double
00178 angle1, double angle2, double eccentricity = 0.0, double strokeWidth =
00179 0.0, const Color* strokeColor = 0, const Color* fillColor = 0, Matrix3*
00180 transform = 0);
00181
00195 virtual void drawEllipse(double x, double y, double width, double height,
00196 double strokeWidth = 0.0, const Color* strokeColor = 0, const Color*
00197 fillColor = 0, Matrix3* transform = 0);
00198
00212 virtual void drawEllipseEc(double xc, double yc, double radius, double
00213 eccentricity = 0.0, double strokeWidth = 0.0, const Color* strokeColor =
00214 0, const Color* fillColor = 0, Matrix3* transform = 0);
00215
00228 virtual void drawCircle(double xc, double yc, double radius, double
00229 strokeWidth = 0.0, const Color* strokeColor = 0, const Color* fillColor =
00230 0, Matrix3* transform = 0);
00231
00246 virtual void drawCurve(double x1, double y1, double x2, double y2, double
00247 x3, double y3, double strokeWidth = 0.0, const Color* color = 0, Matrix3*
00248 transform = 0);
00249
00262 virtual void drawText(double x, double y, const std::string& text, const
00263 std::string& fontDesc = "", double fontSize = 0.0, const Color* color =
00264 0, Matrix3* transform = 0);
00265
00277 virtual void getTextSize(const std::string& text, double& width, double&
00278 height, const std::string& fontDesc = "", double fontSize = 0.0, Matrix3*
00279 transform = 0);
00280
00289 virtual CairoCanvas& operator=(const
00290 Ionflux::Tools::Cairo::CairoContext& newCairoContext);
00291
00300 virtual CairoCanvas& operator=(cairo_t* newCairoContext);
00301
00310 virtual CairoCanvas& operator=(const CairoCanvas& newCairoCanvas);
00311 };
00312
00313 }
00314
00315 }
00316
00320 #endif