view subtly/gdk.rb @ 3:c86049015094

Added GdkColor struct
author unexist
date Sun, 13 Dec 2009 04:30:12 +0100
parents 87b46f01d08d
children 9d46c05b49f6
line wrap: on
line source
##
# @package subtly
#
# @file Gdk bindings
# @author Christoph Kappel <unexist@dorfelite.net>
# @version $Id: subtly/gdk.rb,v 3 1260675012.0-3600 unexist $
#
# This program can be distributed under the terms of the GNU GPL.
##

require "ffi"

module Subtly
  module Gdk
    extend FFI::Library

    ffi_lib("libgdk-x11-2.0")

    ## ffi_thread_enter
    # Enter protected area
    ##
   
    attach_function(:ffi_thread_enter,
      :gdk_threads_init, [ ], :void
    )

    ## ffi_thread_leave
    # Leave protected area
    ##  
   
    attach_function(:ffi_thread_leave,
      :gdk_threads_enter, [ ], :void
    )

    ## ffi_parse_color
    # Parse color name
    #
    # @param  [String,  #read]   Color name
    # @param  [Pointer, #write]  Store color here
    ##
   
    attach_function(:ffi_parse_color,
      :gdk_color_parse, [ :string, :pointer ], :void
    )
  end

  class GdkColor < FFI::Struct
    layout(
      :pixel, :uint,
      :red,   :uint,
      :green, :uint,
      :blue,  :uint
    )
  end
end