1 ;; Common Lisp bindings for GTK+ v2.x
2 ;; Copyright 1999-2005 Espen S. Johnsen <espen@users.sf.net>
4 ;; Permission is hereby granted, free of charge, to any person obtaining
5 ;; a copy of this software and associated documentation files (the
6 ;; "Software"), to deal in the Software without restriction, including
7 ;; without limitation the rights to use, copy, modify, merge, publish,
8 ;; distribute, sublicense, and/or sell copies of the Software, and to
9 ;; permit persons to whom the Software is furnished to do so, subject to
10 ;; the following conditions:
12 ;; The above copyright notice and this permission notice shall be
13 ;; included in all copies or substantial portions of the Software.
15 ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 ;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 ;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 ;; $Id: gtk.lisp,v 1.44 2005-04-25 18:20:00 espen Exp $
30 (defbinding check-version () (copy-of string)
31 (required-major unsigned-int)
32 (required-minor unsigned-int)
33 (required-micro unsigned-int))
35 (defbinding query-version () nil
36 (major unsigned-int :out)
37 (minor unsigned-int :out)
38 (micro unsigned-int :out))
41 (multiple-value-bind (major minor micro)
44 (format nil "Gtk+ v~A.~A" major minor)
45 (format nil "Gtk+ v~A.~A.~A" major minor micro))))
53 (defbinding (gtk-init "gtk_parse_args") () boolean
54 "Initializes the library without opening the display."
58 (defun clg-init (&optional display)
59 "Initializes the system and starts the event handling"
60 (unless (gdk:display-get-default)
63 (error "Initialization of GTK+ failed."))
65 (gdk:display-open display)
66 (add-fd-handler (gdk:display-connection-number) :input #'main-iterate-all)
67 (setq *periodic-polling-function* #'main-iterate-all)
68 (setq *max-event-to-sec* 0)
69 (setq *max-event-to-usec* 1000))))
74 (defbinding grab-add () nil
77 (defbinding grab-get-current () widget)
79 (defbinding grab-remove () nil
82 (defbinding get-default-language () (copy-of pango:language))
89 (def-callback-marshal %about-dialog-activate-link-func
90 (nil (dialog about-dialog) (link (copy-of string))))
92 (defbinding about-dialog-set-email-hook (function) nil
93 ((callback %about-dialog-activate-link-func) pointer)
94 ((register-callback-function function) unsigned-int)
95 ((callback user-data-destroy-func) pointer))
97 (defbinding about-dialog-set-url-hook (function) nil
98 ((callback %about-dialog-activate-link-func) pointer)
99 ((register-callback-function function) unsigned-int)
100 ((callback user-data-destroy-func) pointer)))
105 (defbinding %accel-group-connect () nil
106 (accel-group accel-group)
108 (modifiers gdk:modifier-type)
112 (defun accel-group-connect (group accelerator function &optional flags)
113 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
114 (let ((gclosure (make-callback-closure function)))
115 (%accel-group-connect group key modifiers flags gclosure)
118 (defbinding accel-group-connect-by-path (group path function) nil
121 ((make-callback-closure function) gclosure :return))
123 (defbinding %accel-group-disconnect (group gclosure) boolean
127 (defbinding %accel-group-disconnect-key () boolean
130 (modifiers gdk:modifier-type))
132 (defun accel-group-disconnect (group accelerator)
133 (etypecase accelerator
134 (gclosure (%accel-group-disconnect group accelerator))
136 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
137 (%accel-group-disconnect-key group key modifiers)))))
139 (defbinding %accel-group-query () (copy-of (vector (inlined accel-group-entry) n))
140 (accel-group accel-group)
142 (modifiers gdk:modifier-type)
145 (defun accel-group-query (accel-group accelerator)
146 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
147 (%accel-group-query accel-group key modifiers)))
149 (defbinding %accel-group-activate () boolean
150 (accel-group accel-group)
151 (acceleratable gobject)
153 (modifiers gdk:modifier-type))
155 (defun accel-group-activate (accel-group acceleratable accelerator)
156 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
157 (%accel-group-activate accel-group acceleratable key modifiers)))
159 (defbinding accel-group-lock () nil
160 (accel-group accel-group))
162 (defbinding accel-group-unlock () nil
163 (accel-group accel-group))
165 (defbinding accel-group-from-accel-closure () accel-group
168 (defbinding %accel-groups-activate () boolean
171 (modifiers gdk:modifier-type))
173 (defun accel-groups-activate (object accelerator)
174 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
175 (%accel-groups-activate object key modifiers)))
177 (defbinding accel-groups-from-object () (gslist accel-groups)
180 (defbinding accelerator-valid-p (key &optional modifiers) boolean
182 (modifiers gdk:modifier-type))
184 (defbinding %accelerator-parse () nil
186 (key unsigned-int :out)
187 (modifiers gdk:modifier-type :out))
189 (defgeneric parse-accelerator (accelerator))
191 (defmethod parse-accelerator ((accelerator string))
192 (multiple-value-bind (key modifiers) (%accelerator-parse accelerator)
194 (error "Invalid accelerator: ~A" accelerator)
195 (values key modifiers))))
197 (defmethod parse-accelerator ((accelerator cons))
198 (destructuring-bind (key modifiers) accelerator
204 (gdk:keyval-from-name key)
205 (error "Invalid key name: ~A" key)))
206 (character (parse-accelerator key)))
209 (defmethod parse-accelerator ((key integer))
212 (defmethod parse-accelerator ((key character))
214 (gdk:keyval-from-name (string key))
215 (error "Invalid key name: ~A" key)))
218 (defbinding accelerator-name () string
220 (modifiers gdk:modifier-type))
223 (defbinding accelerator-get-label () string
225 (modifiers gdk:modifier-type))
227 (defbinding %accelerator-set-default-mod-mask () nil
228 (default-modifiers gdk:modifier-type))
230 (defun (setf accelerator-default-modifier-mask) (default-modifiers)
231 (%accelerator-set-default-mod-mask default-modifiers))
233 (defbinding (accelerator-default-modifier-mask "gtk_accelerator_get_default_mod_mask") () gdk:modifier-type)
238 (defbinding accel-label-get-accel-width () unsigned-int
239 (accel-label accel-label))
241 (defbinding accel-label-refetch () boolean
242 (accel-label accel-label))
248 (defbinding (accel-map-init "_gtk_accel_map_init") () nil)
250 (defbinding %accel-map-add-entry () nil
253 (modifiers gdk:modifier-type))
255 (defun accel-map-add-entry (path accelerator)
256 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
257 (%accel-map-add-entry path key modifiers)))
259 (defbinding %accel-map-lookup-entry () boolean
261 ((make-instance 'accel-key) accel-key :return))
263 (defun accel-map-lookup-entry (path)
264 (multiple-value-bind (found-p accel-key) (%accel-map-lookup-entry path)
267 (slot-value accel-key 'key)
268 (slot-value accel-key 'modifiers)
269 (slot-value accel-key 'flags)))))
271 (defbinding %accel-map-change-entry () boolean
274 (modifiers gdk:modifier-type)
277 (defun accel-map-change-entry (path accelerator &optional replace)
278 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
279 (%accel-map-change-entry path key modifiers replace)))
281 (defbinding accel-map-load () nil
284 (defbinding accel-map-save () nil
287 (defcallback %accel-map-foreach-func
289 (callback-id unsigned-int) (accel-path (copy-of string))
290 (key unsigned-int) (modifiers gdk:modifier-type) (changed boolean))
291 (invoke-callback callback-id nil accel-path key modifiers changed))
293 (defbinding %accel-map-foreach (callback-id) nil
294 (callback-id unsigned-int)
295 (%accel-map-foreach-func callback))
297 (defbinding %accel-map-foreach-unfiltered (callback-id) nil
298 (callback-id unsigned-int)
299 (%accel-map-foreach-func callback))
301 (defun accel-map-foreach (function &optional (filter-p t))
302 (with-callback-function (id function)
304 (%accel-map-foreach id)
305 (%accel-map-foreach-unfiltered id))))
307 (defbinding accel-map-add-filter () nil
310 (defbinding accel-map-get () accel-map)
312 (defbinding accel-map-lock-path () nil
315 (defbinding accel-map-unlock-path () nil
322 (defbinding accessible-connect-widget-destroyed () nil
323 (accessible accessible))
328 (defmethod initialize-instance ((adjustment adjustment) &key value)
331 ;; we need to make sure that the value is set last, otherwise it
332 ;; may be outside current limits and ignored
334 (setf (slot-value adjustment 'value) value))))
337 (defbinding adjustment-changed () nil
338 (adjustment adjustment))
340 (defbinding adjustment-value-changed () nil
341 (adjustment adjustment))
343 (defbinding adjustment-clamp-page () nil
344 (adjustment adjustment)
346 (upper single-float))
351 (defbinding alignment-set () nil
352 (alognment alignment)
353 (x-align single-float)
354 (y-align single-float)
355 (x-scale single-float)
356 (y-scale single-float))
358 (defbinding alignment-get-padding () nil
359 (alognment alignment)
360 (top unsigned-int :out)
361 (bottom unsigned-int :out)
362 (left unsigned-int :out)
363 (right unsigned-int :out))
365 (defbinding alignment-set-padding () nil
366 (alognment alignment)
368 (bottom unsigned-int)
370 (right unsigned-int))
378 (defun (setf bin-child) (child bin)
379 (when-bind (current-child (bin-child bin))
380 (container-remove bin current-child))
381 (container-add bin child)
384 (defmethod compute-signal-function ((bin bin) signal function object)
385 (declare (ignore signal))
386 (if (eq object :child)
387 #'(lambda (&rest args)
388 (apply function (bin-child bin) (rest args)))
394 (defbinding box-pack-start () nil
399 (padding unsigned-int))
401 (defbinding box-pack-end () nil
406 (padding unsigned-int))
408 (defun box-pack (box child &key end (expand t) (fill t) (padding 0))
410 (box-pack-end box child expand fill padding)
411 (box-pack-start box child expand fill padding)))
413 (defbinding box-reorder-child () nil
418 (defbinding box-query-child-packing () nil
421 (expand boolean :out)
423 (padding unsigned-int :out)
424 (pack-type pack-type :out))
426 (defbinding box-set-child-packing () nil
431 (padding unsigned-int)
432 (pack-type pack-type))
438 (defmethod initialize-instance ((button button) &rest initargs &key stock)
440 (apply #'call-next-method button :label stock :use-stock t initargs)
444 (defbinding button-pressed () nil
447 (defbinding button-released () nil
450 (defbinding button-clicked () nil
453 (defbinding button-enter () nil
456 (defbinding button-leave () nil
463 (defbinding calendar-select-month () int
468 (defbinding calendar-select-day () nil
472 (defbinding calendar-mark-day () int
476 (defbinding calendar-unmark-day () int
480 (defbinding calendar-clear-marks () nil
483 (defbinding calendar-get-date () nil
485 (year unsigned-int :out)
486 (month unsigned-int :out)
487 (day unsigned-int :out))
489 (defbinding calendar-freeze () nil
492 (defbinding calendar-thaw () nil
498 (defbinding check-menu-item-toggled () nil
499 (check-menu-item check-menu-item))
504 (defbinding (color-selection-is-adjusting-p
505 "gtk_color_selection_is_adjusting") () boolean
506 (colorsel color-selection))
510 ;;; Color selection dialog -- no functions
516 (defmethod initialize-instance ((combo-box combo-box) &rest initargs
517 &key model content active)
518 (remf initargs :active)
520 (apply #'call-next-method combo-box initargs)
522 (apply #'call-next-method combo-box
523 :model (make-instance 'list-store :column-types '(string))
525 (unless (typep combo-box 'combo-box-entry)
526 (let ((cell (make-instance 'cell-renderer-text)))
527 (cell-layout-pack combo-box cell :expand t)
528 (cell-layout-add-attribute combo-box cell :text 0)))))
530 (mapc #'(lambda (text)
531 (combo-box-append-text combo-box text))
534 (setf (combo-box-active combo-box) active)))
537 ;; (defmethod shared-initialize :after ((combo-box combo-box) names &key active)
539 ;; (signal-emit combo-box 'changed)))
541 (defbinding combo-box-append-text () nil
542 (combo-box combo-box)
545 (defbinding combo-box-insert-text () nil
546 (combo-box combo-box)
550 (defbinding combo-box-prepend-text () nil
551 (combo-box combo-box)
555 (defbinding combo-box-get-active-text () string
556 (combo-box combo-box))
558 (defbinding combo-box-popup () nil
559 (combo-box combo-box))
561 (defbinding combo-box-popdown () nil
562 (combo-box combo-box))
568 (defmethod initialize-instance ((combo-box-entry combo-box-entry) &key model)
571 (setf (combo-box-entry-text-column combo-box-entry) 0)))
576 (defmethod shared-initialize ((dialog dialog) names &rest initargs
578 (declare (ignore button buttons))
581 (initial-apply-add dialog #'dialog-add-button initargs :button :buttons)))
584 (defun dialog-response-id (dialog response &optional create-p error-p)
585 "Returns a numeric response id"
586 (if (typep response 'response-type)
587 (response-type-to-int response)
588 (let ((responses (object-data dialog 'responses)))
590 ((and responses (position response responses :test #'equal)))
594 (vector-push-extend response responses)
595 (1- (length responses)))
598 (object-data dialog 'responses)
599 (make-array 1 :adjustable t :fill-pointer t
600 :initial-element response))
603 (error "Invalid response: ~A" response))))))
605 (defun dialog-find-response (dialog id)
606 "Finds a symbolic response given a numeric id"
608 (int-to-response-type id)
609 (aref (object-data dialog 'responses) id)))
612 (defmethod compute-signal-id ((dialog dialog) signal)
613 (if (dialog-response-id dialog signal)
614 (ensure-signal-id 'response dialog)
617 (defmethod compute-signal-function ((dialog dialog) signal function object)
618 (declare (ignore function object))
619 (let ((callback (call-next-method))
620 (id (dialog-response-id dialog signal)))
622 #'(lambda (dialog response)
623 (when (= response id)
624 (funcall callback dialog)))
627 (defbinding dialog-run () nil
630 (defbinding dialog-response (dialog response) nil
632 ((dialog-response-id dialog response nil t) int))
635 (defbinding %dialog-add-button () button
640 (defun dialog-add-button (dialog label &optional (response label)
641 &key default object after)
642 "Adds a button to the dialog."
643 (let* ((signal (if (functionp response)
646 (id (dialog-response-id dialog signal t))
647 (button (%dialog-add-button dialog label id)))
648 (when (functionp response)
649 (signal-connect dialog signal response :object object :after after))
651 (%dialog-set-default-response dialog id))
655 (defbinding %dialog-add-action-widget () nil
657 (action-widget widget)
660 (defun dialog-add-action-widget (dialog widget &optional (response widget)
661 &key default object after)
662 (let* ((signal (if (functionp response)
665 (id (dialog-response-id dialog signal t)))
666 (unless (widget-hidden-p widget)
667 (widget-show widget))
668 (%dialog-add-action-widget dialog widget id)
669 (when (functionp response)
670 (signal-connect dialog signal response :object object :after after))
672 (%dialog-set-default-response dialog id))
676 (defbinding %dialog-set-default-response () nil
680 (defun dialog-set-default-response (dialog response)
681 (%dialog-set-default-response
682 dialog (dialog-response-id dialog response nil t)))
684 (defbinding dialog-set-response-sensitive (dialog response sensitive) nil
686 ((dialog-response-id dialog response nil t) int)
690 (defbinding alternative-dialog-button-order-p (&optional screen) boolean
691 (screen (or null gdk:screen)))
694 (defbinding (dialog-set-alternative-button-order
695 "gtk_dialog_set_alternative_button_order_from_array")
698 ((length new-order) int)
699 ((map 'vector #'(lambda (response)
700 (dialog-response-id dialog response nil t))
701 new-order) (vector int)))
704 (defmethod container-add ((dialog dialog) (child widget) &rest args)
705 (apply #'container-add (dialog-vbox dialog) child args))
708 (defmethod container-remove ((dialog dialog) (child widget))
709 (container-remove (dialog-vbox dialog) child))
711 (defmethod container-children ((dialog dialog))
712 (container-children (dialog-vbox dialog)))
714 (defmethod (setf container-children) (children (dialog dialog))
715 (setf (container-children (dialog-vbox dialog)) children))
720 (defbinding entry-get-layout-offsets () nil
725 (defbinding entry-layout-index-to-text-index () int
729 (defbinding entry-text-index-to-layout-index () int
736 (def-callback-marshal %entry-completion-match-func
737 (boolean entry-completion string (copy-of tree-iter)))
739 (defbinding entry-completion-set-match-func (completion function) nil
740 (completion entry-completion)
741 ((callback %entry-completion-match-func) pointer)
742 ((register-callback-function function) unsigned-int)
743 ((callback user-data-destroy-func) pointer))
745 (defbinding entry-completion-complete () nil
746 (completion entry-completion))
749 (defbinding entry-completion-insert-prefix () nil
750 (completion entry-completion))
752 (defbinding entry-completion-insert-action-text () nil
753 (completion entry-completion)
757 (defbinding entry-completion-insert-action-markup () nil
758 (completion entry-completion)
762 (defbinding entry-completion-delete-action () nil
763 (completion entry-completion)
769 (defmethod initialize-instance ((file-chooser file-chooser) &rest initargs
770 &key filter filters shortcut-folder
771 shortcut-folders shortcut-folder-uti
772 shortcut-folder-uris)
773 (declare (ignore filter filters shortcut-folder shortcut-folders
774 shortcut-folder-uti shortcut-folder-uris))
777 (initial-add file-chooser #'file-chooser-add-filter
778 initargs :filer :filters)
779 (initial-add file-chooser #'file-chooser-add-shortcut-folder
780 initargs :shortcut-folder :shortcut-folders)
781 (initial-add file-chooser #'file-chooser-add-shortcut-folder-uri
782 initargs :shortcut-folder-uri :shortcut-folders-uris)))
785 (defbinding file-chooser-select-filename () boolean
786 (file-chooser file-chooser)
789 (defbinding file-chooser-unselect-filename () nil
790 (file-chooser file-chooser)
793 (defbinding file-chooser-select-all () boolean
794 (file-chooser file-chooser))
796 (defbinding file-chooser-unselect-all () boolean
797 (file-chooser file-chooser))
799 (defbinding file-chooser-get-filenames () (gslist string)
800 (file-chooser file-chooser))
802 (defbinding file-chooser-select-uri () boolean
803 (file-chooser file-chooser)
806 (defbinding file-chooser-unselect-uri () nil
807 (file-chooser file-chooser)
810 (defbinding file-chooser-get-uris () (gslist string)
811 (file-chooser file-chooser))
813 (defbinding file-chooser-add-filter () nil
814 (file-chooser file-chooser)
815 (filter file-filter))
817 (defbinding file-chooser-remove-filter () nil
818 (file-chooser file-chooser)
819 (filter file-filter))
821 (defbinding file-chooser-list-filters () (gslist file-filter)
822 (file-chooser file-chooser))
824 (defbinding file-chooser-add-shortcut-folder () boolean
825 (file-chooser file-chooser)
829 (defbinding file-chooser-remove-shortcut-folder () nil
830 (file-chooser file-chooser)
834 (defbinding file-chooser-list-shortcut-folders () (gslist string)
835 (file-chooser file-chooser))
837 (defbinding file-chooser-add-shortcut-folder-uri () boolean
838 (file-chooser file-chooser)
842 (defbinding file-chooser-remove-shortcut-folder-uri () nil
843 (file-chooser file-chooser)
847 (defbinding file-chooser-list-shortcut-folder-uris () (gslist string)
848 (file-chooser file-chooser))
853 (defmethod initialize-instance ((file-filter file-filter) &rest initargs
854 &key mime-type mime-types pattern patterns
856 (declare (ignore mime-type mime-types pattern patterns))
860 #-gtk2.6(warn "Initarg :PIXBUF-FORMATS not supportet in this version of Gtk")
861 #+gtk2.6(file-filter-add-pixbuf-formats file-filter))
862 (initial-add file-filter #'file-filter-add-mime-type
863 initargs :mime-type :mime-types)
864 (initial-add file-filter #'file-filter-add-pattern
865 initargs :pattern :patterns)))
868 (defbinding file-filter-add-mime-type () nil
872 (defbinding file-filter-add-pattern () nil
877 (defbinding file-filter-add-pixbuf-formats () nil
878 (filter file-filter))
880 (def-callback-marshal %file-filter-func (boolean file-filter-info))
882 (defbinding file-filter-add-custom (filter needed function) nil
884 (needed file-filter-flags)
885 ((callback %file-filter-func) pointer)
886 ((register-callback-function function) unsigned-int)
887 ((callback user-data-destroy-func) pointer))
889 (defbinding file-filter-get-needed () file-filter-flags
890 (filter file-filter))
892 (defbinding file-filter-filter () boolean
894 (filter-info file-filter-info))
900 (defbinding image-set-from-file () nil
904 (defmethod (setf image-pixmap) ((data vector) (image image))
905 (multiple-value-bind (pixmap mask) (gdk:pixmap-create data)
906 (setf (image-pixmap image) pixmap)
907 (setf (image-mask image) mask)))
909 (defmethod initialize-instance ((image image) &rest initargs &key pixmap file)
911 ((typep pixmap 'vector)
912 (multiple-value-bind (pixmap mask) (gdk:pixmap-create pixmap)
913 (apply #'call-next-method image :pixmap pixmap :mask mask initargs)))
917 (image-set-from-file image file)))
918 ((call-next-method))))
920 (defun create-image-widget (source &optional mask)
922 (gdk:pixbuf (make-instance 'image :pixbuf source))
923 (string (make-instance 'image :stock source))
924 (pathname (make-instance 'image :file source))
925 ((or list vector) (make-instance 'image :pixmap source))
926 (gdk:pixmap (make-instance 'image :pixmap source :mask mask))))
931 (defmethod initialize-instance ((item image-menu-item) &rest initargs &key image)
932 (if (and image (not (typep image 'widget)))
933 (apply #'call-next-method item :image (create-image-widget image) initargs)
937 (defmethod (setf image-menu-item-image) ((widget widget) (item image-menu-item))
938 (setf (slot-value item 'image) widget))
940 (defmethod (setf image-menu-item-image) (image (item image-menu-item))
941 (setf (image-menu-item-image item) (create-image-widget image)))
946 (defmethod shared-initialize ((label label) names &key pattern)
947 (declare (ignore names))
950 (setf (label-pattern label) pattern)))
952 (defbinding label-get-layout-offsets () nil
957 (defbinding label-select-region () nil
962 (defbinding label-get-selection-bounds () boolean
971 (defbinding %radio-button-get-group () pointer
972 (radio-button radio-button))
974 (defbinding %radio-button-set-group () nil
975 (radio-button radio-button)
978 (defmethod add-to-radio-group ((button1 radio-button) (button2 radio-button))
979 "Add BUTTON1 to the group which BUTTON2 belongs to."
980 (%radio-button-set-group button1 (%radio-button-get-group button2)))
982 (defun %add-activate-callback (widget signal function object after)
984 (signal-connect widget signal
986 (when (slot-value widget 'active)
987 (funcall function object (slot-value widget 'value))))
988 :object object :after after)
989 (signal-connect widget signal
991 (when (slot-value widget 'active)
992 (funcall function (slot-value widget 'value))))
995 (defmethod activate-radio-widget ((button radio-button))
996 (signal-emit button 'clicked))
998 (defmethod add-activate-callback ((button radio-button) function &key object after)
999 (%add-activate-callback button 'clicked function object after))
1001 (defmethod initialize-instance ((button radio-button) &key group)
1005 (add-to-radio-group button group))))
1010 (defbinding item-select () nil
1013 (defbinding item-deselect () nil
1016 (defbinding item-toggle () nil
1023 (defmethod initialize-instance ((item menu-item) &key label)
1027 (setf (menu-item-label item) label))))
1030 (defun (setf menu-item-label) (label menu-item)
1031 (make-instance 'accel-label
1032 :label label :xalign 0.0 :yalign 0.5 :accel-widget menu-item
1033 :use-underline (menu-item-use-underline-p menu-item)
1034 :visible t :parent menu-item)
1037 (defun menu-item-label (menu-item)
1038 (when (and (slot-boundp menu-item 'child)
1039 (typep (bin-child menu-item) 'label))
1040 (label-label (bin-child menu-item))))
1042 (defbinding menu-item-remove-submenu () nil
1043 (menu-item menu-item))
1045 (defbinding menu-item-set-accel-path () nil
1046 (menu-item menu-item)
1047 (accel-path string))
1049 (defbinding menu-item-select () nil
1050 (menu-item menu-item))
1052 (defbinding menu-item-deselect () nil
1053 (menu-item menu-item))
1055 (defbinding menu-item-activate () nil
1056 (menu-item menu-item))
1058 (defbinding menu-item-toggle-size-request () nil
1059 (menu-item menu-item)
1060 (requisition int :out))
1062 (defbinding menu-item-toggle-size-allocate () nil
1063 (menu-item menu-item)
1067 ;;; Menu tool button
1070 (defbinding menu-tool-button-set-arrow-tooltip () nil
1071 (menu-tool-button menu-tool-button)
1074 (tip-private string))
1079 (defmethod initialize-instance ((dialog message-dialog)
1080 &key (message-type :info) (buttons :close)
1081 flags text #+gtk 2.6 secondary-text
1084 (slot-value dialog 'location)
1085 (%message-dialog-new transient-parent flags message-type buttons))
1087 (message-dialog-set-markup dialog text))
1089 (when secondary-text
1090 (message-dialog-format-secondary-markup dialog secondary-text))
1094 (defbinding %message-dialog-new () pointer
1095 (parent (or null window))
1096 (flags dialog-flags)
1098 (buttons buttons-type)
1101 (defbinding message-dialog-set-markup () nil
1102 (message-dialog message-dialog)
1106 (defbinding message-dialog-format-secondary-text () nil
1107 (message-dialog message-dialog)
1111 (defbinding message-dialog-format-secondary-markup () nil
1112 (message-dialog message-dialog)
1119 (defbinding %radio-menu-item-get-group () pointer
1120 (radio-menu-item radio-menu-item))
1122 (defbinding %radio-menu-item-set-group () nil
1123 (radio-menu-item radio-menu-item)
1126 (defmethod activate-radio-widget ((item radio-menu-item))
1127 (menu-item-activate item))
1129 (defmethod add-to-radio-group ((item1 radio-menu-item) (item2 radio-menu-item))
1130 "Add ITEM1 to the group which ITEM2 belongs to."
1131 (%radio-menu-item-set-group item1 (%radio-menu-item-get-group item2)))
1133 (defmethod add-activate-callback ((item radio-menu-item) function &key object after)
1134 (%add-activate-callback item 'activate function object after))
1136 (defmethod initialize-instance ((item radio-menu-item) &key group)
1140 (add-to-radio-group item group))))
1144 ;;; Radio tool button
1146 (defbinding %radio-tool-button-get-group () pointer
1147 (radio-tool-button radio-tool-button))
1149 (defbinding %radio-tool-button-set-group () nil
1150 (radio-tool-button radio-tool-button)
1153 (defmethod activate-radio-widget ((button radio-tool-button))
1154 (signal-emit button 'clicked))
1156 (defmethod add-to-radio-group ((button1 radio-tool-button) (button2 radio-tool-button))
1157 "Add BUTTON1 to the group which BUTTON2 belongs to."
1158 (%radio-tool-button-set-group button1 (%radio-tool-button-get-group button2)))
1159 (defmethod add-activate-callback ((button radio-tool-button) function &key object after)
1160 (%add-activate-callback button 'clicked function object after))
1162 (defmethod initialize-instance ((button radio-tool-button) &key group)
1166 (add-to-radio-group button group))))
1172 (defbinding toggle-button-toggled () nil
1173 (toggle-button toggle-button))
1178 (defmethod initialize-instance ((window window) &rest initargs
1179 &key accel-group accel-groups)
1180 (declare (ignore accel-group accel-groups))
1183 (initial-add window #'window-add-accel-group
1184 initargs :accel-group :accel-groups)))
1187 (defbinding window-set-wmclass () nil
1189 (wmclass-name string)
1190 (wmclass-class string))
1192 (defbinding window-add-accel-group () nil
1194 (accel-group accel-group))
1196 (defbinding window-remove-accel-group () nil
1198 (accel-group accel-group))
1200 (defbinding window-activate-focus () int
1203 (defbinding window-activate-default () int
1206 (defbinding window-set-default-size (window width height) int
1209 ((or height -1) int))
1211 (defbinding %window-set-geometry-hints () nil
1213 (geometry gdk:geometry)
1214 (geometry-mask gdk:window-hints))
1216 (defun window-set-geometry-hints (window &key min-width min-height
1217 max-width max-height base-width base-height
1218 width-inc height-inc min-aspect max-aspect
1219 (gravity nil gravity-p) min-size max-size)
1220 (let ((geometry (make-instance 'gdk:geometry
1221 :min-width (or min-width -1)
1222 :min-height (or min-height -1)
1223 :max-width (or max-width -1)
1224 :max-height (or max-height -1)
1225 :base-width (or base-width 0)
1226 :base-height (or base-height 0)
1227 :width-inc (or width-inc 0)
1228 :height-inc (or height-inc 0)
1229 :min-aspect (or min-aspect 0)
1230 :max-aspect (or max-aspect 0)
1233 (when (or min-size min-width min-height)
1234 (push :min-size mask))
1235 (when (or max-size max-width max-height)
1236 (push :max-size mask))
1237 (when (or base-width base-height)
1238 (push :base-size mask))
1239 (when (or width-inc height-inc)
1240 (push :resize-inc mask))
1241 (when (or min-aspect max-aspect)
1242 (push :aspect mask))
1244 (push :win-gravity mask))
1245 (%window-set-geometry-hints window geometry mask)))
1247 (defbinding window-list-toplevels () (glist (copy-of window))
1248 "Returns a list of all existing toplevel windows.")
1250 (defbinding window-add-mnemonic (window key target) nil
1252 ((gdk:keyval-from-name key) unsigned-int)
1255 (defbinding window-remove-mnemonic (window key target) nil
1257 ((gdk:keyval-from-name key) unsigned-int)
1260 (defbinding window-mnemonic-activate (window key modifier) nil
1262 ((gdk:keyval-from-name key) unsigned-int)
1263 (modifier gdk:modifier-type))
1265 (defbinding window-activate-key () boolean
1267 (event gdk:key-event))
1269 (defbinding window-propagate-key-event () boolean
1271 (event gdk:key-event))
1273 (defbinding window-present () nil
1276 (defbinding window-iconify () nil
1279 (defbinding window-deiconify () nil
1282 (defbinding window-stick () nil
1285 (defbinding window-unstick () nil
1288 (defbinding window-maximize () nil
1291 (defbinding window-unmaximize () nil
1294 (defbinding window-fullscreen () nil
1297 (defbinding window-unfullscreen () nil
1300 (defbinding window-set-keep-above () nil
1304 (defbinding window-set-keep-below () nil
1308 (defbinding window-begin-resize-drag () nil
1310 (edge gdk:window-edge)
1312 (root-x int) (root-y int)
1313 (timestamp unsigned-int))
1315 (defbinding window-begin-move-drag () nil
1317 (edge gdk:window-edge)
1319 (root-x int) (root-y int)
1320 (timestamp unsigned-int))
1322 (defbinding window-set-frame-dimensions () nil
1324 (left int) (top int) (rigth int) (bottom int))
1326 (defbinding %window-get-default-size () nil
1331 (defun window-get-default-size (window)
1332 (multiple-value-bind (width height) (%window-get-default-size window)
1333 (values (unless (= width -1) width) (unless (= height -1) height))))
1335 (defbinding window-get-frame-dimensions () nil
1337 (left int :out) (top int :out) (rigth int :out) (bottom int :out))
1339 (defbinding %window-get-icon-list () (glist gdk:pixbuf)
1342 (defbinding window-get-position () nil
1347 (defbinding window-get-size () nil
1352 (defbinding window-move () nil
1357 (defbinding window-parse-geometry () boolean
1361 (defbinding window-reshow-with-initial-size () nil
1364 (defbinding window-resize () nil
1369 (defbinding (window-default-icon-list "gtk_window_get_default_icon_list")
1370 () (glist gdk:pixbuf))
1372 (defun window-default-icon ()
1373 (first (window-default-icon-list)))
1375 (defbinding %window-set-default-icon-list () nil
1376 (icons (glist gdk:pixbuf)))
1378 (defun (setf window-default-icon-list) (icons)
1379 (%window-set-default-icon-list icons)
1382 (defbinding %window-set-default-icon () nil
1383 (icons (glist gdk:pixbuf)))
1385 (defmethod (setf window-default-icon) ((icon gdk:pixbuf))
1386 (%window-set-default-icon icon)
1389 (defmethod (setf window-group) ((group window-group) (window window))
1390 (window-group-add-window group window)
1393 (defbinding %window-set-default-icon-from-file () boolean
1397 (defmethod (setf window-default-icon) ((icon-file pathname))
1398 (%window-set-default-icon-from-file icon-file)
1401 (defbinding %window-set-icon-from-file () boolean
1406 (defmethod (setf window-icon) ((icon-file pathname) (window window))
1407 (%window-set-icon-from-file window icon-file)
1410 (defbinding window-set-auto-startup-notification () nil
1413 (defbinding decorated-window-init () nil
1416 (defbinding decorated-window-calculate-frame-size () nil
1419 (defbinding decorated-window-set-title () nil
1423 (defbinding decorated-window-move-resize-window () nil
1433 (defmethod initialize-instance ((window-group window-group) &rest initargs
1434 &key window windows)
1435 (declare (ignore window windows))
1438 (initial-add window-group #'window-group-add-window
1439 initargs :window :windows)))
1442 (defbinding window-group-add-window () nil
1443 (window-group window-group)
1446 (defbinding window-group-remove-window () nil
1447 (window-group window-group)
1453 (defun (setf scrolled-window-scrollbar-policy) (policy window)
1454 (setf (scrolled-window-hscrollbar-policy window) policy)
1455 (setf (scrolled-window-vscrollbar-policy window) policy))
1457 (defbinding scrolled-window-add-with-viewport () nil
1458 (scrolled-window scrolled-window)
1461 (defmethod shared-initialize ((window scrolled-window) names &key policy)
1462 (declare (ignore names))
1464 (setf (slot-value window 'hscrollbar-policy) policy)
1465 (setf (slot-value window 'vscrollbar-policy) policy))
1471 (defbinding statusbar-get-context-id () unsigned-int
1472 (statusbar statusbar)
1473 (context-description string))
1475 (defbinding statusbar-push () unsigned-int
1476 (statusbar statusbar)
1477 (context-id unsigned-int)
1480 (defbinding statusbar-pop () nil
1481 (statusbar statusbar)
1482 (context-id unsigned-int))
1484 (defbinding statusbar-remove () nil
1485 (statusbar statusbar)
1486 (context-id unsigned-int)
1487 (message-id unsigned-int))
1493 (defbinding fixed-put () nil
1498 (defbinding fixed-move () nil
1507 (defun %ensure-notebook-position (notebook page)
1510 (widget (notebook-page-num notebook page t))))
1512 (defun %ensure-notebook-child (notebook position)
1515 (t (notebook-get-nth-page notebook position))))
1517 (defbinding (notebook-insert "gtk_notebook_insert_page_menu")
1518 (notebook position child tab-label &optional menu-label) nil
1521 ((if (stringp tab-label)
1522 (make-instance 'label :label tab-label)
1524 ((if (stringp menu-label)
1525 (make-instance 'label :label menu-label)
1526 menu-label) (or null widget))
1527 ((%ensure-notebook-position notebook position) position))
1529 (defun notebook-append (notebook child tab-label &optional menu-label)
1530 (notebook-insert notebook :last child tab-label menu-label))
1532 (defun notebook-prepend (notebook child tab-label &optional menu-label)
1533 (notebook-insert notebook :first child tab-label menu-label))
1535 (defbinding notebook-remove-page (notebook page) nil
1537 ((%ensure-notebook-position notebook page) position))
1539 (defbinding %notebook-page-num () int
1543 (defun notebook-page-num (notebook child &optional error-p)
1544 (let ((page-num (%notebook-page-num notebook child)))
1547 (error "~A is not a page in ~A" child notebook))
1550 (defbinding notebook-next-page () nil
1551 (notebook notebook))
1553 (defbinding notebook-prev-page () nil
1554 (notebook notebook))
1556 (defbinding notebook-reorder-child (notebook child position) nil
1559 ((%notebook-position notebook position) int))
1561 (defbinding notebook-popup-enable () nil
1562 (notebook notebook))
1564 (defbinding notebook-popup-disable () nil
1565 (notebook notebook))
1567 (defbinding notebook-get-nth-page () widget
1571 (defun %notebook-current-page (notebook)
1572 (when (slot-boundp notebook 'current-page-num)
1573 (notebook-get-nth-page notebook (notebook-current-page-num notebook))))
1575 (defun (setf notebook-current-page) (page notebook)
1576 (setf (notebook-current-page notebook) (notebook-page-num notebook page)))
1578 (defbinding (notebook-tab-label "gtk_notebook_get_tab_label")
1579 (notebook page) widget
1581 ((%ensure-notebook-child notebook page) widget))
1583 (defbinding (notebook-tab-label-text "gtk_notebook_get_tab_label_text")
1584 (notebook page) (copy-of string)
1586 ((%ensure-notebook-child notebook page) widget))
1588 (defbinding %notebook-set-tab-label () nil
1593 (defun (setf notebook-tab-label) (tab-label notebook page)
1594 (let ((widget (if (stringp tab-label)
1595 (make-instance 'label :label tab-label)
1597 (%notebook-set-tab-label notebook (%ensure-notebook-child notebook page) widget)
1601 (defbinding (notebook-menu-label "gtk_notebook_get_menu_label")
1602 (notebook page) widget
1604 ((%ensure-notebook-child notebook page) widget))
1606 (defbinding (notebook-menu-label-text "gtk_notebook_get_menu_label_text")
1607 (notebook page) (copy-of string)
1609 ((%ensure-notebook-child notebook page) widget))
1611 (defbinding %notebook-set-menu-label () nil
1614 (menu-label widget))
1616 (defun (setf notebook-menu-label) (menu-label notebook page)
1617 (let ((widget (if (stringp menu-label)
1618 (make-instance 'label :label menu-label)
1620 (%notebook-set-menu-label notebook (%ensure-notebook-child notebook page) widget)
1624 (defbinding notebook-query-tab-label-packing (notebook page) nil
1626 ((%notebook-child notebook page) widget)
1627 (expand boolean :out)
1629 (pack-type pack-type :out))
1631 (defbinding notebook-set-tab-label-packing
1632 (notebook page expand fill pack-type) nil
1634 ((%notebook-child notebook page) widget)
1637 (pack-type pack-type))
1643 (defbinding paned-pack1 () nil
1649 (defbinding paned-pack2 () nil
1658 (defbinding layout-put () nil
1664 (defbinding layout-move () nil
1670 (defbinding layout-set-size () nil
1672 (width unsigned-int)
1673 (height unsigned-int))
1675 (defbinding layout-get-size () nil
1677 (width unsigned-int :out)
1678 (height unsigned-int :out))
1683 (defbinding menu-shell-insert (menu-shell menu-item position) nil
1684 (menu-shell menu-shell)
1685 (menu-item menu-item)
1691 (defun menu-shell-append (menu-shell menu-item)
1692 (menu-shell-insert menu-shell menu-item :last))
1694 (defun menu-shell-prepend (menu-shell menu-item)
1695 (menu-shell-insert menu-shell menu-item :fisrt))
1697 (defbinding menu-shell-deactivate () nil
1698 (menu-shell menu-shell))
1700 (defbinding menu-shell-select-item () nil
1701 (menu-shell menu-shell)
1702 (menu-item menu-item))
1704 (defbinding menu-shell-select-first () nil
1705 (menu-shell menu-shell)
1706 (search-sensitive boolean))
1708 (defbinding menu-shell-deselect () nil
1709 (menu-shell menu-shell))
1711 (defbinding menu-shell-activate-item () nil
1712 (menu-shell menu-shell)
1713 (menu-item menu-item)
1714 (fore-deactivate boolean))
1716 (defbinding menu-shell-cancel () nil
1717 (menu-shell menu-shell))
1722 (defun %menu-position (menu child)
1725 (keyword (case child
1728 (t (error "Invalid position keyword: ~A" child))))
1729 (widget (menu-child-position menu child))))
1732 (defbinding menu-reorder-child (menu menu-item position) nil
1734 (menu-item menu-item)
1735 ((%menu-position menu position) int))
1737 (defbinding menu-attach () nil
1739 (menu-item menu-item)
1740 (left-attach unsigned-int)
1741 (right-attach unsigned-int)
1742 (top-attach unsigned-int)
1743 (bottom-attach unsigned-int))
1745 (def-callback-marshal %menu-position-func (nil (menu menu) (x int) (y int) (push-in boolean)))
1747 (defbinding %menu-popup () nil
1749 (parent-menu-shell (or null menu-shell))
1750 (parent-menu-item (or null menu-item))
1751 (callback-func (or null pointer))
1752 (callback-id unsigned-int)
1753 (button unsigned-int)
1754 (activate-time (unsigned 32)))
1756 (defun menu-popup (menu button activate-time &key callback parent-menu-shell
1759 (with-callback-function (id callback)
1761 menu parent-menu-shell parent-menu-item
1762 (callback %menu-position-func) id button activate-time))
1764 menu parent-menu-shell parent-menu-item nil 0 button activate-time)))
1766 (defbinding menu-set-accel-path () nil
1768 (accel-path string))
1770 (defbinding menu-reposition () nil
1773 (defbinding menu-popdown () nil
1776 (defun menu-child-position (menu child)
1777 (position child (container-children menu)))
1779 (defun menu-active-num (menu)
1780 (menu-child-position menu (menu-active menu)))
1782 (defbinding %menu-set-active () nil
1784 (index unsigned-int))
1786 (defun (setf menu-active) (menu child)
1787 (%menu-set-active menu (%menu-position menu child))
1790 (defcallback %menu-detach-func (nil (widget widget) (menu menu))
1791 (funcall (object-data menu 'detach-func) widget menu))
1793 (defbinding %menu-attach-to-widget () nil
1796 ((callback %menu-detach-func) pointer))
1798 (defun menu-attach-to-widget (menu widget function)
1799 (setf (object-data menu 'detach-func) function)
1800 (%menu-attach-to-widget menu widget))
1802 (defbinding menu-detach () nil
1806 (defbinding menu-get-for-attach-widget () (copy-of (glist widget))
1809 (defbinding menu-set-monitor () nil
1816 (defbinding table-resize () nil
1819 (columns unsigned-int))
1821 (defbinding table-attach (table child left right top bottom
1822 &key options x-options y-options
1823 (x-padding 0) (y-padding 0)) nil
1827 (right unsigned-int)
1829 (bottom unsigned-int)
1830 ((append (mklist options) (mklist x-options)) attach-options)
1831 ((append (mklist options) (mklist y-options)) attach-options)
1832 (x-padding unsigned-int)
1833 (y-padding unsigned-int))
1836 (defbinding %table-set-row-spacing () nil
1839 (spacing unsigned-int))
1841 (defbinding %table-set-row-spacings () nil
1843 (spacing unsigned-int))
1845 (defun (setf table-row-spacing) (spacing table &optional row)
1847 (%table-set-row-spacing table row spacing)
1848 (%table-set-row-spacings table spacing))
1851 (defbinding %table-get-row-spacing () unsigned-int
1855 (defbinding %table-get-default-row-spacing () unsigned-int
1858 (defun table-row-spacing (table &optional row)
1860 (%table-get-row-spacing table row)
1861 (%table-get-default-row-spacing table)))
1864 (defbinding %table-set-col-spacing () nil
1867 (spacing unsigned-int))
1869 (defbinding %table-set-col-spacings () nil
1871 (spacing unsigned-int))
1873 (defun (setf table-col-spacing) (spacing table &optional col)
1875 (%table-set-col-spacing table col spacing)
1876 (%table-set-col-spacings table spacing))
1879 (defbinding %table-get-col-spacing () unsigned-int
1883 (defbinding %table-get-default-col-spacing () unsigned-int
1886 (defun table-col-spacing (table &optional col)
1888 (%table-get-col-spacing table col)
1889 (%table-get-default-col-spacing table)))
1895 (defmethod initialize-instance ((toolbar toolbar) &rest initargs &key tooltips)
1897 (apply #'call-next-method toolbar
1898 :tooltips (make-instance 'tooltips) initargs)
1899 (call-next-method)))
1901 (defbinding %toolbar-insert () nil
1903 (tool-item tool-item)
1904 (position position))
1906 (defun toolbar-insert (toolbar tool-item &optional (position :end))
1907 (%toolbar-insert toolbar tool-item position)
1908 (%tool-item-update-tooltips tool-item))
1910 (defbinding toolbar-get-item-index () int
1914 (defbinding toolbar-get-nth-item () tool-item
1918 (defbinding toolbar-get-drop-index () int
1922 (defbinding toolbar-set-drop-highlight-item () nil
1924 (tool-item tool-item)
1930 (defmethod initialize-instance ((button tool-button) &rest initargs &key icon)
1931 (if (and icon (not (typep icon 'widget)))
1932 (apply #'call-next-method button :icon (create-image-widget icon) initargs)
1933 (call-next-method)))
1938 (defbinding tool-item-set-tooltip () nil
1939 (tool-item tool-item)
1942 (tip-private string))
1945 (defun %tool-item-update-tooltips (tool-item)
1947 (slot-boundp tool-item 'parent)
1949 (user-data-p tool-item 'tip-text)
1950 (user-data-p tool-item 'tip-private)))
1951 (tool-item-set-tooltip
1952 tool-item (toolbar-tooltips (widget-parent tool-item))
1953 (or (user-data tool-item 'tip-text) "")
1954 (or (user-data tool-item 'tip-private) ""))))
1956 (defmethod (setf tool-item-tip-text) ((tip-text string) (tool-item tool-item))
1957 (setf (user-data tool-item 'tip-text) tip-text)
1958 (%tool-item-update-tooltips tool-item)
1961 (defmethod (setf tool-item-tip-private) ((tip-private string) (tool-item tool-item))
1962 (setf (user-data tool-item 'tip-private) tip-private)
1963 (%tool-item-update-tooltips tool-item)
1966 (defmethod container-add ((toolbar toolbar) (tool-item tool-item) &rest args)
1967 (declare (ignore args))
1970 (%tool-item-update-tooltips tool-item)))
1973 (defbinding tool-item-retrieve-proxy-menu-item () widget
1974 (tool-item tool-item))
1976 (defbinding (tool-item-proxy-menu-item
1977 "gtk_tool_item_get_proxy_menu_item") () menu-item
1978 (tool-item tool-item)
1979 (menu-item-id string))
1981 (defbinding %tool-item-set-proxy-menu-item () nil
1982 (tool-item tool-item)
1983 (menu-item-id string)
1984 (menu-item menu-item))
1986 (defun (setf tool-item-proxy-menu-item) (menu-item menu-item-id tool-item)
1987 (%tool-item-set-proxy-menu-item menu-item-id tool-item menu-item)
1991 (defbinding tool-item-rebuild-menu () nil
1992 (tool-item tool-item))
1997 (defbinding editable-select-region (editable &optional (start 0) end) nil
2002 (defbinding editable-get-selection-bounds (editable) nil
2007 (defbinding editable-insert-text (editable text &optional (position 0)) nil
2011 (position position :in-out))
2013 (defun editable-append-text (editable text)
2014 (editable-insert-text editable text nil))
2016 (defun editable-prepend-text (editable text)
2017 (editable-insert-text editable text 0))
2019 (defbinding editable-delete-text (editable &optional (start 0) end) nil
2024 (defbinding (editable-text "gtk_editable_get_chars")
2025 (editable &optional (start 0) end) string
2030 (defun (setf editable-text) (text editable)
2032 (editable-delete-text
2034 (editable-insert-text editable text))
2035 (editable-delete-text editable))
2038 (defbinding editable-cut-clipboard () nil
2039 (editable editable))
2041 (defbinding editable-copy-clipboard () nil
2042 (editable editable))
2044 (defbinding editable-paste-clipboard () nil
2045 (editable editable))
2047 (defbinding editable-delete-selection () nil
2048 (editable editable))
2054 (defbinding spin-button-configure () nil
2055 (spin-button spin-button)
2056 (adjustment adjustment)
2057 (climb-rate double-float)
2058 (digits unsigned-int))
2060 (defbinding spin-button-set-range () nil
2061 (spin-button spin-button)
2065 (defbinding spin-button-get-range () nil
2066 (spin-button spin-button)
2067 (min double-float :out)
2068 (max double-float :out))
2070 (defun spin-button-value-as-int (spin-button)
2071 (round (spin-button-value spin-button)))
2073 (defbinding %spin-button-spin () nil
2074 (spin-button spin-button)
2075 (direction spin-type)
2076 (increment double-float))
2078 (defun spin-button-spin (spin-button value)
2080 (real (%spin-button-spin spin-button :spin-user-defined value))
2081 (spin-type (%spin-button-spin spin-button value 0))))
2084 (defbinding spin-button-update () nil
2085 (spin-button spin-button))
2091 (defbinding ruler-set-range () nil
2093 (lower single-float)
2094 (upper single-float)
2095 (position single-float)
2096 (max-size single-float))
2098 (defbinding ruler-get-range () nil
2100 (lower single-float :out)
2101 (upper single-float :out)
2102 (position single-float :out)
2103 (max-size single-float :out))
2109 (defun range-lower (range)
2110 (adjustment-lower (range-adjustment range)))
2112 (defun range-upper (range)
2113 (adjustment-upper (range-adjustment range)))
2115 (defun (setf range-lower) (value range)
2116 (setf (adjustment-lower (range-adjustment range)) value))
2118 (defun (setf range-upper) (value range)
2119 (setf (adjustment-upper (range-adjustment range)) value))
2121 (defun range-page-increment (range)
2122 (adjustment-page-increment (range-adjustment range)))
2124 (defun range-step-increment (range)
2125 (adjustment-step-increment (range-adjustment range)))
2127 (defun (setf range-page-increment) (value range)
2128 (setf (adjustment-page-increment (range-adjustment range)) value))
2130 (defun (setf range-step-increment) (value range)
2131 (setf (adjustment-step-increment (range-adjustment range)) value))
2133 (defbinding range-set-range () nil
2135 (lower double-float)
2136 (upper double-float))
2138 (defbinding range-set-increments () nil
2141 (page double-float))
2146 (defbinding scale-get-layout-offsets () nil
2154 (defbinding progress-bar-pulse () nil
2155 (progress-bar progress-bar))
2160 (defmethod initialize-instance ((size-group size-group) &rest initargs
2161 &key widget widgets)
2162 (declare (ignore widget widgets))
2165 (initial-add size-group #'size-group-add-widget
2166 initargs :widget :widgets)))
2169 (defbinding size-group-add-widget () nil
2170 (size-group size-group)
2173 (defbinding size-group-remove-widget () nil
2174 (size-group size-group)
2180 (defbinding %stock-item-copy () pointer
2183 (defbinding %stock-item-free () nil
2186 (defmethod reference-foreign ((class (eql (find-class 'stock-item))) location)
2187 (%stock-item-copy location))
2189 (defmethod unreference-foreign ((class (eql (find-class 'stock-item))) location)
2190 (%stock-item-free location))
2192 (defbinding stock-add (stock-item) nil
2193 (stock-item stock-item)
2196 (defbinding stock-list-ids () (gslist string))
2198 (defbinding %stock-lookup () boolean
2202 (defun stock-lookup (stock-id)
2204 (allocate-memory (proxy-instance-size (find-class 'stock-item)))))
2206 (when (%stock-lookup stock-id location)
2207 (ensure-proxy-instance 'stock-item (%stock-item-copy location)))
2208 (deallocate-memory location))))
2213 (defbinding tooltips-enable () nil
2214 (tooltips tooltips))
2216 (defbinding tooltips-disable () nil
2217 (tooltips tooltips))
2219 (defun (setf tooltips-enabled-p) (enable tooltips)
2221 (tooltips-enable tooltips)
2222 (tooltips-disable tooltips)))
2224 (defbinding tooltips-set-tip () nil
2228 (tip-private string))
2230 (defbinding tooltips-data-get () tooltips-data
2233 (defbinding tooltips-force-window () nil
2234 (tooltips tooltips))
2236 (defbinding tooltips-get-info-from-tip-window () boolean
2238 (tooltips tooltips :out)
2239 (current-widget widget :out))
2244 (defbinding rc-add-default-file (filename) nil
2245 ((namestring (truename filename)) string))
2247 (defbinding rc-parse (filename) nil
2248 ((namestring (truename filename)) string))
2250 (defbinding rc-parse-string () nil
2253 (defbinding rc-reparse-all () nil)
2255 (defbinding rc-get-style () style