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 <locale>
00033 #include "libwpg.h"
00034 #include "WPGStreamImplementation.h"
00035 
00036 namespace libwpg
00037 {
00038 
00039 class WPGSVGGenerator : public WPGPaintInterface {
00040 public:
00041         WPGSVGGenerator(std::ostream & output_sink);
00042         ~WPGSVGGenerator();
00043 
00044         void startDocument(double imageWidth, double imageHeight);
00045         void endDocument();
00046         void startLayer(unsigned int id);
00047         void endLayer(unsigned int id);
00048 
00049         void setPen(const libwpg::WPGPen& pen);
00050         void setBrush(const libwpg::WPGBrush& brush);
00051         void setFillRule(FillRule rule);
00052 
00053         void drawRectangle(const libwpg::WPGRect& rect, double rx, double ry);
00054         void drawEllipse(const libwpg::WPGPoint& center, double rx, double ry);
00055         void drawPolygon(const libwpg::WPGPointArray& vertices);
00056         void drawPath(const libwpg::WPGPath& path);
00057         void drawBitmap(const libwpg::WPGBitmap& bitmap);
00058 
00059 private:
00060         libwpg::WPGPen m_pen;
00061         libwpg::WPGBrush m_brush;
00062         FillRule m_fillRule;
00063         int m_gradientIndex;
00064         void writeStyle();
00065 
00066         std::ostream & m_outputSink;
00067         std::locale m_oldLocale;
00068 };
00069 
00070 } // namespace libwpg
00071 
00072 #endif // __WPGSVGGENERATOR_H__

Generated on Mon Aug 6 10:06:04 2007 for libwpg by doxygen 1.5.3