From: espen Date: Sun, 24 Mar 2002 12:50:30 +0000 (+0000) Subject: Added bindings to GObject ref/unref functions X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/commitdiff_plain/de8516caf7f9031a1cbffa1382c4a3f97a892350?ds=sidebyside Added bindings to GObject ref/unref functions --- diff --git a/glib/gobject.lisp b/glib/gobject.lisp index 2a11bce..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.10 2002-01-20 14:09:52 espen Exp $ +;; $Id: gobject.lisp,v 1.11 2002-03-24 12:50:30 espen Exp $ (in-package "GLIB") @@ -25,24 +25,33 @@ (defclass gobject (ginstance) () (: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 @@ (defclass effective-gobject-slot-definition ; (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)