chiark / gitweb /
Added manually defined slots to autogenerated class definitions
[clg] / gtk / gtktypes.lisp
1 ;; Common Lisp bindings for GTK+ v2.0.x
2 ;; Copyright (C) 1999-2001 Espen S. Johnsen <esj@stud.cs.uit.no>
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.8 2001-10-21 23:16:31 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 "GtkRequisition"))
36
37 (defclass border (boxed)
38   ((left
39     :allocation :alien
40     :accessor border-left
41     :initarg :left
42     :type int)
43    (right
44     :allocation :alien
45     :accessor border-right
46     :initarg :right
47     :type int)
48    (top
49     :allocation :alien
50     :accessor border-top
51     :initarg :top
52     :type int)
53    (bottom
54     :allocation :alien
55     :accessor border-bottom
56     :initarg :bottom
57     :type int))
58   (:metaclass boxed-class)
59   (:alien-name "GtkBorder"))
60
61 (defclass adjustment (%object)
62   ((lower
63     :allocation :alien
64     :accessor adjustment-lower
65     :initarg :lower
66     :type single-float)
67    (upper
68     :allocation :alien
69     :accessor adjustment-upper
70     :initarg :upper
71     :type single-float)
72    (value
73     :allocation :alien
74     :accessor adjustment-value
75     :initarg :value
76     :type single-float)
77    (step-increment
78     :allocation :alien
79     :accessor adjustment-step-increment
80     :initarg :step-increment
81     :type single-float)
82    (page-increment
83     :allocation :alien
84     :accessor adjustment-page-increment
85     :initarg :page-increment
86     :type single-float)
87    (page-size
88     :allocation :alien
89     :accessor adjustment-page-size
90     :initarg :page-size
91     :type single-float))
92   (:metaclass gobject-class)
93   (:alien-name "GtkAdjustment"))
94
95
96
97 (define-types-by-introspection "Gtk"
98   ;; Manually defined
99   ("GtkObject" :ignore t)
100   ("GtkRequisition" :ignore t)
101   ("GtkBorder" :ignore t)
102   ("GtkAdjustment" :ignore t)
103
104   
105   ;; Temporary disabled
106   ("GtkCellRenderer" :ignore-prefix t)
107
108   
109   ;; Manual override
110   ("GtkWidget"
111    :slots
112    ((child-slots
113     :allocation :instance
114     :accessor widget-child-slots
115     :type container-child)
116     (parent
117      :allocation :virtual
118      :getter "gtk_widget_get_parent"
119      :setter "gtk_widget_set_parent"
120      :accessor widget-parent
121      :type container
122      :documentation "The parent widget of this widget. Must be a container widget.")
123     (window
124      :allocation :virtual
125      :getter "gtk_widget_get_window"
126      :reader widget-window
127      :type gdk:window)
128     (state
129      :allocation :virtual
130      :getter "gtk_widget_get_state"
131      :setter "gtk_widget_set_state"
132      :accessor widget-state
133      :initarg :state
134      :type state-type)
135     (colormap
136      :allocation :virtual
137      :getter "gtk_widget_get_colormap"
138      :reader widget-colormap
139      :type gdk:colormap)
140     (visual
141      :allocation :virtual
142      :getter "gtk_widget_get_visual"
143      :reader widget-visual
144      :type gdk:visual)))
145
146   ("GtkContainer"
147    :slots
148    ((child
149      :ignore t)
150     (children
151      :allocation :virtual
152      :getter container-children
153      :setter (setf container-children))
154     (focus-child
155      :allocation :virtual
156      :getter "gtk_container_get_focus_child"
157      :setter "gtk_container_set_focus_child"
158      :accessor container-focus-child
159      :initarg :focus-child
160      :type widget)
161     (focus-hadjustment
162      :allocation :virtual
163      :getter "gtk_container_get_focus_hadjustment"
164      :setter "gtk_container_set_focus_hadjustment"
165      :accessor container-focus-hadjustment
166      :initarg :focus-hadjustment
167      :type adjustment)
168     (focus-vadjustment
169      :allocation :virtual
170      :getter "gtk_container_get_focus_vadjustment"
171      :setter "gtk_container_set_focus_vadjustment"
172      :accessor container-focus-vadjustment
173      :initarg :focus-vadjustment
174      :type adjustment)))
175       
176   ("GtkBin"
177    :slots
178    ((child
179      :allocation :virtual
180      :getter bin-child
181      :setter (setf bin-child))))
182   
183   ("GtkTooltips"
184    :slots
185    ((enabled
186      :allocation :virtual
187      :getter "gtk_tooltips_get_enabled"
188      :setter (setf tooltips-enabled-p)
189      :reader tooltips-enabled-p
190      :initarg :enabled
191      :type boolean)))
192   
193   ("GtkOptionMenu"
194    :slots
195    ((menu
196      :allocation :virtual
197      :getter "gtk_option_menu_get_menu"
198      :setter (setf option-menu-menu)
199      :reader option-menu-menu
200      :initarg :menu
201      :type widget)
202     (history
203      :allocation :virtual
204      :getter "gtk_option_menu_get_history"
205      :setter "gtk_option_menu_set_history"
206      :accessor option-menu-history
207      :initarg :history
208      :type unsigned-int)))
209
210   ("GtkMenuItem"
211    :slots
212    ((label
213      :allocation :virtual
214      :setter menu-item-label
215      :initarg :label
216      :type string)
217     (submenu
218      :allocation :virtual
219      :getter "gtk_menu_item_get_submenu"
220      :setter (setf menu-item-submenu)
221      :reader menu-item-submenu
222      :initarg :submenu
223      :type menu-item)
224     (placement
225      :allocation :virtual
226      :getter "gtk_menu_item_get_placement"
227      :setter "_gtk_menu_item_set_placement"  ; why underscore?
228      :accessor menu-item-placement
229      :initarg :placement
230      :type submenu-placement)
231     (submenu-indicator
232      :allocation :virtual
233      :getter "gtk_menu_item_get_show_submenu"
234      :setter "gtk_menu_item_set_show_submenu"
235      :accessor menu-item-submenu-indicator-p
236      :initarg :submenu-indicator
237      :type boolean)))
238
239   ("GtkColorSelectionDialog"
240    :slots
241    ((colorsel
242      :allocation :alien
243      :reader color-selection-dialog-colorsel
244      :type widget)
245     (ok-button
246      :allocation :alien
247      :reader color-selection-dialog-ok-button
248      :type widget)
249     (cancel-button
250      :allocation :alien
251      :reader color-selection-dialog-cancel-button
252      :type widget)
253     (help-button
254      :allocation :alien
255      :reader color-selection-dialog-help-button
256      :type widget)))
257
258   ("GtkScrolledWindow"
259    :slots
260    ((hscrollbar
261      :allocation :alien
262      :reader scrolled-window-hscrollbar
263      :type widget)
264     (vscrollbar
265      :allocation :alien
266      :reader scrolled-window-vscrollbar
267      :type widget)))
268
269   ("GtkPaned"
270    :slot
271    ((child1
272     :allocation :virtual
273     :getter paned-child1
274     :setter (setf paned-child1)
275     :initarg :child1
276     :type widget)
277    (child2
278     :allocation :virtual
279     :getter paned-child2
280     :setter (setf paned-child2)
281     :initarg :child2
282     :type widget)))
283
284   ("GtkMenu"
285    :slots
286    ((accel-group
287      :allocation :virtual
288      :getter "gtk_menu_get_accel_group"
289      :setter "gtk_menu_set_accel_group"
290      :accessor menu-accel-group
291      :initarg :accel-group
292      :type accel-group)
293     (active
294      :allocation :virtual
295      :getter "gtk_menu_get_active"
296      :setter (setf menu-active)
297      :reader menu-active
298      :initarg :active
299      :type widget)
300     (tornoff
301      :allocation :virtual
302      :getter "gtk_menu_get_tearoff_state"
303      :setter "gtk_menu_set_tearoff_state"
304      :accessor menu-tornoff-p
305      :initarg :tearoff
306      :type boolean)))
307
308   ("GtkToolbar"
309    :slots
310    ((tooltips
311      :allocation :virtual
312      :getter "gtk_toolbar_get_tooltips"
313      :setter "gtk_toolbar_set_tooltips"
314      :accessor toolbar-tooltips-p
315      :initarg :tooltips
316      :type boolean)
317     (icon-size
318      :allocation :virtual
319      :getter "gtk_toolbar_get_icon_size"
320      :setter "gtk_toolbar_set_icon_size"
321      :accessor toolbar-icon-size
322      :initarg :icon-size
323      :type icon-size)))
324
325   ("GtkRuler"
326    :slots
327    ((metric
328      :allocation :virtual
329      :getter "gtk_ruler_get_metric"
330      :setter "gtk_ruler_set_metric"
331      :accessor ruler-metric
332      :initarg :metric
333      :type metric-type)))
334
335   ("GtkProgressBar"
336    :slots
337    ; deprecated properties
338    ((bar-style :ignore t)
339     (adjustment :ignore t)
340     (activity-step :ignore t)
341     (activity-blocks :ignore t)
342     (discrete-blocks :ignore t)))
343
344   ("GtkTable"
345    :slots
346    ((column-spacing
347      :allocation :virtual
348      :getter "gtk_table_get_default_col_spacing"
349      :setter "gtk_table_set_col_spacings"
350      :initarg :column-spacing
351      :type unsigned-int)
352     (row-spacing
353      :allocation :virtual
354      :getter "gtk_table_get_default_row_spacing"
355      :setter "gtk_table_set_row_spacings"
356      :initarg :row-spacing
357      :type unsigned-int)))
358
359   ("GtkDialog"
360    :slots
361    ((vbox
362      :allocation :virtual
363      :getter "gtk_dialog_get_vbox"
364      :reader dialog-vbox
365      :type widget)
366     (action-area
367      :allocation :virtual
368      :getter "gtk_dialog_get_action_area"
369      :reader dialog-action-area
370      :type widget)))
371
372   ("GtkCombo"
373    :slots
374    ((entry
375      :allocation :virtual
376      :getter "gtk_combo_get_entry"
377      :reader combo-entry
378      :type entry)))
379
380   ("GtkRadioButton"
381    :slots
382    ((group
383      :allocation :virtual
384      :getter "gtk_radio_button_get_group"
385      :reader radio-button-group
386      :type (static (gslist widget)))))
387
388   ("GtkRadioMenuItem"
389    :slots
390    ((group
391      :allocation :virtual
392      :getter "gtk_radio_menu_item_get_group"
393      :reader radio-menu-item-group
394      :type (static (gslist widget)))))
395
396   ("GtkFileSelection"
397    :slots
398    ((action-area
399      :allocation :virtual
400      :getter "gtk_file_selection_get_action_area"
401      :reader file-selection-action-area
402      :type widget)
403     (ok-button
404      :allocation :virtual
405      :getter "gtk_file_selection_get_ok_button"
406      :reader file-selection-ok-button
407      :type widget)
408     (cancel-button
409      :allocation :virtual
410      :getter "gtk_file_selection_get_cancel_button"
411      :reader file-selection-cancel-button
412      :type widget)))
413
414   ("GtkLayout"
415    :slots
416    ((bin-window
417      :getter "gtk_layout_get_bin_window"
418      :reader layout-bin-window
419      :type gdk:window)
420     (x-offset
421      :getter "gtk_layout_get_xoffset"
422      :setter "gtk_layout_set_xoffset"
423      :accessor layout-x-offset
424      :initarg :x-offset
425      :type unsigned-int)
426     (y-offset
427      :getter "gtk_layout_get_yoffset"
428      :setter "gtk_layout_set_yoffset"
429      :accessor layout-y-offset
430      :initarg :x-offset
431      :type unsigned-int)))
432
433      
434   ;; Not needed
435   ("GtkFundamentalType" :ignore t)
436   ("GtkArgFlags" :ignore t)
437
438   
439   ;; Deprecated widgets
440   ("GtkCList" :ignore-prefix t)
441   ("GtkCTree" :ignore-prefix t)
442   ("GtkList" :ignore-prefix t)
443   ("GtkTree" :ignore t)
444   ("GtkTreeItem" :ignore t)
445   ("GtkText" :ignore-prefix t)
446   ("GtkPacker" :ignore-prefix t)
447   ("GtkPixmap" :ignore t)
448   ("GtkPreview" :ignore-prefix t)
449   ("GtkTipsQuery" :ignore t)
450   ("GtkOldEditable" :ignore t))