From: Dmitry Kalyanov Date: Wed, 25 Feb 2009 23:04:08 +0000 (+0300) Subject: Added :accessor option to g-boxed-ref' slots X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=ec38c3b734c56a1f0ef7ec2a7d76e02dc6e83a1e;p=cl-gtk2.git Added :accessor option to g-boxed-ref' slots --- diff --git a/glib/gobject.foreign-gboxed.lisp b/glib/gobject.foreign-gboxed.lisp index 994e759..a6525c3 100644 --- a/glib/gobject.foreign-gboxed.lisp +++ b/glib/gobject.foreign-gboxed.lisp @@ -289,14 +289,14 @@ (setf (gethash (pointer-address value) *boxed-ref-owner*) owner)))) (defun g-boxed-ref-slot->methods (class slot) - (bind (((slot-name &key reader writer type) slot)) + (bind (((slot-name &key reader writer type (accessor slot-name)) slot)) `(progn ,@(when reader - (list `(defmethod ,slot-name ((object ,class)) + (list `(defmethod ,accessor ((object ,class)) ,(if (stringp reader) `(foreign-funcall ,reader :pointer (pointer object) ,type) `(,reader object))))) ,@(when writer - (list `(defmethod (setf ,slot-name) (new-value (object ,class)) + (list `(defmethod (setf ,accessor) (new-value (object ,class)) ,(if (stringp writer) `(foreign-funcall ,writer :pointer (pointer object) ,type new-value) `(,writer new-value object))))))))