class GirFFI::UserDefinedObjectInfo

Represents a user defined type, conforming, as needed, to the interface of GObjectIntrospection::IObjectInfo.

Attributes

g_name[W]
properties[R]
vfunc_implementations[R]

Public Class Methods

new(klass) { |self| ... } click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 12
def initialize(klass)
  @klass = klass
  @properties = []
  @vfunc_implementations = []

  # FIXME: Limit access to only install_property and install_vfunc_implementation.
  yield self if block_given?
end

Public Instance Methods

abstract?() click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 66
def abstract?
  false
end
class_struct() click to toggle source

TODO: Create custom class that includes the interfaces instead

# File lib/gir_ffi/user_defined_object_info.rb, line 54
def class_struct
  nil
end
described_class() click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 21
def described_class
  @klass
end
find_instance_method(_method) click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 37
def find_instance_method(_method)
  nil
end
find_method(_method) click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 33
def find_method(_method)
  nil
end
find_property(_property) click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 41
def find_property(_property)
  nil
end
find_signal(_signal_name) click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 62
def find_signal(_signal_name)
  nil
end
g_name() click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 72
def g_name
  @g_name ||= @klass.name
end
install_property(param_spec) click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 25
def install_property(param_spec)
  @properties << param_spec
end
install_vfunc_implementation(name, implementation = nil) click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 29
def install_vfunc_implementation(name, implementation = nil)
  @vfunc_implementations << VFuncImplementation.new(name, implementation)
end
interfaces() click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 58
def interfaces
  (@klass.included_modules - @klass.superclass.included_modules).map(&:gir_info)
end
parent() click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 49
def parent
  @parent ||= gir.find_by_gtype(parent_gtype.to_i)
end
parent_gtype() click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 45
def parent_gtype
  @parent_gtype ||= GType.new(@klass.superclass.gtype)
end

Private Instance Methods

gir() click to toggle source
# File lib/gir_ffi/user_defined_object_info.rb, line 78
def gir
  @gir ||= GObjectIntrospection::IRepository.default
end