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