chiark
/
gitweb
/
~mdw
/
clg
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b33bdd3
)
Referencing foreign classes when loading saved images
author
espen
<espen>
Tue, 10 Feb 2009 15:16:34 +0000
(15:16 +0000)
committer
espen
<espen>
Tue, 10 Feb 2009 15:16:34 +0000
(15:16 +0000)
glib/gtype.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/gtype.lisp
b/glib/gtype.lisp
index 795e0a2c491b0bece56092965c6fb03f7333a346..add9c8e97e7c679094afe6ea1495da0bb1118188 100644
(file)
--- 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.
;; 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.6
8 2009-02-09 12:22:53
espen Exp $
+;; $Id: gtype.lisp,v 1.6
9 2009-02-10 15:16:34
espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-348,6
+348,8
@@
(defun register-new-type (type parent &optional foreign-name)
;;;; Metaclass for subclasses of ginstance
;;;; 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))))
(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
@@
(default-alien-type-name class-name))))
(type-class-ref
(if (or (symbolp gtype) (type-number-from-glib-name gtype nil))
(register-type class-name gtype)
(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))
#+nil
(when (and
(supertype (find-type-number class))
@@
-386,6
+389,12
@@
(default-alien-type-name class-name))))
(update-size class))
#-clisp(call-next-method))
(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))
(defmethod shared-initialize ((class ginstance-class) names &rest initargs)
(declare (ignore names initargs))