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.53 2006-02-16 19:39:34 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"
61 (find-package "SWANK")
62 (eq (symbol-value (find-symbol "*COMMUNICATION-STYLE*" "SWANK")) :spawn))
63 (error "When running clg in Slime the communication style :spawn can not be used. See the README file and <http://common-lisp.net/project/slime/doc/html/slime_45.html> for more information."))
65 (unless (gdk:display-get-default)
68 (error "Initialization of GTK+ failed."))
70 (gdk:display-open display)
71 (add-fd-handler (gdk:display-connection-number) :input #'main-iterate-all)
72 (setq *periodic-polling-function* #'main-iterate-all)
73 (setq *max-event-to-sec* 0)
74 (setq *max-event-to-usec* 1000))))
79 (defbinding grab-add () nil
82 (defbinding grab-get-current () widget)
84 (defbinding grab-remove () nil
87 (defbinding get-default-language () (copy-of pango:language))
94 (def-callback-marshal %about-dialog-activate-link-func
95 (nil (dialog about-dialog) (link (copy-of string))))
97 (defbinding about-dialog-set-email-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))
102 (defbinding about-dialog-set-url-hook (function) nil
103 ((callback %about-dialog-activate-link-func) pointer)
104 ((register-callback-function function) unsigned-int)
105 ((callback user-data-destroy-func) pointer)))
110 (defbinding %accel-group-connect () nil
111 (accel-group accel-group)
113 (modifiers gdk:modifier-type)
117 (defun accel-group-connect (group accelerator function &optional flags)
118 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
119 (let ((gclosure (make-callback-closure function)))
120 (%accel-group-connect group key modifiers flags gclosure)
123 (defbinding accel-group-connect-by-path (group path function) nil
126 ((make-callback-closure function) gclosure :return))
128 (defbinding %accel-group-disconnect (group gclosure) boolean
132 (defbinding %accel-group-disconnect-key () boolean
135 (modifiers gdk:modifier-type))
137 (defun accel-group-disconnect (group accelerator)
138 (etypecase accelerator
139 (gclosure (%accel-group-disconnect group accelerator))
141 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
142 (%accel-group-disconnect-key group key modifiers)))))
144 (defbinding %accel-group-query () (copy-of (vector (inlined accel-group-entry) n))
145 (accel-group accel-group)
147 (modifiers gdk:modifier-type)
150 (defun accel-group-query (accel-group accelerator)
151 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
152 (%accel-group-query accel-group key modifiers)))
154 (defbinding %accel-group-activate () boolean
155 (accel-group accel-group)
156 (acceleratable gobject)
158 (modifiers gdk:modifier-type))
160 (defun accel-group-activate (accel-group acceleratable accelerator)
161 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
162 (%accel-group-activate accel-group acceleratable key modifiers)))
164 (defbinding accel-group-lock () nil
165 (accel-group accel-group))
167 (defbinding accel-group-unlock () nil
168 (accel-group accel-group))
170 (defbinding accel-group-from-accel-closure () accel-group
173 (defbinding %accel-groups-activate () boolean
176 (modifiers gdk:modifier-type))
178 (defun accel-groups-activate (object accelerator)
179 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
180 (%accel-groups-activate object key modifiers)))
182 (defbinding accel-groups-from-object () (gslist accel-groups)
185 (defbinding accelerator-valid-p (key &optional modifiers) boolean
187 (modifiers gdk:modifier-type))
189 (defbinding %accelerator-parse () nil
191 (key unsigned-int :out)
192 (modifiers gdk:modifier-type :out))
194 (defgeneric parse-accelerator (accelerator))
196 (defmethod parse-accelerator ((accelerator string))
197 (multiple-value-bind (key modifiers) (%accelerator-parse accelerator)
199 (error "Invalid accelerator: ~A" accelerator)
200 (values key modifiers))))
202 (defmethod parse-accelerator ((accelerator cons))
203 (destructuring-bind (key modifiers) accelerator
209 (gdk:keyval-from-name key)
210 (error "Invalid key name: ~A" key)))
211 (character (parse-accelerator key)))
214 (defmethod parse-accelerator ((key integer))
217 (defmethod parse-accelerator ((key character))
219 (gdk:keyval-from-name (string key))
220 (error "Invalid key name: ~A" key)))
223 (defbinding accelerator-name () string
225 (modifiers gdk:modifier-type))
228 (defbinding accelerator-get-label () string
230 (modifiers gdk:modifier-type))
232 (defbinding %accelerator-set-default-mod-mask () nil
233 (default-modifiers gdk:modifier-type))
235 (defun (setf accelerator-default-modifier-mask) (default-modifiers)
236 (%accelerator-set-default-mod-mask default-modifiers))
238 (defbinding (accelerator-default-modifier-mask "gtk_accelerator_get_default_mod_mask") () gdk:modifier-type)
243 (defbinding accel-label-get-accel-width () unsigned-int
244 (accel-label accel-label))
246 (defbinding accel-label-refetch () boolean
247 (accel-label accel-label))
253 (defbinding (accel-map-init "_gtk_accel_map_init") () nil)
255 (defbinding %accel-map-add-entry () nil
258 (modifiers gdk:modifier-type))
260 (defun accel-map-add-entry (path accelerator)
261 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
262 (%accel-map-add-entry path key modifiers)))
264 (defbinding %accel-map-lookup-entry () boolean
266 ((make-instance 'accel-key) accel-key :return))
268 (defun accel-map-lookup-entry (path)
269 (multiple-value-bind (found-p accel-key) (%accel-map-lookup-entry path)
272 (slot-value accel-key 'key)
273 (slot-value accel-key 'modifiers)
274 (slot-value accel-key 'flags)))))
276 (defbinding %accel-map-change-entry () boolean
279 (modifiers gdk:modifier-type)
282 (defun accel-map-change-entry (path accelerator &optional replace)
283 (multiple-value-bind (key modifiers) (parse-accelerator accelerator)
284 (%accel-map-change-entry path key modifiers replace)))
286 (defbinding accel-map-load () nil
289 (defbinding accel-map-save () nil
292 (defcallback %accel-map-foreach-func
294 (callback-id unsigned-int) (accel-path (copy-of string))
295 (key unsigned-int) (modifiers gdk:modifier-type) (changed boolean))
296 (invoke-callback callback-id nil accel-path key modifiers changed))
298 (defbinding %accel-map-foreach (callback-id) nil
299 (callback-id unsigned-int)
300 (%accel-map-foreach-func callback))
302 (defbinding %accel-map-foreach-unfiltered (callback-id) nil
303 (callback-id unsigned-int)
304 (%accel-map-foreach-func callback))
306 (defun accel-map-foreach (function &optional (filter-p t))
307 (with-callback-function (id function)
309 (%accel-map-foreach id)
310 (%accel-map-foreach-unfiltered id))))
312 (defbinding accel-map-add-filter () nil
315 (defbinding accel-map-get () accel-map)
317 (defbinding accel-map-lock-path () nil
320 (defbinding accel-map-unlock-path () nil
327 (defbinding accessible-connect-widget-destroyed () nil
328 (accessible accessible))
333 (defmethod initialize-instance ((adjustment adjustment) &key value)
336 ;; we need to make sure that the value is set last, otherwise it
337 ;; may be outside current limits and ignored
339 (setf (slot-value adjustment 'value) value))))
342 (defbinding adjustment-changed () nil
343 (adjustment adjustment))
345 (defbinding adjustment-value-changed () nil
346 (adjustment adjustment))
348 (defbinding adjustment-clamp-page () nil
349 (adjustment adjustment)
351 (upper single-float))
356 (defbinding alignment-set () nil
357 (alognment alignment)
358 (x-align single-float)
359 (y-align single-float)
360 (x-scale single-float)
361 (y-scale single-float))
363 (defbinding alignment-get-padding () nil
364 (alognment alignment)
365 (top unsigned-int :out)
366 (bottom unsigned-int :out)
367 (left unsigned-int :out)
368 (right unsigned-int :out))
370 (defbinding alignment-set-padding () nil
371 (alognment alignment)
373 (bottom unsigned-int)
375 (right unsigned-int))
383 (defun (setf bin-child) (child bin)
384 (when-bind (current-child (bin-child bin))
385 (container-remove bin current-child))
386 (container-add bin child)
389 (defmethod compute-signal-function ((bin bin) signal function object)
390 (declare (ignore signal))
391 (if (eq object :child)
392 #'(lambda (&rest args)
393 (apply function (bin-child bin) (rest args)))
399 (defbinding box-pack-start () nil
404 (padding unsigned-int))
406 (defbinding box-pack-end () nil
411 (padding unsigned-int))
413 (defun box-pack (box child &key end (expand t) (fill t) (padding 0))
415 (box-pack-end box child expand fill padding)
416 (box-pack-start box child expand fill padding)))
418 (defbinding box-reorder-child () nil
423 (defbinding box-query-child-packing () nil
426 (expand boolean :out)
428 (padding unsigned-int :out)
429 (pack-type pack-type :out))
431 (defbinding box-set-child-packing () nil
436 (padding unsigned-int)
437 (pack-type pack-type))
443 (defmethod initialize-instance ((button button) &rest initargs &key stock)
445 (apply #'call-next-method button :label stock :use-stock t initargs)
449 (defbinding button-pressed () nil
452 (defbinding button-released () nil
455 (defbinding button-clicked () nil
458 (defbinding button-enter () nil
461 (defbinding button-leave () nil
468 (defbinding calendar-select-month () int
473 (defbinding calendar-select-day () nil
477 (defbinding calendar-mark-day () int
481 (defbinding calendar-unmark-day () int
485 (defbinding calendar-clear-marks () nil
488 (defbinding calendar-get-date () nil
490 (year unsigned-int :out)
491 (month unsigned-int :out)
492 (day unsigned-int :out))
494 (defbinding calendar-freeze () nil
497 (defbinding calendar-thaw () nil
503 (defbinding check-menu-item-toggled () nil
504 (check-menu-item check-menu-item))
509 (defbinding (color-selection-is-adjusting-p
510 "gtk_color_selection_is_adjusting") () boolean
511 (colorsel color-selection))
515 ;;; Color selection dialog -- no functions
521 (defmethod initialize-instance ((combo-box combo-box) &rest initargs
522 &key model content active)
523 (remf initargs :active)
525 (apply #'call-next-method combo-box initargs)
527 (apply #'call-next-method combo-box
528 :model (make-instance 'list-store :column-types '(string))
530 (unless (typep combo-box 'combo-box-entry)
531 (let ((cell (make-instance 'cell-renderer-text)))
532 (cell-layout-pack combo-box cell :expand t)
533 (cell-layout-add-attribute combo-box cell :text 0)))))
535 (mapc #'(lambda (text)
536 (combo-box-append-text combo-box text))
539 (setf (combo-box-active combo-box) active)))
542 ;; (defmethod shared-initialize :after ((combo-box combo-box) names &key active)
544 ;; (signal-emit combo-box 'changed)))
546 (defbinding combo-box-append-text () nil
547 (combo-box combo-box)
550 (defbinding combo-box-insert-text () nil
551 (combo-box combo-box)
555 (defbinding combo-box-prepend-text () nil
556 (combo-box combo-box)
560 (defbinding combo-box-get-active-text () string
561 (combo-box combo-box))
563 (defbinding combo-box-popup () nil
564 (combo-box combo-box))
566 (defbinding combo-box-popdown () nil
567 (combo-box combo-box))
573 (defmethod initialize-instance ((combo-box-entry combo-box-entry) &key model)
576 (setf (combo-box-entry-text-column combo-box-entry) 0)))
581 (defmethod shared-initialize ((dialog dialog) names &rest initargs
583 (declare (ignore button buttons))
586 (initial-apply-add dialog #'dialog-add-button initargs :button :buttons)))
589 (defun dialog-response-id (dialog response &optional create-p error-p)
590 "Returns a numeric response id"
591 (if (typep response 'response-type)
592 (response-type-to-int response)
593 (let ((responses (object-data dialog 'responses)))
595 ((and responses (position response responses :test #'equal)))
599 (vector-push-extend response responses)
600 (1- (length responses)))
603 (object-data dialog 'responses)
604 (make-array 1 :adjustable t :fill-pointer t
605 :initial-element response))
608 (error "Invalid response: ~A" response))))))
610 (defun dialog-find-response (dialog id)
611 "Finds a symbolic response given a numeric id"
613 (int-to-response-type id)
614 (aref (object-data dialog 'responses) id)))
617 (defmethod compute-signal-id ((dialog dialog) signal)
618 (if (dialog-response-id dialog signal)
619 (ensure-signal-id 'response dialog)
622 (defmethod compute-signal-function ((dialog dialog) signal function object)
623 (declare (ignore function object))
624 (let ((callback (call-next-method))
625 (id (dialog-response-id dialog signal)))
627 #'(lambda (dialog response)
628 (when (= response id)
629 (funcall callback dialog)))
632 (defbinding dialog-run () nil
635 (defbinding dialog-response (dialog response) nil
637 ((dialog-response-id dialog response nil t) int))
640 (defbinding %dialog-add-button () button
645 (defun dialog-add-button (dialog label &optional (response label)
646 &key default object after)
647 "Adds a button to the dialog."
648 (let* ((signal (if (functionp response)
651 (id (dialog-response-id dialog signal t))
652 (button (%dialog-add-button dialog label id)))
653 (when (functionp response)
654 (signal-connect dialog signal response :object object :after after))
656 (%dialog-set-default-response dialog id))
660 (defbinding %dialog-add-action-widget () nil
662 (action-widget widget)
665 (defun dialog-add-action-widget (dialog widget &optional (response widget)
666 &key default object after)
667 (let* ((signal (if (functionp response)
670 (id (dialog-response-id dialog signal t)))
671 (unless (widget-hidden-p widget)
672 (widget-show widget))
673 (%dialog-add-action-widget dialog widget id)
674 (when (functionp response)
675 (signal-connect dialog signal response :object object :after after))
677 (%dialog-set-default-response dialog id))
681 (defbinding %dialog-set-default-response () nil
685 (defun dialog-set-default-response (dialog response)
686 (%dialog-set-default-response
687 dialog (dialog-response-id dialog response nil t)))
689 (defbinding dialog-set-response-sensitive (dialog response sensitive) nil
691 ((dialog-response-id dialog response nil t) int)
695 (defbinding alternative-dialog-button-order-p (&optional screen) boolean
696 (screen (or null gdk:screen)))
699 (defbinding (dialog-set-alternative-button-order
700 "gtk_dialog_set_alternative_button_order_from_array")
703 ((length new-order) int)
704 ((map 'vector #'(lambda (response)
705 (dialog-response-id dialog response nil t))
706 new-order) (vector int)))
711 (defbinding %dialog-get-response-for-widget () int
715 (defun dialog-get-response-for-widget (dialog widget)
716 (dialog-find-response dialog (dialog-get-response-for-widget dialog widget))))
719 (defmethod container-add ((dialog dialog) (child widget) &rest args)
720 (apply #'container-add (dialog-vbox dialog) child args))
723 (defmethod container-remove ((dialog dialog) (child widget))
724 (container-remove (dialog-vbox dialog) child))
726 (defmethod container-children ((dialog dialog))
727 (container-children (dialog-vbox dialog)))
729 (defmethod (setf container-children) (children (dialog dialog))
730 (setf (container-children (dialog-vbox dialog)) children))
735 (defbinding entry-get-layout-offsets () nil
740 (defbinding entry-layout-index-to-text-index () int
744 (defbinding entry-text-index-to-layout-index () int
751 (def-callback-marshal %entry-completion-match-func
752 (boolean entry-completion string (copy-of tree-iter)))
754 (defbinding entry-completion-set-match-func (completion function) nil
755 (completion entry-completion)
756 ((callback %entry-completion-match-func) pointer)
757 ((register-callback-function function) unsigned-int)
758 ((callback user-data-destroy-func) pointer))
760 (defbinding entry-completion-complete () nil
761 (completion entry-completion))
764 (defbinding entry-completion-insert-prefix () nil
765 (completion entry-completion))
767 (defbinding entry-completion-insert-action-text () nil
768 (completion entry-completion)
772 (defbinding entry-completion-insert-action-markup () nil
773 (completion entry-completion)
777 (defbinding entry-completion-delete-action () nil
778 (completion entry-completion)
784 (defmethod initialize-instance ((file-chooser file-chooser) &rest initargs
785 &key filter filters shortcut-folder
786 shortcut-folders shortcut-folder-uti
787 shortcut-folder-uris)
788 (declare (ignore filter filters shortcut-folder shortcut-folders
789 shortcut-folder-uti shortcut-folder-uris))
792 (initial-add file-chooser #'file-chooser-add-filter
793 initargs :filer :filters)
794 (initial-add file-chooser #'file-chooser-add-shortcut-folder
795 initargs :shortcut-folder :shortcut-folders)
796 (initial-add file-chooser #'file-chooser-add-shortcut-folder-uri
797 initargs :shortcut-folder-uri :shortcut-folders-uris)))
800 (defbinding file-chooser-select-filename () boolean
801 (file-chooser file-chooser)
804 (defbinding file-chooser-unselect-filename () nil
805 (file-chooser file-chooser)
808 (defbinding file-chooser-select-all () boolean
809 (file-chooser file-chooser))
811 (defbinding file-chooser-unselect-all () boolean
812 (file-chooser file-chooser))
814 (defbinding file-chooser-get-filenames () (gslist string)
815 (file-chooser file-chooser))
817 (defbinding file-chooser-select-uri () boolean
818 (file-chooser file-chooser)
821 (defbinding file-chooser-unselect-uri () nil
822 (file-chooser file-chooser)
825 (defbinding file-chooser-get-uris () (gslist string)
826 (file-chooser file-chooser))
828 (defbinding file-chooser-add-filter () nil
829 (file-chooser file-chooser)
830 (filter file-filter))
832 (defbinding file-chooser-remove-filter () nil
833 (file-chooser file-chooser)
834 (filter file-filter))
836 (defbinding file-chooser-list-filters () (gslist file-filter)
837 (file-chooser file-chooser))
839 (defbinding file-chooser-add-shortcut-folder () boolean
840 (file-chooser file-chooser)
844 (defbinding file-chooser-remove-shortcut-folder () nil
845 (file-chooser file-chooser)
849 (defbinding file-chooser-list-shortcut-folders () (gslist string)
850 (file-chooser file-chooser))
852 (defbinding file-chooser-add-shortcut-folder-uri () boolean
853 (file-chooser file-chooser)
857 (defbinding file-chooser-remove-shortcut-folder-uri () nil
858 (file-chooser file-chooser)
862 (defbinding file-chooser-list-shortcut-folder-uris () (gslist string)
863 (file-chooser file-chooser))
868 (defmethod initialize-instance ((file-filter file-filter) &rest initargs
869 &key mime-type mime-types pattern patterns
871 (declare (ignore mime-type mime-types pattern patterns))
875 #-gtk2.6(warn "Initarg :PIXBUF-FORMATS not supportet in this version of Gtk")
876 #+gtk2.6(file-filter-add-pixbuf-formats file-filter))
877 (initial-add file-filter #'file-filter-add-mime-type
878 initargs :mime-type :mime-types)
879 (initial-add file-filter #'file-filter-add-pattern
880 initargs :pattern :patterns)))
883 (defbinding file-filter-add-mime-type () nil
887 (defbinding file-filter-add-pattern () nil
892 (defbinding file-filter-add-pixbuf-formats () nil
893 (filter file-filter))
895 (def-callback-marshal %file-filter-func (boolean file-filter-info))
897 (defbinding file-filter-add-custom (filter needed function) nil
899 (needed file-filter-flags)
900 ((callback %file-filter-func) pointer)
901 ((register-callback-function function) unsigned-int)
902 ((callback user-data-destroy-func) pointer))
904 (defbinding file-filter-get-needed () file-filter-flags
905 (filter file-filter))
907 (defbinding file-filter-filter () boolean
909 (filter-info file-filter-info))
915 (defbinding image-set-from-file () nil
919 (defmethod (setf image-pixmap) ((data vector) (image image))
920 (multiple-value-bind (pixmap mask) (gdk:pixmap-create data)
921 (setf (image-pixmap image) pixmap)
922 (setf (image-mask image) mask)))
924 (defmethod initialize-instance ((image image) &rest initargs &key pixmap file)
926 ((typep pixmap 'vector)
927 (multiple-value-bind (pixmap mask) (gdk:pixmap-create pixmap)
928 (apply #'call-next-method image :pixmap pixmap :mask mask initargs)))
932 (image-set-from-file image file)))
933 ((call-next-method))))
935 (defun create-image-widget (source &optional mask)
937 (gdk:pixbuf (make-instance 'image :pixbuf source))
938 (string (make-instance 'image :stock source))
939 (pathname (make-instance 'image :file source))
940 ((or list vector) (make-instance 'image :pixmap source))
941 (gdk:pixmap (make-instance 'image :pixmap source :mask mask))))
944 (defbinding image-clear () nil
951 (defmethod initialize-instance ((item image-menu-item) &rest initargs &key image)
952 (if (and image (not (typep image 'widget)))
953 (apply #'call-next-method item :image (create-image-widget image) initargs)
957 (defmethod (setf image-menu-item-image) ((widget widget) (item image-menu-item))
958 (setf (slot-value item 'image) widget))
960 (defmethod (setf image-menu-item-image) (image (item image-menu-item))
961 (setf (image-menu-item-image item) (create-image-widget image)))
966 (defmethod shared-initialize ((label label) names &key pattern)
967 (declare (ignore names))
970 (setf (label-pattern label) pattern)))
972 (defbinding label-get-layout-offsets () nil
977 (defbinding label-select-region () nil
982 (defbinding label-get-selection-bounds () boolean
991 (defbinding %radio-button-get-group () pointer
992 (radio-button radio-button))
994 (defbinding %radio-button-set-group () nil
995 (radio-button radio-button)
998 (defmethod add-to-radio-group ((button1 radio-button) (button2 radio-button))
999 "Add BUTTON1 to the group which BUTTON2 belongs to."
1000 (%radio-button-set-group button1 (%radio-button-get-group button2)))
1002 (defun %add-activate-callback (widget signal function object after)
1004 (signal-connect widget signal
1006 (when (slot-value widget 'active)
1007 (funcall function object (slot-value widget 'value))))
1008 :object object :after after)
1009 (signal-connect widget signal
1011 (when (slot-value widget 'active)
1012 (funcall function (slot-value widget 'value))))
1015 (defmethod activate-radio-widget ((button radio-button))
1016 (signal-emit button 'clicked))
1018 (defmethod add-activate-callback ((button radio-button) function &key object after)
1019 (%add-activate-callback button 'clicked function object after))
1021 (defmethod initialize-instance ((button radio-button) &key group)
1025 (add-to-radio-group button group))))
1030 (defbinding item-select () nil
1033 (defbinding item-deselect () nil
1036 (defbinding item-toggle () nil
1043 (defmethod initialize-instance ((item menu-item) &key label)
1047 (setf (menu-item-label item) label))))
1050 (defun (setf menu-item-label) (label menu-item)
1051 (make-instance 'accel-label
1052 :label label :xalign 0.0 :yalign 0.5 :accel-widget menu-item
1053 :use-underline (menu-item-use-underline-p menu-item)
1054 :visible t :parent menu-item)
1057 (defun menu-item-label (menu-item)
1058 (when (and (slot-boundp menu-item 'child)
1059 (typep (bin-child menu-item) 'label))
1060 (label-label (bin-child menu-item))))
1062 (defbinding menu-item-remove-submenu () nil
1063 (menu-item menu-item))
1065 (defbinding menu-item-set-accel-path () nil
1066 (menu-item menu-item)
1067 (accel-path string))
1069 (defbinding menu-item-select () nil
1070 (menu-item menu-item))
1072 (defbinding menu-item-deselect () nil
1073 (menu-item menu-item))
1075 (defbinding menu-item-activate () nil
1076 (menu-item menu-item))
1078 (defbinding menu-item-toggle-size-request () nil
1079 (menu-item menu-item)
1080 (requisition int :out))
1082 (defbinding menu-item-toggle-size-allocate () nil
1083 (menu-item menu-item)
1087 ;;; Menu tool button
1090 (defbinding menu-tool-button-set-arrow-tooltip () nil
1091 (menu-tool-button menu-tool-button)
1094 (tip-private string))
1099 (defmethod allocate-foreign ((dialog message-dialog) &key (message-type :info)
1100 (buttons :close) flags transient-parent)
1101 (%message-dialog-new transient-parent flags message-type buttons))
1104 (defmethod shared-initialize ((dialog message-dialog) names
1105 &key text #+gtk 2.6 secondary-text)
1106 (declare (ignore names))
1108 (message-dialog-set-markup dialog text))
1110 (when secondary-text
1111 (message-dialog-format-secondary-markup dialog secondary-text))
1115 (defbinding %message-dialog-new () pointer
1116 (parent (or null window))
1117 (flags dialog-flags)
1119 (buttons buttons-type)
1122 (defbinding message-dialog-set-markup () nil
1123 (message-dialog message-dialog)
1127 (defbinding message-dialog-format-secondary-text () nil
1128 (message-dialog message-dialog)
1132 (defbinding message-dialog-format-secondary-markup () nil
1133 (message-dialog message-dialog)
1140 (defbinding %radio-menu-item-get-group () pointer
1141 (radio-menu-item radio-menu-item))
1143 (defbinding %radio-menu-item-set-group () nil
1144 (radio-menu-item radio-menu-item)
1147 (defmethod activate-radio-widget ((item radio-menu-item))
1148 (menu-item-activate item))
1150 (defmethod add-to-radio-group ((item1 radio-menu-item) (item2 radio-menu-item))
1151 "Add ITEM1 to the group which ITEM2 belongs to."
1152 (%radio-menu-item-set-group item1 (%radio-menu-item-get-group item2)))
1154 (defmethod add-activate-callback ((item radio-menu-item) function &key object after)
1155 (%add-activate-callback item 'activate function object after))
1157 (defmethod initialize-instance ((item radio-menu-item) &key group)
1161 (add-to-radio-group item group))))
1165 ;;; Radio tool button
1167 (defbinding %radio-tool-button-get-group () pointer
1168 (radio-tool-button radio-tool-button))
1170 (defbinding %radio-tool-button-set-group () nil
1171 (radio-tool-button radio-tool-button)
1174 (defmethod activate-radio-widget ((button radio-tool-button))
1175 (signal-emit button 'clicked))
1177 (defmethod add-to-radio-group ((button1 radio-tool-button) (button2 radio-tool-button))
1178 "Add BUTTON1 to the group which BUTTON2 belongs to."
1179 (%radio-tool-button-set-group button1 (%radio-tool-button-get-group button2)))
1180 (defmethod add-activate-callback ((button radio-tool-button) function &key object after)
1181 (%add-activate-callback button 'clicked function object after))
1183 (defmethod initialize-instance ((button radio-tool-button) &key group)
1187 (add-to-radio-group button group))))
1193 (defbinding toggle-button-toggled () nil
1194 (toggle-button toggle-button))
1199 (defmethod initialize-instance ((window window) &rest initargs
1200 &key accel-group accel-groups)
1201 (declare (ignore accel-group accel-groups))
1204 (initial-add window #'window-add-accel-group
1205 initargs :accel-group :accel-groups)))
1208 (defbinding window-set-wmclass () nil
1210 (wmclass-name string)
1211 (wmclass-class string))
1213 (defbinding window-add-accel-group () nil
1215 (accel-group accel-group))
1217 (defbinding window-remove-accel-group () nil
1219 (accel-group accel-group))
1221 (defbinding window-activate-focus () int
1224 (defbinding window-activate-default () int
1227 (defbinding window-set-default-size (window width height) int
1230 ((or height -1) int))
1232 (defbinding %window-set-geometry-hints () nil
1234 (geometry gdk:geometry)
1235 (geometry-mask gdk:window-hints))
1237 (defun window-set-geometry-hints (window &key min-width min-height
1238 max-width max-height base-width base-height
1239 width-inc height-inc min-aspect max-aspect
1240 (gravity nil gravity-p) min-size max-size)
1241 (let ((geometry (make-instance 'gdk:geometry
1242 :min-width (or min-width -1)
1243 :min-height (or min-height -1)
1244 :max-width (or max-width -1)
1245 :max-height (or max-height -1)
1246 :base-width (or base-width 0)
1247 :base-height (or base-height 0)
1248 :width-inc (or width-inc 0)
1249 :height-inc (or height-inc 0)
1250 :min-aspect (or min-aspect 0)
1251 :max-aspect (or max-aspect 0)
1254 (when (or min-size min-width min-height)
1255 (push :min-size mask))
1256 (when (or max-size max-width max-height)
1257 (push :max-size mask))
1258 (when (or base-width base-height)
1259 (push :base-size mask))
1260 (when (or width-inc height-inc)
1261 (push :resize-inc mask))
1262 (when (or min-aspect max-aspect)
1263 (push :aspect mask))
1265 (push :win-gravity mask))
1266 (%window-set-geometry-hints window geometry mask)))
1268 (defbinding window-list-toplevels () (glist (copy-of window))
1269 "Returns a list of all existing toplevel windows.")
1271 (defbinding window-add-mnemonic (window key target) nil
1273 ((gdk:keyval-from-name key) unsigned-int)
1276 (defbinding window-remove-mnemonic (window key target) nil
1278 ((gdk:keyval-from-name key) unsigned-int)
1281 (defbinding window-mnemonic-activate (window key modifier) nil
1283 ((gdk:keyval-from-name key) unsigned-int)
1284 (modifier gdk:modifier-type))
1286 (defbinding window-activate-key () boolean
1288 (event gdk:key-event))
1290 (defbinding window-propagate-key-event () boolean
1292 (event gdk:key-event))
1295 (defbinding window-present () nil
1300 (defbinding %window-present () nil
1303 (defbinding %window-present-with-time () nil
1305 (timespamp unsigned-int))
1307 (defun window-present (window &optional timestamp)
1309 (%window-present-with-time window timestamp)
1310 (%window-present window))))
1312 (defbinding window-iconify () nil
1315 (defbinding window-deiconify () nil
1318 (defbinding window-stick () nil
1321 (defbinding window-unstick () nil
1324 (defbinding window-maximize () nil
1327 (defbinding window-unmaximize () nil
1330 (defbinding window-fullscreen () nil
1333 (defbinding window-unfullscreen () nil
1336 (defbinding window-set-keep-above () nil
1340 (defbinding window-set-keep-below () nil
1344 (defbinding window-begin-resize-drag () nil
1346 (edge gdk:window-edge)
1348 (root-x int) (root-y int)
1349 (timestamp unsigned-int))
1351 (defbinding window-begin-move-drag () nil
1353 (edge gdk:window-edge)
1355 (root-x int) (root-y int)
1356 (timestamp unsigned-int))
1358 (defbinding window-set-frame-dimensions () nil
1360 (left int) (top int) (rigth int) (bottom int))
1362 (defbinding %window-get-default-size () nil
1367 (defun window-get-default-size (window)
1368 (multiple-value-bind (width height) (%window-get-default-size window)
1369 (values (unless (= width -1) width) (unless (= height -1) height))))
1371 (defbinding window-get-frame-dimensions () nil
1373 (left int :out) (top int :out) (rigth int :out) (bottom int :out))
1375 (defbinding %window-get-icon-list () (glist (copy-of gdk:pixbuf))
1378 (defbinding window-get-position () nil
1383 (defbinding window-get-size () nil
1388 (defbinding window-move () nil
1393 (defbinding window-parse-geometry () boolean
1397 (defbinding window-reshow-with-initial-size () nil
1400 (defbinding window-resize () nil
1405 (defbinding (window-default-icon-list "gtk_window_get_default_icon_list")
1406 () (glist gdk:pixbuf))
1408 (defun window-default-icon ()
1409 (first (window-default-icon-list)))
1411 (defbinding %window-set-default-icon-list () nil
1412 (icons (glist gdk:pixbuf)))
1414 (defun (setf window-default-icon-list) (icons)
1415 (%window-set-default-icon-list icons)
1418 (defbinding %window-set-default-icon () nil
1419 (icons (glist gdk:pixbuf)))
1421 (defmethod (setf window-default-icon) ((icon gdk:pixbuf))
1422 (%window-set-default-icon icon)
1425 (defmethod (setf window-group) ((group window-group) (window window))
1426 (window-group-add-window group window)
1429 (defbinding %window-set-default-icon-from-file () boolean
1433 (defmethod (setf window-default-icon) ((icon-file pathname))
1434 (%window-set-default-icon-from-file icon-file)
1437 (defbinding %window-set-icon-from-file () boolean
1442 (defmethod (setf window-icon) ((icon-file pathname) (window window))
1443 (%window-set-icon-from-file window icon-file)
1446 (defbinding window-set-auto-startup-notification () nil
1449 (defbinding decorated-window-init () nil
1452 (defbinding decorated-window-calculate-frame-size () nil
1455 (defbinding decorated-window-set-title () nil
1459 (defbinding decorated-window-move-resize-window () nil
1469 (defmethod initialize-instance ((window-group window-group) &rest initargs
1470 &key window windows)
1471 (declare (ignore window windows))
1474 (initial-add window-group #'window-group-add-window
1475 initargs :window :windows)))
1478 (defbinding window-group-add-window () nil
1479 (window-group window-group)
1482 (defbinding window-group-remove-window () nil
1483 (window-group window-group)
1489 (defun (setf scrolled-window-scrollbar-policy) (policy window)
1490 (setf (scrolled-window-hscrollbar-policy window) policy)
1491 (setf (scrolled-window-vscrollbar-policy window) policy))
1493 (defbinding scrolled-window-add-with-viewport () nil
1494 (scrolled-window scrolled-window)
1497 (defmethod shared-initialize ((window scrolled-window) names &key policy)
1498 (declare (ignore names))
1500 (setf (slot-value window 'hscrollbar-policy) policy)
1501 (setf (slot-value window 'vscrollbar-policy) policy))
1507 (defbinding statusbar-get-context-id () unsigned-int
1508 (statusbar statusbar)
1509 (context-description string))
1511 (defbinding statusbar-push () unsigned-int
1512 (statusbar statusbar)
1513 (context-id unsigned-int)
1516 (defbinding statusbar-pop () nil
1517 (statusbar statusbar)
1518 (context-id unsigned-int))
1520 (defbinding statusbar-remove () nil
1521 (statusbar statusbar)
1522 (context-id unsigned-int)
1523 (message-id unsigned-int))
1529 (defbinding fixed-put () nil
1534 (defbinding fixed-move () nil
1543 (defun %ensure-notebook-position (notebook page)
1546 (widget (notebook-page-num notebook page t))))
1548 (defun %ensure-notebook-child (notebook position)
1551 (t (notebook-get-nth-page notebook position))))
1553 (defbinding (notebook-insert "gtk_notebook_insert_page_menu")
1554 (notebook position child tab-label &optional menu-label) nil
1557 ((if (stringp tab-label)
1558 (make-instance 'label :label tab-label)
1560 ((if (stringp menu-label)
1561 (make-instance 'label :label menu-label)
1562 menu-label) (or null widget))
1563 ((%ensure-notebook-position notebook position) position))
1565 (defun notebook-append (notebook child tab-label &optional menu-label)
1566 (notebook-insert notebook :last child tab-label menu-label))
1568 (defun notebook-prepend (notebook child tab-label &optional menu-label)
1569 (notebook-insert notebook :first child tab-label menu-label))
1571 (defbinding notebook-remove-page (notebook page) nil
1573 ((%ensure-notebook-position notebook page) position))
1575 (defbinding %notebook-page-num () int
1579 (defun notebook-page-num (notebook child &optional error-p)
1580 (let ((page-num (%notebook-page-num notebook child)))
1583 (error "~A is not a page in ~A" child notebook))
1586 (defbinding notebook-next-page () nil
1587 (notebook notebook))
1589 (defbinding notebook-prev-page () nil
1590 (notebook notebook))
1592 (defbinding notebook-reorder-child (notebook child position) nil
1595 ((%ensure-notebook-position notebook position) int))
1597 (defbinding notebook-popup-enable () nil
1598 (notebook notebook))
1600 (defbinding notebook-popup-disable () nil
1601 (notebook notebook))
1603 (defbinding notebook-get-nth-page () widget
1607 (defun %notebook-current-page (notebook)
1608 (when (slot-boundp notebook 'current-page-num)
1609 (notebook-get-nth-page notebook (notebook-current-page-num notebook))))
1611 (defun (setf notebook-current-page) (page notebook)
1612 (setf (notebook-current-page notebook) (notebook-page-num notebook page)))
1614 (defbinding (notebook-tab-label "gtk_notebook_get_tab_label")
1615 (notebook page) widget
1617 ((%ensure-notebook-child notebook page) widget))
1619 (defbinding (notebook-tab-label-text "gtk_notebook_get_tab_label_text")
1620 (notebook page) (copy-of string)
1622 ((%ensure-notebook-child notebook page) widget))
1624 (defbinding %notebook-set-tab-label () nil
1629 (defun (setf notebook-tab-label) (tab-label notebook page)
1630 (let ((widget (if (stringp tab-label)
1631 (make-instance 'label :label tab-label)
1633 (%notebook-set-tab-label notebook (%ensure-notebook-child notebook page) widget)
1637 (defbinding (notebook-menu-label "gtk_notebook_get_menu_label")
1638 (notebook page) widget
1640 ((%ensure-notebook-child notebook page) widget))
1642 (defbinding (notebook-menu-label-text "gtk_notebook_get_menu_label_text")
1643 (notebook page) (copy-of string)
1645 ((%ensure-notebook-child notebook page) widget))
1647 (defbinding %notebook-set-menu-label () nil
1650 (menu-label widget))
1652 (defun (setf notebook-menu-label) (menu-label notebook page)
1653 (let ((widget (if (stringp menu-label)
1654 (make-instance 'label :label menu-label)
1656 (%notebook-set-menu-label notebook (%ensure-notebook-child notebook page) widget)
1660 (defbinding notebook-query-tab-label-packing (notebook page) nil
1662 ((%ensure-notebook-child notebook page) widget)
1663 (expand boolean :out)
1665 (pack-type pack-type :out))
1667 (defbinding notebook-set-tab-label-packing
1668 (notebook page expand fill pack-type) nil
1670 ((%ensure-notebook-child notebook page) widget)
1673 (pack-type pack-type))
1679 (defbinding paned-pack1 () nil
1685 (defbinding paned-pack2 () nil
1694 (defbinding layout-put () nil
1700 (defbinding layout-move () nil
1706 (defbinding layout-set-size () nil
1708 (width unsigned-int)
1709 (height unsigned-int))
1711 (defbinding layout-get-size () nil
1713 (width unsigned-int :out)
1714 (height unsigned-int :out))
1719 (defbinding menu-shell-insert (menu-shell menu-item position) nil
1720 (menu-shell menu-shell)
1721 (menu-item menu-item)
1727 (defun menu-shell-append (menu-shell menu-item)
1728 (menu-shell-insert menu-shell menu-item :last))
1730 (defun menu-shell-prepend (menu-shell menu-item)
1731 (menu-shell-insert menu-shell menu-item :fisrt))
1733 (defbinding menu-shell-deactivate () nil
1734 (menu-shell menu-shell))
1736 (defbinding menu-shell-select-item () nil
1737 (menu-shell menu-shell)
1738 (menu-item menu-item))
1740 (defbinding menu-shell-select-first () nil
1741 (menu-shell menu-shell)
1742 (search-sensitive boolean))
1744 (defbinding menu-shell-deselect () nil
1745 (menu-shell menu-shell))
1747 (defbinding menu-shell-activate-item () nil
1748 (menu-shell menu-shell)
1749 (menu-item menu-item)
1750 (fore-deactivate boolean))
1752 (defbinding menu-shell-cancel () nil
1753 (menu-shell menu-shell))
1758 (defun %menu-position (menu child)
1761 (keyword (case child
1764 (t (error "Invalid position keyword: ~A" child))))
1765 (widget (menu-child-position menu child))))
1768 (defbinding menu-reorder-child (menu menu-item position) nil
1770 (menu-item menu-item)
1771 ((%menu-position menu position) int))
1773 (defbinding menu-attach () nil
1775 (menu-item menu-item)
1776 (left-attach unsigned-int)
1777 (right-attach unsigned-int)
1778 (top-attach unsigned-int)
1779 (bottom-attach unsigned-int))
1781 (def-callback-marshal %menu-position-func (nil (menu menu) (x int) (y int) (push-in boolean)))
1783 (defbinding %menu-popup () nil
1785 (parent-menu-shell (or null menu-shell))
1786 (parent-menu-item (or null menu-item))
1787 (callback-func (or null pointer))
1788 (callback-id unsigned-int)
1789 (button unsigned-int)
1790 (activate-time (unsigned 32)))
1792 (defun menu-popup (menu button activate-time &key callback parent-menu-shell
1795 (with-callback-function (id callback)
1797 menu parent-menu-shell parent-menu-item
1798 (callback %menu-position-func) id button activate-time))
1800 menu parent-menu-shell parent-menu-item nil 0 button activate-time)))
1802 (defbinding menu-set-accel-path () nil
1804 (accel-path string))
1806 (defbinding menu-reposition () nil
1809 (defbinding menu-popdown () nil
1812 (defun menu-child-position (menu child)
1813 (position child (container-children menu)))
1815 (defun menu-active-num (menu)
1816 (menu-child-position menu (menu-active menu)))
1818 (defbinding %menu-set-active () nil
1820 (index unsigned-int))
1822 (defun (setf menu-active) (menu child)
1823 (%menu-set-active menu (%menu-position menu child))
1826 (defcallback %menu-detach-func (nil (widget widget) (menu menu))
1827 (funcall (object-data menu 'detach-func) widget menu))
1829 (defbinding %menu-attach-to-widget () nil
1832 ((callback %menu-detach-func) pointer))
1834 (defun menu-attach-to-widget (menu widget function)
1835 (setf (object-data menu 'detach-func) function)
1836 (%menu-attach-to-widget menu widget))
1838 (defbinding menu-detach () nil
1842 (defbinding menu-get-for-attach-widget () (copy-of (glist widget))
1845 (defbinding menu-set-monitor () nil
1852 (defbinding table-resize () nil
1855 (columns unsigned-int))
1857 (defbinding table-attach (table child left right top bottom
1858 &key options x-options y-options
1859 (x-padding 0) (y-padding 0)) nil
1863 (right unsigned-int)
1865 (bottom unsigned-int)
1866 ((append (mklist options) (mklist x-options)) attach-options)
1867 ((append (mklist options) (mklist y-options)) attach-options)
1868 (x-padding unsigned-int)
1869 (y-padding unsigned-int))
1872 (defbinding %table-set-row-spacing () nil
1875 (spacing unsigned-int))
1877 (defbinding %table-set-row-spacings () nil
1879 (spacing unsigned-int))
1881 (defun (setf table-row-spacing) (spacing table &optional row)
1883 (%table-set-row-spacing table row spacing)
1884 (%table-set-row-spacings table spacing))
1887 (defbinding %table-get-row-spacing () unsigned-int
1891 (defbinding %table-get-default-row-spacing () unsigned-int
1894 (defun table-row-spacing (table &optional row)
1896 (%table-get-row-spacing table row)
1897 (%table-get-default-row-spacing table)))
1900 (defbinding %table-set-col-spacing () nil
1903 (spacing unsigned-int))
1905 (defbinding %table-set-col-spacings () nil
1907 (spacing unsigned-int))
1909 (defun (setf table-col-spacing) (spacing table &optional col)
1911 (%table-set-col-spacing table col spacing)
1912 (%table-set-col-spacings table spacing))
1915 (defbinding %table-get-col-spacing () unsigned-int
1919 (defbinding %table-get-default-col-spacing () unsigned-int
1922 (defun table-col-spacing (table &optional col)
1924 (%table-get-col-spacing table col)
1925 (%table-get-default-col-spacing table)))
1931 (defmethod initialize-instance ((toolbar toolbar) &rest initargs &key tooltips)
1933 (apply #'call-next-method toolbar
1934 :tooltips (make-instance 'tooltips) initargs)
1935 (call-next-method)))
1937 (defbinding %toolbar-insert () nil
1939 (tool-item tool-item)
1940 (position position))
1942 (defun toolbar-insert (toolbar tool-item &optional (position :end))
1943 (%toolbar-insert toolbar tool-item position)
1944 (%tool-item-update-tooltips tool-item))
1946 (defbinding toolbar-get-item-index () int
1950 (defbinding toolbar-get-nth-item () tool-item
1954 (defbinding toolbar-get-drop-index () int
1958 (defbinding toolbar-set-drop-highlight-item () nil
1960 (tool-item tool-item)
1966 (defmethod initialize-instance ((button tool-button) &rest initargs &key icon)
1967 (if (and icon (not (typep icon 'widget)))
1968 (apply #'call-next-method button :icon (create-image-widget icon) initargs)
1969 (call-next-method)))
1974 (defbinding tool-item-set-tooltip () nil
1975 (tool-item tool-item)
1978 (tip-private string))
1981 (defun %tool-item-update-tooltips (tool-item)
1983 (slot-boundp tool-item 'parent)
1985 (user-data-p tool-item 'tip-text)
1986 (user-data-p tool-item 'tip-private)))
1987 (tool-item-set-tooltip
1988 tool-item (toolbar-tooltips (widget-parent tool-item))
1989 (or (user-data tool-item 'tip-text) "")
1990 (or (user-data tool-item 'tip-private) ""))))
1992 (defmethod (setf tool-item-tip-text) ((tip-text string) (tool-item tool-item))
1993 (setf (user-data tool-item 'tip-text) tip-text)
1994 (%tool-item-update-tooltips tool-item)
1997 (defmethod (setf tool-item-tip-private) ((tip-private string) (tool-item tool-item))
1998 (setf (user-data tool-item 'tip-private) tip-private)
1999 (%tool-item-update-tooltips tool-item)
2002 (defmethod container-add ((toolbar toolbar) (tool-item tool-item) &rest args)
2003 (declare (ignore args))
2006 (%tool-item-update-tooltips tool-item)))
2009 (defbinding tool-item-retrieve-proxy-menu-item () widget
2010 (tool-item tool-item))
2012 (defbinding (tool-item-proxy-menu-item
2013 "gtk_tool_item_get_proxy_menu_item") () menu-item
2014 (tool-item tool-item)
2015 (menu-item-id string))
2017 (defbinding %tool-item-set-proxy-menu-item () nil
2018 (tool-item tool-item)
2019 (menu-item-id string)
2020 (menu-item menu-item))
2022 (defun (setf tool-item-proxy-menu-item) (menu-item menu-item-id tool-item)
2023 (%tool-item-set-proxy-menu-item menu-item-id tool-item menu-item)
2027 (defbinding tool-item-rebuild-menu () nil
2028 (tool-item tool-item))
2033 (defbinding editable-select-region (editable &optional (start 0) end) nil
2038 (defbinding editable-get-selection-bounds (editable) nil
2043 (defbinding editable-insert-text (editable text &optional (position 0)) nil
2047 (position position :in-out))
2049 (defun editable-append-text (editable text)
2050 (editable-insert-text editable text nil))
2052 (defun editable-prepend-text (editable text)
2053 (editable-insert-text editable text 0))
2055 (defbinding editable-delete-text (editable &optional (start 0) end) nil
2060 (defbinding (editable-text "gtk_editable_get_chars")
2061 (editable &optional (start 0) end) string
2066 (defun (setf editable-text) (text editable)
2068 (editable-delete-text
2070 (editable-insert-text editable text))
2071 (editable-delete-text editable))
2074 (defbinding editable-cut-clipboard () nil
2075 (editable editable))
2077 (defbinding editable-copy-clipboard () nil
2078 (editable editable))
2080 (defbinding editable-paste-clipboard () nil
2081 (editable editable))
2083 (defbinding editable-delete-selection () nil
2084 (editable editable))
2090 (defbinding spin-button-configure () nil
2091 (spin-button spin-button)
2092 (adjustment adjustment)
2093 (climb-rate double-float)
2094 (digits unsigned-int))
2096 (defbinding spin-button-set-range () nil
2097 (spin-button spin-button)
2101 (defbinding spin-button-get-range () nil
2102 (spin-button spin-button)
2103 (min double-float :out)
2104 (max double-float :out))
2106 (defun spin-button-value-as-int (spin-button)
2107 (round (spin-button-value spin-button)))
2109 (defbinding %spin-button-spin () nil
2110 (spin-button spin-button)
2111 (direction spin-type)
2112 (increment double-float))
2114 (defun spin-button-spin (spin-button value)
2116 (real (%spin-button-spin spin-button :spin-user-defined value))
2117 (spin-type (%spin-button-spin spin-button value 0))))
2120 (defbinding spin-button-update () nil
2121 (spin-button spin-button))
2127 (defbinding ruler-set-range () nil
2129 (lower single-float)
2130 (upper single-float)
2131 (position single-float)
2132 (max-size single-float))
2134 (defbinding ruler-get-range () nil
2136 (lower single-float :out)
2137 (upper single-float :out)
2138 (position single-float :out)
2139 (max-size single-float :out))
2145 (defun range-lower (range)
2146 (adjustment-lower (range-adjustment range)))
2148 (defun range-upper (range)
2149 (adjustment-upper (range-adjustment range)))
2151 (defun (setf range-lower) (value range)
2152 (setf (adjustment-lower (range-adjustment range)) value))
2154 (defun (setf range-upper) (value range)
2155 (setf (adjustment-upper (range-adjustment range)) value))
2157 (defun range-page-increment (range)
2158 (adjustment-page-increment (range-adjustment range)))
2160 (defun range-step-increment (range)
2161 (adjustment-step-increment (range-adjustment range)))
2163 (defun (setf range-page-increment) (value range)
2164 (setf (adjustment-page-increment (range-adjustment range)) value))
2166 (defun (setf range-step-increment) (value range)
2167 (setf (adjustment-step-increment (range-adjustment range)) value))
2169 (defbinding range-set-range () nil
2171 (lower double-float)
2172 (upper double-float))
2174 (defbinding range-set-increments () nil
2177 (page double-float))
2182 (defbinding scale-get-layout-offsets () nil
2190 (defbinding progress-bar-pulse () nil
2191 (progress-bar progress-bar))
2196 (defmethod initialize-instance ((size-group size-group) &rest initargs
2197 &key widget widgets)
2198 (declare (ignore widget widgets))
2201 (initial-add size-group #'size-group-add-widget
2202 initargs :widget :widgets)))
2205 (defbinding size-group-add-widget () nil
2206 (size-group size-group)
2209 (defbinding size-group-remove-widget () nil
2210 (size-group size-group)
2216 (defbinding %stock-item-copy () pointer
2219 (defbinding %stock-item-free () nil
2222 (defmethod reference-foreign ((class (eql (find-class 'stock-item))) location)
2223 (%stock-item-copy location))
2225 (defmethod unreference-foreign ((class (eql (find-class 'stock-item))) location)
2226 (%stock-item-free location))
2228 (defbinding stock-add (stock-item) nil
2229 (stock-item stock-item)
2232 (defbinding stock-list-ids () (gslist string))
2234 (defbinding %stock-lookup () boolean
2238 (defun stock-lookup (stock-id)
2240 (allocate-memory (foreign-size (find-class 'stock-item)))))
2242 (when (%stock-lookup stock-id location)
2243 (ensure-proxy-instance 'stock-item (%stock-item-copy location)))
2244 (deallocate-memory location))))
2249 (defbinding tooltips-enable () nil
2250 (tooltips tooltips))
2252 (defbinding tooltips-disable () nil
2253 (tooltips tooltips))
2255 (defun (setf tooltips-enabled-p) (enable tooltips)
2257 (tooltips-enable tooltips)
2258 (tooltips-disable tooltips)))
2260 (defbinding tooltips-set-tip () nil
2264 (tip-private string))
2266 (defbinding tooltips-data-get () tooltips-data
2269 (defbinding tooltips-force-window () nil
2270 (tooltips tooltips))
2272 (defbinding tooltips-get-info-from-tip-window () boolean
2274 (tooltips tooltips :out)
2275 (current-widget widget :out))
2280 (defbinding rc-add-default-file (filename) nil
2281 ((namestring (truename filename)) string))
2283 (defbinding rc-parse (filename) nil
2284 ((namestring (truename filename)) string))
2286 (defbinding rc-parse-string () nil
2289 (defbinding rc-reparse-all () nil)
2291 (defbinding rc-get-style () style