gdk3 2.2.3 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +6 -6
- data/lib/gdk3/cairo.rb +7 -3
- data/lib/gdk3/color.rb +22 -0
- data/lib/gdk3/deprecated.rb +16 -16
- data/lib/gdk3/loader.rb +3 -4
- data/test/test-gdk-cairo.rb +35 -5
- data/test/test-gdk-color.rb +25 -0
- data/test/test-gdk-keyval.rb +55 -0
- data/test/test-gdk-window-attr.rb +3 -3
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fb6a6ffa274f7d19f464561c1c9c9d31488797e
|
4
|
+
data.tar.gz: d70a7a19bd10a9f153756071e893c89aa8f98626
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da1e352a3f37a5965fff3418f9129b8401d00fb9e59d3448b1bf0d2783bc12d5777c06032724b39759610367df076301fcd4bbb1b690beb5ed14e537af90e90b
|
7
|
+
data.tar.gz: a40ea46084e97b457562940a49411f304360ecdc338091f3e4a71c0835302143fbbab2327972c5ca41340519713645cda12661399529c267c43655086da88840
|
data/Rakefile
CHANGED
@@ -47,7 +47,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
|
|
47
47
|
:name => "gtk+",
|
48
48
|
:download_site => :gnome,
|
49
49
|
:label => "GTK+",
|
50
|
-
:version => "3.14.
|
50
|
+
:version => "3.14.6",
|
51
51
|
:compression_method => "xz",
|
52
52
|
:windows => {
|
53
53
|
:configure_args => [
|
@@ -60,14 +60,14 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
|
|
60
60
|
},
|
61
61
|
},
|
62
62
|
{
|
63
|
-
:name => "
|
64
|
-
:
|
65
|
-
:label => "
|
66
|
-
:version => "
|
63
|
+
:name => "adwaita-icon-theme",
|
64
|
+
:download_site => :gnome,
|
65
|
+
:label => "adwaita-icon-theme",
|
66
|
+
:version => "3.14.1",
|
67
67
|
:windows => {
|
68
68
|
:configure_args => [],
|
69
69
|
:build_concurrently => false,
|
70
|
-
:built_file => "share/icons/
|
70
|
+
:built_file => "share/icons/Adwaita/index.theme",
|
71
71
|
}
|
72
72
|
},
|
73
73
|
]
|
data/lib/gdk3/cairo.rb
CHANGED
@@ -36,11 +36,15 @@ module Cairo
|
|
36
36
|
|
37
37
|
if method_defined?(:set_source_rgba)
|
38
38
|
alias_method :set_source_not_gdk_rgba, :set_source_rgba
|
39
|
-
def set_source_rgba(rgba)
|
40
|
-
|
39
|
+
def set_source_rgba(rgba, g=nil, b=nil, a=nil)
|
40
|
+
case rgba
|
41
|
+
when Gdk::RGBA
|
41
42
|
set_source_gdk_rgba(rgba)
|
42
|
-
|
43
|
+
when Array
|
43
44
|
set_source_not_gdk_rgba(rgba)
|
45
|
+
else
|
46
|
+
r = rgba
|
47
|
+
set_source_not_gdk_rgba([r, g, b, a])
|
44
48
|
end
|
45
49
|
end
|
46
50
|
else
|
data/lib/gdk3/color.rb
CHANGED
@@ -16,6 +16,28 @@
|
|
16
16
|
|
17
17
|
module Gdk
|
18
18
|
class Color
|
19
|
+
class << self
|
20
|
+
alias_method :parse_raw, :parse
|
21
|
+
def parse(spec)
|
22
|
+
succeeded, color = parse_raw(spec)
|
23
|
+
unless succeeded
|
24
|
+
message = "Invalid color spec: <#{spec.inspect}>: "
|
25
|
+
message << "Color spec must be one of them: "
|
26
|
+
message << "\"\#rgb\", "
|
27
|
+
message << "\"\#rrggbb\", "
|
28
|
+
message << "\"\#rrggbb\", "
|
29
|
+
message << "\"\#rrrgggbbb\", "
|
30
|
+
message << "\"\#rrrrggggbbbb\", "
|
31
|
+
message << "\"\#fff\", "
|
32
|
+
message << "\"\#ffffff\", "
|
33
|
+
message << "\"\#fffffffff\", "
|
34
|
+
message << "\"\#fffffffffffff\""
|
35
|
+
raise ArgumentError, message
|
36
|
+
end
|
37
|
+
color
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
19
41
|
alias_method :initialize_raw, :initialize
|
20
42
|
def initialize(red, green, blue)
|
21
43
|
initialize_raw
|
data/lib/gdk3/deprecated.rb
CHANGED
@@ -53,11 +53,8 @@ module Gdk
|
|
53
53
|
|
54
54
|
class Event
|
55
55
|
extend GLib::Deprecatable
|
56
|
-
|
57
|
-
|
58
|
-
Gdk::EventMask.constants.each do |event_mask|
|
59
|
-
define_deprecated_const event_mask, ['Gdk::EventMask', event_mask].join('::')
|
60
|
-
end
|
56
|
+
define_deprecated_const :Mask, "Gdk::EventMask"
|
57
|
+
define_deprecated_const :Type, "Gdk::EventType"
|
61
58
|
end
|
62
59
|
|
63
60
|
class EventCrossing
|
@@ -134,17 +131,20 @@ module Gdk
|
|
134
131
|
|
135
132
|
class Window
|
136
133
|
extend GLib::Deprecatable
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
define_deprecated_const :
|
146
|
-
|
147
|
-
|
134
|
+
|
135
|
+
define_deprecated_const :Gravity, "Gdk::Gravity"
|
136
|
+
define_deprecated_const :AttributesType, "Gdk::WindowAttributesType"
|
137
|
+
define_deprecated_const :Edge, "Gdk::WindowEdge"
|
138
|
+
define_deprecated_const :FilterReturn, "Gdk::FilterReturn"
|
139
|
+
define_deprecated_const :Hints, "Gdk::WindowHints"
|
140
|
+
define_deprecated_const :ModifierType, "Gdk::ModifierType"
|
141
|
+
define_deprecated_const :Type, "Gdk::WindowType"
|
142
|
+
define_deprecated_const :TypeHint, "Gdk::WindowTypeHint"
|
143
|
+
define_deprecated_const :WindowClass, "Gdk::WindowWindowClass"
|
144
|
+
define_deprecated_const :Class, "Gdk::WindowWindowClass"
|
145
|
+
define_deprecated_const :WMDecoration, "Gdk::WMDecoration"
|
146
|
+
define_deprecated_const :WMFunction, "Gdk::WMFunction"
|
147
|
+
define_deprecated_const :PARENT_RELATIVE, "Gdk::PARENT_RELATIVE"
|
148
148
|
define_deprecated_method :clear, :warn => "Don't use this method."
|
149
149
|
define_deprecated_method :clear_area, :warn => "Don't use this method."
|
150
150
|
define_deprecated_method :internal_paint_info, :raise => "Don't use this method."
|
data/lib/gdk3/loader.rb
CHANGED
@@ -218,6 +218,9 @@ module Gdk
|
|
218
218
|
else
|
219
219
|
define_method(info, Cairo::Context, name)
|
220
220
|
end
|
221
|
+
when /\Akeyval_/
|
222
|
+
name = rubyish_method_name(info, :prefix => "keyval_")
|
223
|
+
define_module_function(@keyval_module, name, info)
|
221
224
|
else
|
222
225
|
super
|
223
226
|
end
|
@@ -237,10 +240,6 @@ module Gdk
|
|
237
240
|
|
238
241
|
def define_enum(info)
|
239
242
|
case info.name
|
240
|
-
when /\AWindowWindow/
|
241
|
-
self.class.define_class(info.gtype, $POSTMATCH, window_class)
|
242
|
-
when /\AWindow/
|
243
|
-
self.class.define_class(info.gtype, $POSTMATCH, window_class)
|
244
243
|
when "EventType"
|
245
244
|
self.class.register_constant_rename_map("2BUTTON_PRESS",
|
246
245
|
"BUTTON2_PRESS")
|
data/test/test-gdk-cairo.rb
CHANGED
@@ -32,10 +32,40 @@ class TestGdkCairo < Test::Unit::TestCase
|
|
32
32
|
@context.source.color)
|
33
33
|
end
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
sub_test_case "#set_source_rgba" do
|
36
|
+
sub_test_case "RGBA" do
|
37
|
+
def test_rgba
|
38
|
+
rgba = Gdk::RGBA.new(0.1, 0.2, 0.3, 0.4)
|
39
|
+
@context.source_rgba = rgba
|
40
|
+
assert_equal(Cairo::Color::RGB.new(0.1, 0.2, 0.3, 0.4),
|
41
|
+
@context.source.color)
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_values
|
45
|
+
@context.set_source_rgba(0.1, 0.2, 0.3, 0.4)
|
46
|
+
assert_equal([0.1, 0.2, 0.3, 0.4],
|
47
|
+
@context.source.rgba)
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_array
|
51
|
+
@context.set_source_rgba([0.1, 0.2, 0.3, 0.4])
|
52
|
+
assert_equal([0.1, 0.2, 0.3, 0.4],
|
53
|
+
@context.source.rgba)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
sub_test_case "RGB" do
|
58
|
+
def test_values
|
59
|
+
@context.set_source_rgb(0.1, 0.2, 0.3)
|
60
|
+
assert_equal([0.1, 0.2, 0.3, 1.0],
|
61
|
+
@context.source.rgba)
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_array
|
65
|
+
@context.set_source_rgb([0.1, 0.2, 0.3])
|
66
|
+
assert_equal([0.1, 0.2, 0.3, 1.0],
|
67
|
+
@context.source.rgba)
|
68
|
+
end
|
69
|
+
end
|
40
70
|
end
|
41
71
|
end
|
data/test/test-gdk-color.rb
CHANGED
@@ -17,6 +17,31 @@
|
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
18
|
|
19
19
|
class TestGdkColor < Test::Unit::TestCase
|
20
|
+
sub_test_case ".parse" do
|
21
|
+
def test_invalid_spec
|
22
|
+
spec = "fff"
|
23
|
+
message = "Invalid color spec: <#{spec.inspect}>: "
|
24
|
+
message << "Color spec must be one of them: "
|
25
|
+
message << "\"\#rgb\", "
|
26
|
+
message << "\"\#rrggbb\", "
|
27
|
+
message << "\"\#rrggbb\", "
|
28
|
+
message << "\"\#rrrgggbbb\", "
|
29
|
+
message << "\"\#rrrrggggbbbb\", "
|
30
|
+
message << "\"\#fff\", "
|
31
|
+
message << "\"\#ffffff\", "
|
32
|
+
message << "\"\#fffffffff\", "
|
33
|
+
message << "\"\#fffffffffffff\""
|
34
|
+
assert_raise(ArgumentError.new(message)) do
|
35
|
+
Gdk::Color.parse(spec)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_valid
|
40
|
+
color = Gdk::Color.parse("#abc")
|
41
|
+
assert_equal("#aaaabbbbcccc", color.to_s)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
20
45
|
def test_to_s
|
21
46
|
color = Gdk::Color.new(0xffff, 0x1234, 0xabcd)
|
22
47
|
assert_equal("#ffff1234abcd", color.to_s)
|
data/test/test-gdk-keyval.rb
CHANGED
@@ -18,4 +18,59 @@ class TestGdkKeyval < Test::Unit::TestCase
|
|
18
18
|
def test_consntant_name
|
19
19
|
assert_equal("a".unpack("c")[0], Gdk::Keyval::KEY_a)
|
20
20
|
end
|
21
|
+
|
22
|
+
sub_test_case "#lower?" do
|
23
|
+
def test_lower
|
24
|
+
assert_true(Gdk::Keyval.lower?(Gdk::Keyval::KEY_a))
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_upper
|
28
|
+
assert_false(Gdk::Keyval.lower?(Gdk::Keyval::KEY_A))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
sub_test_case "#upper?" do
|
33
|
+
def test_lower
|
34
|
+
assert_false(Gdk::Keyval.upper?(Gdk::Keyval::KEY_a))
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_upper
|
38
|
+
assert_true(Gdk::Keyval.upper?(Gdk::Keyval::KEY_A))
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_name
|
43
|
+
assert_equal("A", Gdk::Keyval.name(Gdk::Keyval::KEY_A))
|
44
|
+
end
|
45
|
+
|
46
|
+
sub_test_case "#to_lower" do
|
47
|
+
def test_lower
|
48
|
+
assert_equal(Gdk::Keyval::KEY_a,
|
49
|
+
Gdk::Keyval.to_lower(Gdk::Keyval::KEY_a))
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_upper
|
53
|
+
assert_equal(Gdk::Keyval::KEY_a,
|
54
|
+
Gdk::Keyval.to_lower(Gdk::Keyval::KEY_A))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
sub_test_case "#to_upper" do
|
59
|
+
def test_lower
|
60
|
+
assert_equal(Gdk::Keyval::KEY_A,
|
61
|
+
Gdk::Keyval.to_upper(Gdk::Keyval::KEY_a))
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_upper
|
65
|
+
assert_equal(Gdk::Keyval::KEY_A,
|
66
|
+
Gdk::Keyval.to_upper(Gdk::Keyval::KEY_A))
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
sub_test_case "#to_unicode" do
|
71
|
+
def test_to_unicode
|
72
|
+
assert_equal("\u02D8", # BREVE
|
73
|
+
[Gdk::Keyval.to_unicode(Gdk::Keyval::KEY_breve)].pack("U"))
|
74
|
+
end
|
75
|
+
end
|
21
76
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
-
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
3
|
+
# Copyright (C) 2013-2014 Ruby-GNOME2 Project Team
|
4
4
|
#
|
5
5
|
# This library is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -24,8 +24,8 @@ class TestGdkWindowAttr < Test::Unit::TestCase
|
|
24
24
|
assert_equal([
|
25
25
|
100,
|
26
26
|
100,
|
27
|
-
Gdk::
|
28
|
-
Gdk::
|
27
|
+
Gdk::WindowWindowClass::INPUT_ONLY,
|
28
|
+
Gdk::WindowType::TEMP,
|
29
29
|
],
|
30
30
|
[attrs.width, attrs.height, attrs.wclass, attrs.window_type])
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gdk3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
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: 2014-
|
11
|
+
date: 2014-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pango
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.2.
|
19
|
+
version: 2.2.4
|
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: 2.2.
|
26
|
+
version: 2.2.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: gdk_pixbuf2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.2.
|
33
|
+
version: 2.2.4
|
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: 2.2.
|
40
|
+
version: 2.2.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cairo-gobject
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.2.
|
47
|
+
version: 2.2.4
|
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: 2.2.
|
54
|
+
version: 2.2.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: gobject-introspection
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.2.
|
61
|
+
version: 2.2.4
|
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: 2.2.
|
68
|
+
version: 2.2.4
|
69
69
|
description: Ruby/GDK3 is a Ruby binding of GDK-3.x.
|
70
70
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
71
71
|
executables: []
|