chiark / gitweb /
Added bindings to GObject ref/unref functions
authorespen <espen>
Sun, 24 Mar 2002 12:50:30 +0000 (12:50 +0000)
committerespen <espen>
Sun, 24 Mar 2002 12:50:30 +0000 (12:50 +0000)
glib/gobject.lisp

index 2a11bce7b3fa6ba47e95e7a1d3a1189516162981..6e4e4e0df3a490ca9cc16d9ec9592ed2238483b5 100644 (file)
@@ -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
 
 ;; 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")
 
 
 (in-package "GLIB")
 
@@ -25,24 +25,33 @@   (defclass gobject (ginstance)
     ()
     (:metaclass ginstance-class)
     (:alien-name "GObject")
     ()
     (: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))
 
 (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 (%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
 
 
 ;;;; Property stuff
 
@@ -113,6 +122,8 @@   (defclass effective-gobject-slot-definition
 ;   (class pointer)
 ;   (name string))
 
 ;   (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)
 
 (defmethod initialize-instance :after ((slotd direct-gobject-slot-definition)
                                       &rest initargs &key pname)