anchor.diff:  ;; 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: gobject.lisp,v 1.20 2004-11-09 10:10:59 espen Exp $
  +;; $Id: gobject.lisp,v 1.21 2004-11-09 12:47:44 espen Exp $
   
   (in-package "GLIB")
   
  
positive.code:     ()
      (:metaclass gobject-class)
      (:alien-name "GObject")))
  
  (defmethod print-object ((instance gobject) stream)
    (print-unreadable-object (instance stream :type t :identity nil)
      (if (slot-boundp instance 'location)
  	(format stream "at 0x~X" (sap-int (proxy-location instance)))
        (write-string "(destroyed)" stream))))
  
  
  (defmethod initialize-instance ((object gobject) &rest initargs)
    ;; Extract initargs which we should pass directly to the GObeject
  
negative.code: 	 (slot-value object 'location) 
  	 (%gobject-new (type-number-of object)))))
  
    (apply #'call-next-method object initargs))
  
  
  (defmethod instance-finalizer ((instance gobject))
    (let ((location (proxy-location instance)))
      #'(lambda ()
  	(remove-cached-instance location)
  	(%object-unref location))))
  
  
  (defbinding (%gobject-new "g_object_new") () pointer
    (type type-number)
  