Class: GirFFI::UserDefinedObjectInfo
- Inherits:
-
Object
- Object
- GirFFI::UserDefinedObjectInfo
- Defined in:
- lib/gir_ffi/user_defined_object_info.rb
Overview
Represents a user defined type, conforming, as needed, to the interface of GObjectIntrospection::IObjectInfo.
Instance Attribute Summary collapse
- #g_name ⇒ Object
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#vfunc_implementations ⇒ Object
readonly
Returns the value of attribute vfunc_implementations.
Instance Method Summary collapse
- #abstract? ⇒ Boolean
-
#class_struct ⇒ Object
TODO: Create custom class that includes the interfaces instead.
- #described_class ⇒ Object
- #find_instance_method(_method) ⇒ Object
- #find_method(_method) ⇒ Object
- #find_property(_property) ⇒ Object
- #find_signal(_signal_name) ⇒ Object
-
#initialize(klass) {|_self| ... } ⇒ UserDefinedObjectInfo
constructor
A new instance of UserDefinedObjectInfo.
- #install_property(param_spec) ⇒ Object
- #install_vfunc_implementation(name, implementation = nil) ⇒ Object
- #interfaces ⇒ Object
- #parent ⇒ Object
- #parent_gtype ⇒ Object
Constructor Details
#initialize(klass) {|_self| ... } ⇒ UserDefinedObjectInfo
Returns a new instance of UserDefinedObjectInfo.
12 13 14 15 16 17 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 12 def initialize(klass) @klass = klass @properties = [] @vfunc_implementations = [] yield self if block_given? end |
Instance Attribute Details
#g_name ⇒ Object
71 72 73 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 71 def g_name @g_name ||= @klass.name end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
10 11 12 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 10 def properties @properties end |
#vfunc_implementations ⇒ Object (readonly)
Returns the value of attribute vfunc_implementations.
10 11 12 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 10 def vfunc_implementations @vfunc_implementations end |
Instance Method Details
#abstract? ⇒ Boolean
65 66 67 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 65 def abstract? false end |
#class_struct ⇒ Object
TODO: Create custom class that includes the interfaces instead
53 54 55 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 53 def class_struct parent.class_struct end |
#described_class ⇒ Object
19 20 21 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 19 def described_class @klass end |
#find_instance_method(_method) ⇒ Object
36 37 38 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 36 def find_instance_method(_method) nil end |
#find_method(_method) ⇒ Object
32 33 34 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 32 def find_method(_method) nil end |
#find_property(_property) ⇒ Object
40 41 42 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 40 def find_property(_property) nil end |
#find_signal(_signal_name) ⇒ Object
61 62 63 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 61 def find_signal(_signal_name) nil end |
#install_property(param_spec) ⇒ Object
23 24 25 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 23 def install_property(param_spec) @properties << param_spec end |
#install_vfunc_implementation(name, implementation = nil) ⇒ Object
27 28 29 30 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 27 def install_vfunc_implementation(name, implementation = nil) implementation ||= ->(obj, *args) { obj.public_send name, *args } @vfunc_implementations << VFuncImplementation.new(name, implementation) end |
#interfaces ⇒ Object
57 58 59 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 57 def interfaces (@klass.included_modules - @klass.superclass.included_modules).map(&:gir_info) end |
#parent ⇒ Object
48 49 50 |
# File 'lib/gir_ffi/user_defined_object_info.rb', line 48 def parent @parent ||= gir.find_by_gtype(parent_gtype.to_i) end |