X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/cc4896efc8971724789b7c8ed4649fde81834671..4f1380af7f0e327a644c4525c6be30759a31f427:/gtk/gtktree.lisp diff --git a/gtk/gtktree.lisp b/gtk/gtktree.lisp index 5c5eebc..1e238b6 100644 --- a/gtk/gtktree.lisp +++ b/gtk/gtktree.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtktree.lisp,v 1.27 2007/05/10 20:20:05 espen Exp $ +;; $Id: gtktree.lisp,v 1.32 2007/10/22 09:21:50 espen Exp $ (in-package "GTK") @@ -181,8 +181,7 @@ (when data (setf (tree-model-row-data store iter) data)) iter) -(defbinding %list-store-insert-after - (list-store &optional sibling (tree-iter (make-instance 'tree-iter))) nil +(defbinding %list-store-insert-after () nil (list-store list-store) (tree-iter tree-iter) (sibling (or null tree-iter))) @@ -256,11 +255,12 @@ location)) (defun %tree-path-to-vector (location) - (let ((indices (%tree-path-get-indices location)) - (depth (%tree-path-get-depth location))) - (if (null-pointer-p indices) - #() - (map-c-vector 'vector #'identity indices 'int depth)))) + (unless (null-pointer-p location) + (let ((indices (%tree-path-get-indices location)) + (depth (%tree-path-get-depth location))) + (if (null-pointer-p indices) + #() + (map-c-vector 'vector #'identity indices 'int depth))))) (defmacro %with-tree-path ((var path) &body body) (let* ((pointer-offset (adjust-offset (size-of 'int) 'pointer)) @@ -384,6 +384,12 @@ (model tree-model) (iter tree-iter :in/return) (path tree-path)) + +#?(pkg-exists-p "gtk+-2.0" :atleast-version "2.12.0") +(defmethod allocate-foreign ((tree-iter tree-iter) &rest initargs) + (declare (ignore initargs)) + (let ((size (foreign-size (class-of tree-iter)))) + (slice-alloc size))) (defun ensure-tree-iter (model row) (etypecase row @@ -418,7 +424,7 @@ (coerce (loop with iter = (ensure-tree-iter model row) - for index from 0 to (tree-model-n-columns model) + for index from 0 below (tree-model-n-columns model) collect (tree-model-value model iter index)) 'vector)) @@ -841,7 +847,10 @@ then the model will sort using this function." (column tree-view-column) (base-column (or null tree-view-column))) -;;(defbinding tree-view-set-column drag-function ...) +(define-callback-setter tree-view-set-column-drag-function tree-view boolean + (column tree-view-column) + (prev tree-view-column) + (next tree-view-column)) (defbinding tree-view-scroll-to-point () nil (tree-view tree-view) @@ -856,13 +865,8 @@ then the model will sort using this function." (row-align single-float) (col-align single-float)) -(defbinding tree-view-set-cursor () nil - (tree-view tree-view) - (path tree-path) - (focus-column tree-view-column) - (start-editing boolean)) - -(defbinding tree-view-set-cursor-on-cell () nil +(defbinding (tree-view-set-cursor "gtk_tree_view_set_cursor_on_cell") + (tree-view path &key focus-column focus-cell start-editing) nil (tree-view tree-view) (path tree-path) (focus-column (or null tree-view-column)) @@ -1083,18 +1087,18 @@ then the model will sort using this function." (start-path tree-path :out) (end-path tree-path :out)) -;; (defbinding icon-view-enable-model-drag-source () nil -;; (icon-view icon-view) -;; (start-button-mask gdk:modifier-type) -;; (targets (vector target-entry)) -;; ((length targets) unsigned-int) -;; (actions gdk:drag-action)) - -;; (defbinding icon-view-enable-model-drag-dest () nil -;; (icon-view icon-view) -;; (targets (vector target-entry)) -;; ((length targets) unsigned-int) -;; (actions gdk:drag-action)) + (defbinding icon-view-enable-model-drag-source () nil + (icon-view icon-view) + (start-button-mask gdk:modifier-type) + (targets (vector (inlined target-entry))) + ((length targets) unsigned-int) + (actions gdk:drag-action)) + + (defbinding icon-view-enable-model-drag-dest () nil + (icon-view icon-view) + (targets (vector (inlined target-entry))) + ((length targets) unsigned-int) + (actions gdk:drag-action)) (defbinding icon-view-unset-model-drag-source () nil (icon-view icon-view))