Sha256: 3752f8547973710926e05ccf10335fad2266a1efb2b2cd636d1b7b75cdf5bb8d

Contents?: true

Size: 633 Bytes

Versions: 2

Compression:

Stored size: 633 Bytes

Contents

module GirFFI
  module InfoExt
    # Extensions for GObjectIntrospection::ICallbackInfo needed by GirFFI
    module ICallbackInfo
      def to_ffitype
        Builder.build_class(self)
      end

      def argument_ffi_types
        args.map { |arg| arg.to_callback_ffitype }
      end

      def return_ffi_type
        result = return_type.to_callback_ffitype
        # FIXME: Should this be in ITypeInfo#to_callback_ffitype?
        if result == GLib::Boolean
          :bool
        else
          result
        end
      end
    end
  end
end

GObjectIntrospection::ICallbackInfo.send :include, GirFFI::InfoExt::ICallbackInfo

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gir_ffi-0.7.4 lib/gir_ffi/info_ext/i_callback_info.rb
gir_ffi-0.7.3 lib/gir_ffi/info_ext/i_callback_info.rb