Main Page
Namespaces
Classes
Files
File List
File Members
VSDXTypes.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* libvisio
3
* Version: MPL 1.1 / GPLv2+ / LGPLv2+
4
*
5
* The contents of this file are subject to the Mozilla Public License Version
6
* 1.1 (the "License"); you may not use this file except in compliance with
7
* the License or as specified alternatively below. You may obtain a copy of
8
* the License at http://www.mozilla.org/MPL/
9
*
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
13
* License.
14
*
15
* Major Contributor(s):
16
* Copyright (C) 2011 Fridrich Strba <fridrich.strba@bluewin.ch>
17
* Copyright (C) 2011 Eilidh McAdam <tibbylickle@gmail.com>
18
*
19
*
20
* All Rights Reserved.
21
*
22
* For minor contributions see the git repository.
23
*
24
* Alternatively, the contents of this file may be used under the terms of
25
* either the GNU General Public License Version 2 or later (the "GPLv2+"), or
26
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
27
* in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
28
* instead of those above.
29
*/
30
31
#ifndef VSDXTYPES_H
32
#define VSDXTYPES_H
33
34
#include <libwpd/libwpd.h>
35
36
namespace
libvisio
37
{
38
struct
XForm
39
{
40
double
pinX
;
41
double
pinY
;
42
double
height
;
43
double
width
;
44
double
pinLocX
;
45
double
pinLocY
;
46
double
angle
;
47
bool
flipX
;
48
bool
flipY
;
49
double
x
;
50
double
y
;
51
XForm
() :
pinX
(0.0),
pinY
(0.0),
height
(0.0),
width
(0.0),
52
pinLocX
(0.0),
pinLocY
(0.0),
angle
(0.0),
53
flipX
(false),
flipY
(false),
x
(0.0),
y
(0.0) {}
54
};
55
56
// Utilities
57
struct
ChunkHeader
58
{
59
unsigned
chunkType
;
// 4 bytes
60
unsigned
id
;
// 4 bytes
61
unsigned
list
;
// 4 bytes
62
unsigned
dataLength
;
// 4 bytes
63
unsigned
short
level
;
// 2 bytes
64
unsigned
char
unknown
;
// 1 byte
65
unsigned
trailer
;
// Derived
66
};
67
68
struct
Colour
69
{
70
Colour
(
unsigned
red,
unsigned
char
green,
unsigned
char
blue,
unsigned
char
alpha)
71
:
r
(red),
g
(green),
b
(blue),
a
(alpha) {}
72
Colour
() :
r
(0),
g
(0),
b
(0),
a
(0) {}
73
unsigned
char
r
;
74
unsigned
char
g
;
75
unsigned
char
b
;
76
unsigned
char
a
;
77
};
78
79
struct
NURBSData
80
{
81
double
lastKnot
;
82
unsigned
degree
;
83
unsigned
char
xType
;
84
unsigned
char
yType
;
85
std::vector<double>
knots
;
86
std::vector<double>
weights
;
87
std::vector<std::pair<double, double> >
points
;
88
NURBSData
()
89
:
lastKnot
(0.0),
90
degree
(0),
91
xType
(0x00),
92
yType
(0x00),
93
knots
(),
94
weights
(),
95
points
() {}
96
NURBSData
(
const
NURBSData
&data)
97
:
lastKnot
(data.
lastKnot
),
98
degree
(data.
degree
),
99
xType
(data.
xType
),
100
yType
(data.
yType
),
101
knots
(data.
knots
),
102
weights
(data.
weights
),
103
points
(data.
points
) {}
104
NURBSData
&
operator=
(
const
NURBSData
&data)
105
{
106
lastKnot
= data.
lastKnot
;
107
degree
= data.
degree
;
108
xType
= data.
xType
;
109
yType
= data.
yType
;
110
knots
= data.
knots
;
111
weights
= data.
weights
;
112
points
= data.
points
;
113
return
*
this
;
114
}
115
};
116
117
struct
PolylineData
118
{
119
unsigned
char
xType
;
120
unsigned
char
yType
;
121
std::vector<std::pair<double, double> >
points
;
122
PolylineData
()
123
:
xType
(0x00),
124
yType
(0x00),
125
points
() {}
126
PolylineData
(
const
PolylineData
&data)
127
:
xType
(data.
xType
),
128
yType
(data.
yType
),
129
points
(data.
points
) {}
130
PolylineData
&
operator=
(
const
PolylineData
&data)
131
{
132
xType
= data.
xType
;
133
yType
= data.
yType
;
134
points
= data.
points
;
135
return
*
this
;
136
}
137
};
138
139
140
struct
ForeignData
141
{
142
unsigned
typeId
;
143
unsigned
dataId
;
144
unsigned
typeLevel
;
145
unsigned
dataLevel
;
146
unsigned
type
;
147
unsigned
format
;
148
double
offsetX
;
149
double
offsetY
;
150
double
width
;
151
double
height
;
152
WPXBinaryData
data
;
153
ForeignData
()
154
:
typeId
(0),
155
dataId
(0),
156
typeLevel
(0),
157
dataLevel
(0),
158
type
(0),
159
format
(0),
160
offsetX
(0.0),
161
offsetY
(0.0),
162
width
(0.0),
163
height
(0.0),
164
data
() {}
165
ForeignData
(
const
ForeignData
&fd)
166
:
typeId
(fd.
typeId
),
167
dataId
(fd.
dataId
),
168
typeLevel
(fd.
typeLevel
),
169
dataLevel
(fd.
dataLevel
),
170
type
(fd.
type
),
171
format
(fd.
format
),
172
offsetX
(fd.
offsetX
),
173
offsetY
(fd.
offsetY
),
174
width
(fd.
width
),
175
height
(fd.
height
),
176
data
(fd.
data
) {}
177
};
178
179
enum
TextFormat
180
{
181
VSD_TEXT_ANSI
= 0,
182
VSD_TEXT_GREEK
,
183
VSD_TEXT_TURKISH
,
184
VSD_TEXT_VIETNAMESE
,
185
VSD_TEXT_HEBREW
,
186
VSD_TEXT_ARABIC
,
187
VSD_TEXT_BALTIC
,
188
VSD_TEXT_RUSSIAN
,
189
VSD_TEXT_THAI
,
190
VSD_TEXT_CENTRAL_EUROPE
,
191
VSD_TEXT_UTF16
192
};
193
194
class
VSDXName
195
{
196
public
:
197
VSDXName
(
const
WPXBinaryData &data,
TextFormat
format)
198
:
m_data
(data),
199
m_format
(format) {}
200
VSDXName
() :
m_data
(),
m_format
(
VSD_TEXT_ANSI
) {}
201
VSDXName
(
const
VSDXName
&element)
202
:
m_data
(element.
m_data
),
203
m_format
(element.
m_format
) {}
204
VSDXName
&
operator=
(
const
VSDXName
&element)
205
{
206
m_data
= element.
m_data
;
207
m_format
= element.
m_format
;
208
return
*
this
;
209
}
210
WPXBinaryData
m_data
;
211
TextFormat
m_format
;
212
};
213
214
struct
VSDXFont
215
{
216
WPXString
name
;
217
TextFormat
encoding
;
218
VSDXFont
() :
name
(
"Arial"
),
encoding
(libvisio::
VSD_TEXT_ANSI
) {}
219
};
220
221
}
// namespace libvisio
222
223
#endif
/* VSDXTYPES_H */
224
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Generated for libvisio by
doxygen
1.8.1