Work around for bug in GtkEntryCompletion
[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.58 2007-10-17 16:55:47 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 ;; Need to be manually defined, as this value through the property
682 ;; mechanism doesn't work
683 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
684 (text-column
685 :allocation :virtual
686 :getter "gtk_entry_completion_get_text_column"
687 :setter "gtk_entry_completion_set_text_column"
688 :unbound -1
689 :accessor entry-completion-text-column
690 :type int)))
691
692 ("GtkRadioButton"
693 :slots
694 ((group
695 :allocation :virtual
696 :getter "gtk_radio_button_get_group"
697 :reader radio-button-group
698 :type (copy-of (gslist widget)))
699 (value
700 :allocation :user-data
701 :initarg :value
702 :accessor radio-button-value
703 :documentation "Value passed as argument to the activate callback")))
704
705 ("GtkRadioMenuItem"
706 :slots
707 ((group
708 :allocation :virtual
709 :getter "gtk_radio_menu_item_get_group"
710 :reader radio-menu-item-group
711 :type (copy-of (gslist widget)))
712 (value
713 :allocation :user-data
714 :initarg :value
715 :accessor radio-menu-item-value
716 :documentation "Value passed as argument to the activate callback")))
717
718 ("GtkLayout"
719 :slots
720 ((bin-window
721 :allocation :virtual
722 :getter "gtk_layout_get_bin_window"
723 :reader layout-bin-window
724 :type gdk:window)))
725
726 ("GtkFixed"
727 :slots
728 ((has-window
729 :allocation :virtual
730 :getter "gtk_fixed_get_has_window"
731 :setter "gtk_fixed_set_has_window"
732 :reader fixed-has-window-p
733 :initarg :has-window
734 :type boolean)))
735
736 ("GtkRange"
737 :slots
738 ((value
739 :allocation :virtual
740 :getter "gtk_range_get_value"
741 :setter "gtk_range_set_value"
742 :initarg :value
743 :accessor range-value
744 :type double-float)
745 (upper
746 :allocation :virtual
747 :getter range-upper
748 :setter (setf range-upper)
749 :initarg :upper)
750 (lower
751 :allocation :virtual
752 :getter range-lower
753 :setter (setf range-lower)
754 :initarg :lower)
755 (step-increment
756 :allocation :virtual
757 :getter range-step-increment
758 :setter (setf range-step-increment)
759 :initarg :step-increment)
760 (page-increment
761 :allocation :virtual
762 :getter range-page-increment
763 :setter (setf range-page-increment)
764 :initarg :page-increment)))
765
766 ("GtkImage"
767 :slots
768 ((file :ignore t)
769 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
770 (pixel-size :merge t :unbound -1)))
771
772 ("GtkLabel"
773 :slots
774 ((layout
775 :allocation :virtual
776 :getter "gtk_label_get_layout"
777 :reader label-layout
778 :type pango:layout)))
779
780 ("GtkScale"
781 :slots
782 ((layout
783 :allocation :virtual
784 :getter "gtk_scale_get_layout"
785 :reader scale-layout
786 :type pango:layout)))
787
788 ("GtkEditable"
789 :slots
790 ((editable
791 :allocation :virtual
792 :getter "gtk_editable_get_editable"
793 :setter "gtk_editable_set_editable"
794 :reader editable-editable-p
795 :initarg :editable
796 :type boolean)
797 (position
798 :allocation :virtual
799 :getter "gtk_editable_get_position"
800 :setter "gtk_editable_set_position"
801 :reader editable-position
802 :initarg :position
803 :type position)
804 (text
805 :allocation :virtual
806 :getter editable-text
807 :setter (setf editable-text)
808 :initarg text)))
809
810 ("GtkFileChooser"
811 :slots
812 ((filename
813 :allocation :virtual
814 :getter "gtk_file_chooser_get_filename"
815 :setter "gtk_file_chooser_set_filename"
816 :accessor file-chooser-filename
817 :initarg :filename
818 :type string)
819 (current-name
820 :allocation :virtual
821 :setter "gtk_file_chooser_set_current_name"
822 :accessor file-chooser-current-name
823 :initarg :current-name
824 :type string)
825 (current-folder
826 :allocation :virtual
827 :setter "gtk_file_chooser_set_current_folder"
828 :setter "gtk_file_chooser_get_current_folder"
829 :accessor file-chooser-current-folder
830 :initarg :current-folder
831 :type string)
832 (uri
833 :allocation :virtual
834 :getter "gtk_file_chooser_get_uri"
835 :setter "gtk_file_chooser_set_uri"
836 :accessor file-chooser-uri
837 :initarg :uri
838 :type string)
839 (current-folder-uri
840 :allocation :virtual
841 :setter "gtk_file_chooser_set_current_folder_uri"
842 :setter "gtk_file_chooser_get_current_folder_uri"
843 :accessor file-chooser-current-folder-uri
844 :initarg :current-folder-uri
845 :type string)))
846
847 ("GtkFileFilter"
848 :slots
849 ((name
850 :allocation :virtual
851 :getter "gtk_file_filter_get_name"
852 :setter "gtk_file_filter_set_name"
853 :accessor file-filter-name
854 :initarg :name
855 :type string)))
856
857 ("GtkTreeView"
858 :slots
859 ((columns
860 :allocation :virtual
861 :getter "gtk_tree_view_get_columns"
862 :reader tree-view-columns
863 :type (glist tree-view-column))
864 (selection
865 :allocation :virtual
866 :getter "gtk_tree_view_get_selection"
867 :reader tree-view-selection
868 :type tree-selection)))
869
870 ("GtkTreeModel"
871 :slots
872 ((n-columns
873 :allocation :virtual
874 :getter "gtk_tree_model_get_n_columns"
875 :reader tree-model-n-columns
876 :type int)))
877
878 ("GtkTreeSelection"
879 :slots
880 ((mode
881 :allocation :virtual
882 :getter "gtk_tree_selection_get_mode"
883 :setter "gtk_tree_selection_set_mode"
884 :accessor tree-selection-mode
885 :initarg :mode
886 :type selection-mode)
887 (tree-view
888 :allocation :virtual
889 :getter "gtk_tree_selection_get_tree_view"
890 :reader tree-selection-tree-view
891 :type tree-view)))
892
893 ("GtkComboBox"
894 :slots
895 ((active-iter
896 :allocation :virtual
897 :getter "gtk_combo_box_get_active_iter"
898 :setter "gtk_combo_box_set_active_iter"
899 :accessor combo-box-active-iter
900 :type tree-iter)))
901
902 ("GtkTextBuffer"
903 :slots
904 ((line-count
905 :allocation :virtual
906 :getter "gtk_text_buffer_get_line_count"
907 :reader text-buffer-line-count
908 :type int)
909 (char-count
910 :allocation :virtual
911 :getter "gtk_text_buffer_get_char_count"
912 :reader text-buffer-char-count
913 :type int)
914 (modified
915 :allocation :virtual
916 :getter "gtk_text_buffer_get_modified"
917 :setter "gtk_text_buffer_set_modified"
918 :accessor text-buffer-modifed-p
919 :type boolean)))
920
921 ("GtkTextView"
922 :slots
923 ((default-attributes
924 :allocation :virtual
925 :getter "gtk_text_view_get_default_attributes"
926 :reader text-view-default-attributes
927 :type text-attributes)))
928
929 ("GtkTextTagTable"
930 :slots
931 ((size
932 :allocation :virtual
933 :getter "gtk_text_tag_table_get_size"
934 :reader text-tag-table-size
935 :type int)))
936
937 ("GtkTextTag"
938 :slots
939 ((priority
940 :allocation :virtual
941 :getter "gtk_text_tag_get_priority"
942 :setter "gtk_text_tag_set_priority"
943 :accessor text-tag-priority
944 :type int)
945 (weight
946 :merge t :type pango:weight)))
947
948 ("GtkTextMark"
949 :slots
950 ((buffer
951 :allocation :virtual
952 :getter "gtk_text_mark_get_buffer"
953 :reader text-mark-buffer
954 :type text-buffer)
955 (name
956 :allocation :virtual
957 :getter "gtk_text_mark_get_name"
958 :reader text-mark-name
959 :type (copy-of string))
960 (visible
961 :allocation :virtual
962 :getter "gtk_text_mark_get_visible"
963 :setter "gtk_text_mark_set_visible"
964 :accessor text-mark-visible-p
965 :type boolean)
966 (deleted
967 :allocation :virtual
968 :getter "gtk_text_mark_get_deleted"
969 :reader text-mark-deleted-p
970 :type boolean)
971 (left-gravity
972 :allocation :virtual
973 :getter "gtk_text_mark_get_left_gravity"
974 :reader text-mark-left-gravity-p
975 :type boolean)))
976
977 ("GtkUIManager"
978 :type ui-manager
979 :slots
980 ((action-groups
981 :allocation :virtual
982 :getter "gtk_ui_manager_get_action_groups"
983 :reader ui-manager-action-groups
984 :type (copy-of (glist action-group)))
985 (accel-group
986 :allocation :virtual
987 :getter "gtk_ui_manager_get_accel_group"
988 :reader ui-manager-accel-group
989 :type accel-group)))
990
991 ("GtkUIManagerItemType"
992 :type ui-manager-item-type)
993
994 ("GtkAction"
995 :slots
996 ((accelerator
997 :allocation :user-data :initarg :accelerator
998 :reader action-accelerator)))
999
1000 #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1001 ("GtkToggleAction"
1002 :slots
1003 ((active
1004 :allocation :virtual
1005 :getter "gtk_toggle_action_get_active"
1006 :setter "gtk_toggle_action_set_active"
1007 ; :initarg :active ;; Handled by initialize-instance
1008 :accessor toggle-action-active-p
1009 :type boolean)))
1010
1011 ("GtkRadioAction"
1012 :slots
1013 ((group
1014 :allocation :virtual
1015 :getter "gtk_radio_button_get_group"
1016 :reader radio-action-group
1017 :type (copy-of (gslist widget)))
1018 (self
1019 :allocation :property :pname "value" :type int
1020 :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.")
1021 (value
1022 :allocation :user-data :initarg :value :accessor radio-action-value)
1023 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1024 ;; Use radio-action-get-current-value to get the current value of
1025 ;; a radio action group
1026 (current-value :ignore t)))
1027
1028 ("GtkColorSelection"
1029 :slots
1030 ((previous-alpha
1031 :allocation :virtual
1032 :getter "gtk_color_selection_get_previous_alpha"
1033 :setter "gtk_color_selection_get_previous_alpha"
1034 :initarg :previous-alpha
1035 :accessor color-selection-previous-alpha
1036 :type (unsigned 16))
1037 (previous-color
1038 :allocation :virtual
1039 :getter "gtk_color_selection_get_previous_color"
1040 :setter "gtk_color_selection_get_previous_color"
1041 :initarg :previous-color
1042 :accessor color-selection-previous-color
1043 :type gdk:color)))
1044
1045 ("GtkFontSelection"
1046 :slots
1047 ; deprecated property
1048 ((font :ignore t)))
1049
1050 ("GtkClipboard"
1051 :slots
1052 ((display
1053 :allocation :virtual
1054 :getter "gtk_clipboard_get_display"
1055 :reader clipboard-display
1056 :type gdk:display)))
1057
1058 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
1059 ("GtkIconView"
1060 :slots
1061 ((text-column
1062 :allocation :virtual
1063 :getter %icon-view-get-text-column
1064 :setter %icon-view-set-text-column
1065 :boundp %icon-view-text-column-boundp
1066 :initarg :text-column
1067 :accessor icon-view-text-column)
1068 (markup-column
1069 :allocation :virtual
1070 :getter %icon-view-get-markup-column
1071 :setter %icon-view-set-tmarkup-column
1072 :boundp %icon-view-markup-column-boundp
1073 :initarg :markup-column
1074 :accessor icon-view-markup-column)
1075 (pixbuf-column
1076 :allocation :virtual
1077 :getter %icon-view-get-pixbuf-column
1078 :setter %icon-view-set-pixbuf-column
1079 :boundp %icon-view-pixbuf-column-boundp
1080 :initarg :pixbuf-column
1081 :accessor icon-view-pixbuf-column)))
1082
1083 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1084 ("GtkAssistant"
1085 :slots
1086 ((current-page
1087 :allocation :virtual
1088 :getter "gtk_assistant_get_current_page"
1089 :setter "gtk_assistant_set_current_page"
1090 :accessor assistant-current-page
1091 :type int)
1092 (num-pages
1093 :allocation :virtual
1094 :getter "gtk_assistant_get_n_page"
1095 :reader assistant-current-page
1096 :type int)))
1097
1098 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1099 ("GtkRecentChooser"
1100 :slots
1101 ((current-item
1102 :allocation :virtual
1103 :getter "gtk_recent_chooser_get_current_item"
1104 :reader recent-chooser-current-item
1105 :type recent-info)
1106 (current-uri
1107 :allocation :virtual
1108 :getter "gtk_recent_chooser_get_current_uri"
1109 :setter %recent-chooser-set-current-uri
1110 :accessor recent-chooser-current-uri
1111 :type string)))
1112
1113 ;; Not needed
1114 ("GtkFundamentalType" :ignore t)
1115 ("GtkArgFlags" :ignore t)
1116
1117
1118 ;; Deprecated widgets
1119 ("GtkCList" :ignore-prefix t)
1120 ("GtkCTree" :ignore-prefix t)
1121 ("GtkList" :ignore t)
1122 ("GtkListItem" :ignore t)
1123 ("GtkTree" :ignore t)
1124 ("GtkTreeItem" :ignore t)
1125 ("GtkItemFactory" :ignore t)
1126 ("GtkText" :ignore t)
1127 ("GtkPacker" :ignore-prefix t)
1128 ("GtkPixmap" :ignore t)
1129 ("GtkPreview" :ignore-prefix t)
1130 ("GtkProgres" :ignore t)
1131 ("GtkTipsQuery" :ignore t)
1132 ("GtkOldEditable" :ignore t)
1133 ("GtkCombo" :ignore t)
1134 ("GtkOptionMenu" :ignore t)
1135 ("GtkFileSelection" :ignore t)
1136 ("GtkInputDialog")
1137
1138 ;; What are these?
1139 ("GtkFileSystemModule" :ignore t)
1140 ("GtkIMModule" :ignore t)
1141 ("GtkThemeEngine" :ignore t))
1142
1143
1144 (defclass text-iter (boxed)
1145 ((buffer
1146 :allocation :virtual
1147 :getter "gtk_text_iter_get_buffer"
1148 :reader text-iter-buffer
1149 :type pointer) ;text-buffer)
1150 (offset
1151 :allocation :virtual
1152 :getter "gtk_text_iter_get_offset"
1153 :setter "gtk_text_iter_set_offset"
1154 :accessor text-iter-offset
1155 :type int)
1156 (line
1157 :allocation :virtual
1158 :getter "gtk_text_iter_get_line"
1159 :setter "gtk_text_iter_set_line"
1160 :accessor text-iter-line
1161 :type int)
1162 (line-offset
1163 :allocation :virtual
1164 :getter "gtk_text_iter_get_line_offset"
1165 :setter "gtk_text_iter_set_line_offset"
1166 :accessor text-iter-line-offset
1167 :type int)
1168 (line-index
1169 :allocation :virtual
1170 :getter "gtk_text_iter_get_line_index"
1171 :setter "gtk_text_iter_set_line_index"
1172 :accessor text-iter-line-index
1173 :type int)
1174 (visible-line-index
1175 :allocation :virtual
1176 :getter "gtk_text_iter_get_visible_line_index"
1177 :setter "gtk_text_iter_set_visible_line_index"
1178 :accessor text-iter-visible-line-index
1179 :type int)
1180 (visible-line-offset
1181 :allocation :virtual
1182 :getter "gtk_text_iter_get_visible_line_offset"
1183 :setter "gtk_text_iter_set_visible_line_offset"
1184 :accessor text-iter-visible-line-offset
1185 :type int))
1186 (:metaclass boxed-class)
1187 (:size #.(* 14 (size-of 'pointer))))
1188
1189
1190 (defclass tooltips-data (struct)
1191 ((tooltips
1192 :allocation :alien
1193 :reader tooltips-data-tooltips
1194 :type tooltips)
1195 (widget
1196 :allocation :alien
1197 :reader tooltips-data-widget
1198 :type widget)
1199 (tip-text
1200 :allocation :alien
1201 :reader tooltips-data-tip-text
1202 :type string)
1203 (tip-private
1204 :allocation :alien
1205 :reader tooltips-data-tip-private
1206 :type string))
1207 (:metaclass struct-class))
1208
1209 (defclass file-filter-info (struct)
1210 ((contains
1211 :allocation :alien
1212 :initarg :contains
1213 :type file-filter-flags)
1214 (filename
1215 :allocation :alien
1216 :initarg :filename
1217 :type string)
1218 (uri
1219 :allocation :alien
1220 :initarg :uri
1221 :type string)
1222 (display-name
1223 :allocation :alien
1224 :initarg :display-name
1225 :type string)
1226 (mime-type
1227 :allocation :alien
1228 :initarg :mime-type
1229 :type string))
1230 (:metaclass struct-class))
1231
1232
1233 (defclass accel-key (struct)
1234 ((key
1235 :allocation :alien
1236 :type unsigned-int)
1237 (modifiers
1238 :allocation :alien
1239 :type gdk:modifier-type)
1240 (flags
1241 :allocation :alien
1242 :type (unsigned 16)))
1243 (:metaclass struct-class))
1244
1245 (defclass accel-group-entry (struct)
1246 ((key
1247 :allocation :alien
1248 :setter nil
1249 :type (inlined accel-key))
1250 (gclosure
1251 :allocation :alien
1252 :type gclosure)
1253 (accel_path_quark
1254 :allocation :alien
1255 :type quark))
1256 (:metaclass struct-class))
1257
1258 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
1259 (define-enum-type drop-position
1260 :no-drop :drop-into :drop-left :drop-right :drop-above :drop-below)
1261
1262
1263 (defclass target-entry (struct)
1264 ((target
1265 :allocation :alien
1266 :accessor target-entry-target
1267 :initarg :target
1268 :type string)
1269 (flags
1270 :allocation :alien
1271 :accessor target-entry-flags
1272 :initarg :flags
1273 :type target-flags)
1274 (id
1275 :allocation :alien
1276 :accessor target-entry-id
1277 :initarg :id
1278 :type unsigned-int))
1279 (:metaclass struct-class))
1280
1281
1282 (defclass selection-data (boxed)
1283 ((selection
1284 :allocation :alien :type gdk:atom
1285 :reader selection-data-selection)
1286 (target
1287 :allocation :alien :type gdk:atom
1288 :reader selection-data-target)
1289 (type
1290 :allocation :alien :type gdk:atom
1291 :reader selection-data-type)
1292 (format
1293 :allocation :alien :type int
1294 :reader selection-data-format)
1295 (data
1296 :allocation :alien :type pointer
1297 :reader selection-data-data)
1298 (length
1299 :allocation :alien :type int
1300 :reader selection-data-length)
1301 (display
1302 :allocation :alien :type gdk:display
1303 :reader selection-data-display))
1304 (:metaclass boxed-class))
1305
1306
1307 #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1308 (defclass target-list (proxy)
1309 ()
1310 (:metaclass proxy-class)
1311 (:ref target-list-ref)
1312 (:unref target-list-unref))
1313
1314 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1315 (defclass target-list (boxed)
1316 ()
1317 (:metaclass boxed-class))