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