Sha256: 12a53adac97af8479d62b991152f039f6c5aa5b1f15f3924c2b430d5fc7197f3
Contents?: true
Size: 1.28 KB
Versions: 2
Compression:
Stored size: 1.28 KB
Contents
require 'gir_ffi/builder_helper' module GirFFI module InfoExt module ITypeInfo include BuilderHelper def layout_specification_type ffitype = GirFFI::Builder.itypeinfo_to_ffitype self case ffitype when Class ffitype.const_get :Struct when :bool :int when :array subtype = param_type(0).layout_specification_type # XXX Don't use pointer directly to appease JRuby. if subtype == :pointer subtype = :"uint#{FFI.type_size(:pointer)*8}" end [subtype, array_fixed_size] else ffitype end end def subtype_tag index st = param_type(index) tag = st.tag case tag when :interface return :interface_pointer if st.pointer? return :interface when :void return :gpointer if st.pointer? return :void else return tag end end def element_type case tag when :glist, :gslist, :array subtype_tag 0 when :ghash [subtype_tag(0), subtype_tag(1)] else nil end end end end end GObjectIntrospection::ITypeInfo.send :include, GirFFI::InfoExt::ITypeInfo
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gir_ffi-0.4.2 | lib/gir_ffi/info_ext/i_type_info.rb |
gir_ffi-0.4.1 | lib/gir_ffi/info_ext/i_type_info.rb |