Class: GirFFI::Builders::SignalBuilder
Overview
Implements the creation of a signal module 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
42
43
44
|
# File 'lib/gir_ffi/builders/signal_builder.rb', line 42
def container_class
@container_class ||= Builder.build_class(container_info)
end
|
#container_info ⇒ Object
46
47
48
|
# File 'lib/gir_ffi/builders/signal_builder.rb', line 46
def container_info
@container_info ||= info.container
end
|
#instantiate_class ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/gir_ffi/builders/signal_builder.rb', line 14
def instantiate_class
unless already_set_up
klass.extend SignalBase
setup_constants
klass.class_eval mapping_method_definition
end
klass
end
|
#klass ⇒ Object
23
24
25
|
# File 'lib/gir_ffi/builders/signal_builder.rb', line 23
def klass
@klass ||= get_or_define_module container_class, @classname
end
|
#mapping_method_definition ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/gir_ffi/builders/signal_builder.rb', line 27
def mapping_method_definition
arg_infos = info.args
container_type_info = ReceiverTypeInfo.new(container_info)
receiver_info = ReceiverArgumentInfo.new(container_type_info)
user_data_type_info = UserDataTypeInfo.new
user_data_argument_info = UserDataArgumentInfo.new(user_data_type_info)
MappingMethodBuilder.for_signal(receiver_info,
arg_infos,
user_data_argument_info,
info.return_type).method_definition
end
|