gtk2 3.0.8 → 3.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/sample/gtk-demo/appwindow.rb +2 -2
- data/sample/gtk-demo/cairo-clip-image.rb +1 -1
- data/sample/gtk-demo/cairo-image.rb +1 -1
- data/sample/gtk-demo/iconview.rb +3 -3
- data/sample/gtk-demo/images.rb +3 -3
- data/sample/gtk-demo/pixbufs.rb +9 -7
- data/sample/gtk-demo/stock_browser.rb +1 -1
- data/sample/gtk-demo/textview.rb +2 -2
- data/sample/misc/aboutdialog.rb +1 -1
- data/sample/misc/combobox.rb +1 -1
- data/sample/misc/iconview.rb +2 -2
- data/sample/misc/itemfactory.rb +1 -1
- data/sample/misc/itemfactory2.rb +1 -1
- data/sample/misc/to_drawable.rb +2 -2
- data/sample/misc/treeview.rb +1 -1
- data/test/test_gdk_pixbuf.rb +6 -6
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09c854751da556f847d807085392ceb594f00d50
|
4
|
+
data.tar.gz: ef261ca8ceae4d276538b0725e8ef3d49d8afc68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f6b374a2a9c30d574e20b1d77ca743979b6bab54e9adb024f60b89b8c9a49b3fca8eca6e8174614d041ec5f08c2893bbfea34605ba9c7ab88c6fd4887d4179a
|
7
|
+
data.tar.gz: 925045502f9efd9b4d8075e37805050e5bc079943a43a23c6055c3049ec80f02a0997e0a9af82d0c8c96902b1ef09442cadad11eca1f80d1a843de8ec25dafdc
|
@@ -184,7 +184,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
184
184
|
Boston, MA 02111-1307, USA.
|
185
185
|
]
|
186
186
|
|
187
|
-
transparent =
|
187
|
+
transparent = GdkPixbuf::Pixbuf.new(:file => Demo.find_file("gtk-logo-rgb.gif")).add_alpha(true, 0xff, 0xff, 0xff)
|
188
188
|
|
189
189
|
Gtk::AboutDialog.set_email_hook {|about, link|
|
190
190
|
puts "send mail to #{link}"
|
@@ -222,7 +222,7 @@ Boston, MA 02111-1307, USA.
|
|
222
222
|
factory.add_default
|
223
223
|
|
224
224
|
filename = Demo.find_file('gtk-logo-rgb.gif')
|
225
|
-
pixbuf =
|
225
|
+
pixbuf = GdkPixbuf::Pixbuf.new(:file => filename)
|
226
226
|
|
227
227
|
transparent = pixbuf.add_alpha(true, 0xff, 0xff, 0xff)
|
228
228
|
|
data/sample/gtk-demo/iconview.rb
CHANGED
@@ -37,10 +37,10 @@ puts path
|
|
37
37
|
|
38
38
|
def initialize
|
39
39
|
super('Gtk::IconView demo')
|
40
|
-
@file_pixbuf =
|
41
|
-
@folder_pixbuf =
|
40
|
+
@file_pixbuf = GdkPixbuf::Pixbuf.new(:file => Demo.find_file("gnome-fs-regular.png"))
|
41
|
+
@folder_pixbuf = GdkPixbuf::Pixbuf.new(:file => Demo.find_file("gnome-fs-directory.png"))
|
42
42
|
|
43
|
-
@store = Gtk::ListStore.new(String, String, TrueClass,
|
43
|
+
@store = Gtk::ListStore.new(String, String, TrueClass, GdkPixbuf::Pixbuf)
|
44
44
|
@parent = "/"
|
45
45
|
|
46
46
|
@store.set_default_sort_func do |a, b|
|
data/sample/gtk-demo/images.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
= Images
|
7
7
|
|
8
8
|
Gtk::Image is used to display an image; the image can be in a number of formats.
|
9
|
-
Typically, you load an image into a
|
9
|
+
Typically, you load an image into a GdkPixbuf::Pixbuf, then display the pixbuf.
|
10
10
|
|
11
11
|
This demo code shows some of the more obscure cases, in the simple
|
12
12
|
case a call to Gtk::Image.new is all you need.
|
@@ -55,7 +55,7 @@ module Demo
|
|
55
55
|
pixbuf = nil
|
56
56
|
begin
|
57
57
|
filename = Demo.find_file('gtk-logo-rgb.gif')
|
58
|
-
pixbuf =
|
58
|
+
pixbuf = GdkPixbuf::Pixbuf.new(:file => filename)
|
59
59
|
rescue
|
60
60
|
# This code shows off error handling. You can just use
|
61
61
|
# Gtk::Image.new instead if you don't want to report
|
@@ -159,7 +159,7 @@ module Demo
|
|
159
159
|
@pixbuf_loader = nil
|
160
160
|
end
|
161
161
|
|
162
|
-
@pixbuf_loader =
|
162
|
+
@pixbuf_loader = GdkPixbuf::PixbufLoader.new
|
163
163
|
|
164
164
|
@pixbuf_loader.signal_connect('area_prepared') do |loader|
|
165
165
|
pixbuf = loader.pixbuf
|
data/sample/gtk-demo/pixbufs.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
=begin
|
6
6
|
= Pixbufs
|
7
7
|
|
8
|
-
A
|
8
|
+
A GdkPixbuf::Pixbuf represents an image, normally in RGB or RGBA format.
|
9
9
|
Pixbufs are normally used to load files from disk and perform
|
10
10
|
image scaling.
|
11
11
|
|
@@ -51,9 +51,11 @@ module Demo
|
|
51
51
|
|
52
52
|
set_size_request(@background.width, @background.height)
|
53
53
|
|
54
|
-
@frame =
|
55
|
-
|
56
|
-
|
54
|
+
@frame = GdkPixbuf::Pixbuf.new(:colorspace => :rgb,
|
55
|
+
:has_alpha => false,
|
56
|
+
:bits_per_sample => 8,
|
57
|
+
:width => @background.width,
|
58
|
+
:height => @background.height)
|
57
59
|
|
58
60
|
@da = Gtk::DrawingArea.new
|
59
61
|
|
@@ -96,12 +98,12 @@ module Demo
|
|
96
98
|
# in the location where the file is installed.
|
97
99
|
#
|
98
100
|
filename = Demo.find_file(BACKGROUND_NAME)
|
99
|
-
@background =
|
101
|
+
@background = GdkPixbuf::Pixbuf.new(:file => filename)
|
100
102
|
|
101
103
|
IMAGE_NAMES.each_with_index do |basename, i|
|
102
104
|
filename = Demo.find_file(basename)
|
103
105
|
|
104
|
-
@images[i] =
|
106
|
+
@images[i] = GdkPixbuf::Pixbuf.new(:file => filename)
|
105
107
|
end
|
106
108
|
end
|
107
109
|
|
@@ -154,7 +156,7 @@ module Demo
|
|
154
156
|
dest = r1.intersect(r2)
|
155
157
|
if dest
|
156
158
|
@frame.composite!(image, dest.x, dest.y, dest.width, dest.height,
|
157
|
-
xpos, ypos, k, k,
|
159
|
+
xpos, ypos, k, k, :nearest,
|
158
160
|
if (i & 1) == 1
|
159
161
|
[
|
160
162
|
127,
|
@@ -147,7 +147,7 @@ module Demo
|
|
147
147
|
# Make the result the proper size for our thumbnail
|
148
148
|
w, h = Gtk::IconSize.lookup(size)
|
149
149
|
|
150
|
-
scaled = info.small_icon.scale(w, h,
|
150
|
+
scaled = info.small_icon.scale(w, h, GdkPixbuf::Pixbuf::INTERP_BILINEAR)
|
151
151
|
info.small_icon = scaled
|
152
152
|
end
|
153
153
|
|
data/sample/gtk-demo/textview.rb
CHANGED
@@ -188,14 +188,14 @@ module Demo
|
|
188
188
|
#
|
189
189
|
|
190
190
|
filename = Demo.find_file("gtk-logo-rgb.gif")
|
191
|
-
pixbuf =
|
191
|
+
pixbuf = GdkPixbuf::Pixbuf.new(:file => filename) if filename
|
192
192
|
|
193
193
|
unless pixbuf
|
194
194
|
$stderr.print "Failed to load image file gtk-logo-rgb.gif\n"
|
195
195
|
exit 1
|
196
196
|
end
|
197
197
|
|
198
|
-
scaled = pixbuf.scale(32, 32,
|
198
|
+
scaled = pixbuf.scale(32, 32, :bilinear)
|
199
199
|
pixbuf = scaled
|
200
200
|
|
201
201
|
##
|
data/sample/misc/aboutdialog.rb
CHANGED
@@ -31,7 +31,7 @@ a.comments = "This is a sample script for Gtk::AboutDialog"
|
|
31
31
|
a.copyright = "Copyright (C) 2005 Ruby-GNOME2 Project"
|
32
32
|
a.documenters = ["Documenter 1 <no1@foo.bar.com>", "Documenter 2 <no2@foo.bar.com>"]
|
33
33
|
a.license = "This program is licenced under the same licence as Ruby-GNOME2."
|
34
|
-
a.logo =
|
34
|
+
a.logo = GdkPixbuf::Pixbuf.new(:file => "gnome-logo-icon.png")
|
35
35
|
a.program_name = "Gtk::AboutDialog sample"
|
36
36
|
a.translator_credits = "Translator 1\nTranslator 2\n"
|
37
37
|
a.version = "1.0.0"
|
data/sample/misc/combobox.rb
CHANGED
data/sample/misc/iconview.rb
CHANGED
@@ -13,7 +13,7 @@ require 'gtk2'
|
|
13
13
|
TEXT_COLUMN = 0
|
14
14
|
PIXBUF_COLUMN = 1
|
15
15
|
|
16
|
-
model = Gtk::ListStore.new(String,
|
16
|
+
model = Gtk::ListStore.new(String, GdkPixbuf::Pixbuf)
|
17
17
|
|
18
18
|
iv = Gtk::IconView.new(model)
|
19
19
|
|
@@ -23,7 +23,7 @@ iv.pixbuf_column = PIXBUF_COLUMN
|
|
23
23
|
Dir.glob("../gtk-demo/gnome*.png").each do |f|
|
24
24
|
iter = model.append
|
25
25
|
iter[TEXT_COLUMN] = File.basename(f)
|
26
|
-
iter[PIXBUF_COLUMN] =
|
26
|
+
iter[PIXBUF_COLUMN] = GdkPixbuf::Pixbuf.new(:file => f)
|
27
27
|
end
|
28
28
|
|
29
29
|
iv.signal_connect("item_activated") do |iv, path|
|
data/sample/misc/itemfactory.rb
CHANGED
@@ -56,7 +56,7 @@ ifp.create_items([
|
|
56
56
|
["/_Misc", "<LastBranch>"],
|
57
57
|
["/_Misc/Tearoff", "<Tearoff>"],
|
58
58
|
["/_Misc/Title", "<Title>"],
|
59
|
-
["/_Misc/Image", "<ImageItem>", "",
|
59
|
+
["/_Misc/Image", "<ImageItem>", "", GdkPixbuf::Pixbuf.new(:file => "gnome-logo-icon.png"), cal_misc, 1],
|
60
60
|
["/_Misc/Separator", "<Separator>"],
|
61
61
|
["/_Misc/Item", "<Item>", nil, nil, cal_misc, 2]
|
62
62
|
])
|
data/sample/misc/itemfactory2.rb
CHANGED
@@ -60,7 +60,7 @@ ifp.create_item("/_Misc", "<LastBranch>")
|
|
60
60
|
ifp.create_item("/_Misc/Tearoff", "<Tearoff>")
|
61
61
|
ifp.create_item("/_Misc/Title", "<Title>")
|
62
62
|
ifp.create_item("/_Misc/Seperator", "<Separator>")
|
63
|
-
ifp.create_item("/_Misc/Image", "<ImageItem>", "",
|
63
|
+
ifp.create_item("/_Misc/Image", "<ImageItem>", "", GdkPixbuf::Pixbuf.new(:file => "gnome-logo-icon.png")) do
|
64
64
|
p "ImageItem"
|
65
65
|
end
|
66
66
|
|
data/sample/misc/to_drawable.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
=begin
|
3
|
-
to_drawable.rb -
|
3
|
+
to_drawable.rb - GdkPixbuf::Pixbuf(GDK methods) sample script.
|
4
4
|
|
5
5
|
Copyright (c) 2002-2006 Ruby-GNOME2 Project Team
|
6
6
|
This program is licenced under the same licence as Ruby-GNOME2.
|
@@ -16,7 +16,7 @@ unless filename
|
|
16
16
|
exit(1)
|
17
17
|
end
|
18
18
|
|
19
|
-
pixbuf =
|
19
|
+
pixbuf = GdkPixbuf::Pixbuf.new(:file => filename)
|
20
20
|
|
21
21
|
w = Gtk::Window.new("Drawable sample")
|
22
22
|
w.realize
|
data/sample/misc/treeview.rb
CHANGED
@@ -13,7 +13,7 @@ require 'gtk2'
|
|
13
13
|
window = Gtk::Window.new("Gtk::TreeView sample")
|
14
14
|
|
15
15
|
# Create data
|
16
|
-
model = Gtk::TreeStore.new(String, String, Gdk::Color, Float,
|
16
|
+
model = Gtk::TreeStore.new(String, String, Gdk::Color, Float, GdkPixbuf::Pixbuf)
|
17
17
|
|
18
18
|
# column 1
|
19
19
|
root_iter = model.append(nil)
|
data/test/test_gdk_pixbuf.rb
CHANGED
@@ -23,12 +23,12 @@ class TestGdkPixbuf < Test::Unit::TestCase
|
|
23
23
|
width, height = gdk_window.size
|
24
24
|
|
25
25
|
assert_nothing_raised do
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
GdkPixbuf::Pixbuf.from_drawable(colormap,
|
27
|
+
gdk_window,
|
28
|
+
src_x,
|
29
|
+
src_y,
|
30
|
+
width,
|
31
|
+
height)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtk2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
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-
|
11
|
+
date: 2016-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: atk
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.0.
|
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.
|
26
|
+
version: 3.0.9
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pango
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.0.
|
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.
|
40
|
+
version: 3.0.9
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: gdk_pixbuf2
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 3.0.
|
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.
|
54
|
+
version: 3.0.9
|
55
55
|
description: Ruby/GTK2 is a Ruby binding of GTK+-2.x.
|
56
56
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
57
57
|
executables: []
|
@@ -546,7 +546,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
546
546
|
requirements:
|
547
547
|
- - ">="
|
548
548
|
- !ruby/object:Gem::Version
|
549
|
-
version: 1.
|
549
|
+
version: 2.1.0
|
550
550
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
551
551
|
requirements:
|
552
552
|
- - ">="
|