837db69
--- alexandria-0.6.9/lib/alexandria/ui/icons.rb.rg309	2009-08-29 21:27:15.000000000 +0900
837db69
+++ alexandria-0.6.9/lib/alexandria/ui/icons.rb	2016-08-15 17:32:58.220820991 +0900
837db69
@@ -15,18 +15,26 @@
837db69
 # write to the Free Software Foundation, Inc., 51 Franklin Street,
837db69
 # Fifth Floor, Boston, MA 02110-1301 USA.
837db69
 
837db69
-class Gdk::Pixbuf
837db69
+if !defined?(GDK_PIXBUF)
837db69
+  if defined?(GdkPixbuf)
837db69
+    GDK_PIXBUF = GdkPixbuf::Pixbuf
837db69
+  else
837db69
+    GDK_PIXBUF = Gdk::Pixbuf
837db69
+  end
837db69
+end
837db69
+
837db69
+class GDK_PIXBUF
837db69
   def tag(tag_pixbuf)
837db69
     # Computes some tweaks.
837db69
     tweak_x = tag_pixbuf.width / 3
837db69
     tweak_y = tag_pixbuf.height / 3
837db69
 
837db69
     # Creates the destination pixbuf.
837db69
-    new_pixbuf = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB,
837db69
-                                 true,
837db69
-                                 8,
837db69
-                                 self.width + tweak_x,
837db69
-                                 self.height + tweak_y)
837db69
+    new_pixbuf = GDK_PIXBUF.new(:colorspace => :rgb,
837db69
+                                 :has_alpha => true,
837db69
+                                 :bits_per_sample => 8,
837db69
+                                 :width => self.width + tweak_x,
837db69
+                                 :height => self.height + tweak_y)
837db69
 
837db69
     # Fills with blank.
837db69
     new_pixbuf.fill!(0)
837db69
@@ -39,13 +47,24 @@
837db69
 
837db69
     # Copies the tag pixbuf there (north-est).
837db69
     tag_pixbuf_x = self.width - (tweak_x * 2)
837db69
-    new_pixbuf.composite!(tag_pixbuf,
837db69
+    if defined?(GdkPixbuf)
837db69
+      new_pixbuf.composite!(tag_pixbuf,
837db69
+                          :dest_x =>0, :dest_y => 0,
837db69
+                          :dest_width => tag_pixbuf.width + tag_pixbuf_x,
837db69
+                          :dest_height => tag_pixbuf.height,
837db69
+                          :offset_x => tag_pixbuf_x, :offset_y => 0,
837db69
+                          :scale_x => 1, :scale_y => 1,
837db69
+                          :interpolation_type => :hyper, :overall_alpha => 255
837db69
+                          )
837db69
+    else
837db69
+      new_pixbuf.composite!(tag_pixbuf,
837db69
                           0, 0,
837db69
                           tag_pixbuf.width + tag_pixbuf_x,
837db69
                           tag_pixbuf.height,
837db69
                           tag_pixbuf_x, 0,
837db69
                           1, 1,
837db69
                           Gdk::Pixbuf::INTERP_HYPER, 255)
837db69
+    end
837db69
     return new_pixbuf
837db69
   end
837db69
 end
837db69
@@ -66,7 +85,7 @@
837db69
             # Don't use upcase and use tr instead
837db69
             # For example in Turkish the upper case of 'i' is still 'i'.
837db69
             name = File.basename(file, ".png").tr('a-z', 'A-Z')
837db69
-          const_set(name, Gdk::Pixbuf.new(File.join(ICONS_DIR, file)))
837db69
+          const_set(name, GDK_PIXBUF.new(:file => File.join(ICONS_DIR, file)))
837db69
         end
837db69
       end
837db69
 
837db69
@@ -75,7 +94,7 @@
837db69
           return BOOK_ICON if library.nil?
837db69
           filename = library.cover(book)
837db69
           if File.exists?(filename)
837db69
-            return Gdk::Pixbuf.new(filename)
837db69
+            return GDK_PIXBUF.new(:file => filename)
837db69
           end
837db69
         rescue Exception => err
837db69
             # report load error; FIX should go to a Logger...
837db69
@@ -88,7 +107,7 @@
837db69
 
837db69
       def self.blank?(filename)
837db69
         begin
837db69
-          pixbuf = Gdk::Pixbuf.new(filename)
837db69
+          pixbuf = GdkPixbuf::Pixbuf.new(:file => filename)
837db69
           pixbuf.width == 1 and pixbuf.height == 1
837db69
         rescue Exception => err
837db69
           puts err.message
837db69
--- alexandria-0.6.9/lib/alexandria/ui/sidepane.rb.rg309	2009-03-26 08:09:32.000000000 +0900
837db69
+++ alexandria-0.6.9/lib/alexandria/ui/sidepane.rb	2016-08-15 17:13:47.764552444 +0900
837db69
@@ -1,3 +1,11 @@
837db69
+if !defined?(GDK_PIXBUF)
837db69
+  if defined?(GdkPixbuf)
837db69
+    GDK_PIXBUF = GdkPixbuf::Pixbuf
837db69
+  else
837db69
+    GDK_PIXBUF = Gdk::Pixbuf
837db69
+  end
837db69
+end
837db69
+
837db69
 module Alexandria
837db69
   module UI
837db69
     class SidePaneManager
837db69
@@ -80,7 +88,7 @@
837db69
       end
837db69
 
837db69
       def setup_sidepane
837db69
-        @library_listview.model = Gtk::ListStore.new(Gdk::Pixbuf,
837db69
+        @library_listview.model = Gtk::ListStore.new(GDK_PIXBUF,
837db69
                                                      String,
837db69
                                                      TrueClass,
837db69
                                                      TrueClass)
837db69
--- alexandria-0.6.9/lib/alexandria/ui/ui_manager.rb.rg309	2016-08-15 21:32:21.259657750 +0900
837db69
+++ alexandria-0.6.9/lib/alexandria/ui/ui_manager.rb	2016-08-15 17:12:04.362982918 +0900
837db69
@@ -16,6 +16,14 @@
837db69
 # write to the Free Software Foundation, Inc., 51 Franklin Street,
837db69
 # Fifth Floor, Boston, MA 02110-1301 USA.
837db69
 
837db69
+if !defined?(GDK_PIXBUF)
837db69
+  if defined?(GdkPixbuf)
837db69
+    GDK_PIXBUF = GdkPixbuf::Pixbuf
837db69
+  else
837db69
+    GDK_PIXBUF = Gdk::Pixbuf
837db69
+  end
837db69
+end
837db69
+
837db69
 module Alexandria
837db69
   module UI
837db69
     MAX_RATING_STARS = 5
837db69
@@ -263,8 +271,8 @@
837db69
         log.debug { "setting up active model" }
837db69
         # The active model.
837db69
 
837db69
-        list = [Gdk::Pixbuf,    # COVER_LIST
837db69
-          Gdk::Pixbuf,    # COVER_ICON
837db69
+        list = [GDK_PIXBUF,    # COVER_LIST
837db69
+          GDK_PIXBUF,    # COVER_ICON
837db69
           String,         # TITLE
837db69
           String,         # TITLE_REDUCED
837db69
           String,         # AUTHORS