Sha256: 915d97b044261a01947f91cea77c1faf3618515ee677a1b599bb6436d44a3b00

Contents?: true

Size: 1.4 KB

Versions: 4

Compression:

Stored size: 1.4 KB

Contents

GirFFI.setup :GLib

require 'ffi-glib/s_list'
require 'ffi-glib/list'
require 'ffi-glib/hash_table'
require 'ffi-glib/byte_array'
require 'ffi-glib/array'
require 'ffi-glib/ptr_array'
require 'ffi-glib/strv'

module GLib
  # FIXME: Remove eventually.
  def self.main_loop_new context, is_running
    ::GLib::MainLoop.wrap(::GLib::Lib.g_main_loop_new context, is_running)
  end

  load_class :HFunc
  load_class :HashFunc
  load_class :EqualFunc
  load_class :Func

  module Lib
    attach_function :g_slist_prepend, [:pointer, :pointer], :pointer

    attach_function :g_list_append, [:pointer, :pointer], :pointer

    attach_function :g_hash_table_foreach,
      [:pointer, HFunc, :pointer], :void
    attach_function :g_hash_table_new,
      [HashFunc, EqualFunc], :pointer
    attach_function :g_hash_table_insert,
      [:pointer, :pointer, :pointer], :void

    attach_function :g_byte_array_new, [], :pointer
    attach_function :g_byte_array_append,
      [:pointer, :pointer, :uint], :pointer

    attach_function :g_array_new, [:int, :int, :uint], :pointer
    attach_function :g_array_append_vals,
      [:pointer, :pointer, :uint], :pointer

    attach_function :g_ptr_array_new, [], :pointer
    attach_function :g_ptr_array_add, [:pointer, :pointer], :void
    attach_function :g_ptr_array_foreach, [:pointer, Func, :pointer],
      :pointer

    attach_function :g_main_loop_new, [:pointer, :bool], :pointer
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.4.0 lib/ffi-glib.rb
gir_ffi-0.3.2 lib/ffi-glib.rb
gir_ffi-0.3.1 lib/ffi-glib.rb
gir_ffi-0.3.0 lib/ffi-glib.rb