[cells-gtk-cvs] CVS root/cells-gtk

pdenno pdenno at common-lisp.net
Sat Feb 11 03:38:02 UTC 2006


Update of /project/cells-gtk/cvsroot/root/cells-gtk
In directory common-lisp:/tmp/cvs-serv31057/root/cells-gtk

Modified Files:
	tree-view.lisp 
Log Message:
Replaced hello-c:ff-defun-callable with cffi:defcallback

--- /project/cells-gtk/cvsroot/root/cells-gtk/tree-view.lisp	2006/01/03 19:01:59	1.12
+++ /project/cells-gtk/cvsroot/root/cells-gtk/tree-view.lisp	2006/02/11 03:38:02	1.13
@@ -82,20 +82,19 @@
         finally (return node)))
 
 ;;; Used by combo-box also, when it is using a tree model. 
-(ff-defun-callable :cdecl :void tree-view-items-selector
-  ((model :pointer-void) (path :pointer-void) (iter :pointer-void) (data :pointer-void))
+(cffi:defcallback tree-view-items-selector :void
+  ((model :pointer) (path :pointer) (iter :pointer) (data :pointer))
   (let ((tree (of-tree (gtk-object-find model))))
-    (push (item-from-path 
-           (children-fn tree)
-           (roots tree)
-           (read-from-string 
-            (gtk-tree-model-get-cell model iter (length (column-types tree)) :string)))
+    (push (item-from-path (children-fn tree)
+            (roots tree)
+	    (read-from-string 
+	     (gtk-tree-model-get-cell model iter (length (column-types tree)) :string)))
           (selected-items-cache tree)))
   0)
 
 (defmethod get-selection ((self tree-view))
   (let ((selection (gtk-tree-view-get-selection (id self)))
-        (cb (ff-register-callable 'tree-view-items-selector)))
+        (cb (cffi:get-callback 'tree-view-items-selector)))
     (setf (selected-items-cache self) nil)
     (gtk-tree-selection-selected-foreach selection cb c-null)
     (if (equal (gtk-tree-selection-get-mode selection) 3) ;;multiple
@@ -112,12 +111,12 @@
 	   (:browse 2)
 	   (:multiple 3))))))
 
-(ff-defun-callable :cdecl :void tree-view-select-handler
-  ((column-widget :pointer-void) (event :pointer-void) (data :pointer-void))
+(cffi:defcallback tree-view-select-handler :void
+ ((column-widget :pointer) (event :pointer) (data :pointer))
   (bif (tree-view (gtk-object-find column-widget))
-    (let ((cb (callback-recover tree-view :on-select)))
-      (funcall cb tree-view column-widget event data))
-    (trc "dude, clean up old widgets after runs" column-widget))
+       (let ((cb (callback-recover tree-view :on-select)))
+         (funcall cb tree-view column-widget event data))
+       (trc "Clean up old widgets after runs" column-widget))
   0)
 
 ;;; The check that previously was performed here (for a clos object) caused the handler
@@ -127,7 +126,7 @@
     (let ((selected-widget (gtk-tree-view-get-selection (id self))))
       (gtk-object-store selected-widget self) ;; tie column widget to clos tree-view
       (callback-register self :on-select new-value)
-      (let ((cb (ff-register-callable 'tree-view-select-handler)))
+      (let ((cb (cffi:get-callback 'tree-view-select-handler)))
         ;(trc nil "tree-view on-select pcb:" cb selected-widget "changed")
         (gtk-signal-connect selected-widget "changed" cb)))))
 
@@ -209,14 +208,14 @@
            (gtk-tree-store-set-kids model sub-tree iter
             pos column-types print-fn children-fn (cons index path)))))
 
-(ff-defun-callable :cdecl :int tree-view-render-cell-callback
-    ((tree-column :pointer-void) (cell-renderer :pointer-void)
-     (tree-model :pointer-void) (iter :pointer-void) (data :pointer-void))
+(cffi:defcallback tree-view-render-cell-callback :int
+  ((tree-column :pointer) (cell-renderer :pointer) (tree-model :pointer) 
+   (iter :pointer) (data :pointer))
   (bif (self (gtk-object-find tree-column))
-    (let ((cb (callback-recover self :render-cell)))
-      (assert cb () "No :render-cell callback for ~a" self)
-      (funcall cb tree-column cell-renderer tree-model iter data))
-    (trc nil "dude, clean up old widgets from prior runs" tree-column))
+       (let ((cb (callback-recover self :render-cell)))
+         (assert cb nil "no :render-cell callback for ~a" self)
+         (funcall cb tree-column cell-renderer tree-model iter data))
+       (trc nil "Clean up old widgets from prior runs." tree-column))
   1)
 
 (def-c-output columns ((self tree-view))
@@ -229,7 +228,7 @@
                          (t (gtk-cell-renderer-text-new))) do
           (gtk-tree-view-column-pack-start (id col) renderer t)
           (gtk-tree-view-column-set-cell-data-func (id col) renderer
-            (let ((cb (ff-register-callable 'tree-view-render-cell-callback)))
+            (let ((cb (cffi:get-callback 'tree-view-render-cell-callback)))
               ;(trc nil "tree-view columns pcb:" cb (id col) :render-cell)
               (callback-register col :render-cell
                 (gtk-tree-view-render-cell pos 




More information about the Cells-gtk-cvs mailing list