class GObjectIntrospection::CallableInfo

Public Instance Methods

in_args() click to toggle source
# File lib/gobject-introspection/callable-info.rb, line 25
def in_args
  callback_indexes = []
  closure_indexes = []
  destroy_indexes = []
  args.each_with_index do |arg, i|
    next if arg.scope == ScopeType::INVALID
    callback_indexes << i
    closure_index = arg.closure
    closure_indexes << closure_index if closure_index != -1
    destroy_index = arg.destroy
    destroy_indexes << destroy_index if destroy_index != -1
  end

  args.find_all.with_index do |arg, i|
    case arg.direction
    when Direction::IN, Direction::INOUT
      if callback_indexes.include?(i)
        false
      elsif closure_indexes.include?(i)
        false
      elsif destroy_indexes.include?(i)
        false
      else
        true
      end
    else
      false
    end
  end
end
n_in_args() click to toggle source
# File lib/gobject-introspection/callable-info.rb, line 62
def n_in_args
  in_args.size
end
n_out_args() click to toggle source
# File lib/gobject-introspection/callable-info.rb, line 87
def n_out_args
  out_args.size
end
n_required_in_args() click to toggle source
# File lib/gobject-introspection/callable-info.rb, line 66
def n_required_in_args
  required_in_args.size
end
out_args() click to toggle source
# File lib/gobject-introspection/callable-info.rb, line 76
def out_args
  args.find_all do |arg|
    case arg.direction
    when Direction::OUT, Direction::INOUT
      true
    else
      false
    end
  end
end
require_callback?() click to toggle source
# File lib/gobject-introspection/callable-info.rb, line 70
def require_callback?
  args.any? do |arg|
    arg.direction == Direction::IN and arg.scope != ScopeType::INVALID
  end
end
required_in_args() click to toggle source
# File lib/gobject-introspection/callable-info.rb, line 56
def required_in_args
  in_args.reject do |arg|
    arg.may_be_null?
  end
end