3 (defcfun gtk-tree-selection-set-select-function :void
5 (select-function :pointer)
7 (destroy-notify :pointer))
9 (defcallback gtk-tree-selection-select-function-callback :boolean
10 ((selection g-object) (model g-object) (path (g-boxed-ref tree-path)) (path-currently-selected :boolean) (data :pointer))
11 (let ((fn (get-stable-pointer-value data)))
13 (funcall fn selection model path path-currently-selected)
15 (return-false () nil))))
17 (defun tree-selection-set-select-function (tree-selection fn)
18 (gtk-tree-selection-set-select-function tree-selection
19 (callback gtk-tree-selection-select-function-callback)
20 (allocate-stable-pointer fn)
21 (callback stable-pointer-free-destroy-notify-callback)))
23 (defcfun gtk-tree-selection-get-user-data :pointer (tree-selection g-object))
25 (defun tree-selection-get-select-function (tree-selection)
26 (let ((ptr (gtk-tree-selection-get-user-data tree-selection)))
27 (unless (null-pointer-p ptr)
28 (get-stable-pointer-value ptr))))
30 (defcfun gtk-tree-selection-get-selected :boolean
33 (iter (g-boxed-ref tree-iter)))
35 (defun tree-selection-selected (tree-selection)
36 (let ((iter (make-instance 'tree-iter)))
37 (if (gtk-tree-selection-get-selected tree-selection (null-pointer) iter)
41 (export 'tree-selection-selected)
43 (defcfun gtk-tree-selection-selected-foreach :void
48 (defcallback gtk-tree-selection-foreach-callback :void
49 ((model g-object) (path (g-boxed-ref tree-path)) (iter (g-boxed-ref tree-iter)) (data :pointer))
50 (let ((fn (get-stable-pointer-value data)))
51 (funcall fn model path iter)))
53 (defun map-tree-selection-rows (tree-selection fn)
54 (with-stable-pointer (ptr fn)
55 (gtk-tree-selection-selected-foreach tree-selection (callback gtk-tree-selection-foreach-callback) ptr)))
57 (export 'map-tree-selection-rows)
59 (defcfun gtk-tree-selection-get-selected-rows (glist (g-boxed-ref tree-path) :free-from-foreign t)
63 (defun tree-selection-selected-rows (tree-selection)
64 (gtk-tree-selection-get-selected-rows tree-selection (null-pointer)))
66 (export 'tree-selection-selected-rows)
68 (defcfun (tree-selection-count-selected-rows "gtk_tree_selection_count_selected_rows") :int
71 (export 'tree-selection-count-selected-rows)
73 (defcfun (tree-selection-select-path "gtk_tree_selection_select_path") :void
75 (path (g-boxed-ref tree-path)))
77 (export 'tree-selection-select-path)
79 (defcfun (tree-selection-unselect-path "gtk_tree_selection_unselect_path") :void
81 (path (g-boxed-ref tree-path)))
83 (export 'tree-selection-unselect-path)
85 (defcfun (tree-selection-path-selected-p "gtk_tree_selection_path_is_selected") :boolean
87 (path (g-boxed-ref tree-path)))
89 (export 'tree-selection-path-selected-p)
91 (defcfun (tree-selection-select-iter "gtk_tree_selection_select_iter") :void
93 (iter (g-boxed-ref tree-iter)))
95 (export 'tree-selection-select-iter)
97 (defcfun (tree-selection-unselect-iter "gtk_tree_selection_unselect_iter") :void
99 (iter (g-boxed-ref tree-iter)))
101 (export 'tree-selection-unselect-iter)
103 (defcfun (tree-selection-iter-selected-p "gtk_tree_selection_iter_is_selected") :boolean
105 (iter (g-boxed-ref tree-iter)))
107 (export 'tree-selection-iter-selected-p)
109 (defcfun (tree-selection-select-all "gtk_tree_selection_select_all") :void
110 (selection g-object))
112 (export 'tree-selection-select-all)
114 (defcfun (tree-selection-unselect-all "gtk_tree_selection_unselect_all") :void
115 (selection g-object))
117 (export 'tree-selection-unselect-all)
119 (defcfun (tree-selection-select-range "gtk_tree_selection_select_range") :void
121 (start-path (g-boxed-ref tree-path))
122 (end-path (g-boxed-ref tree-path)))
124 (export 'tree-selection-select-range)
126 (defcfun (tree-selection-unselect-range "gtk_tree_selection_unselect_range") :void
128 (start-path (g-boxed-ref tree-path))
129 (end-path (g-boxed-ref tree-path)))
131 (export 'tree-selection-unselect-range)