Sha256: 62b1868ea6b5094f116d1e0c81c85b26f263ff70301d017c76ffc683e9ca929b

Contents?: true

Size: 1.56 KB

Versions: 24

Compression:

Stored size: 1.56 KB

Contents

=begin
  Copyright (c) 2006-2011 Ruby-GNOME2 Project Team
  This program is licenced under the same licence as Ruby-GNOME2.
=end


require 'atk'
require 'gdk3'

base_dir = Pathname.new(__FILE__).dirname.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}/gtk3.so"
rescue LoadError
  require "gtk3.so"
end


module Gtk
  LOG_DOMAIN = "Gtk"

  class Printer
    def self.printers(wait = false)
      printers = []
      self.each(wait) {|v| printers << v}
      printers
    end
  end

  class Builder
    private
    def canonical_handler_name(name)
      name.gsub(/[-\s]+/, "_")
    end

    def __connect_signals__(connector, object, signal_name,
                            handler_name, connect_object, flags)
      handler_name = canonical_handler_name(handler_name)
      if connect_object
        handler = connect_object.method(handler_name)
      else
        handler = connector.call(handler_name)
      end
      unless handler
        $stderr.puts("Undefined handler: #{handler_name}") if $DEBUG
        return
      end

      if flags.after?
        signal_connect_method = :signal_connect_after
      else
        signal_connect_method = :signal_connect
      end

      if handler.arity.zero?
        object.send(signal_connect_method, signal_name) {handler.call}
      else
        object.send(signal_connect_method, signal_name, &handler)
      end
    end
  end
end

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
gtk3-2.2.5-x64-mingw32 lib/gtk3/base.rb
gtk3-2.2.5-x86-mingw32 lib/gtk3/base.rb
gtk3-2.2.5 lib/gtk3/base.rb
gtk3-2.2.4-x64-mingw32 lib/gtk3/base.rb
gtk3-2.2.4-x86-mingw32 lib/gtk3/base.rb
gtk3-2.2.4 lib/gtk3/base.rb
gtk3-2.2.3-x86-mingw32 lib/gtk3/base.rb
gtk3-2.2.3 lib/gtk3/base.rb
gtk3-2.2.2-x86-mingw32 lib/gtk3/base.rb
gtk3-2.2.2 lib/gtk3/base.rb
gtk3-2.2.1-x86-mingw32 lib/gtk3/base.rb
gtk3-2.2.1 lib/gtk3/base.rb
gtk3-2.2.0-x86-mingw32 lib/gtk3/base.rb
gtk3-2.2.0 lib/gtk3/base.rb
gtk3-2.1.0-x86-mingw32 lib/gtk3/base.rb
gtk3-2.1.0 lib/gtk3/base.rb
gtk3-2.0.3-x86-mingw32 lib/gtk3/base.rb
gtk3-2.0.3 lib/gtk3/base.rb
gtk3-2.0.2-x86-mingw32 lib/gtk3/base.rb
gtk3-2.0.2 lib/gtk3/base.rb