changeset 3:c86049015094

Added GdkColor struct
author unexist
date Sun, 13 Dec 2009 04:30:12 +0100
parents d4c65ef43e0f
children 705abf5135fe
files subtly/gdk.rb
diffstat 1 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/subtly/gdk.rb	Sun Dec 13 04:29:49 2009 +0100
+++ b/subtly/gdk.rb	Sun Dec 13 04:30:12 2009 +0100
@@ -16,31 +16,40 @@
 
     ffi_lib("libgdk-x11-2.0")
 
-    ## thread_enter
+    ## ffi_thread_enter
     # Enter protected area
     ##
    
-    attach_function(:thread_enter,
+    attach_function(:ffi_thread_enter,
       :gdk_threads_init, [ ], :void
     )
 
-    ## thread_leave
+    ## ffi_thread_leave
     # Leave protected area
     ##  
    
-    attach_function(:thread_leave,
+    attach_function(:ffi_thread_leave,
       :gdk_threads_enter, [ ], :void
     )
 
-    ## parse_color
+    ## ffi_parse_color
     # Parse color name
     #
     # @param  [String,  #read]   Color name
     # @param  [Pointer, #write]  Store color here
     ##
    
-    attach_function(:parse_color,
+    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