glimmer-dsl-swt 4.18.4.4 → 4.18.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/LICENSE.txt +20 -20
- data/README.md +43 -5058
- data/RUBY_VERSION +1 -1
- data/VERSION +1 -1
- data/bin/girb +31 -31
- data/bin/girb_runner.rb +34 -34
- data/bin/glimmer +26 -26
- data/docs/reference/GLIMMER_COMMAND.md +591 -0
- data/docs/reference/GLIMMER_CONFIGURATION.md +183 -0
- data/docs/reference/GLIMMER_GIRB.md +30 -0
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +3367 -0
- data/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md +202 -0
- data/docs/reference/GLIMMER_SAMPLES.md +755 -0
- data/docs/reference/GLIMMER_STYLE_GUIDE.md +14 -0
- data/glimmer-dsl-swt.gemspec +22 -7
- data/lib/ext/glimmer.rb +41 -41
- data/lib/ext/glimmer/config.rb +167 -167
- data/lib/ext/rouge/themes/glimmer.rb +29 -29
- data/lib/glimmer-dsl-swt.rb +44 -44
- data/lib/glimmer/Rakefile +26 -26
- data/lib/glimmer/data_binding/list_selection_binding.rb +72 -72
- data/lib/glimmer/data_binding/observable_widget.rb +38 -38
- data/lib/glimmer/data_binding/shine.rb +44 -44
- data/lib/glimmer/data_binding/table_items_binding.rb +89 -89
- data/lib/glimmer/data_binding/tree_items_binding.rb +108 -108
- data/lib/glimmer/data_binding/widget_binding.rb +73 -73
- data/lib/glimmer/dsl/swt/animation_expression.rb +43 -43
- data/lib/glimmer/dsl/swt/async_exec_expression.rb +35 -35
- data/lib/glimmer/dsl/swt/bind_expression.rb +58 -58
- data/lib/glimmer/dsl/swt/block_property_expression.rb +41 -41
- data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +61 -61
- data/lib/glimmer/dsl/swt/color_expression.rb +40 -40
- data/lib/glimmer/dsl/swt/column_properties_expression.rb +45 -45
- data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +67 -67
- data/lib/glimmer/dsl/swt/cursor_expression.rb +44 -44
- data/lib/glimmer/dsl/swt/custom_widget_expression.rb +63 -63
- data/lib/glimmer/dsl/swt/data_binding_expression.rb +55 -55
- data/lib/glimmer/dsl/swt/dialog_expression.rb +48 -48
- data/lib/glimmer/dsl/swt/directory_dialog_expression.rb +48 -48
- data/lib/glimmer/dsl/swt/display_expression.rb +40 -40
- data/lib/glimmer/dsl/swt/dnd_expression.rb +46 -46
- data/lib/glimmer/dsl/swt/dsl.rb +63 -63
- data/lib/glimmer/dsl/swt/exec_expression.rb +55 -55
- data/lib/glimmer/dsl/swt/expand_item_expression.rb +60 -60
- data/lib/glimmer/dsl/swt/file_dialog_expression.rb +48 -48
- data/lib/glimmer/dsl/swt/font_expression.rb +49 -49
- data/lib/glimmer/dsl/swt/image_expression.rb +54 -50
- data/lib/glimmer/dsl/swt/layout_data_expression.rb +46 -46
- data/lib/glimmer/dsl/swt/layout_expression.rb +50 -50
- data/lib/glimmer/dsl/swt/list_selection_data_binding_expression.rb +65 -65
- data/lib/glimmer/dsl/swt/menu_bar_expression.rb +54 -54
- data/lib/glimmer/dsl/swt/menu_expression.rb +53 -53
- data/lib/glimmer/dsl/swt/message_box_expression.rb +54 -54
- data/lib/glimmer/dsl/swt/multiply_expression.rb +53 -53
- data/lib/glimmer/dsl/swt/observe_expression.rb +56 -53
- data/lib/glimmer/dsl/swt/pixel_expression.rb +38 -0
- data/lib/glimmer/dsl/swt/property_expression.rb +46 -46
- data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +62 -61
- data/lib/glimmer/dsl/swt/rgb_expression.rb +33 -33
- data/lib/glimmer/dsl/swt/rgba_expression.rb +33 -33
- data/lib/glimmer/dsl/swt/shape_expression.rb +54 -54
- data/lib/glimmer/dsl/swt/shell_expression.rb +46 -46
- data/lib/glimmer/dsl/swt/swt_expression.rb +46 -46
- data/lib/glimmer/dsl/swt/sync_exec_expression.rb +36 -36
- data/lib/glimmer/dsl/swt/tab_item_expression.rb +54 -54
- data/lib/glimmer/dsl/swt/table_items_data_binding_expression.rb +52 -52
- data/lib/glimmer/dsl/swt/transform_expression.rb +55 -55
- data/lib/glimmer/dsl/swt/tree_items_data_binding_expression.rb +52 -52
- data/lib/glimmer/dsl/swt/tree_properties_expression.rb +47 -47
- data/lib/glimmer/dsl/swt/widget_expression.rb +67 -66
- data/lib/glimmer/dsl/swt/widget_listener_expression.rb +53 -53
- data/lib/glimmer/rake_task.rb +220 -220
- data/lib/glimmer/rake_task/list.rb +97 -97
- data/lib/glimmer/rake_task/package.rb +139 -139
- data/lib/glimmer/rake_task/scaffold.rb +765 -765
- data/lib/glimmer/swt/color_proxy.rb +108 -107
- data/lib/glimmer/swt/cursor_proxy.rb +66 -66
- data/lib/glimmer/swt/custom/animation.rb +245 -243
- data/lib/glimmer/swt/custom/checkbox_group.rb +181 -181
- data/lib/glimmer/swt/custom/code_text.rb +1 -0
- data/lib/glimmer/swt/custom/drawable.rb +97 -49
- data/lib/glimmer/swt/custom/radio_group.rb +177 -176
- data/lib/glimmer/swt/custom/shape.rb +332 -297
- data/lib/glimmer/swt/date_time_proxy.rb +85 -85
- data/lib/glimmer/swt/directory_dialog_proxy.rb +65 -65
- data/lib/glimmer/swt/display_proxy.rb +167 -166
- data/lib/glimmer/swt/dnd_proxy.rb +51 -51
- data/lib/glimmer/swt/expand_item_proxy.rb +97 -97
- data/lib/glimmer/swt/file_dialog_proxy.rb +66 -66
- data/lib/glimmer/swt/font_proxy.rb +94 -94
- data/lib/glimmer/swt/image_proxy.rb +195 -184
- data/lib/glimmer/swt/layout_data_proxy.rb +105 -105
- data/lib/glimmer/swt/layout_proxy.rb +112 -112
- data/lib/glimmer/swt/menu_proxy.rb +126 -126
- data/lib/glimmer/swt/message_box_proxy.rb +89 -89
- data/lib/glimmer/swt/packages.rb +37 -37
- data/lib/glimmer/swt/properties.rb +74 -49
- data/lib/glimmer/swt/sash_form_proxy.rb +53 -53
- data/lib/glimmer/swt/scrolled_composite_proxy.rb +46 -37
- data/lib/glimmer/swt/style_constantizable.rb +157 -157
- data/lib/glimmer/swt/styled_text_proxy.rb +38 -38
- data/lib/glimmer/swt/swt_proxy.rb +59 -59
- data/lib/glimmer/swt/tab_item_proxy.rb +92 -91
- data/lib/glimmer/swt/table_column_proxy.rb +57 -57
- data/lib/glimmer/swt/transform_proxy.rb +109 -109
- data/lib/glimmer/swt/tree_proxy.rb +145 -145
- data/lib/glimmer/swt/widget_listener_proxy.rb +64 -64
- data/lib/glimmer/swt/widget_proxy.rb +977 -957
- data/lib/glimmer/ui/custom_shell.rb +82 -82
- data/lib/glimmer/ui/custom_widget.rb +332 -315
- data/lib/glimmer/util/proc_tracker.rb +39 -39
- data/samples/elaborate/contact_manager.rb +142 -142
- data/samples/elaborate/contact_manager/contact.rb +32 -32
- data/samples/elaborate/contact_manager/contact_manager_presenter.rb +47 -47
- data/samples/elaborate/contact_manager/contact_repository.rb +169 -169
- data/samples/elaborate/login.rb +123 -123
- data/samples/elaborate/mandelbrot_fractal.rb +354 -0
- data/samples/elaborate/tetris.rb +5 -18
- data/samples/elaborate/tetris/model/block.rb +48 -48
- data/samples/elaborate/tetris/model/past_game.rb +39 -39
- data/samples/elaborate/tetris/view/block.rb +1 -1
- data/samples/elaborate/tetris/view/playfield.rb +1 -1
- data/samples/elaborate/tic_tac_toe.rb +76 -76
- data/samples/elaborate/tic_tac_toe/board.rb +145 -145
- data/samples/elaborate/tic_tac_toe/cell.rb +48 -48
- data/samples/elaborate/user_profile.rb +76 -76
- data/samples/hello/hello_browser.rb +31 -31
- data/samples/hello/hello_button.rb +46 -46
- data/samples/hello/hello_canvas.rb +64 -64
- data/samples/hello/hello_canvas_animation.rb +1 -1
- data/samples/hello/hello_checkbox.rb +85 -85
- data/samples/hello/hello_checkbox_group.rb +71 -71
- data/samples/hello/hello_code_text.rb +104 -104
- data/samples/hello/hello_combo.rb +63 -63
- data/samples/hello/hello_computed.rb +96 -96
- data/samples/hello/hello_computed/contact.rb +42 -42
- data/samples/hello/hello_cursor.rb +57 -0
- data/samples/hello/hello_custom_shell.rb +155 -155
- data/samples/hello/hello_custom_widget.rb +86 -86
- data/samples/hello/hello_date_time.rb +63 -63
- data/samples/hello/hello_dialog.rb +78 -78
- data/samples/hello/hello_directory_dialog.rb +60 -60
- data/samples/hello/hello_drag_and_drop.rb +50 -50
- data/samples/hello/hello_expand_bar.rb +110 -110
- data/samples/hello/hello_file_dialog.rb +60 -60
- data/samples/hello/hello_group.rb +104 -104
- data/samples/hello/hello_link.rb +80 -80
- data/samples/hello/hello_list_multi_selection.rb +74 -74
- data/samples/hello/hello_list_single_selection.rb +59 -59
- data/samples/hello/hello_menu_bar.rb +241 -241
- data/samples/hello/hello_message_box.rb +37 -37
- data/samples/hello/hello_pop_up_context_menu.rb +84 -84
- data/samples/hello/hello_radio.rb +108 -108
- data/samples/hello/hello_radio_group.rb +87 -87
- data/samples/hello/hello_sash_form.rb +137 -137
- data/samples/hello/hello_spinner.rb +69 -69
- data/samples/hello/hello_styled_text.rb +138 -138
- data/samples/hello/hello_tab.rb +50 -50
- data/samples/hello/hello_table.rb +1 -1
- data/samples/hello/hello_table/baseball_park.png +0 -0
- data/samples/hello/hello_world.rb +29 -29
- metadata +19 -4
@@ -1,107 +1,108 @@
|
|
1
|
-
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
# a copy of this software and associated documentation files (the
|
5
|
-
# "Software"), to deal in the Software without restriction, including
|
6
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
# the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be
|
12
|
-
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
-
|
22
|
-
require 'glimmer/swt/swt_proxy'
|
23
|
-
require 'glimmer/swt/display_proxy'
|
24
|
-
|
25
|
-
module Glimmer
|
26
|
-
module SWT
|
27
|
-
# Proxy for org.eclipse.swt.graphics.Color
|
28
|
-
#
|
29
|
-
# Invoking `#swt_color` returns the SWT Color object wrapped by this proxy
|
30
|
-
#
|
31
|
-
# Follows the Proxy Design Pattern and Flyweight Design Pattern (caching memoization)
|
32
|
-
class ColorProxy
|
33
|
-
include_package 'org.eclipse.swt.graphics'
|
34
|
-
|
35
|
-
class << self
|
36
|
-
def flyweight(*args)
|
37
|
-
flyweight_color_proxies[args] ||= new(*args)
|
38
|
-
end
|
39
|
-
|
40
|
-
# Flyweight Design Pattern memoization cache. Can be cleared if memory is needed.
|
41
|
-
def flyweight_color_proxies
|
42
|
-
@flyweight_color_proxies ||= {}
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# Initializes a proxy for an SWT Color object
|
47
|
-
#
|
48
|
-
# Takes a standard color single argument, rgba 3 args, or rgba 4 args
|
49
|
-
#
|
50
|
-
# A standard color is a string/symbol representing one of the
|
51
|
-
# SWT.COLOR_*** constants like SWT.COLOR_RED, but in underscored string
|
52
|
-
# format (e.g :color_red).
|
53
|
-
# Glimmer can also accept standard color names without the color_ prefix,
|
54
|
-
# and it will automatically figure out the SWT.COLOR_*** constant
|
55
|
-
# (e.g. :red)
|
56
|
-
#
|
57
|
-
# rgb is 3 arguments representing Red, Green, Blue numeric values
|
58
|
-
#
|
59
|
-
# rgba is 4 arguments representing Red, Green, Blue, and Alpha numeric values
|
60
|
-
#
|
61
|
-
def initialize(*args)
|
62
|
-
@
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
@swt_color =
|
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
|
-
end
|
1
|
+
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require 'glimmer/swt/swt_proxy'
|
23
|
+
require 'glimmer/swt/display_proxy'
|
24
|
+
|
25
|
+
module Glimmer
|
26
|
+
module SWT
|
27
|
+
# Proxy for org.eclipse.swt.graphics.Color
|
28
|
+
#
|
29
|
+
# Invoking `#swt_color` returns the SWT Color object wrapped by this proxy
|
30
|
+
#
|
31
|
+
# Follows the Proxy Design Pattern and Flyweight Design Pattern (caching memoization)
|
32
|
+
class ColorProxy
|
33
|
+
include_package 'org.eclipse.swt.graphics'
|
34
|
+
|
35
|
+
class << self
|
36
|
+
def flyweight(*args)
|
37
|
+
flyweight_color_proxies[args] ||= new(*args)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Flyweight Design Pattern memoization cache. Can be cleared if memory is needed.
|
41
|
+
def flyweight_color_proxies
|
42
|
+
@flyweight_color_proxies ||= {}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes a proxy for an SWT Color object
|
47
|
+
#
|
48
|
+
# Takes a standard color single argument, rgba 3 args, or rgba 4 args
|
49
|
+
#
|
50
|
+
# A standard color is a string/symbol representing one of the
|
51
|
+
# SWT.COLOR_*** constants like SWT.COLOR_RED, but in underscored string
|
52
|
+
# format (e.g :color_red).
|
53
|
+
# Glimmer can also accept standard color names without the color_ prefix,
|
54
|
+
# and it will automatically figure out the SWT.COLOR_*** constant
|
55
|
+
# (e.g. :red)
|
56
|
+
#
|
57
|
+
# rgb is 3 arguments representing Red, Green, Blue numeric values
|
58
|
+
#
|
59
|
+
# rgba is 4 arguments representing Red, Green, Blue, and Alpha numeric values
|
60
|
+
#
|
61
|
+
def initialize(*args)
|
62
|
+
@options = args.last.is_a?(Hash) ? args.pop : {}
|
63
|
+
@args = args
|
64
|
+
@args = @args.first if @args.first.is_a?(Array)
|
65
|
+
ensure_arg_values_within_valid_bounds unless @options[:ensure_bounds] == false
|
66
|
+
end
|
67
|
+
|
68
|
+
def swt_color
|
69
|
+
unless @swt_color
|
70
|
+
case @args.size
|
71
|
+
when 1
|
72
|
+
if @args.first.is_a?(String) || @args.first.is_a?(Symbol)
|
73
|
+
standard_color = @args.first
|
74
|
+
standard_color = "color_#{standard_color}".to_sym unless standard_color.to_s.downcase.include?('color_')
|
75
|
+
@swt_color = DisplayProxy.instance.swt_display.getSystemColor(SWTProxy[standard_color])
|
76
|
+
else
|
77
|
+
@swt_color = @args.first
|
78
|
+
end
|
79
|
+
when 3..4
|
80
|
+
@swt_color = Color.new(*@args)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
@swt_color
|
84
|
+
end
|
85
|
+
|
86
|
+
def method_missing(method, *args, &block)
|
87
|
+
swt_color.send(method, *args, &block)
|
88
|
+
rescue => e
|
89
|
+
Glimmer::Config.logger.debug {"Neither ColorProxy nor #{swt_color.class.name} can handle the method ##{method}"}
|
90
|
+
super
|
91
|
+
end
|
92
|
+
|
93
|
+
def respond_to?(method, *args, &block)
|
94
|
+
super || swt_color.respond_to?(method, *args, &block)
|
95
|
+
end
|
96
|
+
|
97
|
+
private
|
98
|
+
|
99
|
+
def ensure_arg_values_within_valid_bounds
|
100
|
+
if @args.to_a.size >= 3
|
101
|
+
@args = @args.map do |value|
|
102
|
+
[[value, 255].min, 0].max
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -1,66 +1,66 @@
|
|
1
|
-
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
# a copy of this software and associated documentation files (the
|
5
|
-
# "Software"), to deal in the Software without restriction, including
|
6
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
# the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be
|
12
|
-
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
-
|
22
|
-
require 'glimmer/error'
|
23
|
-
require 'glimmer/swt/swt_proxy'
|
24
|
-
require 'glimmer/swt/display_proxy'
|
25
|
-
|
26
|
-
module Glimmer
|
27
|
-
module SWT
|
28
|
-
# Proxy for org.eclipse.swt.graphics.Cursor
|
29
|
-
#
|
30
|
-
# Invoking `#swt_cursor` returns the SWT Cursor object wrapped by this proxy
|
31
|
-
#
|
32
|
-
# Follows the Proxy Design Pattern
|
33
|
-
class CursorProxy
|
34
|
-
CURSOR_STYLES = org.eclipse.swt.SWT.constants.select {|c| c.to_s.downcase.start_with?('cursor_')}.map {|c| c.to_s.downcase.sub('cursor_', '').to_sym}
|
35
|
-
ERROR_INVALID_CURSOR_STYLE = " is an invalid cursor style! Valid values are #{CURSOR_STYLES.map(&:to_s).join(", ")}"
|
36
|
-
|
37
|
-
include_package 'org.eclipse.swt.graphics'
|
38
|
-
|
39
|
-
attr_reader :swt_cursor, :cursor_style
|
40
|
-
|
41
|
-
# Builds a new CursorProxy from passed in cursor SWT style (e.g. :appstarting, :hand, or :help)
|
42
|
-
#
|
43
|
-
# Cursor SWT styles are those that begin with "CURSOR_" prefix
|
44
|
-
#
|
45
|
-
# They are expected to be passed in in short form without the prefix (but would work with the prefix too)
|
46
|
-
def initialize(cursor_style)
|
47
|
-
@cursor_style = cursor_style
|
48
|
-
@cursor_style = SWTProxy.reverse_lookup(@cursor_style).detect { |symbol| symbol.to_s.downcase.start_with?('cursor_') } if cursor_style.is_a?(Integer)
|
49
|
-
@cursor_style = @cursor_style.to_s.downcase
|
50
|
-
@cursor_style = @cursor_style.sub(/^cursor\_/, '') if @cursor_style.start_with?('cursor_')
|
51
|
-
detect_invalid_cursor_style
|
52
|
-
@swt_cursor = DisplayProxy.instance.swt_display.get_system_cursor(SWTProxy[swt_style])
|
53
|
-
end
|
54
|
-
|
55
|
-
def swt_style
|
56
|
-
@swt_style ||= @cursor_style.upcase.start_with?('CURSOR_') ? @cursor_style : "CURSOR_#{@cursor_style}"
|
57
|
-
end
|
58
|
-
|
59
|
-
private
|
60
|
-
|
61
|
-
def detect_invalid_cursor_style
|
62
|
-
raise Error, cursor_style.to_s + ERROR_INVALID_CURSOR_STYLE unless CURSOR_STYLES.include?(cursor_style.to_s.downcase.to_sym)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
1
|
+
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require 'glimmer/error'
|
23
|
+
require 'glimmer/swt/swt_proxy'
|
24
|
+
require 'glimmer/swt/display_proxy'
|
25
|
+
|
26
|
+
module Glimmer
|
27
|
+
module SWT
|
28
|
+
# Proxy for org.eclipse.swt.graphics.Cursor
|
29
|
+
#
|
30
|
+
# Invoking `#swt_cursor` returns the SWT Cursor object wrapped by this proxy
|
31
|
+
#
|
32
|
+
# Follows the Proxy Design Pattern
|
33
|
+
class CursorProxy
|
34
|
+
CURSOR_STYLES = org.eclipse.swt.SWT.constants.select {|c| c.to_s.downcase.start_with?('cursor_')}.map {|c| c.to_s.downcase.sub('cursor_', '').to_sym}
|
35
|
+
ERROR_INVALID_CURSOR_STYLE = " is an invalid cursor style! Valid values are #{CURSOR_STYLES.map(&:to_s).join(", ")}"
|
36
|
+
|
37
|
+
include_package 'org.eclipse.swt.graphics'
|
38
|
+
|
39
|
+
attr_reader :swt_cursor, :cursor_style
|
40
|
+
|
41
|
+
# Builds a new CursorProxy from passed in cursor SWT style (e.g. :appstarting, :hand, or :help)
|
42
|
+
#
|
43
|
+
# Cursor SWT styles are those that begin with "CURSOR_" prefix
|
44
|
+
#
|
45
|
+
# They are expected to be passed in in short form without the prefix (but would work with the prefix too)
|
46
|
+
def initialize(cursor_style)
|
47
|
+
@cursor_style = cursor_style
|
48
|
+
@cursor_style = SWTProxy.reverse_lookup(@cursor_style).detect { |symbol| symbol.to_s.downcase.start_with?('cursor_') } if cursor_style.is_a?(Integer)
|
49
|
+
@cursor_style = @cursor_style.to_s.downcase
|
50
|
+
@cursor_style = @cursor_style.sub(/^cursor\_/, '') if @cursor_style.start_with?('cursor_')
|
51
|
+
detect_invalid_cursor_style
|
52
|
+
@swt_cursor = DisplayProxy.instance.swt_display.get_system_cursor(SWTProxy[swt_style])
|
53
|
+
end
|
54
|
+
|
55
|
+
def swt_style
|
56
|
+
@swt_style ||= @cursor_style.upcase.start_with?('CURSOR_') ? @cursor_style : "CURSOR_#{@cursor_style}"
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def detect_invalid_cursor_style
|
62
|
+
raise Error, cursor_style.to_s + ERROR_INVALID_CURSOR_STYLE unless CURSOR_STYLES.include?(cursor_style.to_s.downcase.to_sym)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -1,243 +1,245 @@
|
|
1
|
-
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
# a copy of this software and associated documentation files (the
|
5
|
-
# "Software"), to deal in the Software without restriction, including
|
6
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
# the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be
|
12
|
-
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
-
|
22
|
-
require 'glimmer/swt/properties'
|
23
|
-
|
24
|
-
module Glimmer
|
25
|
-
module SWT
|
26
|
-
module Custom
|
27
|
-
# Represents an animation declaratively
|
28
|
-
class Animation
|
29
|
-
include Properties
|
30
|
-
|
31
|
-
class << self
|
32
|
-
def schedule_frame_animation(animation, &frame_animation_block)
|
33
|
-
frame_animation_queue(animation).prepend(frame_animation_block)
|
34
|
-
swt_display.async_exec do
|
35
|
-
frame_animation_queue(next_animation)&.pop&.call
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def next_animation
|
40
|
-
animation = nil
|
41
|
-
while frame_animation_queues.values.reduce(:+)&.any? && (animation.nil? || frame_animation_queue(animation).last.nil?)
|
42
|
-
animation = frame_animation_queues.keys[next_animation_index]
|
43
|
-
frame_animation_queues.delete(animation) if frame_animation_queues.values.reduce(:+)&.any? && !animation.nil? && frame_animation_queue(animation).empty?
|
44
|
-
end
|
45
|
-
animation
|
46
|
-
end
|
47
|
-
|
48
|
-
def next_animation_index
|
49
|
-
next_schedule_index % frame_animation_queues.keys.size
|
50
|
-
end
|
51
|
-
|
52
|
-
def next_schedule_index
|
53
|
-
unless defined? @@next_schedule_index
|
54
|
-
@@next_schedule_index = 0
|
55
|
-
else
|
56
|
-
@@next_schedule_index += 1
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def frame_animation_queues
|
61
|
-
unless defined? @@frame_animation_queues
|
62
|
-
@@frame_animation_queues = {}
|
63
|
-
end
|
64
|
-
@@frame_animation_queues
|
65
|
-
end
|
66
|
-
|
67
|
-
def frame_animation_queue(animation)
|
68
|
-
frame_animation_queues[animation] ||= []
|
69
|
-
end
|
70
|
-
|
71
|
-
def swt_display
|
72
|
-
unless defined? @@swt_display
|
73
|
-
@@swt_display = DisplayProxy.instance.swt_display
|
74
|
-
end
|
75
|
-
@@swt_display
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
attr_reader :parent, :options, :frame_index, :cycle
|
80
|
-
alias current_frame_index frame_index
|
81
|
-
attr_accessor :frame_block, :every, :cycle_count, :frame_count, :started, :duration_limit
|
82
|
-
alias started? started
|
83
|
-
# TODO consider supporting an async: false option
|
84
|
-
|
85
|
-
def initialize(parent)
|
86
|
-
@parent = parent
|
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
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
@
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
end
|
1
|
+
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require 'glimmer/swt/properties'
|
23
|
+
|
24
|
+
module Glimmer
|
25
|
+
module SWT
|
26
|
+
module Custom
|
27
|
+
# Represents an animation declaratively
|
28
|
+
class Animation
|
29
|
+
include Properties
|
30
|
+
|
31
|
+
class << self
|
32
|
+
def schedule_frame_animation(animation, &frame_animation_block)
|
33
|
+
frame_animation_queue(animation).prepend(frame_animation_block)
|
34
|
+
swt_display.async_exec do
|
35
|
+
frame_animation_queue(next_animation)&.pop&.call
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def next_animation
|
40
|
+
animation = nil
|
41
|
+
while frame_animation_queues.values.reduce(:+)&.any? && (animation.nil? || frame_animation_queue(animation).last.nil?)
|
42
|
+
animation = frame_animation_queues.keys[next_animation_index]
|
43
|
+
frame_animation_queues.delete(animation) if frame_animation_queues.values.reduce(:+)&.any? && !animation.nil? && frame_animation_queue(animation).empty?
|
44
|
+
end
|
45
|
+
animation
|
46
|
+
end
|
47
|
+
|
48
|
+
def next_animation_index
|
49
|
+
next_schedule_index % frame_animation_queues.keys.size
|
50
|
+
end
|
51
|
+
|
52
|
+
def next_schedule_index
|
53
|
+
unless defined? @@next_schedule_index
|
54
|
+
@@next_schedule_index = 0
|
55
|
+
else
|
56
|
+
@@next_schedule_index += 1
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def frame_animation_queues
|
61
|
+
unless defined? @@frame_animation_queues
|
62
|
+
@@frame_animation_queues = {}
|
63
|
+
end
|
64
|
+
@@frame_animation_queues
|
65
|
+
end
|
66
|
+
|
67
|
+
def frame_animation_queue(animation)
|
68
|
+
frame_animation_queues[animation] ||= []
|
69
|
+
end
|
70
|
+
|
71
|
+
def swt_display
|
72
|
+
unless defined? @@swt_display
|
73
|
+
@@swt_display = DisplayProxy.instance.swt_display
|
74
|
+
end
|
75
|
+
@@swt_display
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
attr_reader :parent, :options, :frame_index, :cycle
|
80
|
+
alias current_frame_index frame_index
|
81
|
+
attr_accessor :frame_block, :every, :cycle_count, :frame_count, :started, :duration_limit
|
82
|
+
alias started? started
|
83
|
+
# TODO consider supporting an async: false option
|
84
|
+
|
85
|
+
def initialize(parent)
|
86
|
+
@parent = parent
|
87
|
+
@parent.requires_shape_disposal = true
|
88
|
+
@started = true
|
89
|
+
@frame_index = 0
|
90
|
+
@cycle_count_index = 0
|
91
|
+
@start_number = 0 # denotes the number of starts (increments on every start)
|
92
|
+
self.class.swt_display # ensures initializing variable to set from GUI thread
|
93
|
+
end
|
94
|
+
|
95
|
+
def post_add_content
|
96
|
+
if @dispose_listener_registration.nil?
|
97
|
+
@dispose_listener_registration = @parent.on_widget_disposed { stop }
|
98
|
+
start if started?
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# Starts an animation that is indefinite or has never been started before (i.e. having `started: false` option).
|
103
|
+
# Otherwise, resumes a stopped animation that has not been completed.
|
104
|
+
def start
|
105
|
+
return if @start_number > 0 && started?
|
106
|
+
@start_number += 1
|
107
|
+
@started = true
|
108
|
+
@start_time = Time.now
|
109
|
+
@original_start_time = @start_time if @duration.nil?
|
110
|
+
# TODO track when finished in a variable for finite animations (whether by frame count, cycle count, or duration limit)
|
111
|
+
Thread.new do
|
112
|
+
start_number = @start_number
|
113
|
+
if cycle_count.is_a?(Integer) && cycle.is_a?(Array)
|
114
|
+
(cycle_count * cycle.length).times do
|
115
|
+
break unless draw_frame(start_number)
|
116
|
+
end
|
117
|
+
else
|
118
|
+
loop do
|
119
|
+
# this code has to be duplicated to break from a loop (break keyword only works when literally in a loop block)
|
120
|
+
break unless draw_frame(start_number)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
def stop
|
127
|
+
return if stopped?
|
128
|
+
@started = false
|
129
|
+
@duration = (Time.now - @start_time) + @duration.to_f if duration_limited? && !@start_time.nil?
|
130
|
+
end
|
131
|
+
|
132
|
+
# Restarts an animation (whether indefinite or not and whether stopped or not)
|
133
|
+
def restart
|
134
|
+
@original_start_time = @start_time = nil
|
135
|
+
@duration = nil
|
136
|
+
@frame_index = 0
|
137
|
+
@cycle_count_index = 0
|
138
|
+
stop
|
139
|
+
start
|
140
|
+
end
|
141
|
+
|
142
|
+
def stopped?
|
143
|
+
!started?
|
144
|
+
end
|
145
|
+
|
146
|
+
def finite?
|
147
|
+
frame_count_limited? || cycle_limited? || duration_limited?
|
148
|
+
end
|
149
|
+
|
150
|
+
def infinite?
|
151
|
+
!finite?
|
152
|
+
end
|
153
|
+
alias indefinite? infinite?
|
154
|
+
|
155
|
+
def has_attribute?(attribute_name, *args)
|
156
|
+
respond_to?(ruby_attribute_setter(attribute_name)) && respond_to?(ruby_attribute_getter(attribute_name))
|
157
|
+
end
|
158
|
+
|
159
|
+
def set_attribute(attribute_name, *args)
|
160
|
+
send(ruby_attribute_setter(attribute_name), *args)
|
161
|
+
end
|
162
|
+
|
163
|
+
def get_attribute(attribute_name)
|
164
|
+
send(ruby_attribute_getter(attribute_name))
|
165
|
+
end
|
166
|
+
|
167
|
+
def cycle=(*args)
|
168
|
+
if args.size == 1
|
169
|
+
if args.first.is_a?(Array)
|
170
|
+
@cycle = args.first
|
171
|
+
else
|
172
|
+
@cycle = [args.first]
|
173
|
+
end
|
174
|
+
elsif args.size > 1
|
175
|
+
@cycle = args
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
def cycle_enabled?
|
180
|
+
@cycle.is_a?(Array)
|
181
|
+
end
|
182
|
+
|
183
|
+
def cycle_limited?
|
184
|
+
cycle_enabled? && @cycle_count.is_a?(Integer)
|
185
|
+
end
|
186
|
+
|
187
|
+
def duration_limited?
|
188
|
+
@duration_limit.is_a?(Integer)
|
189
|
+
end
|
190
|
+
|
191
|
+
def frame_count_limited?
|
192
|
+
@frame_count.is_a?(Integer)
|
193
|
+
end
|
194
|
+
|
195
|
+
def surpassed_duration_limit?
|
196
|
+
duration_limited? && ((Time.now - @start_time) > (@duration_limit - @duration.to_f))
|
197
|
+
end
|
198
|
+
|
199
|
+
def within_duration_limit?
|
200
|
+
!surpassed_duration_limit?
|
201
|
+
end
|
202
|
+
|
203
|
+
private
|
204
|
+
|
205
|
+
# Returns true on success of painting a frame and false otherwise
|
206
|
+
def draw_frame(start_number)
|
207
|
+
return false if stopped? ||
|
208
|
+
start_number != @start_number ||
|
209
|
+
(frame_count_limited? && @frame_index == @frame_count) ||
|
210
|
+
(cycle_limited? && @cycle_count_index == @cycle_count) ||
|
211
|
+
surpassed_duration_limit?
|
212
|
+
block_args = [@frame_index]
|
213
|
+
block_args << @cycle[@frame_index % @cycle.length] if cycle_enabled?
|
214
|
+
current_frame_index = @frame_index
|
215
|
+
current_cycle_count_index = @cycle_count_index
|
216
|
+
self.class.schedule_frame_animation(self) do
|
217
|
+
if started? && start_number == @start_number && within_duration_limit?
|
218
|
+
unless @parent.isDisposed
|
219
|
+
@parent.clear_shapes # TODO adjust this to clear only the shapes of this animation (not all shapes) to allow simultaneous animations to occur on the same parent
|
220
|
+
@parent.content { frame_block.call(*block_args) }
|
221
|
+
end
|
222
|
+
else
|
223
|
+
if stopped? && @frame_index > current_frame_index
|
224
|
+
@started = false
|
225
|
+
@frame_index = current_frame_index
|
226
|
+
@cycle_count_index = current_cycle_count_index
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
@frame_index += 1
|
231
|
+
@cycle_count_index += 1 if cycle_limited? && (@frame_index % @cycle&.length&.to_i) == 0
|
232
|
+
sleep(every) if every.is_a?(Numeric)
|
233
|
+
true
|
234
|
+
rescue => e
|
235
|
+
Glimmer::Config.logger.error {e}
|
236
|
+
false
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|
240
|
+
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|