-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsheets.lua
More file actions
197 lines (175 loc) · 4.61 KB
/
sheets.lua
File metadata and controls
197 lines (175 loc) · 4.61 KB
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
-- @defineifndef SHEETS_LOWRES true
-- @defineifndef SHEETS_DEFAULT_TRANSITION_TIME .3
-- @defineifndef SHEETS_DEFAULT_TRANSITION_EASING "transition"
-- @defineifndef SHEETS_MINIFY
-- @defineifndef SHEETS_PARSING
-- @defineifndef SHEETS_DYNAMIC
-- @defineifndef SHEETS_DYNAMIC_PARSING
-- @defineifndef SHEETS_SML false
-- @defineifndef SHEETS_WRAP false
-- @defineifndef SHEETS_EXTERNAL false
-- @if SHEETS_DYNAMIC_PARSING
-- @error "dynamic value parsing is not yet implemented"
-- @endif
-- @if SHEETS_SML
-- @error "SML is not yet implemented"
-- @endif
-- @once
-- @print Including sheets (minify: $SHEETS_MINIFY, low resolution: $SHEETS_LOWRES, dynamic-values: $SHEETS_DYNAMIC (expressions: $SHEETS_DYNAMIC_PARSING), sml: $SHEETS_SML)
-- @define SHEETS_EXCEPTION_ERROR "SHEETS_EXCEPTION\n_put code in a try block to catch the exception."
-- @include constants
-- @if SHEETS_WRAP
local env = setmetatable( {}, { __index = _ENV } )
local function f()
local _ENV = env
if setfenv then
setfenv( 1, env )
end
-- @endif
event = {
mouse_down = SHEETS_EVENT_MOUSE_DOWN;
mouse_up = SHEETS_EVENT_MOUSE_UP;
mouse_click = SHEETS_EVENT_MOUSE_CLICK;
mouse_hold = SHEETS_EVENT_MOUSE_HOLD;
mouse_drag = SHEETS_EVENT_MOUSE_DRAG;
mouse_scroll = SHEETS_EVENT_MOUSE_SCROLL;
mouse_ping = SHEETS_EVENT_MOUSE_PING;
key_down = SHEETS_EVENT_KEY_DOWN;
key_up = SHEETS_EVENT_KEY_UP;
text = SHEETS_EVENT_TEXT;
voice = SHEETS_EVENT_VOICE;
paste = SHEETS_EVENT_PASTE;
}
alignment = {
left = ALIGNMENT_LEFT;
centre = ALIGNMENT_CENTRE;
center = ALIGNMENT_CENTRE;
right = ALIGNMENT_RIGHT;
top = ALIGNMENT_TOP;
bottom = ALIGNMENT_BOTTOM;
}
area = {
box = GRAPHICS_AREA_BOX;
circle = GRAPHICS_AREA_CIRCLE;
line = GRAPHICS_AREA_LINE;
vline = GRAPHICS_AREA_VLINE;
hline = GRAPHICS_AREA_HLINE;
fill = GRAPHICS_AREA_FILL;
point = GRAPHICS_AREA_POINT;
ccircle = GRAPHICS_AREA_CCIRCLE;
}
colour = {
transparent = TRANSPARENT;
white = WHITE;
orange = ORANGE;
magenta = MAGENTA;
light_blue = LIGHTBLUE;
yellow = YELLOW;
lime = LIME;
pink = PINK;
grey = GREY;
light_grey = LIGHTGREY;
cyan = CYAN;
purple = PURPLE;
blue = BLUE;
brown = BROWN;
green = GREEN;
red = RED;
black = BLACK;
}
token = {
eof = TOKEN_EOF;
string = TOKEN_STRING;
float = TOKEN_FLOAT;
int = TOKEN_INT;
ident = TOKEN_IDENT;
newline = TOKEN_NEWLINE;
symbol = TOKEN_SYMBOL;
operator = TOKEN_OPERATOR;
}
-- @require lib.class
-- @require lib.clipboard
-- @require lib.parameters
-- @require lib.query_utils
-- @require lib.timer
-- @ifn SHEETS_LOWRES
-- @require graphics.Font
GRAPHICS_DEFAULT_FONT = Font()
-- @endif
-- @include graphics.shader
-- @require graphics.Canvas
-- @require graphics.DrawingCanvas
-- @require graphics.ScreenCanvas
-- @require graphics.image
-- @require exceptions.Exception
-- @require exceptions.IncorrectParameterException
-- @require exceptions.IncorrectConstructorException
-- @require exceptions.ResourceLoadException
-- @require exceptions.ThreadRuntimeException
-- @require interfaces.IAnimation
-- @require interfaces.IAttributeAnimator
-- @require interfaces.ICollatedChildren
-- @require interfaces.IChildContainer
-- @require interfaces.IQueryable
-- @require interfaces.ISize
-- @require events.Event
-- @require events.KeyboardEvent
-- @require events.MiscEvent
-- @require events.MouseEvent
-- @require events.TextEvent
-- @require parsing.Stream
-- @require parsing.QueryParser
-- @require parsing.DynamicValueParser
-- @require core.Animation
-- @require core.Application
-- @require core.Codegen
-- @require core.QueryTracker
-- @require core.Screen
-- @require core.Sheet
-- @require core.Style
-- @require core.Thread
-- @require core.ValueHandler
-- @if SHEETS_BUTTON
-- @require interfaces.IHasText
-- @require elements.Button
-- @endif
-- @if SHEETS_CHECKBOX
-- @/require elements.Checkbox
-- @endif
-- @if SHEETS_CONTAINER
-- @require elements.Container
-- @endif
-- @if SHEETS_DRAGGABLE
-- @/require interfaces.IHasText
-- @/require elements.Draggable
-- @endif
-- @if SHEETS_IMAGE
-- @/require elements.Image
-- @endif
-- @if SHEETS_KEYHANDLER
-- @require elements.KeyHandler
-- @endif
-- @if SHEETS_PANEL
-- @require elements.Panel
-- @endif
-- @if SHEETS_SCROLLCONTAINER
-- @/require elements.ScrollContainer
-- @endif
-- @if SHEETS_TEXT
-- @/require interfaces.IHasText
-- @/require elements.Text
-- @endif
-- @if SHEETS_TEXTINPUT
-- @/require elements.TextInput
-- @endif
-- @if SHEETS_WRAP
end
f()
local sheets = {}
for k, v in pairs( env ) do
sheets[k] = v
end
-- @endif
-- @if SHEETS_EXTERNAL
return sheets
-- @endif