From 4769576f381e72d2bc169a23e33b1c897f59e6e7 Mon Sep 17 00:00:00 2001 From: espen Date: Tue, 10 Feb 2009 15:16:34 +0000 Subject: [PATCH] Referencing foreign classes when loading saved images --- glib/gtype.lisp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/glib/gtype.lisp b/glib/gtype.lisp index 795e0a2..add9c8e 100644 --- a/glib/gtype.lisp +++ b/glib/gtype.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtype.lisp,v 1.68 2009-02-09 12:22:53 espen Exp $ +;; $Id: gtype.lisp,v 1.69 2009-02-10 15:16:34 espen Exp $ (in-package "GLIB") @@ -348,6 +348,8 @@ ;;;; Metaclass for subclasses of ginstance +(defvar *referenced-ginstance-classes* ()) + (eval-when (:compile-toplevel :load-toplevel :execute) (defclass ginstance-class (proxy-class) ((gtype :initarg :gtype :initform nil :reader ginstance-class-gtype)))) @@ -376,7 +378,8 @@ (type-class-ref (if (or (symbolp gtype) (type-number-from-glib-name gtype nil)) (register-type class-name gtype) - (register-new-type class-name (class-name super) gtype)))) + (register-new-type class-name (class-name super) gtype))) + (push class-name *referenced-ginstance-classes*)) #+nil (when (and (supertype (find-type-number class)) @@ -386,6 +389,12 @@ (update-size class)) #-clisp(call-next-method)) +(defun reinitialize-ginstance-classes () + (mapc #'type-class-ref *referenced-ginstance-classes*)) + +(asdf:install-init-hook 'reinitialize-ginstance-classes) + + (defmethod shared-initialize ((class ginstance-class) names &rest initargs) (declare (ignore names initargs)) -- 2.11.0