[cells-gtk-cvs] CVS update: root/gtk-ffi/gtk-ffi.lisp

Peter Denno pdenno at common-lisp.net
Sat Feb 26 22:37:41 UTC 2005


Update of /project/cells-gtk/cvsroot/root/gtk-ffi
In directory common-lisp.net:/tmp/cvs-serv8389/gtk-ffi

Modified Files:
	gtk-ffi.lisp 
Log Message:
provisions to load libcellsgtk, definition of gtk-event-key foreign structure.
Date: Sat Feb 26 23:37:40 2005
Author: pdenno

Index: root/gtk-ffi/gtk-ffi.lisp
diff -u root/gtk-ffi/gtk-ffi.lisp:1.9 root/gtk-ffi/gtk-ffi.lisp:1.10
--- root/gtk-ffi/gtk-ffi.lisp:1.9	Sat Feb 12 16:07:58 2005
+++ root/gtk-ffi/gtk-ffi.lisp	Sat Feb 26 23:37:40 2005
@@ -45,11 +45,12 @@
          '(:array :int) index)
     new-value))
 
+
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (export '(c-null c-null-int int-slot-indexed))
   (defun gtk-function-name (lisp-name)
     (substitute #\_ #\- lisp-name))
-  
+
   (defun libname (lib)
     #+(or win32 mswindows)
     (concatenate 'string
@@ -59,7 +60,7 @@
         (:glib "libglib-2.0-0.dll")
         (:gthread "libgthread-2.0-0.dll")
         (:gdk "libgdk-win32-2.0-0.dll")
-        (:gtk "libgtk-win32-2.0-0.dll")))
+        (:cgtk "libcellsgtk")))
     #+macosx
     (concatenate 'string
       "/sw/lib/"
@@ -68,25 +69,32 @@
         (:glib "libglib-2.0.0.dylib")
         (:gthread "libgthread-2.0.0.dylib")
         (:gdk "libgdk-x11-2.0.0.dylib")
-       (:gtk "libgtk-x11-2.0.0.dylib")))
+       (:gtk "libgtk-x11-2.0.0.dylib")
+       (:cgtk "libcellsgtk.dylib")))
     #-(or macosx win32 mswindows)
     (ecase lib
       (:gobject "libgobject-2.0")      
       (:glib "libglib-2.0")
       (:gthread "libgthread-2.0")
       (:gdk "libgdk-x11-2.0")
-      (:gtk "libgtk-x11-2.0")))
+      (:gtk "libgtk-x11-2.0")
+      (:cgtk "libcellsgtk")))
+
+
+
   #+cmu
-  (loop for lib in '(:gthread :glib :gobject :gdk :gtk)
+  (loop for lib in '(:gthread :glib :gobject :gdk :gtk #+libcellsgtk :cgtk)
         with libpath = (cond ((directory "/usr/lib/libgtk*") "/usr/lib/")
                              ((directory "/opt/gnome/lib/libgtk*") "/opt/gnome/lib/")
                              ((find :mswindows *features*) nil)
                              (t (error "Cannot find a path containing libgtk")))
      do (assert (uffi:load-foreign-library ;;simon
-		 (hic:find-foreign-library (gtk-ffi::libname lib) libpath)
-		 :force-load nil
-		 :module (string lib)))
-     )
+                 (hic:find-foreign-library (gtk-ffi::libname lib) libpath)
+                 :force-load nil
+                 :module (string lib))))
+
+  #-libcellsgtk 
+  (warn "libcellsgtk.so not found. Just a few capabilities will be unavailable.")
   
   (defun ffi-to-uffi-type (clisp-type)
     #+clisp clisp-type
@@ -103,6 +111,7 @@
                 (sint32 :int)
                 (uint32 :unsigned-int)
                 (uint8 :unsigned-byte)
+                (uint16 :short) ; no signed/unsigned types?
                 (boolean :unsigned-int)
                 (ulong :unsigned-long)
                 (int :int)
@@ -252,6 +261,18 @@
   (x_root double-float)
   (y_root double-float))
 
+(def-c-struct gdk-event-key
+  (type int)
+  (window c-pointer)
+  (send-event uint8)
+  (time uint32)
+  (state uint)
+  (keyval uint)
+  (length int)
+  (string c-pointer)
+  (hardware-keycode uint16)
+  (group uint8))
+
 (defun event-type (event)
   (ecase event
     (-1 :nothing)
@@ -347,7 +368,6 @@
      (setf (get-slot-value ,iter-var 'gtk-tree-iter 'user-data2) c-null)
      (setf (get-slot-value ,iter-var 'gtk-tree-iter 'user-data3) c-null)
      , at body))
-  
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defun as-gtk-type-name (type)




More information about the Cells-gtk-cvs mailing list