glimmer-dsl-libui 0.2.24 → 0.3.3
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/CHANGELOG.md +34 -0
- data/README.md +1153 -921
- data/VERSION +1 -1
- data/examples/area_gallery.rb +19 -19
- data/examples/area_gallery2.rb +91 -89
- data/examples/area_gallery3.rb +19 -19
- data/examples/area_gallery4.rb +91 -89
- data/examples/basic_image.rb +19 -0
- data/examples/basic_image2.rb +13 -0
- data/examples/basic_image3.rb +23 -0
- data/examples/basic_image4.rb +17 -0
- data/examples/basic_image5.rb +75 -0
- data/examples/basic_table_color.rb +1 -11
- data/examples/basic_table_color2.rb +39 -0
- data/examples/basic_table_image.rb +2 -14
- data/examples/basic_table_image2.rb +44 -0
- data/examples/basic_table_image_text.rb +2 -13
- data/examples/basic_table_image_text2.rb +44 -0
- data/examples/basic_transform.rb +3 -6
- data/examples/basic_transform2.rb +34 -0
- data/examples/color_the_circles.rb +1 -3
- data/examples/dynamic_area.rb +1 -3
- data/examples/dynamic_area2.rb +5 -7
- data/examples/form_table.rb +4 -0
- data/examples/grid.rb +4 -4
- data/examples/histogram.rb +4 -8
- data/examples/meta_example.rb +50 -10
- data/examples/snake.rb +1 -3
- data/examples/tetris.rb +15 -18
- data/examples/tic_tac_toe/board.rb +4 -2
- data/examples/tic_tac_toe.rb +1 -3
- data/glimmer-dsl-libui.gemspec +0 -0
- data/lib/glimmer/dsl/libui/control_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/shape_expression.rb +6 -1
- data/lib/glimmer/libui/control_proxy/area_proxy.rb +1 -0
- data/lib/glimmer/libui/control_proxy/column.rb +2 -2
- data/lib/glimmer/libui/control_proxy/image_part_proxy.rb +0 -1
- data/lib/glimmer/libui/control_proxy/image_proxy.rb +159 -12
- data/lib/glimmer/libui/control_proxy/table_proxy.rb +15 -2
- data/lib/glimmer/libui/control_proxy/window_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy.rb +7 -7
- data/lib/glimmer/libui/image_path_renderer.rb +30 -0
- data/lib/glimmer/libui/shape.rb +44 -1
- metadata +29 -19
@@ -21,6 +21,9 @@
|
|
21
21
|
|
22
22
|
require 'glimmer/dsl/expression'
|
23
23
|
require 'glimmer/dsl/parent_expression'
|
24
|
+
require 'glimmer/libui/control_proxy/path_proxy'
|
25
|
+
require 'glimmer/libui/shape'
|
26
|
+
require 'glimmer/libui/control_proxy/area_proxy'
|
24
27
|
|
25
28
|
module Glimmer
|
26
29
|
module DSL
|
@@ -32,7 +35,9 @@ module Glimmer
|
|
32
35
|
Glimmer::LibUI::Shape.exists?(keyword) and
|
33
36
|
(
|
34
37
|
parent.is_a?(Glimmer::LibUI::ControlProxy::PathProxy) or
|
35
|
-
|
38
|
+
parent.is_a?(Glimmer::LibUI::Shape) or
|
39
|
+
parent.is_a?(Glimmer::LibUI::ControlProxy::AreaProxy) or
|
40
|
+
(parent.nil? && Glimmer::LibUI::ControlProxy::AreaProxy.current_area_draw_params)
|
36
41
|
)
|
37
42
|
end
|
38
43
|
|
@@ -218,6 +218,7 @@ module Glimmer
|
|
218
218
|
{
|
219
219
|
key: key_to_char(area_key_event.Key, modifiers),
|
220
220
|
key_value: area_key_event.Key,
|
221
|
+
key_code: area_key_event.Key,
|
221
222
|
ext_key: ext_key_to_symbol(area_key_event.ExtKey),
|
222
223
|
ext_key_value: area_key_event.ExtKey,
|
223
224
|
modifier: modifiers_to_symbols(area_key_event.Modifier).first,
|
@@ -43,9 +43,9 @@ module Glimmer
|
|
43
43
|
@column_index ||= @parent_proxy.send(:next_column_index)
|
44
44
|
end
|
45
45
|
|
46
|
-
# actual index within table columns (disregarding
|
46
|
+
# actual index within table columns (disregarding extra fillings that account for DualColumn instances)
|
47
47
|
def index
|
48
|
-
@parent_proxy.columns.
|
48
|
+
@parent_proxy.columns.select {|c| c.is_a?(Column)}.index(self)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -20,44 +20,191 @@
|
|
20
20
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
21
|
|
22
22
|
require 'glimmer/libui/control_proxy'
|
23
|
+
require 'glimmer/libui/control_proxy/image_part_proxy'
|
24
|
+
require 'glimmer/libui/image_path_renderer'
|
23
25
|
require 'glimmer/data_binding/observer'
|
26
|
+
require 'glimmer/libui/control_proxy/transformable'
|
24
27
|
|
25
28
|
using ArrayIncludeMethods
|
26
29
|
|
27
30
|
module Glimmer
|
28
31
|
module LibUI
|
29
32
|
class ControlProxy
|
30
|
-
# Proxy for LibUI image
|
33
|
+
# Proxy for LibUI image object and Glimmer custom control
|
31
34
|
#
|
32
35
|
# Follows the Proxy Design Pattern
|
33
36
|
class ImageProxy < ControlProxy
|
37
|
+
include Parent
|
38
|
+
prepend Transformable
|
39
|
+
|
40
|
+
attr_reader :data, :pixels, :shapes
|
41
|
+
|
34
42
|
def initialize(keyword, parent, args, &block)
|
35
43
|
@keyword = keyword
|
36
44
|
@parent_proxy = parent
|
37
45
|
@args = args
|
38
46
|
@block = block
|
39
47
|
@enabled = true
|
40
|
-
@children = []
|
41
48
|
post_add_content if @block.nil?
|
42
49
|
end
|
43
|
-
|
50
|
+
|
44
51
|
def post_add_content
|
45
|
-
|
46
|
-
|
52
|
+
if area_image?
|
53
|
+
@shapes = nil
|
54
|
+
super
|
55
|
+
if @parent_proxy.nil? && AreaProxy.current_area_draw_params
|
56
|
+
draw(AreaProxy.current_area_draw_params)
|
57
|
+
destroy
|
58
|
+
end
|
59
|
+
@content_added = true
|
60
|
+
else # image object not control
|
61
|
+
build_control
|
62
|
+
super
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def file(value = nil)
|
67
|
+
if value.nil?
|
68
|
+
@args[0]
|
69
|
+
else
|
70
|
+
@args[0] = value
|
71
|
+
if @content_added
|
72
|
+
post_add_content
|
73
|
+
request_auto_redraw
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
alias file= file
|
78
|
+
alias set_file file
|
79
|
+
|
80
|
+
def width(value = nil)
|
81
|
+
if value.nil?
|
82
|
+
@args[1]
|
83
|
+
else
|
84
|
+
@args[1] = value
|
85
|
+
if area_image? && @content_added
|
86
|
+
post_add_content
|
87
|
+
request_auto_redraw
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
alias width= width
|
92
|
+
alias set_width width
|
93
|
+
|
94
|
+
def height(value = nil)
|
95
|
+
if value.nil?
|
96
|
+
@args[2]
|
97
|
+
else
|
98
|
+
@args[2] = value
|
99
|
+
if area_image? && @content_added
|
100
|
+
post_add_content
|
101
|
+
request_auto_redraw
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
alias height= height
|
106
|
+
alias set_height height
|
107
|
+
|
108
|
+
def redraw
|
109
|
+
@parent_proxy&.redraw
|
110
|
+
end
|
111
|
+
|
112
|
+
def request_auto_redraw
|
113
|
+
@parent_proxy&.request_auto_redraw if area_image?
|
114
|
+
end
|
115
|
+
|
116
|
+
def draw(area_draw_params)
|
117
|
+
if @shapes.nil?
|
118
|
+
load_image
|
119
|
+
parse_pixels
|
120
|
+
calculate_shapes
|
121
|
+
end
|
122
|
+
ImagePathRenderer.new(@parent_proxy, @shapes).render
|
47
123
|
end
|
48
|
-
|
49
|
-
def
|
50
|
-
@
|
124
|
+
|
125
|
+
def area_image?
|
126
|
+
@area_image ||= !!(@parent_proxy&.is_a?(AreaProxy) || AreaProxy.current_area_draw_params)
|
127
|
+
end
|
128
|
+
|
129
|
+
def destroy
|
130
|
+
@parent_proxy&.children&.delete(self)
|
131
|
+
ControlProxy.control_proxies.delete(self)
|
51
132
|
end
|
52
133
|
|
53
134
|
private
|
54
135
|
|
55
136
|
def build_control
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
137
|
+
unless area_image? # image object
|
138
|
+
if file
|
139
|
+
load_image
|
140
|
+
ImagePartProxy.new('image_part', self, [@data, width, height, width * 4])
|
141
|
+
end
|
142
|
+
@args[1] = @children.first.args[1] if @children.size == 1 && @args[1].nil?
|
143
|
+
@args[2] = @children.first.args[2] if @children.size == 1 && @args[2].nil?
|
144
|
+
@libui = ControlProxy.new_control(@keyword, [width, height])
|
145
|
+
@libui.tap do
|
146
|
+
@children.each {|child| child&.send(:build_control) }
|
147
|
+
end
|
148
|
+
end
|
149
|
+
rescue => e
|
150
|
+
Glimmer::Config.logger.error {"Failed to load image file: #{file}"}
|
151
|
+
Glimmer::Config.logger.error {e.full_message}
|
152
|
+
raise e
|
153
|
+
end
|
154
|
+
|
155
|
+
def load_image
|
156
|
+
require 'chunky_png'
|
157
|
+
canvas = nil
|
158
|
+
if file.start_with?('http')
|
159
|
+
require 'net/http'
|
160
|
+
require 'open-uri'
|
161
|
+
uri = URI(file)
|
162
|
+
canvas = ChunkyPNG::Canvas.from_string(Net::HTTP.get(uri))
|
163
|
+
else
|
164
|
+
f = File.open(file)
|
165
|
+
canvas = ChunkyPNG::Canvas.from_io(f)
|
166
|
+
f.close
|
167
|
+
end
|
168
|
+
canvas.resample_nearest_neighbor!(width, height) if width && height
|
169
|
+
@data = canvas.to_rgba_stream
|
170
|
+
self.width = canvas.width
|
171
|
+
self.height = canvas.height
|
172
|
+
[@data, width, height]
|
173
|
+
end
|
174
|
+
|
175
|
+
def parse_pixels
|
176
|
+
@pixels = height.times.map do |y|
|
177
|
+
width.times.map do |x|
|
178
|
+
r = @data[(y*width + x)*4].ord
|
179
|
+
g = @data[(y*width + x)*4 + 1].ord
|
180
|
+
b = @data[(y*width + x)*4 + 2].ord
|
181
|
+
a = @data[(y*width + x)*4 + 3].ord
|
182
|
+
{x: x, y: y, color: {r: r, g: g, b: b, a: a}}
|
183
|
+
end
|
184
|
+
end.flatten
|
185
|
+
end
|
186
|
+
|
187
|
+
def calculate_shapes
|
188
|
+
@shapes = []
|
189
|
+
original_pixels = @pixels.dup
|
190
|
+
indexed_original_pixels = Hash[original_pixels.each_with_index.to_a]
|
191
|
+
@pixels.each do |pixel|
|
192
|
+
index = indexed_original_pixels[pixel]
|
193
|
+
@rectangle_start_x ||= pixel[:x]
|
194
|
+
@rectangle_width ||= 1
|
195
|
+
if pixel[:x] < width - 1 && pixel[:color] == original_pixels[index + 1][:color]
|
196
|
+
@rectangle_width += 1
|
197
|
+
else
|
198
|
+
if pixel[:x] > 0 && pixel[:color] == original_pixels[index - 1][:color]
|
199
|
+
@shapes << {x: @rectangle_start_x, y: pixel[:y], width: @rectangle_width, height: 1, color: pixel[:color]}
|
200
|
+
else
|
201
|
+
@shapes << {x: pixel[:x], y: pixel[:y], width: 1, height: 1, color: pixel[:color]}
|
202
|
+
end
|
203
|
+
@rectangle_width = 1
|
204
|
+
@rectangle_start_x = pixel[:x] == width - 1 ? 0 : pixel[:x] + 1
|
205
|
+
end
|
60
206
|
end
|
207
|
+
@shapes
|
61
208
|
end
|
62
209
|
end
|
63
210
|
end
|
@@ -21,6 +21,7 @@
|
|
21
21
|
|
22
22
|
require 'glimmer/libui/control_proxy'
|
23
23
|
require 'glimmer/libui/control_proxy/dual_column'
|
24
|
+
require 'glimmer/libui/control_proxy/triple_column'
|
24
25
|
require 'glimmer/data_binding/observer'
|
25
26
|
require 'glimmer/fiddle_consumer'
|
26
27
|
|
@@ -137,7 +138,7 @@ module Glimmer
|
|
137
138
|
|
138
139
|
def build_control
|
139
140
|
@model_handler = ::LibUI::FFI::TableModelHandler.malloc
|
140
|
-
@model_handler.NumColumns = fiddle_closure_block_caller(4) { @columns.map {|c| c.is_a?(DualColumn) ? 2 : 1}.sum }
|
141
|
+
@model_handler.NumColumns = fiddle_closure_block_caller(4) { @columns.map {|c| c.is_a?(DualColumn) ? 2 : (c.is_a?(TripleColumn) ? 3 : 1)}.sum }
|
141
142
|
@model_handler.ColumnType = fiddle_closure_block_caller(4, [1, 1, 4]) do |_, _, column|
|
142
143
|
# TODO consider refactoring to use Glimmer::LibUI.enum_symbols(:table_value_type)
|
143
144
|
case @columns[column]
|
@@ -193,15 +194,27 @@ module Glimmer
|
|
193
194
|
column = @columns[column].index
|
194
195
|
@cell_rows[row] ||= []
|
195
196
|
@cell_rows[row][column] = ::LibUI.table_value_string(val).to_s
|
197
|
+
when Column::TextColorColumnProxy
|
198
|
+
column = @columns[column].index
|
199
|
+
@cell_rows[row] ||= []
|
200
|
+
@cell_rows[row][column] ||= []
|
201
|
+
@cell_rows[row][column][0] = ::LibUI.table_value_string(val).to_s
|
196
202
|
when :text
|
197
203
|
column = @columns[column - 1].index
|
204
|
+
@cell_rows[row] ||= []
|
205
|
+
@cell_rows[row][column] ||= []
|
198
206
|
@cell_rows[row][column][1] = ::LibUI.table_value_string(val).to_s
|
199
207
|
when Column::ButtonColumnProxy
|
200
208
|
@columns[column].notify_listeners(:on_clicked, row)
|
201
|
-
when Column::CheckboxColumnProxy
|
209
|
+
when Column::CheckboxColumnProxy
|
202
210
|
column = @columns[column].index
|
203
211
|
@cell_rows[row] ||= []
|
204
212
|
@cell_rows[row][column] = ::LibUI.table_value_int(val).to_i == 1
|
213
|
+
when Column::CheckboxTextColumnProxy
|
214
|
+
column = @columns[column].index
|
215
|
+
@cell_rows[row] ||= []
|
216
|
+
@cell_rows[row][column] ||= []
|
217
|
+
@cell_rows[row][column][0] = ::LibUI.table_value_int(val).to_i == 1
|
205
218
|
end
|
206
219
|
on_edited.each {|listener| listener.call(row, @cell_rows[row])}
|
207
220
|
end
|
@@ -45,7 +45,7 @@ module Glimmer
|
|
45
45
|
|
46
46
|
def destroy
|
47
47
|
super
|
48
|
-
ControlProxy.image_proxies.each { |image_proxy| ::LibUI.free_image(image_proxy.libui) }
|
48
|
+
ControlProxy.image_proxies.each { |image_proxy| ::LibUI.free_image(image_proxy.libui) unless image_proxy.area_image? }
|
49
49
|
@on_destroy_procs&.each { |on_destroy_proc| on_destroy_proc.call(self)}
|
50
50
|
end
|
51
51
|
|
@@ -27,8 +27,8 @@ module Glimmer
|
|
27
27
|
class ControlProxy
|
28
28
|
class << self
|
29
29
|
def exists?(keyword)
|
30
|
-
::LibUI.respond_to?("new_#{keyword}")
|
31
|
-
::LibUI.respond_to?(keyword)
|
30
|
+
::LibUI.respond_to?("new_#{keyword}") or
|
31
|
+
::LibUI.respond_to?(keyword) or
|
32
32
|
descendant_keyword_constant_map.keys.include?(keyword)
|
33
33
|
end
|
34
34
|
|
@@ -207,11 +207,11 @@ module Glimmer
|
|
207
207
|
end
|
208
208
|
|
209
209
|
def respond_to_libui?(method_name, *args, &block)
|
210
|
-
::LibUI.respond_to?("control_#{method_name}")
|
211
|
-
(::LibUI.respond_to?("control_#{method_name.to_s.sub(/\?$/, '')}") && BOOLEAN_PROPERTIES.include?(method_name.to_s.sub(/\?$/, '')) )
|
212
|
-
::LibUI.respond_to?("control_set_#{method_name.to_s.sub(/=$/, '')}")
|
213
|
-
::LibUI.respond_to?("#{libui_api_keyword}_#{method_name}")
|
214
|
-
(::LibUI.respond_to?("#{libui_api_keyword}_#{method_name.to_s.sub(/\?$/, '')}") && BOOLEAN_PROPERTIES.include?(method_name.to_s.sub(/\?$/, '')) )
|
210
|
+
::LibUI.respond_to?("control_#{method_name}") or
|
211
|
+
(::LibUI.respond_to?("control_#{method_name.to_s.sub(/\?$/, '')}") && BOOLEAN_PROPERTIES.include?(method_name.to_s.sub(/\?$/, '')) ) or
|
212
|
+
::LibUI.respond_to?("control_set_#{method_name.to_s.sub(/=$/, '')}") or
|
213
|
+
::LibUI.respond_to?("#{libui_api_keyword}_#{method_name}") or
|
214
|
+
(::LibUI.respond_to?("#{libui_api_keyword}_#{method_name.to_s.sub(/\?$/, '')}") && BOOLEAN_PROPERTIES.include?(method_name.to_s.sub(/\?$/, '')) ) or
|
215
215
|
::LibUI.respond_to?("#{libui_api_keyword}_set_#{method_name.to_s.sub(/=$/, '')}")
|
216
216
|
end
|
217
217
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Glimmer
|
2
|
+
module LibUI
|
3
|
+
class ImagePathRenderer
|
4
|
+
include Glimmer
|
5
|
+
|
6
|
+
def initialize(area_proxy, shapes)
|
7
|
+
@area_proxy = area_proxy
|
8
|
+
@shapes = shapes
|
9
|
+
end
|
10
|
+
|
11
|
+
def render
|
12
|
+
work = Proc.new do
|
13
|
+
@shapes.each do |shape|
|
14
|
+
path {
|
15
|
+
rectangle(shape[:x], shape[:y], shape[:width], shape[:height])
|
16
|
+
|
17
|
+
fill shape[:color]
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
if @area_proxy.nil?
|
22
|
+
# Ensure it renders without a parent
|
23
|
+
Glimmer::DSL::Engine.add_content(nil, Glimmer::DSL::Libui::ControlExpression.new, 'image', &work)
|
24
|
+
else
|
25
|
+
work.call
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/glimmer/libui/shape.rb
CHANGED
@@ -73,12 +73,22 @@ module Glimmer
|
|
73
73
|
@args = args
|
74
74
|
@block = block
|
75
75
|
set_parameter_defaults
|
76
|
+
build_control if implicit_path?
|
76
77
|
post_add_content if @block.nil?
|
77
78
|
end
|
78
79
|
|
79
80
|
# Subclasses may override to perform post add_content work (normally must call super)
|
80
81
|
def post_add_content
|
81
82
|
@parent&.post_initialize_child(self)
|
83
|
+
@parent.post_add_content if implicit_path? && dynamic?
|
84
|
+
end
|
85
|
+
|
86
|
+
def post_initialize_child(child, add_child: true)
|
87
|
+
if child.is_a?(ControlProxy::MatrixProxy)
|
88
|
+
path_proxy.post_initialize_child(child, add_child: add_child)
|
89
|
+
else
|
90
|
+
super(child, add_child: add_child)
|
91
|
+
end
|
82
92
|
end
|
83
93
|
|
84
94
|
# Subclasses must override to perform draw work and call super afterwards to ensure calling destroy when semi-declarative in an on_draw method
|
@@ -105,6 +115,24 @@ module Glimmer
|
|
105
115
|
def path_proxy
|
106
116
|
find_parent_in_ancestors { |parent| parent.nil? || parent.is_a?(ControlProxy::PathProxy) }
|
107
117
|
end
|
118
|
+
|
119
|
+
def fill(*args)
|
120
|
+
path_proxy.fill(*args)
|
121
|
+
end
|
122
|
+
alias fill= fill
|
123
|
+
alias set_fill fill
|
124
|
+
|
125
|
+
def stroke(*args)
|
126
|
+
path_proxy.stroke(*args)
|
127
|
+
end
|
128
|
+
alias stroke= stroke
|
129
|
+
alias set_stroke stroke
|
130
|
+
|
131
|
+
def transform(matrix = nil)
|
132
|
+
path_proxy.transform(matrix)
|
133
|
+
end
|
134
|
+
alias transform= transform
|
135
|
+
alias set_transform transform
|
108
136
|
|
109
137
|
def respond_to?(method_name, *args, &block)
|
110
138
|
self.class.parameters.include?(method_name.to_s.sub(/=$/, '').sub(/^set_/, '').to_sym) or
|
@@ -117,6 +145,7 @@ module Glimmer
|
|
117
145
|
method_name = method_name.to_s
|
118
146
|
parameter_index = self.class.parameters.index(method_name_parameter)
|
119
147
|
if method_name.start_with?('set_') || method_name.end_with?('=') || !args.empty?
|
148
|
+
args = [args] if args.size > 1
|
120
149
|
if args.first != @args[parameter_index]
|
121
150
|
@args[parameter_index] = args.first
|
122
151
|
request_auto_redraw
|
@@ -124,13 +153,27 @@ module Glimmer
|
|
124
153
|
else
|
125
154
|
@args[parameter_index]
|
126
155
|
end
|
127
|
-
else
|
156
|
+
else # TODO consider if there is a need to redirect anything to path proxy or delete this TODO
|
128
157
|
super
|
129
158
|
end
|
130
159
|
end
|
131
160
|
|
132
161
|
private
|
133
162
|
|
163
|
+
def build_control
|
164
|
+
block = Proc.new {} if dynamic?
|
165
|
+
@parent = Glimmer::LibUI::ControlProxy::PathProxy.new('path', @parent, [], &block)
|
166
|
+
end
|
167
|
+
|
168
|
+
# indicates if nested directly under area or on_draw event (having an implicit path not an explicit path parent)
|
169
|
+
def implicit_path?
|
170
|
+
@implicit_path ||= !!(@parent.is_a?(Glimmer::LibUI::ControlProxy::AreaProxy) || (@parent.nil? && Glimmer::LibUI::ControlProxy::AreaProxy.current_area_draw_params))
|
171
|
+
end
|
172
|
+
|
173
|
+
def dynamic?
|
174
|
+
((@parent.nil? || (@parent.is_a?(ControlProxy::PathProxy) && @parent.parent_proxy.nil?)) && Glimmer::LibUI::ControlProxy::AreaProxy.current_area_draw_params)
|
175
|
+
end
|
176
|
+
|
134
177
|
def set_parameter_defaults
|
135
178
|
self.class.parameter_defaults.each_with_index do |default, i|
|
136
179
|
@args[i] ||= default
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-libui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.5.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.5.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: os
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,6 +72,20 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: 0.0.12
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: chunky_png
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 1.4.0
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.4.0
|
75
89
|
- !ruby/object:Gem::Dependency
|
76
90
|
name: juwelier
|
77
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,20 +190,6 @@ dependencies:
|
|
176
190
|
- - "~>"
|
177
191
|
- !ruby/object:Gem::Version
|
178
192
|
version: 0.7.0
|
179
|
-
- !ruby/object:Gem::Dependency
|
180
|
-
name: chunky_png
|
181
|
-
requirement: !ruby/object:Gem::Requirement
|
182
|
-
requirements:
|
183
|
-
- - "~>"
|
184
|
-
- !ruby/object:Gem::Version
|
185
|
-
version: 1.4.0
|
186
|
-
type: :development
|
187
|
-
prerelease: false
|
188
|
-
version_requirements: !ruby/object:Gem::Requirement
|
189
|
-
requirements:
|
190
|
-
- - "~>"
|
191
|
-
- !ruby/object:Gem::Version
|
192
|
-
version: 1.4.0
|
193
193
|
description: Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI
|
194
194
|
Library) - No need to pre-install any prerequisites. Just install the gem and have
|
195
195
|
platform-independent native GUI that just works! Glimmer DSL for LibUI aims to provide
|
@@ -221,15 +221,24 @@ files:
|
|
221
221
|
- examples/basic_draw_text.rb
|
222
222
|
- examples/basic_draw_text2.rb
|
223
223
|
- examples/basic_entry.rb
|
224
|
+
- examples/basic_image.rb
|
225
|
+
- examples/basic_image2.rb
|
226
|
+
- examples/basic_image3.rb
|
227
|
+
- examples/basic_image4.rb
|
228
|
+
- examples/basic_image5.rb
|
224
229
|
- examples/basic_table.rb
|
225
230
|
- examples/basic_table_button.rb
|
226
231
|
- examples/basic_table_checkbox.rb
|
227
232
|
- examples/basic_table_checkbox_text.rb
|
228
233
|
- examples/basic_table_color.rb
|
234
|
+
- examples/basic_table_color2.rb
|
229
235
|
- examples/basic_table_image.rb
|
236
|
+
- examples/basic_table_image2.rb
|
230
237
|
- examples/basic_table_image_text.rb
|
238
|
+
- examples/basic_table_image_text2.rb
|
231
239
|
- examples/basic_table_progress_bar.rb
|
232
240
|
- examples/basic_transform.rb
|
241
|
+
- examples/basic_transform2.rb
|
233
242
|
- examples/basic_window.rb
|
234
243
|
- examples/basic_window2.rb
|
235
244
|
- examples/color_button.rb
|
@@ -347,6 +356,7 @@ files:
|
|
347
356
|
- lib/glimmer/libui/control_proxy/transformable.rb
|
348
357
|
- lib/glimmer/libui/control_proxy/triple_column.rb
|
349
358
|
- lib/glimmer/libui/control_proxy/window_proxy.rb
|
359
|
+
- lib/glimmer/libui/image_path_renderer.rb
|
350
360
|
- lib/glimmer/libui/parent.rb
|
351
361
|
- lib/glimmer/libui/shape.rb
|
352
362
|
- lib/glimmer/libui/shape/arc.rb
|
@@ -385,7 +395,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
385
395
|
- !ruby/object:Gem::Version
|
386
396
|
version: '0'
|
387
397
|
requirements: []
|
388
|
-
rubygems_version: 3.2.
|
398
|
+
rubygems_version: 3.2.31
|
389
399
|
signing_key:
|
390
400
|
specification_version: 4
|
391
401
|
summary: Glimmer DSL for LibUI
|