Module: GirFFI::InterfaceBase
Overview
Base module for modules representing GLib interfaces.
Instance Method Summary
collapse
#setup_instance_method, #setup_instance_method!
#setup_method, #setup_method!
#gtype
Methods included from TypeBase
#gir_ffi_builder, #gir_info
Instance Method Details
#copy_value_to_pointer(value, pointer, offset = 0) ⇒ Object
TODO: Unify with implementation in ObjectBase
22
23
24
|
# 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) ⇒ Object
14
15
16
17
18
19
|
# 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 ⇒ Object
34
35
36
|
# File 'lib/gir_ffi/interface_base.rb', line 34
def to_callback_ffi_type
:pointer
end
|
#to_ffi_type ⇒ Object
30
31
32
|
# File 'lib/gir_ffi/interface_base.rb', line 30
def to_ffi_type
:pointer
end
|
#wrap(ptr) ⇒ Object
26
27
28
|
# File 'lib/gir_ffi/interface_base.rb', line 26
def wrap(ptr)
ptr.to_object
end
|