chiark / gitweb /
Renamed dialog class slot vbox to main-area
[clg] / gtk / gtktypes.lisp
1 ;; Common Lisp bindings for GTK+ v2.0.x
2 ;; Copyright (C) 1999-2001 Espen S. Johnsen <espen@users.sourceforge.org>
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
18 ;; $Id: gtktypes.lisp,v 1.13 2002-03-24 15:42:17 espen Exp $
19
20
21 (in-package "GTK")
22
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)
35   (:alien-name "GtkTypeRequisition"))
36
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
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)
82   (:alien-name "GtkTypeBorder"))
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)
95    (%value ; to get the offset right
96     :allocation :alien
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
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
119     :type single-float))
120   (:metaclass gobject-class)
121   (:alien-name "GtkAdjustment"))
122
123
124
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
132   
133   ;; Manual override
134   ("GtkWidget"
135    :slots
136    ((child-slots
137     :allocation :instance
138     :accessor widget-child-slots
139     :type container-child)
140     (parent-window
141      :allocation :virtual
142      :getter "gtk_widget_get_parent_window"
143      :setter "gtk_widget_set_parent_window"
144      :accessor widget-parent-window
145      :type gdk:window)
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"
161      :setter "gtk_widget_set_colormap"
162      :initarg :colormap
163      :accessor widget-colormap
164      :type gdk:colormap)
165     (visual
166      :allocation :virtual
167      :getter "gtk_widget_get_visual"
168      :reader widget-visual
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      
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)
212     (focus-chain
213      :allocation :virtual
214      :getter container-focus-chain
215      :setter (setf container-focus-chain))
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
235      :getter "gtk_bin_get_child"
236      :setter (setf bin-child)
237      :reader bin-child
238      :type widget)))
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)))
325
326   ("GtkPaned"
327    :slot
328    ((child1
329     :allocation :virtual
330     :getter paned-child1
331     :setter (setf paned-child1)
332     :initarg :child1
333     :type widget)
334    (child2
335     :allocation :virtual
336     :getter paned-child2
337     :setter (setf paned-child2)
338     :initarg :child2
339     :type widget)))
340
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
418    ((main-area
419      :allocation :virtual
420      :getter "gtk_dialog_get_vbox"
421      :reader dialog-main-area
422      :type widget)
423     (action-area
424      :allocation :virtual
425      :getter "gtk_dialog_get_action_area"
426      :reader dialog-action-area
427      :type widget)))
428
429   ("GtkCombo"
430    :slots
431    ((entry
432      :allocation :virtual
433      :getter "gtk_combo_get_entry"
434      :reader combo-entry
435      :type entry)))
436
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)))))
444
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)))))
452
453   ("GtkFileSelection"
454    :slots
455    ((action-area
456      :allocation :virtual
457      :getter "gtk_file_selection_get_action_area"
458      :reader file-selection-action-area
459      :type widget)
460     (ok-button
461      :allocation :virtual
462      :getter "gtk_file_selection_get_ok_button"
463      :reader file-selection-ok-button
464      :type widget)
465     (cancel-button
466      :allocation :virtual
467      :getter "gtk_file_selection_get_cancel_button"
468      :reader file-selection-cancel-button
469      :type widget)))
470
471   ("GtkLayout"
472    :slots
473    ((bin-window
474      :getter "gtk_layout_get_bin_window"
475      :reader layout-bin-window
476      :type gdk:window)))
477      
478   ;; Not needed
479   ("GtkFundamentalType" :ignore t)
480   ("GtkArgFlags" :ignore t)
481
482   
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)
489   ("GtkText" :ignore-prefix t :except ("GtkTextDirection"))
490   ("GtkPacker" :ignore-prefix t)
491   ("GtkPixmap" :ignore t)
492   ("GtkPreview" :ignore-prefix t)
493   ("GtkTipsQuery" :ignore t)
494   ("GtkOldEditable" :ignore t))