3 (defcfun gtk-tree-store-set-column-types
:void
4 (tree-store (g-object tree-store
))
8 (defun call-tree-store-set-column-types (tree-store column-types
)
9 (let ((n (length column-types
)))
10 (with-foreign-object (types-ar 'g-type-designator n
)
11 (iter (for i from
0 below n
)
12 (for type in column-types
)
13 (setf (mem-aref types-ar
'g-type-designator i
) type
))
14 (gtk-tree-store-set-column-types tree-store n types-ar
))))
16 (defmethod initialize-instance :after
((store tree-store
) &rest initargs
&key
(column-types nil column-types-supplied-p
) &allow-other-keys
)
17 (declare (ignore initargs
))
18 (when column-types-supplied-p
19 (call-tree-store-set-column-types store column-types
)))
21 (defcfun (%gtk-tree-store-set-value
"gtk_tree_store_set_value") :void
22 (tree-store (g-object tree-store
))
23 (iter (g-boxed-foreign tree-iter
))
27 (defun gtk-tree-store-set-value (tree-store iter column value
)
28 (with-foreign-object (v 'g-value
)
29 (set-g-value v value
(tree-model-column-type tree-store column
) :zero-g-value t
)
30 (%gtk-tree-store-set-value tree-store iter column v
)
34 (defun tree-store-value (tree-store iter column
)
35 (tree-model-value tree-store iter column
))
37 (defun (setf tree-store-value
) (new-value tree-store iter column
)
38 (gtk-tree-store-set-value tree-store iter column new-value
)
41 (export 'tree-store-value
)
44 ;; void gtk_tree_store_set_valuesv (GtkTreeStore *tree_store,
50 (defcfun (tree-store-remove "gtk_tree_store_remove") :boolean
51 (tree-store (g-object tree-store
))
52 (iter (g-boxed-foreign tree-iter
)))
54 (export 'tree-store-remove
)
56 (defcfun gtk-tree-store-insert
:void
57 (tree-store (g-object tree-store
))
58 (iter (g-boxed-foreign tree-iter
))
59 (parent (g-boxed-foreign tree-iter
))
62 (defun tree-store-insert (tree-store parent position
)
63 (let ((iter (make-tree-iter)))
64 (gtk-tree-store-insert tree-store iter parent position
)
67 (defcfun gtk-tree-store-insert-before
:void
68 (tree-store (g-object tree-store
))
69 (iter (g-boxed-foreign tree-iter
))
70 (parent (g-boxed-foreign tree-iter
))
71 (sibling (g-boxed-foreign tree-iter
)))
73 (defun tree-store-insert-before (tree-store parent sibling
)
74 (let ((iter (make-tree-iter)))
75 (gtk-tree-store-insert-before tree-store iter parent sibling
)
78 (defcfun gtk-tree-store-insert-after
:void
79 (tree-store (g-object tree-store
))
80 (iter (g-boxed-foreign tree-iter
))
81 (parent (g-boxed-foreign tree-iter
))
82 (sibling (g-boxed-foreign tree-iter
)))
84 (defun tree-store-insert-after (tree-store parent sibling
)
85 (let ((iter (make-tree-iter)))
86 (gtk-tree-store-insert-after tree-store iter parent sibling
)
89 (export '(tree-store-insert tree-store-insert-before tree-store-insert-after
))
91 (defcfun gtk-tree-store-insert-with-valuesv
:void
92 (tree-store (g-object tree-store
))
93 (iter (g-boxed-foreign tree-iter
))
94 (parent (g-boxed-foreign tree-iter
))
100 (defun tree-store-insert-with-values (tree-store parent position
&rest values
)
101 (let ((n (length values
))
102 (iter (make-tree-iter)))
103 (with-foreign-objects ((v-ar 'g-value n
)
105 (iter (for i from
0 below n
)
106 (for value in values
)
107 (for type
= (tree-model-column-type tree-store i
))
108 (setf (mem-aref columns-ar
:int i
) i
)
109 (set-g-value (mem-aref v-ar
'g-value i
) value type
:zero-g-value t
))
110 (gtk-tree-store-insert-with-valuesv tree-store iter parent position columns-ar v-ar n
)
111 (iter (for i from
0 below n
)
112 (g-value-unset (mem-aref v-ar
'g-value i
)))
115 (export 'tree-store-insert-with-values
)
117 (defcfun gtk-tree-store-prepend
:void
118 (tree-store (g-object tree-store
))
119 (iter (g-boxed-foreign tree-iter
))
120 (parent (g-boxed-foreign tree-iter
)))
122 (defun tree-store-prepend (tree-store parent
)
123 (let ((iter (make-tree-iter)))
124 (gtk-tree-store-prepend tree-store iter parent
)
127 (defcfun gtk-tree-store-append
:void
128 (tree-store (g-object tree-store
))
129 (iter (g-boxed-foreign tree-iter
))
130 (parent (g-boxed-foreign tree-iter
)))
132 (defun tree-store-append (tree-store parent
)
133 (let ((iter (make-tree-iter)))
134 (gtk-tree-store-append tree-store iter parent
)
137 (export '(tree-store-prepend tree-store-append
))
139 (defcfun (tree-store-is-ancestor "gtk_tree_store_is_ancestor") :boolean
140 (tree-store (g-object tree-store
))
141 (iter (g-boxed-foreign tree-iter
))
142 (descendant (g-boxed-foreign tree-iter
)))
144 (export 'tree-store-is-ancestor
)
146 (defcfun (tree-store-iter-depth "gtk_tree_store_iter_depth") :int
147 (tree-store (g-object tree-store
))
148 (tree-iter (g-boxed-foreign tree-iter
)))
150 (export 'tree-store-iter-depth
)
152 (defcfun (tree-store-clear "gtk_tree_store_clear") :void
153 (tree-store (g-object tree-store
)))
155 (export 'tree-store-clear
)
157 (defcfun (tree-store-iter-is-valid "gtk_tree_store_iter_is_valid") :boolean
158 (tree-store (g-object tree-store
))
159 (iter (g-boxed-foreign tree-iter
)))
161 (export 'tree-store-iter-is-valid
)
164 ;; void gtk_tree_store_reorder (GtkTreeStore *tree_store,
165 ;; GtkTreeIter *parent,
169 (defcfun (tree-store-swap "gtk_tree_store_swap") :void
170 (tree-store (g-object tree-store
))
171 (a (g-boxed-foreign tree-iter
))
172 (b (g-boxed-foreign tree-iter
)))
174 (export 'tree-store-swap
)
176 (defcfun (tree-store-move-before "gtk_tree_store_move_before") :void
177 (tree-store (g-object tree-store
))
178 (iter (g-boxed-foreign tree-iter
))
179 (position (g-boxed-foreign tree-iter
)))
181 (export 'tree-store-move-before
)
183 (defcfun (tree-store-move-after "gtk_tree_store_move_after") :void
184 (tree-store (g-object tree-store
))
185 (iter (g-boxed-foreign tree-iter
))
186 (position (g-boxed-foreign tree-iter
)))
188 (export 'tree-store-move-after
)