X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/323d42652561d8cedb7bfc888175e4111ace2588..f9e76ebedea0ba6c60589cf75b0327794e800d7a:/glib/gobject.lisp diff --git a/glib/gobject.lisp b/glib/gobject.lisp index 8c54999..6e4e4e0 100644 --- a/glib/gobject.lisp +++ b/glib/gobject.lisp @@ -15,7 +15,7 @@ ;; 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.9 2001-10-21 21:52:53 espen Exp $ +;; $Id: gobject.lisp,v 1.11 2002-03-24 12:50:30 espen Exp $ (in-package "GLIB") @@ -25,24 +25,33 @@ () (:metaclass ginstance-class) (:alien-name "GObject") - (:ref "g_object_ref") - (:unref "g_object_unref"))) + (:copy %object-ref) + (:free %object-unref))) (defmethod initialize-instance ((object gobject) &rest initargs) (declare (ignore initargs)) - (setf - (slot-value object 'location) - (%gobject-new (type-number-of object))) -; (funcall (proxy-class-copy (class-of object)) nil (proxy-location object)) - (call-next-method) -; (funcall (proxy-class-free (class-of object)) nil (proxy-location object)) - ) + (setf (slot-value object 'location) (%gobject-new (type-number-of object))) + (call-next-method)) (defbinding (%gobject-new "g_object_new") () pointer (type type-number) (nil null)) +(defbinding %object-ref (type location) pointer + (location pointer)) + +(defbinding %object-unref (type location) nil + (location pointer)) + + +(defun object-ref (object) + (%object-ref nil (proxy-location object))) + +(defun object-unref (object) + (%object-unref nil (proxy-location object))) + + ;;;; Property stuff @@ -113,6 +122,8 @@ ; (class pointer) ; (name string)) +(defun signal-name-to-string (name) + (substitute #\_ #\- (string-downcase (string name)))) (defmethod initialize-instance :after ((slotd direct-gobject-slot-definition) &rest initargs &key pname) @@ -201,7 +212,7 @@ (defun expand-gobject-type (type-number &optional options (metaclass 'gobject-class)) - (let* ((super (supertype type-number)) + (let* ((supers (cons (supertype type-number) (implements type-number))) (class (type-from-number type-number)) (override-slots (getf options :slots)) (expanded-slots @@ -251,7 +262,7 @@ (push slot-def expanded-slots)))) `(progn - (defclass ,class (,super) + (defclass ,class ,supers ,expanded-slots (:metaclass ,metaclass) (:alien-name ,(find-type-name type-number))))))