/usr/lib/ruby/vendor_ruby/gir_ffi/builders/vfunc_argument_builder.rb is in ruby-gir-ffi 0.9.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | require 'gir_ffi/builders/callback_argument_builder'
module GirFFI
module Builders
# Convertor for arguments for vfuncs. Used when building the
# argument mapper for vfuncs.
class VFuncArgumentBuilder < CallbackArgumentBuilder
def pre_conversion
if ingoing_ref_needed
super + [pre_ref_count_increase]
else
super
end
end
private
def ingoing_ref_needed
direction == :in &&
ownership_transfer == :nothing &&
specialized_type_tag == :object
end
def pre_ref_count_increase
"#{pre_converted_name}.ref"
end
# SMELL: Override private method
def post_convertor_argument
if outgoing_ref_needed
"#{super}.ref"
else
super
end
end
def outgoing_ref_needed
direction == :out &&
ownership_transfer == :everything &&
specialized_type_tag == :object
end
end
end
end
|