Hide new functions in Gdk-2.18 behind conditional read
[cl-gtk2.git] / gtk / gtk.icon-view.lisp
blobfe74defb9dbc8d88190673a8e9eaa9444cc05d73
1 (in-package :gtk)
3 (defcfun (icon-view-get-path-at-pos "gtk_icon_view_get_path_at_pos") (g-boxed-foreign tree-path :return)
4 (icon-view g-object)
5 (x :int)
6 (y :int))
8 (export 'icon-view-get-path-at-pos)
10 (defcfun gtk-icon-view-get-item-at-pos :boolean
11 (icon-view g-object)
12 (x :int)
13 (y :int)
14 (path :pointer)
15 (cell :pointer))
17 (defun icon-view-get-item-at-pos (icon-view x y)
18 (with-foreign-objects ((path :pointer) (cell :pointer))
19 (when (gtk-icon-view-get-item-at-pos icon-view x y path cell)
20 (values (mem-ref path '(g-boxed-foreign tree-path :return))
21 (mem-ref cell 'g-object)))))
23 (export 'icon-view-get-item-at-pos)
25 (defcfun gtk-icon-view-convert-widget-to-bin-window-coords :void
26 (icon-view g-object)
27 (x :int)
28 (y :int)
29 (rx :pointer)
30 (ry :pointer))
32 (defun icon-view-convert-widget-to-bin-window-coords (icon-view x y)
33 (with-foreign-objects ((rx :int) (ry :int))
34 (gtk-icon-view-convert-widget-to-bin-window-coords icon-view x y rx ry)
35 (values (mem-ref rx :int)
36 (mem-ref ry :int))))
38 (export 'icon-view-conver-widget-to-bin-window-coords)
40 (defcfun (icon-view-set-cursor "gtk_icon_view_set_cursor") :void
41 (icon-view g-object)
42 (path (g-boxed-foreign tree-path))
43 (cell g-object)
44 (start-editing :boolean))
46 (export 'icon-view-set-cursor)
48 (defcfun gtk-icon-view-get-cursor :boolean
49 (icon-view g-object)
50 (path :pointer)
51 (cell :pointer))
53 (defun icon-view-get-cursor (icon-view)
54 (with-foreign-objects ((path :pointer) (cell :pointer))
55 (when (gtk-icon-view-get-cursor icon-view path cell)
56 (values (mem-ref path '(g-boxed-foreign tree-path :return))
57 (mem-ref cell 'g-object)))))
59 (export 'icon-view-get-cursor)
61 (defcallback gtk-icon-view-foreach-func-callback :void
62 ((icon-view g-object) (path (g-boxed-foreign tree-path)) (data :pointer))
63 (restart-case
64 (funcall (get-stable-pointer-value data)
65 icon-view
66 path)
67 (return () nil)))
69 (defcfun gtk-icon-view-selected-foreach :void
70 (icon-view g-object)
71 (func :pointer)
72 (data :pointer))
74 (defun map-icon-view-selected (icon-view func)
75 (with-stable-pointer (ptr func)
76 (gtk-icon-view-selected-foreach icon-view
77 (callback gtk-icon-view-foreach-func-callback)
78 ptr)))
80 (export 'map-icon-view-selected)
82 (defcfun (icon-view-select-path "gtk_icon_view_select_path") :void
83 (icon-view g-object)
84 (path (g-boxed-foreign tree-path)))
86 (export 'icon-view-select-path)
88 (defcfun (icon-view-unselect-path "gtk_icon_view_unselect_path") :void
89 (icon-view g-object)
90 (path (g-boxed-foreign tree-path)))
92 (export 'icon-view-unselect-path)
94 (defcfun (icon-view-path-selected-p "gtk_icon_view_path_is_selected") :boolean
95 (icon-view g-object)
96 (path (g-boxed-foreign tree-path)))
98 (export 'icon-view-path-selected-p)
100 (defcfun (icon-view-selected-items "gtk_icon_view_get_selected_items") (glist (g-boxed-foreign tree-path) :free-from-foreign t)
101 (icon-view g-object))
103 (export 'icon-view-selected-items)
105 (defcfun (icon-view-select-all "gtk_icon_view_select_all") :void
106 (icon-view g-object))
108 (export 'icon-view-select-all)
110 (defcfun (icon-view-unselect-all "gtk_icon_view_unselect_all") :void
111 (icon-view g-object))
113 (export 'icon-view-unselect-all)
115 (defcfun gtk-icon-view-scroll-to-path :void
116 (icon-view g-object)
117 (path (g-boxed-foreign tree-path))
118 (use-align :boolean)
119 (row-align :float)
120 (col-align :float))
122 (defun icon-view-scroll-to-path (icon-view path &key (row-align 0.5 row-align-supplied-p) (col-align 0.5 col-align-supplied-p))
123 (gtk-icon-view-scroll-to-path icon-view path (or row-align-supplied-p col-align-supplied-p) row-align col-align))
125 (export 'icon-view-scroll-to-path)
127 (defcfun gtk-icon-view-get-visible-range :boolean
128 (icon-view g-object)
129 (start-path :pointer)
130 (end-path :pointer))
132 (defun icon-view-get-visible-range (icon-view)
133 (with-foreign-objects ((start-path :pointer) (end-path :pointer))
134 (when (gtk-icon-view-get-visible-range icon-view start-path end-path)
135 (values (mem-ref start-path '(g-boxed-foreign tree-path :return))
136 (mem-ref end-path '(g-boxed-foreign tree-path :return))))))
138 (export 'icon-view-get-visible-range)
140 (defcfun (icon-view-set-tooltip-item "gtk_icon_view_set_tooltip_item") :void
141 (icon-view (g-object icon-view))
142 (tooltip (g-object tooltip))
143 (path (g-boxed-foreign tree-path)))
145 (export 'icon-view-set-tooltip-item)
147 (defcfun (icon-view-set-tooltip-cell "gtk_icon_view_set_tooltip_cell") :void
148 (icon-view (g-object icon-view))
149 (tooltip (g-object tooltip))
150 (path (g-boxed-foreign tree-path))
151 (cell-renderer (g-object cell-renderer)))
153 (export 'icon-view-set-tooltip-cell)
155 (defcfun gtk-icon-view-get-tooltip-context :boolean
156 (icon-view (g-object icon-view))
157 (x (:pointer :int))
158 (y (:pointer :int))
159 (keyboard-tip :boolean)
160 (model (:pointer (g-object tree-model)))
161 (path (:pointer (g-boxed-foreign tree-path)))
162 (iter (g-boxed-foreign tree-iter)))
164 (defun icon-view-get-tooltip-context (icon-view x y keyboard-tip)
165 (with-foreign-objects ((xx :int) (yy :int) (model-ptr :pointer) (path-ptr :pointer))
166 (setf (mem-ref xx :int) x
167 (mem-ref yy :int) y)
168 (let ((iter (make-tree-iter)))
169 (when (gtk-icon-view-get-tooltip-context icon-view xx yy keyboard-tip model-ptr path-ptr iter)
170 (values (mem-ref xx :int) (mem-ref yy :int)
171 (convert-from-foreign (mem-ref model-ptr :pointer) '(g-object tree-model))
172 (convert-from-foreign (mem-ref path-ptr :pointer) '(g-boxed-foreign tree-path :return))
173 iter)))))
175 ; TODO: gtk_icon_view_enable_model_drag_source
177 ; TODO: gtk_icon_view_enable_model_drag_dest
179 ; TODO: gtk_icon_view_unset_model_drag_source
181 ; TODO: gtk_icon_view_unset_model_drag_dest
183 ; TODO: gtk_icon_view_set_drag_dest_item
185 ; TODO: gtk_icon_view_get_drag_dest_item
187 ; TODO: gtk_icon_view_get_dest_item_at_pos
189 ; TODO: gtk_icon_view_create_drag_icon