WPG1Parser.h
Go to the documentation of this file.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* libwpg
* Version: MPL 2.0 / LGPLv2.1+
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Major Contributor(s):
* Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
* Copyright (C) 2005 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2004 Marc Oude Kotte (marc@solcon.nl)
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms
* of the GNU Lesser General Public License Version 2.1 or later
* (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
* applicable instead of those above.
*
* For further information visit http://libwpg.sourceforge.net
*/
/* "This product is not manufactured, approved, or supported by
* Corel Corporation or Corel Corporation Limited."
*/
#ifndef __WPG1PARSER_H__
#define __WPG1PARSER_H__
#include <vector>
#include <boost/optional.hpp>
#include <librevenge/librevenge.h>
#include "WPGBitmap.h"
#include "WPGDashArray.h"
#include "WPGXParser.h"
class WPG1Parser : public WPGXParser
{
public:
WPG1Parser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter);
bool parse() override;
private:
void handleStartWPG();
void handleEndWPG();
void handlePageFormat();
void handleFillAttributes();
void handleLineAttributes();
void handleColormap();
void handleLine();
void handlePolyline();
void handleRectangle();
void handlePolygon();
void handleEllipse();
void handleCurvedPolyline();
void handleGroup();
void closeGroup(bool force = false);
bool decodeRLE(std::vector<unsigned char> &buffer, unsigned width, unsigned height, unsigned depth);
void fillPixels(libwpg::WPGBitmap &bitmap, const unsigned char *buffer, unsigned width, unsigned height, unsigned depth);
void handleBitmapTypeOne();
void handleBitmapTypeTwo();
void handlePostscriptTypeOne();
void handlePostscriptTypeTwo();
void handleGraphicsTextAttributes();
void handleGraphicsTextTypeOne();
void handleGraphicsTextTypeTwo();
void handleGraphicsTextTypeThree();
void resetPalette();
// parsing context
int m_recordLength;
long m_recordEnd;
boost::optional<long> m_groupEnd;
bool m_success;
bool m_exit;
bool m_graphicsStarted;
int m_width;
int m_height;
librevenge::RVNGPropertyList m_style;
libwpg::WPGColor m_penForeColor;
libwpg::WPGColor m_penBackColor;
libwpg::WPGColor m_brushForeColor;
libwpg::WPGColor m_brushBackColor;
libwpg::WPGDashArray m_dashArray;
librevenge::RVNGPropertyListVector m_gradient;
libwpg::WPGColor m_fontColor;
unsigned m_fontSize;
unsigned m_avgCharWidth;
unsigned char m_textAlign;
};
#endif // __WPG1PARSER_H__
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPGBitmap.h
WPGDashArray.h
WPGXParser.h
WPG1Parser::handleStartWPG
void handleStartWPG()
Definition WPG1Parser.cpp:301
WPG1Parser::m_dashArray
libwpg::WPGDashArray m_dashArray
Definition WPG1Parser.h:95
WPG1Parser::handleEllipse
void handleEllipse()
Definition WPG1Parser.cpp:644
WPG1Parser::m_avgCharWidth
unsigned m_avgCharWidth
Definition WPG1Parser.h:99
WPG1Parser::handleLine
void handleLine()
Definition WPG1Parser.cpp:521
WPG1Parser::WPG1Parser
WPG1Parser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
Definition WPG1Parser.cpp:152
WPG1Parser::handlePostscriptTypeOne
void handlePostscriptTypeOne()
Definition WPG1Parser.cpp:1020
WPG1Parser::handleEndWPG
void handleEndWPG()
Definition WPG1Parser.cpp:322
WPG1Parser::resetPalette
void resetPalette()
Definition WPG1Parser.cpp:1251
WPG1Parser::handleRectangle
void handleRectangle()
Definition WPG1Parser.cpp:583
WPG1Parser::m_width
int m_width
Definition WPG1Parser.h:88
WPG1Parser::m_penBackColor
libwpg::WPGColor m_penBackColor
Definition WPG1Parser.h:92
WPG1Parser::m_style
librevenge::RVNGPropertyList m_style
Definition WPG1Parser.h:90
WPG1Parser::handleCurvedPolyline
void handleCurvedPolyline()
Definition WPG1Parser.cpp:674
WPG1Parser::fillPixels
void fillPixels(libwpg::WPGBitmap &bitmap, const unsigned char *buffer, unsigned width, unsigned height, unsigned depth)
Definition WPG1Parser.cpp:831
WPG1Parser::m_fontSize
unsigned m_fontSize
Definition WPG1Parser.h:98
WPG1Parser::m_success
bool m_success
Definition WPG1Parser.h:85
WPG1Parser::m_gradient
librevenge::RVNGPropertyListVector m_gradient
Definition WPG1Parser.h:96
WPG1Parser::handleGraphicsTextTypeTwo
void handleGraphicsTextTypeTwo()
Definition WPG1Parser.cpp:1200
WPG1Parser::handlePostscriptTypeTwo
void handlePostscriptTypeTwo()
Definition WPG1Parser.cpp:1048
WPG1Parser::m_textAlign
unsigned char m_textAlign
Definition WPG1Parser.h:100
WPG1Parser::m_groupEnd
boost::optional< long > m_groupEnd
Definition WPG1Parser.h:84
WPG1Parser::m_exit
bool m_exit
Definition WPG1Parser.h:86
WPG1Parser::m_brushForeColor
libwpg::WPGColor m_brushForeColor
Definition WPG1Parser.h:93
WPG1Parser::handleGraphicsTextAttributes
void handleGraphicsTextAttributes()
Definition WPG1Parser.cpp:1102
WPG1Parser::m_fontColor
libwpg::WPGColor m_fontColor
Definition WPG1Parser.h:97
WPG1Parser::handleFillAttributes
void handleFillAttributes()
Definition WPG1Parser.cpp:412
WPG1Parser::parse
bool parse() override
Definition WPG1Parser.cpp:175
WPG1Parser::handlePolygon
void handlePolygon()
Definition WPG1Parser.cpp:612
WPG1Parser::handlePolyline
void handlePolyline()
Definition WPG1Parser.cpp:554
WPG1Parser::handleGraphicsTextTypeOne
void handleGraphicsTextTypeOne()
Definition WPG1Parser.cpp:1133
WPG1Parser::handleBitmapTypeTwo
void handleBitmapTypeTwo()
Definition WPG1Parser.cpp:953
WPG1Parser::m_recordEnd
long m_recordEnd
Definition WPG1Parser.h:83
WPG1Parser::m_penForeColor
libwpg::WPGColor m_penForeColor
Definition WPG1Parser.h:91
WPG1Parser::handleBitmapTypeOne
void handleBitmapTypeOne()
Definition WPG1Parser.cpp:902
WPG1Parser::closeGroup
void closeGroup(bool force=false)
Definition WPG1Parser.cpp:742
WPG1Parser::handleLineAttributes
void handleLineAttributes()
Definition WPG1Parser.cpp:476
WPG1Parser::handleColormap
void handleColormap()
Definition WPG1Parser.cpp:391
WPG1Parser::handleGroup
void handleGroup()
Definition WPG1Parser.cpp:725
WPG1Parser::handleGraphicsTextTypeThree
void handleGraphicsTextTypeThree()
WPG1Parser::handlePageFormat
void handlePageFormat()
Definition WPG1Parser.cpp:335
WPG1Parser::decodeRLE
bool decodeRLE(std::vector< unsigned char > &buffer, unsigned width, unsigned height, unsigned depth)
Definition WPG1Parser.cpp:756
WPG1Parser::m_recordLength
int m_recordLength
Definition WPG1Parser.h:82
WPG1Parser::m_brushBackColor
libwpg::WPGColor m_brushBackColor
Definition WPG1Parser.h:94
WPG1Parser::m_graphicsStarted
bool m_graphicsStarted
Definition WPG1Parser.h:87
WPG1Parser::m_height
int m_height
Definition WPG1Parser.h:89
WPGXParser::WPGXParser
WPGXParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
Definition WPGXParser.cpp:30
libwpg::WPGBitmap
Definition WPGBitmap.h:40
libwpg::WPGColor
Definition WPGColor.h:35
libwpg::WPGDashArray
Definition WPGDashArray.h:37