28 #ifndef __WPG2PARSER_H__ 29 #define __WPG2PARSER_H__ 34 #include <libwpd/libwpd.h> 48 element[0][0] = element[1][1] = 1;
50 element[0][1] = element[0][2] = 0;
51 element[1][0] = element[1][2] = 0;
52 element[2][0] = element[2][1] = 0;
57 long rx = (long)(element[0][0]*x + element[1][0]*y + element[2][0]);
58 long ry = (long)(element[0][1]*x + element[1][1]*y + element[2][1]);
65 ::WPXPropertyList propList;
66 propList.insert(
"svg:x", (element[0][0]*p[
"svg:x"]->getDouble() + element[1][0]*p[
"svg:y"]->getDouble() + element[2][0]));
67 propList.insert(
"svg:y", (element[0][1]*p[
"svg:x"]->getDouble() + element[1][1]*p[
"svg:y"]->getDouble() + element[2][1]));
73 ::WPXPropertyList propList;
74 double oldx1 = r[
"svg:x"]->getDouble();
75 double oldy1 = r[
"svg:y"]->getDouble();
76 double oldx2 = r[
"svg:x"]->getDouble() + r[
"svg:width"]->getDouble();
77 double oldy2 = r[
"svg:y"]->getDouble() + r[
"svg:height"]->getDouble();
79 double newx1 = element[0][0]*oldx1 + element[1][0]*oldy1 + element[2][0];
80 double newy1 = element[0][1]*oldx1 + element[1][1]*oldy1 + element[2][1];
81 double newx2 = element[0][0]*oldx2 + element[1][0]*oldy2 + element[2][0];
82 double newy2 = element[0][1]*oldx2 + element[1][1]*oldy2 + element[2][1];
84 propList.insert(
"svg:x", (
double)newx1);
85 propList.insert(
"svg:y", (
double)newy1);
86 propList.insert(
"svg:width", (newx2-newx1));
87 propList.insert(
"svg:height", (newy2-newy1));
95 for(
int i = 0; i < 3; i++)
96 for(
int j = 0; j < 3; j++)
99 for(
int k = 0; k < 3; k++)
100 result[i][j] += m.
element[i][k]*element[k][j];
103 for(
int x = 0; x < 3; x++)
104 for(
int y = 0; y < 3; y++)
105 element[x][y] = result[x][y];
135 compoundPath(), compoundMatrix(), compoundWindingRule(false),
136 compoundFilled(false), compoundFramed(true), compoundClosed(false) {}
140 return parentType == 0x1a;
147 double x1, y1, x2,
y2;
155 double x1, y1, x2,
y2;
164 double x1, y1, x2,
y2;
169 WPGTextDataContext(): x1(0), y1(0), x2(0), y2(0), flags(), vertAlign(), horAlign(), baseLineAngle(0.0) {}
179 void handleStartWPG();
181 void handleFormSettings();
183 void handleCompoundPolygon();
185 void handlePenStyleDefinition();
187 void handleColorPalette();
188 void handleDPColorPalette();
189 void handlePenForeColor();
190 void handleDPPenForeColor();
191 void handlePenBackColor();
192 void handleDPPenBackColor();
193 void handlePenStyle();
194 void handlePenSize();
195 void handleDPPenSize();
196 void handleLineCap();
197 void handleLineJoin();
198 void handleBrushGradient();
199 void handleDPBrushGradient();
200 void handleBrushForeColor();
201 void handleDPBrushForeColor();
202 void handleBrushBackColor();
203 void handleDPBrushBackColor();
204 void handleBrushPattern();
206 void handlePolyline();
207 void handlePolyspline();
208 void handlePolycurve();
209 void handleRectangle();
213 void handleBitmapData();
215 void handleTextData();
216 void handleTextLine();
217 void handleTextBlock();
218 void handleTextPath();
220 void handleObjectCapsule();
221 void handleObjectImage();
224 void flushCompoundPolygon();
250 unsigned int m_layerId;
274 #endif // __WPG2PARSER_H__ libwpg::WPGColor m_brushForeColor
Definition: WPG2Parser.h:243
libwpg::WPGDashArray m_dashArray
Definition: WPG2Parser.h:245
Definition: WPG2Parser.cpp:167
libwpg::WPGColor m_brushBackColor
Definition: WPG2Parser.h:244
long vres
Definition: WPG2Parser.h:148
libwpg::WPGColor m_penForeColor
Definition: WPG2Parser.h:241
int objectIndex
Definition: WPG2Parser.h:156
Definition: WPG2Parser.h:152
Definition: WPG2Parser.h:161
int m_recordLength
Definition: WPG2Parser.h:228
Definition: WPGDashArray.h:34
std::map< unsigned int, libwpg::WPGDashArray > m_dashArrayStyles
Definition: WPG2Parser.h:247
unsigned int m_yres
Definition: WPG2Parser.h:234
unsigned char horAlign
Definition: WPG2Parser.h:167
Definition: WPGColor.h:34
WPGBinaryDataContext()
Definition: WPG2Parser.h:158
bool compoundClosed
Definition: WPG2Parser.h:132
bool m_compoundFilled
Definition: WPG2Parser.h:258
std::stack< WPGGroupContext > m_groupStack
Definition: WPG2Parser.h:255
bool isFilled
Definition: WPG2Parser.h:115
bool isFramed
Definition: WPG2Parser.h:116
bool m_doublePrecision
Definition: WPG2Parser.h:239
WPGBitmapContext()
Definition: WPG2Parser.h:149
bool m_drawTextData
Definition: WPG2Parser.h:265
bool m_exit
Definition: WPG2Parser.h:231
unsigned short flags
Definition: WPG2Parser.h:165
bool m_layerOpened
Definition: WPG2Parser.h:248
Definition: WPGPaintInterface.h:35
bool isCompoundPolygon() const
Definition: WPG2Parser.h:138
WPG2TransformMatrix m_matrix
Definition: WPG2Parser.h:252
double y2
Definition: WPG2Parser.h:155
Definition: WPG2Parser.h:122
long m_yofs
Definition: WPG2Parser.h:236
std::vector< WPXString > mimeTypes
Definition: WPG2Parser.h:157
bool m_success
Definition: WPG2Parser.h:230
WPGTextDataContext m_textData
Definition: WPG2Parser.h:264
WPG2TransformMatrix m_compoundMatrix
Definition: WPG2Parser.h:256
bool m_compoundClosed
Definition: WPG2Parser.h:260
libwpg::WPGColor m_penBackColor
Definition: WPG2Parser.h:242
::WPXPropertyList m_style
Definition: WPG2Parser.h:240
WPG2TransformMatrix compoundMatrix
Definition: WPG2Parser.h:128
long m_width
Definition: WPG2Parser.h:237
WPG2TransformMatrix matrix
Definition: WPG2Parser.h:114
double y2
Definition: WPG2Parser.h:147
bool compoundWindingRule
Definition: WPG2Parser.h:129
::WPXPropertyListVector compoundPath
Definition: WPG2Parser.h:127
double m_gradientAngle
Definition: WPG2Parser.h:253
Definition: WPG2Parser.h:172
Definition: WPG2Parser.h:111
unsigned subIndex
Definition: WPG2Parser.h:125
double y2
Definition: WPG2Parser.h:164
bool m_graphicsStarted
Definition: WPG2Parser.h:232
bool m_compoundWindingRule
Definition: WPG2Parser.h:257
long m_recordEnd
Definition: WPG2Parser.h:229
bool isClosed
Definition: WPG2Parser.h:117
unsigned int m_xres
Definition: WPG2Parser.h:233
WPGCompoundPolygon()
Definition: WPG2Parser.h:119
::WPXPropertyListVector m_gradient
Definition: WPG2Parser.h:246
bool m_compoundFramed
Definition: WPG2Parser.h:259
int parentType
Definition: WPG2Parser.h:126
Definition: WPGXParser.h:38
bool compoundFramed
Definition: WPG2Parser.h:131
long m_xofs
Definition: WPG2Parser.h:235
WPGTextDataContext()
Definition: WPG2Parser.h:169
double baseLineAngle
Definition: WPG2Parser.h:168
long m_height
Definition: WPG2Parser.h:238
::WPXPropertyList m_gradientRef
Definition: WPG2Parser.h:254
Definition: WPG2Parser.h:144
WPGBinaryDataContext m_binaryData
Definition: WPG2Parser.h:262
unsigned char vertAlign
Definition: WPG2Parser.h:166
bool compoundFilled
Definition: WPG2Parser.h:130
WPGBitmapContext m_bitmap
Definition: WPG2Parser.h:261
bool m_vFlipped
Definition: WPG2Parser.h:263
WPGGroupContext()
Definition: WPG2Parser.h:134