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