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.



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

def initialize(signal_id)
  @signal_id = signal_id
end

Instance Attribute Details

#signal_idObject (readonly)

Returns the value of attribute signal_id.



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

def signal_id
  @signal_id
end

Instance Method Details

#arguments_to_gvalues(instance, arguments) ⇒ Object



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

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



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

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

#nameObject



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

def name
  GObject.signal_name signal_id
end

#wrap_in_closure(&block) ⇒ Object



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

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