module GirFFI::InterfaceBase

Base module for modules representing GLib interfaces.

Public Instance Methods

copy_value_to_pointer(value, pointer, offset = 0) click to toggle source

TODO: Unify with implementation in ObjectBase

# File lib/gir_ffi/interface_base.rb, line 22
def copy_value_to_pointer(value, pointer, offset = 0)
  pointer.put_pointer offset, value.to_ptr
end
setup_and_call(method, arguments, &block) click to toggle source
# File lib/gir_ffi/interface_base.rb, line 14
def setup_and_call(method, arguments, &block)
  method_name = setup_method method.to_s
  raise NoMethodError, "undefined method `#{method}' for #{self}" unless method_name

  send method_name, *arguments, &block
end
to_callback_ffi_type() click to toggle source
# File lib/gir_ffi/interface_base.rb, line 34
def to_callback_ffi_type
  :pointer
end
to_ffi_type() click to toggle source
# File lib/gir_ffi/interface_base.rb, line 30
def to_ffi_type
  :pointer
end
wrap(ptr) click to toggle source
# File lib/gir_ffi/interface_base.rb, line 26
def wrap(ptr)
  ptr.to_object
end