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
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;
89  : lastKnot(0.0),
90  degree(0),
91  xType(0x00),
92  yType(0x00),
93  knots(),
94  weights(),
95  points() {}
96 };
97 
99 {
100  unsigned char xType;
101  unsigned char yType;
102  std::vector<std::pair<double, double> > points;
104  : xType(0x00),
105  yType(0x00),
106  points() {}
107 };
108 
109 
111 {
112  unsigned typeId;
113  unsigned dataId;
114  unsigned typeLevel;
115  unsigned dataLevel;
116  unsigned type;
117  unsigned format;
118  double offsetX;
119  double offsetY;
120  double width;
121  double height;
122  WPXBinaryData data;
124  : typeId(0),
125  dataId(0),
126  typeLevel(0),
127  dataLevel(0),
128  type(0),
129  format(0),
130  offsetX(0.0),
131  offsetY(0.0),
132  width(0.0),
133  height(0.0),
134  data() {}
135 };
136 
138 {
150 };
151 
152 class VSDXName
153 {
154 public:
155  VSDXName(const WPXBinaryData &data, TextFormat format)
156  : m_data(data),
157  m_format(format) {}
159  WPXBinaryData m_data;
161 };
162 
163 struct VSDXFont
164 {
165  WPXString name;
167  VSDXFont() : name("Arial"), encoding(libvisio::VSD_TEXT_ANSI) {}
168 };
169 
170 } // namespace libvisio
171 
172 #endif /* VSDXTYPES_H */
173 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */

Generated for libvisio by doxygen 1.8.1.1