3 (define-vtable ("GtkTreeModel" tree-model
)
4 (:skip parent-instance g-type-interface
)
6 (:skip tree-model-row-changed
:pointer
)
7 (:skip tree-model-row-inserted
:pointer
)
8 (:skip tree-model-row-has-child-toggled
:pointer
)
9 (:skip tree-model-row-deleted
:pointer
)
10 (:skip tree-model-rows-reordered
:pointer
)
12 (get-flags (tree-model-flags (tree-model g-object
)))
13 (get-n-columns (:int
(tree-model g-object
)))
14 (get-column-type (g-type-designator
19 (iter (g-boxed-foreign tree-iter
))
20 (path (g-boxed-foreign tree-path
))))
21 (get-path ((g-boxed-foreign tree-path
:return
)
23 (iter (g-boxed-foreign tree-iter
))))
26 (iter (g-boxed-foreign tree-iter
))
28 (value (:pointer g-value
)))
31 (multiple-value-bind (v type
) (tree-model-get-value-impl tree-model iter n
)
32 (set-g-value value v type
))))
35 (iter (g-boxed-foreign tree-iter
))))
36 (iter-children (:boolean
38 (iter (g-boxed-foreign tree-iter
))
39 (parent (g-boxed-foreign tree-iter
))))
40 (iter-has-child (:boolean
42 (iter (g-boxed-foreign tree-iter
))))
43 (iter-n-children (:int
45 (iter (g-boxed-foreign tree-iter
))))
46 (iter-nth-child (:boolean
48 (iter (g-boxed-foreign tree-iter
))
49 (parent (g-boxed-foreign tree-iter
))
51 (iter-parent (:boolean
53 (iter (g-boxed-foreign tree-iter
))
54 (child (g-boxed-foreign tree-iter
))))
57 (iter (g-boxed-foreign tree-iter
))))
60 (iter (g-boxed-foreign tree-iter
)))))
62 (define-vtable ("GtkTreeSortable" tree-sortable
)
63 (:skip parent-instance g-type-interface
)
65 (:skip sort-columns-changed
:pointer
)
68 (:boolean
(sortable (g-object tree-sortable
))
69 (sort-column-id (:pointer
:int
))
70 (order (:pointer sort-type
)))
71 :impl-call
((sortable)
72 (multiple-value-bind (sorted-p r-sort-column-id r-order
) (tree-sortable-get-sort-column-id-impl sortable
)
73 (unless (null-pointer-p sort-column-id
)
74 (setf (mem-ref sort-column-id
:int
) r-sort-column-id
))
75 (unless (null-pointer-p order
)
76 (setf (mem-ref order
'sort-type
) r-order
))
78 (set-sort-column-id (:void
(sortable (g-object tree-sortable
)) (sort-column-id :int
) (order sort-type
)))
79 (set-sort-func (:void
(sortable (g-object tree-sortable
)) (sort-column-id :int
) (func :pointer
) (data :pointer
) (destroy-notify :pointer
)))
80 (set-default-sort-func (:void
(sortable (g-object tree-sortable
)) (func :pointer
) (data :pointer
) (destroy-notify :pointer
)))
81 (has-default-sort-func (:boolean
(sortable (g-object tree-sortable
)))))
83 (defcfun (tree-model-sort-convert-child-path-to-path "gtk_tree_model_sort_convert_child_path_to_path") (g-boxed-foreign tree-path
:return
)
84 (tree-model-sort (g-object tree-model-sort
))
85 (child-path (g-boxed-foreign tree-path
)))
87 (export 'tree-model-sort-conver-child-path-to-path
)
89 (defcfun gtk-tree-model-sort-convert-child-iter-to-iter
:boolean
90 (tree-model-sort (g-object tree-model-sort
))
91 (sort-iter (g-boxed-foreign tree-iter
))
92 (child-iter (g-boxed-foreign tree-iter
)))
94 (defun tree-model-sort-convert-child-iter-to-iter (tree-model-sort child-iter
)
95 (let ((sort-iter (make-tree-iter)))
96 (when (gtk-tree-model-sort-convert-child-iter-to-iter tree-model-sort sort-iter child-iter
)
99 (export 'tree-model-sort-convert-child-iter-to-iter
)
101 (defcfun (tree-model-sort-convert-path-to-child-path "gtk_tree_model_sort_convert_path_to_child_path") (g-boxed-foreign tree-path
:return
)
102 (tree-model-sort (g-object tree-model-sort
))
103 (sort-path (g-boxed-foreign tree-path
)))
105 (export 'tree-model-sort-convert-path-to-child-path
)
107 (defcfun gtk-tree-model-sort-convert-iter-to-child-iter
:void
108 (tree-model-sort (g-object tree-model-sort
))
109 (child-iter (g-boxed-foreign tree-iter
))
110 (sorted-iter (g-boxed-foreign tree-iter
)))
112 (defun tree-model-sort-convert-iter-to-child-iter (tree-model-sort sorted-iter
)
113 (let ((child-iter (make-tree-iter)))
114 (gtk-tree-model-sort-convert-iter-to-child-iter tree-model-sort child-iter sorted-iter
)
117 (export 'tree-model-sort-convert-iter-to-child-iter
)
119 (defcfun (tree-model-sort-reset-default-sort-func "gtk_tree_model_sort_reset_default_sort_func") :void
120 (tree-model-sort (g-object tree-model-sort
)))
122 (export 'tree-model-sort-reset-default-sort-func
)
124 (defcfun (tree-model-sort-clear-cache "gtk_tree_model_sort_clear_cache") :void
125 (tree-model-sort (g-object tree-model-sort
)))
127 (export 'tree-model-sort-clear-cached
)
129 (defcfun (tree-model-sort-iter-is-valid "gtk_tree_model_sort_iter_is_valid") :boolean
130 (tree-model-sort (g-object tree-model-sort
))
131 (iter (g-boxed-foreign tree-iter
)))
133 (export 'tree-model-sort-iter-is-valid
)
135 ; TODO: GtkTreeModelFilter
137 (defclass array-list-store
(tree-model)
138 ((items :initform
(make-array 0 :adjustable t
:fill-pointer t
) :reader store-items
)
139 (columns-getters :initform
(make-array 0 :adjustable t
:fill-pointer t
) :reader store-getters
)
140 (columns-types :initform
(make-array 0 :adjustable t
:fill-pointer t
) :reader store-types
))
141 (:metaclass gobject-class
)
142 (:g-type-name .
"LispArrayListStore"))
144 (export 'array-list-store
)
146 (register-object-type-implementation "LispArrayListStore" array-list-store
"GObject" ("GtkTreeModel") nil
)
148 (defun store-items-count (store)
149 (length (store-items store
)))
151 (export 'store-items-count
)
153 (defun store-item (store index
)
154 (aref (store-items store
) index
))
158 (defun store-add-item (store item
)
159 (vector-push-extend item
(store-items store
))
160 (let* ((path (make-instance 'tree-path
))
161 (iter (make-tree-iter)))
162 (setf (tree-path-indices path
) (list (1- (length (store-items store
)))))
163 (setf (tree-iter-stamp iter
) 0 (tree-iter-user-data iter
) (1- (length (store-items store
))))
164 (emit-signal store
"row-inserted" path iter
)))
166 (export 'store-add-item
)
168 (defun store-remove-item (store item
&key
(test 'eq
))
169 (with-slots (items) store
170 (let ((index (position item items
:test test
)))
171 (unless index
(error "No such item~%~A~%in list-store~%~A" item store
))
172 (setf items
(delete item items
:test test
))
173 (let ((path (make-instance 'tree-path
)))
174 (setf (tree-path-indices path
) (list index
))
175 (emit-signal store
"row-deleted" path
)))))
177 (export 'store-remove-item
)
179 (defun store-add-column (store type getter
)
180 (vector-push-extend type
(store-types store
))
181 (vector-push-extend getter
(store-getters store
))
182 (1- (length (store-types store
))))
184 (export 'store-add-column
)
186 (defmethod tree-model-get-flags-impl ((model array-list-store
))
189 (defmethod tree-model-get-n-columns-impl ((model array-list-store
))
190 (length (store-types model
)))
192 (defmethod tree-model-get-column-type-impl ((tree-model array-list-store
) index
)
193 (aref (store-types tree-model
) index
))
195 (defmethod tree-model-get-iter-impl ((model array-list-store
) iter path
)
196 (let ((indices (tree-path-indices path
)))
197 (when (and (= 1 (length indices
))
198 (< (first indices
) (length (store-items model
))))
199 (setf (tree-iter-stamp iter
) 0 (tree-iter-user-data iter
) (first indices
))
202 (defmethod tree-model-ref-node-impl ((model array-list-store
) iter
)
203 (declare (ignorable model iter
)))
204 (defmethod tree-model-unref-node-impl ((model array-list-store
) iter
)
205 (declare (ignorable model iter
)))
207 (defmethod tree-model-iter-next-impl ((model array-list-store
) iter
)
208 (let ((n (tree-iter-user-data iter
)))
209 (when (< n
(1- (length (store-items model
))))
210 (setf (tree-iter-user-data iter
) (1+ n
))
213 (defmethod tree-model-iter-nth-child-impl ((model array-list-store
) iter parent n
)
214 (declare (ignorable parent
))
215 (setf (tree-iter-stamp iter
) 0
216 (tree-iter-user-data iter
) n
)
219 (defmethod tree-model-iter-children-impl ((model array-list-store
) iter parent
)
220 (declare (ignore iter parent
))
223 (defmethod tree-model-iter-n-children-impl ((model array-list-store
) iter
)
225 (length (store-items model
))
228 (defmethod tree-model-get-path-impl ((model array-list-store
) iter
)
229 (let ((path (make-instance 'tree-path
)))
230 (setf (tree-path-indices path
) (list (tree-iter-user-data iter
)))
233 (defmethod tree-model-iter-has-child-impl ((model array-list-store
) iter
)
234 (declare (ignorable iter
))
237 (defgeneric tree-model-item
(model iter-or-path
))
239 (defmethod tree-model-item ((model array-list-store
) (iter tree-iter
))
240 (let ((n-row (tree-iter-user-data iter
)))
241 (aref (store-items model
) n-row
)))
243 (defmethod tree-model-item ((model array-list-store
) (path tree-path
))
244 (let ((n-row (first (tree-path-indices path
))))
245 (aref (store-items model
) n-row
)))
247 (export 'tree-model-item
)
249 (defmethod tree-model-get-value-impl ((model array-list-store
) iter n
)
250 (let ((n-row (tree-iter-user-data iter
)))
251 (values (funcall (aref (store-getters model
) n
)
252 (aref (store-items model
) n-row
))
253 (aref (store-types model
) n
))))
255 (defcfun (tree-model-flags "gtk_tree_model_get_flags") tree-model-flags
256 (tree-model g-object
))
258 (export 'tree-model-flags
)
260 (defcfun (tree-model-n-columns "gtk_tree_model_get_n_columns") :int
261 (tree-model g-object
))
263 (export 'tree-model-flags
)
265 (defcfun (tree-model-column-type "gtk_tree_model_get_column_type") g-type-designator
266 (tree-model g-object
)
269 (export 'tree-model-column-type
)
271 (defcfun (tree-model-set-iter-to-path "gtk_tree_model_get_iter") :boolean
272 (tree-model g-object
)
273 (iter (g-boxed-foreign tree-iter
))
274 (path (g-boxed-foreign tree-path
)))
276 (defun tree-model-iter-by-path (tree-model tree-path
)
277 (let ((iter (make-tree-iter)))
278 (if (tree-model-set-iter-to-path tree-model iter tree-path
)
282 (export 'tree-model-iter-by-path
)
284 (defcfun (tree-model-set-iter-from-string "gtk_tree_model_get_iter_from_string") :boolean
285 (tree-model g-object
)
286 (iter (g-boxed-foreign tree-iter
))
287 (path-string :string
))
289 (defun tree-model-iter-from-string (tree-model path-string
)
290 (let ((iter (make-tree-iter)))
291 (if (tree-model-set-iter-from-string tree-model iter path-string
)
295 (export 'tree-model-iter-from-string
)
297 (defcfun (tree-model-set-iter-to-first "gtk_tree_model_get_iter_first") :boolean
299 (iter (g-boxed-foreign tree-iter
)))
301 (defun tree-model-iter-first (tree-model)
302 (let ((iter (make-tree-iter)))
303 (if (tree-model-set-iter-to-first tree-model iter
)
307 (export 'tree-model-iter-first
)
309 (defcfun (tree-model-path "gtk_tree_model_get_path") (g-boxed-foreign tree-path
:return
)
310 (tree-model g-object
)
311 (iter (g-boxed-foreign tree-iter
)))
313 (export 'tree-model-path
)
315 (defcfun gtk-tree-model-get-value
:void
317 (iter (g-boxed-foreign tree-iter
))
319 (value (:pointer g-value
)))
321 (defun tree-model-value (tree-model iter column
)
322 (with-foreign-object (v 'g-value
)
324 (gtk-tree-model-get-value tree-model iter column v
)
325 (prog1 (parse-g-value v
)
328 (export 'tree-model-value
)
330 (defcfun (tree-model-iter-next "gtk_tree_model_iter_next") :boolean
331 (tree-model g-object
)
332 (iter (g-boxed-foreign tree-iter
)))
334 (export 'tree-model-iter-next
)
336 (defcfun gtk-tree-model-iter-children
:boolean
337 (tree-model g-object
)
338 (iter (g-boxed-foreign tree-iter
))
339 (parent (g-boxed-foreign tree-iter
)))
341 (defun tree-model-iter-first-child (tree-model parent
)
342 (let ((iter (make-tree-iter)))
343 (if (gtk-tree-model-iter-children tree-model iter parent
)
347 (export 'tree-model-iter-first-child
)
349 (defcfun (tree-model-iter-has-child "gtk_tree_model_iter_has_child") :boolean
350 (tree-model g-object
)
351 (iter (g-boxed-foreign tree-iter
)))
353 (export 'tree-model-iter-has-child
)
355 (defcfun (tree-model-iter-n-children "gtk_tree_model_iter_n_children") :int
356 (tree-model g-object
)
357 (iter (g-boxed-foreign tree-iter
)))
359 (export 'tree-model-iter-n-children
)
361 (defcfun gtk-tree-model-iter-nth-child
:boolean
362 (tree-model g-object
)
363 (iter (g-boxed-foreign tree-iter
))
364 (parent (g-boxed-foreign tree-iter
))
367 (defun tree-model-iter-nth-child (tree-model parent n
)
368 (let ((iter (make-tree-iter)))
369 (if (gtk-tree-model-iter-nth-child tree-model iter parent n
)
373 (export 'tree-model-iter-nth-child
)
375 (defcfun gtk-tree-model-iter-parent
:boolean
376 (tree-model g-object
)
377 (iter (g-boxed-foreign tree-iter
))
378 (parent (g-boxed-foreign tree-iter
)))
380 (defun tree-model-iter-parent (tree-model iter
)
381 (let ((parent (make-tree-iter)))
382 (if (gtk-tree-model-iter-parent tree-model iter parent
)
386 (export 'tree-model-iter-parent
)
388 (defcfun (tree-model-iter-to-string "gtk_tree_model_get_string_from_iter") (g-string :free-from-foreign t
)
389 (tree-model g-object
)
390 (iter (g-boxed-foreign tree-iter
)))
392 (export 'tree-model-iter-to-string
)
394 (defcfun (tree-model-ref-node "gtk_tree_model_ref_node") :void
395 (tree-model g-object
)
396 (iter (g-boxed-foreign tree-iter
)))
398 (export 'tree-model-ref-node
)
400 (defcfun (tree-model-unref-node "gtk_tree_model_unref_node") :void
401 (tree-model g-object
)
402 (iter (g-boxed-foreign tree-iter
)))
404 (export 'tree-model-unref-node
)
406 (defcallback gtk-tree-model-foreach-cb
:boolean
((model g-object
) (path (g-boxed-foreign tree-path
)) (iter (g-boxed-foreign tree-iter
)) (data :pointer
))
407 (let ((fn (get-stable-pointer-value data
)))
409 (funcall fn model path iter
)
410 (stop-tree-model-iteration () t
)
411 (skip-tree-model-current () nil
))))
413 (defcfun gtk-tree-model-foreach
:void
418 (defun do-tree-model (model fn
)
419 (with-stable-pointer (ptr fn
)
420 (gtk-tree-model-foreach model
(callback gtk-tree-model-foreach-cb
) ptr
)))
422 (export 'do-tree-model
)
424 (defun array-insert-at (array element index
)
425 (assert (adjustable-array-p array
))
426 (adjust-array array
(1+ (length array
)) :fill-pointer t
)
427 (iter (for i from
(1- (length array
)) above index
)
429 (aref array
(1- i
))))
430 (setf (aref array index
) element
)
433 (defun array-remove-at (array index
)
434 (assert (adjustable-array-p array
))
435 (iter (for i from index below
(1- (length array
)))
437 (aref array
(1+ i
))))
438 (adjust-array array
(1- (length array
)) :fill-pointer t
)
446 (children (make-array 0 :element-type
'tree-node
:adjustable t
:fill-pointer t
)))
448 (defclass tree-lisp-store
(tree-model)
449 ((columns-getters :initform
(make-array 0 :adjustable t
:fill-pointer t
) :reader tree-lisp-store-getters
)
450 (columns-types :initform
(make-array 0 :adjustable t
:fill-pointer t
) :reader tree-lisp-store-types
)
451 (root :initform
(make-tree-node) :reader tree-lisp-store-root
)
452 (id-map :initform
(make-hash-table) :reader tree-lisp-store-id-map
)
453 (next-id-value :initform
0 :accessor tree-lisp-store-next-id-value
))
454 (:metaclass gobject-class
)
455 (:g-type-name .
"LispTreeStore"))
457 (defmethod initialize-instance :after
((object tree-lisp-store
) &key
&allow-other-keys
)
458 (setf (tree-node-tree (tree-lisp-store-root object
)) object
))
460 (register-object-type-implementation "LispTreeStore" tree-lisp-store
"GObject" ("GtkTreeModel") nil
)
462 (defun map-subtree (node fn
)
464 (iter (for child in-vector
(tree-node-children node
))
465 (map-subtree child fn
)))
467 (defun clear-id (node)
470 (when (and (tree-node-id n
)
472 (remhash (tree-node-id n
)
473 (tree-lisp-store-id-map (tree-node-tree n
))))
474 (setf (tree-node-id n
) nil
))))
476 (defun set-node-tree (node tree
)
479 (setf (tree-node-tree n
) tree
))))
481 (defun tree-node-insert-at (node child index
)
482 (assert (null (tree-node-parent child
)))
484 (setf (tree-node-parent child
) node
)
485 (set-node-tree child
(tree-node-tree node
))
486 (array-insert-at (tree-node-children node
) child index
)
487 (notice-tree-node-insertion (tree-node-tree node
) node child index
)
490 (defun tree-node-child-at (node index
)
491 (aref (tree-node-children node
) index
))
493 (defun tree-node-remove-at (node index
)
494 (assert (<= 0 index
(1- (length (tree-node-children node
)))))
495 (let ((child (tree-node-child-at node index
)))
497 (setf (tree-node-parent child
) nil
)
498 (set-node-tree child nil
)
499 (array-remove-at (tree-node-children node
) index
)
500 (notice-tree-node-removal (tree-node-tree node
) node child index
)))
502 (defun tree-lisp-store-add-column (store column-type column-getter
)
503 (vector-push-extend column-getter
(tree-lisp-store-getters store
))
504 (vector-push-extend column-type
(tree-lisp-store-types store
)))
506 (defmethod tree-model-get-flags-impl ((store tree-lisp-store
))
509 (defmethod tree-model-get-n-columns-impl ((store tree-lisp-store
))
510 (length (tree-lisp-store-getters store
)))
512 (defmethod tree-model-get-column-type-impl ((store tree-lisp-store
) index
)
513 (aref (tree-lisp-store-types store
) index
))
515 (defun get-node-by-indices (root indices
)
517 (get-node-by-indices (tree-node-child-at root
(first indices
)) (rest indices
))
520 (defun get-node-by-path (tree path
)
521 (let ((indices (tree-path-indices path
)))
522 (get-node-by-indices (tree-lisp-store-root tree
) indices
)))
524 (defun get-node-path (node)
526 (for parent
= (tree-node-parent node
))
528 (for index
= (position node
(tree-node-children parent
)))
531 (finally (return z
))))
533 (defun tree-lisp-store-get-next-id (tree)
534 (incf (tree-lisp-store-next-id-value tree
)))
536 (defun tree-lisp-store-add-id-map (tree id node
)
537 (setf (gethash id
(tree-lisp-store-id-map tree
)) node
))
539 (defun get-assigned-id (tree node
)
540 (or (tree-node-id node
)
541 (let ((id (tree-lisp-store-get-next-id tree
)))
542 (tree-lisp-store-add-id-map tree id node
)
543 (setf (tree-node-id node
) id
)
546 (defun get-node-by-id (tree id
)
547 (gethash id
(tree-lisp-store-id-map tree
)))
549 (defmethod tree-model-get-iter-impl ((store tree-lisp-store
) iter path
)
550 (let* ((node (get-node-by-path store path
))
551 (node-idx (get-assigned-id store node
)))
552 (setf (tree-iter-stamp iter
) 0
553 (tree-iter-user-data iter
) node-idx
)))
555 (defun get-node-by-iter (tree iter
)
556 (get-node-by-id tree
(tree-iter-user-data iter
)))
558 (defmethod tree-model-get-path-impl ((store tree-lisp-store
) iter
)
559 (let* ((path (make-instance 'tree-path
))
560 (node (get-node-by-iter store iter
))
561 (indices (get-node-path node
)))
562 (setf (tree-path-indices path
) indices
)
565 (defmethod tree-model-get-value-impl ((store tree-lisp-store
) iter n
)
566 (let* ((node (get-node-by-iter store iter
))
567 (getter (aref (tree-lisp-store-getters store
) n
))
568 (type (aref (tree-lisp-store-types store
) n
)))
569 (values (funcall getter
(tree-node-item node
))
572 (defmethod tree-model-iter-next-impl ((store tree-lisp-store
) iter
)
573 (let* ((node (get-node-by-iter store iter
))
574 (parent (tree-node-parent node
))
575 (index (position node
(tree-node-children parent
))))
576 (when (< (1+ index
) (length (tree-node-children parent
)))
577 (setf (tree-iter-stamp iter
)
579 (tree-iter-user-data iter
)
580 (get-assigned-id store
(tree-node-child-at parent
(1+ index
))))
583 (defmethod tree-model-iter-children-impl ((store tree-lisp-store
) iter parent
)
584 (let* ((node (if parent
585 (get-node-by-iter store parent
)
586 (tree-lisp-store-root store
))))
587 (when (plusp (length (tree-node-children node
)))
588 (setf (tree-iter-stamp iter
)
590 (tree-iter-user-data iter
)
591 (get-assigned-id store
(tree-node-child-at node
0)))
594 (defmethod tree-model-iter-has-child-impl ((store tree-lisp-store
) iter
)
595 (let ((node (get-node-by-iter store iter
)))
596 (plusp (length (tree-node-children node
)))))
598 (defmethod tree-model-iter-n-children-impl ((store tree-lisp-store
) iter
)
599 (let* ((node (if iter
600 (get-node-by-iter store iter
)
601 (tree-lisp-store-root store
))))
602 (length (tree-node-children node
))))
604 (defmethod tree-model-iter-nth-child-impl ((store tree-lisp-store
) iter parent n
)
605 (let* ((node (if parent
606 (get-node-by-iter store parent
)
607 (tree-lisp-store-root store
)))
608 (requested-node (tree-node-child-at node n
)))
609 (setf (tree-iter-stamp iter
) 0
610 (tree-iter-user-data iter
) (get-assigned-id store requested-node
))
613 (defmethod tree-model-iter-parent-impl ((store tree-lisp-store
) iter child
)
614 (let ((node (get-node-by-iter store child
)))
615 (when (tree-node-parent node
)
616 (setf (tree-iter-stamp iter
) 0
617 (tree-iter-user-data iter
) (get-assigned-id store
(tree-node-parent node
))))))
619 (defmethod tree-model-ref-node-impl ((store tree-lisp-store
) iter
)
620 (declare (ignorable iter
)))
622 (defmethod tree-model-unref-node-impl ((store tree-lisp-store
) iter
)
623 (declare (ignorable iter
)))
625 (defun notice-tree-node-insertion (tree node child index
)
626 (declare (ignore node index
))
628 (let* ((path (make-instance 'tree-path
))
629 (iter (make-tree-iter)))
630 (setf (tree-path-indices path
) (get-node-path child
)
631 (tree-iter-stamp iter
) 0
632 (tree-iter-user-data iter
) (get-assigned-id tree child
))
633 (emit-signal tree
"row-inserted" path iter
)
634 (when (plusp (length (tree-node-children child
)))
635 (emit-signal tree
"row-has-child-toggled" path iter
)))))
637 (defun notice-tree-node-removal (tree node child index
)
638 (declare (ignore child
))
640 (let ((path (make-instance 'tree-path
)))
641 (setf (tree-path-indices path
) (nconc (get-node-path node
) (list index
)))
642 (emit-signal tree
"row-deleted" path
))
643 (when (zerop (length (tree-node-children node
)))
644 (let* ((path (make-instance 'tree-path
))
645 (iter (make-tree-iter)))
646 (setf (tree-path-indices path
) (get-node-path node
)
647 (tree-iter-stamp iter
) 0
648 (tree-iter-user-data iter
) (get-assigned-id tree node
))
649 (emit-signal tree
"row-has-child-toggled" path iter
)))))