- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

WPG1Parser.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwpg
3 * Version: MPL 2.0 / LGPLv2.1+
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * Major Contributor(s):
10 * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
11 * Copyright (C) 2005 Fridrich Strba (fridrich.strba@bluewin.ch)
12 * Copyright (C) 2004 Marc Oude Kotte (marc@solcon.nl)
13 *
14 * For minor contributions see the git repository.
15 *
16 * Alternatively, the contents of this file may be used under the terms
17 * of the GNU Lesser General Public License Version 2.1 or later
18 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19 * applicable instead of those above.
20 *
21 * For further information visit http://libwpg.sourceforge.net
22 */
23
24 /* "This product is not manufactured, approved, or supported by
25 * Corel Corporation or Corel Corporation Limited."
26 */
27
28 #ifndef __WPG1PARSER_H__
29 #define __WPG1PARSER_H__
30
31 #include "WPGXParser.h"
32 #include "WPGDashArray.h"
33 #include "WPGBitmap.h"
34 #include <librevenge/librevenge.h>
35 #include <vector>
36
37 class WPG1Parser : public WPGXParser
38 {
39 public:
40 WPG1Parser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter);
41 bool parse();
42
43 private:
44 void handleStartWPG();
45 void handleEndWPG();
46
47 void handleFillAttributes();
48 void handleLineAttributes();
49 void handleColormap();
50
51 void handleLine();
52 void handlePolyline();
53 void handleRectangle();
54 void handlePolygon();
55 void handleEllipse();
56
57 void handleCurvedPolyline();
58
59 void decodeRLE(std::vector<unsigned char> &buffer, unsigned width, unsigned height, unsigned depth);
60 void fillPixels(libwpg::WPGBitmap &bitmap, const unsigned char *buffer, unsigned width, unsigned height, unsigned depth);
61 void handleBitmapTypeOne();
62 void handleBitmapTypeTwo();
63 void handlePostscriptTypeOne();
64 void handlePostscriptTypeTwo();
65
66 void handleGraphicsTextAttributes();
67 void handleGraphicsTextTypeOne();
68 void handleGraphicsTextTypeTwo();
69 void handleGraphicsTextTypeThree();
70
71 void resetPalette();
72
73 // parsing context
74 int m_recordLength;
75 long m_recordEnd;
76 bool m_success;
77 bool m_exit;
78 bool m_graphicsStarted;
79 int m_width;
80 int m_height;
81 ::librevenge::RVNGPropertyList m_style;
82 libwpg::WPGColor m_penForeColor;
83 libwpg::WPGColor m_penBackColor;
84 libwpg::WPGColor m_brushForeColor;
85 libwpg::WPGColor m_brushBackColor;
86 libwpg::WPGDashArray m_dashArray;
87 ::librevenge::RVNGPropertyListVector m_gradient;
88 };
89
90 #endif // __WPG1PARSER_H__
91 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPG1Parser::handleEllipse
void handleEllipse()
Definition: WPG1Parser.cpp:494
WPG1Parser::handleStartWPG
void handleStartWPG()
Definition: WPG1Parser.cpp:274
WPGBitmap.h
WPG1Parser::m_exit
bool m_exit
Definition: WPG1Parser.h:77
WPG1Parser::handleBitmapTypeTwo
void handleBitmapTypeTwo()
Definition: WPG1Parser.cpp:762
WPG1Parser::parse
bool parse()
Definition: WPG1Parser.cpp:160
libwpg::WPGDashArray
Definition: WPGDashArray.h:34
WPG1Parser::handlePostscriptTypeTwo
void handlePostscriptTypeTwo()
Definition: WPG1Parser.cpp:858
libwpg::WPGColor
Definition: WPGColor.h:34
WPG1Parser::m_penForeColor
libwpg::WPGColor m_penForeColor
Definition: WPG1Parser.h:82
WPG1Parser::m_width
int m_width
Definition: WPG1Parser.h:79
WPG1Parser::decodeRLE
void decodeRLE(std::vector< unsigned char > &buffer, unsigned width, unsigned height, unsigned depth)
Definition: WPG1Parser.cpp:573
WPG1Parser::m_dashArray
libwpg::WPGDashArray m_dashArray
Definition: WPG1Parser.h:86
WPG1Parser::m_brushForeColor
libwpg::WPGColor m_brushForeColor
Definition: WPG1Parser.h:84
WPG1Parser::m_brushBackColor
libwpg::WPGColor m_brushBackColor
Definition: WPG1Parser.h:85
WPGXParser.h
WPG1Parser::handlePolyline
void handlePolyline()
Definition: WPG1Parser.cpp:408
WPG1Parser::handleRectangle
void handleRectangle()
Definition: WPG1Parser.cpp:435
WPG1Parser
Definition: WPG1Parser.h:37
WPG1Parser::m_recordEnd
long m_recordEnd
Definition: WPG1Parser.h:75
WPG1Parser::m_height
int m_height
Definition: WPG1Parser.h:80
WPG1Parser::handleLineAttributes
void handleLineAttributes()
Definition: WPG1Parser.cpp:348
WPG1Parser::m_style
::librevenge::RVNGPropertyList m_style
Definition: WPG1Parser.h:81
WPG1Parser::handleColormap
void handleColormap()
Definition: WPG1Parser.cpp:306
WPG1Parser::handleBitmapTypeOne
void handleBitmapTypeOne()
Definition: WPG1Parser.cpp:710
WPG1Parser::m_graphicsStarted
bool m_graphicsStarted
Definition: WPG1Parser.h:78
WPG1Parser::handleLine
void handleLine()
Definition: WPG1Parser.cpp:375
WPG1Parser::handlePolygon
void handlePolygon()
Definition: WPG1Parser.cpp:464
WPG1Parser::handleCurvedPolyline
void handleCurvedPolyline()
Definition: WPG1Parser.cpp:524
WPG1Parser::handleGraphicsTextTypeOne
void handleGraphicsTextTypeOne()
Definition: WPG1Parser.cpp:918
WPG1Parser::handleFillAttributes
void handleFillAttributes()
Definition: WPG1Parser.cpp:327
WPG1Parser::m_gradient
::librevenge::RVNGPropertyListVector m_gradient
Definition: WPG1Parser.h:87
WPG1Parser::handleEndWPG
void handleEndWPG()
Definition: WPG1Parser.cpp:295
WPG1Parser::WPG1Parser
WPG1Parser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
Definition: WPG1Parser.cpp:142
WPG1Parser::m_penBackColor
libwpg::WPGColor m_penBackColor
Definition: WPG1Parser.h:83
WPG1Parser::resetPalette
void resetPalette()
Definition: WPG1Parser.cpp:983
WPGXParser
Definition: WPGXParser.h:38
WPG1Parser::fillPixels
void fillPixels(libwpg::WPGBitmap &bitmap, const unsigned char *buffer, unsigned width, unsigned height, unsigned depth)
Definition: WPG1Parser.cpp:639
WPG1Parser::m_success
bool m_success
Definition: WPG1Parser.h:76
WPG1Parser::handlePostscriptTypeOne
void handlePostscriptTypeOne()
Definition: WPG1Parser.cpp:830
WPG1Parser::m_recordLength
int m_recordLength
Definition: WPG1Parser.h:74
WPGDashArray.h
WPG1Parser::handleGraphicsTextTypeThree
void handleGraphicsTextTypeThree()
WPG1Parser::handleGraphicsTextAttributes
void handleGraphicsTextAttributes()
Definition: WPG1Parser.cpp:912
WPG1Parser::handleGraphicsTextTypeTwo
void handleGraphicsTextTypeTwo()
Definition: WPG1Parser.cpp:948
libwpg::WPGBitmap
Definition: WPGBitmap.h:36