Added export of G-OBJECT-CLASS symbol, fixed build error
[cl-gtk2.git] / glib / sbcl.lisp
1 (in-package :glib)
2
3 #+thread-support
4 (progn
5   (defun glib-stop-thread ()
6     (setf *threads-initialized-p* nil))
7   (defun glib-start-thread ()
8     (g-thread-init (null-pointer))
9     (setf *threads-initialized-p* t))
10   (pushnew 'glib-stop-thread sb-ext:*save-hooks*)
11   (pushnew 'glib-start-thread sb-ext:*init-hooks*))
12
13 (defun map-inherited-classes (class fn)
14   (when (symbolp class) (setf class (find-class class)))
15   (when class
16     (funcall fn class)
17     (iter (for subclass in (closer-mop:class-direct-subclasses class))
18           (map-inherited-classes subclass fn))))
19
20 (defun initialize-all-gobject-types ()
21   (map-inherited-classes 'gobject::g-object
22                          (lambda (class)
23                            (when (typep class 'gobject::gobject-class)
24                              (gobject::initialize-gobject-class-g-type class)))))
25
26 (pushnew 'initialize-all-gobject-types sb-ext:*init-hooks*)