X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/c2e7d8b60a17e0fd23b88291ffa45f1d5ea3bc5c..cb8163645e1940bfe52ec24690ec048342d2159f:/glib/gtype.lisp diff --git a/glib/gtype.lisp b/glib/gtype.lisp index 17bcf41..856ff46 100644 --- a/glib/gtype.lisp +++ b/glib/gtype.lisp @@ -1,5 +1,5 @@ ;; Common Lisp bindings for GTK+ v2.0 -;; Copyright (C) 2000 Espen S. Johnsen +;; Copyright (C) 2000 Espen S. Johnsen ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public @@ -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: gtype.lisp,v 1.4 2000/09/04 22:04:24 espen Exp $ +;; $Id: gtype.lisp,v 1.7 2001/01/28 14:11:20 espen Exp $ (in-package "GLIB") @@ -38,8 +38,8 @@ (define-foreign type-instance-size (type) int ((find-type-number type) type-number)) -(define-foreign type-create-instance (type) pointer - ((find-type-number type) type-number)) +; (define-foreign type-create-instance (type) pointer +; ((find-type-number type) type-number)) (define-foreign type-free-instance () nil (instance pointer)) @@ -171,10 +171,10 @@ object)) ((or (functionp writer) (symbolp writer)) (funcall writer value object) - object) + value) (t (funcall (fdefinition writer) value object) - object)))) + value)))) (defmethod validate-superclass @@ -550,8 +550,8 @@ (:reference `(ensure-alien-instance ',type-spec - `(,(alien-copier type-spec) - location ,(alien-class-size (find-class type-spec))))))))) + (,(alien-copier type-spec) + location ,(alien-class-size (find-class type-spec))))))))) (deftype-method cleanup-alien alien-structure (type-spec sap &optional copied) (when copied @@ -582,7 +582,7 @@ ;;;; Superclass wrapping types in the glib type system (eval-when (:compile-toplevel :load-toplevel :execute) - (defclass gtype (alien-object) + (defclass ginstance (alien-object) () (:metaclass alien-class) (:size 4 #|(size-of 'pointer)|#))) @@ -593,7 +593,7 @@ (sap-ref-unsigned class 0))) -(deftype-method translate-from-alien gtype (type-spec location &optional alloc) +(deftype-method translate-from-alien ginstance (type-spec location &optional alloc) (declare (ignore type-spec alloc)) `(let ((location ,location)) (unless (null-pointer-p location) @@ -603,13 +603,13 @@ -;;;; Metaclass for subclasses of gtype-class +;;;; Metaclass for subclasses of ginstance-class (eval-when (:compile-toplevel :load-toplevel :execute) - (defclass gtype-class (alien-class))) + (defclass ginstance-class (alien-class))) -(defmethod shared-initialize ((class gtype-class) names +(defmethod shared-initialize ((class ginstance-class) names &rest initargs &key name) (declare (ignore initargs names)) (call-next-method) @@ -619,12 +619,12 @@ (defmethod validate-superclass - ((class gtype-class) (super pcl::standard-class)) - (subtypep (class-name super) 'gtype)) + ((class ginstance-class) (super pcl::standard-class)) + (subtypep (class-name super) 'ginstance)) -(defmethod allocate-alien-storage ((class gtype-class)) - (type-create-instance (find-type-number class))) +; (defmethod allocate-alien-storage ((class ginstance-class)) +; (type-create-instance (find-type-number class))) ;;;; Initializing type numbers