[gtk-cffi-cvs] CVS gtk-cffi/ext

CVS User rklochkov rklochkov at common-lisp.net
Tue May 8 09:38:07 UTC 2012


Update of /project/gtk-cffi/cvsroot/gtk-cffi/ext
In directory tiger.common-lisp.net:/tmp/cvs-serv25361/ext

Modified Files:
	lisp-model.lisp package.lisp 
Log Message:
Added GtkComboBoxText
Changed GtkTextIter to struct implementation from cffi-objects


--- /project/gtk-cffi/cvsroot/gtk-cffi/ext/lisp-model.lisp	2012/02/12 17:29:41	1.3
+++ /project/gtk-cffi/cvsroot/gtk-cffi/ext/lisp-model.lisp	2012/05/08 09:38:07	1.4
@@ -88,8 +88,9 @@
     (warn "Undefined implementation of GET-ITER for ~a" lisp-model-impl)))
 
 (defun set-iter (iter index)
-  (with-foreign-slots ((stamp u1) iter tree-iter-struct)
-    (setf stamp 0 u1 (make-pointer index)))
+;  (break)
+  (setf (stamp iter) 0
+        (u1 iter) (make-pointer index))
   t)
 
 (defmethod get-iter ((lisp-model-list lisp-model-list) iter path)
@@ -110,7 +111,7 @@
       (when found (set-iter iter index)))))
 
 (defun iter->index (iter)
-  (pointer-address (foreign-slot-value iter 'tree-iter-struct 'u1)))
+  (pointer-address (u1 iter)))
 
 (defun iter->aref (lisp-model iter)
   (aref (larray lisp-model) (iter->index iter)))
@@ -176,7 +177,7 @@
 
 (defgeneric iter-children (lisp-model-impl iter parent)
   (:method ((lisp-model-list lisp-model-list) iter parent)
-    (when (null-pointer-p parent)
+    (unless parent
       (set-iter iter 0)))
   (:method ((lisp-model lisp-model-tree-array) iter parent)
     (multiple-value-bind (found index)
@@ -205,13 +206,12 @@
 
 (defgeneric iter-nth-child (lisp-model-impl iter parent n)
   (:method ((lisp-model-list lisp-model-list) iter parent n) 
-    (when (and (null-pointer-p parent)
-               (< n (lisp-model-length lisp-model-list)))
+    (when (and (null parent) (< n (lisp-model-length lisp-model-list)))
         (set-iter iter n)))
   (:method ((lisp-model lisp-model-tree-array) iter parent n)
     (multiple-value-bind (found index)
         (descend (tree lisp-model)
-                 (if (null-pointer-p parent)
+                 (if (null parent)
                      (list n)
                      (let ((r (iter->path-list lisp-model parent)))
                        (append r (list n)))))
@@ -267,19 +267,19 @@
  get-flags (:int)
  get-n-columns (:int)
  get-column-type (:int (index :int))
- get-iter (:boolean (iter tree-iter-struct) (path :pointer))
- get-path (pobject (iter tree-iter-struct))
- get-value (:void (iter tree-iter-struct) (n :int) (value :pointer))
- iter-next (:boolean (iter tree-iter-struct))
- iter-previous (:boolean (iter tree-iter-struct))
- iter-children (:boolean (iter tree-iter-struct) (parent tree-iter-struct)) 
- iter-has-child (:boolean (iter tree-iter-struct))
- iter-n-children (:int (iter tree-iter-struct))
- iter-nth-child (:boolean (iter tree-iter-struct) 
-                          (parent tree-iter-struct) (n :int))
- iter-parent (:boolean (iter tree-iter-struct) (child tree-iter-struct))
- ref-node (:void (iter tree-iter-struct))
- unref-node (:void (iter tree-iter-struct)))
+ get-iter (:boolean (iter (struct tree-iter)) (path :pointer))
+ get-path (pobject (iter (struct tree-iter)))
+ get-value (:void (iter (struct tree-iter)) (n :int) (value :pointer))
+ iter-next (:boolean (iter (struct tree-iter)))
+ iter-previous (:boolean (iter (struct tree-iter)))
+ iter-children (:boolean (iter (struct tree-iter)) (parent (struct tree-iter))) 
+ iter-has-child (:boolean (iter (struct tree-iter)))
+ iter-n-children (:int (iter (struct tree-iter)))
+ iter-nth-child (:boolean (iter (struct tree-iter)) 
+                          (parent (struct tree-iter)) (n :int))
+ iter-parent (:boolean (iter (struct tree-iter)) (child (struct tree-iter)))
+ ref-node (:void (iter (struct tree-iter)))
+ unref-node (:void (iter (struct tree-iter))))
 
 
 (defcstruct g-interface-info
--- /project/gtk-cffi/cvsroot/gtk-cffi/ext/package.lisp	2012/05/07 09:02:04	1.3
+++ /project/gtk-cffi/cvsroot/gtk-cffi/ext/package.lisp	2012/05/08 09:38:07	1.4
@@ -6,7 +6,7 @@
         #:gtk-cffi-utils #:gtk-cffi)
   (:shadowing-import-from #:gtk-cffi #:image #:window)
   (:import-from #:gtk-cffi 
-                #:tree-iter-struct #:u1 #:stamp 
+                #:tree-iter #:u1 #:stamp 
                 #:tree-model-iface #:get-n-columns #:get-column-type
                 #:get-iter #:get-path #:get-value #:iter-next #:iter-previous
                 #:iter-children #:iter-has-child #:iter-n-children #:get-flags
@@ -15,9 +15,18 @@
   (:export
    #:lisp-model
    #:implementation
+   #:lisp-model-list
+   #:lisp-model-tree
    #:lisp-model-array
    #:lisp-model-tree-array
    #:larray
+
+   #:get-value
+   #:lisp-model-length
+   #:set-value
+   #:iter->index
+   #:iter->aref
+
    #:with-progress
    #:set-progress))
 





More information about the gtk-cffi-cvs mailing list