X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/545712f46c8aacc476237717cd31fc48a6719da9..580820d8044f45eb58f39b9d52d185d2efd16bcd:/glib/gboxed.lisp?ds=inline diff --git a/glib/gboxed.lisp b/glib/gboxed.lisp index ceae18f..8e621aa 100644 --- a/glib/gboxed.lisp +++ b/glib/gboxed.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: gboxed.lisp,v 1.16 2005-02-14 00:44:26 espen Exp $ +;; $Id: gboxed.lisp,v 1.18 2005-03-11 10:56:58 espen Exp $ (in-package "GLIB") @@ -42,17 +42,13 @@ (defmethod validate-superclass ((class boxed-class) (super standard-class)) (subtypep (class-name super) 'boxed))) -(defmethod shared-initialize ((class boxed-class) names - &rest initargs &key name alien-name) - (declare (ignore initargs names)) +(defmethod shared-initialize ((class boxed-class) names &key name gtype) + (declare (ignore names)) (call-next-method) - - (let* ((class-name (or name (class-name class))) - (type-number - (find-type-number - (or (first alien-name) (default-alien-type-name class-name))))) - (register-type class-name type-number))) - + (let ((class-name (or name (class-name class)))) + (unless (find-type-number class-name) + (register-type class-name + (or (first gtype) (default-type-init-name class-name)))))) (defbinding %boxed-copy () pointer (type-number type-number) @@ -76,7 +72,7 @@ (defun expand-boxed-type (type-number forward-p slots) ,(unless forward-p slots) (:metaclass boxed-class) - (:alien-name ,(find-type-name type-number)))) + (:gtype ,(register-type-as type-number)))) (register-derivable-type 'boxed "GBoxed" 'expand-boxed-type) @@ -115,4 +111,4 @@ (register-derivable-type 'boxed "GBoxed" 'expand-boxed-type) ;;;; NULL terminated vector of strings (deftype strings () '(null-terminated-vector string)) -(register-type 'strings "GStrv") +(register-type 'strings '|g_strv_get_type|)