560af5c5 |
1 | ;; Common Lisp bindings for GTK+ v2.0.x |
56460319 |
2 | ;; Copyright (C) 1999-2001 Espen S. Johnsen <espen@users.sourceforge.org> |
560af5c5 |
3 | ;; |
4 | ;; This library is free software; you can redistribute it and/or |
5 | ;; modify it under the terms of the GNU Lesser General Public |
6 | ;; License as published by the Free Software Foundation; either |
7 | ;; version 2 of the License, or (at your option) any later version. |
8 | ;; |
9 | ;; This library is distributed in the hope that it will be useful, |
10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | ;; Lesser General Public License for more details. |
13 | ;; |
14 | ;; You should have received a copy of the GNU Lesser General Public |
15 | ;; License along with this library; if not, write to the Free Software |
16 | ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 | |
fb278f4f |
18 | ;; $Id: gtktypes.lisp,v 1.13 2002-03-24 15:42:17 espen Exp $ |
560af5c5 |
19 | |
20 | |
21 | (in-package "GTK") |
22 | |
2719586f |
23 | (defclass requisition (boxed) |
24 | ((width |
25 | :allocation :alien |
26 | :accessor requisition-width |
27 | :initarg :width |
28 | :type int) |
29 | (height |
30 | :allocation :alien |
31 | :accessor requisition-height |
32 | :initarg :height |
33 | :type int)) |
34 | (:metaclass boxed-class) |
b030f2d9 |
35 | (:alien-name "GtkTypeRequisition")) |
2719586f |
36 | |
e6d40e16 |
37 | (defclass allocation (struct) |
38 | ((x |
39 | :allocation :alien |
40 | :accessor allocation-width |
41 | :initarg :x |
42 | :type int) |
43 | (y |
44 | :allocation :alien |
45 | :accessor allocation-width |
46 | :initarg :width |
47 | :type int) |
48 | (width |
49 | :allocation :alien |
50 | :accessor allocation-width |
51 | :initarg :width |
52 | :type int) |
53 | (height |
54 | :allocation :alien |
55 | :accessor allocation-height |
56 | :initarg :height |
57 | :type int)) |
58 | (:metaclass proxy-class)) |
59 | |
2719586f |
60 | (defclass border (boxed) |
61 | ((left |
62 | :allocation :alien |
63 | :accessor border-left |
64 | :initarg :left |
65 | :type int) |
66 | (right |
67 | :allocation :alien |
68 | :accessor border-right |
69 | :initarg :right |
70 | :type int) |
71 | (top |
72 | :allocation :alien |
73 | :accessor border-top |
74 | :initarg :top |
75 | :type int) |
76 | (bottom |
77 | :allocation :alien |
78 | :accessor border-bottom |
79 | :initarg :bottom |
80 | :type int)) |
81 | (:metaclass boxed-class) |
b030f2d9 |
82 | (:alien-name "GtkTypeBorder")) |
2719586f |
83 | |
84 | (defclass adjustment (%object) |
85 | ((lower |
86 | :allocation :alien |
87 | :accessor adjustment-lower |
88 | :initarg :lower |
89 | :type single-float) |
90 | (upper |
91 | :allocation :alien |
92 | :accessor adjustment-upper |
93 | :initarg :upper |
94 | :type single-float) |
56460319 |
95 | (%value ; to get the offset right |
2719586f |
96 | :allocation :alien |
2719586f |
97 | :type single-float) |
98 | (step-increment |
99 | :allocation :alien |
100 | :accessor adjustment-step-increment |
101 | :initarg :step-increment |
102 | :type single-float) |
103 | (page-increment |
104 | :allocation :alien |
105 | :accessor adjustment-page-increment |
106 | :initarg :page-increment |
107 | :type single-float) |
108 | (page-size |
109 | :allocation :alien |
110 | :accessor adjustment-page-size |
111 | :initarg :page-size |
56460319 |
112 | :type single-float) |
113 | (value |
114 | :allocation :virtual |
115 | :getter "gtk_adjustment_get_value" |
116 | :setter "gtk_adjustment_set_value" |
117 | :accessor adjustment-value |
118 | :initarg :value |
2719586f |
119 | :type single-float)) |
120 | (:metaclass gobject-class) |
121 | (:alien-name "GtkAdjustment")) |
122 | |
560af5c5 |
123 | |
5b51dee1 |
124 | |
2719586f |
125 | (define-types-by-introspection "Gtk" |
126 | ;; Manually defined |
127 | ("GtkObject" :ignore t) |
128 | ("GtkRequisition" :ignore t) |
129 | ("GtkBorder" :ignore t) |
130 | ("GtkAdjustment" :ignore t) |
131 | |
5b51dee1 |
132 | |
5b51dee1 |
133 | ;; Manual override |
134 | ("GtkWidget" |
135 | :slots |
136 | ((child-slots |
d520140e |
137 | :allocation :instance |
138 | :accessor widget-child-slots |
139 | :type container-child) |
e6d40e16 |
140 | (parent-window |
5b51dee1 |
141 | :allocation :virtual |
e6d40e16 |
142 | :getter "gtk_widget_get_parent_window" |
143 | :setter "gtk_widget_set_parent_window" |
144 | :accessor widget-parent-window |
145 | :type gdk:window) |
5b51dee1 |
146 | (window |
147 | :allocation :virtual |
148 | :getter "gtk_widget_get_window" |
149 | :reader widget-window |
150 | :type gdk:window) |
151 | (state |
152 | :allocation :virtual |
153 | :getter "gtk_widget_get_state" |
154 | :setter "gtk_widget_set_state" |
155 | :accessor widget-state |
156 | :initarg :state |
157 | :type state-type) |
158 | (colormap |
159 | :allocation :virtual |
160 | :getter "gtk_widget_get_colormap" |
e6d40e16 |
161 | :setter "gtk_widget_set_colormap" |
162 | :initarg :colormap |
163 | :accessor widget-colormap |
5b51dee1 |
164 | :type gdk:colormap) |
165 | (visual |
166 | :allocation :virtual |
167 | :getter "gtk_widget_get_visual" |
168 | :reader widget-visual |
e6d40e16 |
169 | :type gdk:visual) |
170 | (direction |
171 | :allocation :virtual |
172 | :getter "gtk_widget_get_direction" |
173 | :setter "gtk_widget_set_direction" |
174 | :accessor widget-direction |
175 | :initarg :direction |
176 | :type text-direction) |
177 | (composite-name |
178 | :allocation :virtual |
179 | :getter "gtk_widget_get_composite_name" |
180 | :setter "gtk_widget_set_composite_name" |
181 | :accessor widget-composite-name |
182 | :initarg :composite-name |
183 | :type string) |
184 | (settings |
185 | :allocation :virtual |
186 | :getter "gtk_widget_get_settings" |
187 | :accessor widget-settings |
188 | :type settings) |
189 | (child-visible |
190 | :allocation :virtual |
191 | :getter "gtk_widget_get_child_visible" |
192 | :setter "gtk_widget_set_child_visible" |
193 | :accessor widget-child-visible-p |
194 | :initarg :child-visible |
195 | :type boolean))) |
196 | |
5b51dee1 |
197 | ("GtkContainer" |
198 | :slots |
199 | ((child |
200 | :ignore t) |
201 | (children |
202 | :allocation :virtual |
203 | :getter container-children |
204 | :setter (setf container-children)) |
205 | (focus-child |
206 | :allocation :virtual |
207 | :getter "gtk_container_get_focus_child" |
208 | :setter "gtk_container_set_focus_child" |
209 | :accessor container-focus-child |
210 | :initarg :focus-child |
211 | :type widget) |
e6d40e16 |
212 | (focus-chain |
213 | :allocation :virtual |
214 | :getter container-focus-chain |
215 | :setter (setf container-focus-chain)) |
5b51dee1 |
216 | (focus-hadjustment |
217 | :allocation :virtual |
218 | :getter "gtk_container_get_focus_hadjustment" |
219 | :setter "gtk_container_set_focus_hadjustment" |
220 | :accessor container-focus-hadjustment |
221 | :initarg :focus-hadjustment |
222 | :type adjustment) |
223 | (focus-vadjustment |
224 | :allocation :virtual |
225 | :getter "gtk_container_get_focus_vadjustment" |
226 | :setter "gtk_container_set_focus_vadjustment" |
227 | :accessor container-focus-vadjustment |
228 | :initarg :focus-vadjustment |
229 | :type adjustment))) |
230 | |
231 | ("GtkBin" |
232 | :slots |
233 | ((child |
234 | :allocation :virtual |
56460319 |
235 | :getter "gtk_bin_get_child" |
236 | :setter (setf bin-child) |
237 | :reader bin-child |
238 | :type widget))) |
5b51dee1 |
239 | |
240 | ("GtkTooltips" |
241 | :slots |
242 | ((enabled |
243 | :allocation :virtual |
244 | :getter "gtk_tooltips_get_enabled" |
245 | :setter (setf tooltips-enabled-p) |
246 | :reader tooltips-enabled-p |
247 | :initarg :enabled |
248 | :type boolean))) |
249 | |
250 | ("GtkOptionMenu" |
251 | :slots |
252 | ((menu |
253 | :allocation :virtual |
254 | :getter "gtk_option_menu_get_menu" |
255 | :setter (setf option-menu-menu) |
256 | :reader option-menu-menu |
257 | :initarg :menu |
258 | :type widget) |
259 | (history |
260 | :allocation :virtual |
261 | :getter "gtk_option_menu_get_history" |
262 | :setter "gtk_option_menu_set_history" |
263 | :accessor option-menu-history |
264 | :initarg :history |
265 | :type unsigned-int))) |
266 | |
267 | ("GtkMenuItem" |
268 | :slots |
269 | ((label |
270 | :allocation :virtual |
271 | :setter menu-item-label |
272 | :initarg :label |
273 | :type string) |
274 | (submenu |
275 | :allocation :virtual |
276 | :getter "gtk_menu_item_get_submenu" |
277 | :setter (setf menu-item-submenu) |
278 | :reader menu-item-submenu |
279 | :initarg :submenu |
280 | :type menu-item) |
281 | (placement |
282 | :allocation :virtual |
283 | :getter "gtk_menu_item_get_placement" |
284 | :setter "_gtk_menu_item_set_placement" ; why underscore? |
285 | :accessor menu-item-placement |
286 | :initarg :placement |
287 | :type submenu-placement) |
288 | (submenu-indicator |
289 | :allocation :virtual |
290 | :getter "gtk_menu_item_get_show_submenu" |
291 | :setter "gtk_menu_item_set_show_submenu" |
292 | :accessor menu-item-submenu-indicator-p |
293 | :initarg :submenu-indicator |
294 | :type boolean))) |
295 | |
296 | ("GtkColorSelectionDialog" |
297 | :slots |
298 | ((colorsel |
299 | :allocation :alien |
300 | :reader color-selection-dialog-colorsel |
301 | :type widget) |
302 | (ok-button |
303 | :allocation :alien |
304 | :reader color-selection-dialog-ok-button |
305 | :type widget) |
306 | (cancel-button |
307 | :allocation :alien |
308 | :reader color-selection-dialog-cancel-button |
309 | :type widget) |
310 | (help-button |
311 | :allocation :alien |
312 | :reader color-selection-dialog-help-button |
313 | :type widget))) |
314 | |
315 | ("GtkScrolledWindow" |
316 | :slots |
317 | ((hscrollbar |
318 | :allocation :alien |
319 | :reader scrolled-window-hscrollbar |
320 | :type widget) |
321 | (vscrollbar |
322 | :allocation :alien |
323 | :reader scrolled-window-vscrollbar |
324 | :type widget))) |
560af5c5 |
325 | |
5b51dee1 |
326 | ("GtkPaned" |
327 | :slot |
328 | ((child1 |
560af5c5 |
329 | :allocation :virtual |
5b51dee1 |
330 | :getter paned-child1 |
331 | :setter (setf paned-child1) |
332 | :initarg :child1 |
560af5c5 |
333 | :type widget) |
5b51dee1 |
334 | (child2 |
2d379b6a |
335 | :allocation :virtual |
5b51dee1 |
336 | :getter paned-child2 |
337 | :setter (setf paned-child2) |
338 | :initarg :child2 |
339 | :type widget))) |
560af5c5 |
340 | |
5b51dee1 |
341 | ("GtkMenu" |
342 | :slots |
343 | ((accel-group |
344 | :allocation :virtual |
345 | :getter "gtk_menu_get_accel_group" |
346 | :setter "gtk_menu_set_accel_group" |
347 | :accessor menu-accel-group |
348 | :initarg :accel-group |
349 | :type accel-group) |
350 | (active |
351 | :allocation :virtual |
352 | :getter "gtk_menu_get_active" |
353 | :setter (setf menu-active) |
354 | :reader menu-active |
355 | :initarg :active |
356 | :type widget) |
357 | (tornoff |
358 | :allocation :virtual |
359 | :getter "gtk_menu_get_tearoff_state" |
360 | :setter "gtk_menu_set_tearoff_state" |
361 | :accessor menu-tornoff-p |
362 | :initarg :tearoff |
363 | :type boolean))) |
364 | |
365 | ("GtkToolbar" |
366 | :slots |
367 | ((tooltips |
368 | :allocation :virtual |
369 | :getter "gtk_toolbar_get_tooltips" |
370 | :setter "gtk_toolbar_set_tooltips" |
371 | :accessor toolbar-tooltips-p |
372 | :initarg :tooltips |
373 | :type boolean) |
374 | (icon-size |
375 | :allocation :virtual |
376 | :getter "gtk_toolbar_get_icon_size" |
377 | :setter "gtk_toolbar_set_icon_size" |
378 | :accessor toolbar-icon-size |
379 | :initarg :icon-size |
380 | :type icon-size))) |
381 | |
382 | ("GtkRuler" |
383 | :slots |
384 | ((metric |
385 | :allocation :virtual |
386 | :getter "gtk_ruler_get_metric" |
387 | :setter "gtk_ruler_set_metric" |
388 | :accessor ruler-metric |
389 | :initarg :metric |
390 | :type metric-type))) |
391 | |
392 | ("GtkProgressBar" |
393 | :slots |
394 | ; deprecated properties |
395 | ((bar-style :ignore t) |
396 | (adjustment :ignore t) |
397 | (activity-step :ignore t) |
398 | (activity-blocks :ignore t) |
399 | (discrete-blocks :ignore t))) |
400 | |
401 | ("GtkTable" |
402 | :slots |
403 | ((column-spacing |
404 | :allocation :virtual |
405 | :getter "gtk_table_get_default_col_spacing" |
406 | :setter "gtk_table_set_col_spacings" |
407 | :initarg :column-spacing |
408 | :type unsigned-int) |
409 | (row-spacing |
410 | :allocation :virtual |
411 | :getter "gtk_table_get_default_row_spacing" |
412 | :setter "gtk_table_set_row_spacings" |
413 | :initarg :row-spacing |
414 | :type unsigned-int))) |
415 | |
416 | ("GtkDialog" |
417 | :slots |
fb278f4f |
418 | ((main-area |
5b51dee1 |
419 | :allocation :virtual |
420 | :getter "gtk_dialog_get_vbox" |
fb278f4f |
421 | :reader dialog-main-area |
5b51dee1 |
422 | :type widget) |
423 | (action-area |
424 | :allocation :virtual |
425 | :getter "gtk_dialog_get_action_area" |
426 | :reader dialog-action-area |
427 | :type widget))) |
2ed3bebb |
428 | |
5b51dee1 |
429 | ("GtkCombo" |
430 | :slots |
431 | ((entry |
432 | :allocation :virtual |
433 | :getter "gtk_combo_get_entry" |
434 | :reader combo-entry |
435 | :type entry))) |
2ed3bebb |
436 | |
5b51dee1 |
437 | ("GtkRadioButton" |
438 | :slots |
439 | ((group |
440 | :allocation :virtual |
441 | :getter "gtk_radio_button_get_group" |
442 | :reader radio-button-group |
443 | :type (static (gslist widget))))) |
d520140e |
444 | |
5b51dee1 |
445 | ("GtkRadioMenuItem" |
446 | :slots |
447 | ((group |
448 | :allocation :virtual |
449 | :getter "gtk_radio_menu_item_get_group" |
450 | :reader radio-menu-item-group |
451 | :type (static (gslist widget))))) |
560af5c5 |
452 | |
5b51dee1 |
453 | ("GtkFileSelection" |
454 | :slots |
455 | ((action-area |
d520140e |
456 | :allocation :virtual |
5b51dee1 |
457 | :getter "gtk_file_selection_get_action_area" |
d520140e |
458 | :reader file-selection-action-area |
459 | :type widget) |
460 | (ok-button |
461 | :allocation :virtual |
5b51dee1 |
462 | :getter "gtk_file_selection_get_ok_button" |
d520140e |
463 | :reader file-selection-ok-button |
464 | :type widget) |
465 | (cancel-button |
466 | :allocation :virtual |
5b51dee1 |
467 | :getter "gtk_file_selection_get_cancel_button" |
d520140e |
468 | :reader file-selection-cancel-button |
5b51dee1 |
469 | :type widget))) |
470 | |
471 | ("GtkLayout" |
472 | :slots |
473 | ((bin-window |
474 | :getter "gtk_layout_get_bin_window" |
475 | :reader layout-bin-window |
f784870f |
476 | :type gdk:window))) |
5b51dee1 |
477 | |
478 | ;; Not needed |
479 | ("GtkFundamentalType" :ignore t) |
480 | ("GtkArgFlags" :ignore t) |
560af5c5 |
481 | |
d520140e |
482 | |
5b51dee1 |
483 | ;; Deprecated widgets |
484 | ("GtkCList" :ignore-prefix t) |
485 | ("GtkCTree" :ignore-prefix t) |
486 | ("GtkList" :ignore-prefix t) |
487 | ("GtkTree" :ignore t) |
488 | ("GtkTreeItem" :ignore t) |
e6d40e16 |
489 | ("GtkText" :ignore-prefix t :except ("GtkTextDirection")) |
5b51dee1 |
490 | ("GtkPacker" :ignore-prefix t) |
491 | ("GtkPixmap" :ignore t) |
492 | ("GtkPreview" :ignore-prefix t) |
493 | ("GtkTipsQuery" :ignore t) |
494 | ("GtkOldEditable" :ignore t)) |