Sha256: 50e706f62d77a689eac4ed11f198eb311b12973ff952dcaa2b64bf369c7280da

Contents?: true

Size: 773 Bytes

Versions: 2

Compression:

Stored size: 773 Bytes

Contents

require 'ffi'

module GirFFI
  module GObject
    def self.type_init
      Lib::g_type_init
    end

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

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

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

    def self.object_is_floating o
      Lib::g_object_is_floating o.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

2 entries across 2 versions & 1 rubygems

Version Path
gir_ffi-0.0.5 lib/gir_ffi/g_object.rb
gir_ffi-0.0.4 lib/gir_ffi/g_object.rb