WPGSVGGenerator.h

Go to the documentation of this file.
00001 /* libwpg
00002  * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
00003  * Copyright (C) 2005 Fridrich Strba (fridrich.strba@bluewin.ch)
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the
00017  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA  02111-1301 USA
00019  *
00020  * For further information visit http://libwpg.sourceforge.net
00021  */
00022 
00023 /* "This product is not manufactured, approved, or supported by
00024  * Corel Corporation or Corel Corporation Limited."
00025  */
00026 
00027 #ifndef __WPGSVGGENERATOR_H__
00028 #define __WPGSVGGENERATOR_H__
00029 
00030 #include <stdio.h>
00031 #include <iostream>
00032 #include "libwpg.h"
00033 
00034 namespace libwpg
00035 {
00036 
00037 class WPGSVGGenerator : public WPGPaintInterface {
00038 public:
00039         WPGSVGGenerator(std::ostream & output_sink);
00040         ~WPGSVGGenerator();
00041 
00042         void startGraphics(double imageWidth, double imageHeight);
00043         void endGraphics();
00044         void startLayer(unsigned int id);
00045         void endLayer(unsigned int id);
00046 
00047         void setPen(const libwpg::WPGPen& pen);
00048         void setBrush(const libwpg::WPGBrush& brush);
00049         void setFillRule(FillRule rule);
00050 
00051         void drawRectangle(const libwpg::WPGRect& rect, double rx, double ry);
00052         void drawEllipse(const libwpg::WPGPoint& center, double rx, double ry);
00053         void drawPolygon(const libwpg::WPGPointArray& vertices);
00054         void drawPath(const libwpg::WPGPath& path);
00055         void drawBitmap(const libwpg::WPGBitmap& bitmap);
00056         void drawImageObject(const libwpg::WPGBinaryData& binaryData);
00057 
00058 private:
00059         libwpg::WPGPen m_pen;
00060         libwpg::WPGBrush m_brush;
00061         FillRule m_fillRule;
00062         int m_gradientIndex;
00063         void writeStyle();
00064 
00065         std::ostream & m_outputSink;
00066 };
00067 
00068 } // namespace libwpg
00069 
00070 #endif // __WPGSVGGENERATOR_H__

Generated on Thu Dec 13 16:55:19 2007 for libwpg by doxygen 1.5.4