hokusai-zero 0.2.6.pre.pinephone6 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +2 -0
- data/README.md +1 -1
- data/ast/src/core/input.h +1 -0
- data/ast/src/core/util.c +23 -23
- data/ast/src/core/util.h +7 -7
- data/ext/extconf.rb +3 -3
- data/hokusai.gemspec +2 -1
- data/ui/examples/counter.rb +1 -2
- data/ui/examples/forum/file.rb +1 -1
- data/ui/examples/forum/post.rb +1 -0
- data/ui/examples/forum.rb +7 -7
- data/ui/examples/spreadsheet.rb +0 -1
- data/ui/examples/tic_tac_toe.rb +6 -6
- data/ui/lib/lib_hokusai.rb +24 -25
- data/ui/spec/spec_helper.rb +1 -1
- data/ui/src/hokusai/assets/chevron-down.svg +1 -0
- data/ui/src/hokusai/automation/driver_commands/base.rb +8 -2
- data/ui/src/hokusai/automation/driver_commands/trigger_keyboard.rb +6 -3
- data/ui/src/hokusai/automation/driver_commands/trigger_mouse.rb +5 -12
- data/ui/src/hokusai/automation/server.rb +3 -2
- data/ui/src/hokusai/backends/raylib/config.rb +1 -2
- data/ui/src/hokusai/backends/raylib/font.rb +3 -24
- data/ui/src/hokusai/backends/raylib.rb +36 -167
- data/ui/src/hokusai/backends/sdl2/config.rb +6 -9
- data/ui/src/hokusai/backends/sdl2/font.rb +1 -3
- data/ui/src/hokusai/backends/sdl2.rb +93 -188
- data/ui/src/hokusai/blocks/input.rb +2 -2
- data/ui/src/hokusai/commands/rect.rb +3 -12
- data/ui/src/hokusai/commands.rb +0 -22
- data/ui/src/hokusai/event.rb +1 -2
- data/ui/src/hokusai/events/keyboard.rb +18 -11
- data/ui/src/hokusai/events/mouse.rb +8 -10
- data/ui/src/hokusai/mounting/loop_entry.rb +1 -1
- data/ui/src/hokusai/painter.rb +8 -31
- data/ui/src/hokusai/types.rb +244 -20
- data/ui/src/hokusai.rb +35 -61
- data/xmake.lua +1 -1
- metadata +22 -32
- data/ui/examples/drag.rb +0 -154
- data/ui/examples/embedded.rb +0 -58
- data/ui/examples/game.rb +0 -143
- data/ui/examples/keyboard.rb +0 -47
- data/ui/examples/overlay.rb +0 -233
- data/ui/examples/provider.rb +0 -56
- data/ui/examples/shader/test.rb +0 -155
- data/ui/examples/shader.rb +0 -100
- data/ui/examples/wiki.rb +0 -82
- data/ui/spec/hokusai/e2e/keyboard_spec.rb +0 -52
- data/ui/src/hokusai/assets/arrow-down-line.png +0 -0
- data/ui/src/hokusai/assets/arrow-down-wide-line.png +0 -0
- data/ui/src/hokusai/assets/icons/outline/arrow-big-up.svg +0 -19
- data/ui/src/hokusai/assets/icons/outline/backspace.svg +0 -20
- data/ui/src/hokusai/blocks/color_picker.rb +0 -1080
- data/ui/src/hokusai/blocks/keyboard.rb +0 -249
- data/ui/src/hokusai/blocks/shader_begin.rb +0 -22
- data/ui/src/hokusai/blocks/shader_end.rb +0 -12
- data/ui/src/hokusai/blocks/slider.rb +0 -139
- data/ui/src/hokusai/blocks/texture.rb +0 -23
- data/ui/src/hokusai/commands/shader.rb +0 -33
- data/ui/src/hokusai/commands/texture.rb +0 -26
- data/ui/src/hokusai/events/touch.rb +0 -62
- data/ui/src/hokusai/types/display.rb +0 -151
- data/ui/src/hokusai/types/keyboard.rb +0 -168
- data/ui/src/hokusai/types/mouse.rb +0 -36
- data/ui/src/hokusai/types/primitives.rb +0 -56
- data/ui/src/hokusai/types/touch.rb +0 -181
- data/ui/src/hokusai/util/wrap_stream.rb +0 -193
data/ui/src/hokusai/painter.rb
CHANGED
@@ -45,16 +45,6 @@ module Hokusai
|
|
45
45
|
keyup: KeyUpEvent.new(input, state),
|
46
46
|
keypress: KeyPressEvent.new(input, state)
|
47
47
|
}
|
48
|
-
|
49
|
-
add_touch_events(events, input, state) unless input.touch.nil?
|
50
|
-
end
|
51
|
-
|
52
|
-
def add_touch_events(events, input, state)
|
53
|
-
events.merge!({
|
54
|
-
taphold: TapHoldEvent.new(input, state),
|
55
|
-
pinch: PinchEvent.new(input, state),
|
56
|
-
swipe: SwipeEvent.new(input, state),
|
57
|
-
})
|
58
48
|
end
|
59
49
|
|
60
50
|
def on_before_render(&block)
|
@@ -96,7 +86,7 @@ module Hokusai
|
|
96
86
|
root_entry = PainterEntry.new(root, canvas.x, canvas.y, canvas.width, canvas.height)
|
97
87
|
groups << [root_entry, measure(root_children, canvas)]
|
98
88
|
|
99
|
-
mouse_y = input.mouse.pos
|
89
|
+
mouse_y = input.mouse.pos[:y]
|
100
90
|
can_capture = mouse_y >= (canvas.y || 0.0) && mouse_y <= (canvas.y || 0.0) + canvas.height
|
101
91
|
|
102
92
|
hovered = false
|
@@ -110,6 +100,7 @@ module Hokusai
|
|
110
100
|
while group = group_children.shift
|
111
101
|
z = group.block.node.meta.get_prop(:z)&.to_i || 0
|
112
102
|
ztarget = group.block.node.meta.get_prop(:ztarget)
|
103
|
+
entry = PainterEntry.new(group.block, group.x, group.y, group.w, group.h)
|
113
104
|
|
114
105
|
if (zindex_counter > 0 || z > 0)
|
115
106
|
case ztarget
|
@@ -117,17 +108,12 @@ module Hokusai
|
|
117
108
|
entry = PainterEntry.new(group.block, zroot_x || 0.0, zroot_y || 0.0, zroot_w, zroot_h).freeze
|
118
109
|
when ZTARGET_PARENT
|
119
110
|
entry = PainterEntry.new(group.block, group_parent.x || 0.0, group_parent.y || 0.0, group_parent.w, group_parent.h).freeze
|
120
|
-
else
|
121
|
-
entry = PainterEntry.new(group.block, group.x, group.y, group.w, group.h).freeze
|
122
111
|
end
|
123
|
-
else
|
124
|
-
entry = PainterEntry.new(group.block, group.x, group.y, group.w, group.h).freeze
|
125
112
|
end
|
126
113
|
|
127
|
-
|
128
114
|
canvas.reset(entry.x, entry.y, entry.w, entry.h)
|
129
115
|
|
130
|
-
before_render&.call([group.block, group.parent], canvas, input)
|
116
|
+
before_render&.call([group.block, group.parent], canvas, input.raw)
|
131
117
|
|
132
118
|
if capture
|
133
119
|
capture_events(group.block, canvas, hovered: hovered)
|
@@ -184,12 +170,6 @@ module Hokusai
|
|
184
170
|
events[:mouseout].bubble
|
185
171
|
events[:mousedown].bubble
|
186
172
|
events[:mouseup].bubble
|
187
|
-
|
188
|
-
unless input.touch.nil?
|
189
|
-
events[:taphold].bubble
|
190
|
-
events[:pinch].bubble
|
191
|
-
events[:swipe].bubble
|
192
|
-
end
|
193
173
|
end
|
194
174
|
|
195
175
|
after_render&.call
|
@@ -267,7 +247,10 @@ module Hokusai
|
|
267
247
|
return
|
268
248
|
end
|
269
249
|
|
270
|
-
|
250
|
+
rect = canvas.to_hoku_rect
|
251
|
+
block_is_hovered = LibHokusai.hoku_input_is_hovered(input.raw, rect)
|
252
|
+
|
253
|
+
if block_is_hovered
|
271
254
|
events[:hover].capture(block, canvas)
|
272
255
|
events[:click].capture(block, canvas)
|
273
256
|
events[:wheel].capture(block, canvas)
|
@@ -278,16 +261,10 @@ module Hokusai
|
|
278
261
|
end
|
279
262
|
events[:mousemove].capture(block, canvas)
|
280
263
|
|
281
|
-
if
|
264
|
+
if block_is_hovered || block.node.meta.focused
|
282
265
|
events[:keyup].capture(block, canvas)
|
283
266
|
events[:keypress].capture(block, canvas)
|
284
267
|
end
|
285
|
-
|
286
|
-
unless input.touch.nil?
|
287
|
-
events[:taphold].capture(block, canvas)
|
288
|
-
events[:pinch].capture(block, canvas)
|
289
|
-
events[:swipe].capture(block, canvas)
|
290
|
-
end
|
291
268
|
end
|
292
269
|
end
|
293
270
|
end
|
data/ui/src/hokusai/types.rb
CHANGED
@@ -1,42 +1,266 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "./types/primitives"
|
4
|
-
require_relative "./types/display"
|
5
|
-
require_relative "./types/touch"
|
6
|
-
require_relative "./types/mouse"
|
7
|
-
require_relative "./types/keyboard"
|
8
|
-
|
9
3
|
module Hokusai
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
# Rect = Struct.new(:x, :y, :width, :height) do
|
5
|
+
class Rect
|
6
|
+
attr_accessor :x, :y, :width, :height
|
7
|
+
|
8
|
+
def initialize(x, y, width, height)
|
9
|
+
@x = x
|
10
|
+
@y = y
|
11
|
+
@width = width
|
12
|
+
@height = height
|
13
|
+
end
|
14
|
+
def to_hoku_rect
|
15
|
+
@hoku_rect ||= LibHokusai::HmlRect.create(x, y, width, height)
|
16
|
+
end
|
17
|
+
|
18
|
+
def includes_y?(y)
|
19
|
+
LibHokusai.hoku_rect_includes_y(to_hoku_rect, y)
|
20
|
+
end
|
21
|
+
|
22
|
+
def includes_x?(x)
|
23
|
+
LibHokusai.hoku_rect_includes_x(to_hoku_rect, x)
|
24
|
+
end
|
25
|
+
|
26
|
+
def move_x_left(times = 1)
|
27
|
+
LibHokusai.hoku_rect_x_left(to_hoku_rect, times)
|
28
|
+
end
|
29
|
+
|
30
|
+
def move_x_right(times = 1)
|
31
|
+
LibHokusai.hoku_rect_x_right(to_hoku_rect, times)
|
32
|
+
end
|
33
|
+
|
34
|
+
def move_y_up(times = 1)
|
35
|
+
LibHokusai.hoku_rect_y_up(to_hoku_rect, times)
|
36
|
+
end
|
37
|
+
|
38
|
+
def move_y_down(times = 1)
|
39
|
+
LibHokusai.hoku_rect_y_down(to_hoku_rect, times)
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.from_hoku_rect(rect)
|
43
|
+
self.x = rect[:x]
|
44
|
+
self.y = rect[:y]
|
45
|
+
self.width = rect[:w]
|
46
|
+
self.height = rect[:h]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
Outline = Struct.new(:top, :right, :bottom, :left) do
|
51
|
+
def self.default
|
52
|
+
new(0.0, 0.0, 0.0, 0.0)
|
53
|
+
end
|
13
54
|
|
14
55
|
def hash
|
15
|
-
[self.class,
|
56
|
+
[self.class, top, right, bottom, left].hash
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.convert(value)
|
60
|
+
case value
|
61
|
+
when String
|
62
|
+
if value =~ /,/
|
63
|
+
convert(value.split(",").map(&:to_f))
|
64
|
+
else
|
65
|
+
convert(value.to_f)
|
66
|
+
end
|
67
|
+
when Float
|
68
|
+
new(value, value, value, value)
|
69
|
+
when Array
|
70
|
+
new(value[0] || 0.0, value[1] || 0.0, value[2] || 0.0, value[3] || 0.0)
|
71
|
+
when Outline
|
72
|
+
value
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def present?
|
77
|
+
top > 0.0 || right > 0.0 || bottom > 0.0 || left > 0.0
|
78
|
+
end
|
79
|
+
|
80
|
+
def uniform?
|
81
|
+
top == right && top == bottom && top == left
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
class Padding
|
86
|
+
attr_reader :top, :left, :right, :bottom
|
87
|
+
def initialize(top, right, bottom, left)
|
88
|
+
@top = top
|
89
|
+
@left = left
|
90
|
+
@right = right
|
91
|
+
@bottom = bottom
|
92
|
+
end
|
93
|
+
|
94
|
+
alias_method :t, :top
|
95
|
+
alias_method :l, :left
|
96
|
+
alias_method :r, :right
|
97
|
+
alias_method :b, :bottom
|
98
|
+
|
99
|
+
def self.convert(value)
|
100
|
+
case value
|
101
|
+
when String
|
102
|
+
if value =~ /,/
|
103
|
+
convert(value.split(",").map(&:to_f))
|
104
|
+
else
|
105
|
+
convert(value.to_i)
|
106
|
+
end
|
107
|
+
when Integer
|
108
|
+
new(value, value, value, value)
|
109
|
+
when Array
|
110
|
+
new(value[0], value[1], value[2], value[3])
|
111
|
+
when Padding
|
112
|
+
value
|
113
|
+
else
|
114
|
+
raise Hokusai::Error.new("Unsupported conversion type #{value.class} for Hokusai::Padding")
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def hash
|
119
|
+
[self.class, top, right, bottom, left].hash
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
class Canvas
|
124
|
+
attr_accessor :width, :height, :x, :y, :vertical, :reverse
|
125
|
+
def initialize(width, height, x = 0.0, y = 0.0, vertical = true, reverse = false)
|
126
|
+
@width = width
|
127
|
+
@height = height
|
128
|
+
@x = x
|
129
|
+
@y = y
|
130
|
+
@vertical = vertical
|
131
|
+
@reverse = reverse
|
16
132
|
end
|
17
133
|
|
18
|
-
def
|
19
|
-
|
20
|
-
|
134
|
+
def reset(x, y, width, height, vertical: true, reverse: false)
|
135
|
+
self.x = x
|
136
|
+
self.y = y
|
137
|
+
self.width = width
|
138
|
+
self.height = height
|
139
|
+
self.vertical = vertical
|
140
|
+
self.reverse = reverse
|
21
141
|
end
|
22
142
|
|
23
|
-
def
|
24
|
-
|
143
|
+
def to_bounds
|
144
|
+
Hokusai::Rect.new(x, y, width, height)
|
145
|
+
end
|
146
|
+
|
147
|
+
def reverse?
|
148
|
+
reverse
|
149
|
+
end
|
150
|
+
|
151
|
+
def to_hoku_rect
|
152
|
+
LibHokusai::HmlRect.create(x, y, width, height)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# Color = Struct.new(:red, :green, :blue, :alpha) do
|
157
|
+
class Color
|
158
|
+
attr_reader :red, :green, :blue, :alpha
|
159
|
+
def initialize(red, green, blue, alpha = 255)
|
160
|
+
@red = red.freeze
|
161
|
+
@green = green.freeze
|
162
|
+
@blue = blue.freeze
|
163
|
+
@alpha = alpha.freeze
|
164
|
+
end
|
165
|
+
|
166
|
+
alias_method :r, :red
|
167
|
+
alias_method :b, :blue
|
168
|
+
alias_method :g, :green
|
169
|
+
alias_method :a, :alpha
|
170
|
+
|
171
|
+
def self.convert(value)
|
172
|
+
case value
|
173
|
+
when String
|
174
|
+
value = value.split(",").map(&:to_i)
|
175
|
+
when Array
|
176
|
+
when Color
|
177
|
+
return value
|
178
|
+
else
|
179
|
+
raise Hokusai::Error.new("Unsupported conversion type #{value.class} for Hokusai::Color")
|
180
|
+
end
|
181
|
+
|
182
|
+
new(value[0], value[1], value[2], value[3] || 255)
|
183
|
+
end
|
184
|
+
|
185
|
+
def hash
|
186
|
+
[self.class, r, g, b, a].hash
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
class Keyboard
|
191
|
+
attr_reader :raw
|
192
|
+
|
193
|
+
[
|
194
|
+
:shift, :super, :ctrl,
|
195
|
+
:alt, :pressed, :pressed_len, :released,
|
196
|
+
:released_len
|
197
|
+
].each do |name|
|
198
|
+
define_method(name) do
|
199
|
+
raw[name]
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
def keyboard_key
|
204
|
+
pressed.read_array_of_type(TYPE_UINT8, :read_uint8, pressed_len).first
|
205
|
+
end
|
206
|
+
|
207
|
+
def key
|
208
|
+
keyboard_key[:key][:key]
|
209
|
+
end
|
210
|
+
|
211
|
+
def initialize(raw)
|
212
|
+
@raw = raw
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
class Mouse
|
217
|
+
attr_reader :raw
|
218
|
+
|
219
|
+
def initialize(raw)
|
220
|
+
@raw = raw
|
221
|
+
end
|
222
|
+
|
223
|
+
[
|
224
|
+
:pos, :delta, :scroll,
|
225
|
+
:scroll_delta, :selection,
|
226
|
+
:selection_type, :left,
|
227
|
+
:middle, :right
|
228
|
+
].each do |name|
|
229
|
+
define_method(name) do
|
230
|
+
# instance_variable_set("@#{name}", raw[name]) if instance_variable_get("@#{name}").nil?
|
231
|
+
#
|
232
|
+
# instance_variable_get("@#{name}")
|
233
|
+
|
234
|
+
raw[name]
|
235
|
+
end
|
236
|
+
|
237
|
+
define_method("#{name}=") do |val|
|
238
|
+
raw[name] = val
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
class Input
|
244
|
+
attr_reader :raw
|
245
|
+
|
246
|
+
def hash
|
247
|
+
[self.class, mouse.pos.x, mouse.pos.y, mouse.scroll, mouse.left.clicked, mouse.left.down, mouse.left.up].hash
|
248
|
+
end
|
25
249
|
|
26
|
-
|
250
|
+
def initialize(raw)
|
251
|
+
@raw = raw
|
27
252
|
end
|
28
253
|
|
29
254
|
def keyboard
|
30
|
-
|
255
|
+
Keyboard.new(@raw[:keyboard])
|
31
256
|
end
|
32
257
|
|
33
258
|
def mouse
|
34
|
-
@mouse ||= Mouse.new
|
259
|
+
@mouse ||= Mouse.new(@raw[:mouse])
|
35
260
|
end
|
36
261
|
|
37
262
|
def hovered?(canvas)
|
38
|
-
|
39
|
-
pos.x >= canvas.x && pos.x <= canvas.x + canvas.width && pos.y >= canvas.y && pos.y <= canvas.y + canvas.height
|
263
|
+
LibHokusai.hoku_input_is_hovered(raw, canvas.to_hoku_rect)
|
40
264
|
end
|
41
265
|
end
|
42
266
|
end
|
data/ui/src/hokusai.rb
CHANGED
@@ -13,11 +13,45 @@ require_relative './hokusai/event'
|
|
13
13
|
require_relative './hokusai/painter'
|
14
14
|
require_relative './hokusai/util/selection'
|
15
15
|
require_relative './hokusai/util/piece_table'
|
16
|
+
require_relative './hokusai/blocks/empty'
|
17
|
+
require_relative './hokusai/blocks/vblock'
|
18
|
+
require_relative './hokusai/blocks/hblock'
|
19
|
+
require_relative './hokusai/blocks/label'
|
20
|
+
require_relative './hokusai/blocks/rect'
|
21
|
+
require_relative './hokusai/blocks/button'
|
22
|
+
require_relative './hokusai/blocks/circle'
|
23
|
+
require_relative './hokusai/blocks/checkbox'
|
24
|
+
require_relative './hokusai/blocks/scissor_begin'
|
25
|
+
require_relative './hokusai/blocks/scissor_end'
|
26
|
+
require_relative './hokusai/blocks/clipped'
|
27
|
+
require_relative './hokusai/blocks/cursor'
|
28
|
+
require_relative './hokusai/blocks/image'
|
29
|
+
require_relative './hokusai/blocks/svg'
|
30
|
+
require_relative './hokusai/blocks/toggle'
|
31
|
+
require_relative './hokusai/blocks/scrollbar'
|
32
|
+
require_relative './hokusai/blocks/dynamic'
|
33
|
+
require_relative './hokusai/blocks/panel'
|
34
|
+
require_relative './hokusai/blocks/text'
|
35
|
+
require_relative './hokusai/blocks/selectable'
|
36
|
+
require_relative './hokusai/blocks/input'
|
37
|
+
require_relative './hokusai/blocks/variable'
|
38
|
+
require_relative './hokusai/blocks/titlebar/osx'
|
39
|
+
require_relative './hokusai/blocks/modal'
|
40
|
+
require_relative './hokusai/blocks/dropdown'
|
41
|
+
|
42
|
+
require "concurrent"
|
16
43
|
|
17
44
|
# A backend agnostic library for authoring
|
18
45
|
# desktop applications
|
19
46
|
# @author skinnyjames
|
20
47
|
module Hokusai
|
48
|
+
ThreadPool = Concurrent::ThreadPoolExecutor.new(
|
49
|
+
min_threads: 5,
|
50
|
+
max_threads: 5,
|
51
|
+
max_queue: 20,
|
52
|
+
fallback_policy: :caller_runs
|
53
|
+
)
|
54
|
+
|
21
55
|
SHADER_UNIFORM_FLOAT = 0 # Shader uniform type: float
|
22
56
|
SHADER_UNIFORM_VEC2 = 1 # Shader uniform type: vec2 (2 float)
|
23
57
|
SHADER_UNIFORM_VEC3 = 2 # Shader uniform type: vec3 (3 float)
|
@@ -31,10 +65,6 @@ module Hokusai
|
|
31
65
|
SHADER_UNIFORM_UIVEC3 = 10 # Shader uniform type: uivec3 (3 unsigned int)
|
32
66
|
SHADER_UNIFORM_UIVEC4 = 11 # Shader uniform type: uivec4 (4 unsigned int)
|
33
67
|
|
34
|
-
def self.asset(path)
|
35
|
-
"#{ASSETS_FOLDER}/#{path}"
|
36
|
-
end
|
37
|
-
|
38
68
|
# Access the font registry
|
39
69
|
#
|
40
70
|
# @return [Hokusai::FontRegistry]
|
@@ -136,60 +166,4 @@ module Hokusai
|
|
136
166
|
def self.set_mouse_cursor(type)
|
137
167
|
@on_set_mouse_cursor&.call(type)
|
138
168
|
end
|
139
|
-
|
140
|
-
# Mobile support
|
141
|
-
def self.on_show_keyboard(&block)
|
142
|
-
@on_show_keyboard = block
|
143
|
-
end
|
144
|
-
|
145
|
-
def self.show_keyboard
|
146
|
-
@on_show_keyboard&.call
|
147
|
-
end
|
148
|
-
|
149
|
-
def self.on_hide_keyboard(&block)
|
150
|
-
@on_hide_keyboard = block
|
151
|
-
end
|
152
|
-
|
153
|
-
def self.hide_keyboard
|
154
|
-
@on_hide_keyboard&.call
|
155
|
-
end
|
156
|
-
|
157
|
-
def self.on_keyboard_visible(&block)
|
158
|
-
@on_keyboard_visible = block
|
159
|
-
end
|
160
|
-
|
161
|
-
def self.keyboard_visible?
|
162
|
-
@on_keyboard_visible&.call
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
require_relative './hokusai/blocks/empty'
|
167
|
-
require_relative './hokusai/blocks/vblock'
|
168
|
-
require_relative './hokusai/blocks/hblock'
|
169
|
-
require_relative './hokusai/blocks/label'
|
170
|
-
require_relative './hokusai/blocks/rect'
|
171
|
-
require_relative './hokusai/blocks/button'
|
172
|
-
require_relative './hokusai/blocks/circle'
|
173
|
-
require_relative './hokusai/blocks/checkbox'
|
174
|
-
require_relative './hokusai/blocks/scissor_begin'
|
175
|
-
require_relative './hokusai/blocks/scissor_end'
|
176
|
-
require_relative './hokusai/blocks/clipped'
|
177
|
-
require_relative './hokusai/blocks/cursor'
|
178
|
-
require_relative './hokusai/blocks/image'
|
179
|
-
require_relative './hokusai/blocks/svg'
|
180
|
-
require_relative './hokusai/blocks/toggle'
|
181
|
-
require_relative './hokusai/blocks/scrollbar'
|
182
|
-
require_relative './hokusai/blocks/dynamic'
|
183
|
-
require_relative './hokusai/blocks/panel'
|
184
|
-
require_relative './hokusai/blocks/text'
|
185
|
-
require_relative './hokusai/blocks/selectable'
|
186
|
-
require_relative './hokusai/blocks/input'
|
187
|
-
require_relative './hokusai/blocks/variable'
|
188
|
-
require_relative './hokusai/blocks/titlebar/osx'
|
189
|
-
require_relative './hokusai/blocks/modal'
|
190
|
-
require_relative './hokusai/blocks/dropdown'
|
191
|
-
require_relative './hokusai/blocks/shader_begin'
|
192
|
-
require_relative './hokusai/blocks/shader_end'
|
193
|
-
require_relative './hokusai/blocks/texture'
|
194
|
-
require_relative './hokusai/blocks/color_picker'
|
195
|
-
require_relative './hokusai/blocks/keyboard'
|
169
|
+
end
|
data/xmake.lua
CHANGED
@@ -159,7 +159,7 @@ target("test-ast")
|
|
159
159
|
)
|
160
160
|
-- add_cflags("-Wall -Werror")
|
161
161
|
after_build(function(target)
|
162
|
-
os.exec("./%s -t
|
162
|
+
os.exec("./%s -t markdown", target:targetfile())
|
163
163
|
-- os.exec("leaks -atExit -- %s", target:targetfile())
|
164
164
|
end)
|
165
165
|
target_end()
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hokusai-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.6
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- skinnyjames
|
8
|
+
autorequire:
|
8
9
|
bindir: bin
|
9
10
|
cert_chain: []
|
10
|
-
date:
|
11
|
+
date: 2025-06-24 00:00:00.000000000 Z
|
11
12
|
dependencies:
|
12
13
|
- !ruby/object:Gem::Dependency
|
13
14
|
name: ffi
|
@@ -23,6 +24,20 @@ dependencies:
|
|
23
24
|
- - "~>"
|
24
25
|
- !ruby/object:Gem::Version
|
25
26
|
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: concurrent-ruby
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.3.4
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.3.4
|
26
41
|
- !ruby/object:Gem::Dependency
|
27
42
|
name: raylib-bindings
|
28
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,6 +94,7 @@ dependencies:
|
|
79
94
|
- - ">="
|
80
95
|
- !ruby/object:Gem::Version
|
81
96
|
version: '0'
|
97
|
+
description:
|
82
98
|
email: zero@skinnyjames.net
|
83
99
|
executables: []
|
84
100
|
extensions:
|
@@ -165,26 +181,17 @@ files:
|
|
165
181
|
- ui/examples/buddy.rb
|
166
182
|
- ui/examples/clock.rb
|
167
183
|
- ui/examples/counter.rb
|
168
|
-
- ui/examples/drag.rb
|
169
184
|
- ui/examples/dynamic.rb
|
170
|
-
- ui/examples/embedded.rb
|
171
185
|
- ui/examples/foobar.rb
|
172
186
|
- ui/examples/forum.rb
|
173
187
|
- ui/examples/forum/file.rb
|
174
188
|
- ui/examples/forum/music.rb
|
175
189
|
- ui/examples/forum/post.rb
|
176
|
-
- ui/examples/game.rb
|
177
|
-
- ui/examples/keyboard.rb
|
178
|
-
- ui/examples/overlay.rb
|
179
|
-
- ui/examples/provider.rb
|
180
|
-
- ui/examples/shader.rb
|
181
|
-
- ui/examples/shader/test.rb
|
182
190
|
- ui/examples/spreadsheet.rb
|
183
191
|
- ui/examples/spreadsheet/csv.rb
|
184
192
|
- ui/examples/stock.rb
|
185
193
|
- ui/examples/stock_decider/option.rb
|
186
194
|
- ui/examples/tic_tac_toe.rb
|
187
|
-
- ui/examples/wiki.rb
|
188
195
|
- ui/lib/lib_hokusai.rb
|
189
196
|
- ui/spec/hokusai/ast_spec.rb
|
190
197
|
- ui/spec/hokusai/automation/keys_transcoder_spec.rb
|
@@ -193,7 +200,6 @@ files:
|
|
193
200
|
- ui/spec/hokusai/diff_spec.rb
|
194
201
|
- ui/spec/hokusai/directives_spec.rb
|
195
202
|
- ui/spec/hokusai/e2e/client_spec.rb
|
196
|
-
- ui/spec/hokusai/e2e/keyboard_spec.rb
|
197
203
|
- ui/spec/hokusai/e2e/meta_spec.rb
|
198
204
|
- ui/spec/hokusai/providers_spec.rb
|
199
205
|
- ui/spec/hokusai/publisher_spec.rb
|
@@ -202,12 +208,9 @@ files:
|
|
202
208
|
- ui/spec/hokusai_spec.rb
|
203
209
|
- ui/spec/spec_helper.rb
|
204
210
|
- ui/src/hokusai.rb
|
205
|
-
- ui/src/hokusai/assets/arrow-down-line.png
|
206
|
-
- ui/src/hokusai/assets/arrow-down-wide-line.png
|
207
211
|
- ui/src/hokusai/assets/arrow-drop-down-line.png
|
212
|
+
- ui/src/hokusai/assets/chevron-down.svg
|
208
213
|
- ui/src/hokusai/assets/close-large-line.png
|
209
|
-
- ui/src/hokusai/assets/icons/outline/arrow-big-up.svg
|
210
|
-
- ui/src/hokusai/assets/icons/outline/backspace.svg
|
211
214
|
- ui/src/hokusai/ast.rb
|
212
215
|
- ui/src/hokusai/automation.rb
|
213
216
|
- ui/src/hokusai/automation/client.rb
|
@@ -239,7 +242,6 @@ files:
|
|
239
242
|
- ui/src/hokusai/blocks/checkbox.rb
|
240
243
|
- ui/src/hokusai/blocks/circle.rb
|
241
244
|
- ui/src/hokusai/blocks/clipped.rb
|
242
|
-
- ui/src/hokusai/blocks/color_picker.rb
|
243
245
|
- ui/src/hokusai/blocks/cursor.rb
|
244
246
|
- ui/src/hokusai/blocks/dropdown.rb
|
245
247
|
- ui/src/hokusai/blocks/dynamic.rb
|
@@ -247,7 +249,6 @@ files:
|
|
247
249
|
- ui/src/hokusai/blocks/hblock.rb
|
248
250
|
- ui/src/hokusai/blocks/image.rb
|
249
251
|
- ui/src/hokusai/blocks/input.rb
|
250
|
-
- ui/src/hokusai/blocks/keyboard.rb
|
251
252
|
- ui/src/hokusai/blocks/label.rb
|
252
253
|
- ui/src/hokusai/blocks/modal.rb
|
253
254
|
- ui/src/hokusai/blocks/panel.rb
|
@@ -256,12 +257,8 @@ files:
|
|
256
257
|
- ui/src/hokusai/blocks/scissor_end.rb
|
257
258
|
- ui/src/hokusai/blocks/scrollbar.rb
|
258
259
|
- ui/src/hokusai/blocks/selectable.rb
|
259
|
-
- ui/src/hokusai/blocks/shader_begin.rb
|
260
|
-
- ui/src/hokusai/blocks/shader_end.rb
|
261
|
-
- ui/src/hokusai/blocks/slider.rb
|
262
260
|
- ui/src/hokusai/blocks/svg.rb
|
263
261
|
- ui/src/hokusai/blocks/text.rb
|
264
|
-
- ui/src/hokusai/blocks/texture.rb
|
265
262
|
- ui/src/hokusai/blocks/titlebar/osx.rb
|
266
263
|
- ui/src/hokusai/blocks/toggle.rb
|
267
264
|
- ui/src/hokusai/blocks/variable.rb
|
@@ -272,15 +269,12 @@ files:
|
|
272
269
|
- ui/src/hokusai/commands/image.rb
|
273
270
|
- ui/src/hokusai/commands/rect.rb
|
274
271
|
- ui/src/hokusai/commands/scissor.rb
|
275
|
-
- ui/src/hokusai/commands/shader.rb
|
276
272
|
- ui/src/hokusai/commands/text.rb
|
277
|
-
- ui/src/hokusai/commands/texture.rb
|
278
273
|
- ui/src/hokusai/diff.rb
|
279
274
|
- ui/src/hokusai/error.rb
|
280
275
|
- ui/src/hokusai/event.rb
|
281
276
|
- ui/src/hokusai/events/keyboard.rb
|
282
277
|
- ui/src/hokusai/events/mouse.rb
|
283
|
-
- ui/src/hokusai/events/touch.rb
|
284
278
|
- ui/src/hokusai/font.rb
|
285
279
|
- ui/src/hokusai/meta.rb
|
286
280
|
- ui/src/hokusai/mounting/loop_entry.rb
|
@@ -292,15 +286,9 @@ files:
|
|
292
286
|
- ui/src/hokusai/publisher.rb
|
293
287
|
- ui/src/hokusai/style.rb
|
294
288
|
- ui/src/hokusai/types.rb
|
295
|
-
- ui/src/hokusai/types/display.rb
|
296
|
-
- ui/src/hokusai/types/keyboard.rb
|
297
|
-
- ui/src/hokusai/types/mouse.rb
|
298
|
-
- ui/src/hokusai/types/primitives.rb
|
299
|
-
- ui/src/hokusai/types/touch.rb
|
300
289
|
- ui/src/hokusai/util/clamping_iterator.rb
|
301
290
|
- ui/src/hokusai/util/piece_table.rb
|
302
291
|
- ui/src/hokusai/util/selection.rb
|
303
|
-
- ui/src/hokusai/util/wrap_stream.rb
|
304
292
|
- ui/vendor/.gitkeep
|
305
293
|
- vendor/.gitkeep
|
306
294
|
- xmake.lua
|
@@ -309,6 +297,7 @@ licenses:
|
|
309
297
|
- MIT
|
310
298
|
metadata:
|
311
299
|
source_code_uri: https://codeberg.org/skinnyjames/hokusai
|
300
|
+
post_install_message:
|
312
301
|
rdoc_options: []
|
313
302
|
require_paths:
|
314
303
|
- ui/src
|
@@ -323,7 +312,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
323
312
|
- !ruby/object:Gem::Version
|
324
313
|
version: '0'
|
325
314
|
requirements: []
|
326
|
-
rubygems_version: 3.
|
315
|
+
rubygems_version: 3.5.22
|
316
|
+
signing_key:
|
327
317
|
specification_version: 4
|
328
318
|
summary: A Ruby library for writing GUI applications
|
329
319
|
test_files: []
|