gir_ffi-gtk 0.13.0 → 0.13.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e84a1c1fb530cf07ca0c685de398c075279e5f0aad37d5b99d1cb1828baec9c
4
- data.tar.gz: 92bb036950992713f0fe8ae0a46f0cffa9ec294581597f2eae19cfb19a85aa63
3
+ metadata.gz: ff690307c8af4d785db6460b4944c73e7f80b0a5d51e58516d2bd18ad18b27cc
4
+ data.tar.gz: c428003b8da3caa6e48f1b297c79f9c8482d8cbce82a1c05f0748572efa40af5
5
5
  SHA512:
6
- metadata.gz: df68feccf33c8cba1025cd92448b3dd33535364c1abcbdec3b79cb9341d02aa14f8d165a3702f675d180631d013fa7385df374999957a480fbdfb7cd3f9cd444
7
- data.tar.gz: 39e23cb92615d3bd685474147843540dc9cbaf25d2c4a127e939a00d773205696bdaefcbe01cbc86174c99c94a3d3ccb8fecde8766c98a424fc4f54e13345302
6
+ metadata.gz: e12f72f2b557f3e7b0ad3880775f4b9e1aacb34c7c9818f8c3c560d305a820bb50f5af9c69cd215c58d479aa60e7d4f7b15fca76a2a9e2291807b65c6d57fa1a
7
+ data.tar.gz: 2ffba95ce0d0dbf4771321eec7da295d5febee23ca10593eecde56c1a584757d19bbee37fbe4e5f2f5971470e5f8c84042875cefd982ce0356526ce75e4d4266
@@ -3,6 +3,11 @@
3
3
  All notable changes to this project will be documented in this file. See the
4
4
  Git log for all changes.
5
5
 
6
+ ## 0.13.1 / 2018-09-24
7
+
8
+ * Depend on GirFFI 0.13.1
9
+ * Add overrides for some methods that take a Gtk::IconSize parameter
10
+
6
11
  ## 0.13.0 / 2018-09-08
7
12
 
8
13
  * Drop support for Ruby 2.1
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GirFFIGtk
4
+ # Overrides for GtkAction
5
+ module ActionOverrides
6
+ def create_icon(icon_size)
7
+ super Gtk::IconSize.to_int(icon_size)
8
+ end
9
+ end
10
+ end
11
+
12
+ Gtk.load_class :Action
13
+ Gtk::Action.prepend GirFFIGtk::ActionOverrides
@@ -49,6 +49,7 @@ module GirFFIGtk
49
49
  ex = GLib::MainLoop::EXCEPTIONS.shift
50
50
  GLib::MainLoop::RUNNING_LOOPS.pop
51
51
  raise ex if ex
52
+
52
53
  result
53
54
  end
54
55
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GirFFIGtk
4
+ # Overrides for GtkAction class methods
5
+ module ButtonClassOverrides
6
+ def new_from_icon_name(icon_name, size)
7
+ super icon_name, Gtk::IconSize.to_int(size)
8
+ end
9
+ end
10
+ end
11
+
12
+ Gtk.load_class :Button
13
+ Gtk::Button.singleton_class.prepend GirFFIGtk::ButtonClassOverrides
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GirFFIGtk
4
+ # Overrides for GtkImage methods
5
+ module ImageOverrides
6
+ def set_from_gicon(icon, size)
7
+ super icon, Gtk::IconSize.to_int(size)
8
+ end
9
+ end
10
+
11
+ # Overrides for GtkImage class methods
12
+ module ImageClassOverrides
13
+ def new_from_icon_name(icon_name, size)
14
+ super icon_name, Gtk::IconSize.to_int(size)
15
+ end
16
+
17
+ def new_from_gicon(icon, size)
18
+ super icon, Gtk::IconSize.to_int(size)
19
+ end
20
+ end
21
+ end
22
+
23
+ Gtk.load_class :Image
24
+
25
+ Gtk::Image.prepend GirFFIGtk::ImageOverrides
26
+ Gtk::Image.singleton_class.prepend GirFFIGtk::ImageClassOverrides
@@ -5,8 +5,11 @@ require 'gir_ffi'
5
5
  GirFFI.setup :Gtk, '2.0'
6
6
 
7
7
  require 'gir_ffi-gtk/base'
8
+
9
+ require 'gir_ffi-gtk/action'
8
10
  require 'gir_ffi-gtk/builder'
9
11
  require 'gir_ffi-gtk/container'
12
+ require 'gir_ffi-gtk/image'
10
13
  require 'gir_ffi-gtk/list_store'
11
14
  require 'gir_ffi-gtk/menu'
12
15
  require 'gir_ffi-gtk/message_dialog'
@@ -5,8 +5,11 @@ require 'gir_ffi'
5
5
  GirFFI.setup :Gtk, '3.0'
6
6
 
7
7
  require 'gir_ffi-gtk/base'
8
+
9
+ require 'gir_ffi-gtk/action'
8
10
  require 'gir_ffi-gtk/builder'
9
11
  require 'gir_ffi-gtk/container'
12
+ require 'gir_ffi-gtk/image'
10
13
  require 'gir_ffi-gtk/list_store'
11
14
  require 'gir_ffi-gtk/menu'
12
15
  require 'gir_ffi-gtk/message_dialog'
@@ -14,4 +17,5 @@ require 'gir_ffi-gtk/tree_path'
14
17
  require 'gir_ffi-gtk/tree_store'
15
18
  require 'gir_ffi-gtk/tree_view_column'
16
19
 
20
+ require 'gir_ffi-gtk/gtk3/button'
17
21
  require 'gir_ffi-gtk/gtk3/target_entry'
@@ -0,0 +1,17 @@
1
+ require 'test_helper'
2
+
3
+ describe Gtk::Action do
4
+ let(:action) { Gtk::Action.new('hi', 'Hello', 'hey there', Gtk::STOCK_FILE) }
5
+
6
+ describe '#create_icon' do
7
+ it 'works when called with a symbol' do
8
+ result = action.create_icon :dialog
9
+ result.must_be_instance_of Gtk::Image
10
+ end
11
+
12
+ it 'works when called with an integer' do
13
+ result = action.create_icon 4
14
+ result.must_be_instance_of Gtk::Image
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ require 'test_helper'
2
+
3
+ describe Gtk::Button do
4
+ describe '.new_from_icon_name' do
5
+ before do
6
+ skip if Gtk::MAJOR_VERSION == 2 || Gtk::MAJOR_VERSION == 3 && Gtk::MINOR_VERSION < 10
7
+ end
8
+
9
+ it 'works when called with a symbol' do
10
+ result = Gtk::Button.new_from_icon_name('hi', :dialog)
11
+ result.must_be_instance_of Gtk::Button
12
+ end
13
+
14
+ it 'works when called with an integer' do
15
+ result = Gtk::Button.new_from_icon_name('hi', 4)
16
+ result.must_be_instance_of Gtk::Button
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,43 @@
1
+ require 'test_helper'
2
+
3
+ describe Gtk::Image do
4
+ describe '.new_from_icon_name' do
5
+ it 'works when called with a symbol' do
6
+ result = Gtk::Image.new_from_icon_name('hi', :dialog)
7
+ result.must_be_instance_of Gtk::Image
8
+ end
9
+
10
+ it 'works when called with an integer' do
11
+ result = Gtk::Image.new_from_icon_name('hi', 4)
12
+ result.must_be_instance_of Gtk::Image
13
+ end
14
+ end
15
+
16
+ describe '.new_from_gicon' do
17
+ let(:gicon) { Gio::ThemedIcon.new('hi') }
18
+ it 'works when called with a symbol' do
19
+ result = Gtk::Image.new_from_gicon(gicon, :dialog)
20
+ result.must_be_instance_of Gtk::Image
21
+ end
22
+
23
+ it 'works when called with an integer' do
24
+ result = Gtk::Image.new_from_gicon(gicon, 4)
25
+ result.must_be_instance_of Gtk::Image
26
+ end
27
+ end
28
+
29
+ describe '#set_from_gicon' do
30
+ let(:gicon) { Gio::ThemedIcon.new('gnome') }
31
+ let(:image) { Gtk::Image.new }
32
+
33
+ it 'works when called with a symbol' do
34
+ image.set_from_gicon(gicon, :dialog)
35
+ image.get_gicon.must_equal [gicon, 6]
36
+ end
37
+
38
+ it 'works when called with an integer' do
39
+ image.set_from_gicon(gicon, 4)
40
+ image.get_gicon.must_equal [gicon, 4]
41
+ end
42
+ end
43
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi-gtk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matijs van Zuijlen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-08 00:00:00.000000000 Z
11
+ date: 2018-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gir_ffi
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.13.0
19
+ version: 0.13.1
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: 0.13.0
26
+ version: 0.13.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -87,6 +87,7 @@ files:
87
87
  - examples/08_webkit_headless.rb
88
88
  - examples/09_webkit2_headless.rb
89
89
  - examples/10_completion_provider.rb
90
+ - lib/gir_ffi-gtk/action.rb
90
91
  - lib/gir_ffi-gtk/base.rb
91
92
  - lib/gir_ffi-gtk/builder.rb
92
93
  - lib/gir_ffi-gtk/container.rb
@@ -95,7 +96,9 @@ files:
95
96
  - lib/gir_ffi-gtk/gtk2/radio_button.rb
96
97
  - lib/gir_ffi-gtk/gtk2/target_entry.rb
97
98
  - lib/gir_ffi-gtk/gtk2/tree_store.rb
99
+ - lib/gir_ffi-gtk/gtk3/button.rb
98
100
  - lib/gir_ffi-gtk/gtk3/target_entry.rb
101
+ - lib/gir_ffi-gtk/image.rb
99
102
  - lib/gir_ffi-gtk/list_store.rb
100
103
  - lib/gir_ffi-gtk/menu.rb
101
104
  - lib/gir_ffi-gtk/message_dialog.rb
@@ -106,10 +109,13 @@ files:
106
109
  - lib/gir_ffi-gtk3.rb
107
110
  - tasks/test.rake
108
111
  - test/callback_exceptions_test.rb
112
+ - test/gir_ffi-gtk/action_test.rb
109
113
  - test/gir_ffi-gtk/base_test.rb
110
114
  - test/gir_ffi-gtk/builder_test.rb
115
+ - test/gir_ffi-gtk/button_test.rb
111
116
  - test/gir_ffi-gtk/container_test.rb
112
117
  - test/gir_ffi-gtk/generated_gtk_test.rb
118
+ - test/gir_ffi-gtk/image_test.rb
113
119
  - test/gir_ffi-gtk/list_store_test.rb
114
120
  - test/gir_ffi-gtk/menu_test.rb
115
121
  - test/gir_ffi-gtk/message_dialog_test.rb
@@ -146,10 +152,13 @@ specification_version: 4
146
152
  summary: GirFFI-based Ruby bindings for Gtk+ 2 and 3
147
153
  test_files:
148
154
  - test/callback_exceptions_test.rb
155
+ - test/gir_ffi-gtk/action_test.rb
149
156
  - test/gir_ffi-gtk/base_test.rb
150
157
  - test/gir_ffi-gtk/builder_test.rb
158
+ - test/gir_ffi-gtk/button_test.rb
151
159
  - test/gir_ffi-gtk/container_test.rb
152
160
  - test/gir_ffi-gtk/generated_gtk_test.rb
161
+ - test/gir_ffi-gtk/image_test.rb
153
162
  - test/gir_ffi-gtk/list_store_test.rb
154
163
  - test/gir_ffi-gtk/menu_test.rb
155
164
  - test/gir_ffi-gtk/message_dialog_test.rb