Typo.
[cl-gtk2.git] / gtk / gtk.layout-containers.lisp
1 (in-package :gtk)
2
3 (defcfun (fixed-put "gtk_fixed_put") :void
4   (fixed g-object)
5   (widget g-object)
6   (x :int)
7   (y :int))
8
9 (export 'fixed-put)
10
11 (defcfun (fixed-move "gtk_fixed_move") :void
12   (fixed g-object)
13   (widget g-object)
14   (x :int)
15   (y :int))
16
17 (export 'fixed-move)
18
19 (defcfun (layout-put "gtk_layout_put") :void
20   (layout g-object)
21   (widget g-object)
22   (x :int)
23   (y :int))
24
25 (export 'layout-put)
26
27 (defcfun (layout-move "gtk_layout_move") :void
28   (layout g-object)
29   (widget g-object)
30   (x :int)
31   (y :int))
32
33 (export 'layout-move)
34
35 (defcfun gtk-notebook-append-page :int
36   (notebook g-object)
37   (child g-object)
38   (tab-label g-object))
39
40 (defcfun gtk-notebook-append-page-menu :int
41   (notebook g-object)
42   (child g-object)
43   (tab-label g-object)
44   (menu g-object))
45
46 (defcfun gtk-notebook-prepend-page :int
47   (notebook g-object)
48   (child g-object)
49   (tab-label g-object))
50
51 (defcfun gtk-notebook-prepend-page-menu :int
52   (notebook g-object)
53   (child g-object)
54   (tab-label g-object)
55   (menu g-object))
56
57 (defcfun gtk-notebook-insert-page :int
58   (notebook g-object)
59   (child g-object)
60   (tab-label g-object)
61   (position :int))
62
63 (defcfun gtk-notebook-insert-page-menu :int
64   (notebook g-object)
65   (child g-object)
66   (tab-label g-object)
67   (menu g-object)
68   (position :int))
69
70 (defun notebook-add-page (notebook child tab-label &key (position :end) menu)
71   (assert (typep position '(or integer (member :start :end))))
72   (assert (typep menu '(or null g-object (member :default))))
73   (case position
74     (:end (if menu
75               (gtk-notebook-append-page-menu notebook child tab-label (if (eq menu :default) (null-pointer) menu))
76               (gtk-notebook-append-page notebook child tab-label)))
77     (:start (if menu
78                 (gtk-notebook-prepend-page-menu notebook child tab-label (if (eq menu :default) (null-pointer) menu))
79                 (gtk-notebook-prepend-page notebook child tab-label)))
80     (otherwise (if menu
81                 (gtk-notebook-insert-page-menu notebook child tab-label (if (eq menu :default) (null-pointer) menu) position)
82                 (gtk-notebook-insert-page notebook child tab-label position)))))
83
84 (export 'notebook-add-page)
85
86 (defcfun (notebook-page-num "gtk_notebook_page_num") :int
87   (notebook g-object)
88   (child g-object))
89
90 (export 'notebook-page-num)
91
92 (defcfun gtk-notebook-remove-page :void
93   (notebook g-object)
94   (page-num :int))
95
96 (defun notebook-remove-page (notebook page-or-number)
97   (gtk-notebook-remove-page notebook (etypecase page-or-number
98                                        (integer page-or-number)
99                                        (widget (notebook-page-num notebook page-or-number)))))
100
101 (export 'notebook-remove-page)
102
103 (defcfun (notebook-next-page "gtk_notebook_next_page") :void
104   (notebook g-object))
105
106 (export 'notebook-next-page)
107
108 (defcfun (notebook-prev-page "gtk_notebook_prev_page") :void
109   (notebook g-object))
110
111 (export 'notebook-prev-page)
112
113 (defcfun (notebook-reorder-child "gtk_notebook_reorder_child") :void
114   (notebook g-object)
115   (child g-object)
116   (position :int))
117
118 (export 'notebook-reorder-child)
119
120 (defcfun (notebook-menu-label-widget "gtk_notebook_get_menu_label") g-object
121   (notebook g-object)
122   (child g-object))
123
124 (export 'notebook-menu-label-widget)
125
126 (defcfun (notebook-nth-page "gtk_notebook_get_nth_page") g-object
127   (notebook g-object)
128   (page-num :int))
129
130 (export 'notebook-nth-page)
131
132 (defcfun (notebook-n-pages "gtk_notebook_get_n_pages") :int
133   (notebook g-object))
134
135 (export 'notebook-n-pages)
136
137 (defcfun (notebook-tab-label-widget "gtk_notebook_get_tab_label") g-object
138   (notebook g-object)
139   (child g-object))
140
141 (export 'notebook-tab-label-widget)
142
143 (defcfun (gtk-notebook-set-menu-label-widget "gtk_notebook_set_menu_label") :void
144   (notebook g-object)
145   (child g-object)
146   (menu-label g-object))
147
148 (defun (setf notebook-menu-label-widget) (new-value notebook child)
149   (gtk-notebook-set-menu-label-widget notebook child new-value)
150   new-value)
151
152 (defcfun (gtk-notebook-set-tab-label-widget "gtk_notebook_set_tab_label") :void
153   (notebook g-object)
154   (child g-object)
155   (tab-label g-object))
156
157 (defun (setf notebook-tab-label-widget) (new-value notebook child)
158   (gtk-notebook-set-tab-label-widget notebook child new-value)
159   new-value)
160
161 (defcallback gtk-notebook-window-creation-func-callback g-object
162     ((source g-object) (page g-object) (x :int) (y :int) (data :pointer))
163   (restart-case
164       (funcall (get-stable-pointer-value data)
165                source page x y)
166     (return-null () nil)))
167
168 (defcfun gtk-notebook-set-window-creation-hook :void
169   (func :pointer)
170   (data :pointer)
171   (destroy-notify :pointer))
172
173 (defun notebook-set-window-creation-hook (function)
174   (gtk-notebook-set-window-creation-hook (callback gtk-notebook-window-creation-func-callback)
175                                          (allocate-stable-pointer function)
176                                          (callback stable-pointer-free-destroy-notify-callback)))
177
178 (export 'notebook-set-window-creation-hook)
179
180 (defcfun gtk-table-attach :void
181   (table (g-object table))
182   (child (g-object widget))
183   (left-attach :uint)
184   (right-attach :uint)
185   (top-attach :uint)
186   (bottom-attach :uint)
187   (x-options attach-options)
188   (y-options attach-options)
189   (x-padding :uint)
190   (y-padding :uint))
191
192 (defun table-attach (table widget left right top bottom &key (x-options '(:expand :fill)) (y-options '(:expand :fill)) (x-padding 0) (y-padding 0))
193   (gtk-table-attach table widget left right top bottom x-options y-options x-padding y-padding))
194
195 (export 'table-attach)
196
197 (defcfun (table-row-spacing-for-row "gtk_table_get_row_spacing") :uint
198   (table g-object)
199   (row :uint))
200
201 (defcfun gtk-table-set-row-spacing :void
202   (table g-object)
203   (row :uint)
204   (spacing :uint))
205
206 (defun (setf table-row-spacing-for-row) (new-value table row)
207   (gtk-table-set-row-spacing table row new-value))
208
209 (export 'table-row-spacing-for-row)
210
211 (defcfun (table-col-spacing-for-col "gtk_table_get_col_spacing") :uint
212   (table g-object)
213   (col :uint))
214
215 (defcfun gtk-table-set-col-spacing :void
216   (table g-object)
217   (col :uint)
218   (spacing :uint))
219
220 (defun (setf table-col-spacing-for-col) (new-value table col)
221   (gtk-table-set-col-spacing table col new-value))
222
223 (export 'table-col-spacing-for-col)