Merge remote-tracking branch 'andy128k/master'
[cl-gtk2.git] / gtk / gtk.tree-model-filter.lisp
blobd2af6534992695ace5228a201e043d06527e259b
1 (in-package :gtk)
3 (defcallback gtk-tree-model-filter-visible-func-callback :boolean
4 ((tree-model g-object) (iter (g-boxed-foreign tree-iter)) (data :pointer))
5 (let ((fn (get-stable-pointer-value data)))
6 (restart-case
7 (funcall fn tree-model iter)
8 (return-true () t)
9 (return-false () nil))))
11 (defcfun gtk-tree-model-filter-set-visible-func :void
12 (filter (g-object tree-model-filter))
13 (func :pointer)
14 (data :pointer)
15 (destroy-notify :pointer))
17 (defun tree-model-filter-set-visible-function (tree-model-filter function)
18 (gtk-tree-model-filter-set-visible-func
19 tree-model-filter
20 (callback gtk-tree-model-filter-visible-func-callback)
21 (allocate-stable-pointer function)
22 (callback stable-pointer-free-destroy-notify-callback)))
24 (export 'tree-model-filter-set-visible-function)
28 typedef void (* GtkTreeModelFilterModifyFunc) (GtkTreeModel *model,
29 GtkTreeIter *iter,
30 GValue *value,
31 gint column,
32 gpointer data);
34 void gtk_tree_model_filter_set_modify_func (GtkTreeModelFilter *filter,
35 gint n_columns,
36 GType *types,
37 GtkTreeModelFilterModifyFunc func,
38 gpointer data,
39 GDestroyNotify destroy);
42 (defcfun (tree-model-filter-set-visible-column "gtk_tree_model_filter_set_visible_column") :void
43 (filter (g-object tree-model-filter))
44 (column :int))
46 (export 'tree-model-filter-set-visible-column)
48 ;; conversion
50 (defcfun gtk-tree-model-filter-convert-child-iter-to-iter :boolean
51 (filter (g-object tree-model-filter))
52 (filter-iter (g-boxed-foreign tree-iter))
53 (child-iter (g-boxed-foreign tree-iter)))
55 (defun tree-model-filter-convert-child-iter-to-iter (filter iter)
56 (let ((filter-iter (make-instance 'tree-iter)))
57 (when (gtk-tree-model-filter-convert-child-iter-to-iter filter filter-iter iter)
58 filter-iter)))
60 (export 'tree-model-filter-convert-child-iter-to-iter)
62 (defcfun gtk-tree-model-filter-convert-iter-to-child-iter :void
63 (filter (g-object tree-model-filter))
64 (child-iter (g-boxed-foreign tree-iter))
65 (filter-iter (g-boxed-foreign tree-iter)))
67 (defun tree-model-filter-convert-iter-to-child-iter (filter iter)
68 (let ((child-iter (make-instance 'tree-iter)))
69 (gtk-tree-model-filter-convert-iter-to-child-iter filter child-iter iter)
70 child-iter))
72 (export 'tree-model-filter-convert-iter-to-child-iter)
74 (defcfun (tree-model-filter-convert-child-path-to-path "gtk_tree_model_filter_convert_child_path_to_path") (g-boxed-foreign tree-path :return)
75 (filter (g-object tree-model-sort))
76 (child-path (g-boxed-foreign tree-path)))
78 (export 'tree-model-filter-convert-child-path-to-path)
80 (defcfun (tree-model-filter-convert-path-to-child-path "gtk_tree_model_filter_convert_path_to_child_path") (g-boxed-foreign tree-path :return)
81 (filter (g-object tree-model-sort))
82 (filter-path (g-boxed-foreign tree-path)))
84 (export 'tree-model-filter-convert-path-to-child-path)
86 ;; extras
88 (defcfun (tree-model-filter-refilter "gtk_tree_model_filter_refilter") :void
89 (filter (g-object tree-model-filter)))
91 (export 'tree-model-filter-refilter)
93 (defcfun (tree-model-filter-clear-cache "gtk_tree_model_filter_clear_cache") :void
94 (filter (g-object tree-model-filter)))
96 (export 'tree-model-filter-clear-cache)