chiark / gitweb /
Added bindings for Gtk 2.8
[clg] / gtk / gtktypes.lisp
CommitLineData
112ac1d3 1;; Common Lisp bindings for GTK+ v2.x
2;; Copyright 1999-2005 Espen S. Johnsen <espen@users.sf.net>
560af5c5 3;;
112ac1d3 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:
560af5c5 11;;
112ac1d3 12;; The above copyright notice and this permission notice shall be
13;; included in all copies or substantial portions of the Software.
560af5c5 14;;
112ac1d3 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.
560af5c5 22
bdc0e300 23;; $Id: gtktypes.lisp,v 1.39 2005-09-26 21:34:53 espen Exp $
560af5c5 24
25(in-package "GTK")
26
2719586f 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))
1047e159 38 (:metaclass boxed-class))
39
2719586f 40
e6d40e16 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))
9adccb27 62 (:metaclass struct-class))
e6d40e16 63
2719586f 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))
1047e159 85 (:metaclass boxed-class))
2719586f 86
f5b67f2b 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))
5e17fb78 113 (:metaclass struct-class))
f5b67f2b 114
2a8752b0 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
f4175703 130(deftype tree-path () '(vector integer))
dfa4f314 131(register-type 'tree-path '|gtk_tree_path_get_type|)
2a8752b0 132
68f519e0 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))
d76e9fca 139
2719586f 140(define-types-by-introspection "Gtk"
141 ;; Manually defined
142 ("GtkObject" :ignore t)
143 ("GtkRequisition" :ignore t)
144 ("GtkBorder" :ignore t)
2a8752b0 145 ("GtkTreeIter" :ignore t)
146 ("GtkTreePath" :ignore t)
aa77651b 147; ("GtkStyle" :ignore t)
1047e159 148
5b51dee1 149 ;; Manual override
150 ("GtkWidget"
151 :slots
c289d084 152 ((child-properties
1047e159 153 :allocation :instance
c289d084 154 :accessor widget-child-properties
1047e159 155 :type container-child)
5b51dee1 156 (window
157 :allocation :virtual
158 :getter "gtk_widget_get_window"
159 :reader widget-window
160 :type gdk:window)
c2a12566 161 (parent :merge t :initarg nil)
162 (visible :merge t :initarg nil)
68f519e0 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)
5b51dee1 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"
e6d40e16 180 :setter "gtk_widget_set_colormap"
181 :initarg :colormap
182 :accessor widget-colormap
5b51dee1 183 :type gdk:colormap)
184 (visual
185 :allocation :virtual
186 :getter "gtk_widget_get_visual"
187 :reader widget-visual
e6d40e16 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
68f519e0 202 :type (copy-of string)) ; will leak the string when setting
e6d40e16 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
aa77651b 214 :type boolean)
215 (width-request
216 :merge t :unbound -1)
217 (height-request
218 :merge t :unbound -1)))
e6d40e16 219
5b51dee1 220 ("GtkContainer"
221 :slots
d76e9fca 222 ((child :ignore t)
5b51dee1 223 (children
224 :allocation :virtual
225 :getter container-children
d76e9fca 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
cb4bf772 235 :getter "gtk_container_child_type"
d76e9fca 236 :reader container-child-type
237 :type gtype)
5b51dee1 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)
e6d40e16 245 (focus-chain
246 :allocation :virtual
247 :getter container-focus-chain
248 :setter (setf container-focus-chain))
5b51dee1 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
d76e9fca 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)))
5b51dee1 270
271 ("GtkBin"
272 :slots
273 ((child
274 :allocation :virtual
56460319 275 :getter "gtk_bin_get_child"
276 :setter (setf bin-child)
277 :reader bin-child
278 :type widget)))
3f73963b 279
280 ("GtkWindow"
281 :slots
4d16221f 282 ((focus-widget
3f73963b 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)
3f73963b 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)
4d16221f 303 (icon-list
3f73963b 304 :allocation :virtual
4d16221f 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))
3f73963b 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
4d16221f 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)))
5b51dee1 333
4d16221f 334 ("GtkWindowGroup"
335 :slots
336 ((grabs
337 :allocation :alien
338 :accessor window-group-grabs
339 :type (gslist window))))
340
5b51dee1 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
5b51dee1 351 ("GtkMenuItem"
352 :slots
353 ((label
354 :allocation :virtual
f5b67f2b 355 :getter menu-item-label
356 :setter (setf menu-item-label)
5b51dee1 357 :type string)
d76e9fca 358 (use-underline
359 :allocation :user-data
360 :initform nil
361 :initarg :use-underline
362 :accessor menu-item-use-underline-p)
f5b67f2b 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)
5b51dee1 370 (submenu
371 :allocation :virtual
372 :getter "gtk_menu_item_get_submenu"
d76e9fca 373 :setter "gtk_menu_item_set_submenu"
374 :accessor menu-item-submenu
5b51dee1 375 :initarg :submenu
d76e9fca 376 :type widget)))
5b51dee1 377
bdc0e300 378 ("GtkMenuShell"
379 :slots
380 ((take-focus-p
381 :allocation :virtual
382 :getter "gtk_menu_shell_get_take_focus"
383 :setter "gtk_menu_shell_set_take_focus"
384 :accessor menu-shell-take-focus-p
385 :type boolean)))
386
5b51dee1 387 ("GtkColorSelectionDialog"
388 :slots
389 ((colorsel
390 :allocation :alien
391 :reader color-selection-dialog-colorsel
392 :type widget)
393 (ok-button
394 :allocation :alien
395 :reader color-selection-dialog-ok-button
396 :type widget)
397 (cancel-button
398 :allocation :alien
399 :reader color-selection-dialog-cancel-button
400 :type widget)
401 (help-button
402 :allocation :alien
403 :reader color-selection-dialog-help-button
404 :type widget)))
405
406 ("GtkScrolledWindow"
407 :slots
bdc0e300 408 (#-gtk2.8
409 (hscrollbar
410 :allocation :alien
5b51dee1 411 :reader scrolled-window-hscrollbar
412 :type widget)
bdc0e300 413 #-gtk2.8
5b51dee1 414 (vscrollbar
415 :allocation :alien
416 :reader scrolled-window-vscrollbar
bdc0e300 417 :type widget)
418 #+gtk2.8
419 (hscrollbar
420 :allocation :virtual
421 :getter "gtk_scrolled_window_get_hscrollbar"
422 :reader scrolled-window-hscrollbar
423 :type widget)
424 #+gtk2.8
425 (vscrollbar
426 :allocation :virtual
427 :getter "gtk_scrolled_window_get_hscrollbar"
428 :reader scrolled-window-vscrollbar
5b51dee1 429 :type widget)))
560af5c5 430
5b51dee1 431 ("GtkPaned"
1047e159 432 :slots
5b51dee1 433 ((child1
560af5c5 434 :allocation :virtual
1dd03ab8 435 :getter "gtk_paned_get_child1"
436 :setter "gtk_paned_add1"
437 :accessor paned-child1
5b51dee1 438 :initarg :child1
560af5c5 439 :type widget)
5b51dee1 440 (child2
2d379b6a 441 :allocation :virtual
1dd03ab8 442 :getter "gtk_paned_get_child2"
443 :setter "gtk_paned_add2"
444 :accessor paned-child2
5b51dee1 445 :initarg :child2
446 :type widget)))
560af5c5 447
5b51dee1 448 ("GtkMenu"
449 :slots
450 ((accel-group
451 :allocation :virtual
452 :getter "gtk_menu_get_accel_group"
453 :setter "gtk_menu_set_accel_group"
454 :accessor menu-accel-group
455 :initarg :accel-group
456 :type accel-group)
457 (active
458 :allocation :virtual
459 :getter "gtk_menu_get_active"
460 :setter (setf menu-active)
461 :reader menu-active
462 :initarg :active
463 :type widget)
d76e9fca 464 (screen
465 :allocation :virtual
466 :getter "gtk_menu_get_screen"
467 :setter "gtk_menu_set_screen"
468 :accessor menu-screen
469 :initarg :screen
470 :type gdk:screen)
471 (attach-widget
472 :allocation :virtual
473 :getter "gtk_menu_get_attach_widget"
474 :reader menu-attach-widget
475 :type widget)
476 #-gtk2.6
477 (tearoff-state
5b51dee1 478 :allocation :virtual
479 :getter "gtk_menu_get_tearoff_state"
480 :setter "gtk_menu_set_tearoff_state"
d76e9fca 481 :accessor menu-tearoff-state-p
482 :initarg :tearoff-state
5b51dee1 483 :type boolean)))
484
485 ("GtkToolbar"
486 :slots
cb4bf772 487 ((show-tooltips
5b51dee1 488 :allocation :virtual
489 :getter "gtk_toolbar_get_tooltips"
490 :setter "gtk_toolbar_set_tooltips"
cb4bf772 491 :accessor toolbar-show-tooltips-p
492 :initarg :show-tooltips
5b51dee1 493 :type boolean)
cb4bf772 494 (tooltips
5b51dee1 495 :allocation :virtual
cb4bf772 496 :getter "gtk_toolbar_get_tooltips_object"
497 :reader toolbar-tooltips
498 :type tooltips)
1047e159 499 (toolbar-style
500 :allocation :property
501 :pname "toolbar-style"
502 :initarg :toolbar-style
503 :accessor toolbar-style
cb4bf772 504 :type toolbar-style)
505 (n-items
506 :allocation :virtual
507 :getter "gtk_toolbar_get_n_items"
508 :reader toolbar-n-items
509 :type int)))
5b51dee1 510
d76e9fca 511 ("GtkToolItem"
512 :slots
cb4bf772 513 ((use-drag-window
d76e9fca 514 :allocation :virtual
cb4bf772 515 :getter "gtk_tool_item_get_use_drag_window"
516 :setter "gtk_tool_item_set_use_drag_window"
517 :accessor tool-item-use-drag-window-p
d76e9fca 518 :initarg :drag-window
cb4bf772 519 :type boolean)
520 (tip-text
521 :allocation :user-data
522 :setter (setf tool-item-tip-text)
523 :initarg :tip-text
524 :reader tool-item-tip-text)
525 (tip-private
526 :allocation :user-data
527 :setter (setf tool-item-tip-private)
528 :initarg :tip-private
529 :reader tool-item-tip-private)))
530
531 ("GtkToolButton"
532 :slots
533 ((stock-id :merge t :initarg :stock)
534 (icon-widget :merge t :initarg :icon)))
d76e9fca 535
536 ("GtkToggleToolButton"
537 :slots
538 ((active
539 :allocation :virtual
540 :getter "gtk_toggle_tool_button_get_active"
541 :setter "gtk_toggle_tool_button_get_active"
542 :accessor toggle-tool-button-active-p
543 :initarg :active
544 :type boolean)))
545
546 ("GtkRadioToolButton"
547 :slots
548 ((group
549 :allocation :virtual
550 :getter "gtk_radio_tool_button_get_group"
551 :reader radio-tool-button-group
cb4bf772 552 :type (copy-of (gslist widget)))
553 (value
554 :allocation :user-data
555 :initarg :value
556 :accessor radio-tool-button-value
557 :documentation "Value passed as argument to the activate callback")))
d76e9fca 558
f5b67f2b 559 ("GtkNotebook"
560 :slots
561 ((current-page
562 :allocation :virtual
68f519e0 563 :getter %notebook-current-page
f5b67f2b 564 :setter (setf notebook-current-page)
68f519e0 565 :reader notebook-current-page
566 :type widget
f5b67f2b 567 :initarg :current-page)
68f519e0 568 (current-page-num
569 :allocation :virtual
570 :getter "gtk_notebook_get_current_page"
571 :setter "gtk_notebook_set_current_page"
572 :unbound -1
573 :initarg :current-page-num
574 :accessor notebook-current-page-num
575 :type position)))
f5b67f2b 576
5b51dee1 577 ("GtkRuler"
578 :slots
579 ((metric
580 :allocation :virtual
581 :getter "gtk_ruler_get_metric"
582 :setter "gtk_ruler_set_metric"
583 :accessor ruler-metric
584 :initarg :metric
585 :type metric-type)))
586
587 ("GtkProgressBar"
588 :slots
589 ; deprecated properties
590 ((bar-style :ignore t)
591 (adjustment :ignore t)
592 (activity-step :ignore t)
593 (activity-blocks :ignore t)
594 (discrete-blocks :ignore t)))
595
d76e9fca 596 ("GtkHandleBox"
597 :slots
598 ; deprecated property
599 ((shadow :ignore t)))
600
601 ("GtkFrame"
602 :slots
603 ; deprecated property
604 ((shadow :ignore t)))
605
5b51dee1 606 ("GtkTable"
607 :slots
608 ((column-spacing
609 :allocation :virtual
610 :getter "gtk_table_get_default_col_spacing"
611 :setter "gtk_table_set_col_spacings"
612 :initarg :column-spacing
613 :type unsigned-int)
614 (row-spacing
615 :allocation :virtual
616 :getter "gtk_table_get_default_row_spacing"
617 :setter "gtk_table_set_row_spacings"
618 :initarg :row-spacing
619 :type unsigned-int)))
620
621 ("GtkDialog"
622 :slots
1047e159 623 ((vbox
5b51dee1 624 :allocation :virtual
625 :getter "gtk_dialog_get_vbox"
1047e159 626 :reader dialog-vbox
5b51dee1 627 :type widget)
628 (action-area
629 :allocation :virtual
630 :getter "gtk_dialog_get_action_area"
631 :reader dialog-action-area
632 :type widget)))
2ed3bebb 633
d76e9fca 634 ("GtkEntry"
5b51dee1 635 :slots
d76e9fca 636 ((layout
5b51dee1 637 :allocation :virtual
d76e9fca 638 :getter "gtk_entry_get_layout"
639 :reader entry-layout
640 :type pango:layout)
641 (completion
642 :getter "gtk_entry_get_completion"
643 :setter "gtk_entry_set_completion"
644 :initarg :completion
645 :accessor entry-completion
646 :type entry-completion)
647 (max-length :merge t :unbound 0)
648 #+gtk2.6
647c99e5 649 (width-chars :merge t :unbound -1)))
d76e9fca 650
f45fd227 651 ("GtkEntryCompletion"
652 :slots
653 ((entry
654 :allocation :virtual
655 :getter "gtk_entry_completion_get_entry"
656 :reader entry-completion-entry
657 :type entry)
d76e9fca 658 (minimum-key-length :merge t :unbound -1)
f45fd227 659 #+gtk2.6
d76e9fca 660 (text-column :merge t :unbound -1)))
f45fd227 661
5b51dee1 662 ("GtkRadioButton"
663 :slots
664 ((group
665 :allocation :virtual
666 :getter "gtk_radio_button_get_group"
667 :reader radio-button-group
cb4bf772 668 :type (copy-of (gslist widget)))
669 (value
670 :allocation :user-data
671 :initarg :value
672 :accessor radio-button-value
673 :documentation "Value passed as argument to the activate callback")))
d520140e 674
5b51dee1 675 ("GtkRadioMenuItem"
676 :slots
677 ((group
678 :allocation :virtual
679 :getter "gtk_radio_menu_item_get_group"
680 :reader radio-menu-item-group
cb4bf772 681 :type (copy-of (gslist widget)))
682 (value
683 :allocation :user-data
684 :initarg :value
685 :accessor radio-menu-item-value
686 :documentation "Value passed as argument to the activate callback")))
560af5c5 687
5b51dee1 688 ("GtkLayout"
689 :slots
690 ((bin-window
1047e159 691 :allocation :virtual
5b51dee1 692 :getter "gtk_layout_get_bin_window"
693 :reader layout-bin-window
f784870f 694 :type gdk:window)))
f5b67f2b 695
696 ("GtkFixed"
697 :slots
698 ((has-window
1047e159 699 :allocation :virtual
f5b67f2b 700 :getter "gtk_fixed_get_has_window"
701 :setter "gtk_fixed_set_has_window"
702 :reader fixed-has-window-p
703 :initarg :has-window
704 :type boolean)))
1047e159 705
706 ("GtkRange"
707 :slots
708 ((value
709 :allocation :virtual
710 :getter "gtk_range_get_value"
711 :setter "gtk_range_set_value"
712 :initarg :value
713 :accessor range-value
714 :type double-float)
715 (upper
716 :allocation :virtual
717 :getter range-upper
718 :setter (setf range-upper)
719 :initarg :upper)
720 (lower
721 :allocation :virtual
722 :getter range-lower
723 :setter (setf range-lower)
724 :initarg :lower)
725 (step-increment
726 :allocation :virtual
727 :getter range-step-increment
728 :setter (setf range-step-increment)
729 :initarg :step-increment)
730 (page-increment
731 :allocation :virtual
732 :getter range-page-increment
733 :setter (setf range-page-increment)
734 :initarg :page-increment)))
735
736 ("GtkImage"
737 :slots
d76e9fca 738 ((file :ignore t)
739 #+gtk2.6
740 (pixel-size :merge t :unbound -1)))
741
742 ("GtkLabel"
743 :slots
744 ((layout
745 :allocation :virtual
746 :getter "gtk_label_get_layout"
747 :reader label-layout
748 :type pango:layout)))
749
68f519e0 750 ("GtkScale"
751 :slots
752 ((layout
753 :allocation :virtual
754 :getter "gtk_scale_get_layout"
755 :reader scale-layout
756 :type pango:layout)))
757
1047e159 758 ("GtkEditable"
759 :slots
760 ((editable
761 :allocation :virtual
762 :getter "gtk_editable_get_editable"
763 :setter "gtk_editable_set_editable"
764 :reader editable-editable-p
765 :initarg :editable
766 :type boolean)
767 (position
768 :allocation :virtual
769 :getter "gtk_editable_get_position"
770 :setter "gtk_editable_set_position"
771 :reader editable-position
772 :initarg :position
cb4bf772 773 :type position)
1047e159 774 (text
775 :allocation :virtual
776 :getter editable-text
777 :setter (setf editable-text)
778 :initarg text)))
779
780 ("GtkFileChooser"
781 :slots
782 ((filename
783 :allocation :virtual
784 :getter "gtk_file_chooser_get_filename"
785 :setter "gtk_file_chooser_set_filename"
786 :accessor file-chooser-filename
787 :initarg :filename
788 :type string)
789 (current-name
790 :allocation :virtual
791 :setter "gtk_file_chooser_set_current_name"
68f519e0 792 :accessor file-chooser-current-name
1047e159 793 :initarg :current-name
794 :type string)
795 (current-folder
796 :allocation :virtual
797 :setter "gtk_file_chooser_set_current_folder"
798 :setter "gtk_file_chooser_get_current_folder"
68f519e0 799 :accessor file-chooser-current-folder
1047e159 800 :initarg :current-folder
801 :type string)
802 (uri
803 :allocation :virtual
804 :getter "gtk_file_chooser_get_uri"
805 :setter "gtk_file_chooser_set_uri"
68f519e0 806 :accessor file-chooser-uri
1047e159 807 :initarg :uri
808 :type string)
809 (current-folder-uri
810 :allocation :virtual
811 :setter "gtk_file_chooser_set_current_folder_uri"
812 :setter "gtk_file_chooser_get_current_folder_uri"
68f519e0 813 :accessor file-chooser-current-folder-uri
1047e159 814 :initarg :current-folder-uri
815 :type string)))
816
68f519e0 817 ("GtkFileFilter"
818 :slots
819 ((name
820 :allocation :virtual
821 :getter "gtk_file_filter_get_name"
822 :setter "gtk_file_filter_set_name"
823 :accessor file-filter-name
824 :initarg :name
825 :type string)))
826
1a1949c7 827 ("GtkTreeView"
828 :slots
829 ((columns
830 :allocation :virtual
831 :getter "gtk_tree_view_get_columns"
832 :reader tree-view-columns
f4175703 833 :type (glist tree-view-column))
834 (selection
835 :allocation :virtual
836 :getter "gtk_tree_view_get_selection"
837 :reader tree-view-selection
838 :type tree-selection)))
1a1949c7 839
2a8752b0 840 ("GtkTreeModel"
841 :slots
842 ((n-columns
843 :allocation :virtual
844 :getter "gtk_tree_model_get_n_columns"
845 :reader tree-model-n-columns
846 :type int)))
847
f4175703 848 ("GtkTreeSelection"
849 :slots
850 ((mode
851 :allocation :virtual
852 :getter "gtk_tree_selection_get_mode"
853 :setter "gtk_tree_selection_set_mode"
854 :accessor tree-selection-mode
855 :initarg :mode
856 :type selection-mode)
857 (tree-view
858 :allocation :virtual
859 :getter "gtk_tree_selection_get_mode"
860 :reader tree-selection-mode
861 :type tree-view)))
862
1a1949c7 863 ("GtkComboBox"
864 :slots
865 ((active-iter
866 :allocation :virtual
867 :getter "gtk_combo_box_get_active_iter"
868 :setter "gtk_combo_box_set_active_iter"
869 :accessor combo-box-active-iter
870 :type tree-iter)))
871
aa77651b 872 ("GtkTextBuffer"
873 :slots
874 ((line-count
875 :allocation :virtual
876 :getter "gtk_text_buffer_get_line_count"
877 :reader text-buffer-line-count
878 :type int)
879 (char-count
880 :allocation :virtual
881 :getter "gtk_text_buffer_get_char_count"
882 :reader text-buffer-char-count
883 :type int)
884 (modified
885 :allocation :virtual
886 :getter "gtk_text_buffer_get_modified"
887 :setter "gtk_text_buffer_set_modified"
888 :accessor text-buffer-modifed-p
889 :type boolean)))
890
5e17fb78 891 ("GtkTextView"
892 :slots
893 ((default-attributes
894 :allocation :virtual
895 :getter "gtk_text_view_get_default_attributes"
896 :reader text-view-default-attributes
897 :type text-attributes)))
898
aa77651b 899 ("GtkTextTagTable"
900 :slots
901 ((size
902 :allocation :virtual
903 :getter "gtk_text_tag_table_get_size"
904 :reader text-tag-table-size
905 :type int)))
906
907 ("GtkTextTag"
908 :slots
909 ((priority
910 :allocation :virtual
911 :getter "gtk_text_tag_get_priority"
912 :setter "gtk_text_tag_set_priority"
913 :accessor text-tag-priority
914 :type int)
915 (weight
916 :merge t :type pango:weight)))
917
0763f21d 918 ("GtkTextMark"
919 :slots
920 ((buffer
921 :allocation :virtual
922 :getter "gtk_text_mark_get_buffer"
923 :reader text-mark-buffer
924 :type text-buffer)
925 (name
926 :allocation :virtual
927 :getter "gtk_text_mark_get_name"
928 :reader text-mark-name
929 :type string)
930 (visible
931 :allocation :virtual
932 :getter "gtk_text_mark_get_visible"
933 :setter "gtk_text_mark_set_visible"
934 :accessor text-mark-visible-p
935 :type boolean)
936 (deleted
937 :allocation :virtual
938 :getter "gtk_text_mark_get_deleted"
939 :reader text-mark-deleted-p
940 :type boolean)
941 (left-gravity
942 :allocation :virtual
943 :getter "gtk_text_mark_get_left_gravity"
944 :reader text-mark-left-gravity-p
945 :type boolean)))
946
5e17fb78 947 ("GtkUIManager"
948 :type ui-manager
949 :slots
950 ((action-groups
951 :allocation :virtual
952 :getter "gtk_ui_manager_get_action_groups"
953 :reader ui-manager-action-groups
954 :type (copy-of (glist action-group)))
955 (accel-group
956 :allocation :virtual
957 :getter "gtk_ui_manager_get_accel_group"
958 :reader ui-manager-accel-group
959 :type accel-group)))
960
961 ("GtkUIManagerItemType"
962 :type ui-manager-item-type)
963
a5522de5 964 ("GtkAction"
5e17fb78 965 :slots
966 ((accelerator
a5522de5 967 :allocation :user-data :initarg :accelerator
968 :reader action-accelerator)))
5e17fb78 969
970 ("GtkToggleAction"
971 :slots
972 ((active
973 :allocation :virtual
974 :getter "gtk_toggle_action_get_active"
975 :setter "gtk_toggle_action_set_active"
976 :initarg :active
977 :accessor toggle-action-active-p
978 :type boolean)))
979
980 ("GtkRadioAction"
981 :slots
982 ((group
983 :allocation :virtual
984 :getter "gtk_radio_button_get_group"
d76e9fca 985 :reader radio-action-group
5e17fb78 986 :type (copy-of (gslist widget)))
a5522de5 987 (self
988 :allocation :property :pname "value" :type int
989 :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.")
5e17fb78 990 (value
a5522de5 991 :allocation :user-data :initarg :value :accessor radio-action-value)))
2a8752b0 992
68f519e0 993 ("GtkColorSelection"
994 :slots
995 ((previous-alpha
996 :allocation :virtual
997 :getter "gtk_color_selection_get_previous_alpha"
998 :setter "gtk_color_selection_get_previous_alpha"
999 :initarg :previous-alpha
1000 :accessor color-selection-previous-alpha
1001 :type (unsigned 16))
1002 (previous-color
1003 :allocation :virtual
1004 :getter "gtk_color_selection_get_previous_color"
1005 :setter "gtk_color_selection_get_previous_color"
1006 :initarg :previous-color
1007 :accessor color-selection-previous-color
1008 :type gdk:color)))
1009
1010 ("GtkFontSelection"
1011 :slots
1012 ; deprecated property
1013 ((font :ignore t)))
aa77651b 1014
647c99e5 1015 ("GtkClipboard"
1016 :slots
1017 ((display
1018 :allocation :virtual
1019 :getter "gtk_clipboard_get_display"
1020 :reader clipboard-display
1021 :type gdk:display)))
1022
43e260ae 1023 #+gtk2.6
1024 ("GtkIconView"
1025 :slots
1026 ((text-column :merge t :setter %icon-view-set-text-column)
1027 (markup-column :merge t :setter %icon-view-set-markup-column)
1028 (pixbuf-column :merge t :setter %icon-view-set-pixbuf-column)))
647c99e5 1029
5b51dee1 1030 ;; Not needed
1031 ("GtkFundamentalType" :ignore t)
1032 ("GtkArgFlags" :ignore t)
560af5c5 1033
d520140e 1034
5b51dee1 1035 ;; Deprecated widgets
1036 ("GtkCList" :ignore-prefix t)
1037 ("GtkCTree" :ignore-prefix t)
1a1949c7 1038 ("GtkList" :ignore t)
1039 ("GtkListItem" :ignore t)
5b51dee1 1040 ("GtkTree" :ignore t)
1041 ("GtkTreeItem" :ignore t)
1a1949c7 1042 ("GtkItemFactory" :ignore t)
5e17fb78 1043 ("GtkText" :ignore t)
5b51dee1 1044 ("GtkPacker" :ignore-prefix t)
1045 ("GtkPixmap" :ignore t)
1046 ("GtkPreview" :ignore-prefix t)
1a1949c7 1047 ("GtkProgres" :ignore t)
5b51dee1 1048 ("GtkTipsQuery" :ignore t)
1047e159 1049 ("GtkOldEditable" :ignore t)
1a1949c7 1050 ("GtkCombo" :ignore t)
1051 ("GtkOptionMenu" :ignore t)
68f519e0 1052 ("GtkFileSelection" :ignore t)
1053 ("GtkInputDialog")
1047e159 1054
1055 ;; What are these?
1056 ("GtkFileSystemModule" :ignore t)
1057 ("GtkIMModule" :ignore t)
fa60e0a2 1058 ("GtkThemeEngine" :ignore t))
aa77651b 1059
1060
1061(defclass text-iter (boxed)
1062 ((buffer
1063 :allocation :virtual
1064 :getter "gtk_text_iter_get_buffer"
1065 :reader text-iter-buffer
68f519e0 1066 :type pointer) ;text-buffer)
aa77651b 1067 (offset
1068 :allocation :virtual
1069 :getter "gtk_text_iter_get_offset"
1070 :setter "gtk_text_iter_set_offset"
1071 :accessor text-iter-offset
1072 :type int)
1073 (line
1074 :allocation :virtual
1075 :getter "gtk_text_iter_get_line"
1076 :setter "gtk_text_iter_set_line"
1077 :accessor text-iter-line
1078 :type int)
1079 (line-offset
1080 :allocation :virtual
1081 :getter "gtk_text_iter_get_line_offset"
1082 :setter "gtk_text_iter_set_line_offset"
1083 :accessor text-iter-line-offset
1084 :type int)
1085 (line-index
1086 :allocation :virtual
1087 :getter "gtk_text_iter_get_line_index"
1088 :setter "gtk_text_iter_set_line_index"
1089 :accessor text-iter-line-index
1090 :type int)
1091 (visible-line-index
1092 :allocation :virtual
1093 :getter "gtk_text_iter_get_visible_line_index"
1094 :setter "gtk_text_iter_set_visible_line_index"
1095 :accessor text-iter-visible-line-index
1096 :type int)
1097 (visible-line-offset
1098 :allocation :virtual
1099 :getter "gtk_text_iter_get_visible_line_offset"
1100 :setter "gtk_text_iter_set_visible_line_offset"
1101 :accessor text-iter-visible-line-offset
1102 :type int)
1103 ;; Workaround to get correct size
1104 (dummy14
68f519e0 1105 :allocation :alien :offset #.(* 13 (size-of 'pointer))
1106 :type pointer))
aa77651b 1107 (:metaclass boxed-class
1108 ;; I am pretty sure this was working in older versons on CMUCL
68f519e0 1109; :size #.(* 14 (size-of 'pointer))
1110 ))
d76e9fca 1111
1112
1113(defclass tooltips-data (struct)
1114 ((tooltips
1115 :allocation :alien
1116 :reader tooltips-data-tooltips
1117 :type tooltips)
1118 (widget
1119 :allocation :alien
1120 :reader tooltips-data-widget
1121 :type widget)
1122 (tip-text
1123 :allocation :alien
1124 :reader tooltips-data-tip-text
1125 :type string)
1126 (tip-private
1127 :allocation :alien
1128 :reader tooltips-data-tip-private
1129 :type string))
1130 (:metaclass struct-class))
68f519e0 1131
1132(defclass file-filter-info (struct)
1133 ((contains
1134 :allocation :alien
1135 :initarg :contains
1136 :type file-filter-flags)
1137 (filename
1138 :allocation :alien
1139 :initarg :filename
1140 :type string)
1141 (uri
1142 :allocation :alien
1143 :initarg :uri
1144 :type string)
1145 (display-name
1146 :allocation :alien
1147 :initarg :display-name
1148 :type string)
1149 (mime-type
1150 :allocation :alien
1151 :initarg :mime-type
1152 :type string))
1153 (:metaclass struct-class))
eacab64f 1154
1155
1156(defclass accel-key (struct)
1157 ((key
1158 :allocation :alien
1159 :type unsigned-int)
1160 (modifiers
1161 :allocation :alien
1162 :type gdk:modifier-type)
1163 (flags
1164 :allocation :alien
1165 :type (unsigned 16)))
1166 (:metaclass struct-class))
1167
1168(defclass accel-group-entry (struct)
1169 ((key
1170 :allocation :alien
1171 :setter nil
1172 :type (inlined accel-key))
1173 (gclosure
1174 :allocation :alien
1175 :type gclosure)
1176 (accel_path_quark
1177 :allocation :alien
1178 :type quark))
1179 (:metaclass struct-class))
bdc0e300 1180
1181#+gtk2.8
1182(define-enum-type drop-position
1183 :no-drop :drop-into :drop-left :drop-right :drop-above :drop-below)