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