gir_ffi-gtk 0.7.0 → 0.7.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
  SHA1:
3
- metadata.gz: c56a62fd551103e8221e6e65ad13068d6a0af97d
4
- data.tar.gz: e9bff015d8ca92dea4fa765a2e19eb16db54ca19
3
+ metadata.gz: 88100a2341f51b96e708b1b0d47dd6367872266f
4
+ data.tar.gz: d21407d8a6d371b868a3a13f50da70499586a4e5
5
5
  SHA512:
6
- metadata.gz: 91789d145d177a1b418222bed46268d6793d5ff3df7bec731ad685bf724ff03d89f7eeec6659637e9ecc19288c1fa39b5c048b243cd3de7b8df70576bf38c218
7
- data.tar.gz: 30d92df92c4d0d616885c86b626d6f57cd7d01dbc343a4b54242d718ef3b3e08c812f94371f2fec932da136bf1bc990309a8da17a52977a32bea51f1ab71ceb0
6
+ metadata.gz: 237673941e21d3c8397b3767af681d25ff741bfdc360b59d6c912d895ac1821217387fbb6c35efa315c3719e260f288c3307fdba37caf3ff4a6d2355507ab333
7
+ data.tar.gz: b7481e2b68b30b28285e4a4afc2025ecae63ba6dd081990553c2b36fe08e8e1452e77102e1a96797d61c6311bbe20bbbf5ef7e09e6f2dbbf6cc0f2cda80cbe77
data/Changelog.md CHANGED
@@ -1,4 +1,11 @@
1
- ### 0.6.0 / 2013-01-11
1
+ ### 0.7.1 / 2014-03-25
2
+
3
+ * Fix Gtk::Builder#connect_signals_full by updating dependency on GirFFI
4
+ * Only override Gtk::Menu#popup if needed
5
+ * Test both Gtk+ 2 and 3
6
+ * Provide constructors for Gtk::RadioButton if needed
7
+
8
+ ### 0.7.0 / 2014-01-11
2
9
 
3
10
  * Update dependency on GirFFI
4
11
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
- load 'tasks/setup.rb'
1
+ require 'rake/clean'
2
+
3
+ load 'tasks/test.rake'
2
4
 
3
5
  task :default => 'test'
@@ -1,5 +1,3 @@
1
- require 'gir_ffi-gtk/menu'
2
-
3
1
  module Gtk
4
2
  setup_method "init"
5
3
 
@@ -8,12 +6,9 @@ module Gtk
8
6
  remaining.shift
9
7
  ARGV.replace remaining
10
8
  end
9
+
11
10
  class << self
12
11
  alias init_without_auto_argv init
13
12
  alias init init_with_auto_argv
14
13
  end
15
14
  end
16
-
17
- Gtk.class_eval do
18
- end
19
-
@@ -3,11 +3,13 @@ module Gtk
3
3
 
4
4
  # Overrides for GtkMenu
5
5
  class Menu
6
- def popup(parent_menu_shell, parent_menu_item, func, data, button, activate_time)
7
- popup_for_device(nil,
8
- parent_menu_shell, parent_menu_item, func, data,
9
- nil,
10
- button, activate_time)
6
+ unless method_defined? :popup
7
+ def popup(parent_menu_shell, parent_menu_item, func, data, button, activate_time)
8
+ popup_for_device(nil,
9
+ parent_menu_shell, parent_menu_item, func, data,
10
+ nil,
11
+ button, activate_time)
12
+ end
11
13
  end
12
14
  end
13
15
  end
@@ -0,0 +1,26 @@
1
+ module Gtk
2
+ load_class :RadioButton
3
+
4
+ module Lib
5
+ attach_function :gtk_radio_button_new, [:pointer], :pointer
6
+ attach_function :gtk_radio_button_new_from_widget, [:pointer], :pointer
7
+ end
8
+
9
+ # Overrides for GtkRadioButton
10
+ class RadioButton
11
+ def self.new(group)
12
+ _v1 = GLib::SList.from(Gtk::RadioButton, group)
13
+ _v2 = Gtk::Lib.gtk_radio_button_new(_v1)
14
+ _v3 = self.constructor_wrap(_v2)
15
+ return _v3
16
+ end
17
+
18
+ def self.new_from_widget(radio_group_member)
19
+ _v1 = Gtk::RadioButton.from(radio_group_member)
20
+ _v2 = Gtk::Lib.gtk_radio_button_new_from_widget(_v1)
21
+ _v3 = self.constructor_wrap(_v2)
22
+ return _v3
23
+ end
24
+ end
25
+ end
26
+
data/lib/gir_ffi-gtk2.rb CHANGED
@@ -3,3 +3,5 @@ require 'gir_ffi'
3
3
  GirFFI.setup :Gtk, '2.0'
4
4
 
5
5
  require 'gir_ffi-gtk/base'
6
+ require 'gir_ffi-gtk/menu'
7
+ require 'gir_ffi-gtk/radio_button'
data/lib/gir_ffi-gtk3.rb CHANGED
@@ -3,3 +3,4 @@ require 'gir_ffi'
3
3
  GirFFI.setup :Gtk, '3.0'
4
4
 
5
5
  require 'gir_ffi-gtk/base'
6
+ require 'gir_ffi-gtk/menu'
data/tasks/test.rake CHANGED
@@ -1,12 +1,18 @@
1
1
  require 'rake/testtask'
2
2
 
3
3
  namespace :test do
4
- Rake::TestTask.new(:run) do |t|
4
+ Rake::TestTask.new(:gtk3) do |t|
5
5
  t.libs = ['lib']
6
6
  t.test_files = FileList['test/**/*_test.rb']
7
- t.ruby_opts += ["-w"]
7
+ t.ruby_opts += ["-w", "-Itest"]
8
+ end
9
+
10
+ Rake::TestTask.new(:gtk2) do |t|
11
+ t.libs = ['lib']
12
+ t.test_files = FileList['test/**/*_test.rb']
13
+ t.ruby_opts += ["-rgir_ffi-gtk2", "-w", "-Itest"]
8
14
  end
9
15
  end
10
16
 
11
17
  desc 'Run unit tests'
12
- task :test => ['test:run']
18
+ task :test => ['test:gtk3', 'test:gtk2']
@@ -1,4 +1,4 @@
1
- require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
1
+ require 'test_helper'
2
2
 
3
3
  describe Gtk do
4
4
  describe "::init" do
@@ -1,4 +1,4 @@
1
- require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
1
+ require 'test_helper'
2
2
 
3
3
  Gtk.init
4
4
 
@@ -57,33 +57,4 @@ describe "In the generated Gtk module" do
57
57
  assert_equal 2, ref_count(@w)
58
58
  end
59
59
  end
60
-
61
- describe "Gtk::RadioButton" do
62
- describe ".new" do
63
- it "works when called with nil" do
64
- assert_nothing_raised {
65
- Gtk::RadioButton.new nil
66
- }
67
- end
68
- end
69
-
70
- describe "#get_group" do
71
- it "returns a GLib::SList object" do
72
- btn = Gtk::RadioButton.new nil
73
- grp = btn.get_group
74
- assert_instance_of GLib::SList, grp
75
- end
76
- end
77
-
78
- describe ".new" do
79
- it "works when called with the result of #get_group" do
80
- assert_nothing_raised {
81
- btn = Gtk::RadioButton.new nil
82
- grp = btn.get_group
83
- Gtk::RadioButton.new grp
84
- }
85
- end
86
- end
87
-
88
- end
89
60
  end
@@ -1,16 +1,18 @@
1
- require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
1
+ require 'test_helper'
2
2
 
3
3
  describe Gtk::Menu do
4
- describe "#popup" do
5
- it "delegates to popup_for_device" do
6
- mnu = Gtk::Menu.new
7
- mock(mnu).popup_for_device(nil,
8
- 'parent_menu_shell', 'parent_menu_item',
9
- 'func', 'data',
10
- nil,
11
- 'button', 'activate_time')
12
- mnu.popup('parent_menu_shell', 'parent_menu_item', 'func', 'data',
13
- 'button', 'activate_time')
4
+ unless GObjectIntrospection::IRepository.default.find_by_name('Gtk', 'Menu').find_method('popup')
5
+ describe "#popup" do
6
+ it "delegates to popup_for_device" do
7
+ mnu = Gtk::Menu.new
8
+ mock(mnu).popup_for_device(nil,
9
+ 'parent_menu_shell', 'parent_menu_item',
10
+ 'func', 'data',
11
+ nil,
12
+ 'button', 'activate_time')
13
+ mnu.popup('parent_menu_shell', 'parent_menu_item', 'func', 'data',
14
+ 'button', 'activate_time')
15
+ end
14
16
  end
15
17
  end
16
18
  end
@@ -0,0 +1,37 @@
1
+ require 'test_helper'
2
+
3
+ describe Gtk::RadioButton do
4
+ describe ".new_from_widget" do
5
+ it "works when called with nil" do
6
+ result = Gtk::RadioButton.new_from_widget(nil)
7
+ result.must_be_instance_of Gtk::RadioButton
8
+ end
9
+
10
+ it "works when called with another radio button" do
11
+ btn = Gtk::RadioButton.new_from_widget nil
12
+ result = Gtk::RadioButton.new_from_widget btn
13
+ result.must_be_instance_of Gtk::RadioButton
14
+ end
15
+ end
16
+
17
+ describe "#get_group" do
18
+ it "returns a GLib::SList object" do
19
+ btn = Gtk::RadioButton.new_from_widget nil
20
+ grp = btn.get_group
21
+ assert_instance_of GLib::SList, grp
22
+ end
23
+ end
24
+
25
+ describe ".new" do
26
+ it "works when called with nil" do
27
+ result = Gtk::RadioButton.new nil
28
+ result.must_be_instance_of Gtk::RadioButton
29
+ end
30
+
31
+ it "works when called with the result of #get_group" do
32
+ btn = Gtk::RadioButton.new_from_widget nil
33
+ result = Gtk::RadioButton.new btn.get_group
34
+ result.must_be_instance_of Gtk::RadioButton
35
+ end
36
+ end
37
+ end
data/test/test_helper.rb CHANGED
@@ -2,9 +2,12 @@ if RUBY_PLATFORM == 'java'
2
2
  require 'rubygems'
3
3
  end
4
4
 
5
- if RUBY_VERSION >= "1.9" and ENV["SIMPLECOV"]
5
+ begin
6
6
  require 'simplecov'
7
- SimpleCov.start
7
+ SimpleCov.start do
8
+ add_filter "/test/"
9
+ end
10
+ rescue LoadError
8
11
  end
9
12
 
10
13
  require 'minitest/autorun'
@@ -12,13 +15,11 @@ require 'rr'
12
15
 
13
16
  Thread.abort_on_exception = true
14
17
 
15
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
16
-
17
- require 'gir_ffi-gtk3'
18
+ unless Object.const_defined? :Gtk
19
+ require 'gir_ffi-gtk3'
20
+ end
18
21
 
19
22
  class Minitest::Test
20
- include RR::Adapters::TestUnit
21
-
22
23
  def assert_nothing_raised
23
24
  yield
24
25
  assert true
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.7.0
4
+ version: 0.7.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: 2014-01-11 00:00:00.000000000 Z
11
+ date: 2014-03-25 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.7.0
19
+ version: 0.7.3
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.7.0
26
+ version: 0.7.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -76,12 +76,13 @@ files:
76
76
  - lib/gir_ffi-gtk2.rb
77
77
  - lib/gir_ffi-gtk/menu.rb
78
78
  - lib/gir_ffi-gtk/base.rb
79
+ - lib/gir_ffi-gtk/radio_button.rb
79
80
  - lib/gir_ffi-gtk3.rb
80
81
  - test/test_helper.rb
81
82
  - test/gir_ffi-gtk/base_test.rb
82
83
  - test/gir_ffi-gtk/menu_test.rb
83
84
  - test/gir_ffi-gtk/generated_gtk_test.rb
84
- - tasks/setup.rb
85
+ - test/gir_ffi-gtk/radio_button_test.rb
85
86
  - tasks/test.rake
86
87
  - examples/04_webkit.rb
87
88
  - examples/01_empty_window.rb
@@ -121,5 +122,6 @@ test_files:
121
122
  - test/gir_ffi-gtk/base_test.rb
122
123
  - test/gir_ffi-gtk/generated_gtk_test.rb
123
124
  - test/gir_ffi-gtk/menu_test.rb
125
+ - test/gir_ffi-gtk/radio_button_test.rb
124
126
  - test/test_helper.rb
125
127
  has_rdoc:
data/tasks/setup.rb DELETED
@@ -1,6 +0,0 @@
1
- require 'rake/clean'
2
-
3
- # Load the other rake files in the tasks folder
4
- tasks_dir = File.expand_path(File.dirname(__FILE__))
5
- rakefiles = Dir.glob(File.join(tasks_dir, '*.rake')).sort
6
- import(*rakefiles)