Class: GirFFI::ObjectBase

Inherits:
ClassBase show all
Defined in:
lib/gir_ffi/object_base.rb

Overview

Base class for all generated classes of type :object.

Instance Attribute Summary

Attributes inherited from ClassBase

#struct

Class Method Summary collapse

Methods inherited from ClassBase

#==, _allocate, constructor_wrap, direct_wrap, from, #setup_and_call, setup_and_call, setup_instance_method, setup_method, try_in_ancestors

Methods included from RegisteredTypeBase

#get_gtype

Methods included from TypeBase

#gir_ffi_builder, #gir_info

Class Method Details

.copy_value_to_pointer(value, pointer, offset = 0) ⇒ Object



36
37
38
# File 'lib/gir_ffi/object_base.rb', line 36

def self.copy_value_to_pointer value, pointer, offset = 0
  pointer.put_pointer offset, value.to_ptr
end

.find_property(name) ⇒ GObjectIntrospection::IPropertyInfo

Find property info for the named property.

Parameters:

  • name

    The property’s name

Returns:



17
18
19
# File 'lib/gir_ffi/object_base.rb', line 17

def self.find_property name
  gir_ffi_builder.find_property name
end

.find_signal(name) ⇒ GObjectIntrospection::ISignalInfo

Find signal info for the named signal.

Parameters:

  • name

    The signal’s name

Returns:



28
29
30
# File 'lib/gir_ffi/object_base.rb', line 28

def self.find_signal name
  gir_ffi_builder.find_signal name
end

.object_classObject



40
41
42
# File 'lib/gir_ffi/object_base.rb', line 40

def self.object_class
  gir_ffi_builder.object_class
end

.to_ffitypeObject



32
33
34
# File 'lib/gir_ffi/object_base.rb', line 32

def self.to_ffitype
  :pointer
end

.wrap(ptr) ⇒ Object

Wrap the passed pointer in an instance of its type’s corresponding class, generally assumed to be a descendant of the current type.



6
7
8
# File 'lib/gir_ffi/object_base.rb', line 6

def self.wrap ptr
  ptr.to_object
end