gir_ffi-gtk 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +3 -0
- data/lib/gir_ffi-gtk/base.rb +2 -0
- data/lib/gir_ffi-gtk/message_dialog.rb +9 -2
- data/lib/gir_ffi-gtk/radio_button.rb +16 -4
- data/lib/gir_ffi-gtk/tree_path.rb +10 -4
- data/test/gir_ffi-gtk/base_test.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 742b828f6ed4e8f3422442b2b6e9cca410d18fc2
|
4
|
+
data.tar.gz: a6f03e605b7cdbb8bf20886647c9735c4cdab169
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ab32afa737ee8935ec70b2e4102a37f569aa27cf84d8e6173c90d8cdc48a9070d8e00054c3b88c8c5ef19e55980cf7bf6af41efd0e35d258385b0e8f4269bd0
|
7
|
+
data.tar.gz: 14c8e71fc367b194e65da0d56948485272dbc24698a73b1dbfafcf28fb1799d9f3bfc50be5b41c2f061d8294ddcb0d62d3625ec9c02a9d3404e480890355db0f
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ and for Gtk+ 2:
|
|
46
46
|
|
47
47
|
## License
|
48
48
|
|
49
|
-
Copyright © 2012–
|
49
|
+
Copyright © 2012–2015 [Matijs van Zuijlen](http://www.matijs.net)
|
50
50
|
|
51
51
|
GirFFI-Gtk is free software, distributed under the terms of the GNU Lesser
|
52
52
|
General Public License, version 2.1 or later. See the file COPYING.LIB for
|
data/Rakefile
CHANGED
data/lib/gir_ffi-gtk/base.rb
CHANGED
@@ -9,6 +9,7 @@ module GirFFIGtk
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
+
# Implementation of class methods for AutoArgv
|
12
13
|
module ClassMethods
|
13
14
|
def init_with_auto_argv
|
14
15
|
remaining = init_without_auto_argv([$PROGRAM_NAME, *ARGV]).to_a
|
@@ -29,6 +30,7 @@ module GirFFIGtk
|
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
33
|
+
# Implementation of class methods for ThreadEnabler
|
32
34
|
module ClassMethods
|
33
35
|
def main_with_thread_enabler
|
34
36
|
case RUBY_ENGINE
|
@@ -11,12 +11,19 @@ module Gtk
|
|
11
11
|
:varargs], :pointer
|
12
12
|
end
|
13
13
|
|
14
|
+
# Overrides for GtkMessageDialog
|
14
15
|
class MessageDialog
|
15
|
-
def self.new
|
16
|
+
def self.new *args
|
17
|
+
obj = allocate
|
18
|
+
obj.send :initialize, *args
|
19
|
+
obj
|
20
|
+
end
|
21
|
+
|
22
|
+
def initialize parent, flags, type, buttons, message
|
16
23
|
ptr = Gtk::Lib.gtk_message_dialog_new(parent, flags, type, buttons,
|
17
24
|
'%s',
|
18
25
|
:string, message)
|
19
|
-
|
26
|
+
store_pointer(ptr)
|
20
27
|
end
|
21
28
|
end
|
22
29
|
end
|
@@ -8,16 +8,28 @@ module Gtk
|
|
8
8
|
|
9
9
|
# Overrides for GtkRadioButton
|
10
10
|
class RadioButton
|
11
|
-
def self.new
|
11
|
+
def self.new *args
|
12
|
+
obj = allocate
|
13
|
+
obj.send :initialize, *args
|
14
|
+
obj
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.new_from_widget *args
|
18
|
+
obj = allocate
|
19
|
+
obj.send :initialize_from_widget, *args
|
20
|
+
obj
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize group
|
12
24
|
v1 = GLib::SList.from(Gtk::RadioButton, group)
|
13
25
|
v2 = Gtk::Lib.gtk_radio_button_new(v1)
|
14
|
-
|
26
|
+
store_pointer(v2)
|
15
27
|
end
|
16
28
|
|
17
|
-
def
|
29
|
+
def initialize_from_widget radio_group_member
|
18
30
|
v1 = Gtk::RadioButton.from(radio_group_member)
|
19
31
|
v2 = Gtk::Lib.gtk_radio_button_new_from_widget(v1)
|
20
|
-
|
32
|
+
store_pointer(v2)
|
21
33
|
end
|
22
34
|
end
|
23
35
|
end
|
@@ -2,18 +2,24 @@ Gtk.load_class :TreePath
|
|
2
2
|
module Gtk
|
3
3
|
# Add non-introspected function to Gtk::Lib
|
4
4
|
module Lib
|
5
|
-
if Gtk::MAJOR_VERSION == 2 || Gtk::MINOR_VERSION < 12
|
5
|
+
if Gtk::MAJOR_VERSION == 2 || Gtk::MAJOR_VERSION == 3 && Gtk::MINOR_VERSION < 12
|
6
6
|
attach_function :gtk_tree_path_new_from_indices, [:varargs], :pointer
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
10
|
# Overrides for GtkTreePath
|
11
11
|
class TreePath
|
12
|
-
if Gtk::MAJOR_VERSION == 2 || Gtk::MINOR_VERSION < 12
|
13
|
-
def self.new_from_indices
|
12
|
+
if Gtk::MAJOR_VERSION == 2 || Gtk::MAJOR_VERSION == 3 && Gtk::MINOR_VERSION < 12
|
13
|
+
def self.new_from_indices *args
|
14
|
+
obj = allocate
|
15
|
+
obj.send :initialize_from_indices, *args
|
16
|
+
obj
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize_from_indices indices
|
14
20
|
args = indices.flat_map { |index| [:int, index] }
|
15
21
|
ptr = Gtk::Lib.gtk_tree_path_new_from_indices(*args, :int, -1)
|
16
|
-
|
22
|
+
store_pointer ptr
|
17
23
|
end
|
18
24
|
end
|
19
25
|
|
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.
|
4
|
+
version: 0.8.0
|
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:
|
11
|
+
date: 2015-09-20 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.
|
19
|
+
version: 0.8.0
|
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.
|
26
|
+
version: 0.8.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
120
|
rubyforge_project:
|
121
|
-
rubygems_version: 2.4.1
|
121
|
+
rubygems_version: 2.4.5.1
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: GirFFI-based Ruby bindings for Gtk+ 2 and 3
|
@@ -130,4 +130,3 @@ test_files:
|
|
130
130
|
- test/gir_ffi-gtk/radio_button_test.rb
|
131
131
|
- test/gir_ffi-gtk/tree_path_test.rb
|
132
132
|
- test/test_helper.rb
|
133
|
-
has_rdoc:
|