;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-;; $Id: gtkobject.lisp,v 1.47 2008/03/06 22:02:08 espen Exp $
+;; $Id: gtkobject.lisp,v 1.49 2008/10/09 18:45:01 espen Exp $
(in-package "GTK")
;;;; Superclass for the gtk class hierarchy
(eval-when (:compile-toplevel :load-toplevel :execute)
- (init-types-in-library gtk "libgtk-2.0")
+ (init-types-in-library gtk "libgtk-2.0"))
- (defclass %object (gobject)
- ()
- (:metaclass gobject-class)
- (:gtype |gtk_object_get_type|)))
+(defclass %object (initially-unowned)
+ ()
+ (:metaclass gobject-class)
+ (:gtype |gtk_object_get_type|))
(defmethod initialize-instance ((object %object) &rest initargs &key signal)
(dolist (signal-definition (get-all initargs :signal))
(apply #'signal-connect object signal-definition)))
-(defmethod initialize-instance :around ((object %object) &rest initargs)
- (declare (ignore initargs))
- (call-next-method)
- ;; Add a temorary reference which will be removed when the object is
- ;; sinked
- (funcall (reference-function '%object) (foreign-location object))
- (%object-sink object))
-
-(defbinding %object-sink () nil
- (object %object))
+#?-(pkg-exists-p "glib-2.0" :atleast-version "2.10.0")
+(progn
+ (defmethod initialize-instance :around ((object %object) &rest initargs)
+ (declare (ignore initargs))
+ (call-next-method)
+ ;; Add a temorary reference which will be removed when the object is
+ ;; sinked
+ (funcall (reference-function '%object) (foreign-location object))
+ (%object-sink object))
+
+ (defbinding %object-sink () nil
+ (object %object)))
;;;; Main loop and event handling
(:metaclass container-child-class)
(:container ,class))))))))
-(defun container-child-class (container-class)
- (gethash container-class *container-to-child-class-mappings*))
-
(defun container-dependencies (type options)
(delete-duplicates
(append