Made WITH-GC-DISABLED just a wrapper for internal CMUCL/SBCL macros
[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
7a2e0799 18;; $Id: gtk.lisp,v 1.39 2005-03-13 18:08:44 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
7a2e0799 963(defmethod initialize-instance ((dialog message-dialog)
964 &key (message-type :info) (buttons :close)
965 flags text #+gtk 2.6 secondary-text
966 transient-parent)
f4267180 967 (setf
968 (slot-value dialog 'location)
7a2e0799 969 (%message-dialog-new transient-parent flags message-type buttons))
970 (when text
971 (message-dialog-set-markup dialog text))
972 #+gtk2.6
973 (when secondary-text
974 (message-dialog-format-secondary-markup dialog secondary-text))
975 (call-next-method))
f4267180 976
977
978(defbinding %message-dialog-new () pointer
979 (parent (or null window))
980 (flags dialog-flags)
981 (type message-type)
982 (buttons buttons-type)
7a2e0799 983 (nil null))
f4267180 984
985(defbinding message-dialog-set-markup () nil
986 (message-dialog message-dialog)
987 (markup string))
988
989#+gtk2.6
990(defbinding message-dialog-format-secondary-text () nil
991 (message-dialog message-dialog)
992 (text string))
993
994#+gtk2.6
995(defbinding message-dialog-format-secondary-markup () nil
996 (message-dialog message-dialog)
997 (markup string))
998
999
560af5c5 1000
f36ca6af 1001;;; Radio menu item
560af5c5 1002
e5b416f0 1003(defbinding %radio-menu-item-get-group () pointer
d520140e 1004 (radio-menu-item radio-menu-item))
1005
bbaeff4b 1006(defbinding %radio-menu-item-set-group () nil
d520140e 1007 (radio-menu-item radio-menu-item)
1008 (group pointer))
1009
cb4bf772 1010(defmethod add-to-radio-group ((item1 radio-menu-item) (item2 radio-menu-item))
d520140e 1011 "Add ITEM1 to the group which ITEM2 belongs to."
1012 (%radio-menu-item-set-group item1 (%radio-menu-item-get-group item2)))
1013
d76e9fca 1014(defmethod initialize-instance ((item radio-menu-item) &key group)
f5b67f2b 1015 (prog1
1016 (call-next-method)
d76e9fca 1017 (when group
cb4bf772 1018 (add-to-radio-group item group))))
1019
d520140e 1020
560af5c5 1021
d76e9fca 1022;;; Radio tool button
1023
1024(defbinding %radio-tool-button-get-group () pointer
1025 (radio-tool-button radio-tool-button))
1026
1027(defbinding %radio-tool-button-set-group () nil
1028 (radio-tool-button radio-tool-button)
1029 (group pointer))
1030
cb4bf772 1031(defmethod add-to-radio-group ((button1 radio-tool-button) (button2 radio-tool-button))
d76e9fca 1032 "Add BUTTON1 to the group which BUTTON2 belongs to."
1033 (%radio-tool-button-set-group button1 (%radio-tool-button-get-group button2)))
1034
cb4bf772 1035(defmethod add-activate-callback ((widget widget) function &key object after)
1036 (if object
1037 (signal-connect widget 'clicked
1038 #'(lambda (object)
1039 (when (slot-value widget 'active)
1040 (funcall function object (slot-value widget 'value))))
1041 :object object :after after)
1042 (signal-connect widget 'clicked
1043 #'(lambda ()
1044 (when (slot-value widget 'active)
1045 (funcall function (slot-value widget 'value))))
1046 :after after)))
d76e9fca 1047
1048(defmethod initialize-instance ((button radio-tool-button) &key group)
1049 (prog1
1050 (call-next-method)
1051 (when group
cb4bf772 1052 (add-to-radio-group button group))))
1053
d76e9fca 1054
560af5c5 1055
aaa6e6cb 1056;;; Toggle button
1057
1058(defbinding toggle-button-toggled () nil
1059 (toggle-button toggle-button))
1060
1061
560af5c5 1062;;; Window
1063
c49be931 1064(defmethod initialize-instance ((window window) &rest initargs
1065 &key accel-group accel-groups)
1066 (declare (ignore accel-group accel-groups))
1067 (prog1
1068 (call-next-method)
1069 (initial-add window #'window-add-accel-group
1070 initargs :accel-group :accel-groups)))
73d58e01 1071
1072
7625ebd8 1073(defbinding window-set-wmclass () nil
560af5c5 1074 (window window)
1075 (wmclass-name string)
1076 (wmclass-class string))
1077
bbaeff4b 1078(defbinding window-add-accel-group () nil
560af5c5 1079 (window window)
1080 (accel-group accel-group))
1081
bbaeff4b 1082(defbinding window-remove-accel-group () nil
560af5c5 1083 (window window)
1084 (accel-group accel-group))
1085
bbaeff4b 1086(defbinding window-activate-focus () int
560af5c5 1087 (window window))
1088
bbaeff4b 1089(defbinding window-activate-default () int
560af5c5 1090 (window window))
1091
7625ebd8 1092(defbinding window-set-default-size (window width height) int
560af5c5 1093 (window window)
7625ebd8 1094 ((or width -1) int)
1095 ((or height -1) int))
560af5c5 1096
4d16221f 1097(defbinding %window-set-geometry-hints () nil
1098 (window window)
1099 (geometry gdk:geometry)
1100 (geometry-mask gdk:window-hints))
1101
1102(defun window-set-geometry-hints (window &key min-width min-height
1103 max-width max-height base-width base-height
1104 width-inc height-inc min-aspect max-aspect
1105 (gravity nil gravity-p) min-size max-size)
1106 (let ((geometry (make-instance 'gdk:geometry
1107 :min-width (or min-width -1)
1108 :min-height (or min-height -1)
1109 :max-width (or max-width -1)
1110 :max-height (or max-height -1)
1111 :base-width (or base-width 0)
1112 :base-height (or base-height 0)
1113 :width-inc (or width-inc 0)
1114 :height-inc (or height-inc 0)
1115 :min-aspect (or min-aspect 0)
1116 :max-aspect (or max-aspect 0)
1117 :gravity gravity))
1118 (mask ()))
1119 (when (or min-size min-width min-height)
1120 (push :min-size mask))
1121 (when (or max-size max-width max-height)
1122 (push :max-size mask))
1123 (when (or base-width base-height)
1124 (push :base-size mask))
1125 (when (or width-inc height-inc)
1126 (push :resize-inc mask))
1127 (when (or min-aspect max-aspect)
1128 (push :aspect mask))
1129 (when gravity-p
1130 (push :win-gravity mask))
1131 (%window-set-geometry-hints window geometry mask)))
560af5c5 1132
73d58e01 1133(defbinding window-list-toplevels () (glist (copy-of window))
1134 "Returns a list of all existing toplevel windows.")
7625ebd8 1135
1136(defbinding window-add-mnemonic (window key target) nil
1137 (window window)
1138 ((gdk:keyval-from-name key) unsigned-int)
1139 (target widget))
1140
1141(defbinding window-remove-mnemonic (window key target) nil
1142 (window window)
1143 ((gdk:keyval-from-name key) unsigned-int)
1144 (target widget))
1145
1146(defbinding window-mnemonic-activate (window key modifier) nil
1147 (window window)
1148 ((gdk:keyval-from-name key) unsigned-int)
1149 (modifier gdk:modifier-type))
1150
4d16221f 1151(defbinding window-activate-key () boolean
1152 (window window)
1153 (event gdk:key-event))
1154
1155(defbinding window-propagate-key-event () boolean
1156 (window window)
1157 (event gdk:key-event))
1158
7625ebd8 1159(defbinding window-present () nil
1160 (window window))
1161
1162(defbinding window-iconify () nil
1163 (window window))
1164
1165(defbinding window-deiconify () nil
1166 (window window))
1167
1168(defbinding window-stick () nil
1169 (window window))
1170
1171(defbinding window-unstick () nil
1172 (window window))
1173
1174(defbinding window-maximize () nil
1175 (window window))
1176
1177(defbinding window-unmaximize () nil
1178 (window window))
1179
4d16221f 1180(defbinding window-fullscreen () nil
1181 (window window))
1182
1183(defbinding window-unfullscreen () nil
1184 (window window))
1185
1186(defbinding window-set-keep-above () nil
1187 (window window)
1188 (setting boolean))
1189
1190(defbinding window-set-keep-below () nil
1191 (window window)
1192 (setting boolean))
1193
7625ebd8 1194(defbinding window-begin-resize-drag () nil
1195 (window window)
1196 (edge gdk:window-edge)
1197 (button int)
1198 (root-x int) (root-y int)
9adccb27 1199 (timestamp unsigned-int))
7625ebd8 1200
1201(defbinding window-begin-move-drag () nil
1202 (window window)
1203 (edge gdk:window-edge)
1204 (button int)
1205 (root-x int) (root-y int)
9adccb27 1206 (timestamp unsigned-int))
7625ebd8 1207
1208(defbinding window-set-frame-dimensions () nil
1209 (window window)
1210 (left int) (top int) (rigth int) (bottom int))
1211
7625ebd8 1212(defbinding %window-get-default-size () nil
1213 (window window)
1214 (width int :out)
1215 (height int :out))
1216
1217(defun window-get-default-size (window)
1218 (multiple-value-bind (width height) (%window-get-default-size window)
1219 (values (unless (= width -1) width) (unless (= height -1) height))))
1220
1221(defbinding window-get-frame-dimensions () nil
1222 (window window)
1223 (left int :out) (top int :out) (rigth int :out) (bottom int :out))
1224
1225(defbinding %window-get-icon-list () (glist gdk:pixbuf)
1226 (window window))
1227
7625ebd8 1228(defbinding window-get-position () nil
1229 (window window)
1230 (root-x int :out)
1231 (root-y int :out))
1232
1233(defbinding window-get-size () nil
1234 (window window)
1235 (width int :out)
1236 (height int :out))
1237
1238(defbinding window-move () nil
1239 (window window)
1240 (x int)
1241 (y int))
1242
1243(defbinding window-parse-geometry () boolean
1244 (window window)
1245 (geometry string))
1246
1247(defbinding window-reshow-with-initial-size () nil
1248 (window window))
1249
1250(defbinding window-resize () nil
1251 (window window)
1252 (width int)
1253 (heigth int))
1254
4d16221f 1255(defbinding (window-default-icon-list "gtk_window_get_default_icon_list")
1256 () (glist gdk:pixbuf))
1257
1258(defun window-default-icon ()
1259 (first (window-default-icon-list)))
1260
1261(defbinding %window-set-default-icon-list () nil
1262 (icons (glist gdk:pixbuf)))
1263
1264(defun (setf window-default-icon-list) (icons)
1265 (%window-set-default-icon-list icons)
1266 icons)
1267
1268(defbinding %window-set-default-icon () nil
1269 (icons (glist gdk:pixbuf)))
1270
1271(defmethod (setf window-default-icon) ((icon gdk:pixbuf))
1272 (%window-set-default-icon icon)
1273 icon)
1274
1275(defmethod (setf window-group) ((group window-group) (window window))
1276 (window-group-add-window group window)
1277 group)
1278
1279(defbinding %window-set-default-icon-from-file () boolean
1280 (filename pathname)
1281 (nil null))
1282
1283(defmethod (setf window-default-icon) ((icon-file pathname))
1284 (%window-set-default-icon-from-file icon-file)
1285 icon-file)
1286
1287(defbinding %window-set-icon-from-file () boolean
1288 (window window)
1289 (filename pathname)
1290 (nil null))
1291
1292(defmethod (setf window-icon) ((icon-file pathname) (window window))
1293 (%window-set-icon-from-file window icon-file)
1294 icon-file)
1295
1296(defbinding window-set-auto-startup-notification () nil
1297 (setting boolean))
1298
1299(defbinding decorated-window-init () nil
1300 (window window))
1301
1302(defbinding decorated-window-calculate-frame-size () nil
1303 (window window))
1304
1305(defbinding decorated-window-set-title () nil
7625ebd8 1306 (window window)
4d16221f 1307 (title string))
7625ebd8 1308
4d16221f 1309(defbinding decorated-window-move-resize-window () nil
1310 (window window)
1311 (x int)
1312 (y int)
1313 (width int)
1314 (heigth int))
7625ebd8 1315
1316
4d16221f 1317;;; Window group
560af5c5 1318
4d16221f 1319(defmethod initialize-instance ((window-group window-group) &rest initargs
1320 &key window windows)
1321 (declare (ignore window windows))
1322 (prog1
1323 (call-next-method)
1324 (initial-add window-group #'window-group-add-window
1325 initargs :window :windows)))
560af5c5 1326
560af5c5 1327
4d16221f 1328(defbinding window-group-add-window () nil
1329 (window-group window-group)
1330 (window window))
560af5c5 1331
4d16221f 1332(defbinding window-group-remove-window () nil
1333 (window-group window-group)
1334 (window window))
560af5c5 1335
1336
f36ca6af 1337;;; Scrolled window
560af5c5 1338
560af5c5 1339(defun (setf scrolled-window-scrollbar-policy) (policy window)
1340 (setf (scrolled-window-hscrollbar-policy window) policy)
1341 (setf (scrolled-window-vscrollbar-policy window) policy))
1342
bbaeff4b 1343(defbinding scrolled-window-add-with-viewport () nil
560af5c5 1344 (scrolled-window scrolled-window)
1345 (child widget))
1346
7a2e0799 1347(defmethod shared-initialize ((window scrolled-window) names &key policy)
1348 (declare (ignore names))
1349 (when policy
1350 (setf (slot-value window 'hscrollbar-policy) policy)
1351 (setf (slot-value window 'vscrollbar-policy) policy))
1352 (call-next-method))
d520140e 1353
560af5c5 1354
f36ca6af 1355;;; Statusbar
560af5c5 1356
d76e9fca 1357(defbinding statusbar-get-context-id () unsigned-int
f36ca6af 1358 (statusbar statusbar)
1359 (context-description string))
560af5c5 1360
bbaeff4b 1361(defbinding statusbar-push () unsigned-int
f36ca6af 1362 (statusbar statusbar)
1363 (context-id unsigned-int)
1364 (text string))
560af5c5 1365
bbaeff4b 1366(defbinding statusbar-pop () nil
f36ca6af 1367 (statusbar statusbar)
1368 (context-id unsigned-int))
560af5c5 1369
bbaeff4b 1370(defbinding statusbar-remove () nil
f36ca6af 1371 (statusbar statusbar)
1372 (context-id unsigned-int)
1373 (message-id unsigned-int))
560af5c5 1374
560af5c5 1375
1376
1377;;; Fixed
1378
bbaeff4b 1379(defbinding fixed-put () nil
f36ca6af 1380 (fixed fixed)
1381 (widget widget)
f5b67f2b 1382 (x int) (y int))
560af5c5 1383
bbaeff4b 1384(defbinding fixed-move () nil
f36ca6af 1385 (fixed fixed)
1386 (widget widget)
f5b67f2b 1387 (x int) (y int))
560af5c5 1388
1389
1390
d520140e 1391;;; Notebook
560af5c5 1392
68f519e0 1393(defun %ensure-notebook-position (notebook page)
f5b67f2b 1394 (etypecase page
68f519e0 1395 (position page)
f5b67f2b 1396 (widget (notebook-page-num notebook page t))))
1397
68f519e0 1398(defun %ensure-notebook-child (notebook position)
f5b67f2b 1399 (typecase position
1400 (widget position)
68f519e0 1401 (t (notebook-get-nth-page notebook position))))
f5b67f2b 1402
1403(defbinding (notebook-insert "gtk_notebook_insert_page_menu")
f36ca6af 1404 (notebook position child tab-label &optional menu-label) nil
1405 (notebook notebook)
1406 (child widget)
1407 ((if (stringp tab-label)
f5b67f2b 1408 (make-instance 'label :label tab-label)
f36ca6af 1409 tab-label) widget)
1410 ((if (stringp menu-label)
f5b67f2b 1411 (make-instance 'label :label menu-label)
f36ca6af 1412 menu-label) (or null widget))
68f519e0 1413 ((%ensure-notebook-position notebook position) position))
560af5c5 1414
f5b67f2b 1415(defun notebook-append (notebook child tab-label &optional menu-label)
1416 (notebook-insert notebook :last child tab-label menu-label))
560af5c5 1417
f5b67f2b 1418(defun notebook-prepend (notebook child tab-label &optional menu-label)
1419 (notebook-insert notebook :first child tab-label menu-label))
560af5c5 1420
f5b67f2b 1421(defbinding notebook-remove-page (notebook page) nil
f36ca6af 1422 (notebook notebook)
68f519e0 1423 ((%ensure-notebook-position notebook page) position))
560af5c5 1424
bbaeff4b 1425(defbinding %notebook-page-num () int
f36ca6af 1426 (notebook notebook)
1427 (child widget))
1428
f5b67f2b 1429(defun notebook-page-num (notebook child &optional error-p)
f36ca6af 1430 (let ((page-num (%notebook-page-num notebook child)))
1431 (if (= page-num -1)
f5b67f2b 1432 (when error-p
68f519e0 1433 (error "~A is not a page in ~A" child notebook))
f36ca6af 1434 page-num)))
1435
bbaeff4b 1436(defbinding notebook-next-page () nil
f36ca6af 1437 (notebook notebook))
560af5c5 1438
bbaeff4b 1439(defbinding notebook-prev-page () nil
f36ca6af 1440 (notebook notebook))
1441
f5b67f2b 1442(defbinding notebook-reorder-child (notebook child position) nil
1443 (notebook notebook)
1444 (child widget)
1445 ((%notebook-position notebook position) int))
1446
bbaeff4b 1447(defbinding notebook-popup-enable () nil
f36ca6af 1448 (notebook notebook))
1449
bbaeff4b 1450(defbinding notebook-popup-disable () nil
f36ca6af 1451 (notebook notebook))
1452
68f519e0 1453(defbinding notebook-get-nth-page () widget
f5b67f2b 1454 (notebook notebook)
68f519e0 1455 (page position))
f5b67f2b 1456
68f519e0 1457(defun %notebook-current-page (notebook)
1458 (when (slot-boundp notebook 'current-page-num)
1459 (notebook-get-nth-page notebook (notebook-current-page-num notebook))))
f5b67f2b 1460
1461(defun (setf notebook-current-page) (page notebook)
68f519e0 1462 (setf (notebook-current-page notebook) (notebook-page-num notebook page)))
f5b67f2b 1463
1047e159 1464(defbinding (notebook-tab-label "gtk_notebook_get_tab_label")
1465 (notebook page) widget
1466 (notebook notebook)
68f519e0 1467 ((%ensure-notebook-child notebook page) widget))
f5b67f2b 1468
1047e159 1469(defbinding (notebook-tab-label-text "gtk_notebook_get_tab_label_text")
6bb23851 1470 (notebook page) (copy-of string)
1047e159 1471 (notebook notebook)
68f519e0 1472 ((%ensure-notebook-child notebook page) widget))
f5b67f2b 1473
1047e159 1474(defbinding %notebook-set-tab-label () nil
1475 (notebook notebook)
1476 (page widget)
1477 (tab-label widget))
1478
1479(defun (setf notebook-tab-label) (tab-label notebook page)
1480 (let ((widget (if (stringp tab-label)
1481 (make-instance 'label :label tab-label)
1482 tab-label)))
68f519e0 1483 (%notebook-set-tab-label notebook (%ensure-notebook-child notebook page) widget)
1047e159 1484 widget))
f5b67f2b 1485
f5b67f2b 1486
1047e159 1487(defbinding (notebook-menu-label "gtk_notebook_get_menu_label")
1488 (notebook page) widget
1489 (notebook notebook)
68f519e0 1490 ((%ensure-notebook-child notebook page) widget))
f5b67f2b 1491
1047e159 1492(defbinding (notebook-menu-label-text "gtk_notebook_get_menu_label_text")
6bb23851 1493 (notebook page) (copy-of string)
1047e159 1494 (notebook notebook)
68f519e0 1495 ((%ensure-notebook-child notebook page) widget))
f5b67f2b 1496
1047e159 1497(defbinding %notebook-set-menu-label () nil
1498 (notebook notebook)
1499 (page widget)
1500 (menu-label widget))
1501
1502(defun (setf notebook-menu-label) (menu-label notebook page)
1503 (let ((widget (if (stringp menu-label)
1504 (make-instance 'label :label menu-label)
1505 menu-label)))
68f519e0 1506 (%notebook-set-menu-label notebook (%ensure-notebook-child notebook page) widget)
1047e159 1507 widget))
f5b67f2b 1508
1509
1510(defbinding notebook-query-tab-label-packing (notebook page) nil
f36ca6af 1511 (notebook notebook)
f5b67f2b 1512 ((%notebook-child notebook page) widget)
f36ca6af 1513 (expand boolean :out)
1514 (fill boolean :out)
1515 (pack-type pack-type :out))
1516
f5b67f2b 1517(defbinding notebook-set-tab-label-packing
1518 (notebook page expand fill pack-type) nil
f36ca6af 1519 (notebook notebook)
f5b67f2b 1520 ((%notebook-child notebook page) widget)
f36ca6af 1521 (expand boolean)
1522 (fill boolean)
1523 (pack-type pack-type))
1524
560af5c5 1525
1526
d520140e 1527;;; Paned
560af5c5 1528
bbaeff4b 1529(defbinding paned-pack1 () nil
d520140e 1530 (paned paned)
1531 (child widget)
1532 (resize boolean)
1533 (shrink boolean))
560af5c5 1534
bbaeff4b 1535(defbinding paned-pack2 () nil
d520140e 1536 (paned paned)
1537 (child widget)
1538 (resize boolean)
1539 (shrink boolean))
560af5c5 1540
560af5c5 1541
d520140e 1542;;; Layout
560af5c5 1543
bbaeff4b 1544(defbinding layout-put () nil
d520140e 1545 (layout layout)
68f519e0 1546 (child widget)
d520140e 1547 (x int)
1548 (y int))
560af5c5 1549
bbaeff4b 1550(defbinding layout-move () nil
d520140e 1551 (layout layout)
68f519e0 1552 (child widget)
d520140e 1553 (x int)
1554 (y int))
560af5c5 1555
68f519e0 1556(defbinding layout-set-size () nil
1557 (layout layout)
1558 (width unsigned-int)
1559 (height unsigned-int))
1560
1561(defbinding layout-get-size () nil
1562 (layout layout)
1563 (width unsigned-int :out)
1564 (height unsigned-int :out))
560af5c5 1565
1566
560af5c5 1567;;; Menu shell
1568
f5b67f2b 1569(defbinding menu-shell-insert (menu-shell menu-item position) nil
f36ca6af 1570 (menu-shell menu-shell)
1571 (menu-item menu-item)
f5b67f2b 1572 ((case position
1573 (:first 0)
1574 (:last -1)
1575 (t position)) int))
560af5c5 1576
f36ca6af 1577(defun menu-shell-append (menu-shell menu-item)
f5b67f2b 1578 (menu-shell-insert menu-shell menu-item :last))
560af5c5 1579
f36ca6af 1580(defun menu-shell-prepend (menu-shell menu-item)
f5b67f2b 1581 (menu-shell-insert menu-shell menu-item :fisrt))
560af5c5 1582
bbaeff4b 1583(defbinding menu-shell-deactivate () nil
f36ca6af 1584 (menu-shell menu-shell))
560af5c5 1585
bbaeff4b 1586(defbinding menu-shell-select-item () nil
f36ca6af 1587 (menu-shell menu-shell)
1588 (menu-item menu-item))
560af5c5 1589
d76e9fca 1590(defbinding menu-shell-select-first () nil
1591 (menu-shell menu-shell)
1592 (search-sensitive boolean))
1593
bbaeff4b 1594(defbinding menu-shell-deselect () nil
f36ca6af 1595 (menu-shell menu-shell))
560af5c5 1596
bbaeff4b 1597(defbinding menu-shell-activate-item () nil
f36ca6af 1598 (menu-shell menu-shell)
1599 (menu-item menu-item)
1600 (fore-deactivate boolean))
560af5c5 1601
d76e9fca 1602(defbinding menu-shell-cancel () nil
1603 (menu-shell menu-shell))
560af5c5 1604
1605
f5b67f2b 1606;;; Menu
560af5c5 1607
f5b67f2b 1608(defun %menu-position (menu child)
1609 (etypecase child
1610 (int child)
1611 (keyword (case child
1612 (:first 0)
1613 (:last -1)
1047e159 1614 (t (error "Invalid position keyword: ~A" child))))
f5b67f2b 1615 (widget (menu-child-position menu child))))
560af5c5 1616
1617
f5b67f2b 1618(defbinding menu-reorder-child (menu menu-item position) nil
1619 (menu menu)
1620 (menu-item menu-item)
1621 ((%menu-position menu position) int))
560af5c5 1622
d76e9fca 1623(defbinding menu-attach () nil
1624 (menu menu)
1625 (menu-item menu-item)
1626 (left-attach unsigned-int)
1627 (right-attach unsigned-int)
1628 (top-attach unsigned-int)
1629 (bottom-attach unsigned-int))
1630
1631(def-callback-marshal %menu-position-func (nil (menu menu) (x int) (y int) (push-in boolean)))
560af5c5 1632
f5b67f2b 1633(defbinding %menu-popup () nil
1634 (menu menu)
1635 (parent-menu-shell (or null menu-shell))
1636 (parent-menu-item (or null menu-item))
1637 (callback-func (or null pointer))
1638 (callback-id unsigned-int)
1639 (button unsigned-int)
1640 (activate-time (unsigned 32)))
1641
1642(defun menu-popup (menu button activate-time &key callback parent-menu-shell
1643 parent-menu-item)
1644 (if callback
1a1949c7 1645 (with-callback-function (id callback)
1646 (%menu-popup
1647 menu parent-menu-shell parent-menu-item
d76e9fca 1648 (callback %menu-position-func) id button activate-time))
f5b67f2b 1649 (%menu-popup
1650 menu parent-menu-shell parent-menu-item nil 0 button activate-time)))
1651
1652(defbinding menu-set-accel-path () nil
1653 (menu menu)
1654 (accel-path string))
560af5c5 1655
bbaeff4b 1656(defbinding menu-reposition () nil
f36ca6af 1657 (menu menu))
560af5c5 1658
bbaeff4b 1659(defbinding menu-popdown () nil
f36ca6af 1660 (menu menu))
560af5c5 1661
f5b67f2b 1662(defun menu-child-position (menu child)
1663 (position child (container-children menu)))
1664
1665(defun menu-active-num (menu)
1666 (menu-child-position menu (menu-active menu)))
1667
bbaeff4b 1668(defbinding %menu-set-active () nil
f36ca6af 1669 (menu menu)
1670 (index unsigned-int))
560af5c5 1671
f5b67f2b 1672(defun (setf menu-active) (menu child)
1673 (%menu-set-active menu (%menu-position menu child))
1674 child)
d520140e 1675
d76e9fca 1676(defcallback %menu-detach-func (nil (widget widget) (menu menu))
1677 (funcall (object-data menu 'detach-func) widget menu))
1678
1679(defbinding %menu-attach-to-widget () nil
1680 (menu menu)
1681 (widget widget)
1682 ((callback %menu-detach-func) pointer))
1683
1684(defun menu-attach-to-widget (menu widget function)
1685 (setf (object-data menu 'detach-func) function)
1686 (%menu-attach-to-widget menu widget))
1687
1688(defbinding menu-detach () nil
1689 (menu menu))
1690
1691#+gtk2.6
1692(defbinding menu-get-for-attach-widget () (copy-of (glist widget))
1693 (widget widget))
1694
1695(defbinding menu-set-monitor () nil
1696 (menu menu)
1697 (monitor-num int))
560af5c5 1698
1699
f36ca6af 1700;;; Table
560af5c5 1701
bbaeff4b 1702(defbinding table-resize () nil
f36ca6af 1703 (table table)
1704 (rows unsigned-int)
1705 (columns unsigned-int))
560af5c5 1706
bbaeff4b 1707(defbinding table-attach (table child left right top bottom
c49be931 1708 &key options x-options y-options
1709 (x-padding 0) (y-padding 0)) nil
f36ca6af 1710 (table table)
1711 (child widget)
1712 (left unsigned-int)
1713 (right unsigned-int)
1714 (top unsigned-int)
1715 (bottom unsigned-int)
c49be931 1716 ((append (mklist options) (mklist x-options)) attach-options)
1717 ((append (mklist options) (mklist y-options)) attach-options)
f36ca6af 1718 (x-padding unsigned-int)
1719 (y-padding unsigned-int))
1720
e5b416f0 1721
bbaeff4b 1722(defbinding %table-set-row-spacing () nil
f36ca6af 1723 (table table)
1724 (row unsigned-int)
1725 (spacing unsigned-int))
1726
e5b416f0 1727(defbinding %table-set-row-spacings () nil
1728 (table table)
1729 (spacing unsigned-int))
1730
1731(defun (setf table-row-spacing) (spacing table &optional row)
1732 (if row
1733 (%table-set-row-spacing table row spacing)
1734 (%table-set-row-spacings table spacing))
f36ca6af 1735 spacing)
1736
e5b416f0 1737(defbinding %table-get-row-spacing () unsigned-int
f36ca6af 1738 (table table)
e5b416f0 1739 (row unsigned-int))
1740
1741(defbinding %table-get-default-row-spacing () unsigned-int
1742 (table table))
1743
1744(defun table-row-spacing (table &optional row)
1745 (if row
1746 (%table-get-row-spacing table row)
1747 (%table-get-default-row-spacing table)))
1748
f36ca6af 1749
bbaeff4b 1750(defbinding %table-set-col-spacing () nil
f36ca6af 1751 (table table)
1752 (col unsigned-int)
1753 (spacing unsigned-int))
1754
e5b416f0 1755(defbinding %table-set-col-spacings () nil
1756 (table table)
1757 (spacing unsigned-int))
1758
1759(defun (setf table-col-spacing) (spacing table &optional col)
1760 (if col
1761 (%table-set-col-spacing table col spacing)
1762 (%table-set-col-spacings table spacing))
f36ca6af 1763 spacing)
1764
e5b416f0 1765(defbinding %table-get-col-spacing () unsigned-int
f36ca6af 1766 (table table)
e5b416f0 1767 (col unsigned-int))
1768
1769(defbinding %table-get-default-col-spacing () unsigned-int
1770 (table table))
1771
1772(defun table-col-spacing (table &optional col)
1773 (if col
1774 (%table-get-col-spacing table col)
1775 (%table-get-default-col-spacing table)))
1776
1777
f36ca6af 1778
1779;;; Toolbar
1780
cb4bf772 1781(defmethod initialize-instance ((toolbar toolbar) &rest initargs &key tooltips)
1782 (if (eq tooltips t)
1783 (apply #'call-next-method toolbar
1784 :tooltips (make-instance 'tooltips) initargs)
1785 (call-next-method)))
560af5c5 1786
cb4bf772 1787(defbinding %toolbar-insert () nil
f5b67f2b 1788 (toolbar toolbar)
cb4bf772 1789 (tool-item tool-item)
1790 (position position))
f36ca6af 1791
cb4bf772 1792(defun toolbar-insert (toolbar tool-item &optional (position :end))
1793 (%toolbar-insert toolbar tool-item position)
1794 (%tool-item-update-tooltips tool-item))
f5b67f2b 1795
cb4bf772 1796(defbinding toolbar-get-item-index () int
1797 (toolbar toolbar)
1798 (item tool-item))
f36ca6af 1799
cb4bf772 1800(defbinding toolbar-get-nth-item () tool-item
1801 (toolbar toolbar)
1802 (n int))
f36ca6af 1803
cb4bf772 1804(defbinding toolbar-get-drop-index () int
1805 (toolbar toolbar)
1806 (x int) (y int))
f36ca6af 1807
cb4bf772 1808(defbinding toolbar-set-drop-highlight-item () nil
1809 (toolbar toolbar)
1810 (tool-item tool-item)
1811 (index int))
f36ca6af 1812
560af5c5 1813
cb4bf772 1814;;; Tool button
560af5c5 1815
cb4bf772 1816(defmethod initialize-instance ((button tool-button) &rest initargs &key icon)
1817 (if (and icon (not (typep icon 'widget)))
1818 (apply #'call-next-method button :icon (create-image-widget icon) initargs)
1819 (call-next-method)))
560af5c5 1820
1821
cb4bf772 1822;;; Tool item
560af5c5 1823
cb4bf772 1824(defbinding tool-item-set-tooltip () nil
1825 (tool-item tool-item)
1826 (tooltips tooltips)
1827 (tip-text string)
1828 (tip-private string))
560af5c5 1829
560af5c5 1830
cb4bf772 1831(defun %tool-item-update-tooltips (tool-item)
1832 (when (and
1833 (slot-boundp tool-item 'parent)
1834 (or
1835 (user-data-p tool-item 'tip-text)
1836 (user-data-p tool-item 'tip-private)))
1837 (tool-item-set-tooltip
1838 tool-item (toolbar-tooltips (widget-parent tool-item))
1839 (or (user-data tool-item 'tip-text) "")
1840 (or (user-data tool-item 'tip-private) ""))))
1841
1842(defmethod (setf tool-item-tip-text) ((tip-text string) (tool-item tool-item))
1843 (setf (user-data tool-item 'tip-text) tip-text)
1844 (%tool-item-update-tooltips tool-item)
1845 tip-text)
1846
1847(defmethod (setf tool-item-tip-private) ((tip-private string) (tool-item tool-item))
1848 (setf (user-data tool-item 'tip-private) tip-private)
1849 (%tool-item-update-tooltips tool-item)
1850 tip-private)
1851
1852(defmethod container-add ((toolbar toolbar) (tool-item tool-item) &rest args)
1853 (declare (ignore args))
1854 (prog1
1855 (call-next-method)
1856 (%tool-item-update-tooltips tool-item)))
560af5c5 1857
d76e9fca 1858
1859(defbinding tool-item-retrieve-proxy-menu-item () widget
1860 (tool-item tool-item))
1861
1862(defbinding (tool-item-proxy-menu-item
1863 "gtk_tool_item_get_proxy_menu_item") () menu-item
1864 (tool-item tool-item)
1865 (menu-item-id string))
1866
1867(defbinding %tool-item-set-proxy-menu-item () nil
1868 (tool-item tool-item)
1869 (menu-item-id string)
1870 (menu-item menu-item))
1871
1872(defun (setf tool-item-proxy-menu-item) (menu-item menu-item-id tool-item)
1873 (%tool-item-set-proxy-menu-item menu-item-id tool-item menu-item)
1874 menu-item)
1875
1876#+gtk2.6
1877(defbinding tool-item-rebuild-menu () nil
1878 (tool-item tool-item))
1879
1880
bbaeff4b 1881;;; Editable
1047e159 1882
bbaeff4b 1883(defbinding editable-select-region (editable &optional (start 0) end) nil
f36ca6af 1884 (editable editable)
1885 (start int)
1886 ((or end -1) int))
560af5c5 1887
1047e159 1888(defbinding editable-get-selection-bounds (editable) nil
1889 (editable editable)
1890 (start int :out)
1891 (end int :out))
1892
d76e9fca 1893(defbinding editable-insert-text (editable text &optional (position 0)) nil
f36ca6af 1894 (editable editable)
1895 (text string)
1896 ((length text) int)
34fe0ead 1897 (position position :in-out))
560af5c5 1898
f36ca6af 1899(defun editable-append-text (editable text)
1900 (editable-insert-text editable text nil))
560af5c5 1901
f36ca6af 1902(defun editable-prepend-text (editable text)
1903 (editable-insert-text editable text 0))
560af5c5 1904
bbaeff4b 1905(defbinding editable-delete-text (editable &optional (start 0) end) nil
f36ca6af 1906 (editable editable)
1907 (start int)
1908 ((or end -1) int))
560af5c5 1909
bbaeff4b 1910(defbinding (editable-text "gtk_editable_get_chars")
f36ca6af 1911 (editable &optional (start 0) end) string
1912 (editable editable)
1913 (start int)
1914 ((or end -1) int))
560af5c5 1915
f36ca6af 1916(defun (setf editable-text) (text editable)
1917 (if text
1918 (editable-delete-text
1919 editable
1920 (editable-insert-text editable text))
1921 (editable-delete-text editable))
1922 text)
560af5c5 1923
bbaeff4b 1924(defbinding editable-cut-clipboard () nil
f36ca6af 1925 (editable editable))
560af5c5 1926
bbaeff4b 1927(defbinding editable-copy-clipboard () nil
f36ca6af 1928 (editable editable))
560af5c5 1929
bbaeff4b 1930(defbinding editable-paste-clipboard () nil
f36ca6af 1931 (editable editable))
560af5c5 1932
bbaeff4b 1933(defbinding editable-delete-selection () nil
f36ca6af 1934 (editable editable))
560af5c5 1935
560af5c5 1936
560af5c5 1937
f36ca6af 1938;;; Spin button
560af5c5 1939
d76e9fca 1940(defbinding spin-button-configure () nil
1941 (spin-button spin-button)
1942 (adjustment adjustment)
1943 (climb-rate double-float)
1944 (digits unsigned-int))
1945
1946(defbinding spin-button-set-range () nil
1947 (spin-button spin-button)
1948 (min double-float)
1949 (max double-float))
1950
1951(defbinding spin-button-get-range () nil
1952 (spin-button spin-button)
1953 (min double-float :out)
1954 (max double-float :out))
1955
f36ca6af 1956(defun spin-button-value-as-int (spin-button)
1957 (round (spin-button-value spin-button)))
560af5c5 1958
510fbcc1 1959(defbinding %spin-button-spin () nil
f36ca6af 1960 (spin-button spin-button)
1961 (direction spin-type)
510fbcc1 1962 (increment double-float))
1963
1964(defun spin-button-spin (spin-button value)
1965 (etypecase value
1966 (real (%spin-button-spin spin-button :spin-user-defined value))
1967 (spin-type (%spin-button-spin spin-button value 0))))
1968
560af5c5 1969
bbaeff4b 1970(defbinding spin-button-update () nil
f36ca6af 1971 (spin-button spin-button))
560af5c5 1972
1973
1974
1975; ;;; Ruler
1976
bbaeff4b 1977(defbinding ruler-set-range () nil
f36ca6af 1978 (ruler ruler)
1979 (lower single-float)
1980 (upper single-float)
1981 (position single-float)
1982 (max-size single-float))
560af5c5 1983
68f519e0 1984(defbinding ruler-get-range () nil
1985 (ruler ruler)
1986 (lower single-float :out)
1987 (upper single-float :out)
1988 (position single-float :out)
1989 (max-size single-float :out))
560af5c5 1990
560af5c5 1991
560af5c5 1992
d520140e 1993;;; Range
560af5c5 1994
1047e159 1995(defun range-lower (range)
1996 (adjustment-lower (range-adjustment range)))
560af5c5 1997
1047e159 1998(defun range-upper (range)
1999 (adjustment-upper (range-adjustment range)))
560af5c5 2000
1047e159 2001(defun (setf range-lower) (value range)
2002 (setf (adjustment-lower (range-adjustment range)) value))
560af5c5 2003
1047e159 2004(defun (setf range-upper) (value range)
2005 (setf (adjustment-upper (range-adjustment range)) value))
560af5c5 2006
1047e159 2007(defun range-page-increment (range)
2008 (adjustment-page-increment (range-adjustment range)))
560af5c5 2009
1047e159 2010(defun range-step-increment (range)
2011 (adjustment-step-increment (range-adjustment range)))
560af5c5 2012
1047e159 2013(defun (setf range-page-increment) (value range)
2014 (setf (adjustment-page-increment (range-adjustment range)) value))
560af5c5 2015
1047e159 2016(defun (setf range-step-increment) (value range)
2017 (setf (adjustment-step-increment (range-adjustment range)) value))
560af5c5 2018
1047e159 2019(defbinding range-set-range () nil
d520140e 2020 (range range)
1047e159 2021 (lower double-float)
2022 (upper double-float))
560af5c5 2023
1047e159 2024(defbinding range-set-increments () nil
d520140e 2025 (range range)
1047e159 2026 (step double-float)
2027 (page double-float))
560af5c5 2028
560af5c5 2029
d520140e 2030;;; Scale
560af5c5 2031
68f519e0 2032(defbinding scale-get-layout-offsets () nil
2033 (scale scale)
2034 (x int :out)
2035 (y int :out))
560af5c5 2036
560af5c5 2037
d520140e 2038;;; Progress bar
560af5c5 2039
bbaeff4b 2040(defbinding progress-bar-pulse () nil
d520140e 2041 (progress-bar progress-bar))
560af5c5 2042
2043
c49be931 2044;;; Size group
2045
2046(defmethod initialize-instance ((size-group size-group) &rest initargs
2047 &key widget widgets)
2048 (declare (ignore widget widgets))
2049 (prog1
2050 (call-next-method)
2051 (initial-add size-group #'size-group-add-widget
2052 initargs :widget :widgets)))
2053
2054
2055(defbinding size-group-add-widget () nil
2056 (size-group size-group)
2057 (widget widget))
2058
2059(defbinding size-group-remove-widget () nil
2060 (size-group size-group)
2061 (widget widget))
2062
560af5c5 2063
f5b67f2b 2064;;; Stock items
2065
73d58e01 2066(defbinding %stock-item-copy () pointer
2067 (location pointer))
2068
2069(defbinding %stock-item-free () nil
2070 (location pointer))
f5b67f2b 2071
73d58e01 2072(defmethod reference-foreign ((class (eql (find-class 'stock-item))) location)
2073 (%stock-item-copy location))
2074
2075(defmethod unreference-foreign ((class (eql (find-class 'stock-item))) location)
2076 (%stock-item-free location))
2077
2078(defbinding stock-add (stock-item) nil
2079 (stock-item stock-item)
2080 (1 unsigned-int))
2081
2082(defbinding stock-list-ids () (gslist string))
2083
2084(defbinding %stock-lookup () boolean
2085 (stock-id string)
2086 (location pointer))
2087
2088(defun stock-lookup (stock-id)
2089 (let ((location
2090 (allocate-memory (proxy-instance-size (find-class 'stock-item)))))
2091 (unwind-protect
2092 (when (%stock-lookup stock-id location)
2093 (ensure-proxy-instance 'stock-item (%stock-item-copy location)))
2094 (deallocate-memory location))))
560af5c5 2095
2096
2097;;; Tooltips
2098
bbaeff4b 2099(defbinding tooltips-enable () nil
d520140e 2100 (tooltips tooltips))
560af5c5 2101
bbaeff4b 2102(defbinding tooltips-disable () nil
d520140e 2103 (tooltips tooltips))
560af5c5 2104
e5b416f0 2105(defun (setf tooltips-enabled-p) (enable tooltips)
2106 (if enable
2107 (tooltips-enable tooltips)
2108 (tooltips-disable tooltips)))
2109
bbaeff4b 2110(defbinding tooltips-set-tip () nil
d520140e 2111 (tooltips tooltips)
2112 (widget widget)
2113 (tip-text string)
2114 (tip-private string))
560af5c5 2115
d76e9fca 2116(defbinding tooltips-data-get () tooltips-data
2117 (widget widget))
2118
bbaeff4b 2119(defbinding tooltips-force-window () nil
d520140e 2120 (tooltips tooltips))
560af5c5 2121
d76e9fca 2122(defbinding tooltips-get-info-from-tip-window () boolean
2123 (tip-window window)
2124 (tooltips tooltips :out)
2125 (current-widget widget :out))
560af5c5 2126
2127
d520140e 2128;;; Rc
560af5c5 2129
bbaeff4b 2130(defbinding rc-add-default-file (filename) nil
d520140e 2131 ((namestring (truename filename)) string))
560af5c5 2132
bbaeff4b 2133(defbinding rc-parse (filename) nil
d520140e 2134 ((namestring (truename filename)) string))
560af5c5 2135
bbaeff4b 2136(defbinding rc-parse-string () nil
d520140e 2137 (rc-string string))
560af5c5 2138
bbaeff4b 2139(defbinding rc-reparse-all () nil)
560af5c5 2140
bbaeff4b 2141(defbinding rc-get-style () style
d520140e 2142 (widget widget))