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