Added documentation for GtkDialog
[cl-gtk2.git] / gtk / gtk.tree-view.lisp
blobf9a1e1989839acb47119f434aba749737cc0098d
1 (in-package :gtk)
3 (defcfun (tree-view-columns-autosize "gtk_tree_view_columns_autosize") :void
4 (tree-view g-object))
6 (export 'tree-view-columns-autosize)
8 (defcfun (tree-view-append-column "gtk_tree_view_append_column") :int
9 (tree-view (g-object gtk:tree-view))
10 (column (g-object gtk:tree-view-column)))
12 (export 'tree-view-append-column)
14 (defcfun (tree-view-remove-column "gtk_tree_view_remove_column") :int
15 (tree-view (g-object gtk:tree-view))
16 (column (g-object gtk:tree-view-column)))
18 (export 'tree-view-remove-column)
20 (defcfun (tree-view-insert-column "gtk_tree_view_insert_column") :int
21 (tree-view g-object)
22 (column g-object)
23 (position :int))
25 (export 'tree-view-insert-column)
27 (defcfun (tree-view-get-column "gtk_tree_view_get_column") g-object
28 (tree-view g-object)
29 (position :int))
31 (export 'tree-view-get-column)
33 (defcfun (tree-view-columns "gtk_tree_view_get_columns") (glist g-object)
34 (tree-view g-object))
36 (export 'tree-view-columns)
38 (defcfun (tree-view-move-column-after "gtk_tree_view_move_column_after") :void
39 (tree-view g-object)
40 (column g-object)
41 (base-column g-object))
43 (export 'tree-view-move-column-after)
45 (defcallback gtk-tree-view-column-drop-func-callback :boolean
46 ((tree-view g-object) (column g-object) (prev-column g-object) (next-column g-object) (data :pointer))
47 (let ((fn (get-stable-pointer-value data)))
48 (funcall fn tree-view column prev-column next-column)))
50 (defcfun gtk-tree-view-set-column-drag-function :void
51 (tree-view g-object)
52 (func :pointer)
53 (data :pointer)
54 (destroy-notify :pointer))
56 (defun tree-view-set-column-drag-fuction (tree-view function)
57 (gtk-tree-view-set-column-drag-function tree-view
58 (callback gtk-tree-view-column-drop-func-callback)
59 (allocate-stable-pointer function)
60 (callback stable-pointer-free-destroy-notify-callback)))
62 (defcfun (tree-view-scroll-to-point "gtk_tree_view_scroll_to_point") :void
63 (tree-view g-object)
64 (tree-x :int)
65 (tree-y :int))
67 (export 'tree-view-scroll-to-point)
69 (defcfun gtk-tree-view-scroll-to-cell :void
70 (tree-view g-object)
71 (path (g-boxed-foreign tree-path))
72 (column g-object)
73 (use-align :boolean)
74 (row-align :float)
75 (col-align :float))
77 (defun tree-view-scroll-to-cell (tree-view path column &optional (row-align 0.5 row-align-supplied-p) (col-align 0.5 col-align-supplied-p))
78 (gtk-tree-view-scroll-to-cell tree-view path column (or row-align-supplied-p col-align-supplied-p) row-align col-align))
80 (export 'tree-view-scroll-to-cell)
82 (defcfun gtk-tree-view-set-cursor :void
83 (tree-view g-object)
84 (path (g-boxed-foreign tree-path))
85 (focus-column g-object)
86 (start-editing :boolean))
88 (defun tree-view-set-cursor (tree-view path &key focus-column start-editing)
89 (gtk-tree-view-set-cursor tree-view path focus-column start-editing))
91 (export 'tree-view-set-cursor)
93 (defcfun gtk-tree-view-set-cursor-on-cell :void
94 (tree-view g-object)
95 (path (g-boxed-foreign tree-path))
96 (focus-column g-object)
97 (focus-cell g-object)
98 (start-editing :boolean))
100 (defun tree-view-set-cursor-on-cell (tree-view path &key focus-column focus-cell start-editing)
101 (gtk-tree-view-set-cursor-on-cell tree-view path focus-column focus-cell start-editing))
103 (export 'tree-view-set-cursor-on-cell)
105 (defcfun gtk-tree-view-get-cursor :void
106 (tree-view g-object)
107 (path :pointer)
108 (focus-column :pointer))
110 (defun tree-view-get-cursor (tree-view)
111 (with-foreign-objects ((path :pointer) (focus-column :pointer))
112 (gtk-tree-view-get-cursor tree-view path focus-column)
113 (values (mem-ref path '(g-boxed-foreign tree-path :return))
114 (mem-ref focus-column 'g-object))))
116 (export 'tree-view-get-cursor)
118 (defcfun (tree-view-expand-all "gtk_tree_view_expand_all") :void
119 (tree-view g-object))
121 (export 'tree-view-expand-all)
123 (defcfun (tree-view-collapse-all "gtk_tree_view_collapse_all") :void
124 (tree-view g-object))
126 (export 'tree-view-collapse-all)
128 (defcfun (tree-view-expand-to-path "gtk_tree_view_expand_to_path") :void
129 (tree-view g-object)
130 (path (g-boxed-foreign tree-path)))
132 (export 'tree-view-expand-to-path)
134 (defcfun (tree-view-expand-row "gtk_tree_view_expand_row") :boolean
135 (tree-view g-object)
136 (path (g-boxed-foreign tree-path)))
138 (export 'tree-view-expand-row)
140 (defcfun (tree-view-collapse-row "gtk_tree_view_collapse_row") :boolean
141 (tree-view g-object)
142 (path (g-boxed-foreign tree-path)))
144 (export 'tree-view-collapse-row)
146 (defcallback gtk-tree-view-mapping-func-callback :void
147 ((tree-view g-object) (path (g-boxed-foreign tree-path)) (data :pointer))
148 (funcall (get-stable-pointer-value data)
149 tree-view path))
151 (defcfun gtk-tree-view-map-expanded-rows :void
152 (tree-view g-object)
153 (func :pointer)
154 (data :pointer))
156 (defun tree-view-map-expanded-rows (tree-view function)
157 (with-stable-pointer (ptr function)
158 (gtk-tree-view-map-expanded-rows tree-view (callback gtk-tree-view-mapping-func-callback) ptr)))
160 (export 'tree-view-map-expanded-rows)
162 (defcfun (tree-view-row-expanded-p "gtk_tree_view_row_expanded") :boolean
163 (tree-view g-object)
164 (path (g-boxed-foreign tree-path)))
166 (export 'tree-view-row-expanded-p)
168 (defcfun gtk-tree-view-get-path-at-pos :boolean
169 (tree-view g-object)
170 (x :int)
171 (y :int)
172 (path :pointer)
173 (column :pointer)
174 (cell-x :pointer)
175 (cell-y :pointer))
177 (defun tree-view-get-path-at-pos (tree-view x y)
178 (with-foreign-objects ((path :pointer) (column :pointer) (cell-x :int) (cell-y :int))
179 (when (gtk-tree-view-get-path-at-pos tree-view x y path column cell-x cell-y)
180 (values (mem-ref path '(g-boxed-foreign tree-path :return))
181 (mem-ref column 'g-object)
182 (mem-ref cell-x :int)
183 (mem-ref cell-y :int)))))
185 (export 'tree-view-get-path-at-pos)
187 (defcfun gtk-tree-view-get-cell-area :void
188 (tree-view g-object)
189 (path (g-boxed-foreign tree-path))
190 (column g-object)
191 (rectangle (g-boxed-foreign rectangle)))
193 (defun tree-view-get-cell-area (tree-view path column)
194 (let ((rect (make-rectangle :x 0 :y 0 :width 0 :height 0)))
195 (gtk-tree-view-get-cell-area tree-view path column rect)
196 rect))
198 (export 'tree-view-get-cell-area)
200 (defcfun gtk-tree-view-get-background-area :void
201 (tree-view g-object)
202 (path (g-boxed-foreign tree-path))
203 (column g-object)
204 (rectangle (g-boxed-foreign rectangle)))
206 (defun tree-view-get-background-area (tree-view path column)
207 (let ((rect (make-rectangle :x 0 :y 0 :width 0 :height 0)))
208 (gtk-tree-view-get-background-area tree-view path column rect)
209 rect))
211 (export 'tree-view-get-background-area)
213 (defcfun gtk-tree-view-get-visible-rect :void
214 (tree-view g-object)
215 (rectangle (g-boxed-foreign rectangle)))
217 (defun tree-view-get-visible-rect (tree-view)
218 (let ((rect (make-rectangle :x 0 :y 0 :width 0 :height 0)))
219 (gtk-tree-view-get-visible-rect tree-view rect)
220 rect))
222 (export 'tree-view-get-visible-rect)
224 (defcfun gtk-tree-view-get-visible-range :boolean
225 (tree-view g-object)
226 (start-path :pointer)
227 (end-path :pointer))
229 (defun tree-view-get-visible-range (tree-view)
230 (with-foreign-objects ((start-path :pointer) (end-path :pointer))
231 (when (gtk-tree-view-get-visible-range tree-view start-path end-path)
232 (values (mem-ref start-path '(g-boxed-foreign tree-path :return))
233 (mem-ref end-path '(g-boxed-foreign tree-path :return))))))
235 (export 'tree-view-get-visible-range)
237 (defcfun gtk-tree-view-convert-bin-window-to-tree-coords :void
238 (tree-view g-object)
239 (x :int)
240 (y :int)
241 (rx :pointer)
242 (ry :pointer))
244 (defun tree-view-convert-bin-window-to-tree-coords (tree-view x y)
245 (with-foreign-objects ((rx :int) (ry :int))
246 (gtk-tree-view-convert-bin-window-to-tree-coords tree-view x y rx ry)
247 (values (mem-ref rx :int)
248 (mem-ref ry :int))))
250 (export 'tree-view-convert-bin-window-to-tree-coords)
252 (defcfun gtk-tree-view-convert-bin-window-to-widget-coords :void
253 (tree-view g-object)
254 (x :int)
255 (y :int)
256 (rx :pointer)
257 (ry :pointer))
259 (defun tree-view-convert-bin-window-to-widget-coords (tree-view x y)
260 (with-foreign-objects ((rx :int) (ry :int))
261 (gtk-tree-view-convert-bin-window-to-widget-coords tree-view x y rx ry)
262 (values (mem-ref rx :int)
263 (mem-ref ry :int))))
265 (export 'tree-view-convert-bin-window-to-widget-coords)
267 (defcfun gtk-tree-view-convert-tree-to-bin-window-coords :void
268 (tree-view g-object)
269 (x :int)
270 (y :int)
271 (rx :pointer)
272 (ry :pointer))
274 (defun tree-view-convert-tree-to-bin-window-coords (tree-view x y)
275 (with-foreign-objects ((rx :int) (ry :int))
276 (gtk-tree-view-convert-tree-to-bin-window-coords tree-view x y rx ry)
277 (values (mem-ref rx :int)
278 (mem-ref ry :int))))
280 (export 'tree-view-convert-tree-to-bin-window-coords)
282 (defcfun gtk-tree-view-convert-tree-to-widget-coords :void
283 (tree-view g-object)
284 (x :int)
285 (y :int)
286 (rx :pointer)
287 (ry :pointer))
289 (defun tree-view-convert-tree-to-widget-coords (tree-view x y)
290 (with-foreign-objects ((rx :int) (ry :int))
291 (gtk-tree-view-convert-tree-to-widget-coords tree-view x y rx ry)
292 (values (mem-ref rx :int)
293 (mem-ref ry :int))))
295 (export 'tree-view-convert-tree-to-widget-coords)
297 (defcfun gtk-tree-view-convert-widget-to-bin-window-coords :void
298 (tree-view g-object)
299 (x :int)
300 (y :int)
301 (rx :pointer)
302 (ry :pointer))
304 (defun tree-view-convert-widget-to-bin-window-coords (tree-view x y)
305 (with-foreign-objects ((rx :int) (ry :int))
306 (gtk-tree-view-convert-widget-to-bin-window-coords tree-view x y rx ry)
307 (values (mem-ref rx :int)
308 (mem-ref ry :int))))
310 (export 'tree-view-convert-widget-to-bin-window-coords)
312 (defcfun gtk-tree-view-convert-widget-to-tree-coords :void
313 (tree-view g-object)
314 (x :int)
315 (y :int)
316 (rx :pointer)
317 (ry :pointer))
319 (defun tree-view-convert-widget-to-tree-coords (tree-view x y)
320 (with-foreign-objects ((rx :int) (ry :int))
321 (gtk-tree-view-convert-widget-to-tree-coords tree-view x y rx ry)
322 (values (mem-ref rx :int)
323 (mem-ref ry :int))))
325 (export 'tree-view-convert-widget-to-tree-coords)
327 ; TODO: gtk_tree_view_enable_model_drag_dest
329 ; TODO: gtk_tree_view_enable_model_drag_source
331 ; TODO: gtk_tree_view_unset_rows_drag_source
333 ; TODO: gtk_tree_view_unset_rows_drag_dest
335 ; TOOD: gtk_tree_view_set_drag_dest_row
337 ; TOOD: gtk_tree_view_get_drag_dest_row
339 ; TOOD: gtk_tree_view_get_dest_row_at_pos
341 ; TOOD: gtk_tree_view_create_drag_icon
343 (defcallback gtk-tree-view-search-equal-func-callback :boolean
344 ((model g-object) (column :int) (key (:string :free-from-foreign nil)) (iter (g-boxed-foreign tree-iter)) (data :pointer))
345 (restart-case
346 (funcall (get-stable-pointer-value data)
347 model column key iter)
348 (return-true () t)
349 (return-false () t)))
351 (defcfun gtk-tree-view-set-search-equal-func :void
352 (tree-view g-object)
353 (func :pointer)
354 (data :pointer)
355 (destroy-notify :pointer))
357 (defun tree-view-set-search-equal-func (tree-view func)
358 (gtk-tree-view-set-search-equal-func tree-view
359 (callback gtk-tree-view-search-equal-func-callback)
360 (allocate-stable-pointer func)
361 (callback stable-pointer-free-destroy-notify-callback)))
363 (defcallback gtk-tree-view-search-position-func :void
364 ((tree-view g-object) (search-dialog g-object) (data :pointer))
365 (restart-case
366 (funcall (get-stable-pointer-value data)
367 tree-view
368 search-dialog)
369 (return () nil)))
371 (defcfun gtk-tree-view-set-search-position-func :void
372 (tree-view g-object)
373 (func :pointer)
374 (data :pointer)
375 (destroy-notify :pointer))
377 (defun tree-view-set-search-position-func (tree-view func)
378 (if func
379 (gtk-tree-view-set-search-position-func tree-view
380 (callback gtk-tree-view-set-search-position-func)
381 (allocate-stable-pointer func)
382 (callback stable-pointer-free-destroy-notify-callback))
383 (gtk-tree-view-set-search-position-func tree-view
384 (null-pointer)
385 (null-pointer)
386 (null-pointer))))
388 ; TODO: gtk_tree_view_set_destroy_count_func
390 (defcallback gtk-tree-view-row-separator-func-callback :boolean
391 ((tree-model g-object) (iter (g-boxed-foreign tree-iter)) (data :pointer))
392 (restart-case
393 (funcall (get-stable-pointer-value data)
394 tree-model
395 iter)
396 (return-true () t)
397 (return-false () nil)))
399 (defcfun gtk-tree-view-set-row-separator-func :void
400 (tree-view g-object)
401 (func :pointer)
402 (data :pointer)
403 (destroy-notify :pointer))
405 (defun tree-view-set-row-separartor-func (tree-view func)
406 (if func
407 (gtk-tree-view-set-row-separator-func tree-view
408 (callback gtk-tree-view-row-separator-func-callback)
409 (allocate-stable-pointer func)
410 (callback stable-pointer-free-destroy-notify-callback))
411 (gtk-tree-view-set-row-separator-func tree-view (null-pointer) (null-pointer) (null-pointer))))
413 (defcfun (tree-view-rubber-banding-active "gtk_tree_view_is_rubber_banding_active") :boolean
414 (tree-view g-object))
416 (export 'tree-view-rubber-banding-active)
418 (defcfun (tree-view-set-tooltip-row "gtk_tree_view_set_tooltip_row") :void
419 (tree-view g-object)
420 (tooltip g-object)
421 (tree-path (g-boxed-foreign tree-path)))
423 (export 'tree-view-set-tooltip-row)
425 (defcfun (tree-view-set-tooltip-cell "gtk_tree_view_set_tooltip_cell") :void
426 (tree-view g-object)
427 (tooltip g-object)
428 (path (g-boxed-foreign tree-path))
429 (column g-object)
430 (cell g-object))
432 (export 'tree-view-set-tooltip-cell)
434 (defcfun gtk-tree-view-get-tooltip-context :boolean
435 (tree-view g-object)
436 (x :int)
437 (y :int)
438 (keyboard-tip :boolean)
439 (model :pointer)
440 (path :pointer)
441 (iter :pointer))
443 (defun tree-view-get-tooltip-context (tree-view)
444 (with-foreign-objects ((x :int) (y :int) (keyboard-tip :boolean) (model :pointer) (path :pointer) (iter :pointer))
445 (when (gtk-tree-view-get-tooltip-context tree-view x y keyboard-tip model path iter)
446 (values (mem-ref x :int)
447 (mem-ref y :int)
448 (mem-ref keyboard-tip :boolean)
449 (mem-ref model 'g-object)
450 (mem-ref path '(g-boxed-foreign tree-path :return))
451 (mem-ref iter '(g-boxed-foreign tree-iter :return))))))
453 (export 'tree-view-get-tooltip-context)
455 ; TODO: GtkTreeView drag-and-drop