ionflux.org | Impressum

CairoCanvas.hpp

Go to the documentation of this file.
00001 #ifndef IONFLUX_TOOLS_CAIROCANVAS
00002 #define IONFLUX_TOOLS_CAIROCANVAS
00003 /* ==========================================================================
00004  * Ionflux Tools
00005  * Copyright (c) 2005 Joern P. Meier
00006  * mail@ionflux.org
00007  * --------------------------------------------------------------------------
00008  * CairoCanvas.hpp                   Cairo drawing canvas.
00009  * ==========================================================================
00010  * 
00011  * This file is part of Ionflux Tools.
00012  * 
00013  * Ionflux Tools is free software; you can redistribute it and/or modify it
00014  * under the terms of the GNU General Public License as published by the 
00015  * Free Software Foundation; either version 2 of the License, or (at your 
00016  * option) any later version.
00017  * 
00018  * Ionflux Tools is distributed in the hope that it will be useful, but 
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of 
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00021  * General Public License for more details.
00022  * 
00023  * You should have received a copy of the GNU General Public License along 
00024  * with Ionflux Tools; if not, write to the Free Software Foundation, Inc.,
00025  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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

Generated on Tue Mar 14 20:58:29 2006 for Ionflux Tools Class Library (iftools) by  doxygen 1.4.6