chiark / gitweb /
Manually defined slots column-spacing and row-spacing for table
[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
03c0a828 23;; $Id: gtktypes.lisp,v 1.54 2007-05-10 20:21:25 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))
b6d4ac86 113 (:metaclass struct-class)
114 (:ref stock-item-copy)
115 (:unref stock-item-free))
f5b67f2b 116
163a08aa 117(defclass tree-iter (boxed)
960af18a 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))
2a8752b0 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
b6d4ac86 136(define-type-method from-alien-form ((type position) form &key ref)
137 (declare (ignore type ref))
75689fea 138 (from-alien-form 'int form))
139
b6d4ac86 140(define-type-method from-alien-function ((type position) &key ref)
141 (declare (ignore type ref))
75689fea 142 (from-alien-function 'int))
143
b6d4ac86 144(define-type-method reader-function ((type position) &optional ref)
145 (declare (ignore type ref))
68f519e0 146 (reader-function 'int))
d76e9fca 147
2719586f 148(define-types-by-introspection "Gtk"
149 ;; Manually defined
150 ("GtkObject" :ignore t)
151 ("GtkRequisition" :ignore t)
152 ("GtkBorder" :ignore t)
2a8752b0 153 ("GtkTreeIter" :ignore t)
154 ("GtkTreePath" :ignore t)
aa77651b 155; ("GtkStyle" :ignore t)
1047e159 156
5b51dee1 157 ;; Manual override
158 ("GtkWidget"
159 :slots
c289d084 160 ((child-properties
b19bbc94 161 :special t
c289d084 162 :accessor widget-child-properties
1047e159 163 :type container-child)
5b51dee1 164 (window
165 :allocation :virtual
166 :getter "gtk_widget_get_window"
167 :reader widget-window
168 :type gdk:window)
c2a12566 169 (parent :merge t :initarg nil)
170 (visible :merge t :initarg nil)
68f519e0 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)
5b51dee1 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"
e6d40e16 188 :setter "gtk_widget_set_colormap"
189 :initarg :colormap
190 :accessor widget-colormap
5b51dee1 191 :type gdk:colormap)
192 (visual
193 :allocation :virtual
194 :getter "gtk_widget_get_visual"
195 :reader widget-visual
e6d40e16 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
68f519e0 210 :type (copy-of string)) ; will leak the string when setting
e6d40e16 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
aa77651b 222 :type boolean)
223 (width-request
224 :merge t :unbound -1)
225 (height-request
226 :merge t :unbound -1)))
e6d40e16 227
5b51dee1 228 ("GtkContainer"
229 :slots
d76e9fca 230 ((child :ignore t)
5b51dee1 231 (children
232 :allocation :virtual
d76e9fca 233 :setter (setf container-children)
b6d4ac86 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)
d76e9fca 240 (child-type
241 :allocation :virtual
cb4bf772 242 :getter "gtk_container_child_type"
d76e9fca 243 :reader container-child-type
244 :type gtype)
5b51dee1 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)
e6d40e16 252 (focus-chain
253 :allocation :virtual
254 :getter container-focus-chain
255 :setter (setf container-focus-chain))
5b51dee1 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
d76e9fca 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)))
5b51dee1 277
278 ("GtkBin"
279 :slots
280 ((child
281 :allocation :virtual
56460319 282 :getter "gtk_bin_get_child"
283 :setter (setf bin-child)
284 :reader bin-child
285 :type widget)))
3f73963b 286
287 ("GtkWindow"
288 :slots
4d16221f 289 ((focus-widget
3f73963b 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)
3f73963b 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)
4d16221f 310 (icon-list
3f73963b 311 :allocation :virtual
b049d554 312 :getter %window-get-icon-list
4d16221f 313 :setter "gtk_window_set_icon_list"
314 :accessor window-icon-list
315 :initarg :icon-list
316 :type (glist gdk:pixbuf))
3f73963b 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)
4007604e 324 #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
3f73963b 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
4d16221f 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)))
5b51dee1 341
4d16221f 342 ("GtkWindowGroup"
b6d4ac86 343 :dependencies (window)
4d16221f 344 :slots
345 ((grabs
346 :allocation :alien
347 :accessor window-group-grabs
348 :type (gslist window))))
349
5b51dee1 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
5b51dee1 360 ("GtkMenuItem"
361 :slots
362 ((label
363 :allocation :virtual
f5b67f2b 364 :getter menu-item-label
365 :setter (setf menu-item-label)
5b51dee1 366 :type string)
d76e9fca 367 (use-underline
368 :allocation :user-data
369 :initform nil
370 :initarg :use-underline
371 :accessor menu-item-use-underline-p)
f5b67f2b 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)
5b51dee1 379 (submenu
380 :allocation :virtual
381 :getter "gtk_menu_item_get_submenu"
d76e9fca 382 :setter "gtk_menu_item_set_submenu"
383 :accessor menu-item-submenu
5b51dee1 384 :initarg :submenu
d76e9fca 385 :type widget)))
5b51dee1 386
bdc0e300 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
5b51dee1 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
b6d4ac86 417 (#?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
bdc0e300 418 (hscrollbar
419 :allocation :alien
5b51dee1 420 :reader scrolled-window-hscrollbar
421 :type widget)
b6d4ac86 422 #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
5b51dee1 423 (vscrollbar
424 :allocation :alien
425 :reader scrolled-window-vscrollbar
bdc0e300 426 :type widget)
b6d4ac86 427 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
bdc0e300 428 (hscrollbar
429 :allocation :virtual
430 :getter "gtk_scrolled_window_get_hscrollbar"
431 :reader scrolled-window-hscrollbar
432 :type widget)
b6d4ac86 433 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
bdc0e300 434 (vscrollbar
435 :allocation :virtual
b6d4ac86 436 :getter "gtk_scrolled_window_get_vscrollbar"
bdc0e300 437 :reader scrolled-window-vscrollbar
5b51dee1 438 :type widget)))
560af5c5 439
5b51dee1 440 ("GtkPaned"
1047e159 441 :slots
5b51dee1 442 ((child1
560af5c5 443 :allocation :virtual
1dd03ab8 444 :getter "gtk_paned_get_child1"
445 :setter "gtk_paned_add1"
446 :accessor paned-child1
5b51dee1 447 :initarg :child1
560af5c5 448 :type widget)
5b51dee1 449 (child2
2d379b6a 450 :allocation :virtual
1dd03ab8 451 :getter "gtk_paned_get_child2"
452 :setter "gtk_paned_add2"
453 :accessor paned-child2
5b51dee1 454 :initarg :child2
455 :type widget)))
560af5c5 456
5b51dee1 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)
d76e9fca 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)
b6d4ac86 485 #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
d76e9fca 486 (tearoff-state
5b51dee1 487 :allocation :virtual
488 :getter "gtk_menu_get_tearoff_state"
489 :setter "gtk_menu_set_tearoff_state"
d76e9fca 490 :accessor menu-tearoff-state-p
491 :initarg :tearoff-state
5b51dee1 492 :type boolean)))
493
8db41d01 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
5b51dee1 510 ("GtkToolbar"
511 :slots
4007604e 512 ((show-tooltips ;; this slot is equivalent to the property
513 :allocation :virtual ;; "tooltips" in Gtk+ 2.8
5b51dee1 514 :getter "gtk_toolbar_get_tooltips"
515 :setter "gtk_toolbar_set_tooltips"
cb4bf772 516 :accessor toolbar-show-tooltips-p
517 :initarg :show-tooltips
5b51dee1 518 :type boolean)
cb4bf772 519 (tooltips
5b51dee1 520 :allocation :virtual
cb4bf772 521 :getter "gtk_toolbar_get_tooltips_object"
522 :reader toolbar-tooltips
523 :type tooltips)
4007604e 524 (toolbar-style ; defined manually to get the accesssor name correct
1047e159 525 :allocation :property
526 :pname "toolbar-style"
527 :initarg :toolbar-style
528 :accessor toolbar-style
cb4bf772 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)))
5b51dee1 535
d76e9fca 536 ("GtkToolItem"
537 :slots
cb4bf772 538 ((use-drag-window
d76e9fca 539 :allocation :virtual
cb4bf772 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
d76e9fca 543 :initarg :drag-window
cb4bf772 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)))
d76e9fca 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
cb4bf772 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")))
d76e9fca 583
f5b67f2b 584 ("GtkNotebook"
585 :slots
586 ((current-page
587 :allocation :virtual
68f519e0 588 :getter %notebook-current-page
f5b67f2b 589 :setter (setf notebook-current-page)
68f519e0 590 :reader notebook-current-page
591 :type widget
f5b67f2b 592 :initarg :current-page)
68f519e0 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)))
f5b67f2b 601
5b51dee1 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
d76e9fca 621 ("GtkHandleBox"
622 :slots
623 ; deprecated property
624 ((shadow :ignore t)))
625
626 ("GtkFrame"
627 :slots
628 ; deprecated property
629 ((shadow :ignore t)))
630
03c0a828 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)))
5b51dee1 641
642 ("GtkDialog"
643 :slots
1047e159 644 ((vbox
5b51dee1 645 :allocation :virtual
646 :getter "gtk_dialog_get_vbox"
1047e159 647 :reader dialog-vbox
5b51dee1 648 :type widget)
649 (action-area
650 :allocation :virtual
651 :getter "gtk_dialog_get_action_area"
652 :reader dialog-action-area
653 :type widget)))
2ed3bebb 654
d76e9fca 655 ("GtkEntry"
5b51dee1 656 :slots
d76e9fca 657 ((layout
5b51dee1 658 :allocation :virtual
d76e9fca 659 :getter "gtk_entry_get_layout"
660 :reader entry-layout
661 :type pango:layout)
662 (completion
163a08aa 663 :allocation :virtual
d76e9fca 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)
b6d4ac86 670 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
647c99e5 671 (width-chars :merge t :unbound -1)))
d76e9fca 672
f45fd227 673 ("GtkEntryCompletion"
674 :slots
675 ((entry
676 :allocation :virtual
677 :getter "gtk_entry_completion_get_entry"
678 :reader entry-completion-entry
679 :type entry)
d76e9fca 680 (minimum-key-length :merge t :unbound -1)
b6d4ac86 681 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
d76e9fca 682 (text-column :merge t :unbound -1)))
f45fd227 683
5b51dee1 684 ("GtkRadioButton"
685 :slots
686 ((group
687 :allocation :virtual
688 :getter "gtk_radio_button_get_group"
689 :reader radio-button-group
cb4bf772 690 :type (copy-of (gslist widget)))
691 (value
692 :allocation :user-data
693 :initarg :value
694 :accessor radio-button-value
695 :documentation "Value passed as argument to the activate callback")))
d520140e 696
5b51dee1 697 ("GtkRadioMenuItem"
698 :slots
699 ((group
700 :allocation :virtual
701 :getter "gtk_radio_menu_item_get_group"
702 :reader radio-menu-item-group
cb4bf772 703 :type (copy-of (gslist widget)))
704 (value
705 :allocation :user-data
706 :initarg :value
707 :accessor radio-menu-item-value
708 :documentation "Value passed as argument to the activate callback")))
560af5c5 709
5b51dee1 710 ("GtkLayout"
711 :slots
712 ((bin-window
1047e159 713 :allocation :virtual
5b51dee1 714 :getter "gtk_layout_get_bin_window"
715 :reader layout-bin-window
f784870f 716 :type gdk:window)))
f5b67f2b 717
718 ("GtkFixed"
719 :slots
720 ((has-window
1047e159 721 :allocation :virtual
f5b67f2b 722 :getter "gtk_fixed_get_has_window"
723 :setter "gtk_fixed_set_has_window"
724 :reader fixed-has-window-p
725 :initarg :has-window
726 :type boolean)))
1047e159 727
728 ("GtkRange"
729 :slots
730 ((value
731 :allocation :virtual
732 :getter "gtk_range_get_value"
733 :setter "gtk_range_set_value"
734 :initarg :value
735 :accessor range-value
736 :type double-float)
737 (upper
738 :allocation :virtual
739 :getter range-upper
740 :setter (setf range-upper)
741 :initarg :upper)
742 (lower
743 :allocation :virtual
744 :getter range-lower
745 :setter (setf range-lower)
746 :initarg :lower)
747 (step-increment
748 :allocation :virtual
749 :getter range-step-increment
750 :setter (setf range-step-increment)
751 :initarg :step-increment)
752 (page-increment
753 :allocation :virtual
754 :getter range-page-increment
755 :setter (setf range-page-increment)
756 :initarg :page-increment)))
757
758 ("GtkImage"
759 :slots
d76e9fca 760 ((file :ignore t)
b6d4ac86 761 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
d76e9fca 762 (pixel-size :merge t :unbound -1)))
763
764 ("GtkLabel"
765 :slots
766 ((layout
767 :allocation :virtual
768 :getter "gtk_label_get_layout"
769 :reader label-layout
770 :type pango:layout)))
771
68f519e0 772 ("GtkScale"
773 :slots
774 ((layout
775 :allocation :virtual
776 :getter "gtk_scale_get_layout"
777 :reader scale-layout
778 :type pango:layout)))
779
1047e159 780 ("GtkEditable"
781 :slots
782 ((editable
783 :allocation :virtual
784 :getter "gtk_editable_get_editable"
785 :setter "gtk_editable_set_editable"
786 :reader editable-editable-p
787 :initarg :editable
788 :type boolean)
789 (position
790 :allocation :virtual
791 :getter "gtk_editable_get_position"
792 :setter "gtk_editable_set_position"
793 :reader editable-position
794 :initarg :position
cb4bf772 795 :type position)
1047e159 796 (text
797 :allocation :virtual
798 :getter editable-text
799 :setter (setf editable-text)
800 :initarg text)))
801
802 ("GtkFileChooser"
803 :slots
804 ((filename
805 :allocation :virtual
806 :getter "gtk_file_chooser_get_filename"
807 :setter "gtk_file_chooser_set_filename"
808 :accessor file-chooser-filename
809 :initarg :filename
810 :type string)
811 (current-name
812 :allocation :virtual
813 :setter "gtk_file_chooser_set_current_name"
68f519e0 814 :accessor file-chooser-current-name
1047e159 815 :initarg :current-name
816 :type string)
817 (current-folder
818 :allocation :virtual
819 :setter "gtk_file_chooser_set_current_folder"
820 :setter "gtk_file_chooser_get_current_folder"
68f519e0 821 :accessor file-chooser-current-folder
1047e159 822 :initarg :current-folder
823 :type string)
824 (uri
825 :allocation :virtual
826 :getter "gtk_file_chooser_get_uri"
827 :setter "gtk_file_chooser_set_uri"
68f519e0 828 :accessor file-chooser-uri
1047e159 829 :initarg :uri
830 :type string)
831 (current-folder-uri
832 :allocation :virtual
833 :setter "gtk_file_chooser_set_current_folder_uri"
834 :setter "gtk_file_chooser_get_current_folder_uri"
68f519e0 835 :accessor file-chooser-current-folder-uri
1047e159 836 :initarg :current-folder-uri
837 :type string)))
838
68f519e0 839 ("GtkFileFilter"
840 :slots
841 ((name
842 :allocation :virtual
843 :getter "gtk_file_filter_get_name"
844 :setter "gtk_file_filter_set_name"
845 :accessor file-filter-name
846 :initarg :name
847 :type string)))
848
1a1949c7 849 ("GtkTreeView"
850 :slots
851 ((columns
852 :allocation :virtual
853 :getter "gtk_tree_view_get_columns"
854 :reader tree-view-columns
f4175703 855 :type (glist tree-view-column))
856 (selection
857 :allocation :virtual
858 :getter "gtk_tree_view_get_selection"
859 :reader tree-view-selection
860 :type tree-selection)))
1a1949c7 861
2a8752b0 862 ("GtkTreeModel"
863 :slots
864 ((n-columns
865 :allocation :virtual
866 :getter "gtk_tree_model_get_n_columns"
867 :reader tree-model-n-columns
868 :type int)))
869
f4175703 870 ("GtkTreeSelection"
871 :slots
872 ((mode
873 :allocation :virtual
874 :getter "gtk_tree_selection_get_mode"
875 :setter "gtk_tree_selection_set_mode"
876 :accessor tree-selection-mode
877 :initarg :mode
878 :type selection-mode)
879 (tree-view
880 :allocation :virtual
881 :getter "gtk_tree_selection_get_mode"
882 :reader tree-selection-mode
883 :type tree-view)))
884
1a1949c7 885 ("GtkComboBox"
886 :slots
887 ((active-iter
888 :allocation :virtual
889 :getter "gtk_combo_box_get_active_iter"
890 :setter "gtk_combo_box_set_active_iter"
891 :accessor combo-box-active-iter
892 :type tree-iter)))
893
aa77651b 894 ("GtkTextBuffer"
895 :slots
896 ((line-count
897 :allocation :virtual
898 :getter "gtk_text_buffer_get_line_count"
899 :reader text-buffer-line-count
900 :type int)
901 (char-count
902 :allocation :virtual
903 :getter "gtk_text_buffer_get_char_count"
904 :reader text-buffer-char-count
905 :type int)
906 (modified
907 :allocation :virtual
908 :getter "gtk_text_buffer_get_modified"
909 :setter "gtk_text_buffer_set_modified"
910 :accessor text-buffer-modifed-p
911 :type boolean)))
912
5e17fb78 913 ("GtkTextView"
914 :slots
915 ((default-attributes
916 :allocation :virtual
917 :getter "gtk_text_view_get_default_attributes"
918 :reader text-view-default-attributes
919 :type text-attributes)))
920
aa77651b 921 ("GtkTextTagTable"
922 :slots
923 ((size
924 :allocation :virtual
925 :getter "gtk_text_tag_table_get_size"
926 :reader text-tag-table-size
927 :type int)))
928
929 ("GtkTextTag"
930 :slots
931 ((priority
932 :allocation :virtual
933 :getter "gtk_text_tag_get_priority"
934 :setter "gtk_text_tag_set_priority"
935 :accessor text-tag-priority
936 :type int)
937 (weight
938 :merge t :type pango:weight)))
939
0763f21d 940 ("GtkTextMark"
941 :slots
942 ((buffer
943 :allocation :virtual
944 :getter "gtk_text_mark_get_buffer"
945 :reader text-mark-buffer
946 :type text-buffer)
947 (name
948 :allocation :virtual
949 :getter "gtk_text_mark_get_name"
950 :reader text-mark-name
f669d557 951 :type (copy-of string))
0763f21d 952 (visible
953 :allocation :virtual
954 :getter "gtk_text_mark_get_visible"
955 :setter "gtk_text_mark_set_visible"
956 :accessor text-mark-visible-p
957 :type boolean)
958 (deleted
959 :allocation :virtual
960 :getter "gtk_text_mark_get_deleted"
961 :reader text-mark-deleted-p
962 :type boolean)
963 (left-gravity
964 :allocation :virtual
965 :getter "gtk_text_mark_get_left_gravity"
966 :reader text-mark-left-gravity-p
967 :type boolean)))
968
5e17fb78 969 ("GtkUIManager"
970 :type ui-manager
971 :slots
972 ((action-groups
973 :allocation :virtual
974 :getter "gtk_ui_manager_get_action_groups"
975 :reader ui-manager-action-groups
976 :type (copy-of (glist action-group)))
977 (accel-group
978 :allocation :virtual
979 :getter "gtk_ui_manager_get_accel_group"
980 :reader ui-manager-accel-group
981 :type accel-group)))
982
983 ("GtkUIManagerItemType"
984 :type ui-manager-item-type)
985
a5522de5 986 ("GtkAction"
5e17fb78 987 :slots
988 ((accelerator
a5522de5 989 :allocation :user-data :initarg :accelerator
990 :reader action-accelerator)))
5e17fb78 991
4007604e 992 #?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
5e17fb78 993 ("GtkToggleAction"
994 :slots
995 ((active
996 :allocation :virtual
997 :getter "gtk_toggle_action_get_active"
998 :setter "gtk_toggle_action_set_active"
4007604e 999; :initarg :active ;; Handled by initialize-instance
5e17fb78 1000 :accessor toggle-action-active-p
1001 :type boolean)))
1002
1003 ("GtkRadioAction"
1004 :slots
1005 ((group
1006 :allocation :virtual
1007 :getter "gtk_radio_button_get_group"
d76e9fca 1008 :reader radio-action-group
5e17fb78 1009 :type (copy-of (gslist widget)))
a5522de5 1010 (self
1011 :allocation :property :pname "value" :type int
1012 :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 1013 (value
4007604e 1014 :allocation :user-data :initarg :value :accessor radio-action-value)
1015 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1016 ;; Use radio-action-get-current-value to get the current value of
1017 ;; a radio action group
1018 (current-value :ignore t)))
2a8752b0 1019
68f519e0 1020 ("GtkColorSelection"
1021 :slots
1022 ((previous-alpha
1023 :allocation :virtual
1024 :getter "gtk_color_selection_get_previous_alpha"
1025 :setter "gtk_color_selection_get_previous_alpha"
1026 :initarg :previous-alpha
1027 :accessor color-selection-previous-alpha
1028 :type (unsigned 16))
1029 (previous-color
1030 :allocation :virtual
1031 :getter "gtk_color_selection_get_previous_color"
1032 :setter "gtk_color_selection_get_previous_color"
1033 :initarg :previous-color
1034 :accessor color-selection-previous-color
1035 :type gdk:color)))
1036
1037 ("GtkFontSelection"
1038 :slots
1039 ; deprecated property
1040 ((font :ignore t)))
aa77651b 1041
647c99e5 1042 ("GtkClipboard"
1043 :slots
1044 ((display
1045 :allocation :virtual
1046 :getter "gtk_clipboard_get_display"
1047 :reader clipboard-display
1048 :type gdk:display)))
1049
b6d4ac86 1050 #?(pkg-exists-p "gtk+-2.0" :atleast-version "2.6.0")
43e260ae 1051 ("GtkIconView"
1052 :slots
c46ca281 1053 ((text-column
1054 :allocation :virtual
1055 :getter %icon-view-get-text-column
1056 :setter %icon-view-set-text-column
1057 :boundp %icon-view-text-column-boundp
1058 :initarg :text-column
1059 :accessor icon-view-text-column)
1060 (markup-column
1061 :allocation :virtual
1062 :getter %icon-view-get-markup-column
1063 :setter %icon-view-set-tmarkup-column
1064 :boundp %icon-view-markup-column-boundp
1065 :initarg :markup-column
1066 :accessor icon-view-markup-column)
1067 (pixbuf-column
1068 :allocation :virtual
1069 :getter %icon-view-get-pixbuf-column
1070 :setter %icon-view-set-pixbuf-column
1071 :boundp %icon-view-pixbuf-column-boundp
1072 :initarg :pixbuf-column
1073 :accessor icon-view-pixbuf-column)))
647c99e5 1074
5b51dee1 1075 ;; Not needed
1076 ("GtkFundamentalType" :ignore t)
1077 ("GtkArgFlags" :ignore t)
560af5c5 1078
d520140e 1079
5b51dee1 1080 ;; Deprecated widgets
1081 ("GtkCList" :ignore-prefix t)
1082 ("GtkCTree" :ignore-prefix t)
1a1949c7 1083 ("GtkList" :ignore t)
1084 ("GtkListItem" :ignore t)
5b51dee1 1085 ("GtkTree" :ignore t)
1086 ("GtkTreeItem" :ignore t)
1a1949c7 1087 ("GtkItemFactory" :ignore t)
5e17fb78 1088 ("GtkText" :ignore t)
5b51dee1 1089 ("GtkPacker" :ignore-prefix t)
1090 ("GtkPixmap" :ignore t)
1091 ("GtkPreview" :ignore-prefix t)
1a1949c7 1092 ("GtkProgres" :ignore t)
5b51dee1 1093 ("GtkTipsQuery" :ignore t)
1047e159 1094 ("GtkOldEditable" :ignore t)
1a1949c7 1095 ("GtkCombo" :ignore t)
1096 ("GtkOptionMenu" :ignore t)
68f519e0 1097 ("GtkFileSelection" :ignore t)
1098 ("GtkInputDialog")
1047e159 1099
1100 ;; What are these?
1101 ("GtkFileSystemModule" :ignore t)
1102 ("GtkIMModule" :ignore t)
fa60e0a2 1103 ("GtkThemeEngine" :ignore t))
aa77651b 1104
1105
1106(defclass text-iter (boxed)
1107 ((buffer
1108 :allocation :virtual
1109 :getter "gtk_text_iter_get_buffer"
1110 :reader text-iter-buffer
68f519e0 1111 :type pointer) ;text-buffer)
aa77651b 1112 (offset
1113 :allocation :virtual
1114 :getter "gtk_text_iter_get_offset"
1115 :setter "gtk_text_iter_set_offset"
1116 :accessor text-iter-offset
1117 :type int)
1118 (line
1119 :allocation :virtual
1120 :getter "gtk_text_iter_get_line"
1121 :setter "gtk_text_iter_set_line"
1122 :accessor text-iter-line
1123 :type int)
1124 (line-offset
1125 :allocation :virtual
1126 :getter "gtk_text_iter_get_line_offset"
1127 :setter "gtk_text_iter_set_line_offset"
1128 :accessor text-iter-line-offset
1129 :type int)
1130 (line-index
1131 :allocation :virtual
1132 :getter "gtk_text_iter_get_line_index"
1133 :setter "gtk_text_iter_set_line_index"
1134 :accessor text-iter-line-index
1135 :type int)
1136 (visible-line-index
1137 :allocation :virtual
1138 :getter "gtk_text_iter_get_visible_line_index"
1139 :setter "gtk_text_iter_set_visible_line_index"
1140 :accessor text-iter-visible-line-index
1141 :type int)
1142 (visible-line-offset
1143 :allocation :virtual
1144 :getter "gtk_text_iter_get_visible_line_offset"
1145 :setter "gtk_text_iter_set_visible_line_offset"
1146 :accessor text-iter-visible-line-offset
163a08aa 1147 :type int))
1148 (:metaclass boxed-class)
1149 (:size #.(* 14 (size-of 'pointer))))
d76e9fca 1150
1151
1152(defclass tooltips-data (struct)
1153 ((tooltips
1154 :allocation :alien
1155 :reader tooltips-data-tooltips
1156 :type tooltips)
1157 (widget
1158 :allocation :alien
1159 :reader tooltips-data-widget
1160 :type widget)
1161 (tip-text
1162 :allocation :alien
1163 :reader tooltips-data-tip-text
1164 :type string)
1165 (tip-private
1166 :allocation :alien
1167 :reader tooltips-data-tip-private
1168 :type string))
1169 (:metaclass struct-class))
68f519e0 1170
1171(defclass file-filter-info (struct)
1172 ((contains
1173 :allocation :alien
1174 :initarg :contains
1175 :type file-filter-flags)
1176 (filename
1177 :allocation :alien
1178 :initarg :filename
1179 :type string)
1180 (uri
1181 :allocation :alien
1182 :initarg :uri
1183 :type string)
1184 (display-name
1185 :allocation :alien
1186 :initarg :display-name
1187 :type string)
1188 (mime-type
1189 :allocation :alien
1190 :initarg :mime-type
1191 :type string))
1192 (:metaclass struct-class))
eacab64f 1193
1194
1195(defclass accel-key (struct)
1196 ((key
1197 :allocation :alien
1198 :type unsigned-int)
1199 (modifiers
1200 :allocation :alien
1201 :type gdk:modifier-type)
1202 (flags
1203 :allocation :alien
1204 :type (unsigned 16)))
1205 (:metaclass struct-class))
1206
1207(defclass accel-group-entry (struct)
1208 ((key
1209 :allocation :alien
1210 :setter nil
1211 :type (inlined accel-key))
1212 (gclosure
1213 :allocation :alien
1214 :type gclosure)
1215 (accel_path_quark
1216 :allocation :alien
1217 :type quark))
1218 (:metaclass struct-class))
bdc0e300 1219
b6d4ac86 1220#?(pkg-exists-p "gtk+-2.0" :atleast-version "2.8.0")
bdc0e300 1221(define-enum-type drop-position
1222 :no-drop :drop-into :drop-left :drop-right :drop-above :drop-below)
163a08aa 1223
1224
163a08aa 1225(defclass target-entry (struct)
1226 ((target
1227 :allocation :alien
1228 :accessor target-entry-target
1229 :initarg :target
1230 :type string)
1231 (flags
1232 :allocation :alien
1233 :accessor target-entry-flags
1234 :initarg :flags
1235 :type target-flags)
1236 (id
1237 :allocation :alien
1238 :accessor target-entry-id
1239 :initarg :id
1240 :type unsigned-int))
1241 (:metaclass struct-class))
1242
18c83e09 1243
1244(defclass selection-data (boxed)
1245 ((selection
1246 :allocation :alien :type gdk:atom
1247 :reader selection-data-selection)
1248 (target
1249 :allocation :alien :type gdk:atom
1250 :reader selection-data-target)
1251 (type
1252 :allocation :alien :type gdk:atom
1253 :reader selection-data-type)
1254 (format
1255 :allocation :alien :type int
1256 :reader selection-data-format)
1257 (data
1258 :allocation :alien :type pointer
1259 :reader selection-data-data)
1260 (length
1261 :allocation :alien :type int
1262 :reader selection-data-length)
1263 (display
1264 :allocation :alien :type gdk:display
1265 :reader selection-data-display))
1266 (:metaclass boxed-class))
1267
1268
36f9a01b 1269#?-(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
18c83e09 1270(defclass target-list (proxy)
1271 ()
b6d4ac86 1272 (:metaclass proxy-class)
1273 (:ref target-list-ref)
1274 (:unref target-list-unref))
36f9a01b 1275
1276#?(pkg-exists-p "gtk+-2.0" :atleast-version "2.10.0")
1277(defclass target-list (boxed)
1278 ()
1279 (:metaclass boxed-class))