X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/9adccb27da69b60d058aa37867d55ea20ecf97ca..2176a9c737407c97be00bab66df443f0685f1058:/glib/glib.lisp diff --git a/glib/glib.lisp b/glib/glib.lisp index 149d392..5429846 100644 --- a/glib/glib.lisp +++ b/glib/glib.lisp @@ -15,7 +15,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -;; $Id: glib.lisp,v 1.16 2004-11-06 21:39:58 espen Exp $ +;; $Id: glib.lisp,v 1.17 2004-11-07 01:23:38 espen Exp $ (in-package "GLIB") @@ -71,6 +71,16 @@ (defun destroy-user-data (id) (funcall (cdr user-data) (car user-data)))) (remhash id *user-data*)) +(defmacro def-callback-marshal (name (return-type &rest args)) + (let ((names (loop + for arg in args + collect (if (atom arg) (gensym) (first arg)))) + (types (loop + for arg in args + collect (if (atom arg) arg (second arg))))) + `(defcallback ,name (,return-type ,@(mapcar #'list names types) + (callback-id unsigned-int)) + (invoke-callback callback-id ',return-type ,@names)))) ;;;; Quarks @@ -197,7 +207,7 @@ (defmethod to-alien-form (list (type (eql 'glist)) &rest args) `(make-glist ',element-type ,list))) (defmethod to-alien-function ((type (eql 'glist)) &rest args) - (declare (ignore type args)) + (declare (ignore type)) (destructuring-bind (element-type) args #'(lambda (list) (make-glist element-type list)))) @@ -277,7 +287,7 @@ (defmethod to-alien-form (list (type (eql 'gslist)) &rest args) `(make-sglist ',element-type ,list))) (defmethod to-alien-function ((type (eql 'gslist)) &rest args) - (declare (ignore type args)) + (declare (ignore type)) (destructuring-bind (element-type) args #'(lambda (list) (make-gslist element-type list))))