Class: GirFFI::Builders::SignalClosureBuilder
Overview
Implements the creation of a closure class for handling a particular signal. The type will be attached to the appropriate class.
Instance Attribute Summary
#info
Instance Method Summary
collapse
#build_class, #initialize
#get_or_define_class, #get_or_define_module, #optionally_define_constant
Instance Method Details
#container_class ⇒ Object
37
38
39
|
# File 'lib/gir_ffi/builders/signal_closure_builder.rb', line 37
def container_class
@container_class ||= Builder.build_class(container_info)
end
|
#container_info ⇒ Object
41
42
43
|
# File 'lib/gir_ffi/builders/signal_closure_builder.rb', line 41
def container_info
@container_info ||= info.container
end
|
#instantiate_class ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/gir_ffi/builders/signal_closure_builder.rb', line 9
def instantiate_class
unless already_set_up
setup_constants
klass.class_eval marshaller_definition
end
klass
end
|
#klass ⇒ Object
33
34
35
|
# File 'lib/gir_ffi/builders/signal_closure_builder.rb', line 33
def klass
@klass ||= get_or_define_class container_class, @classname, GObject::RubyClosure
end
|
#marshaller_definition ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/gir_ffi/builders/signal_closure_builder.rb', line 21
def marshaller_definition
arg_infos = info.args
container_type_info = ReceiverTypeInfo.new(container_info)
receiver_info = ReceiverArgumentInfo.new(container_type_info)
return_value_info = ReturnValueInfo.new info.return_type
MarshallingMethodBuilder.for_signal(receiver_info,
arg_infos,
return_value_info).method_definition
end
|
#setup_method(_method) ⇒ Object
17
18
19
|
# File 'lib/gir_ffi/builders/signal_closure_builder.rb', line 17
def setup_method _method
nil
end
|