gtk2svg 0.3.19 → 0.3.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/gtk2svg.rb +38 -43
  5. metadata +27 -22
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1b9596660f5d99ce677a22cd9aa7074720b30ba3f7ec83f8e76e52cd68196df
4
- data.tar.gz: 5d85c4ecbf1178f3a6f9848a8b00d82c2f16691f9b306cca94ed995f87ff2abe
3
+ metadata.gz: 8b5a118c0868c06925d3a913ddc70520252cf750417619386a0861c15a9b18dc
4
+ data.tar.gz: 767e84933875bebbeaa06ba7e4b46895d5cdcb174b2488d07b1f271feb46f54f
5
5
  SHA512:
6
- metadata.gz: cdf9f7fe4fea456be34bdca25d689f6d8d86637b7b79e4cea5a09945da0291bea87e5f66199e502774923372f5fd8d721eb5a34e09e608fdf768a59bb4874bfb
7
- data.tar.gz: ec6b574a7e920aa4be77e130c2f2ad886dc0497da61265ea07b71c1d1beec82523738d12d5f1b00eddd463dbc001fbc29e463d5b4880aadd031251049fce72ec
6
+ metadata.gz: 9aff8130ed2d5422e8f4119f2bc813631fe350a7d29daef0778283f23547e0205111f9a0b546ea55832442a96d5ea2bfa370d1896a31180308de620243b882d8
7
+ data.tar.gz: ad7e9921a4be4257cff93f79227cb000480a411759efdfce0495356d8562b8e5a020303f7ca0d176f8bcd3bc4da28095dbd288ac979780f6e1c52e7842c7f0c4
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -15,113 +15,94 @@ module Gtk2SVG
15
15
  class Render < DomRender
16
16
 
17
17
 
18
- def circle(e, attributes, raw_style)
19
-
20
- style = style_filter(attributes).merge(raw_style)
18
+ def circle(e, attributes)
21
19
 
22
20
  h = attributes
23
21
 
24
22
  x, y= %i(cx cy).map{|x| h[x].to_i }
25
23
  radius = h[:r].to_i * 2
26
24
 
27
- [:draw_arc, [x, y, radius, radius], style, render_all(e)]
25
+ [:draw_arc, [x, y, radius, radius], attributes, render_all(e)]
28
26
  end
29
27
 
30
- def ellipse(e, attributes, raw_style)
28
+ def ellipse(e, attributes)
31
29
 
32
- style = style_filter(attributes).merge(raw_style)
33
30
  h = attributes
34
31
 
35
32
  x, y= %i(cx cy).map{|x| h[x].to_i }
36
33
  width = h[:rx].to_i * 2
37
34
  height = h[:ry].to_i * 2
38
35
 
39
- [:draw_arc, [x, y, width, height], style, render_all(e)]
36
+ [:draw_arc, [x, y, width, height], attributes, render_all(e)]
40
37
  end
41
38
 
42
- def line(e, attributes, raw_style)
39
+ def line(e, attributes)
43
40
 
44
- style = style_filter(attributes).merge(raw_style)
45
41
 
46
42
  x1, y1, x2, y2 = %i(x1 y1 x2 y2).map{|x| attributes[x].to_i }
47
43
 
48
- [:draw_line, [x1, y1, x2, y2], style, render_all(e)]
44
+ [:draw_line, [x1, y1, x2, y2], attributes, render_all(e)]
49
45
  end
50
46
 
51
- def image(e, attributes, raw_style)
47
+ def image(e, attributes)
52
48
 
53
- style = style_filter(attributes).merge(raw_style)
54
49
  h = attributes
55
50
 
56
51
  x, y, width, height = %i(x y width height).map{|x| h[x] ? h[x].to_i : nil }
57
52
  src = h[:'xlink:href']
58
53
 
59
- [:draw_image, [x, y, width, height], src, style, render_all(e)]
54
+ [:draw_image, [x, y, width, height], src, attributes, render_all(e)]
60
55
  end
61
56
 
62
- def polygon(e, attributes, raw_style)
57
+ def polygon(e, attributes)
63
58
 
64
- style = style_filter(attributes).merge(raw_style)
65
59
  points = attributes[:points].split(/\s+/). \
66
60
  map {|x| x.split(/\s*,\s*/).map(&:to_i)}
67
61
 
68
- [:draw_polygon, points, style, render_all(e)]
62
+ [:draw_polygon, points, attributes, render_all(e)]
69
63
  end
70
64
 
71
- def polyline(e, attributes, raw_style)
65
+ def polyline(e, attributes)
72
66
 
73
- style = style_filter(attributes).merge(raw_style)
74
67
  points = attributes[:points].split(/\s+/). \
75
68
  map {|x| x.split(/\s*,\s*/).map(&:to_i)}
76
69
 
77
- [:draw_lines, points, style, render_all(e)]
70
+ [:draw_lines, points, attributes, render_all(e)]
78
71
  end
79
72
 
80
- def rect(e, attributes, raw_style)
73
+ def rect(e, attributes)
81
74
 
82
- style = style_filter(attributes).merge(raw_style)
75
+ puts 'inside rect'
83
76
  h = attributes
84
77
 
85
78
  x1, y1, width, height = %i(x y width height).map{|x| h[x].to_i }
86
79
  x2, y2, = x1 + width, y1 + height
87
80
 
88
- [:draw_rectangle, [x1, y1, x2, y2], style, render_all(e)]
81
+ [:draw_rectangle, [x1, y1, x2, y2], attributes, render_all(e)]
89
82
  end
90
83
 
91
- def script(e, attributes, style)
84
+ def script(e, attributes)
92
85
  [:script]
93
86
  end
94
87
 
95
- def svg(e, attributes, raw_style)
88
+ def svg(e, attributes)
96
89
 
97
- style = style_filter(attributes).merge(raw_style)
98
90
 
99
91
  # jr051216 style[:fill] = style.delete :'background-color'
100
92
  h = attributes
101
93
  width, height = %i(width height).map{|x| h[x].to_i }
102
94
 
103
- [:draw_rectangle, [0, 0, width, height], style, render_all(e)]
95
+ [:draw_rectangle, [0, 0, width, height], attributes, render_all(e)]
104
96
  end
105
97
 
106
- def text(e, attributes, raw_style)
107
-
108
- style = style_filter(attributes).merge(raw_style)
109
- style.merge!({font_size: '20'})
98
+ def text(e, attributes)
110
99
 
111
100
  x, y = %i(x y).map{|x| attributes[x].to_i }
112
101
 
113
- [:draw_layout, [x, y], e.text, style, render_all(e)]
102
+ [:draw_layout, [x, y], e.text, attributes, render_all(e)]
114
103
  end
115
104
 
116
- private
117
-
118
- def style_filter(attributes)
119
-
120
- %i(stroke stroke-width fill).inject({}) do |r,x|
121
- attributes.has_key?(x) ? r.merge(x => attributes[x]) : r
122
- end
123
-
124
- end
105
+
125
106
 
126
107
  end
127
108
 
@@ -204,7 +185,9 @@ module Gtk2SVG
204
185
 
205
186
  def draw_rectangle(args)
206
187
 
207
- coords, style = args
188
+ puts 'inside draw_rectangle' if @debug
189
+
190
+ coords, style, e = args
208
191
 
209
192
  x1, y1, x2, y2 = coords
210
193
 
@@ -232,7 +215,16 @@ module Gtk2SVG
232
215
  end
233
216
 
234
217
  def render(a)
218
+
219
+ if @debug then
220
+ puts 'inside gtk2svg render '.info
221
+ puts 'a: ' + a.inspect
222
+ end
223
+
235
224
  method(a[0]).call(args=a[1..2])
225
+ puts 'after method' if @debug
226
+ return unless a[3].any?
227
+
236
228
  draw a[3]
237
229
  end
238
230
 
@@ -301,7 +293,7 @@ module Gtk2SVG
301
293
  attr_accessor :doc, :svg
302
294
  attr_reader :width, :height
303
295
 
304
- def initialize(svg, irb: false, title: 'Window', debug: @debug)
296
+ def initialize(svg, irb: false, title: 'window', debug: @debug)
305
297
 
306
298
  @svg, @debug = svg, debug
307
299
  @doc = Svgle.new(svg, callback: self, debug: debug)
@@ -388,7 +380,10 @@ module Gtk2SVG
388
380
 
389
381
  def onmousemove(x,y)
390
382
 
391
- end
383
+ end
384
+
385
+ def refresh()
386
+ end
392
387
 
393
388
  def svg=(svg)
394
389
  @svg = svg
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk2svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.19
4
+ version: 0.3.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,27 +10,32 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDXjCCAkagAwIBAgIBATANBgkqhkiG9w0BAQUFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwODA2MDk1MjE2WhcN
15
- MTkwODA2MDk1MjE2WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggEiMA0GCSqGSIb3DQEBAQUAA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zXr4S0K9oNIfmq+5y4eUQ3
30
+ /eZnDrhLdLN0CfLaT1taKTbnh98wroE44fvW34KOzHEhPx4IL3Bd5jxuztqJRaZW
31
+ NsUP3kOGU/DUK+0/r96bPELVaXYq8AFuQGK13Z/Cr2tM3uX6bLj+tmKx0zOHRBBf
32
+ 8YSz4LRUsv2LMkhdxyQKXEmIgsu9EE1DPu0Jf6DNOsbm/pFQmJ04V5AIoEixNjeZ
33
+ /0gRFIHa6KaTLBTDlD56Vp/KxVAKa4lpIgJd8meNWibAl3URscgQTcKOUpKU0YSU
34
+ +tP3l68P25LjOVqb36q+te45SjB8ATohHZ2kCFc4e5jDB+HX1lwYKqDLTfSd/cuh
35
+ 5C/ULWUz63TixmnPQiXfUV5DTAb+U7xkR+IoF9PZXNzriqakqL6/kvguqZSDiG5K
36
+ C+3upURGHZLC1bs5uIZirvk+
32
37
  -----END CERTIFICATE-----
33
- date: 2019-02-09 00:00:00.000000000 Z
38
+ date: 2020-08-25 00:00:00.000000000 Z
34
39
  dependencies:
35
40
  - !ruby/object:Gem::Dependency
36
41
  name: gtk2
@@ -118,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
123
  - !ruby/object:Gem::Version
119
124
  version: '0'
120
125
  requirements: []
121
- rubygems_version: 3.0.2
126
+ rubygems_version: 3.0.3
122
127
  signing_key:
123
128
  specification_version: 4
124
129
  summary: Renders SVG using GTK2
metadata.gz.sig CHANGED
Binary file