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