+;;; Tree Selection
+
+(def-callback-marshal %tree-selection-func (boolean tree-selection tree-model (path (copy-of tree-path)) (path-currently-selected boolean)))
+
+(defbinding tree-selection-set-select-function (selection function) nil
+ (selection tree-selection)
+ ((callback %tree-selection-func) pointer)
+ ((register-callback-function function) unsigned-int)
+ ((callback %destroy-user-data) pointer))
+
+(defbinding tree-selection-get-selected
+ (selection &optional (iter (make-instance 'tree-iter))) boolean
+ (selection tree-selection)
+ (nil null)
+ (iter tree-iter :return))
+
+(def-callback-marshal %tree-selection-foreach-func (nil tree-model (path (copy-of tree-path)) (iter (copy-of tree-iter))))
+
+(defbinding %tree-selection-selected-foreach () nil
+ (tree-selection tree-selection)
+ ((callback %tree-selection-foreach-func) pointer)
+ (callback-id unsigned-int))
+
+(defun tree-selection-selected-foreach (selection function)
+ (with-callback-function (id function)
+ (%tree-selection-selected-foreach selection id)))
+
+(defbinding tree-selection-get-selected-rows () (glist tree-path)
+ (tree-selection tree-selection)
+ (nil null))
+
+(defbinding tree-selection-count-selected-rows () int
+ (tree-selection tree-selection))
+
+(defbinding %tree-selection-select-path () nil
+ (tree-selection tree-selection)
+ (tree-path tree-path))
+
+(defbinding %tree-selection-unselect-path () nil
+ (tree-selection tree-selection)
+ (tree-path tree-path))
+
+(defbinding %tree-selection-path-is-selected () boolean
+ (tree-selection tree-selection)
+ (tree-path tree-path))
+
+(defbinding %tree-selection-select-iter () nil
+ (tree-selection tree-selection)
+ (tree-path tree-path))
+
+(defbinding %tree-selection-unselect-iter () nil
+ (tree-selection tree-selection)
+ (tree-path tree-path))
+
+(defbinding %tree-selection-iter-is-selected () boolean
+ (tree-selection tree-selection)
+ (tree-path tree-path))
+
+(defun tree-selection-select (selection row)
+ (etypecase row
+ (tree-path (%tree-selection-select-path selection row))
+ (tree-iter (%tree-selection-select-iter selection row))))
+
+(defun tree-selection-unselect (selection row)
+ (etypecase row
+ (tree-path (%tree-selection-unselect-path selection row))
+ (tree-iter (%tree-selection-unselect-iter selection row))))
+
+(defun tree-selection-is-selected-p (selection row)
+ (etypecase row
+ (tree-path (%tree-selection-path-is-selected selection row))
+ (tree-iter (%tree-selection-iter-is-selected selection row))))
+
+(defbinding tree-selection-select-all () nil
+ (tree-selection tree-selection))
+
+(defbinding tree-selection-unselect-all () nil
+ (tree-selection tree-selection))
+
+(defbinding tree-selection-select-range () nil
+ (tree-selection tree-selection)
+ (start tree-path)
+ (end tree-path))
+
+(defbinding tree-selection-unselect-range () nil
+ (tree-selection tree-selection)
+ (start tree-path)
+ (end tree-path))
+
+
+