shoes-swt 4.0.0.pre12 → 4.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/shoes-swt +1 -0
- data/lib/shoes/swt.rb +3 -1
- data/lib/shoes/swt/animation.rb +1 -0
- data/lib/shoes/swt/app.rb +12 -11
- data/lib/shoes/swt/arc.rb +1 -0
- data/lib/shoes/swt/arc_painter.rb +4 -3
- data/lib/shoes/swt/arrow.rb +1 -0
- data/lib/shoes/swt/arrow_painter.rb +10 -5
- data/lib/shoes/swt/background.rb +1 -0
- data/lib/shoes/swt/border.rb +1 -0
- data/lib/shoes/swt/button.rb +1 -0
- data/lib/shoes/swt/check.rb +1 -0
- data/lib/shoes/swt/check_button.rb +1 -0
- data/lib/shoes/swt/click_listener.rb +1 -0
- data/lib/shoes/swt/color.rb +1 -0
- data/lib/shoes/swt/color_factory.rb +1 -0
- data/lib/shoes/swt/common/clickable.rb +1 -0
- data/lib/shoes/swt/common/container.rb +1 -0
- data/lib/shoes/swt/common/fill.rb +2 -1
- data/lib/shoes/swt/common/focus.rb +5 -0
- data/lib/shoes/swt/common/image_handling.rb +11 -5
- data/lib/shoes/swt/common/painter.rb +21 -1
- data/lib/shoes/swt/common/painter_updates_position.rb +1 -0
- data/lib/shoes/swt/common/remove.rb +16 -3
- data/lib/shoes/swt/common/resource.rb +1 -0
- data/lib/shoes/swt/common/selection_listener.rb +1 -0
- data/lib/shoes/swt/common/stroke.rb +1 -0
- data/lib/shoes/swt/common/translate.rb +1 -0
- data/lib/shoes/swt/common/update_position.rb +1 -0
- data/lib/shoes/swt/common/visibility.rb +7 -2
- data/lib/shoes/swt/dialog.rb +1 -0
- data/lib/shoes/swt/disposed_protection.rb +1 -0
- data/lib/shoes/swt/download.rb +1 -0
- data/lib/shoes/swt/font.rb +1 -0
- data/lib/shoes/swt/generate_backend.rb +10 -10
- data/lib/shoes/swt/gradient.rb +24 -6
- data/lib/shoes/swt/image.rb +6 -10
- data/lib/shoes/swt/image_painter.rb +26 -0
- data/lib/shoes/swt/image_pattern.rb +1 -0
- data/lib/shoes/swt/input_box.rb +1 -0
- data/lib/shoes/swt/key_listener.rb +6 -5
- data/lib/shoes/swt/line.rb +1 -0
- data/lib/shoes/swt/line_painter.rb +3 -2
- data/lib/shoes/swt/link.rb +1 -0
- data/lib/shoes/swt/link_segment.rb +1 -0
- data/lib/shoes/swt/list_box.rb +1 -0
- data/lib/shoes/swt/mouse_move_listener.rb +1 -0
- data/lib/shoes/swt/oval.rb +1 -0
- data/lib/shoes/swt/oval_painter.rb +4 -3
- data/lib/shoes/swt/packager.rb +1 -0
- data/lib/shoes/swt/progress.rb +1 -0
- data/lib/shoes/swt/radio.rb +4 -3
- data/lib/shoes/swt/radio_group.rb +1 -0
- data/lib/shoes/swt/rect.rb +1 -2
- data/lib/shoes/swt/rect_painter.rb +3 -2
- data/lib/shoes/swt/redrawing_aspect.rb +16 -12
- data/lib/shoes/swt/shape.rb +5 -3
- data/lib/shoes/swt/shape_painter.rb +12 -0
- data/lib/shoes/swt/shoes_layout.rb +1 -0
- data/lib/shoes/swt/slot.rb +24 -13
- data/lib/shoes/swt/sound.rb +1 -1
- data/lib/shoes/swt/star.rb +1 -0
- data/lib/shoes/swt/star_painter.rb +2 -1
- data/lib/shoes/swt/swt_button.rb +1 -0
- data/lib/shoes/swt/text_block.rb +1 -0
- data/lib/shoes/swt/text_block/centered_text_segment.rb +1 -0
- data/lib/shoes/swt/text_block/cursor_painter.rb +1 -0
- data/lib/shoes/swt/text_block/fitter.rb +1 -0
- data/lib/shoes/swt/text_block/painter.rb +1 -0
- data/lib/shoes/swt/text_block/text_font_factory.rb +2 -0
- data/lib/shoes/swt/text_block/text_segment.rb +1 -0
- data/lib/shoes/swt/text_block/text_segment_collection.rb +1 -0
- data/lib/shoes/swt/text_block/text_style_factory.rb +1 -0
- data/lib/shoes/swt/timer.rb +1 -0
- data/lib/shoes/swt/tooling/leak_hunter.rb +1 -0
- data/lib/shoes/swt/version.rb +1 -1
- metadata +7 -6
data/lib/shoes/swt/shape.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
class Shoes
|
3
4
|
module Swt
|
4
5
|
class Shape
|
@@ -20,7 +21,9 @@ class Shoes
|
|
20
21
|
@app = app
|
21
22
|
@element = ::Swt::Path.new(::Swt.display)
|
22
23
|
@painter = ShapePainter.new(self)
|
24
|
+
@transform = nil
|
23
25
|
@app.add_paint_listener @painter
|
26
|
+
@scroll_top_applied = nil
|
24
27
|
end
|
25
28
|
|
26
29
|
def dispose
|
@@ -28,9 +31,8 @@ class Shoes
|
|
28
31
|
@element.dispose unless @element.nil? || @element.disposed?
|
29
32
|
end
|
30
33
|
|
31
|
-
attr_reader :dsl, :app
|
32
|
-
|
33
|
-
attr_reader :painter
|
34
|
+
attr_reader :dsl, :app, :element, :painter
|
35
|
+
attr_accessor :scroll_top_applied
|
34
36
|
|
35
37
|
def redraw_target
|
36
38
|
@dsl
|
@@ -1,7 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
class Shoes
|
3
4
|
module Swt
|
4
5
|
class ShapePainter < Common::Painter
|
6
|
+
def before_painted
|
7
|
+
if @obj.scroll_top_applied != @obj.dsl.parent.scroll_top
|
8
|
+
# Put back what we've already done
|
9
|
+
@obj.transform.translate(0, @obj.scroll_top_applied) if @obj.scroll_top_applied
|
10
|
+
|
11
|
+
# Move it!
|
12
|
+
@obj.transform.translate(0, -@obj.dsl.parent.scroll_top)
|
13
|
+
@obj.scroll_top_applied = @obj.dsl.parent.scroll_top
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
5
17
|
def fill(gc)
|
6
18
|
gc.fill_path(@obj.element)
|
7
19
|
end
|
data/lib/shoes/swt/slot.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
class Shoes
|
3
4
|
module Swt
|
4
5
|
class Slot
|
@@ -14,27 +15,37 @@ class Shoes
|
|
14
15
|
@real = parent.real
|
15
16
|
|
16
17
|
@app = @parent.app
|
18
|
+
|
19
|
+
@scroll = ::Swt::Widgets::Slider.new(@app.real, ::Swt::SWT::VERTICAL)
|
20
|
+
@scroll.add_selection_listener do |_event|
|
21
|
+
update_scroll
|
22
|
+
end
|
17
23
|
end
|
18
24
|
|
19
25
|
# needed by Layouter code, but slots are no physical elements so they
|
20
26
|
def update_position
|
21
27
|
end
|
22
28
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
#
|
28
|
-
|
29
|
-
# Only alter contents on a visibility change
|
30
|
-
return if @last_hidden_state == dsl.hidden?
|
29
|
+
def update_scroll
|
30
|
+
@dsl.scroll_top = @scroll.selection
|
31
|
+
end
|
32
|
+
|
33
|
+
# This is more than the scrollbar is expected to be on any OS
|
34
|
+
SCROLLBAR_MAX_WIDTH = 20
|
31
35
|
|
32
|
-
|
36
|
+
# For some reason, if we set max to match, you can't get past last 10!
|
37
|
+
SCROLLBAR_PADDING = 10
|
38
|
+
|
39
|
+
def update_visibility
|
40
|
+
@scroll.set_visible(@dsl.scroll && @dsl.scroll_max.positive?)
|
33
41
|
|
34
|
-
if @
|
35
|
-
dsl.
|
36
|
-
|
37
|
-
dsl.
|
42
|
+
if @dsl.scroll
|
43
|
+
@scroll.selection = @dsl.scroll_top
|
44
|
+
@scroll.maximum = @dsl.scroll_max + SCROLLBAR_PADDING
|
45
|
+
@scroll.set_bounds @dsl.element_right - SCROLLBAR_MAX_WIDTH + 1,
|
46
|
+
@dsl.element_top,
|
47
|
+
SCROLLBAR_MAX_WIDTH,
|
48
|
+
@dsl.element_height
|
38
49
|
end
|
39
50
|
end
|
40
51
|
|
data/lib/shoes/swt/sound.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
# JavaZOOM Sound-API Projects
|
3
4
|
# - Shared lib
|
4
5
|
require 'shoes/swt/support/tritonus_share.jar'
|
@@ -43,7 +44,6 @@ class Shoes
|
|
43
44
|
# Play now.
|
44
45
|
rawplay(decoded_audio_format, decoded_audio_input_stream)
|
45
46
|
audio_input_stream.close
|
46
|
-
|
47
47
|
rescue UnsupportedAudioFileException => uafex
|
48
48
|
puts uafex.inspect, uafex.backtrace
|
49
49
|
rescue IOException => ioex
|
data/lib/shoes/swt/star.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
class Shoes
|
3
4
|
module Swt
|
4
5
|
class StarPainter < Common::Painter
|
@@ -15,7 +16,7 @@ class Shoes
|
|
15
16
|
inner = obj.inner
|
16
17
|
points = obj.points
|
17
18
|
left = obj.translate_left + obj.element_left
|
18
|
-
top = obj.translate_top +
|
19
|
+
top = obj.translate_top + drawing_top
|
19
20
|
@polygon = []
|
20
21
|
add_edge(left, top + outer)
|
21
22
|
(1..points * 2).each do |i|
|
data/lib/shoes/swt/swt_button.rb
CHANGED
data/lib/shoes/swt/text_block.rb
CHANGED
data/lib/shoes/swt/timer.rb
CHANGED
data/lib/shoes/swt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoes-swt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.
|
4
|
+
version: 4.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Team Shoes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - '='
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 4.0.0.
|
46
|
+
version: 4.0.0.rc1
|
47
47
|
name: shoes-core
|
48
48
|
prerelease: false
|
49
49
|
type: :runtime
|
@@ -51,13 +51,13 @@ dependencies:
|
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 4.0.0.
|
54
|
+
version: 4.0.0.rc1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - '='
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 4.0.0.
|
60
|
+
version: 4.0.0.rc1
|
61
61
|
name: shoes-package
|
62
62
|
prerelease: false
|
63
63
|
type: :runtime
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 4.0.0.
|
68
|
+
version: 4.0.0.rc1
|
69
69
|
description: A JRuby and Swt backend for Shoes, the best little GUI toolkit for Ruby.
|
70
70
|
Shoes makes building for Mac, Windows, and Linux super simple.
|
71
71
|
email:
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- lib/shoes/swt/generate_backend.rb
|
115
115
|
- lib/shoes/swt/gradient.rb
|
116
116
|
- lib/shoes/swt/image.rb
|
117
|
+
- lib/shoes/swt/image_painter.rb
|
117
118
|
- lib/shoes/swt/image_pattern.rb
|
118
119
|
- lib/shoes/swt/input_box.rb
|
119
120
|
- lib/shoes/swt/key_listener.rb
|