Class: GirFFI::ObjectBase
- Defined in:
- lib/gir_ffi/object_base.rb
Overview
Base class for all generated classes of type :object.
Constant Summary
Constants inherited from ClassBase
Class Method Summary collapse
-
.constructor_wrap(ptr) ⇒ Object
Wraps a pointer retrieved from a constructor method.
- .copy_value_to_pointer(value, pointer, offset = 0) ⇒ Object
-
.find_property(name) ⇒ GObjectIntrospection::IPropertyInfo
Find property info for the named property.
-
.find_signal(name) ⇒ GObjectIntrospection::ISignalInfo
Find signal info for the named signal.
- .object_class ⇒ Object
- .to_ffitype ⇒ Object
-
.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.
Methods inherited from ClassBase
#==, _allocate, direct_wrap, from, #setup_and_call, setup_and_call, setup_instance_method, setup_method
Methods included from TypeBase
Class Method Details
.constructor_wrap(ptr) ⇒ Object
Wraps a pointer retrieved from a constructor method. Here, it is simply defined as a wrapper around direct_wrap, but, e.g., InitiallyUnowned overrides it to sink the floating object.
Unlike wrap, this method assumes the pointer will always be of the type corresponding to the current class, and never of a subtype.
16 17 18 |
# File 'lib/gir_ffi/object_base.rb', line 16 def self.constructor_wrap ptr direct_wrap ptr end |
.copy_value_to_pointer(value, pointer, offset = 0) ⇒ Object
52 53 54 |
# File 'lib/gir_ffi/object_base.rb', line 52 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.
33 34 35 |
# File 'lib/gir_ffi/object_base.rb', line 33 def self.find_property name gir_ffi_builder.find_property name end |
.find_signal(name) ⇒ GObjectIntrospection::ISignalInfo
Find signal info for the named signal.
44 45 46 |
# File 'lib/gir_ffi/object_base.rb', line 44 def self.find_signal name gir_ffi_builder.find_signal name end |
.object_class ⇒ Object
56 57 58 |
# File 'lib/gir_ffi/object_base.rb', line 56 def self.object_class gir_ffi_builder.object_class end |
.to_ffitype ⇒ Object
48 49 50 |
# File 'lib/gir_ffi/object_base.rb', line 48 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.
22 23 24 |
# File 'lib/gir_ffi/object_base.rb', line 22 def self.wrap ptr ptr.to_object end |