chiark / gitweb /
Updated to reflect current state
[clg] / gtk / gtk.lisp
CommitLineData
560af5c5 1;; Common Lisp bindings for GTK+ v2.0
bbaeff4b 2;; Copyright (C) 1999-2001 Espen S. Johnsen <esj@stud.cs.uit.no>
560af5c5 3;;
4;; This library is free software; you can redistribute it and/or
5;; modify it under the terms of the GNU Lesser General Public
6;; License as published by the Free Software Foundation; either
7;; version 2 of the License, or (at your option) any later version.
8;;
9;; This library is distributed in the hope that it will be useful,
10;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12;; Lesser General Public License for more details.
13;;
14;; You should have received a copy of the GNU Lesser General Public
15;; License along with this library; if not, write to the Free Software
16;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
7abdba43 18;; $Id: gtk.lisp,v 1.38 2005-02-27 12:37:01 espen Exp $
560af5c5 19
20
21(in-package "GTK")
22
23;;; Gtk version
24
6bb23851 25(defbinding check-version () (copy-of string)
560af5c5 26 (required-major unsigned-int)
27 (required-minor unsigned-int)
28 (required-micro unsigned-int))
29
bbaeff4b 30(defbinding query-version () nil
560af5c5 31 (major unsigned-int :out)
32 (minor unsigned-int :out)
33 (micro unsigned-int :out))
34
35(defun gtk-version ()
36 (multiple-value-bind (major minor micro)
37 (query-version)
38 (if (zerop micro)
39 (format nil "Gtk+ v~A.~A" major minor)
40 (format nil "Gtk+ v~A.~A.~A" major minor micro))))
41
6bb23851 42(defbinding get-default-language () (copy-of pango:language))
560af5c5 43
44
9adccb27 45;;;; Initalization
46
47(defbinding (gtk-init "gtk_parse_args") () nil
48 "Initializes the library without opening the display."
49 (nil null)
50 (nil null))
51
52(defun clg-init (&optional display)
53 "Initializes the system and starts the event handling"
54 (unless (gdk:display-get-default)
55 (gdk:gdk-init)
56 (gtk-init)
57 (prog1
58 (gdk:display-open display)
73572c12 59 (add-fd-handler (gdk:display-connection-number) :input #'main-iterate-all)
60 (setq *periodic-polling-function* #'main-iterate-all)
61 (setq *max-event-to-sec* 0)
62 (setq *max-event-to-usec* 1000))))
9adccb27 63
64
667a112b 65;;; Misc
66
67(defbinding grab-add () nil
68 (widget widget))
69
7abdba43 70(defbinding grab-get-current () widget)
667a112b 71
72(defbinding grab-remove () nil
73 (widget widget))
74
75
647c99e5 76;;; About dialog
77
78#+gtk2.6
79(progn
80 (def-callback-marshal %about-dialog-activate-link-func
81 (nil (dialog about-dialog) (link (copy-of string))))
82
83 (defbinding about-dialog-set-email-hook (function) nil
84 ((callback %about-dialog-activate-link-func) pointer)
85 ((register-callback-function function) unsigned-int)
86 ((callback user-data-destroy-func) pointer))
87
88 (defbinding about-dialog-set-url-hook (function) nil
89 ((callback %about-dialog-activate-link-func) pointer)
90 ((register-callback-function function) unsigned-int)
91 ((callback user-data-destroy-func) pointer)))
92
93
0f476ab5 94;;; Acccel group
560af5c5 95
31700e82 96(defbinding %accel-group-connect () nil
97 (accel-group accel-group)
98 (key unsigned-int)
99 (modifiers gdk:modifier-type)
100 (flags accel-flags)
101 (gclosure gclosure))
102
103(defun accel-group-connect (group accelerator function &optional flags)
104 (multiple-value-bind (key modifiers) (accelerator-parse accelerator)
105 (let ((gclosure (make-callback-closure function)))
106 (%accel-group-connect group key modifiers flags gclosure)
107 gclosure)))
108
109(defbinding accel-group-connect-by-path (group path function) nil
110 (group accel-group)
111 (path string)
112 ((make-callback-closure function) gclosure :return))
113
114(defbinding %accel-group-disconnect (group gclosure) boolean
115 (group accel-group)
116 (gclosure gclosure))
117
118(defbinding %accel-group-disconnect-key () boolean
119 (group accel-group)
120 (key unsigned-int)
121 (modifiers gdk:modifier-type))
122
123(defun accel-group-disconnect (group accelerator)
124 (etypecase accelerator
125 (gclosure (%accel-group-disconnect group accelerator))
126 (string
127 (multiple-value-bind (key modifiers) (accelerator-parse accelerator)
128 (%accel-group-disconnect-key group key modifiers)))))
129
130(defbinding accel-group-lock () nil
131 (accel-group accel-group))
132
133(defbinding accel-group-unlock () nil
134 (accel-group accel-group))
135
136(defbinding %accel-groups-activate () boolean
137 (object gobject)
138 (key unsigned-int)
139 (modifiers gdk:modifier-type))
140
141(defun accel-groups-activate (object accelerator)
142 (multiple-value-bind (key modifiers) (accelerator-parse accelerator)
143 (%accel-groups-activate object key modifiers)))
144
145(defbinding accel-groups-from-object () (gslist accel-groups)
146 (object gobject))
147
73572c12 148(defbinding accelerator-valid-p (key &optional modifiers) boolean
31700e82 149 (key unsigned-int)
150 (modifiers gdk:modifier-type))
151
152(defbinding %accelerator-parse () nil
153 (accelerator string)
154 (key unsigned-int :out)
155 (modifiers gdk:modifier-type :out))
156
157(defun accelerator-parse (accelerator)
158 (multiple-value-bind (key modifiers) (%accelerator-parse accelerator)
159 (if (zerop key)
160 (error "Invalid accelerator: ~A" accelerator)
161 (values key modifiers))))
162
163(defbinding accelerator-name () string
164 (key unsigned-int)
165 (modifiers gdk:modifier-type))
166
167#+gtk2.6
168(defbinding accelerator-get-label () string
169 (key unsigned-int)
170 (modifiers gdk:modifier-type))
171
172(defbinding %accelerator-set-default-mod-mask () nil
173 (default-modifiers gdk:modifier-type))
174
175(defun (setf accelerator-default-modifier-mask) (default-modifiers)
176 (%accelerator-set-default-mod-mask default-modifiers))
177
178(defbinding (accelerator-default-modifier-mask "gtk_accelerator_get_default_mod_mask") () gdk:modifier-type)
560af5c5 179
1047e159 180
560af5c5 181;;; Acccel label
182
bbaeff4b 183(defbinding accel-label-refetch () boolean
560af5c5 184 (accel-label accel-label))
185
186
31700e82 187
188;;; Accel map
189
190(defbinding %accel-map-add-entry () nil
191 (path string)
192 (key unsigned-int)
193 (modifiers gdk:modifier-type))
194
195(defun accel-map-add-entry (path accelerator)
196 (multiple-value-bind (key modifiers) (accelerator-parse accelerator)
197 (%accel-map-add-entry path key modifiers)))
198
199(defbinding accel-map-lookup-entry () boolean
200 (path string)
201 (key pointer)) ;accel-key))
202
203(defbinding %accel-map-change-entry () boolean
204 (path string)
205 (key unsigned-int)
206 (modifiers gdk:modifier-type)
207 (replace boolean))
208
209(defun accel-map-change-entry (path accelerator &optional replace)
210 (multiple-value-bind (key modifiers) (accelerator-parse accelerator)
211 (%accel-map-change-entry path key modifiers replace)))
212
213(defbinding accel-map-load () nil
214 (filename pathname))
215
216(defbinding accel-map-save () nil
217 (filename pathname))
218
219(defbinding accel-map-get () accel-map)
220
221(defbinding accel-map-lock-path () nil
222 (path string))
223
224(defbinding accel-map-unlock-path () nil
225 (path string))
226
227
228
d76e9fca 229;;; Accessible
230
231(defbinding accessible-connect-widget-destroyed () nil
232 (accessible accessible))
233
234
0f476ab5 235;;; Adjustment
560af5c5 236
d76e9fca 237(defmethod initialize-instance ((adjustment adjustment) &key value)
1047e159 238 (prog1
239 (call-next-method)
240 ;; we need to make sure that the value is set last, otherwise it
d76e9fca 241 ;; may be outside current limits and ignored
1047e159 242 (when value
243 (setf (slot-value adjustment 'value) value))))
244
245
0f476ab5 246(defbinding adjustment-changed () nil
247 (adjustment adjustment))
248
249(defbinding adjustment-value-changed () nil
250 (adjustment adjustment))
251
252(defbinding adjustment-clamp-page () nil
253 (adjustment adjustment)
254 (lower single-float)
255 (upper single-float))
560af5c5 256
0f476ab5 257
68f519e0 258;;; Alignment
259
260(defbinding alignment-set () nil
261 (alognment alignment)
262 (x-align single-float)
263 (y-align single-float)
264 (x-scale single-float)
265 (y-scale single-float))
266
267(defbinding alignment-get-padding () nil
268 (alognment alignment)
269 (top unsigned-int :out)
270 (bottom unsigned-int :out)
271 (left unsigned-int :out)
272 (right unsigned-int :out))
273
274(defbinding alignment-set-padding () nil
275 (alognment alignment)
276 (top unsigned-int)
277 (bottom unsigned-int)
278 (left unsigned-int)
279 (right unsigned-int))
280
281
0f476ab5 282;;; Aspect frame
283
284
285;;; Bin
560af5c5 286
287(defun (setf bin-child) (child bin)
0f476ab5 288 (when-bind (current-child (bin-child bin))
289 (container-remove bin current-child))
560af5c5 290 (container-add bin child)
291 child)
292
14c94516 293(defmethod compute-signal-function ((bin bin) signal function object)
294 (declare (ignore signal))
295 (if (eq object :child)
cb4bf772 296 #'(lambda (&rest args)
297 (apply function (bin-child bin) (rest args)))
298 (call-next-method)))
0f476ab5 299
300
301;;; Box
302
303(defbinding box-pack-start () nil
304 (box box)
305 (child widget)
306 (expand boolean)
307 (fill boolean)
308 (padding unsigned-int))
309
310(defbinding box-pack-end () nil
311 (box box)
312 (child widget)
313 (expand boolean)
314 (fill boolean)
315 (padding unsigned-int))
316
d76e9fca 317(defun box-pack (box child &key end (expand t) (fill t) (padding 0))
1a1949c7 318 (if end
f5b67f2b 319 (box-pack-end box child expand fill padding)
320 (box-pack-start box child expand fill padding)))
0f476ab5 321
322(defbinding box-reorder-child () nil
323 (box box)
324 (child widget)
325 (position int))
326
327(defbinding box-query-child-packing () nil
328 (box box)
329 (child widget)
330 (expand boolean :out)
331 (fill boolean :out)
332 (padding unsigned-int :out)
333 (pack-type pack-type :out))
334
335(defbinding box-set-child-packing () nil
336 (box box)
337 (child widget)
338 (expand boolean)
339 (fill boolean)
340 (padding unsigned-int)
341 (pack-type pack-type))
342
343
344
560af5c5 345;;; Button
346
d76e9fca 347(defmethod initialize-instance ((button button) &rest initargs &key stock)
348 (if stock
349 (apply #'call-next-method button :label stock :use-stock t initargs)
350 (call-next-method)))
351
352
bbaeff4b 353(defbinding button-pressed () nil
560af5c5 354 (button button))
355
0f476ab5 356(defbinding button-released () nil
357 (button button))
358
359(defbinding button-clicked () nil
360 (button button))
361
362(defbinding button-enter () nil
363 (button button))
364
365(defbinding button-leave () nil
366 (button button))
367
368
369
370;;; Calendar
371
372(defbinding calendar-select-month () int
373 (calendar calendar)
374 (month unsigned-int)
375 (year unsigned-int))
376
377(defbinding calendar-select-day () nil
378 (calendar calendar)
379 (day unsigned-int))
380
381(defbinding calendar-mark-day () int
382 (calendar calendar)
383 (day unsigned-int))
384
385(defbinding calendar-unmark-day () int
386 (calendar calendar)
387 (day unsigned-int))
388
389(defbinding calendar-clear-marks () nil
390 (calendar calendar))
391
d76e9fca 392(defbinding calendar-get-date () nil
0f476ab5 393 (calendar calendar)
394 (year unsigned-int :out)
395 (month unsigned-int :out)
396 (day unsigned-int :out))
397
398(defbinding calendar-freeze () nil
399 (calendar calendar))
400
401(defbinding calendar-thaw () nil
402 (calendar calendar))
403
404
0f476ab5 405;;; Check menu item
406
407(defbinding check-menu-item-toggled () nil
408 (check-menu-item check-menu-item))
409
410
0f476ab5 411;;; Color selection
412
413(defbinding (color-selection-is-adjusting-p
414 "gtk_color_selection_is_adjusting") () boolean
415 (colorsel color-selection))
416
417
418
419;;; Color selection dialog -- no functions
420
421
422
1a1949c7 423;;;; Combo Box
0f476ab5 424
d76e9fca 425(defmethod initialize-instance ((combo-box combo-box) &rest initargs
426 &key model content active)
427 (remf initargs :active)
428 (if model
429 (apply #'call-next-method combo-box initargs)
430 (progn
431 (apply #'call-next-method combo-box
432 :model (make-instance 'list-store :column-types '(string))
433 initargs)
434 (unless (typep combo-box 'combo-box-entry)
435 (let ((cell (make-instance 'cell-renderer-text)))
436 (cell-layout-pack combo-box cell :expand t)
437 (cell-layout-add-attribute combo-box cell :text 0)))))
438 (when content
439 (mapc #'(lambda (text)
440 (combo-box-append-text combo-box text))
441 content))
442 (when active
443 (setf (combo-box-active combo-box) active)))
444
1a1949c7 445
446;; (defmethod shared-initialize :after ((combo-box combo-box) names &key active)
447;; (when active
448;; (signal-emit combo-box 'changed)))
449
450(defbinding combo-box-append-text () nil
451 (combo-box combo-box)
452 (text string))
453
454(defbinding combo-box-insert-text () nil
455 (combo-box combo-box)
456 (position int)
457 (text string))
458
459(defbinding combo-box-prepend-text () nil
460 (combo-box combo-box)
461 (text string))
462
463#+gtk2.6
464(defbinding combo-box-get-active-text () string
465 (combo-box combo-box))
0f476ab5 466
1a1949c7 467(defbinding combo-box-popup () nil
468 (combo-box combo-box))
0f476ab5 469
1a1949c7 470(defbinding combo-box-popdown () nil
471 (combo-box combo-box))
472
473
474
475;;;; Combo Box Entry
476
d76e9fca 477(defmethod initialize-instance ((combo-box-entry combo-box-entry) &key model)
1a1949c7 478 (call-next-method)
479 (unless model
480 (setf (combo-box-entry-text-column combo-box-entry) 0)))
0f476ab5 481
482
48da76bf 483;;;; Dialog
0f476ab5 484
c49be931 485(defmethod shared-initialize ((dialog dialog) names &rest initargs
486 &key button buttons)
487 (declare (ignore button buttons))
488 (prog1
489 (call-next-method)
490 (initial-apply-add dialog #'dialog-add-button initargs :button :buttons)))
48da76bf 491
0f476ab5 492
14c94516 493(defun dialog-response-id (dialog response &optional create-p error-p)
494 "Returns a numeric response id"
495 (if (typep response 'response-type)
496 (response-type-to-int response)
497 (let ((responses (object-data dialog 'responses)))
498 (cond
499 ((and responses (position response responses :test #'equal)))
500 (create-p
1047e159 501 (cond
14c94516 502 (responses
503 (vector-push-extend response responses)
504 (1- (length responses)))
1047e159 505 (t
506 (setf
14c94516 507 (object-data dialog 'responses)
508 (make-array 1 :adjustable t :fill-pointer t
509 :initial-element response))
1047e159 510 0)))
511 (error-p
14c94516 512 (error "Invalid response: ~A" response))))))
0f476ab5 513
14c94516 514(defun dialog-find-response (dialog id)
515 "Finds a symbolic response given a numeric id"
516 (if (< id 0)
517 (int-to-response-type id)
518 (aref (object-data dialog 'responses) id)))
519
520
521(defmethod compute-signal-id ((dialog dialog) signal)
522 (if (dialog-response-id dialog signal)
523 (ensure-signal-id 'response dialog)
524 (call-next-method)))
525
526(defmethod compute-signal-function ((dialog dialog) signal function object)
527 (declare (ignore function object))
528 (let ((callback (call-next-method))
529 (id (dialog-response-id dialog signal)))
530 (if id
531 #'(lambda (dialog response)
532 (when (= response id)
533 (funcall callback dialog)))
534 callback)))
0f476ab5 535
48da76bf 536(defbinding dialog-run () nil
537 (dialog dialog))
0f476ab5 538
14c94516 539(defbinding dialog-response (dialog response) nil
0f476ab5 540 (dialog dialog)
14c94516 541 ((dialog-response-id dialog response nil t) int))
0f476ab5 542
543
544(defbinding %dialog-add-button () button
545 (dialog dialog)
546 (text string)
14c94516 547 (response-id int))
0f476ab5 548
1047e159 549(defun dialog-add-button (dialog label &optional (response label)
550 &key default object after)
40b2615c 551 "Adds a button to the dialog."
14c94516 552 (let* ((signal (if (functionp response)
553 label
554 response))
555 (id (dialog-response-id dialog signal t))
556 (button (%dialog-add-button dialog label id)))
1047e159 557 (when (functionp response)
14c94516 558 (signal-connect dialog signal response :object object :after after))
1047e159 559 (when default
14c94516 560 (%dialog-set-default-response dialog id))
0f476ab5 561 button))
562
563
14c94516 564(defbinding %dialog-add-action-widget () nil
0f476ab5 565 (dialog dialog)
566 (action-widget widget)
14c94516 567 (response-id int))
0f476ab5 568
1047e159 569(defun dialog-add-action-widget (dialog widget &optional (response widget)
570 &key default object after)
14c94516 571 (let* ((signal (if (functionp response)
572 widget
573 response))
574 (id (dialog-response-id dialog signal t)))
575 (unless (widget-hidden-p widget)
576 (widget-show widget))
577 (%dialog-add-action-widget dialog widget id)
1047e159 578 (when (functionp response)
14c94516 579 (signal-connect dialog signal response :object object :after after))
1047e159 580 (when default
14c94516 581 (%dialog-set-default-response dialog id))
0f476ab5 582 widget))
0f476ab5 583
0f476ab5 584
48da76bf 585(defbinding %dialog-set-default-response () nil
586 (dialog dialog)
14c94516 587 (response-id int))
0f476ab5 588
14c94516 589(defun dialog-set-default-response (dialog response)
48da76bf 590 (%dialog-set-default-response
14c94516 591 dialog (dialog-response-id dialog response nil t)))
0f476ab5 592
14c94516 593(defbinding dialog-set-response-sensitive (dialog response sensitive) nil
48da76bf 594 (dialog dialog)
14c94516 595 ((dialog-response-id dialog response nil t) int)
48da76bf 596 (sensitive boolean))
0f476ab5 597
40b2615c 598#+gtk2.6
647c99e5 599(defbinding alternative-dialog-button-order-p (&optional screen) boolean
600 (screen (or null gdk:screen)))
40b2615c 601
602#+gtk2.6
603(defbinding (dialog-set-alternative-button-order
604 "gtk_dialog_set_alternative_button_order_from_array")
605 (dialog new-order)
606 (dialog dialog)
607 ((length new-order) int)
14c94516 608 ((map 'vector #'(lambda (response)
609 (dialog-response-id dialog response nil t))
40b2615c 610 new-order) (vector int)))
0f476ab5 611
48da76bf 612
613(defmethod container-add ((dialog dialog) (child widget) &rest args)
1047e159 614 (apply #'container-add (dialog-vbox dialog) child args))
48da76bf 615
14c94516 616
48da76bf 617(defmethod container-remove ((dialog dialog) (child widget))
1047e159 618 (container-remove (dialog-vbox dialog) child))
0f476ab5 619
48da76bf 620(defmethod container-children ((dialog dialog))
1047e159 621 (container-children (dialog-vbox dialog)))
48da76bf 622
623(defmethod (setf container-children) (children (dialog dialog))
1047e159 624 (setf (container-children (dialog-vbox dialog)) children))
560af5c5 625
560af5c5 626
aaa6e6cb 627;;; Entry
560af5c5 628
aaa6e6cb 629(defbinding entry-get-layout-offsets () nil
630 (entry entry)
631 (x int :out)
632 (y int :out))
560af5c5 633
d76e9fca 634(defbinding entry-layout-index-to-text-index () int
635 (entry entry)
636 (layout-index int))
637
638(defbinding entry-text-index-to-layout-index () int
639 (entry entry)
640 (text-index int))
641
560af5c5 642
f45fd227 643;;; Entry Completion
644
645(def-callback-marshal %entry-completion-match-func
646 (boolean entry-completion string (copy-of tree-iter)))
647
648(defbinding entry-completion-set-match-func (completion function) nil
649 (completion entry-completion)
650 ((callback %entry-completion-match-func) pointer)
651 ((register-callback-function function) unsigned-int)
73572c12 652 ((callback user-data-destroy-func) pointer))
f45fd227 653
654(defbinding entry-completion-complete () nil
655 (completion entry-completion))
656
657#+gtk2.6
658(defbinding entry-completion-insert-prefix () nil
659 (completion entry-completion))
660
661(defbinding entry-completion-insert-action-text () nil
662 (completion entry-completion)
663 (index int)
664 (text string))
665
666(defbinding entry-completion-insert-action-markup () nil
667 (completion entry-completion)
668 (index int)
669 (markup string))
670
671(defbinding entry-completion-delete-action () nil
672 (completion entry-completion)
673 (index int))
674
675
68f519e0 676;;; File Chooser
677
678(defmethod initialize-instance ((file-chooser file-chooser) &rest initargs
679 &key filter filters shortcut-folder
680 shortcut-folders shortcut-folder-uti
681 shortcut-folder-uris)
682 (declare (ignore filter filters shortcut-folder shortcut-folders
683 shortcut-folder-uti shortcut-folder-uris))
684 (prog1
685 (call-next-method)
686 (initial-add file-chooser #'file-chooser-add-filter
687 initargs :filer :filters)
688 (initial-add file-chooser #'file-chooser-add-shortcut-folder
689 initargs :shortcut-folder :shortcut-folders)
690 (initial-add file-chooser #'file-chooser-add-shortcut-folder-uri
691 initargs :shortcut-folder-uri :shortcut-folders-uris)))
692
693
694(defbinding file-chooser-select-filename () boolean
695 (file-chooser file-chooser)
696 (filename string))
697
698(defbinding file-chooser-unselect-filename () nil
699 (file-chooser file-chooser)
700 (filename string))
701
702(defbinding file-chooser-select-all () boolean
703 (file-chooser file-chooser))
704
705(defbinding file-chooser-unselect-all () boolean
706 (file-chooser file-chooser))
707
708(defbinding file-chooser-get-filenames () (gslist string)
709 (file-chooser file-chooser))
710
711(defbinding file-chooser-select-uri () boolean
712 (file-chooser file-chooser)
713 (uri string))
714
715(defbinding file-chooser-unselect-uri () nil
716 (file-chooser file-chooser)
717 (uri string))
718
719(defbinding file-chooser-get-uris () (gslist string)
720 (file-chooser file-chooser))
721
722(defbinding file-chooser-add-filter () nil
723 (file-chooser file-chooser)
724 (filter file-filter))
725
726(defbinding file-chooser-remove-filter () nil
727 (file-chooser file-chooser)
728 (filter file-filter))
729
730(defbinding file-chooser-list-filters () (gslist file-filter)
731 (file-chooser file-chooser))
732
733(defbinding file-chooser-add-shortcut-folder () boolean
734 (file-chooser file-chooser)
735 (folder string)
736 (nil null))
737
738(defbinding file-chooser-remove-shortcut-folder () nil
739 (file-chooser file-chooser)
740 (folder string)
741 (nil null))
742
743(defbinding file-chooser-list-shortcut-folders () (gslist string)
744 (file-chooser file-chooser))
745
746(defbinding file-chooser-add-shortcut-folder-uri () boolean
747 (file-chooser file-chooser)
748 (uri string)
749 (nil null))
750
751(defbinding file-chooser-remove-shortcut-folder-uri () nil
752 (file-chooser file-chooser)
753 (uri string)
754 (nil null))
755
756(defbinding file-chooser-list-shortcut-folder-uris () (gslist string)
757 (file-chooser file-chooser))
758
759
760;;; File Filter
761
762(defmethod initialize-instance ((file-filter file-filter) &rest initargs
763 &key mime-type mime-types pattern patterns
764 pixbuf-formats)
765 (declare (ignore mime-type mime-types pattern patterns))
766 (prog1
767 (call-next-method)
768 (when pixbuf-formats
769 #-gtk2.6(warn "Initarg :PIXBUF-FORMATS not supportet in this version of Gtk")
770 #+gtk2.6(file-filter-add-pixbuf-formats file-filter))
771 (initial-add file-filter #'file-filter-add-mime-type
772 initargs :mime-type :mime-types)
773 (initial-add file-filter #'file-filter-add-pattern
774 initargs :pattern :patterns)))
775
776
777(defbinding file-filter-add-mime-type () nil
778 (filter file-filter)
779 (mime-type string))
780
781(defbinding file-filter-add-pattern () nil
782 (filter file-filter)
783 (pattern string))
784
785#+gtk2.6
786(defbinding file-filter-add-pixbuf-formats () nil
647c99e5 787 (filter file-filter))
68f519e0 788
789(def-callback-marshal %file-filter-func (boolean file-filter-info))
790
73572c12 791(defbinding file-filter-add-custom (filter needed function) nil
68f519e0 792 (filter file-filter)
793 (needed file-filter-flags)
794 ((callback %file-filter-func) pointer)
795 ((register-callback-function function) unsigned-int)
73572c12 796 ((callback user-data-destroy-func) pointer))
68f519e0 797
798(defbinding file-filter-get-needed () file-filter-flags
799 (filter file-filter))
800
801(defbinding file-filter-filter () boolean
802 (filter file-filter)
803 (filter-info file-filter-info))
804
805
806
1047e159 807;;; Image
808
809(defbinding image-set-from-file () nil
810 (image image)
811 (filename pathname))
812
d76e9fca 813(defmethod (setf image-pixmap) ((data vector) (image image))
814 (multiple-value-bind (pixmap mask) (gdk:pixmap-create data)
815 (setf (image-pixmap image) pixmap)
816 (setf (image-mask image) mask)))
817
818(defmethod initialize-instance ((image image) &rest initargs &key pixmap file)
819 (cond
820 ((typep pixmap 'vector)
821 (multiple-value-bind (pixmap mask) (gdk:pixmap-create pixmap)
822 (apply #'call-next-method image :pixmap pixmap :mask mask initargs)))
823 (file
824 (prog1
825 (call-next-method)
826 (image-set-from-file image file)))
827 ((call-next-method))))
1047e159 828
cb4bf772 829(defun create-image-widget (source &optional mask)
d76e9fca 830 (etypecase source
831 (gdk:pixbuf (make-instance 'image :pixbuf source))
832 (string (make-instance 'image :stock source))
833 (pathname (make-instance 'image :file source))
834 ((or list vector) (make-instance 'image :pixmap source))
835 (gdk:pixmap (make-instance 'image :pixmap source :mask mask))))
1047e159 836
1047e159 837
d76e9fca 838;;; Image menu item
1047e159 839
d76e9fca 840(defmethod initialize-instance ((item image-menu-item) &rest initargs &key image)
841 (if (and image (not (typep image 'widget)))
cb4bf772 842 (apply #'call-next-method item :image (create-image-widget image) initargs)
d76e9fca 843 (call-next-method)))
1047e159 844
d76e9fca 845
846(defmethod (setf image-menu-item-image) ((widget widget) (item image-menu-item))
847 (setf (slot-value item 'image) widget))
848
849(defmethod (setf image-menu-item-image) (image (item image-menu-item))
cb4bf772 850 (setf (image-menu-item-image item) (create-image-widget image)))
1047e159 851
560af5c5 852
0f476ab5 853;;; Label
560af5c5 854
aaa6e6cb 855(defbinding label-get-layout-offsets () nil
1047e159 856 (label label)
aaa6e6cb 857 (x int :out)
858 (y int :out))
859
0f476ab5 860(defbinding label-select-region () nil
861 (label label)
862 (start int)
863 (end int))
560af5c5 864
1047e159 865(defbinding label-get-selection-bounds () boolean
aaa6e6cb 866 (label label)
867 (start int :out)
868 (end int :out))
f36ca6af 869
560af5c5 870
871
872;;; Radio button
873
e5b416f0 874(defbinding %radio-button-get-group () pointer
d520140e 875 (radio-button radio-button))
876
bbaeff4b 877(defbinding %radio-button-set-group () nil
d520140e 878 (radio-button radio-button)
879 (group pointer))
560af5c5 880
cb4bf772 881(defmethod add-to-radio-group ((button1 radio-button) (button2 radio-button))
d520140e 882 "Add BUTTON1 to the group which BUTTON2 belongs to."
883 (%radio-button-set-group button1 (%radio-button-get-group button2)))
884
d76e9fca 885(defmethod initialize-instance ((button radio-button) &key group)
886 (prog1
887 (call-next-method)
888 (when group
cb4bf772 889 (add-to-radio-group button group))))
560af5c5 890
891
560af5c5 892;;; Item
893
bbaeff4b 894(defbinding item-select () nil
560af5c5 895 (item item))
896
bbaeff4b 897(defbinding item-deselect () nil
560af5c5 898 (item item))
899
bbaeff4b 900(defbinding item-toggle () nil
560af5c5 901 (item item))
902
903
904
905;;; Menu item
906
d76e9fca 907(defmethod initialize-instance ((item menu-item) &key label)
908 (prog1
909 (call-next-method)
910 (when label
911 (setf (menu-item-label item) label))))
912
913
f36ca6af 914(defun (setf menu-item-label) (label menu-item)
915 (make-instance 'accel-label
916 :label label :xalign 0.0 :yalign 0.5 :accel-widget menu-item
d76e9fca 917 :use-underline (menu-item-use-underline-p menu-item)
918 :visible t :parent menu-item)
f36ca6af 919 label)
560af5c5 920
f5b67f2b 921(defun menu-item-label (menu-item)
d76e9fca 922 (when (and (slot-boundp menu-item 'child)
923 (typep (bin-child menu-item) 'label))
924 (label-label (bin-child menu-item))))
f5b67f2b 925
d76e9fca 926(defbinding menu-item-remove-submenu () nil
f36ca6af 927 (menu-item menu-item))
560af5c5 928
f5b67f2b 929(defbinding menu-item-set-accel-path () nil
930 (menu-item menu-item)
931 (accel-path string))
932
bbaeff4b 933(defbinding menu-item-select () nil
f36ca6af 934 (menu-item menu-item))
560af5c5 935
bbaeff4b 936(defbinding menu-item-deselect () nil
f36ca6af 937 (menu-item menu-item))
560af5c5 938
bbaeff4b 939(defbinding menu-item-activate () nil
f36ca6af 940 (menu-item menu-item))
560af5c5 941
f5b67f2b 942(defbinding menu-item-toggle-size-request () nil
943 (menu-item menu-item)
944 (requisition int :out))
945
946(defbinding menu-item-toggle-size-allocate () nil
947 (menu-item menu-item)
948 (allocation int))
949
560af5c5 950
d76e9fca 951;;; Menu tool button
952
953#+gtk2.6
647c99e5 954(defbinding menu-tool-button-set-arrow-tooltip () nil
d76e9fca 955 (menu-tool-button menu-tool-button)
956 (tooltips tooltips)
957 (tip-text string)
958 (tip-private string))
959
960
f4267180 961;;; Message dialog
962
963(defmethod initialize-instance ((dialog message-dialog) &rest initargs
964 &key (type :info) (buttons :close) ; or :ok?
965 flags message parent)
966 (remf initargs :parent)
967 (setf
968 (slot-value dialog 'location)
969 (%message-dialog-new parent flags type buttons nil))
970 (message-dialog-set-markup dialog message)
971 (apply #'call-next-method dialog initargs))
972
973
974(defbinding %message-dialog-new () pointer
975 (parent (or null window))
976 (flags dialog-flags)
977 (type message-type)
978 (buttons buttons-type)
979 (message (or null string)))
980
981(defbinding %message-dialog-new-with-markup () pointer
982 (parent (or null window))
983 (flags dialog-flags)
984 (type message-type)
985 (buttons buttons-type)
986 (message string))
987
988(defbinding message-dialog-set-markup () nil
989 (message-dialog message-dialog)
990 (markup string))
991
992#+gtk2.6
993(defbinding message-dialog-format-secondary-text () nil
994 (message-dialog message-dialog)
995 (text string))
996
997#+gtk2.6
998(defbinding message-dialog-format-secondary-markup () nil
999 (message-dialog message-dialog)
1000 (markup string))
1001
1002
560af5c5 1003
f36ca6af 1004;;; Radio menu item
560af5c5 1005
e5b416f0 1006(defbinding %radio-menu-item-get-group () pointer
d520140e 1007 (radio-menu-item radio-menu-item))
1008
bbaeff4b 1009(defbinding %radio-menu-item-set-group () nil
d520140e 1010 (radio-menu-item radio-menu-item)
1011 (group pointer))
1012
cb4bf772 1013(defmethod add-to-radio-group ((item1 radio-menu-item) (item2 radio-menu-item))
d520140e 1014 "Add ITEM1 to the group which ITEM2 belongs to."
1015 (%radio-menu-item-set-group item1 (%radio-menu-item-get-group item2)))
1016
d76e9fca 1017(defmethod initialize-instance ((item radio-menu-item) &key group)
f5b67f2b 1018 (prog1
1019 (call-next-method)
d76e9fca 1020 (when group
cb4bf772 1021 (add-to-radio-group item group))))
1022
d520140e 1023
560af5c5 1024
d76e9fca 1025;;; Radio tool button
1026
1027(defbinding %radio-tool-button-get-group () pointer
1028 (radio-tool-button radio-tool-button))
1029
1030(defbinding %radio-tool-button-set-group () nil
1031 (radio-tool-button radio-tool-button)
1032 (group pointer))
1033
cb4bf772 1034(defmethod add-to-radio-group ((button1 radio-tool-button) (button2 radio-tool-button))
d76e9fca 1035 "Add BUTTON1 to the group which BUTTON2 belongs to."
1036 (%radio-tool-button-set-group button1 (%radio-tool-button-get-group button2)))
1037
cb4bf772 1038(defmethod add-activate-callback ((widget widget) function &key object after)
1039 (if object
1040 (signal-connect widget 'clicked
1041 #'(lambda (object)
1042 (when (slot-value widget 'active)
1043 (funcall function object (slot-value widget 'value))))
1044 :object object :after after)
1045 (signal-connect widget 'clicked
1046 #'(lambda ()
1047 (when (slot-value widget 'active)
1048 (funcall function (slot-value widget 'value))))
1049 :after after)))
d76e9fca 1050
1051(defmethod initialize-instance ((button radio-tool-button) &key group)
1052 (prog1
1053 (call-next-method)
1054 (when group
cb4bf772 1055 (add-to-radio-group button group))))
1056
d76e9fca 1057
560af5c5 1058
aaa6e6cb 1059;;; Toggle button
1060
1061(defbinding toggle-button-toggled () nil
1062 (toggle-button toggle-button))
1063
1064
560af5c5 1065;;; Window
1066
c49be931 1067(defmethod initialize-instance ((window window) &rest initargs
1068 &key accel-group accel-groups)
1069 (declare (ignore accel-group accel-groups))
1070 (prog1
1071 (call-next-method)
1072 (initial-add window #'window-add-accel-group
1073 initargs :accel-group :accel-groups)))
73d58e01 1074
1075
7625ebd8 1076(defbinding window-set-wmclass () nil
560af5c5 1077 (window window)
1078 (wmclass-name string)
1079 (wmclass-class string))
1080
bbaeff4b 1081(defbinding window-add-accel-group () nil
560af5c5 1082 (window window)
1083 (accel-group accel-group))
1084
bbaeff4b 1085(defbinding window-remove-accel-group () nil
560af5c5 1086 (window window)
1087 (accel-group accel-group))
1088
bbaeff4b 1089(defbinding window-activate-focus () int
560af5c5 1090 (window window))
1091
bbaeff4b 1092(defbinding window-activate-default () int
560af5c5 1093 (window window))
1094
7625ebd8 1095(defbinding window-set-default-size (window width height) int
560af5c5 1096 (window window)
7625ebd8 1097 ((or width -1) int)
1098 ((or height -1) int))
560af5c5 1099
4d16221f 1100(defbinding %window-set-geometry-hints () nil
1101 (window window)
1102 (geometry gdk:geometry)
1103 (geometry-mask gdk:window-hints))
1104
1105(defun window-set-geometry-hints (window &key min-width min-height
1106 max-width max-height base-width base-height
1107 width-inc height-inc min-aspect max-aspect
1108 (gravity nil gravity-p) min-size max-size)
1109 (let ((geometry (make-instance 'gdk:geometry
1110 :min-width (or min-width -1)
1111 :min-height (or min-height -1)
1112 :max-width (or max-width -1)
1113 :max-height (or max-height -1)
1114 :base-width (or base-width 0)
1115 :base-height (or base-height 0)
1116 :width-inc (or width-inc 0)
1117 :height-inc (or height-inc 0)
1118 :min-aspect (or min-aspect 0)
1119 :max-aspect (or max-aspect 0)
1120 :gravity gravity))
1121 (mask ()))
1122 (when (or min-size min-width min-height)
1123 (push :min-size mask))
1124 (when (or max-size max-width max-height)
1125 (push :max-size mask))
1126 (when (or base-width base-height)
1127 (push :base-size mask))
1128 (when (or width-inc height-inc)
1129 (push :resize-inc mask))
1130 (when (or min-aspect max-aspect)
1131 (push :aspect mask))
1132 (when gravity-p
1133 (push :win-gravity mask))
1134 (%window-set-geometry-hints window geometry mask)))
560af5c5 1135
73d58e01 1136(defbinding window-list-toplevels () (glist (copy-of window))
1137 "Returns a list of all existing toplevel windows.")
7625ebd8 1138
1139(defbinding window-add-mnemonic (window key target) nil
1140 (window window)
1141 ((gdk:keyval-from-name key) unsigned-int)
1142 (target widget))
1143
1144(defbinding window-remove-mnemonic (window key target) nil
1145 (window window)
1146 ((gdk:keyval-from-name key) unsigned-int)
1147 (target widget))
1148
1149(defbinding window-mnemonic-activate (window key modifier) nil
1150 (window window)
1151 ((gdk:keyval-from-name key) unsigned-int)
1152 (modifier gdk:modifier-type))
1153
4d16221f 1154(defbinding window-activate-key () boolean
1155 (window window)
1156 (event gdk:key-event))
1157
1158(defbinding window-propagate-key-event () boolean
1159 (window window)
1160 (event gdk:key-event))
1161
7625ebd8 1162(defbinding window-present () nil
1163 (window window))
1164
1165(defbinding window-iconify () nil
1166 (window window))
1167
1168(defbinding window-deiconify () nil
1169 (window window))
1170
1171(defbinding window-stick () nil
1172 (window window))
1173
1174(defbinding window-unstick () nil
1175 (window window))
1176
1177(defbinding window-maximize () nil
1178 (window window))
1179
1180(defbinding window-unmaximize () nil
1181 (window window))
1182
4d16221f 1183(defbinding window-fullscreen () nil
1184 (window window))
1185
1186(defbinding window-unfullscreen () nil
1187 (window window))
1188
1189(defbinding window-set-keep-above () nil
1190 (window window)
1191 (setting boolean))
1192
1193(defbinding window-set-keep-below () nil
1194 (window window)
1195 (setting boolean))
1196
7625ebd8 1197(defbinding window-begin-resize-drag () nil
1198 (window window)
1199 (edge gdk:window-edge)
1200 (button int)
1201 (root-x int) (root-y int)
9adccb27 1202 (timestamp unsigned-int))
7625ebd8 1203
1204(defbinding window-begin-move-drag () nil
1205 (window window)
1206 (edge gdk:window-edge)
1207 (button int)
1208 (root-x int) (root-y int)
9adccb27 1209 (timestamp unsigned-int))
7625ebd8 1210
1211(defbinding window-set-frame-dimensions () nil
1212 (window window)
1213 (left int) (top int) (rigth int) (bottom int))
1214
7625ebd8 1215(defbinding %window-get-default-size () nil
1216 (window window)
1217 (width int :out)
1218 (height int :out))
1219
1220(defun window-get-default-size (window)
1221 (multiple-value-bind (width height) (%window-get-default-size window)
1222 (values (unless (= width -1) width) (unless (= height -1) height))))
1223
1224(defbinding window-get-frame-dimensions () nil
1225 (window window)
1226 (left int :out) (top int :out) (rigth int :out) (bottom int :out))
1227
1228(defbinding %window-get-icon-list () (glist gdk:pixbuf)
1229 (window window))
1230
7625ebd8 1231(defbinding window-get-position () nil
1232 (window window)
1233 (root-x int :out)
1234 (root-y int :out))
1235
1236(defbinding window-get-size () nil
1237 (window window)
1238 (width int :out)
1239 (height int :out))
1240
1241(defbinding window-move () nil
1242 (window window)
1243 (x int)
1244 (y int))
1245
1246(defbinding window-parse-geometry () boolean
1247 (window window)
1248 (geometry string))
1249
1250(defbinding window-reshow-with-initial-size () nil
1251 (window window))
1252
1253(defbinding window-resize () nil
1254 (window window)
1255 (width int)
1256 (heigth int))
1257
4d16221f 1258(defbinding (window-default-icon-list "gtk_window_get_default_icon_list")
1259 () (glist gdk:pixbuf))
1260
1261(defun window-default-icon ()
1262 (first (window-default-icon-list)))
1263
1264(defbinding %window-set-default-icon-list () nil
1265 (icons (glist gdk:pixbuf)))
1266
1267(defun (setf window-default-icon-list) (icons)
1268 (%window-set-default-icon-list icons)
1269 icons)
1270
1271(defbinding %window-set-default-icon () nil
1272 (icons (glist gdk:pixbuf)))
1273
1274(defmethod (setf window-default-icon) ((icon gdk:pixbuf))
1275 (%window-set-default-icon icon)
1276 icon)
1277
1278(defmethod (setf window-group) ((group window-group) (window window))
1279 (window-group-add-window group window)
1280 group)
1281
1282(defbinding %window-set-default-icon-from-file () boolean
1283 (filename pathname)
1284 (nil null))
1285
1286(defmethod (setf window-default-icon) ((icon-file pathname))
1287 (%window-set-default-icon-from-file icon-file)
1288 icon-file)
1289
1290(defbinding %window-set-icon-from-file () boolean
1291 (window window)
1292 (filename pathname)
1293 (nil null))
1294
1295(defmethod (setf window-icon) ((icon-file pathname) (window window))
1296 (%window-set-icon-from-file window icon-file)
1297 icon-file)
1298
1299(defbinding window-set-auto-startup-notification () nil
1300 (setting boolean))
1301
1302(defbinding decorated-window-init () nil
1303 (window window))
1304
1305(defbinding decorated-window-calculate-frame-size () nil
1306 (window window))
1307
1308(defbinding decorated-window-set-title () nil
7625ebd8 1309 (window window)
4d16221f 1310 (title string))
7625ebd8 1311
4d16221f 1312(defbinding decorated-window-move-resize-window () nil
1313 (window window)
1314 (x int)
1315 (y int)
1316 (width int)
1317 (heigth int))
7625ebd8 1318
1319
4d16221f 1320;;; Window group
560af5c5 1321
4d16221f 1322(defmethod initialize-instance ((window-group window-group) &rest initargs
1323 &key window windows)
1324 (declare (ignore window windows))
1325 (prog1
1326 (call-next-method)
1327 (initial-add window-group #'window-group-add-window
1328 initargs :window :windows)))
560af5c5 1329
560af5c5 1330
4d16221f 1331(defbinding window-group-add-window () nil
1332 (window-group window-group)
1333 (window window))
560af5c5 1334
4d16221f 1335(defbinding window-group-remove-window () nil
1336 (window-group window-group)
1337 (window window))
560af5c5 1338
1339
f36ca6af 1340;;; Scrolled window
560af5c5 1341
560af5c5 1342(defun (setf scrolled-window-scrollbar-policy) (policy window)
1343 (setf (scrolled-window-hscrollbar-policy window) policy)
1344 (setf (scrolled-window-vscrollbar-policy window) policy))
1345
bbaeff4b 1346(defbinding scrolled-window-add-with-viewport () nil
560af5c5 1347 (scrolled-window scrolled-window)
1348 (child widget))
1349
d76e9fca 1350(defmethod initialize-instance ((window scrolled-window) &rest initargs
1351 &key policy)
1352 (if policy
1353 (apply #'call-next-method window
1354 :vscrollbar-policy policy :hscrollbar-policy policy initargs)
1355 (call-next-method)))
d520140e 1356
560af5c5 1357
f36ca6af 1358;;; Statusbar
560af5c5 1359
d76e9fca 1360(defbinding statusbar-get-context-id () unsigned-int
f36ca6af 1361 (statusbar statusbar)
1362 (context-description string))
560af5c5 1363
bbaeff4b 1364(defbinding statusbar-push () unsigned-int
f36ca6af 1365 (statusbar statusbar)
1366 (context-id unsigned-int)
1367 (text string))
560af5c5 1368
bbaeff4b 1369(defbinding statusbar-pop () nil
f36ca6af 1370 (statusbar statusbar)
1371 (context-id unsigned-int))
560af5c5 1372
bbaeff4b 1373(defbinding statusbar-remove () nil
f36ca6af 1374 (statusbar statusbar)
1375 (context-id unsigned-int)
1376 (message-id unsigned-int))
560af5c5 1377
560af5c5 1378
1379
1380;;; Fixed
1381
bbaeff4b 1382(defbinding fixed-put () nil
f36ca6af 1383 (fixed fixed)
1384 (widget widget)
f5b67f2b 1385 (x int) (y int))
560af5c5 1386
bbaeff4b 1387(defbinding fixed-move () nil
f36ca6af 1388 (fixed fixed)
1389 (widget widget)
f5b67f2b 1390 (x int) (y int))
560af5c5 1391
1392
1393
d520140e 1394;;; Notebook
560af5c5 1395
68f519e0 1396(defun %ensure-notebook-position (notebook page)
f5b67f2b 1397 (etypecase page
68f519e0 1398 (position page)
f5b67f2b 1399 (widget (notebook-page-num notebook page t))))
1400
68f519e0 1401(defun %ensure-notebook-child (notebook position)
f5b67f2b 1402 (typecase position
1403 (widget position)
68f519e0 1404 (t (notebook-get-nth-page notebook position))))
f5b67f2b 1405
1406(defbinding (notebook-insert "gtk_notebook_insert_page_menu")
f36ca6af 1407 (notebook position child tab-label &optional menu-label) nil
1408 (notebook notebook)
1409 (child widget)
1410 ((if (stringp tab-label)
f5b67f2b 1411 (make-instance 'label :label tab-label)
f36ca6af 1412 tab-label) widget)
1413 ((if (stringp menu-label)
f5b67f2b 1414 (make-instance 'label :label menu-label)
f36ca6af 1415 menu-label) (or null widget))
68f519e0 1416 ((%ensure-notebook-position notebook position) position))
560af5c5 1417
f5b67f2b 1418(defun notebook-append (notebook child tab-label &optional menu-label)
1419 (notebook-insert notebook :last child tab-label menu-label))
560af5c5 1420
f5b67f2b 1421(defun notebook-prepend (notebook child tab-label &optional menu-label)
1422 (notebook-insert notebook :first child tab-label menu-label))
560af5c5 1423
f5b67f2b 1424(defbinding notebook-remove-page (notebook page) nil
f36ca6af 1425 (notebook notebook)
68f519e0 1426 ((%ensure-notebook-position notebook page) position))
560af5c5 1427
bbaeff4b 1428(defbinding %notebook-page-num () int
f36ca6af 1429 (notebook notebook)
1430 (child widget))
1431
f5b67f2b 1432(defun notebook-page-num (notebook child &optional error-p)
f36ca6af 1433 (let ((page-num (%notebook-page-num notebook child)))
1434 (if (= page-num -1)
f5b67f2b 1435 (when error-p
68f519e0 1436 (error "~A is not a page in ~A" child notebook))
f36ca6af 1437 page-num)))
1438
bbaeff4b 1439(defbinding notebook-next-page () nil
f36ca6af 1440 (notebook notebook))
560af5c5 1441
bbaeff4b 1442(defbinding notebook-prev-page () nil
f36ca6af 1443 (notebook notebook))
1444
f5b67f2b 1445(defbinding notebook-reorder-child (notebook child position) nil
1446 (notebook notebook)
1447 (child widget)
1448 ((%notebook-position notebook position) int))
1449
bbaeff4b 1450(defbinding notebook-popup-enable () nil
f36ca6af 1451 (notebook notebook))
1452
bbaeff4b 1453(defbinding notebook-popup-disable () nil
f36ca6af 1454 (notebook notebook))
1455
68f519e0 1456(defbinding notebook-get-nth-page () widget
f5b67f2b 1457 (notebook notebook)
68f519e0 1458 (page position))
f5b67f2b 1459
68f519e0 1460(defun %notebook-current-page (notebook)
1461 (when (slot-boundp notebook 'current-page-num)
1462 (notebook-get-nth-page notebook (notebook-current-page-num notebook))))
f5b67f2b 1463
1464(defun (setf notebook-current-page) (page notebook)
68f519e0 1465 (setf (notebook-current-page notebook) (notebook-page-num notebook page)))
f5b67f2b 1466
1047e159 1467(defbinding (notebook-tab-label "gtk_notebook_get_tab_label")
1468 (notebook page) widget
1469 (notebook notebook)
68f519e0 1470 ((%ensure-notebook-child notebook page) widget))
f5b67f2b 1471
1047e159 1472(defbinding (notebook-tab-label-text "gtk_notebook_get_tab_label_text")
6bb23851 1473 (notebook page) (copy-of string)
1047e159 1474 (notebook notebook)
68f519e0 1475 ((%ensure-notebook-child notebook page) widget))
f5b67f2b 1476
1047e159 1477(defbinding %notebook-set-tab-label () nil
1478 (notebook notebook)
1479 (page widget)
1480 (tab-label widget))
1481
1482(defun (setf notebook-tab-label) (tab-label notebook page)
1483 (let ((widget (if (stringp tab-label)
1484 (make-instance 'label :label tab-label)
1485 tab-label)))
68f519e0 1486 (%notebook-set-tab-label notebook (%ensure-notebook-child notebook page) widget)
1047e159 1487 widget))
f5b67f2b 1488
f5b67f2b 1489
1047e159 1490(defbinding (notebook-menu-label "gtk_notebook_get_menu_label")
1491 (notebook page) widget
1492 (notebook notebook)
68f519e0 1493 ((%ensure-notebook-child notebook page) widget))
f5b67f2b 1494
1047e159 1495(defbinding (notebook-menu-label-text "gtk_notebook_get_menu_label_text")
6bb23851 1496 (notebook page) (copy-of string)
1047e159 1497 (notebook notebook)
68f519e0 1498 ((%ensure-notebook-child notebook page) widget))
f5b67f2b 1499
1047e159 1500(defbinding %notebook-set-menu-label () nil
1501 (notebook notebook)
1502 (page widget)
1503 (menu-label widget))
1504
1505(defun (setf notebook-menu-label) (menu-label notebook page)
1506 (let ((widget (if (stringp menu-label)
1507 (make-instance 'label :label menu-label)
1508 menu-label)))
68f519e0 1509 (%notebook-set-menu-label notebook (%ensure-notebook-child notebook page) widget)
1047e159 1510 widget))
f5b67f2b 1511
1512
1513(defbinding notebook-query-tab-label-packing (notebook page) nil
f36ca6af 1514 (notebook notebook)
f5b67f2b 1515 ((%notebook-child notebook page) widget)
f36ca6af 1516 (expand boolean :out)
1517 (fill boolean :out)
1518 (pack-type pack-type :out))
1519
f5b67f2b 1520(defbinding notebook-set-tab-label-packing
1521 (notebook page expand fill pack-type) nil
f36ca6af 1522 (notebook notebook)
f5b67f2b 1523 ((%notebook-child notebook page) widget)
f36ca6af 1524 (expand boolean)
1525 (fill boolean)
1526 (pack-type pack-type))
1527
560af5c5 1528
1529
d520140e 1530;;; Paned
560af5c5 1531
bbaeff4b 1532(defbinding paned-pack1 () nil
d520140e 1533 (paned paned)
1534 (child widget)
1535 (resize boolean)
1536 (shrink boolean))
560af5c5 1537
bbaeff4b 1538(defbinding paned-pack2 () nil
d520140e 1539 (paned paned)
1540 (child widget)
1541 (resize boolean)
1542 (shrink boolean))
560af5c5 1543
560af5c5 1544
d520140e 1545;;; Layout
560af5c5 1546
bbaeff4b 1547(defbinding layout-put () nil
d520140e 1548 (layout layout)
68f519e0 1549 (child widget)
d520140e 1550 (x int)
1551 (y int))
560af5c5 1552
bbaeff4b 1553(defbinding layout-move () nil
d520140e 1554 (layout layout)
68f519e0 1555 (child widget)
d520140e 1556 (x int)
1557 (y int))
560af5c5 1558
68f519e0 1559(defbinding layout-set-size () nil
1560 (layout layout)
1561 (width unsigned-int)
1562 (height unsigned-int))
1563
1564(defbinding layout-get-size () nil
1565 (layout layout)
1566 (width unsigned-int :out)
1567 (height unsigned-int :out))
560af5c5 1568
1569
560af5c5 1570;;; Menu shell
1571
f5b67f2b 1572(defbinding menu-shell-insert (menu-shell menu-item position) nil
f36ca6af 1573 (menu-shell menu-shell)
1574 (menu-item menu-item)
f5b67f2b 1575 ((case position
1576 (:first 0)
1577 (:last -1)
1578 (t position)) int))
560af5c5 1579
f36ca6af 1580(defun menu-shell-append (menu-shell menu-item)
f5b67f2b 1581 (menu-shell-insert menu-shell menu-item :last))
560af5c5 1582
f36ca6af 1583(defun menu-shell-prepend (menu-shell menu-item)
f5b67f2b 1584 (menu-shell-insert menu-shell menu-item :fisrt))
560af5c5 1585
bbaeff4b 1586(defbinding menu-shell-deactivate () nil
f36ca6af 1587 (menu-shell menu-shell))
560af5c5 1588
bbaeff4b 1589(defbinding menu-shell-select-item () nil
f36ca6af 1590 (menu-shell menu-shell)
1591 (menu-item menu-item))
560af5c5 1592
d76e9fca 1593(defbinding menu-shell-select-first () nil
1594 (menu-shell menu-shell)
1595 (search-sensitive boolean))
1596
bbaeff4b 1597(defbinding menu-shell-deselect () nil
f36ca6af 1598 (menu-shell menu-shell))
560af5c5 1599
bbaeff4b 1600(defbinding menu-shell-activate-item () nil
f36ca6af 1601 (menu-shell menu-shell)
1602 (menu-item menu-item)
1603 (fore-deactivate boolean))
560af5c5 1604
d76e9fca 1605(defbinding menu-shell-cancel () nil
1606 (menu-shell menu-shell))
560af5c5 1607
1608
f5b67f2b 1609;;; Menu
560af5c5 1610
f5b67f2b 1611(defun %menu-position (menu child)
1612 (etypecase child
1613 (int child)
1614 (keyword (case child
1615 (:first 0)
1616 (:last -1)
1047e159 1617 (t (error "Invalid position keyword: ~A" child))))
f5b67f2b 1618 (widget (menu-child-position menu child))))
560af5c5 1619
1620
f5b67f2b 1621(defbinding menu-reorder-child (menu menu-item position) nil
1622 (menu menu)
1623 (menu-item menu-item)
1624 ((%menu-position menu position) int))
560af5c5 1625
d76e9fca 1626(defbinding menu-attach () nil
1627 (menu menu)
1628 (menu-item menu-item)
1629 (left-attach unsigned-int)
1630 (right-attach unsigned-int)
1631 (top-attach unsigned-int)
1632 (bottom-attach unsigned-int))
1633
1634(def-callback-marshal %menu-position-func (nil (menu menu) (x int) (y int) (push-in boolean)))
560af5c5 1635
f5b67f2b 1636(defbinding %menu-popup () nil
1637 (menu menu)
1638 (parent-menu-shell (or null menu-shell))
1639 (parent-menu-item (or null menu-item))
1640 (callback-func (or null pointer))
1641 (callback-id unsigned-int)
1642 (button unsigned-int)
1643 (activate-time (unsigned 32)))
1644
1645(defun menu-popup (menu button activate-time &key callback parent-menu-shell
1646 parent-menu-item)
1647 (if callback
1a1949c7 1648 (with-callback-function (id callback)
1649 (%menu-popup
1650 menu parent-menu-shell parent-menu-item
d76e9fca 1651 (callback %menu-position-func) id button activate-time))
f5b67f2b 1652 (%menu-popup
1653 menu parent-menu-shell parent-menu-item nil 0 button activate-time)))
1654
1655(defbinding menu-set-accel-path () nil
1656 (menu menu)
1657 (accel-path string))
560af5c5 1658
bbaeff4b 1659(defbinding menu-reposition () nil
f36ca6af 1660 (menu menu))
560af5c5 1661
bbaeff4b 1662(defbinding menu-popdown () nil
f36ca6af 1663 (menu menu))
560af5c5 1664
f5b67f2b 1665(defun menu-child-position (menu child)
1666 (position child (container-children menu)))
1667
1668(defun menu-active-num (menu)
1669 (menu-child-position menu (menu-active menu)))
1670
bbaeff4b 1671(defbinding %menu-set-active () nil
f36ca6af 1672 (menu menu)
1673 (index unsigned-int))
560af5c5 1674
f5b67f2b 1675(defun (setf menu-active) (menu child)
1676 (%menu-set-active menu (%menu-position menu child))
1677 child)
d520140e 1678
d76e9fca 1679(defcallback %menu-detach-func (nil (widget widget) (menu menu))
1680 (funcall (object-data menu 'detach-func) widget menu))
1681
1682(defbinding %menu-attach-to-widget () nil
1683 (menu menu)
1684 (widget widget)
1685 ((callback %menu-detach-func) pointer))
1686
1687(defun menu-attach-to-widget (menu widget function)
1688 (setf (object-data menu 'detach-func) function)
1689 (%menu-attach-to-widget menu widget))
1690
1691(defbinding menu-detach () nil
1692 (menu menu))
1693
1694#+gtk2.6
1695(defbinding menu-get-for-attach-widget () (copy-of (glist widget))
1696 (widget widget))
1697
1698(defbinding menu-set-monitor () nil
1699 (menu menu)
1700 (monitor-num int))
560af5c5 1701
1702
f36ca6af 1703;;; Table
560af5c5 1704
bbaeff4b 1705(defbinding table-resize () nil
f36ca6af 1706 (table table)
1707 (rows unsigned-int)
1708 (columns unsigned-int))
560af5c5 1709
bbaeff4b 1710(defbinding table-attach (table child left right top bottom
c49be931 1711 &key options x-options y-options
1712 (x-padding 0) (y-padding 0)) nil
f36ca6af 1713 (table table)
1714 (child widget)
1715 (left unsigned-int)
1716 (right unsigned-int)
1717 (top unsigned-int)
1718 (bottom unsigned-int)
c49be931 1719 ((append (mklist options) (mklist x-options)) attach-options)
1720 ((append (mklist options) (mklist y-options)) attach-options)
f36ca6af 1721 (x-padding unsigned-int)
1722 (y-padding unsigned-int))
1723
e5b416f0 1724
bbaeff4b 1725(defbinding %table-set-row-spacing () nil
f36ca6af 1726 (table table)
1727 (row unsigned-int)
1728 (spacing unsigned-int))
1729
e5b416f0 1730(defbinding %table-set-row-spacings () nil
1731 (table table)
1732 (spacing unsigned-int))
1733
1734(defun (setf table-row-spacing) (spacing table &optional row)
1735 (if row
1736 (%table-set-row-spacing table row spacing)
1737 (%table-set-row-spacings table spacing))
f36ca6af 1738 spacing)
1739
e5b416f0 1740(defbinding %table-get-row-spacing () unsigned-int
f36ca6af 1741 (table table)
e5b416f0 1742 (row unsigned-int))
1743
1744(defbinding %table-get-default-row-spacing () unsigned-int
1745 (table table))
1746
1747(defun table-row-spacing (table &optional row)
1748 (if row
1749 (%table-get-row-spacing table row)
1750 (%table-get-default-row-spacing table)))
1751
f36ca6af 1752
bbaeff4b 1753(defbinding %table-set-col-spacing () nil
f36ca6af 1754 (table table)
1755 (col unsigned-int)
1756 (spacing unsigned-int))
1757
e5b416f0 1758(defbinding %table-set-col-spacings () nil
1759 (table table)
1760 (spacing unsigned-int))
1761
1762(defun (setf table-col-spacing) (spacing table &optional col)
1763 (if col
1764 (%table-set-col-spacing table col spacing)
1765 (%table-set-col-spacings table spacing))
f36ca6af 1766 spacing)
1767
e5b416f0 1768(defbinding %table-get-col-spacing () unsigned-int
f36ca6af 1769 (table table)
e5b416f0 1770 (col unsigned-int))
1771
1772(defbinding %table-get-default-col-spacing () unsigned-int
1773 (table table))
1774
1775(defun table-col-spacing (table &optional col)
1776 (if col
1777 (%table-get-col-spacing table col)
1778 (%table-get-default-col-spacing table)))
1779
1780
f36ca6af 1781
1782;;; Toolbar
1783
cb4bf772 1784(defmethod initialize-instance ((toolbar toolbar) &rest initargs &key tooltips)
1785 (if (eq tooltips t)
1786 (apply #'call-next-method toolbar
1787 :tooltips (make-instance 'tooltips) initargs)
1788 (call-next-method)))
560af5c5 1789
cb4bf772 1790(defbinding %toolbar-insert () nil
f5b67f2b 1791 (toolbar toolbar)
cb4bf772 1792 (tool-item tool-item)
1793 (position position))
f36ca6af 1794
cb4bf772 1795(defun toolbar-insert (toolbar tool-item &optional (position :end))
1796 (%toolbar-insert toolbar tool-item position)
1797 (%tool-item-update-tooltips tool-item))
f5b67f2b 1798
cb4bf772 1799(defbinding toolbar-get-item-index () int
1800 (toolbar toolbar)
1801 (item tool-item))
f36ca6af 1802
cb4bf772 1803(defbinding toolbar-get-nth-item () tool-item
1804 (toolbar toolbar)
1805 (n int))
f36ca6af 1806
cb4bf772 1807(defbinding toolbar-get-drop-index () int
1808 (toolbar toolbar)
1809 (x int) (y int))
f36ca6af 1810
cb4bf772 1811(defbinding toolbar-set-drop-highlight-item () nil
1812 (toolbar toolbar)
1813 (tool-item tool-item)
1814 (index int))
f36ca6af 1815
560af5c5 1816
cb4bf772 1817;;; Tool button
560af5c5 1818
cb4bf772 1819(defmethod initialize-instance ((button tool-button) &rest initargs &key icon)
1820 (if (and icon (not (typep icon 'widget)))
1821 (apply #'call-next-method button :icon (create-image-widget icon) initargs)
1822 (call-next-method)))
560af5c5 1823
1824
cb4bf772 1825;;; Tool item
560af5c5 1826
cb4bf772 1827(defbinding tool-item-set-tooltip () nil
1828 (tool-item tool-item)
1829 (tooltips tooltips)
1830 (tip-text string)
1831 (tip-private string))
560af5c5 1832
560af5c5 1833
cb4bf772 1834(defun %tool-item-update-tooltips (tool-item)
1835 (when (and
1836 (slot-boundp tool-item 'parent)
1837 (or
1838 (user-data-p tool-item 'tip-text)
1839 (user-data-p tool-item 'tip-private)))
1840 (tool-item-set-tooltip
1841 tool-item (toolbar-tooltips (widget-parent tool-item))
1842 (or (user-data tool-item 'tip-text) "")
1843 (or (user-data tool-item 'tip-private) ""))))
1844
1845(defmethod (setf tool-item-tip-text) ((tip-text string) (tool-item tool-item))
1846 (setf (user-data tool-item 'tip-text) tip-text)
1847 (%tool-item-update-tooltips tool-item)
1848 tip-text)
1849
1850(defmethod (setf tool-item-tip-private) ((tip-private string) (tool-item tool-item))
1851 (setf (user-data tool-item 'tip-private) tip-private)
1852 (%tool-item-update-tooltips tool-item)
1853 tip-private)
1854
1855(defmethod container-add ((toolbar toolbar) (tool-item tool-item) &rest args)
1856 (declare (ignore args))
1857 (prog1
1858 (call-next-method)
1859 (%tool-item-update-tooltips tool-item)))
560af5c5 1860
d76e9fca 1861
1862(defbinding tool-item-retrieve-proxy-menu-item () widget
1863 (tool-item tool-item))
1864
1865(defbinding (tool-item-proxy-menu-item
1866 "gtk_tool_item_get_proxy_menu_item") () menu-item
1867 (tool-item tool-item)
1868 (menu-item-id string))
1869
1870(defbinding %tool-item-set-proxy-menu-item () nil
1871 (tool-item tool-item)
1872 (menu-item-id string)
1873 (menu-item menu-item))
1874
1875(defun (setf tool-item-proxy-menu-item) (menu-item menu-item-id tool-item)
1876 (%tool-item-set-proxy-menu-item menu-item-id tool-item menu-item)
1877 menu-item)
1878
1879#+gtk2.6
1880(defbinding tool-item-rebuild-menu () nil
1881 (tool-item tool-item))
1882
1883
bbaeff4b 1884;;; Editable
1047e159 1885
bbaeff4b 1886(defbinding editable-select-region (editable &optional (start 0) end) nil
f36ca6af 1887 (editable editable)
1888 (start int)
1889 ((or end -1) int))
560af5c5 1890
1047e159 1891(defbinding editable-get-selection-bounds (editable) nil
1892 (editable editable)
1893 (start int :out)
1894 (end int :out))
1895
d76e9fca 1896(defbinding editable-insert-text (editable text &optional (position 0)) nil
f36ca6af 1897 (editable editable)
1898 (text string)
1899 ((length text) int)
34fe0ead 1900 (position position :in-out))
560af5c5 1901
f36ca6af 1902(defun editable-append-text (editable text)
1903 (editable-insert-text editable text nil))
560af5c5 1904
f36ca6af 1905(defun editable-prepend-text (editable text)
1906 (editable-insert-text editable text 0))
560af5c5 1907
bbaeff4b 1908(defbinding editable-delete-text (editable &optional (start 0) end) nil
f36ca6af 1909 (editable editable)
1910 (start int)
1911 ((or end -1) int))
560af5c5 1912
bbaeff4b 1913(defbinding (editable-text "gtk_editable_get_chars")
f36ca6af 1914 (editable &optional (start 0) end) string
1915 (editable editable)
1916 (start int)
1917 ((or end -1) int))
560af5c5 1918
f36ca6af 1919(defun (setf editable-text) (text editable)
1920 (if text
1921 (editable-delete-text
1922 editable
1923 (editable-insert-text editable text))
1924 (editable-delete-text editable))
1925 text)
560af5c5 1926
bbaeff4b 1927(defbinding editable-cut-clipboard () nil
f36ca6af 1928 (editable editable))
560af5c5 1929
bbaeff4b 1930(defbinding editable-copy-clipboard () nil
f36ca6af 1931 (editable editable))
560af5c5 1932
bbaeff4b 1933(defbinding editable-paste-clipboard () nil
f36ca6af 1934 (editable editable))
560af5c5 1935
bbaeff4b 1936(defbinding editable-delete-selection () nil
f36ca6af 1937 (editable editable))
560af5c5 1938
560af5c5 1939
560af5c5 1940
f36ca6af 1941;;; Spin button
560af5c5 1942
d76e9fca 1943(defbinding spin-button-configure () nil
1944 (spin-button spin-button)
1945 (adjustment adjustment)
1946 (climb-rate double-float)
1947 (digits unsigned-int))
1948
1949(defbinding spin-button-set-range () nil
1950 (spin-button spin-button)
1951 (min double-float)
1952 (max double-float))
1953
1954(defbinding spin-button-get-range () nil
1955 (spin-button spin-button)
1956 (min double-float :out)
1957 (max double-float :out))
1958
f36ca6af 1959(defun spin-button-value-as-int (spin-button)
1960 (round (spin-button-value spin-button)))
560af5c5 1961
510fbcc1 1962(defbinding %spin-button-spin () nil
f36ca6af 1963 (spin-button spin-button)
1964 (direction spin-type)
510fbcc1 1965 (increment double-float))
1966
1967(defun spin-button-spin (spin-button value)
1968 (etypecase value
1969 (real (%spin-button-spin spin-button :spin-user-defined value))
1970 (spin-type (%spin-button-spin spin-button value 0))))
1971
560af5c5 1972
bbaeff4b 1973(defbinding spin-button-update () nil
f36ca6af 1974 (spin-button spin-button))
560af5c5 1975
1976
1977
1978; ;;; Ruler
1979
bbaeff4b 1980(defbinding ruler-set-range () nil
f36ca6af 1981 (ruler ruler)
1982 (lower single-float)
1983 (upper single-float)
1984 (position single-float)
1985 (max-size single-float))
560af5c5 1986
68f519e0 1987(defbinding ruler-get-range () nil
1988 (ruler ruler)
1989 (lower single-float :out)
1990 (upper single-float :out)
1991 (position single-float :out)
1992 (max-size single-float :out))
560af5c5 1993
560af5c5 1994
560af5c5 1995
d520140e 1996;;; Range
560af5c5 1997
1047e159 1998(defun range-lower (range)
1999 (adjustment-lower (range-adjustment range)))
560af5c5 2000
1047e159 2001(defun range-upper (range)
2002 (adjustment-upper (range-adjustment range)))
560af5c5 2003
1047e159 2004(defun (setf range-lower) (value range)
2005 (setf (adjustment-lower (range-adjustment range)) value))
560af5c5 2006
1047e159 2007(defun (setf range-upper) (value range)
2008 (setf (adjustment-upper (range-adjustment range)) value))
560af5c5 2009
1047e159 2010(defun range-page-increment (range)
2011 (adjustment-page-increment (range-adjustment range)))
560af5c5 2012
1047e159 2013(defun range-step-increment (range)
2014 (adjustment-step-increment (range-adjustment range)))
560af5c5 2015
1047e159 2016(defun (setf range-page-increment) (value range)
2017 (setf (adjustment-page-increment (range-adjustment range)) value))
560af5c5 2018
1047e159 2019(defun (setf range-step-increment) (value range)
2020 (setf (adjustment-step-increment (range-adjustment range)) value))
560af5c5 2021
1047e159 2022(defbinding range-set-range () nil
d520140e 2023 (range range)
1047e159 2024 (lower double-float)
2025 (upper double-float))
560af5c5 2026
1047e159 2027(defbinding range-set-increments () nil
d520140e 2028 (range range)
1047e159 2029 (step double-float)
2030 (page double-float))
560af5c5 2031
560af5c5 2032
d520140e 2033;;; Scale
560af5c5 2034
68f519e0 2035(defbinding scale-get-layout-offsets () nil
2036 (scale scale)
2037 (x int :out)
2038 (y int :out))
560af5c5 2039
560af5c5 2040
d520140e 2041;;; Progress bar
560af5c5 2042
bbaeff4b 2043(defbinding progress-bar-pulse () nil
d520140e 2044 (progress-bar progress-bar))
560af5c5 2045
2046
c49be931 2047;;; Size group
2048
2049(defmethod initialize-instance ((size-group size-group) &rest initargs
2050 &key widget widgets)
2051 (declare (ignore widget widgets))
2052 (prog1
2053 (call-next-method)
2054 (initial-add size-group #'size-group-add-widget
2055 initargs :widget :widgets)))
2056
2057
2058(defbinding size-group-add-widget () nil
2059 (size-group size-group)
2060 (widget widget))
2061
2062(defbinding size-group-remove-widget () nil
2063 (size-group size-group)
2064 (widget widget))
2065
560af5c5 2066
f5b67f2b 2067;;; Stock items
2068
73d58e01 2069(defbinding %stock-item-copy () pointer
2070 (location pointer))
2071
2072(defbinding %stock-item-free () nil
2073 (location pointer))
f5b67f2b 2074
73d58e01 2075(defmethod reference-foreign ((class (eql (find-class 'stock-item))) location)
2076 (%stock-item-copy location))
2077
2078(defmethod unreference-foreign ((class (eql (find-class 'stock-item))) location)
2079 (%stock-item-free location))
2080
2081(defbinding stock-add (stock-item) nil
2082 (stock-item stock-item)
2083 (1 unsigned-int))
2084
2085(defbinding stock-list-ids () (gslist string))
2086
2087(defbinding %stock-lookup () boolean
2088 (stock-id string)
2089 (location pointer))
2090
2091(defun stock-lookup (stock-id)
2092 (let ((location
2093 (allocate-memory (proxy-instance-size (find-class 'stock-item)))))
2094 (unwind-protect
2095 (when (%stock-lookup stock-id location)
2096 (ensure-proxy-instance 'stock-item (%stock-item-copy location)))
2097 (deallocate-memory location))))
560af5c5 2098
2099
2100;;; Tooltips
2101
bbaeff4b 2102(defbinding tooltips-enable () nil
d520140e 2103 (tooltips tooltips))
560af5c5 2104
bbaeff4b 2105(defbinding tooltips-disable () nil
d520140e 2106 (tooltips tooltips))
560af5c5 2107
e5b416f0 2108(defun (setf tooltips-enabled-p) (enable tooltips)
2109 (if enable
2110 (tooltips-enable tooltips)
2111 (tooltips-disable tooltips)))
2112
bbaeff4b 2113(defbinding tooltips-set-tip () nil
d520140e 2114 (tooltips tooltips)
2115 (widget widget)
2116 (tip-text string)
2117 (tip-private string))
560af5c5 2118
d76e9fca 2119(defbinding tooltips-data-get () tooltips-data
2120 (widget widget))
2121
bbaeff4b 2122(defbinding tooltips-force-window () nil
d520140e 2123 (tooltips tooltips))
560af5c5 2124
d76e9fca 2125(defbinding tooltips-get-info-from-tip-window () boolean
2126 (tip-window window)
2127 (tooltips tooltips :out)
2128 (current-widget widget :out))
560af5c5 2129
2130
d520140e 2131;;; Rc
560af5c5 2132
bbaeff4b 2133(defbinding rc-add-default-file (filename) nil
d520140e 2134 ((namestring (truename filename)) string))
560af5c5 2135
bbaeff4b 2136(defbinding rc-parse (filename) nil
d520140e 2137 ((namestring (truename filename)) string))
560af5c5 2138
bbaeff4b 2139(defbinding rc-parse-string () nil
d520140e 2140 (rc-string string))
560af5c5 2141
bbaeff4b 2142(defbinding rc-reparse-all () nil)
560af5c5 2143
bbaeff4b 2144(defbinding rc-get-style () style
d520140e 2145 (widget widget))