Sha256: 856195f30bac0510e4a7aaa44ec5fcbb07c1ccdaa9d791c36ddfe36176a37b5f

Contents?: true

Size: 855 Bytes

Versions: 9

Compression:

Stored size: 855 Bytes

Contents

require 'ffi'

module GirFFI
  # TODO: Rename to avoid constant lookup issues (and confusion).
  module GObject
    def self.type_init
      Lib::g_type_init
    end

    def self.object_ref obj
      Lib::g_object_ref obj.to_ptr
    end

    def self.object_ref_sink obj
      Lib::g_object_ref_sink obj.to_ptr
    end

    def self.object_unref obj
      Lib::g_object_unref obj.to_ptr
    end

    def self.object_is_floating obj
      Lib::g_object_is_floating obj.to_ptr
    end

    module Lib
      extend FFI::Library
      ffi_lib "gobject-2.0"
      attach_function :g_type_init, [], :void
      attach_function :g_object_ref, [:pointer], :void
      attach_function :g_object_ref_sink, [:pointer], :void
      attach_function :g_object_unref, [:pointer], :void
      attach_function :g_object_is_floating, [:pointer], :bool
    end
  end
end


Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gir_ffi-0.0.14 lib/gir_ffi/g_object.rb
gir_ffi-0.0.13 lib/gir_ffi/g_object.rb
gir_ffi-0.0.12 lib/gir_ffi/g_object.rb
gir_ffi-0.0.11 lib/gir_ffi/g_object.rb
gir_ffi-0.0.10 lib/gir_ffi/g_object.rb
gir_ffi-0.0.9 lib/gir_ffi/g_object.rb
gir_ffi-0.0.8 lib/gir_ffi/g_object.rb
gir_ffi-0.0.7 lib/gir_ffi/g_object.rb
gir_ffi-0.0.6 lib/gir_ffi/g_object.rb