-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDefinitions.h
181 lines (160 loc) · 2.09 KB
/
Definitions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#pragma once
#include <string>
#include <vector>
using ST_ID = unsigned int;
using ST_RefID = unsigned int;
struct ST_Loc
{
std::string pln;
std::string abs;
};
using ST_Array = std::string;
using ST_Array_Delta = std::vector<double>;
using ST_Pos = std::string;
struct ST_Box
{
double x;
double y;
double w;
double h;
};
struct CT_Matrix {
double xx;
double yx;
double xy;
double yy;
double x0;
double y0;
};
struct CT_Dest
{
enum TYPE
{
XYZ, FIT, FITH, FITV, FITR
};
TYPE type;
ST_RefID pageID;
double left;
double top;
double right;
double bottom;
double zoom;
};
struct CT_PageArea
{
ST_Box *physicalBox = nullptr;
ST_Box *applicationBox = nullptr;
ST_Box *contentBox = nullptr;
ST_Box *bleedBox = nullptr;
};
struct Bookmark
{
std::string name;
};
struct Goto
{
enum TYPE
{
DEST, BOOKMARK
};
TYPE type;
union
{
CT_Dest *dest = nullptr;
Bookmark *bookmark;
}d;
};
struct Uri
{
std::string uri;
std::string base;
std::string target;
};
struct GotoA
{
std::string AttachID;
bool NewWindow = true;
};
struct Sound
{
ST_RefID resourceID;
int volume;
bool repeat;
bool synchronous;
};
struct Movie
{
enum TYPE
{
PLAY, STOP, PAUSE, RESUME
};
ST_RefID resourceID;
TYPE oper;
};
struct Move
{
ST_Pos point1;
};
struct Line
{
ST_Pos point1;
};
struct QuadraticBezier
{
ST_Pos point1;
ST_Pos point2;
};
struct CubicBezier
{
ST_Pos point1;
ST_Pos point2;
ST_Pos point3;
};
struct _Arc
{
bool sweepDirection;
bool largeArc;
double rotationAngle;
ST_Array ellipseSize;
ST_Pos endPoint;
};
struct Area
{
enum TYPE
{
MOVE, LINE, QUADRATICBEZIER, CUBICBEZIER, ARC, CLOSE
};
union Data
{
Move *move = nullptr;
Line *line;
QuadraticBezier *quadraticBezier;
CubicBezier *cubicBezier;
_Arc *arc;
};
std::vector<std::pair<TYPE, Data*>> d;
ST_Pos start;
};
using CT_Region = std::vector<Area*>;
struct CT_Action
{
enum TYPE
{
GOTO, URI, GOTOA, SOUND, MOVIE
};
enum EVENT
{
DO, PO, CLICK
};
CT_Region region;
TYPE type;
union
{
Goto *_goto = nullptr;
Uri *uri;
GotoA *gotoaA;
Sound *sound;
Movie *movie;
EVENT event;
}d;
};