Work around for an unknown bug
[clg] / glib / gboxed.lisp
index 2ab6ea2..8e621aa 100644 (file)
@@ -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.15 2005-02-09 22:59:03 espen Exp $
+;; $Id: gboxed.lisp,v 1.18 2005-03-11 10:56:58 espen Exp $
 
 (in-package "GLIB")
 
     (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 @@
      ,(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)
 
 
 
 
-;;;; Zero terminated vector of strings
+;;;; NULL terminated vector of strings
 
-(deftype strings () '(vector-null string))
-(register-type 'strings "GStrv")
+(deftype strings () '(null-terminated-vector string))
+(register-type 'strings '|g_strv_get_type|)