gtk3 3.0.8 → 3.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/ext/gtk3/rb-gtk3.c +17 -0
  3. data/lib/gtk3/container.rb +0 -7
  4. data/lib/gtk3/deprecated.rb +3 -3
  5. data/lib/gtk3/image.rb +7 -7
  6. data/lib/gtk3/loader.rb +11 -5
  7. data/lib/gtk3/text-buffer.rb +33 -12
  8. data/lib/gtk3/text-view.rb +53 -0
  9. data/lib/gtk3/tree-model.rb +5 -0
  10. data/lib/gtk3/tree-view.rb +25 -0
  11. data/lib/gtk3/widget.rb +0 -5
  12. data/sample/gtk-demo/TODO +10 -6
  13. data/sample/gtk-demo/application.ui +93 -70
  14. data/sample/gtk-demo/appmenu.ui +19 -0
  15. data/sample/gtk-demo/assistant.rb +1 -0
  16. data/sample/gtk-demo/css_accordion.css +8 -8
  17. data/sample/gtk-demo/css_accordion.rb +2 -2
  18. data/sample/gtk-demo/css_basics.css +1 -1
  19. data/sample/gtk-demo/css_basics.rb +2 -2
  20. data/sample/gtk-demo/css_multiplebgs.rb +2 -2
  21. data/sample/gtk-demo/css_pixbufs.css +2 -2
  22. data/sample/gtk-demo/css_pixbufs.rb +2 -2
  23. data/sample/gtk-demo/css_shadows.css +5 -5
  24. data/sample/gtk-demo/css_shadows.rb +2 -2
  25. data/sample/gtk-demo/cssview.css +5 -5
  26. data/sample/gtk-demo/data/16x16/gtk3-demo-symbolic.symbolic.png +0 -0
  27. data/sample/gtk-demo/data/16x16/gtk3-demo.png +0 -0
  28. data/sample/gtk-demo/data/22x22/gtk3-demo-symbolic.symbolic.png +0 -0
  29. data/sample/gtk-demo/data/22x22/gtk3-demo.png +0 -0
  30. data/sample/gtk-demo/data/24x24/gtk3-demo-symbolic.symbolic.png +0 -0
  31. data/sample/gtk-demo/data/24x24/gtk3-demo.png +0 -0
  32. data/sample/gtk-demo/data/256x256/gtk3-demo-symbolic.symbolic.png +0 -0
  33. data/sample/gtk-demo/data/256x256/gtk3-demo.png +0 -0
  34. data/sample/gtk-demo/data/32x32/gtk3-demo-symbolic.symbolic.png +0 -0
  35. data/sample/gtk-demo/data/32x32/gtk3-demo.png +0 -0
  36. data/sample/gtk-demo/data/48x48/gtk3-demo-symbolic.symbolic.png +0 -0
  37. data/sample/gtk-demo/data/48x48/gtk3-demo.png +0 -0
  38. data/sample/gtk-demo/data/512x512/gtk3-demo-symbolic.symbolic.png +0 -0
  39. data/sample/gtk-demo/data/512x512/gtk3-demo.png +0 -0
  40. data/sample/gtk-demo/data/source.svg +2886 -0
  41. data/sample/gtk-demo/data/symbolic-source.svg +29 -0
  42. data/sample/gtk-demo/demo.gresource.xml +16 -5
  43. data/sample/gtk-demo/demo.ui +1 -0
  44. data/sample/gtk-demo/font_features.rb +1 -1
  45. data/sample/gtk-demo/main.rb +2 -2
  46. data/sample/gtk-demo/main.ui +18 -36
  47. data/sample/gtk-demo/markup.rb +53 -8
  48. data/sample/gtk-demo/markup.txt +2 -2
  49. data/sample/gtk-demo/org.gtk.Demo.gschema.xml +9 -0
  50. data/sample/gtk-demo/pixbufs.rb +105 -145
  51. data/sample/gtk-demo/reset.css +1 -58
  52. data/sample/gtk-demo/rotated_text.rb +119 -55
  53. data/sample/gtk-demo/shortcuts-boxes.ui +167 -0
  54. data/sample/gtk-demo/shortcuts-builder.ui +547 -0
  55. data/sample/gtk-demo/shortcuts-clocks.ui +166 -0
  56. data/sample/gtk-demo/shortcuts-gedit.ui +172 -0
  57. data/sample/gtk-demo/shortcuts.ui +65 -0
  58. data/sample/gtk-demo/stack.ui +5 -5
  59. data/sample/gtk-demo/textscroll.rb +106 -0
  60. data/sample/gtk-demo/theming.ui +58 -22
  61. data/sample/gtk-demo/theming_style_classes.rb +5 -4
  62. data/sample/gtk-demo/transparent.rb +143 -0
  63. data/sample/misc/aboutdialog.rb +1 -1
  64. data/sample/misc/bindings.rb +36 -15
  65. data/sample/misc/combobox.rb +1 -1
  66. data/sample/misc/dnd.rb +3 -3
  67. data/sample/misc/icons-theme-viewer.rb +1 -1
  68. data/sample/misc/iconview.rb +2 -2
  69. data/sample/misc/textbuffer-serialize.rb +18 -14
  70. data/sample/misc/to-drawable.rb +2 -2
  71. data/sample/misc/tooltips.rb +1 -0
  72. data/sample/misc/treeview.rb +1 -1
  73. data/sample/tutorial/README.md +18 -18
  74. data/test/test-gtk-clipboard.rb +1 -1
  75. data/test/test-gtk-combo-box.rb +2 -2
  76. data/test/test-gtk-icon-view.rb +2 -2
  77. data/test/test-gtk-image.rb +1 -1
  78. data/test/test-gtk-list-store.rb +9 -3
  79. data/test/test-gtk-text-view.rb +64 -0
  80. data/test/test-gtk-tree-path.rb +1 -3
  81. data/test/test-gtk-tree-view.rb +97 -0
  82. data/test/test-gtk-window.rb +2 -2
  83. data/test/test-pango-context.rb +56 -0
  84. metadata +44 -17
@@ -87,6 +87,67 @@ class TestGtkTreeView < Test::Unit::TestCase
87
87
  normalized_data)
88
88
  end
89
89
 
90
+ sub_test_case "#expand_row" do
91
+ setup do
92
+ @parent = @store.append(nil)
93
+ @parent[0] = "parent"
94
+ @child = @store.append(@parent)
95
+ @child[0] = "child"
96
+ @grand_child = @store.append(@child)
97
+ @grand_child[0] = "grand child"
98
+ end
99
+
100
+ test "default" do
101
+ @view.expand_row(@parent.path)
102
+ assert do
103
+ @view.row_expanded?(@parent.path)
104
+ end
105
+ assert do
106
+ @view.row_expanded?(@child.path)
107
+ end
108
+ end
109
+
110
+ test "true" do
111
+ @view.expand_row(@parent.path, true)
112
+ assert do
113
+ @view.row_expanded?(@parent.path)
114
+ end
115
+ assert do
116
+ @view.row_expanded?(@child.path)
117
+ end
118
+ end
119
+
120
+ test "false" do
121
+ @view.expand_row(@parent.path, false)
122
+ assert do
123
+ @view.row_expanded?(@parent.path)
124
+ end
125
+ assert do
126
+ not @view.row_expanded?(@child.path)
127
+ end
128
+ end
129
+
130
+ test ":open_all => true" do
131
+ @view.expand_row(@parent.path, :open_all => true)
132
+ assert do
133
+ @view.row_expanded?(@parent.path)
134
+ end
135
+ assert do
136
+ @view.row_expanded?(@child.path)
137
+ end
138
+ end
139
+
140
+ test ":open_all => false" do
141
+ @view.expand_row(@parent.path, :open_all => false)
142
+ assert do
143
+ @view.row_expanded?(@parent.path)
144
+ end
145
+ assert do
146
+ not @view.row_expanded?(@child.path)
147
+ end
148
+ end
149
+ end
150
+
90
151
  test "#row_expanded?" do
91
152
  parent = @store.append(nil)
92
153
  parent[0] = "Hello"
@@ -129,4 +190,40 @@ class TestGtkTreeView < Test::Unit::TestCase
129
190
  end
130
191
  end
131
192
  end
193
+
194
+ sub_test_case "signal" do
195
+ def setup
196
+ @store = Gtk::TreeStore.new(String)
197
+ @view = Gtk::TreeView.new(@store)
198
+
199
+ root = @store.append(nil)
200
+ root[0] = "root"
201
+ child = @store.append(root)
202
+ child[0] = "child"
203
+ grand_child = @store.append(child)
204
+ grand_child[0] = "grand child"
205
+ end
206
+
207
+ test "row-collapsed" do
208
+ @view.expand_all
209
+
210
+ values = []
211
+ @view.signal_connect("row-collapsed") do |_, iter, path|
212
+ values << iter[0]
213
+ end
214
+ @view.collapse_row(Gtk::TreePath.new("0:0"))
215
+ assert_equal(["child"], values)
216
+ end
217
+
218
+ test "row-expanded" do
219
+ @view.collapse_all
220
+
221
+ values = []
222
+ @view.signal_connect("row-expanded") do |_, iter, path|
223
+ values << iter[0]
224
+ end
225
+ @view.expand_row(Gtk::TreePath.new("0"))
226
+ assert_equal(["root", "child"], values)
227
+ end
228
+ end
132
229
  end
@@ -26,8 +26,8 @@ class TestGtkWindow < Test::Unit::TestCase
26
26
  @window.icon = fixture_path("gnome-logo-icon.png")
27
27
  end
28
28
 
29
- test "Gdk::Pixbuf" do
30
- icon = Gdk::Pixbuf.new(fixture_path("gnome-logo-icon.png"))
29
+ test "GdkPixbuf::Pixbuf" do
30
+ icon = GdkPixbuf::Pixbuf.new(:file => fixture_path("gnome-logo-icon.png"))
31
31
  @window.icon = icon
32
32
  end
33
33
  end
@@ -0,0 +1,56 @@
1
+ # Copyright (C) 2016 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class TestPangoContext < Test::Unit::TestCase
18
+ include GtkTestUtils
19
+
20
+ def test_set_shape_renderer
21
+ text = "this is a test"
22
+ label = Gtk::Label.new(text)
23
+ layout = label.layout
24
+
25
+ last_block_arguments = nil
26
+ layout.context.set_shape_renderer do |cr, attr, do_path|
27
+ last_block_arguments = [cr.class, attr.class, do_path]
28
+ end
29
+
30
+ metrics = layout.context.get_metrics(layout.font_description)
31
+ ascent = metrics.ascent
32
+ logical_rect = Pango::Rectangle.new(0, -ascent, ascent, ascent)
33
+ ink_rect = logical_rect.dup
34
+ attrs = Pango::AttrList.new
35
+ attr = Pango::AttrShape.new(ink_rect, logical_rect, "a")
36
+ attr.start_index = text[0, text.index("a")].bytesize
37
+ attr.end_index = attr.start_index + "a".bytesize
38
+ attrs.insert(attr)
39
+ label.attributes = attrs
40
+
41
+ window = Gtk::Window.new
42
+ window.signal_connect("destroy") do
43
+ Gtk.main_quit
44
+ end
45
+ window.add(label)
46
+ GLib::Timeout.add(1000) do
47
+ window.destroy
48
+ GLib::Source::REMOVE
49
+ end
50
+ window.show_all
51
+ Gtk.main
52
+
53
+ assert_equal([Cairo::Context, Pango::AttrShape, false],
54
+ last_block_arguments)
55
+ end
56
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.8
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME2 Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-03 00:00:00.000000000 Z
11
+ date: 2016-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glib2
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.8
19
+ version: 3.0.9
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: 3.0.8
26
+ version: 3.0.9
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gio2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.0.8
33
+ version: 3.0.9
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.0.8
40
+ version: 3.0.9
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: atk
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 3.0.8
47
+ version: 3.0.9
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 3.0.8
54
+ version: 3.0.9
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pango
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 3.0.8
61
+ version: 3.0.9
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 3.0.8
68
+ version: 3.0.9
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: gdk_pixbuf2
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 3.0.8
75
+ version: 3.0.9
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 3.0.8
82
+ version: 3.0.9
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: gdk3
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 3.0.8
89
+ version: 3.0.9
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 3.0.8
96
+ version: 3.0.9
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: gobject-introspection
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 3.0.8
103
+ version: 3.0.9
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 3.0.8
110
+ version: 3.0.9
111
111
  description: Ruby/GTK3 is a Ruby binding of GTK+-3.x.
112
112
  email: ruby-gnome2-devel-en@lists.sourceforge.net
113
113
  executables: []
@@ -184,6 +184,7 @@ files:
184
184
  - lib/gtk3/text-buffer.rb
185
185
  - lib/gtk3/text-iter.rb
186
186
  - lib/gtk3/text-tag-table.rb
187
+ - lib/gtk3/text-view.rb
187
188
  - lib/gtk3/toggle-action.rb
188
189
  - lib/gtk3/toggle-button.rb
189
190
  - lib/gtk3/tool-button.rb
@@ -206,6 +207,7 @@ files:
206
207
  - sample/gtk-demo/alphatest.png
207
208
  - sample/gtk-demo/apple-red.png
208
209
  - sample/gtk-demo/application.ui
210
+ - sample/gtk-demo/appmenu.ui
209
211
  - sample/gtk-demo/assistant.rb
210
212
  - sample/gtk-demo/background.jpg
211
213
  - sample/gtk-demo/brick.png
@@ -255,6 +257,22 @@ files:
255
257
  - sample/gtk-demo/css_shadows.rb
256
258
  - sample/gtk-demo/cssview.css
257
259
  - sample/gtk-demo/cursors.rb
260
+ - sample/gtk-demo/data/16x16/gtk3-demo-symbolic.symbolic.png
261
+ - sample/gtk-demo/data/16x16/gtk3-demo.png
262
+ - sample/gtk-demo/data/22x22/gtk3-demo-symbolic.symbolic.png
263
+ - sample/gtk-demo/data/22x22/gtk3-demo.png
264
+ - sample/gtk-demo/data/24x24/gtk3-demo-symbolic.symbolic.png
265
+ - sample/gtk-demo/data/24x24/gtk3-demo.png
266
+ - sample/gtk-demo/data/256x256/gtk3-demo-symbolic.symbolic.png
267
+ - sample/gtk-demo/data/256x256/gtk3-demo.png
268
+ - sample/gtk-demo/data/32x32/gtk3-demo-symbolic.symbolic.png
269
+ - sample/gtk-demo/data/32x32/gtk3-demo.png
270
+ - sample/gtk-demo/data/48x48/gtk3-demo-symbolic.symbolic.png
271
+ - sample/gtk-demo/data/48x48/gtk3-demo.png
272
+ - sample/gtk-demo/data/512x512/gtk3-demo-symbolic.symbolic.png
273
+ - sample/gtk-demo/data/512x512/gtk3-demo.png
274
+ - sample/gtk-demo/data/source.svg
275
+ - sample/gtk-demo/data/symbolic-source.svg
258
276
  - sample/gtk-demo/decor1.png
259
277
  - sample/gtk-demo/decor2.png
260
278
  - sample/gtk-demo/default_cursor.png
@@ -340,6 +358,11 @@ files:
340
358
  - sample/gtk-demo/scale.ui
341
359
  - sample/gtk-demo/se_resize_cursor.png
342
360
  - sample/gtk-demo/search_entry2.rb
361
+ - sample/gtk-demo/shortcuts-boxes.ui
362
+ - sample/gtk-demo/shortcuts-builder.ui
363
+ - sample/gtk-demo/shortcuts-clocks.ui
364
+ - sample/gtk-demo/shortcuts-gedit.ui
365
+ - sample/gtk-demo/shortcuts.ui
343
366
  - sample/gtk-demo/sidebar.rb
344
367
  - sample/gtk-demo/sizegroup.rb
345
368
  - sample/gtk-demo/spinbutton.ui
@@ -351,9 +374,11 @@ files:
351
374
  - sample/gtk-demo/test_mod.rb
352
375
  - sample/gtk-demo/text_cursor.png
353
376
  - sample/gtk-demo/textmask.rb
377
+ - sample/gtk-demo/textscroll.rb
354
378
  - sample/gtk-demo/textview.rb
355
379
  - sample/gtk-demo/theming.ui
356
380
  - sample/gtk-demo/theming_style_classes.rb
381
+ - sample/gtk-demo/transparent.rb
357
382
  - sample/gtk-demo/tree_store.rb
358
383
  - sample/gtk-demo/vertical_text_cursor.png
359
384
  - sample/gtk-demo/w_resize_cursor.png
@@ -584,6 +609,7 @@ files:
584
609
  - test/test-gtk-target-entry.rb
585
610
  - test/test-gtk-text-buffer.rb
586
611
  - test/test-gtk-text-tag-table.rb
612
+ - test/test-gtk-text-view.rb
587
613
  - test/test-gtk-toggle-action.rb
588
614
  - test/test-gtk-toggle-button.rb
589
615
  - test/test-gtk-tool-button.rb
@@ -599,6 +625,7 @@ files:
599
625
  - test/test-gtk-widget.rb
600
626
  - test/test-gtk-window.rb
601
627
  - test/test-gtk.rb
628
+ - test/test-pango-context.rb
602
629
  homepage: http://ruby-gnome2.sourceforge.jp/
603
630
  licenses:
604
631
  - LGPLv2.1+
@@ -611,7 +638,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
611
638
  requirements:
612
639
  - - ">="
613
640
  - !ruby/object:Gem::Version
614
- version: 1.9.3
641
+ version: 2.1.0
615
642
  required_rubygems_version: !ruby/object:Gem::Requirement
616
643
  requirements:
617
644
  - - ">="