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.43 2005-04-24 13:30:40 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))))
47 (defbinding get-default-language () (copy-of pango:language))
52 (defbinding (gtk-init "gtk_parse_args") () boolean
53 "Initializes the library without opening the display."
57 (defun clg-init (&optional display)
58 "Initializes the system and starts the event handling"
59 (unless (gdk:display-get-default)
62 (error "Initialization of GTK+ failed."))
64 (gdk:display-open display)
65 (add-fd-handler (gdk:display-connection-number) :input #'main-iterate-all)
66 (setq *periodic-polling-function* #'main-iterate-all)
67 (setq *max-event-to-sec* 0)
68 (setq *max-event-to-usec* 1000))))
73 (defbinding grab-add () nil
76 (defbinding grab-get-current () widget)
78 (defbinding grab-remove () nil
86 (def-callback-marshal %about-dialog-activate-link-func
87 (nil (dialog about-dialog) (link (copy-of string))))
89 (defbinding about-dialog-set-email-hook (function) nil
90 ((callback %about-dialog-activate-link-func) pointer)
91 ((register-callback-function function) unsigned-int)
92 ((callback user-data-destroy-func) pointer))
94 (defbinding about-dialog-set-url-hook (function) nil
95 ((callback %about-dialog-activate-link-func) pointer)
96 ((register-callback-function function) unsigned-int)
97 ((callback user-data-destroy-func) pointer)))
102 (defbinding %accel-group-connect () nil
103 (accel-group accel-group)
105 (modifiers gdk:modifier-type)
109 (defun accel-group-connect (group accelerator function &optional flags)
110 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
111 (let ((gclosure (make-callback-closure function)))
112 (%accel-group-connect group key modifiers flags gclosure)
115 (defbinding accel-group-connect-by-path (group path function) nil
118 ((make-callback-closure function) gclosure :return))
120 (defbinding %accel-group-disconnect (group gclosure) boolean
124 (defbinding %accel-group-disconnect-key () boolean
127 (modifiers gdk:modifier-type))
129 (defun accel-group-disconnect (group accelerator)
130 (etypecase accelerator
131 (gclosure (%accel-group-disconnect group accelerator))
133 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
134 (%accel-group-disconnect-key group key modifiers)))))
136 (defbinding %accel-group-query () (copy-of (vector (inlined accel-group-entry) n))
137 (accel-group accel-group)
139 (modifiers gdk:modifier-type)
142 (defun accel-group-query (accel-group accelerator)
143 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
144 (%accel-group-query accel-group key modifiers)))
146 (defbinding %accel-group-activate () boolean
147 (accel-group accel-group)
148 (acceleratable gobject)
150 (modifiers gdk:modifier-type))
152 (defun accel-group-activate (accel-group acceleratable accelerator)
153 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
154 (%accel-group-activate accel-group acceleratable key modifiers)))
156 (defbinding accel-group-lock () nil
157 (accel-group accel-group))
159 (defbinding accel-group-unlock () nil
160 (accel-group accel-group))
162 (defbinding accel-group-from-accel-closure () accel-group
165 (defbinding %accel-groups-activate () boolean
168 (modifiers gdk:modifier-type))
170 (defun accel-groups-activate (object accelerator)
171 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
172 (%accel-groups-activate object key modifiers)))
174 (defbinding accel-groups-from-object () (gslist accel-groups)
177 (defbinding accelerator-valid-p (key &optional modifiers) boolean
179 (modifiers gdk:modifier-type))
181 (defbinding %accelerator-parse () nil
183 (key unsigned-int :out)
184 (modifiers gdk:modifier-type :out))
186 (defgeneric parse-accelerator (accelerator))
188 (defmethod parse-accelerator ((accelerator string))
189 (multiple-value-bind (key modifiers) (%accelerator-parse accelerator)
191 (error "Invalid accelerator: ~A" accelerator)
192 (values key modifiers))))
194 (defmethod parse-accelerator ((accelerator cons))
195 (destructuring-bind (key modifiers) accelerator
201 (gdk:keyval-from-name key)
202 (error "Invalid key name: ~A" key)))
203 (character (parse-accelerator key)))
206 (defmethod parse-accelerator ((key integer))
209 (defmethod parse-accelerator ((key character))
211 (gdk:keyval-from-name (string key))
212 (error "Invalid key name: ~A" key)))
215 (defbinding accelerator-name () string
217 (modifiers gdk:modifier-type))
220 (defbinding accelerator-get-label () string
222 (modifiers gdk:modifier-type))
224 (defbinding %accelerator-set-default-mod-mask () nil
225 (default-modifiers gdk:modifier-type))
227 (defun (setf accelerator-default-modifier-mask) (default-modifiers)
228 (%accelerator-set-default-mod-mask default-modifiers))
230 (defbinding (accelerator-default-modifier-mask "gtk_accelerator_get_default_mod_mask") () gdk:modifier-type)
235 (defbinding accel-label-get-accel-width () unsigned-int
236 (accel-label accel-label))
238 (defbinding accel-label-refetch () boolean
239 (accel-label accel-label))
245 (defbinding (accel-map-init "_gtk_accel_map_init") () nil)
247 (defbinding %accel-map-add-entry () nil
250 (modifiers gdk:modifier-type))
252 (defun accel-map-add-entry (path accelerator)
253 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
254 (%accel-map-add-entry path key modifiers)))
256 (defbinding %accel-map-lookup-entry () boolean
258 ((make-instance 'accel-key) accel-key :return))
260 (defun accel-map-lookup-entry (path)
261 (multiple-value-bind (found-p accel-key) (%accel-map-lookup-entry path)
264 (slot-value accel-key 'key)
265 (slot-value accel-key 'modifiers)
266 (slot-value accel-key 'flags)))))
268 (defbinding %accel-map-change-entry () boolean
271 (modifiers gdk:modifier-type)
274 (defun accel-map-change-entry (path accelerator &optional replace)
275 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
276 (%accel-map-change-entry path key modifiers replace)))
278 (defbinding accel-map-load () nil
281 (defbinding accel-map-save () nil
284 (defcallback %accel-map-foreach-func
286 (callback-id unsigned-int) (accel-path (copy-of string))
287 (key unsigned-int) (modifiers gdk:modifier-type) (changed boolean))
288 (invoke-callback callback-id nil accel-path key modifiers changed))
290 (defbinding %accel-map-foreach (callback-id) nil
291 (callback-id unsigned-int)
292 (%accel-map-foreach-func callback))
294 (defbinding %accel-map-foreach-unfiltered (callback-id) nil
295 (callback-id unsigned-int)
296 (%accel-map-foreach-func callback))
298 (defun accel-map-foreach (function &optional (filter-p t))
299 (with-callback-function (id function)
301 (%accel-map-foreach id)
302 (%accel-map-foreach-unfiltered id))))
304 (defbinding accel-map-add-filter () nil
307 (defbinding accel-map-get () accel-map)
309 (defbinding accel-map-lock-path () nil
312 (defbinding accel-map-unlock-path () nil
319 (defbinding accessible-connect-widget-destroyed () nil
320 (accessible accessible))
325 (defmethod initialize-instance ((adjustment adjustment) &key value)
328 ;; we need to make sure that the value is set last, otherwise it
329 ;; may be outside current limits and ignored
331 (setf (slot-value adjustment 'value) value))))
334 (defbinding adjustment-changed () nil
335 (adjustment adjustment))
337 (defbinding adjustment-value-changed () nil
338 (adjustment adjustment))
340 (defbinding adjustment-clamp-page () nil
341 (adjustment adjustment)
343 (upper single-float))
348 (defbinding alignment-set () nil
349 (alognment alignment)
350 (x-align single-float)
351 (y-align single-float)
352 (x-scale single-float)
353 (y-scale single-float))
355 (defbinding alignment-get-padding () nil
356 (alognment alignment)
357 (top unsigned-int :out)
358 (bottom unsigned-int :out)
359 (left unsigned-int :out)
360 (right unsigned-int :out))
362 (defbinding alignment-set-padding () nil
363 (alognment alignment)
365 (bottom unsigned-int)
367 (right unsigned-int))
375 (defun (setf bin-child) (child bin)
376 (when-bind (current-child (bin-child bin))
377 (container-remove bin current-child))
378 (container-add bin child)
381 (defmethod compute-signal-function ((bin bin) signal function object)
382 (declare (ignore signal))
383 (if (eq object :child)
384 #'(lambda (&rest args)
385 (apply function (bin-child bin) (rest args)))
391 (defbinding box-pack-start () nil
396 (padding unsigned-int))
398 (defbinding box-pack-end () nil
403 (padding unsigned-int))
405 (defun box-pack (box child &key end (expand t) (fill t) (padding 0))
407 (box-pack-end box child expand fill padding)
408 (box-pack-start box child expand fill padding)))
410 (defbinding box-reorder-child () nil
415 (defbinding box-query-child-packing () nil
418 (expand boolean :out)
420 (padding unsigned-int :out)
421 (pack-type pack-type :out))
423 (defbinding box-set-child-packing () nil
428 (padding unsigned-int)
429 (pack-type pack-type))
435 (defmethod initialize-instance ((button button) &rest initargs &key stock)
437 (apply #'call-next-method button :label stock :use-stock t initargs)
441 (defbinding button-pressed () nil
444 (defbinding button-released () nil
447 (defbinding button-clicked () nil
450 (defbinding button-enter () nil
453 (defbinding button-leave () nil
460 (defbinding calendar-select-month () int
465 (defbinding calendar-select-day () nil
469 (defbinding calendar-mark-day () int
473 (defbinding calendar-unmark-day () int
477 (defbinding calendar-clear-marks () nil
480 (defbinding calendar-get-date () nil
482 (year unsigned-int :out)
483 (month unsigned-int :out)
484 (day unsigned-int :out))
486 (defbinding calendar-freeze () nil
489 (defbinding calendar-thaw () nil
495 (defbinding check-menu-item-toggled () nil
496 (check-menu-item check-menu-item))
501 (defbinding (color-selection-is-adjusting-p
502 "gtk_color_selection_is_adjusting") () boolean
503 (colorsel color-selection))
507 ;;; Color selection dialog -- no functions
513 (defmethod initialize-instance ((combo-box combo-box) &rest initargs
514 &key model content active)
515 (remf initargs :active)
517 (apply #'call-next-method combo-box initargs)
519 (apply #'call-next-method combo-box
520 :model (make-instance 'list-store :column-types '(string))
522 (unless (typep combo-box 'combo-box-entry)
523 (let ((cell (make-instance 'cell-renderer-text)))
524 (cell-layout-pack combo-box cell :expand t)
525 (cell-layout-add-attribute combo-box cell :text 0)))))
527 (mapc #'(lambda (text)
528 (combo-box-append-text combo-box text))
531 (setf (combo-box-active combo-box) active)))
534 ;; (defmethod shared-initialize :after ((combo-box combo-box) names &key active)
536 ;; (signal-emit combo-box 'changed)))
538 (defbinding combo-box-append-text () nil
539 (combo-box combo-box)
542 (defbinding combo-box-insert-text () nil
543 (combo-box combo-box)
547 (defbinding combo-box-prepend-text () nil
548 (combo-box combo-box)
552 (defbinding combo-box-get-active-text () string
553 (combo-box combo-box))
555 (defbinding combo-box-popup () nil
556 (combo-box combo-box))
558 (defbinding combo-box-popdown () nil
559 (combo-box combo-box))
565 (defmethod initialize-instance ((combo-box-entry combo-box-entry) &key model)
568 (setf (combo-box-entry-text-column combo-box-entry) 0)))
573 (defmethod shared-initialize ((dialog dialog) names &rest initargs
575 (declare (ignore button buttons))
578 (initial-apply-add dialog #'dialog-add-button initargs :button :buttons)))
581 (defun dialog-response-id (dialog response &optional create-p error-p)
582 "Returns a numeric response id"
583 (if (typep response 'response-type)
584 (response-type-to-int response)
585 (let ((responses (object-data dialog 'responses)))
587 ((and responses (position response responses :test #'equal)))
591 (vector-push-extend response responses)
592 (1- (length responses)))
595 (object-data dialog 'responses)
596 (make-array 1 :adjustable t :fill-pointer t
597 :initial-element response))
600 (error "Invalid response: ~A" response))))))
602 (defun dialog-find-response (dialog id)
603 "Finds a symbolic response given a numeric id"
605 (int-to-response-type id)
606 (aref (object-data dialog 'responses) id)))
609 (defmethod compute-signal-id ((dialog dialog) signal)
610 (if (dialog-response-id dialog signal)
611 (ensure-signal-id 'response dialog)
614 (defmethod compute-signal-function ((dialog dialog) signal function object)
615 (declare (ignore function object))
616 (let ((callback (call-next-method))
617 (id (dialog-response-id dialog signal)))
619 #'(lambda (dialog response)
620 (when (= response id)
621 (funcall callback dialog)))
624 (defbinding dialog-run () nil
627 (defbinding dialog-response (dialog response) nil
629 ((dialog-response-id dialog response nil t) int))
632 (defbinding %dialog-add-button () button
637 (defun dialog-add-button (dialog label &optional (response label)
638 &key default object after)
639 "Adds a button to the dialog."
640 (let* ((signal (if (functionp response)
643 (id (dialog-response-id dialog signal t))
644 (button (%dialog-add-button dialog label id)))
645 (when (functionp response)
646 (signal-connect dialog signal response :object object :after after))
648 (%dialog-set-default-response dialog id))
652 (defbinding %dialog-add-action-widget () nil
654 (action-widget widget)
657 (defun dialog-add-action-widget (dialog widget &optional (response widget)
658 &key default object after)
659 (let* ((signal (if (functionp response)
662 (id (dialog-response-id dialog signal t)))
663 (unless (widget-hidden-p widget)
664 (widget-show widget))
665 (%dialog-add-action-widget dialog widget id)
666 (when (functionp response)
667 (signal-connect dialog signal response :object object :after after))
669 (%dialog-set-default-response dialog id))
673 (defbinding %dialog-set-default-response () nil
677 (defun dialog-set-default-response (dialog response)
678 (%dialog-set-default-response
679 dialog (dialog-response-id dialog response nil t)))
681 (defbinding dialog-set-response-sensitive (dialog response sensitive) nil
683 ((dialog-response-id dialog response nil t) int)
687 (defbinding alternative-dialog-button-order-p (&optional screen) boolean
688 (screen (or null gdk:screen)))
691 (defbinding (dialog-set-alternative-button-order
692 "gtk_dialog_set_alternative_button_order_from_array")
695 ((length new-order) int)
696 ((map 'vector #'(lambda (response)
697 (dialog-response-id dialog response nil t))
698 new-order) (vector int)))
701 (defmethod container-add ((dialog dialog) (child widget) &rest args)
702 (apply #'container-add (dialog-vbox dialog) child args))
705 (defmethod container-remove ((dialog dialog) (child widget))
706 (container-remove (dialog-vbox dialog) child))
708 (defmethod container-children ((dialog dialog))
709 (container-children (dialog-vbox dialog)))
711 (defmethod (setf container-children) (children (dialog dialog))
712 (setf (container-children (dialog-vbox dialog)) children))
717 (defbinding entry-get-layout-offsets () nil
722 (defbinding entry-layout-index-to-text-index () int
726 (defbinding entry-text-index-to-layout-index () int
733 (def-callback-marshal %entry-completion-match-func
734 (boolean entry-completion string (copy-of tree-iter)))
736 (defbinding entry-completion-set-match-func (completion function) nil
737 (completion entry-completion)
738 ((callback %entry-completion-match-func) pointer)
739 ((register-callback-function function) unsigned-int)
740 ((callback user-data-destroy-func) pointer))
742 (defbinding entry-completion-complete () nil
743 (completion entry-completion))
746 (defbinding entry-completion-insert-prefix () nil
747 (completion entry-completion))
749 (defbinding entry-completion-insert-action-text () nil
750 (completion entry-completion)
754 (defbinding entry-completion-insert-action-markup () nil
755 (completion entry-completion)
759 (defbinding entry-completion-delete-action () nil
760 (completion entry-completion)
766 (defmethod initialize-instance ((file-chooser file-chooser) &rest initargs
767 &key filter filters shortcut-folder
768 shortcut-folders shortcut-folder-uti
769 shortcut-folder-uris)
770 (declare (ignore filter filters shortcut-folder shortcut-folders
771 shortcut-folder-uti shortcut-folder-uris))
774 (initial-add file-chooser #'file-chooser-add-filter
775 initargs :filer :filters)
776 (initial-add file-chooser #'file-chooser-add-shortcut-folder
777 initargs :shortcut-folder :shortcut-folders)
778 (initial-add file-chooser #'file-chooser-add-shortcut-folder-uri
779 initargs :shortcut-folder-uri :shortcut-folders-uris)))
782 (defbinding file-chooser-select-filename () boolean
783 (file-chooser file-chooser)
786 (defbinding file-chooser-unselect-filename () nil
787 (file-chooser file-chooser)
790 (defbinding file-chooser-select-all () boolean
791 (file-chooser file-chooser))
793 (defbinding file-chooser-unselect-all () boolean
794 (file-chooser file-chooser))
796 (defbinding file-chooser-get-filenames () (gslist string)
797 (file-chooser file-chooser))
799 (defbinding file-chooser-select-uri () boolean
800 (file-chooser file-chooser)
803 (defbinding file-chooser-unselect-uri () nil
804 (file-chooser file-chooser)
807 (defbinding file-chooser-get-uris () (gslist string)
808 (file-chooser file-chooser))
810 (defbinding file-chooser-add-filter () nil
811 (file-chooser file-chooser)
812 (filter file-filter))
814 (defbinding file-chooser-remove-filter () nil
815 (file-chooser file-chooser)
816 (filter file-filter))
818 (defbinding file-chooser-list-filters () (gslist file-filter)
819 (file-chooser file-chooser))
821 (defbinding file-chooser-add-shortcut-folder () boolean
822 (file-chooser file-chooser)
826 (defbinding file-chooser-remove-shortcut-folder () nil
827 (file-chooser file-chooser)
831 (defbinding file-chooser-list-shortcut-folders () (gslist string)
832 (file-chooser file-chooser))
834 (defbinding file-chooser-add-shortcut-folder-uri () boolean
835 (file-chooser file-chooser)
839 (defbinding file-chooser-remove-shortcut-folder-uri () nil
840 (file-chooser file-chooser)
844 (defbinding file-chooser-list-shortcut-folder-uris () (gslist string)
845 (file-chooser file-chooser))
850 (defmethod initialize-instance ((file-filter file-filter) &rest initargs
851 &key mime-type mime-types pattern patterns
853 (declare (ignore mime-type mime-types pattern patterns))
857 #-gtk2.6(warn "Initarg :PIXBUF-FORMATS not supportet in this version of Gtk")
858 #+gtk2.6(file-filter-add-pixbuf-formats file-filter))
859 (initial-add file-filter #'file-filter-add-mime-type
860 initargs :mime-type :mime-types)
861 (initial-add file-filter #'file-filter-add-pattern
862 initargs :pattern :patterns)))
865 (defbinding file-filter-add-mime-type () nil
869 (defbinding file-filter-add-pattern () nil
874 (defbinding file-filter-add-pixbuf-formats () nil
875 (filter file-filter))
877 (def-callback-marshal %file-filter-func (boolean file-filter-info))
879 (defbinding file-filter-add-custom (filter needed function) nil
881 (needed file-filter-flags)
882 ((callback %file-filter-func) pointer)
883 ((register-callback-function function) unsigned-int)
884 ((callback user-data-destroy-func) pointer))
886 (defbinding file-filter-get-needed () file-filter-flags
887 (filter file-filter))
889 (defbinding file-filter-filter () boolean
891 (filter-info file-filter-info))
897 (defbinding image-set-from-file () nil
901 (defmethod (setf image-pixmap) ((data vector) (image image))
902 (multiple-value-bind (pixmap mask) (gdk:pixmap-create data)
903 (setf (image-pixmap image) pixmap)
904 (setf (image-mask image) mask)))
906 (defmethod initialize-instance ((image image) &rest initargs &key pixmap file)
908 ((typep pixmap 'vector)
909 (multiple-value-bind (pixmap mask) (gdk:pixmap-create pixmap)
910 (apply #'call-next-method image :pixmap pixmap :mask mask initargs)))
914 (image-set-from-file image file)))
915 ((call-next-method))))
917 (defun create-image-widget (source &optional mask)
919 (gdk:pixbuf (make-instance 'image :pixbuf source))
920 (string (make-instance 'image :stock source))
921 (pathname (make-instance 'image :file source))
922 ((or list vector) (make-instance 'image :pixmap source))
923 (gdk:pixmap (make-instance 'image :pixmap source :mask mask))))
928 (defmethod initialize-instance ((item image-menu-item) &rest initargs &key image)
929 (if (and image (not (typep image 'widget)))
930 (apply #'call-next-method item :image (create-image-widget image) initargs)
934 (defmethod (setf image-menu-item-image) ((widget widget) (item image-menu-item))
935 (setf (slot-value item 'image) widget))
937 (defmethod (setf image-menu-item-image) (image (item image-menu-item))
938 (setf (image-menu-item-image item) (create-image-widget image)))
943 (defmethod shared-initialize ((label label) names &key pattern)
944 (declare (ignore names))
947 (setf (label-pattern label) pattern)))
949 (defbinding label-get-layout-offsets () nil
954 (defbinding label-select-region () nil
959 (defbinding label-get-selection-bounds () boolean
968 (defbinding %radio-button-get-group () pointer
969 (radio-button radio-button))
971 (defbinding %radio-button-set-group () nil
972 (radio-button radio-button)
975 (defmethod add-to-radio-group ((button1 radio-button) (button2 radio-button))
976 "Add BUTTON1 to the group which BUTTON2 belongs to."
977 (%radio-button-set-group button1 (%radio-button-get-group button2)))
979 (defun %add-activate-callback (widget signal function object after)
981 (signal-connect widget signal
983 (when (slot-value widget 'active)
984 (funcall function object (slot-value widget 'value))))
985 :object object :after after)
986 (signal-connect widget signal
988 (when (slot-value widget 'active)
989 (funcall function (slot-value widget 'value))))
992 (defmethod activate-radio-widget ((button radio-button))
993 (signal-emit button 'clicked))
995 (defmethod add-activate-callback ((button radio-button) function &key object after)
996 (%add-activate-callback button 'clicked function object after))
998 (defmethod initialize-instance ((button radio-button) &key group)
1002 (add-to-radio-group button group))))
1007 (defbinding item-select () nil
1010 (defbinding item-deselect () nil
1013 (defbinding item-toggle () nil
1020 (defmethod initialize-instance ((item menu-item) &key label)
1024 (setf (menu-item-label item) label))))
1027 (defun (setf menu-item-label) (label menu-item)
1028 (make-instance 'accel-label
1029 :label label :xalign 0.0 :yalign 0.5 :accel-widget menu-item
1030 :use-underline (menu-item-use-underline-p menu-item)
1031 :visible t :parent menu-item)
1034 (defun menu-item-label (menu-item)
1035 (when (and (slot-boundp menu-item 'child)
1036 (typep (bin-child menu-item) 'label))
1037 (label-label (bin-child menu-item))))
1039 (defbinding menu-item-remove-submenu () nil
1040 (menu-item menu-item))
1042 (defbinding menu-item-set-accel-path () nil
1043 (menu-item menu-item)
1044 (accel-path string))
1046 (defbinding menu-item-select () nil
1047 (menu-item menu-item))
1049 (defbinding menu-item-deselect () nil
1050 (menu-item menu-item))
1052 (defbinding menu-item-activate () nil
1053 (menu-item menu-item))
1055 (defbinding menu-item-toggle-size-request () nil
1056 (menu-item menu-item)
1057 (requisition int :out))
1059 (defbinding menu-item-toggle-size-allocate () nil
1060 (menu-item menu-item)
1064 ;;; Menu tool button
1067 (defbinding menu-tool-button-set-arrow-tooltip () nil
1068 (menu-tool-button menu-tool-button)
1071 (tip-private string))
1076 (defmethod initialize-instance ((dialog message-dialog)
1077 &key (message-type :info) (buttons :close)
1078 flags text #+gtk 2.6 secondary-text
1081 (slot-value dialog 'location)
1082 (%message-dialog-new transient-parent flags message-type buttons))
1084 (message-dialog-set-markup dialog text))
1086 (when secondary-text
1087 (message-dialog-format-secondary-markup dialog secondary-text))
1091 (defbinding %message-dialog-new () pointer
1092 (parent (or null window))
1093 (flags dialog-flags)
1095 (buttons buttons-type)
1098 (defbinding message-dialog-set-markup () nil
1099 (message-dialog message-dialog)
1103 (defbinding message-dialog-format-secondary-text () nil
1104 (message-dialog message-dialog)
1108 (defbinding message-dialog-format-secondary-markup () nil
1109 (message-dialog message-dialog)
1116 (defbinding %radio-menu-item-get-group () pointer
1117 (radio-menu-item radio-menu-item))
1119 (defbinding %radio-menu-item-set-group () nil
1120 (radio-menu-item radio-menu-item)
1123 (defmethod activate-radio-widget ((item radio-menu-item))
1124 (menu-item-activate item))
1126 (defmethod add-to-radio-group ((item1 radio-menu-item) (item2 radio-menu-item))
1127 "Add ITEM1 to the group which ITEM2 belongs to."
1128 (%radio-menu-item-set-group item1 (%radio-menu-item-get-group item2)))
1130 (defmethod add-activate-callback ((item radio-menu-item) function &key object after)
1131 (%add-activate-callback item 'activate function object after))
1133 (defmethod initialize-instance ((item radio-menu-item) &key group)
1137 (add-to-radio-group item group))))
1141 ;;; Radio tool button
1143 (defbinding %radio-tool-button-get-group () pointer
1144 (radio-tool-button radio-tool-button))
1146 (defbinding %radio-tool-button-set-group () nil
1147 (radio-tool-button radio-tool-button)
1150 (defmethod activate-radio-widget ((button radio-tool-button))
1151 (signal-emit button 'clicked))
1153 (defmethod add-to-radio-group ((button1 radio-tool-button) (button2 radio-tool-button))
1154 "Add BUTTON1 to the group which BUTTON2 belongs to."
1155 (%radio-tool-button-set-group button1 (%radio-tool-button-get-group button2)))
1156 (defmethod add-activate-callback ((button radio-tool-button) function &key object after)
1157 (%add-activate-callback button 'clicked function object after))
1159 (defmethod initialize-instance ((button radio-tool-button) &key group)
1163 (add-to-radio-group button group))))
1169 (defbinding toggle-button-toggled () nil
1170 (toggle-button toggle-button))
1175 (defmethod initialize-instance ((window window) &rest initargs
1176 &key accel-group accel-groups)
1177 (declare (ignore accel-group accel-groups))
1180 (initial-add window #'window-add-accel-group
1181 initargs :accel-group :accel-groups)))
1184 (defbinding window-set-wmclass () nil
1186 (wmclass-name string)
1187 (wmclass-class string))
1189 (defbinding window-add-accel-group () nil
1191 (accel-group accel-group))
1193 (defbinding window-remove-accel-group () nil
1195 (accel-group accel-group))
1197 (defbinding window-activate-focus () int
1200 (defbinding window-activate-default () int
1203 (defbinding window-set-default-size (window width height) int
1206 ((or height -1) int))
1208 (defbinding %window-set-geometry-hints () nil
1210 (geometry gdk:geometry)
1211 (geometry-mask gdk:window-hints))
1213 (defun window-set-geometry-hints (window &key min-width min-height
1214 max-width max-height base-width base-height
1215 width-inc height-inc min-aspect max-aspect
1216 (gravity nil gravity-p) min-size max-size)
1217 (let ((geometry (make-instance 'gdk:geometry
1218 :min-width (or min-width -1)
1219 :min-height (or min-height -1)
1220 :max-width (or max-width -1)
1221 :max-height (or max-height -1)
1222 :base-width (or base-width 0)
1223 :base-height (or base-height 0)
1224 :width-inc (or width-inc 0)
1225 :height-inc (or height-inc 0)
1226 :min-aspect (or min-aspect 0)
1227 :max-aspect (or max-aspect 0)
1230 (when (or min-size min-width min-height)
1231 (push :min-size mask))
1232 (when (or max-size max-width max-height)
1233 (push :max-size mask))
1234 (when (or base-width base-height)
1235 (push :base-size mask))
1236 (when (or width-inc height-inc)
1237 (push :resize-inc mask))
1238 (when (or min-aspect max-aspect)
1239 (push :aspect mask))
1241 (push :win-gravity mask))
1242 (%window-set-geometry-hints window geometry mask)))
1244 (defbinding window-list-toplevels () (glist (copy-of window))
1245 "Returns a list of all existing toplevel windows.")
1247 (defbinding window-add-mnemonic (window key target) nil
1249 ((gdk:keyval-from-name key) unsigned-int)
1252 (defbinding window-remove-mnemonic (window key target) nil
1254 ((gdk:keyval-from-name key) unsigned-int)
1257 (defbinding window-mnemonic-activate (window key modifier) nil
1259 ((gdk:keyval-from-name key) unsigned-int)
1260 (modifier gdk:modifier-type))
1262 (defbinding window-activate-key () boolean
1264 (event gdk:key-event))
1266 (defbinding window-propagate-key-event () boolean
1268 (event gdk:key-event))
1270 (defbinding window-present () nil
1273 (defbinding window-iconify () nil
1276 (defbinding window-deiconify () nil
1279 (defbinding window-stick () nil
1282 (defbinding window-unstick () nil
1285 (defbinding window-maximize () nil
1288 (defbinding window-unmaximize () nil
1291 (defbinding window-fullscreen () nil
1294 (defbinding window-unfullscreen () nil
1297 (defbinding window-set-keep-above () nil
1301 (defbinding window-set-keep-below () nil
1305 (defbinding window-begin-resize-drag () nil
1307 (edge gdk:window-edge)
1309 (root-x int) (root-y int)
1310 (timestamp unsigned-int))
1312 (defbinding window-begin-move-drag () nil
1314 (edge gdk:window-edge)
1316 (root-x int) (root-y int)
1317 (timestamp unsigned-int))
1319 (defbinding window-set-frame-dimensions () nil
1321 (left int) (top int) (rigth int) (bottom int))
1323 (defbinding %window-get-default-size () nil
1328 (defun window-get-default-size (window)
1329 (multiple-value-bind (width height) (%window-get-default-size window)
1330 (values (unless (= width -1) width) (unless (= height -1) height))))
1332 (defbinding window-get-frame-dimensions () nil
1334 (left int :out) (top int :out) (rigth int :out) (bottom int :out))
1336 (defbinding %window-get-icon-list () (glist gdk:pixbuf)
1339 (defbinding window-get-position () nil
1344 (defbinding window-get-size () nil
1349 (defbinding window-move () nil
1354 (defbinding window-parse-geometry () boolean
1358 (defbinding window-reshow-with-initial-size () nil
1361 (defbinding window-resize () nil
1366 (defbinding (window-default-icon-list "gtk_window_get_default_icon_list")
1367 () (glist gdk:pixbuf))
1369 (defun window-default-icon ()
1370 (first (window-default-icon-list)))
1372 (defbinding %window-set-default-icon-list () nil
1373 (icons (glist gdk:pixbuf)))
1375 (defun (setf window-default-icon-list) (icons)
1376 (%window-set-default-icon-list icons)
1379 (defbinding %window-set-default-icon () nil
1380 (icons (glist gdk:pixbuf)))
1382 (defmethod (setf window-default-icon) ((icon gdk:pixbuf))
1383 (%window-set-default-icon icon)
1386 (defmethod (setf window-group) ((group window-group) (window window))
1387 (window-group-add-window group window)
1390 (defbinding %window-set-default-icon-from-file () boolean
1394 (defmethod (setf window-default-icon) ((icon-file pathname))
1395 (%window-set-default-icon-from-file icon-file)
1398 (defbinding %window-set-icon-from-file () boolean
1403 (defmethod (setf window-icon) ((icon-file pathname) (window window))
1404 (%window-set-icon-from-file window icon-file)
1407 (defbinding window-set-auto-startup-notification () nil
1410 (defbinding decorated-window-init () nil
1413 (defbinding decorated-window-calculate-frame-size () nil
1416 (defbinding decorated-window-set-title () nil
1420 (defbinding decorated-window-move-resize-window () nil
1430 (defmethod initialize-instance ((window-group window-group) &rest initargs
1431 &key window windows)
1432 (declare (ignore window windows))
1435 (initial-add window-group #'window-group-add-window
1436 initargs :window :windows)))
1439 (defbinding window-group-add-window () nil
1440 (window-group window-group)
1443 (defbinding window-group-remove-window () nil
1444 (window-group window-group)
1450 (defun (setf scrolled-window-scrollbar-policy) (policy window)
1451 (setf (scrolled-window-hscrollbar-policy window) policy)
1452 (setf (scrolled-window-vscrollbar-policy window) policy))
1454 (defbinding scrolled-window-add-with-viewport () nil
1455 (scrolled-window scrolled-window)
1458 (defmethod shared-initialize ((window scrolled-window) names &key policy)
1459 (declare (ignore names))
1461 (setf (slot-value window 'hscrollbar-policy) policy)
1462 (setf (slot-value window 'vscrollbar-policy) policy))
1468 (defbinding statusbar-get-context-id () unsigned-int
1469 (statusbar statusbar)
1470 (context-description string))
1472 (defbinding statusbar-push () unsigned-int
1473 (statusbar statusbar)
1474 (context-id unsigned-int)
1477 (defbinding statusbar-pop () nil
1478 (statusbar statusbar)
1479 (context-id unsigned-int))
1481 (defbinding statusbar-remove () nil
1482 (statusbar statusbar)
1483 (context-id unsigned-int)
1484 (message-id unsigned-int))
1490 (defbinding fixed-put () nil
1495 (defbinding fixed-move () nil
1504 (defun %ensure-notebook-position (notebook page)
1507 (widget (notebook-page-num notebook page t))))
1509 (defun %ensure-notebook-child (notebook position)
1512 (t (notebook-get-nth-page notebook position))))
1514 (defbinding (notebook-insert "gtk_notebook_insert_page_menu")
1515 (notebook position child tab-label &optional menu-label) nil
1518 ((if (stringp tab-label)
1519 (make-instance 'label :label tab-label)
1521 ((if (stringp menu-label)
1522 (make-instance 'label :label menu-label)
1523 menu-label) (or null widget))
1524 ((%ensure-notebook-position notebook position) position))
1526 (defun notebook-append (notebook child tab-label &optional menu-label)
1527 (notebook-insert notebook :last child tab-label menu-label))
1529 (defun notebook-prepend (notebook child tab-label &optional menu-label)
1530 (notebook-insert notebook :first child tab-label menu-label))
1532 (defbinding notebook-remove-page (notebook page) nil
1534 ((%ensure-notebook-position notebook page) position))
1536 (defbinding %notebook-page-num () int
1540 (defun notebook-page-num (notebook child &optional error-p)
1541 (let ((page-num (%notebook-page-num notebook child)))
1544 (error "~A is not a page in ~A" child notebook))
1547 (defbinding notebook-next-page () nil
1548 (notebook notebook))
1550 (defbinding notebook-prev-page () nil
1551 (notebook notebook))
1553 (defbinding notebook-reorder-child (notebook child position) nil
1556 ((%notebook-position notebook position) int))
1558 (defbinding notebook-popup-enable () nil
1559 (notebook notebook))
1561 (defbinding notebook-popup-disable () nil
1562 (notebook notebook))
1564 (defbinding notebook-get-nth-page () widget
1568 (defun %notebook-current-page (notebook)
1569 (when (slot-boundp notebook 'current-page-num)
1570 (notebook-get-nth-page notebook (notebook-current-page-num notebook))))
1572 (defun (setf notebook-current-page) (page notebook)
1573 (setf (notebook-current-page notebook) (notebook-page-num notebook page)))
1575 (defbinding (notebook-tab-label "gtk_notebook_get_tab_label")
1576 (notebook page) widget
1578 ((%ensure-notebook-child notebook page) widget))
1580 (defbinding (notebook-tab-label-text "gtk_notebook_get_tab_label_text")
1581 (notebook page) (copy-of string)
1583 ((%ensure-notebook-child notebook page) widget))
1585 (defbinding %notebook-set-tab-label () nil
1590 (defun (setf notebook-tab-label) (tab-label notebook page)
1591 (let ((widget (if (stringp tab-label)
1592 (make-instance 'label :label tab-label)
1594 (%notebook-set-tab-label notebook (%ensure-notebook-child notebook page) widget)
1598 (defbinding (notebook-menu-label "gtk_notebook_get_menu_label")
1599 (notebook page) widget
1601 ((%ensure-notebook-child notebook page) widget))
1603 (defbinding (notebook-menu-label-text "gtk_notebook_get_menu_label_text")
1604 (notebook page) (copy-of string)
1606 ((%ensure-notebook-child notebook page) widget))
1608 (defbinding %notebook-set-menu-label () nil
1611 (menu-label widget))
1613 (defun (setf notebook-menu-label) (menu-label notebook page)
1614 (let ((widget (if (stringp menu-label)
1615 (make-instance 'label :label menu-label)
1617 (%notebook-set-menu-label notebook (%ensure-notebook-child notebook page) widget)
1621 (defbinding notebook-query-tab-label-packing (notebook page) nil
1623 ((%notebook-child notebook page) widget)
1624 (expand boolean :out)
1626 (pack-type pack-type :out))
1628 (defbinding notebook-set-tab-label-packing
1629 (notebook page expand fill pack-type) nil
1631 ((%notebook-child notebook page) widget)
1634 (pack-type pack-type))
1640 (defbinding paned-pack1 () nil
1646 (defbinding paned-pack2 () nil
1655 (defbinding layout-put () nil
1661 (defbinding layout-move () nil
1667 (defbinding layout-set-size () nil
1669 (width unsigned-int)
1670 (height unsigned-int))
1672 (defbinding layout-get-size () nil
1674 (width unsigned-int :out)
1675 (height unsigned-int :out))
1680 (defbinding menu-shell-insert (menu-shell menu-item position) nil
1681 (menu-shell menu-shell)
1682 (menu-item menu-item)
1688 (defun menu-shell-append (menu-shell menu-item)
1689 (menu-shell-insert menu-shell menu-item :last))
1691 (defun menu-shell-prepend (menu-shell menu-item)
1692 (menu-shell-insert menu-shell menu-item :fisrt))
1694 (defbinding menu-shell-deactivate () nil
1695 (menu-shell menu-shell))
1697 (defbinding menu-shell-select-item () nil
1698 (menu-shell menu-shell)
1699 (menu-item menu-item))
1701 (defbinding menu-shell-select-first () nil
1702 (menu-shell menu-shell)
1703 (search-sensitive boolean))
1705 (defbinding menu-shell-deselect () nil
1706 (menu-shell menu-shell))
1708 (defbinding menu-shell-activate-item () nil
1709 (menu-shell menu-shell)
1710 (menu-item menu-item)
1711 (fore-deactivate boolean))
1713 (defbinding menu-shell-cancel () nil
1714 (menu-shell menu-shell))
1719 (defun %menu-position (menu child)
1722 (keyword (case child
1725 (t (error "Invalid position keyword: ~A" child))))
1726 (widget (menu-child-position menu child))))
1729 (defbinding menu-reorder-child (menu menu-item position) nil
1731 (menu-item menu-item)
1732 ((%menu-position menu position) int))
1734 (defbinding menu-attach () nil
1736 (menu-item menu-item)
1737 (left-attach unsigned-int)
1738 (right-attach unsigned-int)
1739 (top-attach unsigned-int)
1740 (bottom-attach unsigned-int))
1742 (def-callback-marshal %menu-position-func (nil (menu menu) (x int) (y int) (push-in boolean)))
1744 (defbinding %menu-popup () nil
1746 (parent-menu-shell (or null menu-shell))
1747 (parent-menu-item (or null menu-item))
1748 (callback-func (or null pointer))
1749 (callback-id unsigned-int)
1750 (button unsigned-int)
1751 (activate-time (unsigned 32)))
1753 (defun menu-popup (menu button activate-time &key callback parent-menu-shell
1756 (with-callback-function (id callback)
1758 menu parent-menu-shell parent-menu-item
1759 (callback %menu-position-func) id button activate-time))
1761 menu parent-menu-shell parent-menu-item nil 0 button activate-time)))
1763 (defbinding menu-set-accel-path () nil
1765 (accel-path string))
1767 (defbinding menu-reposition () nil
1770 (defbinding menu-popdown () nil
1773 (defun menu-child-position (menu child)
1774 (position child (container-children menu)))
1776 (defun menu-active-num (menu)
1777 (menu-child-position menu (menu-active menu)))
1779 (defbinding %menu-set-active () nil
1781 (index unsigned-int))
1783 (defun (setf menu-active) (menu child)
1784 (%menu-set-active menu (%menu-position menu child))
1787 (defcallback %menu-detach-func (nil (widget widget) (menu menu))
1788 (funcall (object-data menu 'detach-func) widget menu))
1790 (defbinding %menu-attach-to-widget () nil
1793 ((callback %menu-detach-func) pointer))
1795 (defun menu-attach-to-widget (menu widget function)
1796 (setf (object-data menu 'detach-func) function)
1797 (%menu-attach-to-widget menu widget))
1799 (defbinding menu-detach () nil
1803 (defbinding menu-get-for-attach-widget () (copy-of (glist widget))
1806 (defbinding menu-set-monitor () nil
1813 (defbinding table-resize () nil
1816 (columns unsigned-int))
1818 (defbinding table-attach (table child left right top bottom
1819 &key options x-options y-options
1820 (x-padding 0) (y-padding 0)) nil
1824 (right unsigned-int)
1826 (bottom unsigned-int)
1827 ((append (mklist options) (mklist x-options)) attach-options)
1828 ((append (mklist options) (mklist y-options)) attach-options)
1829 (x-padding unsigned-int)
1830 (y-padding unsigned-int))
1833 (defbinding %table-set-row-spacing () nil
1836 (spacing unsigned-int))
1838 (defbinding %table-set-row-spacings () nil
1840 (spacing unsigned-int))
1842 (defun (setf table-row-spacing) (spacing table &optional row)
1844 (%table-set-row-spacing table row spacing)
1845 (%table-set-row-spacings table spacing))
1848 (defbinding %table-get-row-spacing () unsigned-int
1852 (defbinding %table-get-default-row-spacing () unsigned-int
1855 (defun table-row-spacing (table &optional row)
1857 (%table-get-row-spacing table row)
1858 (%table-get-default-row-spacing table)))
1861 (defbinding %table-set-col-spacing () nil
1864 (spacing unsigned-int))
1866 (defbinding %table-set-col-spacings () nil
1868 (spacing unsigned-int))
1870 (defun (setf table-col-spacing) (spacing table &optional col)
1872 (%table-set-col-spacing table col spacing)
1873 (%table-set-col-spacings table spacing))
1876 (defbinding %table-get-col-spacing () unsigned-int
1880 (defbinding %table-get-default-col-spacing () unsigned-int
1883 (defun table-col-spacing (table &optional col)
1885 (%table-get-col-spacing table col)
1886 (%table-get-default-col-spacing table)))
1892 (defmethod initialize-instance ((toolbar toolbar) &rest initargs &key tooltips)
1894 (apply #'call-next-method toolbar
1895 :tooltips (make-instance 'tooltips) initargs)
1896 (call-next-method)))
1898 (defbinding %toolbar-insert () nil
1900 (tool-item tool-item)
1901 (position position))
1903 (defun toolbar-insert (toolbar tool-item &optional (position :end))
1904 (%toolbar-insert toolbar tool-item position)
1905 (%tool-item-update-tooltips tool-item))
1907 (defbinding toolbar-get-item-index () int
1911 (defbinding toolbar-get-nth-item () tool-item
1915 (defbinding toolbar-get-drop-index () int
1919 (defbinding toolbar-set-drop-highlight-item () nil
1921 (tool-item tool-item)
1927 (defmethod initialize-instance ((button tool-button) &rest initargs &key icon)
1928 (if (and icon (not (typep icon 'widget)))
1929 (apply #'call-next-method button :icon (create-image-widget icon) initargs)
1930 (call-next-method)))
1935 (defbinding tool-item-set-tooltip () nil
1936 (tool-item tool-item)
1939 (tip-private string))
1942 (defun %tool-item-update-tooltips (tool-item)
1944 (slot-boundp tool-item 'parent)
1946 (user-data-p tool-item 'tip-text)
1947 (user-data-p tool-item 'tip-private)))
1948 (tool-item-set-tooltip
1949 tool-item (toolbar-tooltips (widget-parent tool-item))
1950 (or (user-data tool-item 'tip-text) "")
1951 (or (user-data tool-item 'tip-private) ""))))
1953 (defmethod (setf tool-item-tip-text) ((tip-text string) (tool-item tool-item))
1954 (setf (user-data tool-item 'tip-text) tip-text)
1955 (%tool-item-update-tooltips tool-item)
1958 (defmethod (setf tool-item-tip-private) ((tip-private string) (tool-item tool-item))
1959 (setf (user-data tool-item 'tip-private) tip-private)
1960 (%tool-item-update-tooltips tool-item)
1963 (defmethod container-add ((toolbar toolbar) (tool-item tool-item) &rest args)
1964 (declare (ignore args))
1967 (%tool-item-update-tooltips tool-item)))
1970 (defbinding tool-item-retrieve-proxy-menu-item () widget
1971 (tool-item tool-item))
1973 (defbinding (tool-item-proxy-menu-item
1974 "gtk_tool_item_get_proxy_menu_item") () menu-item
1975 (tool-item tool-item)
1976 (menu-item-id string))
1978 (defbinding %tool-item-set-proxy-menu-item () nil
1979 (tool-item tool-item)
1980 (menu-item-id string)
1981 (menu-item menu-item))
1983 (defun (setf tool-item-proxy-menu-item) (menu-item menu-item-id tool-item)
1984 (%tool-item-set-proxy-menu-item menu-item-id tool-item menu-item)
1988 (defbinding tool-item-rebuild-menu () nil
1989 (tool-item tool-item))
1994 (defbinding editable-select-region (editable &optional (start 0) end) nil
1999 (defbinding editable-get-selection-bounds (editable) nil
2004 (defbinding editable-insert-text (editable text &optional (position 0)) nil
2008 (position position :in-out))
2010 (defun editable-append-text (editable text)
2011 (editable-insert-text editable text nil))
2013 (defun editable-prepend-text (editable text)
2014 (editable-insert-text editable text 0))
2016 (defbinding editable-delete-text (editable &optional (start 0) end) nil
2021 (defbinding (editable-text "gtk_editable_get_chars")
2022 (editable &optional (start 0) end) string
2027 (defun (setf editable-text) (text editable)
2029 (editable-delete-text
2031 (editable-insert-text editable text))
2032 (editable-delete-text editable))
2035 (defbinding editable-cut-clipboard () nil
2036 (editable editable))
2038 (defbinding editable-copy-clipboard () nil
2039 (editable editable))
2041 (defbinding editable-paste-clipboard () nil
2042 (editable editable))
2044 (defbinding editable-delete-selection () nil
2045 (editable editable))
2051 (defbinding spin-button-configure () nil
2052 (spin-button spin-button)
2053 (adjustment adjustment)
2054 (climb-rate double-float)
2055 (digits unsigned-int))
2057 (defbinding spin-button-set-range () nil
2058 (spin-button spin-button)
2062 (defbinding spin-button-get-range () nil
2063 (spin-button spin-button)
2064 (min double-float :out)
2065 (max double-float :out))
2067 (defun spin-button-value-as-int (spin-button)
2068 (round (spin-button-value spin-button)))
2070 (defbinding %spin-button-spin () nil
2071 (spin-button spin-button)
2072 (direction spin-type)
2073 (increment double-float))
2075 (defun spin-button-spin (spin-button value)
2077 (real (%spin-button-spin spin-button :spin-user-defined value))
2078 (spin-type (%spin-button-spin spin-button value 0))))
2081 (defbinding spin-button-update () nil
2082 (spin-button spin-button))
2088 (defbinding ruler-set-range () nil
2090 (lower single-float)
2091 (upper single-float)
2092 (position single-float)
2093 (max-size single-float))
2095 (defbinding ruler-get-range () nil
2097 (lower single-float :out)
2098 (upper single-float :out)
2099 (position single-float :out)
2100 (max-size single-float :out))
2106 (defun range-lower (range)
2107 (adjustment-lower (range-adjustment range)))
2109 (defun range-upper (range)
2110 (adjustment-upper (range-adjustment range)))
2112 (defun (setf range-lower) (value range)
2113 (setf (adjustment-lower (range-adjustment range)) value))
2115 (defun (setf range-upper) (value range)
2116 (setf (adjustment-upper (range-adjustment range)) value))
2118 (defun range-page-increment (range)
2119 (adjustment-page-increment (range-adjustment range)))
2121 (defun range-step-increment (range)
2122 (adjustment-step-increment (range-adjustment range)))
2124 (defun (setf range-page-increment) (value range)
2125 (setf (adjustment-page-increment (range-adjustment range)) value))
2127 (defun (setf range-step-increment) (value range)
2128 (setf (adjustment-step-increment (range-adjustment range)) value))
2130 (defbinding range-set-range () nil
2132 (lower double-float)
2133 (upper double-float))
2135 (defbinding range-set-increments () nil
2138 (page double-float))
2143 (defbinding scale-get-layout-offsets () nil
2151 (defbinding progress-bar-pulse () nil
2152 (progress-bar progress-bar))
2157 (defmethod initialize-instance ((size-group size-group) &rest initargs
2158 &key widget widgets)
2159 (declare (ignore widget widgets))
2162 (initial-add size-group #'size-group-add-widget
2163 initargs :widget :widgets)))
2166 (defbinding size-group-add-widget () nil
2167 (size-group size-group)
2170 (defbinding size-group-remove-widget () nil
2171 (size-group size-group)
2177 (defbinding %stock-item-copy () pointer
2180 (defbinding %stock-item-free () nil
2183 (defmethod reference-foreign ((class (eql (find-class 'stock-item))) location)
2184 (%stock-item-copy location))
2186 (defmethod unreference-foreign ((class (eql (find-class 'stock-item))) location)
2187 (%stock-item-free location))
2189 (defbinding stock-add (stock-item) nil
2190 (stock-item stock-item)
2193 (defbinding stock-list-ids () (gslist string))
2195 (defbinding %stock-lookup () boolean
2199 (defun stock-lookup (stock-id)
2201 (allocate-memory (proxy-instance-size (find-class 'stock-item)))))
2203 (when (%stock-lookup stock-id location)
2204 (ensure-proxy-instance 'stock-item (%stock-item-copy location)))
2205 (deallocate-memory location))))
2210 (defbinding tooltips-enable () nil
2211 (tooltips tooltips))
2213 (defbinding tooltips-disable () nil
2214 (tooltips tooltips))
2216 (defun (setf tooltips-enabled-p) (enable tooltips)
2218 (tooltips-enable tooltips)
2219 (tooltips-disable tooltips)))
2221 (defbinding tooltips-set-tip () nil
2225 (tip-private string))
2227 (defbinding tooltips-data-get () tooltips-data
2230 (defbinding tooltips-force-window () nil
2231 (tooltips tooltips))
2233 (defbinding tooltips-get-info-from-tip-window () boolean
2235 (tooltips tooltips :out)
2236 (current-widget widget :out))
2241 (defbinding rc-add-default-file (filename) nil
2242 ((namestring (truename filename)) string))
2244 (defbinding rc-parse (filename) nil
2245 ((namestring (truename filename)) string))
2247 (defbinding rc-parse-string () nil
2250 (defbinding rc-reparse-all () nil)
2252 (defbinding rc-get-style () style