[cells-gtk-devel] SBCL patches

Andras Simon asimon at math.bme.hu
Thu Jun 1 19:30:30 UTC 2006



On Thu, 1 Jun 2006, Peter Denno wrote:

> Hi all,
>
> OK. The patches that Marco Gidde provided are now in CVS, and the "News"
> section of the web page has been updated to mention this.

Great! Thanks!

[...]

> So does anyone here have thoughts on how we can make things better?

I'd like to clean up the code a little bit to reduce the number of
compiler notes of the different lisps. The attached patch and a new
file (gtk-ffi/package.lisp) is a first step in this direction.

The patch is pretty uncontroversial (I think!) except for the

-      (cffi:load-foreign-library #+cffi-features:unix "libcellsgtk.so" 
+      (cffi:load-foreign-library #+cffi-features:unix 
+				 (merge-pathnames "libcellsgtk.so" #.*compile-file-pathname*)

part. It works for me in all lisps I tried, but still... Or are users
supposed to install libcellsgtk.so in /usr/lib/ or some such?

One more thing: since Cells has become Cells2, I think we should have
a version of Cells in the repository at least until (if ever) we
convert cells-gtk to Cells2.

What do you think?

Andras


-------------- next part --------------
Index: cells-gtk/conditions.lisp
===================================================================
RCS file: /project/cells-gtk/cvsroot/root/cells-gtk/conditions.lisp,v
retrieving revision 1.3
diff -u -r1.3 conditions.lisp
--- cells-gtk/conditions.lisp	16 Feb 2006 18:12:15 -0000	1.3
+++ cells-gtk/conditions.lisp	1 Jun 2006 18:33:29 -0000
@@ -34,5 +34,4 @@
 
 (define-condition gtk-user-signals-quit (condition) ())
 
-(export '(gtk-user-signals-quit gtk-continuable-error gtk-report-error))
 
Index: cells-gtk/menus.lisp
===================================================================
RCS file: /project/cells-gtk/cvsroot/root/cells-gtk/menus.lisp,v
retrieving revision 1.13
diff -u -r1.13 menus.lisp
--- cells-gtk/menus.lisp	19 Feb 2006 20:12:16 -0000	1.13
+++ cells-gtk/menus.lisp	1 Jun 2006 18:33:29 -0000
@@ -18,8 +18,6 @@
 
 (in-package :cgtk)
 
-(export '(cgtk-set-active-item-by-path))
-
 (defmacro with-tree-iters (vars &body body)
   `(let (,@(loop for var in vars collect `(,var (gtk-adds-tree-iter-new))))
      (unwind-protect 
@@ -305,4 +303,3 @@
 (def-widget tearoff-menu-item (menu-item)
   () () ())
 
-(export '(gtk-combo-box-set-active))
\ No newline at end of file
Index: cells-gtk/packages.lisp
===================================================================
RCS file: /project/cells-gtk/cvsroot/root/cells-gtk/packages.lisp,v
retrieving revision 1.5
diff -u -r1.5 packages.lisp
--- cells-gtk/packages.lisp	19 Feb 2006 20:12:58 -0000	1.5
+++ cells-gtk/packages.lisp	1 Jun 2006 18:33:29 -0000
@@ -16,9 +16,16 @@
  
 |#
 
+(in-package :cl-user)
+
 (defpackage :cells-gtk
   (:nicknames :cgtk)
-  (:use :common-lisp :pod :cells :gtk-ffi))
+  (:use :common-lisp :pod :cells :gtk-ffi)
+  (:export #:gtk-user-signals-quit
+	    #:gtk-continuable-error
+	    #:gtk-report-error
+	    #:cgtk-set-active-item-by-path
+	    #:gtk-combo-box-set-active))
 
 
 
Index: gtk-ffi/gtk-ffi.asd
===================================================================
RCS file: /project/cells-gtk/cvsroot/root/gtk-ffi/gtk-ffi.asd,v
retrieving revision 1.13
diff -u -r1.13 gtk-ffi.asd
--- gtk-ffi/gtk-ffi.asd	19 Feb 2006 20:16:57 -0000	1.13
+++ gtk-ffi/gtk-ffi.asd	1 Jun 2006 18:33:31 -0000
@@ -13,7 +13,8 @@
   :name "gtk-ffi"
   :depends-on (:cells :pod-utils :cffi :cffi-uffi-compat)
   :components
-  ((:file "gtk-ffi")
+  ((:file "package")
+   (:file "gtk-ffi" :depends-on ("package"))
    (:file "gtk-core" :depends-on ("gtk-ffi"))
    (:file "gtk-other" :depends-on ("gtk-ffi"))
    (:file "gtk-button" :depends-on ("gtk-ffi"))
Index: gtk-ffi/gtk-ffi.lisp
===================================================================
RCS file: /project/cells-gtk/cvsroot/root/gtk-ffi/gtk-ffi.lisp,v
retrieving revision 1.20
diff -u -r1.20 gtk-ffi.lisp
--- gtk-ffi/gtk-ffi.lisp	1 Jun 2006 14:16:28 -0000	1.20
+++ gtk-ffi/gtk-ffi.lisp	1 Jun 2006 18:33:31 -0000
@@ -16,11 +16,6 @@
  
 |#
 
-(eval-when (:compile-toplevel :load-toplevel :execute)
-  (unless (find-package :gtk-ffi)
-      (defpackage :gtk-ffi
-	(:use :common-lisp :pod))))
-
 (in-package :gtk-ffi)
 
 ;;; POD throw-away utility to convert hello-c/uffi to cffi
@@ -136,13 +131,13 @@
 				 #+win32 "libgtk-win32-2.0-0.dll" 
 				 #+macosx "libgtk-win32-2.0-0.dylib")
       #+libcellsgtk
-      (cffi:load-foreign-library #+cffi-features:unix "libcellsgtk.so" 
+      (cffi:load-foreign-library #+cffi-features:unix 
+				 (merge-pathnames "libcellsgtk.so" #.*compile-file-pathname*)
 				 #+win32 "libcellsgtk.dll" 
 				 #+macosx "libcellsgtk.dylib")))
 ) ; eval
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
-  (export '(+c-null+ int-slot-indexed load-gtk-libs))
   (defun gtk-function-name (lisp-name)
     (substitute #\_ #\- lisp-name))
 
@@ -425,9 +420,6 @@
 (defun cast (ptr type)
   (deref-pointer-runtime-typed ptr (ffi-to-uffi-type type)))
 
-(eval-when (compile load eval)
-  (export '(uint c-pointer c-ptr-null c-array-ptr c-ptr c-string sint32 uint32 uint8 boolean
-	    ulong int long single-float double-float otherwise *gtk-debug* load-gtk-libs
-	    col-type-to-ffi-type deref-pointer-runtime-typed gtk-tree-iter +c-null+)))
+
 
 
-------------- next part --------------
#|

 Gtk ffi

 Copyright (c) 2004 by Vasilis Margioulas <vasilism at sch.gr>

 You have the right to distribute and use this software as governed by 
 the terms of the Lisp Lesser GNU Public License (LLGPL):

    (http://opensource.franz.com/preamble.html)
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 Lisp Lesser GNU Public License for more details.
 
|#

(in-package :cl-user)

(defpackage :gtk-ffi
  (:use :common-lisp :pod)
  (:export #:+c-null+
	   #:int-slot-indexed
	   #:load-gtk-libs
	   #:uint
	   #:c-pointer
	   #:c-ptr-null
	   #:c-array-ptr
	   #:c-ptr
	   #:c-string
	   #:sint32
	   #:uint32
	   #:uint8
	   #:boolean
	   #:ulong
	   #:int
	   #:long
	   #:single-float
	   #:double-float
	   #:otherwise
	   #:*gtk-debug*
	   #:load-gtk-libs
	   #:col-type-to-ffi-type
	   #:deref-pointer-runtime-typed
	   #:gtk-tree-iter))



More information about the cells-gtk-devel mailing list