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