chiark / gitweb /
Fix compilation for Gtk with the new, stricter inheritance
[clg] / gtk / gtktypes.lisp
1 ;; Common Lisp bindings for GTK+ v2.x
2 ;; Copyright 1999-2005 Espen S. Johnsen <espen@users.sf.net>
3 ;;
4 ;; Permission is hereby granted, free of charge, to any person obtaining
5 ;; a copy of this software and associated documentation files (the
6 ;; "Software"), to deal in the Software without restriction, including
7 ;; without limitation the rights to use, copy, modify, merge, publish,
8 ;; distribute, sublicense, and/or sell copies of the Software, and to
9 ;; permit persons to whom the Software is furnished to do so, subject to
10 ;; the following conditions:
11 ;;
12 ;; The above copyright notice and this permission notice shall be
13 ;; included in all copies or substantial portions of the Software.
14 ;;
15 ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 ;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 ;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 ;; $Id: gtktypes.lisp,v 1.65 2008-10-27 18:42:01 espen Exp $
24
25 (in-package "GTK")
26
27 (defclass requisition (boxed)
28   ((width
29     :allocation :alien
30     :accessor requisition-width
31     :initarg :width
32     :type int)
33    (height
34     :allocation :alien
35     :accessor requisition-height
36     :initarg :height
37     :type int))
38   (:metaclass boxed-class))
39
40
41 (defclass allocation (struct)
42   ((x
43     :allocation :alien
44     :accessor allocation-x
45     :initarg :x
46     :type int)
47    (y
48     :allocation :alien
49     :accessor allocation-y
50     :initarg :y
51     :type int)
52    (width
53     :allocation :alien
54     :accessor allocation-width
55     :initarg :width
56     :type int)
57    (height
58     :allocation :alien
59     :accessor allocation-height
60     :initarg :height
61     :type int))
62   (:metaclass struct-class))
63
64 (defclass border (boxed)
65   ((left
66     :allocation :alien
67     :accessor border-left
68     :initarg :left
69     :type int)
70    (right
71     :allocation :alien
72     :accessor border-right
73     :initarg :right
74     :type int)
75    (top
76     :allocation :alien
77     :accessor border-top
78     :initarg :top
79     :type int)
80    (bottom
81     :allocation :alien
82     :accessor border-bottom
83     :initarg :bottom
84     :type int))
85   (:metaclass boxed-class))
86
87 (defclass stock-item (struct)
88   ((id
89     :allocation :alien
90     :accessor stock-item-id
91     :initarg :id
92     :type string)
93    (label
94     :allocation :alien
95     :accessor stock-item-label
96     :initarg :label
97     :type string)
98    (modifier
99     :allocation :alien
100     :accessor stock-item-modifier
101     :initarg :modifier
102     :type gdk:modifier-type)
103    (keyval
104     :allocation :alien
105     :accessor stock-item-keyval
106     :initarg :keyval
107     :type int)
108    (translation-domain
109     :allocation :alien
110     :accessor stock-item-translation-domain
111     :initarg :translation-domain
112     :type string))
113   (:metaclass struct-class)
114   (:ref stock-item-copy)
115   (:unref stock-item-free))
116
117 (defclass tree-iter (boxed)  
118   ((stamp :allocation :alien :type int)
119    (user-data :allocation :alien :type pointer)
120    (user-data2 :allocation :alien :type pointer)
121    (user-data3 :allocation :alien :type pointer))
122   (:metaclass boxed-class))
123
124
125 ;; (defclass tree-path (boxed)
126 ;;   ((depth :allocation :alien :type int)
127 ;;    (indices  :allocation :alien :type pointer))
128 ;;   (:metaclass boxed-class))
129
130 (deftype tree-path () '(vector integer))
131 (register-type 'tree-path '|gtk_tree_path_get_type|)
132
133 (deftype position () 
134   '(or int (enum (:start 0) (:end -1) (:first 0) (:last -1))))
135
136 (define-type-method from-alien-form ((type position) form &key ref)
137   (declare (ignore type ref))
138   (from-alien-form 'int form))
139
140 (define-type-method from-alien-function ((type position) &key ref)
141   (declare (ignore type ref))
142   (from-alien-function 'int))
143
144 (define-type-method reader-function ((type position) &optional ref)
145   (declare (ignore type ref))
146   (reader-function 'int))
147
148 ;; Register GtkObject in advance so that eg GtkTooltips, which inherits from it,
149 ;; gets a proper supertype. TODO: This is a hack. Where is it supposed to
150 ;; happen?
151 (register-type '%object "GtkObject")
152
153 (define-types-by-introspection "Gtk"
154   ;; Manually defined
155   ("GtkObject" :ignore t)
156   ("GtkRequisition" :ignore t)
157   ("GtkBorder" :ignore t)
158   ("GtkTreeIter" :ignore t)
159   ("GtkTreePath" :ignore t)
160 ;  ("GtkStyle" :ignore t)
161
162   ("GtkMountOperation" :ignore t) ; Needs GIO
163
164   ;; Manual override
165   ("GtkWidget"
166    :slots
167    ((child-properties
168      :special t
169      :accessor widget-child-properties
170      :type container-child)
171     (window
172      :allocation :virtual
173      :getter "gtk_widget_get_window"
174      :reader widget-window
175      :type gdk:window)
176     (parent :merge t :initarg nil)
177     (visible :merge t :initarg nil)
178     (parent-window
179      :allocation :virtual
180      :getter %widget-parent-window
181      :setter "gtk_widget_set_parent_window"
182      :accessor widget-parent-window
183      :initarg :parent-window
184      :type gdk:window)
185     (state
186      :allocation :virtual
187      :getter "gtk_widget_get_state"
188      :setter "gtk_widget_set_state"
189      :accessor widget-state
190      :initarg :state
191      :type state-type)
192     (colormap
193      :allocation :virtual
194      :getter "gtk_widget_get_colormap"
195      :setter "gtk_widget_set_colormap"
196      :initarg :colormap
197      :accessor widget-colormap
198      :type gdk:colormap)
199     (visual
200      :allocation :virtual
201      :getter "gtk_widget_get_visual"
202      :reader widget-visual
203      :type gdk:visual)
204     (direction
205      :allocation :virtual
206      :getter "gtk_widget_get_direction"
207      :setter "gtk_widget_set_direction"
208      :accessor widget-direction
209      :initarg :direction
210      :type text-direction)
211     (composite-name
212      :allocation :virtual
213      :getter "gtk_widget_get_composite_name"
214      :setter "gtk_widget_set_composite_name"
215      :accessor widget-composite-name
216      :initarg :composite-name
217      :type (copy-of string)) ; will leak the string when setting
218     (settings
219      :allocation :virtual
220      :getter "gtk_widget_get_settings"
221      :accessor widget-settings
222      :type settings)
223     (child-visible
224      :allocation :virtual
225      :getter "gtk_widget_get_child_visible"
226      :setter "gtk_widget_set_child_visible"
227      :accessor widget-child-visible-p
228      :initarg :child-visible
229      :type boolean)
230     (width-request
231      :merge t :unbound -1)
232     (height-request
233      :merge t :unbound -1)
234     #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.12.0")
235     (tooltip-window
236      :allocation :virtual
237      :getter "gtk_widget_get_tooltip_window"
238      :setter "gtk_widget_set_tooltip_window"
239      :accessor widget-tooltip-window
240      :initarg :tooltip-window
241      :type window)))
242      
243   ("GtkContainer"
244    :slots
245    ((child :ignore t)
246     (children
247      :allocation :virtual
248      :setter (setf container-children)
249      :getter "gtk_container_get_children"
250      :reader container-children
251      :type (glist (copy-of widget)))
252     (internal-children ; for debugging
253      :allocation :virtual
254      :getter container-internal-children)
255     (child-type
256      :allocation :virtual
257      :getter "gtk_container_child_type"
258      :reader container-child-type
259      :type gtype)
260     (focus-child
261      :allocation :virtual
262      :getter "gtk_container_get_focus_child"
263      :setter "gtk_container_set_focus_child"
264      :accessor container-focus-child
265      :initarg :focus-child
266      :type widget)
267     (focus-chain
268      :allocation :virtual
269      :getter container-focus-chain
270      :setter (setf container-focus-chain))
271     (focus-hadjustment
272      :allocation :virtual
273      :getter "gtk_container_get_focus_hadjustment"
274      :setter "gtk_container_set_focus_hadjustment"
275      :accessor container-focus-hadjustment
276      :initarg :focus-hadjustment
277      :type adjustment)
278     (focus-vadjustment
279      :allocation :virtual
280      :getter "gtk_container_get_focus_vadjustment"
281      :setter "gtk_container_set_focus_vadjustment"
282      :accessor container-focus-vadjustment
283      :initarg :focus-vadjustment
284      :type adjustment)
285     (reallocate-redraws
286      :allocation :virtual
287      :getter "gtk_container_get_reallocate_redraws"
288      :setter "gtk_container_set_reallocate_redraws"
289      :accessor container-reallocate-redraws
290      :initarg :reallocate-redraws
291      :type boolean)))
292       
293   ("GtkBin"
294    :slots
295    ((child
296      :allocation :virtual
297      :getter "gtk_bin_get_child"
298      :setter (setf bin-child)
299      :reader bin-child
300      :type widget)))
301
302   ("GtkWindow"
303    :slots
304    ((focus-widget
305      :allocation :virtual
306      :getter "gtk_window_get_focus"
307      :setter "gtk_window_set_focus"
308      :accessor window-focus-widget
309      :initarg :focus-widget
310      :type widget)
311     (default-widget
312      :allocation :virtual
313      :getter "gtk_window_get_default"
314      :setter "gtk_window_set_default"
315      :accessor window-default-widget
316      :initarg :default-widget
317      :type widget)
318     (has-frame
319      :allocation :virtual
320      :getter "gtk_window_get_has_frame"
321      :setter "gtk_window_set_has_frame"
322      :accessor window-has-frame-p
323      :initarg :has-frame
324      :type boolean)
325     (icon-list
326      :allocation :virtual
327      :getter %window-get-icon-list
328      :setter "gtk_window_set_icon_list"
329      :accessor window-icon-list
330      :initarg :icon-list
331      :type (glist gdk:pixbuf))
332     (mnemonic-modifier
333      :allocation :virtual
334      :getter "gtk_window_get_mnemonic_modifier"
335      :setter "gtk_window_set_mnemonic_modifier"
336      :accessor window-mnemonic-modifier
337      :initarg :mnemonic-modifier
338      :type gdk:modifier-type)
339     #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
340     (transient-for
341      :allocation :virtual
342      :getter "gtk_window_get_transient_for"
343      :setter "gtk_window_set_transient_for"
344      :accessor window-transient-for
345      :initarg :transient-for
346      :type window)
347     (group
348      :allocation :virtual
349      :getter "gtk_window_get_group"
350      :setter (setf window-group)
351      :reader window-group
352      :initarg :group
353      :type window-group)
354     (default-width :merge t :unbound -1)
355     (default-height :merge t :unbound -1)))
356   
357   ("GtkWindowGroup"
358    :dependencies (window)
359    :slots
360    ((grabs
361      :allocation :alien
362      :accessor window-group-grabs
363      :type (gslist window))))
364
365   ("GtkTooltips"
366    :slots
367    ((enabled
368      :allocation :virtual
369      :getter "gtk_tooltips_get_enabled"
370      :setter (setf tooltips-enabled-p)
371      :reader tooltips-enabled-p
372      :initarg :enabled
373      :type boolean)))
374   
375   ("GtkMenuItem"
376    :slots
377    ((label
378      :allocation :virtual
379      :getter menu-item-label
380      :setter (setf menu-item-label)
381      :type string)
382     (use-underline
383      :allocation :user-data
384      :initform nil
385      :initarg :use-underline
386      :accessor menu-item-use-underline-p)
387     (right-justified
388      :allocation :virtual
389      :getter "gtk_menu_item_get_right_justified"
390      :setter "gtk_menu_item_set_right_justified"
391      :accessor menu-item-right-justified-p
392      :initarg :right-justified
393      :type boolean)
394     #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.12.0")
395     (submenu
396      :allocation :virtual
397      :getter "gtk_menu_item_get_submenu"
398      :setter "gtk_menu_item_set_submenu"
399      :accessor menu-item-submenu
400      :initarg :submenu
401      :type widget)))
402
403   ("GtkMenuShell"
404    :slots
405    ((take-focus-p
406      :allocation :virtual
407      :getter "gtk_menu_shell_get_take_focus"
408      :setter "gtk_menu_shell_set_take_focus"
409      :accessor menu-shell-take-focus-p
410      :type boolean)))
411
412   ("GtkColorSelectionDialog"
413    :slots
414    ((colorsel
415      :allocation :alien
416      :reader color-selection-dialog-colorsel
417      :type widget)
418     (ok-button
419      :allocation :alien
420      :reader color-selection-dialog-ok-button
421      :type widget)
422     (cancel-button
423      :allocation :alien
424      :reader color-selection-dialog-cancel-button
425      :type widget)
426     (help-button
427      :allocation :alien
428      :reader color-selection-dialog-help-button
429      :type widget)))
430
431   ("GtkScrolledWindow"
432    :slots
433    (#?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
434     (hscrollbar
435      :allocation  :alien
436      :reader scrolled-window-hscrollbar
437      :type widget)
438     #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
439     (vscrollbar
440      :allocation :alien
441      :reader scrolled-window-vscrollbar
442      :type widget)
443     #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
444     (hscrollbar
445      :allocation :virtual
446      :getter "gtk_scrolled_window_get_hscrollbar"
447      :reader scrolled-window-hscrollbar
448      :type widget)
449     #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
450     (vscrollbar
451      :allocation :virtual
452      :getter "gtk_scrolled_window_get_vscrollbar"
453      :reader scrolled-window-vscrollbar
454      :type widget)))
455
456   ("GtkPaned"
457    :slots
458    ((child1
459     :allocation :virtual
460     :getter "gtk_paned_get_child1"
461     :setter "gtk_paned_add1"
462     :accessor paned-child1
463     :initarg :child1
464     :type widget)
465    (child2
466     :allocation :virtual
467     :getter "gtk_paned_get_child2"
468     :setter "gtk_paned_add2"
469     :accessor paned-child2
470     :initarg :child2
471     :type widget)))
472
473   ("GtkMenu"
474    :slots
475    ((accel-group
476      :allocation :virtual
477      :getter "gtk_menu_get_accel_group"
478      :setter "gtk_menu_set_accel_group"
479      :accessor menu-accel-group
480      :initarg :accel-group
481      :type accel-group)
482     (active
483      :allocation :virtual
484      :getter "gtk_menu_get_active"
485      :setter (setf menu-active)
486      :reader menu-active
487      :initarg :active
488      :type widget)
489     (screen
490      :allocation :virtual
491      :getter "gtk_menu_get_screen"
492      :setter "gtk_menu_set_screen"
493      :accessor menu-screen
494      :initarg :screen
495      :type gdk:screen)
496     (attach-widget
497      :allocation :virtual
498      :getter "gtk_menu_get_attach_widget"
499      :reader menu-attach-widget
500      :type widget)
501     #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
502     (tearoff-state
503      :allocation :virtual
504      :getter "gtk_menu_get_tearoff_state"
505      :setter "gtk_menu_set_tearoff_state"
506      :accessor menu-tearoff-state-p
507      :initarg :tearoff-state
508      :type boolean)))
509
510   ("GtkPlug"
511    :slots
512    ((id
513      :allocation :virtual
514      :getter "gtk_plug_get_id"
515      :reader plug-id
516      :type gdk:native-window)))
517
518   ("GtkSocket"
519    :slots
520    ((id
521      :allocation :virtual
522      :getter "gtk_socket_get_id"
523      :reader socket-id
524      :type gdk:native-window)))
525
526   ("GtkToolbar"
527    :slots
528    ((show-tooltips         ;; this slot is equivalent to the property
529      :allocation :virtual  ;; "tooltips" in Gtk+ 2.8
530      :getter "gtk_toolbar_get_tooltips"
531      :setter "gtk_toolbar_set_tooltips"
532      :accessor toolbar-show-tooltips-p
533      :initarg :show-tooltips
534      :type boolean)
535     (tooltips
536      :allocation :virtual
537      :getter "gtk_toolbar_get_tooltips_object"
538      :reader toolbar-tooltips
539      :type tooltips)
540     (toolbar-style ; defined manually to get the accesssor name correct
541      :allocation :property
542      :pname "toolbar-style"
543      :initarg :toolbar-style
544      :accessor toolbar-style
545      :type toolbar-style)
546     (n-items
547      :allocation :virtual
548      :getter "gtk_toolbar_get_n_items"
549      :reader toolbar-n-items
550      :type int)))
551
552   ("GtkToolItem"
553    :slots
554    ((use-drag-window
555      :allocation :virtual
556      :getter "gtk_tool_item_get_use_drag_window"
557      :setter "gtk_tool_item_set_use_drag_window"
558      :accessor tool-item-use-drag-window-p
559      :initarg :drag-window
560      :type boolean)
561     (tip-text 
562      :allocation :user-data
563      :setter (setf tool-item-tip-text)
564      :initarg :tip-text
565      :reader tool-item-tip-text)
566     (tip-private
567      :allocation :user-data
568      :setter (setf tool-item-tip-private)
569      :initarg :tip-private
570      :reader tool-item-tip-private)))
571
572   ("GtkToolButton"
573    :slots
574    ((stock-id :merge t :initarg :stock)
575     (icon-widget :merge t :initarg :icon)))
576
577   ("GtkToggleToolButton"
578    :slots
579    ((active
580      :allocation :virtual
581      :getter "gtk_toggle_tool_button_get_active"
582      :setter "gtk_toggle_tool_button_set_active"
583      :accessor toggle-tool-button-active-p
584      :initarg :active
585      :type boolean)))
586
587   ("GtkRadioToolButton"
588    :slots
589    ((group
590      :allocation :virtual
591      :getter "gtk_radio_tool_button_get_group"
592      :reader radio-tool-button-group
593      :type (copy-of (gslist widget)))
594     (value 
595      :allocation :user-data
596      :initarg :value
597      :accessor radio-tool-button-value
598      :documentation "Value passed as argument to the activate callback")))
599
600   ("GtkNotebook"
601    :slots
602    ((current-page
603      :allocation :virtual
604      :getter %notebook-current-page
605      :setter (setf notebook-current-page)
606      :reader notebook-current-page
607      :type widget
608      :initarg :current-page)
609     (current-page-num
610      :allocation :virtual
611      :getter "gtk_notebook_get_current_page"
612      :setter "gtk_notebook_set_current_page"
613      :unbound -1
614      :initarg :current-page-num
615      :accessor notebook-current-page-num
616      :type position)))
617   
618   ("GtkRuler"
619    :slots
620    ((metric
621      :allocation :virtual
622      :getter "gtk_ruler_get_metric"
623      :setter "gtk_ruler_set_metric"
624      :accessor ruler-metric
625      :initarg :metric
626      :type metric-type)))
627
628   ("GtkProgressBar"
629    :slots
630    ; deprecated properties
631    ((bar-style :ignore t)
632     (adjustment :ignore t)
633     (activity-step :ignore t)
634     (activity-blocks :ignore t)
635     (discrete-blocks :ignore t)))
636
637   ("GtkHandleBox"
638    :slots
639    ; deprecated property
640    ((shadow :ignore t)))
641
642   ("GtkFrame"
643    :slots
644    ; deprecated property
645    ((shadow :ignore t)))
646
647   ("GtkTable"
648    :slots
649    ((column-spacing
650      :allocation :property :pname "column-spacing"
651      :initarg :column-spacing
652      :type unsigned-int)
653     (row-spacing
654      :allocation :property :pname "row-spacing"
655      :initarg :row-spacing
656      :type unsigned-int)))
657
658   ("GtkDialog"
659    :slots
660    ((vbox
661      :allocation :virtual
662      :getter "gtk_dialog_get_vbox"
663      :reader dialog-vbox
664      :type widget)
665     (action-area
666      :allocation :virtual
667      :getter "gtk_dialog_get_action_area"
668      :reader dialog-action-area
669      :type widget)))
670
671   ("GtkEntry"
672    :slots
673    ((layout
674      :allocation :virtual
675      :getter "gtk_entry_get_layout"
676      :reader entry-layout
677      :type pango:layout)
678     (completion
679      :allocation :virtual
680      :getter "gtk_entry_get_completion"
681      :setter "gtk_entry_set_completion"
682      :initarg :completion
683      :accessor entry-completion
684      :type entry-completion)
685     (max-length :merge t :unbound 0)
686     (alignment
687      :allocation :virtual
688      :getter "gtk_entry_get_alignment"
689      :setter "gtk_entry_set_alignment"
690      :initarg :alignment
691      :accessor entry-alignment
692      :type single-float)
693     #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
694     (width-chars :merge t :unbound -1)
695     #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.12.0")
696     (cursor-adjustment
697      :allocation :virtual
698      :getter "gtk_entry_get_cursor_hadjustment"
699      :setter "gtk_entry_set_cursor_hadjustment"
700      :initarg :cursor-hadjustment
701      :accessor entry-cursor-hadjustment
702      :type adjustment)))
703
704   ("GtkEntryCompletion"
705    :slots
706    ((entry
707      :allocation :virtual
708      :getter "gtk_entry_completion_get_entry"
709      :reader entry-completion-entry
710      :type entry)
711     (minimum-key-length :merge t :unbound -1)
712     ;; Need to be manually defined, as this value through the property
713     ;; mechanism doesn't work
714     #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
715     (text-column
716      :allocation :virtual
717      :getter "gtk_entry_completion_get_text_column"
718      :setter "gtk_entry_completion_set_text_column"
719      :unbound -1
720      :accessor entry-completion-text-column
721      :type int)))
722
723   ("GtkRadioButton"
724    :slots
725    ((group
726      :allocation :virtual
727      :getter "gtk_radio_button_get_group"
728      :reader radio-button-group
729      :type (copy-of (gslist widget)))
730     (value 
731      :allocation :user-data
732      :initarg :value
733      :accessor radio-button-value
734      :documentation "Value passed as argument to the activate callback")))
735
736   ("GtkRadioMenuItem"
737    :slots
738    ((group
739      :allocation :virtual
740      :getter "gtk_radio_menu_item_get_group"
741      :reader radio-menu-item-group
742      :type (copy-of (gslist widget)))
743     (value 
744      :allocation :user-data
745      :initarg :value
746      :accessor radio-menu-item-value
747      :documentation "Value passed as argument to the activate callback")))
748
749   ("GtkLayout"
750    :slots
751    ((bin-window
752      :allocation :virtual
753      :getter "gtk_layout_get_bin_window"
754      :reader layout-bin-window
755      :type gdk:window)))
756
757   ("GtkFixed"
758    :slots
759    ((has-window
760      :allocation :virtual
761      :getter "gtk_fixed_get_has_window"
762      :setter "gtk_fixed_set_has_window"
763      :reader fixed-has-window-p
764      :initarg :has-window
765      :type boolean)))
766
767   ("GtkRange"
768    :slots
769    ((value
770      :allocation :virtual
771      :getter "gtk_range_get_value"
772      :setter "gtk_range_set_value"
773      :initarg :value
774      :accessor range-value
775      :type double-float)
776    (upper
777      :allocation :virtual
778      :getter range-upper
779      :setter (setf range-upper)
780      :initarg :upper)
781    (lower
782      :allocation :virtual
783      :getter range-lower
784      :setter (setf range-lower)
785      :initarg :lower)
786    (step-increment
787      :allocation :virtual
788      :getter range-step-increment
789      :setter (setf range-step-increment)
790      :initarg :step-increment)
791    (page-increment
792      :allocation :virtual
793      :getter range-page-increment
794      :setter (setf range-page-increment)
795      :initarg :page-increment)))
796
797   ("GtkImage"
798    :slots
799    ((file :ignore t)
800     #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
801     (pixel-size :merge t :unbound -1)))
802
803   ("GtkLabel"
804    :slots
805    ((layout
806      :allocation :virtual
807      :getter "gtk_label_get_layout"
808      :reader label-layout
809      :type pango:layout)))
810
811   ("GtkScale"
812    :slots
813    ((layout
814      :allocation :virtual
815      :getter "gtk_scale_get_layout"
816      :reader scale-layout
817      :type pango:layout)))
818
819   ("GtkEditable"
820    :slots
821    ((editable
822      :allocation :virtual
823      :getter "gtk_editable_get_editable"
824      :setter "gtk_editable_set_editable"
825      :reader editable-editable-p
826      :initarg :editable
827      :type boolean)
828     (position
829      :allocation :virtual
830      :getter "gtk_editable_get_position"
831      :setter "gtk_editable_set_position"
832      :reader editable-position
833      :initarg :position
834      :type position)
835     (text
836      :allocation :virtual
837      :getter editable-text
838      :setter (setf editable-text)
839      :initarg text)))
840
841   ("GtkFileChooser"
842    :slots
843    ((filename
844      :allocation :virtual
845      :getter "gtk_file_chooser_get_filename"
846      :setter "gtk_file_chooser_set_filename"
847      :accessor file-chooser-filename
848      :initarg :filename
849      :type string)
850     (current-name
851      :allocation :virtual
852      :setter "gtk_file_chooser_set_current_name"
853      :accessor file-chooser-current-name
854      :initarg :current-name
855      :type string)
856     (current-folder
857      :allocation :virtual
858      :setter "gtk_file_chooser_set_current_folder"
859      :getter "gtk_file_chooser_get_current_folder"
860      :accessor file-chooser-current-folder
861      :initarg :current-folder
862      :type string)
863     (uri
864      :allocation :virtual
865      :getter "gtk_file_chooser_get_uri"
866      :setter "gtk_file_chooser_set_uri"
867      :accessor file-chooser-uri
868      :initarg :uri
869      :type string)
870     (current-folder-uri
871      :allocation :virtual
872      :setter "gtk_file_chooser_set_current_folder_uri"
873      :getter "gtk_file_chooser_get_current_folder_uri"
874      :accessor file-chooser-current-folder-uri
875      :initarg :current-folder-uri
876      :type string)))
877
878   ("GtkFileFilter"
879    :slots
880    ((name
881      :allocation :virtual
882      :getter "gtk_file_filter_get_name"
883      :setter "gtk_file_filter_set_name"
884      :accessor file-filter-name
885      :initarg :name
886      :type string)))
887
888   ("GtkTreeView"
889    :slots
890    ((columns
891      :allocation :virtual
892      :getter "gtk_tree_view_get_columns"
893      :reader tree-view-columns 
894      :type (glist (copy-of tree-view-column)))
895     (selection
896      :allocation :virtual
897      :getter "gtk_tree_view_get_selection"
898      :reader tree-view-selection
899      :type tree-selection)))
900
901   ("GtkTreeModel"
902    :slots
903    ((n-columns
904      :allocation :virtual
905      :getter "gtk_tree_model_get_n_columns"
906      :reader tree-model-n-columns 
907      :type int)))
908
909   ("GtkTreeModelFilter"
910    :slots
911    ((virtual-root :merge t :type tree-path)))
912
913   ("GtkTreeSelection"
914    :slots
915    ((mode
916      :allocation :virtual
917      :getter "gtk_tree_selection_get_mode"
918      :setter "gtk_tree_selection_set_mode"
919      :accessor tree-selection-mode
920      :initarg :mode
921      :type selection-mode)
922     (tree-view
923      :allocation :virtual
924      :getter "gtk_tree_selection_get_tree_view"
925      :reader tree-selection-tree-view
926      :type tree-view)))
927
928   ("GtkComboBox"
929    :slots
930    ((active-iter
931      :allocation :virtual
932      :getter "gtk_combo_box_get_active_iter"
933      :setter "gtk_combo_box_set_active_iter"
934      :accessor combo-box-active-iter 
935      :type tree-iter)))
936
937   ("GtkTextBuffer"
938    :slots
939    ((line-count
940      :allocation :virtual
941      :getter "gtk_text_buffer_get_line_count"
942      :reader text-buffer-line-count
943      :type int)
944     (char-count
945      :allocation :virtual
946      :getter "gtk_text_buffer_get_char_count"
947      :reader text-buffer-char-count
948      :type int)
949     (modified
950      :allocation :virtual
951      :getter "gtk_text_buffer_get_modified"
952      :setter "gtk_text_buffer_set_modified"
953      :accessor text-buffer-modifed-p
954      :type boolean)))
955
956   ("GtkTextView"
957    :slots
958    ((default-attributes
959      :allocation :virtual
960      :getter "gtk_text_view_get_default_attributes"
961      :reader text-view-default-attributes
962      :type text-attributes)))
963
964   ("GtkTextTagTable"
965    :slots
966    ((size
967      :allocation :virtual
968      :getter "gtk_text_tag_table_get_size"
969      :reader text-tag-table-size
970      :type int)))
971
972   ("GtkTextTag"
973    :slots
974    ((priority
975      :allocation :virtual
976      :getter "gtk_text_tag_get_priority"
977      :setter "gtk_text_tag_set_priority"
978      :accessor text-tag-priority
979      :type int)
980     (weight
981      :merge t :type pango:weight)))
982
983   ("GtkTextMark"
984    :slots
985    ((buffer
986      :allocation :virtual
987      :getter "gtk_text_mark_get_buffer"
988      :reader text-mark-buffer
989      :type text-buffer)
990     (name
991      :allocation :virtual
992      :getter "gtk_text_mark_get_name"
993      :reader text-mark-name
994      :type (copy-of string))
995     (visible
996      :allocation :virtual
997      :getter "gtk_text_mark_get_visible"
998      :setter "gtk_text_mark_set_visible"
999      :accessor text-mark-visible-p
1000      :type boolean)
1001     (deleted
1002      :allocation :virtual
1003      :getter "gtk_text_mark_get_deleted"
1004      :reader text-mark-deleted-p
1005      :type boolean)
1006     (left-gravity
1007      :allocation :virtual
1008      :getter "gtk_text_mark_get_left_gravity"
1009      :reader text-mark-left-gravity-p
1010      :type boolean)))
1011
1012   ("GtkUIManager"
1013    :type ui-manager
1014    :slots
1015    ((action-groups
1016      :allocation :virtual
1017      :getter "gtk_ui_manager_get_action_groups"
1018      :reader ui-manager-action-groups
1019      :type (copy-of (glist action-group)))
1020     (accel-group
1021      :allocation :virtual
1022      :getter "gtk_ui_manager_get_accel_group"
1023      :reader ui-manager-accel-group
1024      :type accel-group)))
1025
1026   ("GtkUIManagerItemType"
1027    :type ui-manager-item-type)
1028
1029   ("GtkAction"
1030    :slots
1031    ((accelerator
1032      :allocation :user-data :initarg :accelerator 
1033      :reader action-accelerator)))
1034
1035   #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1036   ("GtkToggleAction"
1037    :slots
1038    ((active
1039      :allocation :virtual
1040      :getter "gtk_toggle_action_get_active"
1041      :setter "gtk_toggle_action_set_active"
1042 ;     :initarg :active ;; Handled by initialize-instance
1043      :accessor toggle-action-active-p
1044      :type boolean)))
1045
1046   ("GtkRadioAction"
1047    :slots
1048    ((group
1049      :allocation :virtual
1050      :getter "gtk_radio_button_get_group"
1051      :reader radio-action-group
1052      :type (copy-of (gslist widget)))
1053     (self
1054      :allocation :property :pname "value" :type int
1055      :documentation "A hack so we can use the alien function gtk_radio_action_get_current_value to retrieve the active radio action in a group.")
1056     (value 
1057      :allocation :user-data :initarg :value :accessor radio-action-value)
1058     #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1059     ;; Use radio-action-get-current-value to get the current value of
1060     ;; a radio action group
1061     (current-value :ignore t)))
1062
1063   ("GtkColorSelection"
1064    :slots
1065    ((previous-alpha
1066      :allocation :virtual
1067      :getter "gtk_color_selection_get_previous_alpha"
1068      :setter "gtk_color_selection_set_previous_alpha"
1069      :initarg :previous-alpha
1070      :accessor color-selection-previous-alpha
1071      :type (unsigned 16))
1072     (previous-color
1073      :allocation :virtual
1074      :getter color-selection-previous-color
1075      :setter "gtk_color_selection_set_previous_color"
1076      :initarg :previous-color
1077      :writer (setf color-selection-previous-color)
1078      :type gdk:color)))
1079
1080   ("GtkFontSelection"
1081    :slots
1082    ; deprecated property
1083    ((font :ignore t)))
1084
1085   ("GtkClipboard"
1086    :slots
1087    ((display
1088      :allocation :virtual
1089      :getter "gtk_clipboard_get_display"
1090      :reader clipboard-display
1091      :type gdk:display)))
1092
1093   #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
1094   ("GtkIconView"
1095    :slots
1096    ((text-column
1097      :allocation :virtual
1098      :getter %icon-view-get-text-column
1099      :setter %icon-view-set-text-column
1100      :boundp %icon-view-text-column-boundp
1101      :initarg :text-column
1102      :accessor icon-view-text-column)
1103     (markup-column
1104      :allocation :virtual
1105      :getter %icon-view-get-markup-column
1106      :setter %icon-view-set-markup-column
1107      :boundp %icon-view-markup-column-boundp
1108      :initarg :markup-column
1109      :accessor icon-view-markup-column)
1110     (pixbuf-column
1111      :allocation :virtual
1112      :getter %icon-view-get-pixbuf-column
1113      :setter %icon-view-set-pixbuf-column
1114      :boundp %icon-view-pixbuf-column-boundp
1115      :initarg :pixbuf-column
1116      :accessor icon-view-pixbuf-column)))
1117
1118   #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1119   ("GtkAssistant"
1120    :slots
1121    ((current-page 
1122      :allocation :virtual
1123      :getter "gtk_assistant_get_current_page"
1124      :setter "gtk_assistant_set_current_page"
1125      :accessor assistant-current-page
1126      :type int)
1127     (num-pages
1128      :allocation :virtual
1129      :getter "gtk_assistant_get_n_page"
1130      :reader assistant-current-page
1131      :type int)))
1132
1133   #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1134   ("GtkRecentChooser"
1135    :slots
1136    ((current-item
1137      :allocation :virtual
1138      :getter "gtk_recent_chooser_get_current_item"
1139      :reader recent-chooser-current-item
1140      :type recent-info)
1141     (current-uri
1142      :allocation :virtual
1143      :getter "gtk_recent_chooser_get_current_uri"
1144      :setter %recent-chooser-set-current-uri
1145      :accessor recent-chooser-current-uri
1146      :type string)))
1147
1148   ;; Not needed
1149   ("GtkFundamentalType" :ignore t)
1150   ("GtkArgFlags" :ignore t)
1151
1152   
1153   ;; Deprecated widgets
1154   ("GtkCList" :ignore-prefix t)
1155   ("GtkCTree" :ignore-prefix t)
1156   ("GtkList" :ignore t)
1157   ("GtkListItem" :ignore t)
1158   ("GtkTree" :ignore t)
1159   ("GtkTreeItem" :ignore t)
1160   ("GtkItemFactory" :ignore t)
1161   ("GtkText" :ignore t)
1162   ("GtkPacker" :ignore-prefix t)
1163   ("GtkPixmap" :ignore t)
1164   ("GtkPreview" :ignore-prefix t)
1165   ("GtkProgres" :ignore t)
1166   ("GtkTipsQuery" :ignore t)
1167   ("GtkOldEditable" :ignore t)
1168   ("GtkCombo" :ignore t)
1169   ("GtkOptionMenu" :ignore t)
1170   ("GtkFileSelection" :ignore t)
1171   ("GtkInputDialog")
1172
1173   ;; What are these?
1174   ("GtkFileSystemModule" :ignore t)
1175   ("GtkIMModule" :ignore t)
1176   ("GtkThemeEngine" :ignore t))
1177
1178
1179 (defclass text-iter (boxed)
1180   ((buffer
1181     :allocation :virtual
1182     :getter "gtk_text_iter_get_buffer"
1183     :reader text-iter-buffer
1184     :type pointer) ;text-buffer)
1185    (offset
1186     :allocation :virtual
1187     :getter "gtk_text_iter_get_offset"
1188     :setter "gtk_text_iter_set_offset"
1189     :accessor text-iter-offset
1190     :type int)
1191    (line
1192     :allocation :virtual
1193     :getter "gtk_text_iter_get_line"
1194     :setter "gtk_text_iter_set_line"
1195     :accessor text-iter-line
1196     :type int)
1197    (line-offset
1198     :allocation :virtual
1199     :getter "gtk_text_iter_get_line_offset"
1200     :setter "gtk_text_iter_set_line_offset"
1201     :accessor text-iter-line-offset
1202     :type int)
1203    (line-index
1204     :allocation :virtual
1205     :getter "gtk_text_iter_get_line_index"
1206     :setter "gtk_text_iter_set_line_index"
1207     :accessor text-iter-line-index
1208     :type int)
1209    (visible-line-index
1210     :allocation :virtual
1211     :getter "gtk_text_iter_get_visible_line_index"
1212     :setter "gtk_text_iter_set_visible_line_index"
1213     :accessor text-iter-visible-line-index
1214     :type int)
1215    (visible-line-offset
1216     :allocation :virtual
1217     :getter "gtk_text_iter_get_visible_line_offset"
1218     :setter "gtk_text_iter_set_visible_line_offset"
1219     :accessor text-iter-visible-line-offset
1220     :type int))
1221   (:metaclass boxed-class)
1222   (:size #.(* 14 (size-of 'pointer))))
1223
1224
1225 (defclass tooltips-data (struct)
1226   ((tooltips
1227     :allocation :alien
1228     :reader tooltips-data-tooltips
1229     :type tooltips)
1230    (widget
1231     :allocation :alien
1232     :reader tooltips-data-widget
1233     :type widget)
1234    (tip-text
1235     :allocation :alien
1236     :reader tooltips-data-tip-text
1237     :type string)
1238    (tip-private
1239     :allocation :alien
1240     :reader tooltips-data-tip-private
1241     :type string))
1242   (:metaclass struct-class))
1243
1244 (defclass file-filter-info (struct)
1245   ((contains
1246     :allocation :alien 
1247     :initarg :contains
1248     :type file-filter-flags)
1249    (filename 
1250     :allocation :alien 
1251     :initarg :filename
1252     :type string)
1253    (uri 
1254     :allocation :alien 
1255     :initarg :uri
1256     :type string)
1257    (display-name 
1258     :allocation :alien 
1259     :initarg :display-name
1260     :type string)
1261    (mime-type 
1262     :allocation :alien 
1263     :initarg :mime-type
1264     :type string))
1265   (:metaclass struct-class))
1266
1267
1268 (defclass accel-key (struct)
1269   ((key
1270     :allocation :alien
1271     :type unsigned-int)
1272    (modifiers
1273     :allocation :alien
1274     :type gdk:modifier-type)
1275    (flags
1276     :allocation :alien
1277     :type (unsigned 16)))
1278   (:metaclass struct-class))
1279
1280 (defclass accel-group-entry (struct)
1281   ((key
1282     :allocation :alien
1283     :setter nil
1284     :type (inlined accel-key))
1285    (gclosure
1286     :allocation :alien
1287     :type gclosure)
1288    (accel_path_quark
1289     :allocation :alien
1290     :type quark))
1291   (:metaclass struct-class))
1292
1293 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
1294 (define-enum-type drop-position
1295   :no-drop :drop-into :drop-left :drop-right :drop-above :drop-below)
1296
1297
1298 (defclass target-entry (struct)
1299   ((target
1300     :allocation :alien
1301     :accessor target-entry-target
1302     :initarg :target
1303     :type string)
1304    (flags
1305     :allocation :alien
1306     :accessor target-entry-flags
1307     :initarg :flags
1308     :type target-flags)
1309    (id
1310     :allocation :alien
1311     :accessor target-entry-id
1312     :initarg :id
1313     :type unsigned-int))
1314   (:metaclass struct-class))
1315
1316
1317 (defclass selection-data (boxed)
1318   ((selection
1319     :allocation :alien :type gdk:atom
1320     :reader selection-data-selection)
1321    (target
1322     :allocation :alien :type gdk:atom
1323     :reader selection-data-target)
1324    (type
1325     :allocation :alien :type gdk:atom
1326     :reader selection-data-type)
1327    (format 
1328     :allocation :alien :type int
1329     :reader selection-data-format)
1330    (data
1331     :allocation :alien :type pointer
1332     :reader selection-data-data)
1333    (length 
1334     :allocation :alien :type int
1335     :reader selection-data-length)
1336    (display 
1337     :allocation :alien :type gdk:display
1338     :reader selection-data-display))
1339   (:metaclass boxed-class))
1340
1341
1342 #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1343 (defclass target-list (proxy)
1344   ()
1345   (:metaclass proxy-class)
1346   (:ref target-list-ref)
1347   (:unref target-list-unref))
1348
1349 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1350 (defclass target-list (boxed)
1351   ()
1352   (:metaclass boxed-class))