Fix issuing warning in gobject metaclass if gtype is not available
[cl-gtk2.git] / gtk / gtk.tree-view.lisp
blob6c475678b78c170f8b52aebe08da59a13e6f3e4c
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 (defcfun gtk-tree-view-enable-model-drag-dest :void
328 (tree-view (g-object tree-view))
329 (targets :pointer)
330 (n-targets :int)
331 (actions gdk-drag-action))
333 (defun tree-view-enable-model-drag-dest (tree-view targets actions)
334 (with-foreign-boxed-array (n-targets targets-ptr target-entry targets)
335 (gtk-tree-view-enable-model-drag-dest tree-view targets-ptr n-targets actions)))
337 (export 'tree-view-enable-model-drag-dest)
339 (defcfun gtk-tree-view-enable-model-drag-source :void
340 (tree-view (g-object tree-view))
341 (start-button-mask modifier-type)
342 (targets :pointer)
343 (n-targets :int)
344 (actions gdk-drag-action))
346 (defun tree-view-enable-model-drag-source (tree-view start-button-mask targets actions)
347 (with-foreign-boxed-array (n-targets targets-ptr target-entry targets)
348 (gtk-tree-view-enable-model-drag-source tree-view start-button-mask targets-ptr n-targets actions)))
350 (export 'tree-view-enable-model-drag-source)
352 ; TODO: gtk_tree_view_unset_rows_drag_source
354 ; TODO: gtk_tree_view_unset_rows_drag_dest
356 ; TOOD: gtk_tree_view_set_drag_dest_row
358 ; TOOD: gtk_tree_view_get_drag_dest_row
360 (defcfun gtk-tree-view-get-dest-row-at-pos :boolean
361 (tree_view (g-object tree-view))
362 (drag-x :int)
363 (drag-y :int)
364 (path :pointer)
365 (pos :pointer))
367 (defun tree-view-get-dest-row-at-pos (tree-view x y)
368 (with-foreign-objects ((path :pointer) (pos :int))
369 (when (gtk-tree-view-get-dest-row-at-pos tree-view x y path pos)
370 (values (mem-ref path '(g-boxed-foreign tree-path :return))
371 (mem-ref pos 'tree-view-drop-position)))))
373 (export 'tree-view-get-dest-row-at-pos)
375 ; TOOD: gtk_tree_view_create_drag_icon
377 (defcallback gtk-tree-view-search-equal-func-callback :boolean
378 ((model g-object) (column :int) (key (:string :free-from-foreign nil)) (iter (g-boxed-foreign tree-iter)) (data :pointer))
379 (restart-case
380 (funcall (get-stable-pointer-value data)
381 model column key iter)
382 (return-true () t)
383 (return-false () t)))
385 (defcfun gtk-tree-view-set-search-equal-func :void
386 (tree-view g-object)
387 (func :pointer)
388 (data :pointer)
389 (destroy-notify :pointer))
391 (defun tree-view-set-search-equal-func (tree-view func)
392 (gtk-tree-view-set-search-equal-func tree-view
393 (callback gtk-tree-view-search-equal-func-callback)
394 (allocate-stable-pointer func)
395 (callback stable-pointer-free-destroy-notify-callback)))
397 (defcallback gtk-tree-view-search-position-func :void
398 ((tree-view g-object) (search-dialog g-object) (data :pointer))
399 (restart-case
400 (funcall (get-stable-pointer-value data)
401 tree-view
402 search-dialog)
403 (return () nil)))
405 (defcfun gtk-tree-view-set-search-position-func :void
406 (tree-view g-object)
407 (func :pointer)
408 (data :pointer)
409 (destroy-notify :pointer))
411 (defun tree-view-set-search-position-func (tree-view func)
412 (if func
413 (gtk-tree-view-set-search-position-func tree-view
414 (callback gtk-tree-view-set-search-position-func)
415 (allocate-stable-pointer func)
416 (callback stable-pointer-free-destroy-notify-callback))
417 (gtk-tree-view-set-search-position-func tree-view
418 (null-pointer)
419 (null-pointer)
420 (null-pointer))))
422 ; TODO: gtk_tree_view_set_destroy_count_func
424 (defcallback gtk-tree-view-row-separator-func-callback :boolean
425 ((tree-model g-object) (iter (g-boxed-foreign tree-iter)) (data :pointer))
426 (restart-case
427 (funcall (get-stable-pointer-value data)
428 tree-model
429 iter)
430 (return-true () t)
431 (return-false () nil)))
433 (defcfun gtk-tree-view-set-row-separator-func :void
434 (tree-view g-object)
435 (func :pointer)
436 (data :pointer)
437 (destroy-notify :pointer))
439 (defun tree-view-set-row-separartor-func (tree-view func)
440 (if func
441 (gtk-tree-view-set-row-separator-func tree-view
442 (callback gtk-tree-view-row-separator-func-callback)
443 (allocate-stable-pointer func)
444 (callback stable-pointer-free-destroy-notify-callback))
445 (gtk-tree-view-set-row-separator-func tree-view (null-pointer) (null-pointer) (null-pointer))))
447 (defcfun (tree-view-rubber-banding-active "gtk_tree_view_is_rubber_banding_active") :boolean
448 (tree-view g-object))
450 (export 'tree-view-rubber-banding-active)
452 (defcfun (tree-view-set-tooltip-row "gtk_tree_view_set_tooltip_row") :void
453 (tree-view g-object)
454 (tooltip g-object)
455 (tree-path (g-boxed-foreign tree-path)))
457 (export 'tree-view-set-tooltip-row)
459 (defcfun (tree-view-set-tooltip-cell "gtk_tree_view_set_tooltip_cell") :void
460 (tree-view g-object)
461 (tooltip g-object)
462 (path (g-boxed-foreign tree-path))
463 (column g-object)
464 (cell g-object))
466 (export 'tree-view-set-tooltip-cell)
468 (defcfun gtk-tree-view-get-tooltip-context :boolean
469 (tree-view g-object)
470 (x :int)
471 (y :int)
472 (keyboard-tip :boolean)
473 (model :pointer)
474 (path :pointer)
475 (iter :pointer))
477 (defun tree-view-get-tooltip-context (tree-view)
478 (with-foreign-objects ((x :int) (y :int) (keyboard-tip :boolean) (model :pointer) (path :pointer) (iter :pointer))
479 (when (gtk-tree-view-get-tooltip-context tree-view x y keyboard-tip model path iter)
480 (values (mem-ref x :int)
481 (mem-ref y :int)
482 (mem-ref keyboard-tip :boolean)
483 (mem-ref model 'g-object)
484 (mem-ref path '(g-boxed-foreign tree-path :return))
485 (mem-ref iter '(g-boxed-foreign tree-iter :return))))))
487 (export 'tree-view-get-tooltip-context)
489 ; TODO: GtkTreeView drag-and-drop
491 (defcfun gtk-cell-view-get-size-of-row :boolean
492 (cell-view (g-object cell-view))
493 (path (g-boxed-foreign tree-path))
494 (requisition (g-boxed-foreign requisition)))
496 (defun cell-view-get-size-of-row (cell-view path)
497 (let ((requisition (make-requisition)))
498 (gtk-cell-view-get-size-of-row cell-view path requisition)
499 requisition))
501 (export 'cell-view-get-size-of-row)