class Gtk::Loader
Public Class Methods
new(base_module, init_arguments)
click to toggle source
Calls superclass method
# File lib/gtk4/loader.rb, line 19 def initialize(base_module, init_arguments) super(base_module) @init_arguments = init_arguments end
Public Instance Methods
load()
click to toggle source
Calls superclass method
# File lib/gtk4/loader.rb, line 24 def load self.version = "4.0" super("Gtk") end
Private Instance Methods
call_init_function(repository, namespace)
click to toggle source
# File lib/gtk4/loader.rb, line 36 def call_init_function(repository, namespace) init_check = repository.find(namespace, "init_check") arguments = [ [$0] + @init_arguments, ] succeeded, argv = init_check.invoke(arguments) @init_arguments.replace(argv[1..-1]) unless argv.nil? raise InitError, "failed to initialize GTK+" unless succeeded end
define_version_module()
click to toggle source
# File lib/gtk4/loader.rb, line 46 def define_version_module @version_module = Module.new @base_module.const_set("Version", @version_module) end
load_constant_info(info)
click to toggle source
Calls superclass method
# File lib/gtk4/loader.rb, line 66 def load_constant_info(info) case info.name when /_VERSION\z/ @version_module.const_set($PREMATCH, info.value) else super end end
post_load(repository, namespace)
click to toggle source
# File lib/gtk4/loader.rb, line 51 def post_load(repository, namespace) require_libraries end
pre_load(repository, namespace)
click to toggle source
# File lib/gtk4/loader.rb, line 31 def pre_load(repository, namespace) call_init_function(repository, namespace) define_version_module end
require_libraries()
click to toggle source
# File lib/gtk4/loader.rb, line 55 def require_libraries require "gtk4/box" require "gtk4/builder" require "gtk4/button" require "gtk4/dialog" require "gtk4/menu-item" require "gtk4/message-dialog" require "gtk4/version" require "gtk4/window" end
rubyish_method_name(function_info, options={})
click to toggle source
Calls superclass method
# File lib/gtk4/loader.rb, line 75 def rubyish_method_name(function_info, options={}) name = function_info.name case name when /\Alist_(child_properties|style_properties)\z/ $1 else super end end