gdk_pixbuf2 3.0.8 → 3.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/lib/gdk_pixbuf2.rb +11 -69
  4. data/lib/gdk_pixbuf2/deprecated.rb +160 -0
  5. data/lib/gdk_pixbuf2/loader.rb +51 -0
  6. data/lib/gdk_pixbuf2/pixbuf-loader.rb +24 -0
  7. data/lib/gdk_pixbuf2/pixbuf.rb +282 -0
  8. data/lib/gdk_pixbuf2/version.rb +33 -0
  9. data/sample/anim.rb +2 -2
  10. data/sample/composite.rb +41 -11
  11. data/sample/flip.rb +2 -2
  12. data/sample/format.rb +2 -4
  13. data/sample/loader.rb +3 -3
  14. data/sample/rotate.rb +4 -4
  15. data/sample/save.rb +3 -3
  16. data/sample/scale.rb +14 -6
  17. data/sample/simpleanim.rb +10 -4
  18. data/sample/utils.rb +7 -4
  19. data/sample/xpm.rb +9 -9
  20. data/test/fixture/floppybuddy.gif +0 -0
  21. data/test/fixture/gnome-logo-icon.png +0 -0
  22. data/test/fixture/image.gresource +0 -0
  23. data/test/fixture/image.gresource.xml +6 -0
  24. data/test/gdk_pixbuf2-test-utils.rb +11 -0
  25. data/test/run-test.rb +6 -3
  26. data/test/test-animation.rb +30 -0
  27. data/test/test-loader.rb +31 -0
  28. data/test/test-pixbuf.rb +334 -0
  29. metadata +18 -25
  30. data/README +0 -29
  31. data/ext/gdk_pixbuf2/depend +0 -11
  32. data/ext/gdk_pixbuf2/extconf.rb +0 -68
  33. data/ext/gdk_pixbuf2/gdk_pixbuf2.def +0 -2
  34. data/ext/gdk_pixbuf2/rbgdk-pixbuf-format.c +0 -179
  35. data/ext/gdk_pixbuf2/rbgdk-pixbuf-loader.c +0 -164
  36. data/ext/gdk_pixbuf2/rbgdk-pixbuf.c +0 -737
  37. data/ext/gdk_pixbuf2/rbgdk-pixbuf.h +0 -41
  38. data/ext/gdk_pixbuf2/rbgdk-pixbuf2conversions.h +0 -42
  39. data/ext/gdk_pixbuf2/rbgdk-pixbuf2private.h +0 -35
  40. data/ext/gdk_pixbuf2/rbgdk-pixbufanimation.c +0 -93
  41. data/ext/gdk_pixbuf2/rbgdk-pixbufanimationiter.c +0 -71
  42. data/ext/gdk_pixbuf2/rbgdk-pixbufsimpleanim.c +0 -53
  43. data/ext/gdk_pixbuf2/rbgdk-pixdata.c +0 -213
  44. data/extconf.rb +0 -49
  45. data/sample/inline.rb +0 -37
  46. data/sample/pixdata.rb +0 -39
  47. data/test/test-version.rb +0 -47
data/extconf.rb DELETED
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'pathname'
4
- require 'mkmf'
5
- require 'rbconfig'
6
- require 'fileutils'
7
-
8
- package = "gdk_pixbuf2"
9
-
10
- base_dir = Pathname(__FILE__).dirname.expand_path
11
- ext_dir = base_dir + "ext" + package
12
- mkmf_gnome2_dir = base_dir + 'lib'
13
-
14
- ruby = File.join(RbConfig::CONFIG['bindir'],
15
- RbConfig::CONFIG['ruby_install_name'] +
16
- RbConfig::CONFIG["EXEEXT"])
17
-
18
- build_dir = Pathname("ext") + package
19
- FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist?
20
- extconf_rb_path = ext_dir + "extconf.rb"
21
- system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false)
22
-
23
- create_makefile(package)
24
- FileUtils.mv("Makefile", "Makefile.lib")
25
-
26
- File.open("Makefile", "w") do |makefile|
27
- makefile.puts(<<-EOM)
28
- all:
29
- (cd ext/#{package} && $(MAKE))
30
- $(MAKE) -f Makefile.lib
31
-
32
- install:
33
- (cd ext/#{package} && $(MAKE) install)
34
- $(MAKE) -f Makefile.lib install
35
-
36
- site-install:
37
- (cd ext/#{package} && $(MAKE) site-install)
38
- $(MAKE) -f Makefile.lib site-install
39
-
40
- clean:
41
- (cd ext/#{package} && $(MAKE) clean)
42
- $(MAKE) -f Makefile.lib clean
43
-
44
- distclean:
45
- (cd ext/#{package} && $(MAKE) distclean)
46
- $(MAKE) -f Makefile.lib distclean
47
- @rm -f Makefile.lib
48
- EOM
49
- end
data/sample/inline.rb DELETED
@@ -1,37 +0,0 @@
1
- =begin
2
- inline.rb - Ruby/GdkPixbuf sample script.
3
-
4
- Copyright (c) 2004-2006 Ruby-GNOME2 Project Team
5
- This program is licenced under the same licence as Ruby-GNOME2.
6
-
7
- $Id: inline.rb,v 1.2 2006/06/17 14:38:08 mutoh Exp $
8
- =end
9
-
10
- require 'gtk2'
11
-
12
- pixbuf = Gdk::Pixbuf.new("gnome-foot.png")
13
-
14
- #pixbuf = Gdk::Pixbuf.new(ARGV[0])
15
-
16
- # Create Gdk::Pixbuf from pixels(String).
17
- pixbuf2 = Gdk::Pixbuf.new(pixbuf.pixels, Gdk::Pixbuf::COLORSPACE_RGB,
18
- true, pixbuf.bits_per_sample,
19
- pixbuf.width, pixbuf.height,
20
- pixbuf.rowstride)
21
-
22
- # Create Gdk::Pixbuf from an array of numbers
23
- # which created by Gdk::Pixdata#serialize.
24
- pixdata = Gdk::Pixdata.from_pixbuf(pixbuf, false)
25
- data = pixdata.serialize
26
- pixbuf3 = Gdk::Pixbuf.new(data, false)
27
-
28
- # Create Gdk::Pixbuf from Gdk::Pixbuf.
29
- pixbuf4 = Gdk::Pixbuf.new(pixbuf, 10, 10, 20, 20)
30
-
31
- vbox = Gtk::VBox.new
32
- vbox.add(Gtk::Image.new(pixbuf))
33
- vbox.add(Gtk::Image.new(pixbuf2))
34
- vbox.add(Gtk::Image.new(pixbuf3))
35
- vbox.add(Gtk::Image.new(pixbuf4))
36
- Gtk::Window.new.add(vbox).show_all
37
- Gtk.main
data/sample/pixdata.rb DELETED
@@ -1,39 +0,0 @@
1
- =begin
2
- pixdata.rb - Ruby/GdkPixbuf sample script.
3
-
4
- Copyright (c) 2004-2006 Ruby-GNOME2 Project Team
5
- This program is licenced under the same licence as Ruby-GNOME2.
6
-
7
- $Id: pixdata.rb,v 1.2 2006/06/17 14:38:08 mutoh Exp $
8
- =end
9
- require 'gtk2'
10
-
11
- r_xpm = [
12
- "10 10 3 1",
13
- " c None",
14
- ". c #FE0B0B",
15
- "+ c #FFFFFF",
16
- "+.......++",
17
- "+.. ..+",
18
- "+.. ..+",
19
- "+.. ...+",
20
- "+.......++",
21
- "+.....++++",
22
- "+..++..+++",
23
- "+..++...++",
24
- "+..+++...+",
25
- "+..++++..+"]
26
-
27
- pixbuf = Gdk::Pixbuf.new(r_xpm)
28
- pixdata = Gdk::Pixdata.from_pixbuf(pixbuf, false)
29
-
30
- #Serialize data
31
- p data = pixdata.serialize
32
-
33
- #Deserialize data
34
- pixdata = Gdk::Pixdata.deserialize(data)
35
- pixbuf2 = pixdata.to_pixbuf(false)
36
-
37
- dst = pixbuf2.scale(300, 300, Gdk::Pixbuf::INTERP_HYPER)
38
- Gtk::Window.new.add(Gtk::Image.new(dst)).show_all
39
- Gtk.main
data/test/test-version.rb DELETED
@@ -1,47 +0,0 @@
1
- # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
- #
3
- # This library is free software; you can redistribute it and/or
4
- # modify it under the terms of the GNU Lesser General Public
5
- # License as published by the Free Software Foundation; either
6
- # version 2.1 of the License, or (at your option) any later version.
7
- #
8
- # This library is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- # Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public
14
- # License along with this library; if not, write to the Free Software
15
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
-
17
- class TestGdkPixbufVersion < Test::Unit::TestCase
18
- include GdkPixbufTestUtils
19
-
20
- test "STRING" do
21
- major = Gdk::Pixbuf::Version::MAJOR
22
- minor = Gdk::Pixbuf::Version::MINOR
23
- micro = Gdk::Pixbuf::Version::MICRO
24
- assert_equal([major, minor, micro].join("."),
25
- Gdk::Pixbuf::Version::STRING)
26
- end
27
-
28
- sub_test_case("#or_later?") do
29
- test "same" do
30
- assert_true(Gdk::Pixbuf::Version.or_later?(Gdk::Pixbuf::Version::MAJOR,
31
- Gdk::Pixbuf::Version::MINOR,
32
- Gdk::Pixbuf::Version::MICRO))
33
- end
34
-
35
- test "later" do
36
- assert_true(Gdk::Pixbuf::Version.or_later?(Gdk::Pixbuf::Version::MAJOR,
37
- Gdk::Pixbuf::Version::MINOR - 1,
38
- Gdk::Pixbuf::Version::MICRO))
39
- end
40
-
41
- test "earlier" do
42
- assert_false(Gdk::Pixbuf::Version.or_later?(Gdk::Pixbuf::Version::MAJOR,
43
- Gdk::Pixbuf::Version::MINOR + 1,
44
- Gdk::Pixbuf::Version::MICRO))
45
- end
46
- end
47
- end