Sha256: 1169eae58d5d0cccff29c0daa0bff6fba6ca2e1fd1643c6772babffce82ce846

Contents?: true

Size: 957 Bytes

Versions: 5

Compression:

Stored size: 957 Bytes

Contents

require "glib2"
require "gdk_pixbuf2"
require "cairo"

base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
vendor_dir = base_dir + "vendor" + "local"
vendor_bin_dir = vendor_dir + "bin"
GLib.prepend_dll_path(vendor_bin_dir)
begin
  major, minor, = RUBY_VERSION.split(/\./)
  require "#{major}.#{minor}/rsvg2.so"
rescue LoadError
  require "rsvg2.so"
end

module RSVG
  LOG_DOMAIN = "librsvg"

  class << self
    def cairo_available?
      true
    end
  end

  class Handle
    class << self
      # For backward compatibility
      def new_from_data(data)
        new(:data => data)
      end

      # For backward compatibility
      def new_from_file(file_name, options={})
        new(options.merge(:file_name => file_name))
      end
    end
  end
end

module Cairo
  class Context
    def render_rsvg_handle(handle, *args, &block)
      handle.render_cairo(self, *args, &block)
    end
  end
end

GLib::Log.set_log_domain(RSVG::LOG_DOMAIN)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rsvg2-3.0.1-x64-mingw32 lib/rsvg2.rb
rsvg2-3.0.1-x86-mingw32 lib/rsvg2.rb
rsvg2-3.0.1 lib/rsvg2.rb
rsvg2-3.0.0-x64-mingw32 lib/rsvg2.rb
rsvg2-3.0.0-x86-mingw32 lib/rsvg2.rb