Class: GirFFI::UnintrospectableSignalInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/gir_ffi/unintrospectable_signal_info.rb

Overview

Represents a signal not found in the GIR, conforming, as needed, to the interface of GObjectIntrospection::ISignalInfo.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(signal_id) ⇒ UnintrospectableSignalInfo

Returns a new instance of UnintrospectableSignalInfo.



9
10
11
# File 'lib/gir_ffi/unintrospectable_signal_info.rb', line 9

def initialize(signal_id)
  @signal_id = signal_id
end

Instance Attribute Details

#signal_idObject (readonly)

Returns the value of attribute signal_id.



7
8
9
# File 'lib/gir_ffi/unintrospectable_signal_info.rb', line 7

def signal_id
  @signal_id
end

Instance Method Details

#arguments_to_gvalues(instance, arguments) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/gir_ffi/unintrospectable_signal_info.rb', line 21

def arguments_to_gvalues(instance, arguments)
  param_gtypes = signal_query.param_types || []

  argument_gvalues = param_gtypes.zip(arguments).map do |gtype, arg|
    GObject::Value.for_gtype(gtype).tap { |it| it.set_value arg }
  end

  argument_gvalues.unshift GObject::Value.wrap_instance(instance)
end

#gvalue_for_return_valueObject



31
32
33
# File 'lib/gir_ffi/unintrospectable_signal_info.rb', line 31

def gvalue_for_return_value
  GObject::Value.for_gtype signal_query.return_type
end

#nameObject



13
14
15
# File 'lib/gir_ffi/unintrospectable_signal_info.rb', line 13

def name
  GObject.signal_name signal_id
end

#wrap_in_closure(&block) ⇒ Object



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

def wrap_in_closure(&block)
  GObject::RubyClosure.new(&block)
end