Added finalizing of all gtk+ classes at the end of compilation
[cl-gtk2.git] / gtk / gtk.menu.lisp
bloba316e212db9a2a797e5c5b405a9ed96d5b7c5a21
1 (in-package :gtk)
3 (defcfun (menu-reorder-child "gtk_menu_reorder_child") :void
4 (menu g-object)
5 (child g-object)
6 (position :int))
8 (export 'menu-reorder-child)
10 (defcfun (menu-attach "gtk_menu_attach") :void
11 (menu g-object)
12 (child g-object)
13 (left-attach :uint)
14 (right-attach :uint)
15 (top-attach :uint)
16 (bottom-attach :uint))
18 (export 'menu-attach)
20 (defcfun gtk-menu-popup :void
21 (menu g-object)
22 (parent-menu-shell g-object)
23 (parent-menu-item g-object)
24 (menu-position-func :pointer)
25 (data :pointer)
26 (button :uint)
27 (activate-time :uint32))
29 (defcallback gtk-menu-position-func-callback :void
30 ((menu g-object) (x :pointer) (y :pointer) (push-in :pointer) (data :pointer))
31 (restart-case
32 (multiple-value-bind (rx ry rpush-in) (funcall (get-stable-pointer-value data)
33 menu)
34 (setf (mem-ref x :int) rx
35 (mem-ref y :int) ry
36 (mem-ref push-in :boolean) rpush-in))
37 (return-zero () (setf (mem-ref x :int) 0
38 (mem-ref y :int) 0
39 (mem-ref push-in :boolean) nil))))
41 (defun menu-popup (menu &key parent-menu-shell parent-menu-item position-func (button 0) (activate-time (current-event-time)))
42 (if position-func
43 (with-stable-pointer (ptr position-func)
44 (gtk-menu-popup menu parent-menu-shell parent-menu-item
45 (callback gtk-menu-position-func-callback)
46 ptr button activate-time))
47 (gtk-menu-popup menu parent-menu-shell parent-menu-item (null-pointer) (null-pointer) button activate-time)))
49 (export 'menu-popup)
51 (defcfun (menu-popdown "gtk_menu_popdown") :void
52 (menu g-object))
54 (export 'menu-popdown)
56 (defcfun (menu-reposition "gtk_menu_reposition") :void
57 (menu g-object))
59 (export 'menu-reposition)
61 ; TODO: gtk_menu_attach_to_widget
63 (defcfun (menu-detach "gtk_menu_detach") :void
64 (menu (g-object menu)))
66 (export 'menu-detach)
68 ; TODO: gtk_menu_get_attach_to_widget
70 (defcfun (menu-attached-to-widget "gtk_menu_get_for_attach_widget") (glist (g-object menu) :free-from-foreign nil)
71 (width (g-object widget)))
73 (export 'menu-attached-to-widget)
75 (defcfun (tool-shell-rebuild-menu "gtk_tool_shell_rebuild_menu") :void
76 (shell (g-object tool-shell)))
78 (export 'tool-shell-rebuild-menu)
80 (defcfun (menu-shell-append "gtk_menu_shell_append") :void
81 (menu-shell g-object)
82 (child g-object))
84 (export 'menu-shell-append)
86 (defcfun (menu-shell-prepend "gtk_menu_shell_prepend") :void
87 (menu-shell g-object)
88 (child g-object))
90 (export 'menu-shell-prepend)
92 (defcfun (menu-shell-insert "gtk_menu_shell_insert") :void
93 (menu-shell g-object)
94 (child g-object)
95 (position :int))
97 (export 'menu-shell-insert)
99 (defcfun (menu-shell-deactivate "gtk_menu_shell_deactivate") :void
100 (menu-shell g-object))
102 (export 'menu-shell-deactivate)
104 (defcfun (menu-shell-select-item "gtk_menu_shell_select_item") :void
105 (menu-shell g-object)
106 (menu-item g-object))
108 (export 'menu-shell-select-item)
110 (defcfun gtk-menu-shell-select-first :void
111 (menu-shell g-object)
112 (search-sensitive :boolean))
114 (defun menu-shell-select-first (menu-shell &optional (search-sensitive t))
115 (gtk-menu-shell-select-first menu-shell search-sensitive))
117 (export 'menu-shell-select-first)
119 (defcfun (menu-shell-deselect "gtk_menu_shell_deselect") :void
120 (menu-shell g-object))
122 (export 'menu-shell-deselect)
124 (defcfun gtk-menu-shell-activate-item :void
125 (menu-shell g-object)
126 (menu-item g-object)
127 (force-deactivate :boolean))
129 (defun menu-shell-activate-item (menu-shell menu-item &optional force-deactivate)
130 (gtk-menu-shell-activate-item menu-shell menu-item force-deactivate))
132 (export 'menu-shell-activate-item)
134 (defcfun (menu-shell-cancel "gtk_menu_shell_cancel") :void
135 (menu-shell g-object))
137 (export 'menu-shell-cancel)
139 ; TODO: GtkToolShell
141 (defcfun (toolbar-insert "gtk_toolbar_insert") :void
142 (toolbar g-object)
143 (item g-object)
144 (pos :int))
146 (export 'toolbar-insert)
148 (defcfun (toolbar-item-index "gtk_toolbar_get_item_index") :int
149 (toolbar g-object)
150 (item g-object))
152 (export 'toolbar-item-index)
154 (defcfun (toolbar-items-count "gtk_toolbar_get_n_items") :int
155 (toolbar g-object))
157 (export 'toolbar-items-count)
159 (defcfun (toolbar-nth-item "gtk_toolbar_get_nth_item") g-object
160 (toolbar g-object)
161 (n :int))
163 (export 'toolbar-nth-item)
165 (defcfun (toolbar-get-drop-index "gtk_toolbar_get_drop_index") :int
166 (toolbar g-object)
167 (x :int)
168 (y :int))
170 (export 'toolbar-get-drop-index)
172 (defcfun (toolbar-set-drop-highlight-item "gtk_toolbar_set_drop_highlight_item") :void
173 (toolbar g-object)
174 (tool-item g-object)
175 (index :int))
177 (export 'toolbar-set-drop-highlight-item)
179 (defcfun (toolbar-unset-style "gtk_toolbar_unset_style") :void
180 (toolbar g-object))
182 (export 'toolbar-unset-style)
184 (defcfun (tool-item-retrieve-proxy-menu-item "gtk_tool_item_retrieve_proxy_menu_item") g-object
185 (tool-item g-object))
187 (export 'tool-item-retrieve-proxy-menu-item)
189 ; TODO: gtk_tool_item_get_proxy_menu_item
191 ; TODO: gtk_tool_item_set_proxy_menu_item
193 (defcfun (tool-item-rebuild-menu "gtk_tool_item_rebuild_menu") :void
194 (tool-item g-object))
196 (export 'tool-item-rebuild-menu)
198 (defcfun (radio-tool-button-get-group "gtk_radio_tool_button_get_group")
199 (gslist (g-object radio-tool-button) :free-from-foreign nil)
200 (button (g-object radio-tool-button)))