Sha256: 1c57e02547c7b56320c8ae21f3fd93127b38902fff517b13c34f54c4e612bba4

Contents?: true

Size: 842 Bytes

Versions: 8

Compression:

Stored size: 842 Bytes

Contents

require 'gir_ffi/builder/type/registered_type'
require 'gir_ffi/builder/type/with_layout'
require 'gir_ffi/builder/type/with_methods'

module GirFFI
  module Builder
    module Type

      # Implements the creation of a class representing one of the types
      # whose C representation is a struct, i.e., :object and :struct.
      class StructBased < RegisteredType
        include WithMethods
        include WithLayout

        def pretty_print
          buf = "class #{@classname}\n"
          buf << pretty_print_methods
          buf << "end"
        end

        private

        def setup_class
          setup_layout
          setup_constants
          stub_methods
          setup_gtype_getter
          setup_field_accessors
        end

        def layout_superclass
          FFI::Struct
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gir_ffi-0.4.3 lib/gir_ffi/builder/type/struct_based.rb
gir_ffi-0.4.2 lib/gir_ffi/builder/type/struct_based.rb
gir_ffi-0.4.1 lib/gir_ffi/builder/type/struct_based.rb
gir_ffi-0.4.0 lib/gir_ffi/builder/type/struct_based.rb
gir_ffi-0.3.2 lib/gir_ffi/builder/type/struct_based.rb
gir_ffi-0.3.1 lib/gir_ffi/builder/type/struct_based.rb
gir_ffi-0.3.0 lib/gir_ffi/builder/type/struct_based.rb
gir_ffi-0.2.3 lib/gir_ffi/builder/type/struct_based.rb