The Gobject Introspection Repository. This class is the point of access to the introspection typelibs. This class wraps the GIRepository struct.
Map info type to class. Default is IBaseInfo.
# File lib/ffi-gobject_introspection/i_repository.rb, line 65 def self.default self.instance end
# File lib/ffi-gobject_introspection/i_repository.rb, line 59 def initialize @gobj = Lib::g_irepository_get_default end
# File lib/ffi-gobject_introspection/i_repository.rb, line 69 def self.prepend_search_path path Lib.g_irepository_prepend_search_path path end
# File lib/ffi-gobject_introspection/i_repository.rb, line 73 def self.type_tag_to_string type Lib.g_type_tag_to_string type end
# File lib/ffi-gobject_introspection/i_repository.rb, line 122 def self.wrap_ibaseinfo_pointer ptr return nil if ptr.null? type = Lib.g_base_info_get_type ptr klass = TYPEMAP[type] return klass.wrap(ptr) end
# File lib/ffi-gobject_introspection/i_repository.rb, line 112 def dependencies namespace strv_p = Lib.g_irepository_get_dependencies(@gobj, namespace) strv = GLib::Strv.new strv_p strv.to_a end
# File lib/ffi-gobject_introspection/i_repository.rb, line 107 def find_by_gtype gtype ptr = Lib.g_irepository_find_by_gtype @gobj, gtype return wrap ptr end
# File lib/ffi-gobject_introspection/i_repository.rb, line 102 def find_by_name namespace, name ptr = Lib.g_irepository_find_by_name @gobj, namespace, name return wrap ptr end
# File lib/ffi-gobject_introspection/i_repository.rb, line 90 def info namespace, index ptr = Lib.g_irepository_get_info @gobj, namespace, index return wrap ptr end
Utility method
# File lib/ffi-gobject_introspection/i_repository.rb, line 96 def infos namespace (0..(n_infos(namespace) - 1)).map do |idx| info namespace, idx end end
# File lib/ffi-gobject_introspection/i_repository.rb, line 86 def n_infos namespace Lib.g_irepository_get_n_infos @gobj, namespace end
# File lib/ffi-gobject_introspection/i_repository.rb, line 77 def require namespace, version=nil, flags=0 errpp = FFI::MemoryPointer.new(:pointer).write_pointer nil Lib.g_irepository_require @gobj, namespace, version, flags, errpp errp = errpp.read_pointer raise GError.new(errp).message unless errp.null? end