1 ;; Common Lisp bindings for GTK+ v2.0
2 ;; Copyright (C) 1999-2001 Espen S. Johnsen <esj@stud.cs.uit.no>
4 ;; This library is free software; you can redistribute it and/or
5 ;; modify it under the terms of the GNU Lesser General Public
6 ;; License as published by the Free Software Foundation; either
7 ;; version 2 of the License, or (at your option) any later version.
9 ;; This library is distributed in the hope that it will be useful,
10 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ;; Lesser General Public License for more details.
14 ;; You should have received a copy of the GNU Lesser General Public
15 ;; License along with this library; if not, write to the Free Software
16 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 ;; $Id: gtk.lisp,v 1.12 2002-04-02 15:03:47 espen Exp $
25 (defbinding check-version () string
26 (required-major unsigned-int)
27 (required-minor unsigned-int)
28 (required-micro unsigned-int))
30 (defbinding query-version () nil
31 (major unsigned-int :out)
32 (minor unsigned-int :out)
33 (micro unsigned-int :out))
36 (multiple-value-bind (major minor micro)
39 (format nil "Gtk+ v~A.~A" major minor)
40 (format nil "Gtk+ v~A.~A.~A" major minor micro))))
42 (defbinding get-default-language () string)
50 (defbinding accel-label-refetch () boolean
51 (accel-label accel-label))
56 (defbinding adjustment-changed () nil
57 (adjustment adjustment))
59 (defbinding adjustment-value-changed () nil
60 (adjustment adjustment))
62 (defbinding adjustment-clamp-page () nil
63 (adjustment adjustment)
68 ;;; Arrow -- no functions
77 (defun (setf bin-child) (child bin)
78 (when-bind (current-child (bin-child bin))
79 (container-remove bin current-child))
80 (container-add bin child)
90 (defbinding box-pack-start () nil
95 (padding unsigned-int))
97 (defbinding box-pack-end () nil
102 (padding unsigned-int))
104 (defun box-pack (box child &key from-end (expand t) (fill t) (padding 0))
106 (box-pack-end box child expand fill padding)
107 (box-pack-start box child expand fill padding)))
109 (defbinding box-reorder-child () nil
114 (defbinding box-query-child-packing () nil
117 (expand boolean :out)
119 (padding unsigned-int :out)
120 (pack-type pack-type :out))
122 (defbinding box-set-child-packing () nil
127 (padding unsigned-int)
128 (pack-type pack-type))
134 (defbinding button-pressed () nil
137 (defbinding button-released () nil
140 (defbinding button-clicked () nil
143 (defbinding button-enter () nil
146 (defbinding button-leave () nil
153 (defbinding calendar-select-month () int
158 (defbinding calendar-select-day () nil
162 (defbinding calendar-mark-day () int
166 (defbinding calendar-unmark-day () int
170 (defbinding calendar-clear-marks () nil
173 (defbinding calendar-display-options () nil
175 (options calendar-display-options))
177 (defbinding (calendar-date "gtk_calendar_get_date") () nil
179 (year unsigned-int :out)
180 (month unsigned-int :out)
181 (day unsigned-int :out))
183 (defbinding calendar-freeze () nil
186 (defbinding calendar-thaw () nil
199 ;;; Cell renderer pixbuf -- no functions
203 ;;; Cell renderer text
207 ;;; Cell renderer toggle -- no functions
211 ;;; Check button -- no functions
217 (defbinding check-menu-item-toggled () nil
218 (check-menu-item check-menu-item))
227 (defbinding (color-selection-is-adjusting-p
228 "gtk_color_selection_is_adjusting") () boolean
229 (colorsel color-selection))
233 ;;; Color selection dialog -- no functions
239 (defmethod shared-initialize ((combo combo) names &rest initargs
240 &key popdown-strings)
242 (when popdown-strings
243 (combo-set-popdown-strings combo popdown-strings)))
245 (defbinding combo-set-popdown-strings () nil
247 (strings (glist string)))
249 (defbinding combo-disable-activate () nil
256 (defmethod shared-initialize ((dialog dialog) names &rest initargs)
258 (dolist (button-definition (get-all initargs :button))
259 (apply #'dialog-add-button dialog button-definition)))
262 (defvar %*response-id-key* (gensym))
264 (defun %dialog-find-response-id-num (dialog response-id &optional create-p error-p)
266 (cadr (assoc response-id (rest (type-expand-1 'response-type))))
267 (let* ((response-ids (object-data dialog %*response-id-key*))
268 (response-id-num (position response-id response-ids)))
274 (setf (cdr (last response-ids)) (list response-id))
275 (1- (length response-ids)))
277 (setf (object-data dialog %*response-id-key*) (list response-id))
280 (error "Invalid response: ~A" response-id))))))
282 (defun %dialog-find-response-id (dialog response-id-num)
283 (if (< response-id-num 0)
286 (list response-id-num)
287 (rest (type-expand-1 'response-type)) :test #'equalp))
288 (nth response-id-num (object-data dialog %*response-id-key*))))
291 (defmethod signal-connect ((dialog dialog) signal function &key object after)
292 (let ((response-id-num (%dialog-find-response-id-num dialog signal)))
297 #'(lambda (dialog id)
298 (when (= id response-id-num)
300 ((eq object t) (funcall function dialog))
301 (object (funcall function object))
302 (t (funcall function)))))
303 :object t :after after))
305 (call-next-method)))))
308 (defbinding dialog-run () nil
311 (defbinding dialog-response (dialog response-id) nil
313 ((%dialog-find-response-id-num dialog response-id nil t) int))
316 (defbinding %dialog-add-button () button
319 (response-id-num int))
321 (defun dialog-add-button (dialog label &optional response-id default-p)
322 (let* ((response-id-num
324 (%dialog-find-response-id-num dialog response-id t)
325 (length (object-data dialog %*response-id-key*))))
326 (button (%dialog-add-button dialog label response-id-num)))
328 (%dialog-find-response-id-num dialog button t))
330 (%dialog-set-default-response dialog response-id-num))
334 (defbinding %dialog-add-action-widget () button
336 (action-widget widget)
337 (response-id-num int))
339 (defun dialog-add-action-widget (dialog widget &optional (response-id widget)
341 (let ((response-id-num (%dialog-find-response-id-num dialog response-id t)))
342 (%dialog-add-action-widget dialog widget response-id-num)
344 (%dialog-set-default-response dialog response-id-num))
348 (defbinding %dialog-set-default-response () nil
350 (response-id-num int))
352 (defun dialog-set-default-response (dialog response-id)
353 (%dialog-set-default-response
354 dialog (%dialog-find-response-id-num dialog response-id nil t)))
356 (defbinding dialog-set-response-sensitive (dialog response-id sensitive) nil
358 ((%dialog-find-response-id-num dialog response-id nil t) int)
362 ;; Addition dialog functions
364 (defmethod container-add ((dialog dialog) (child widget) &rest args)
365 (apply #'container-add (slot-value dialog 'main-area) child args))
367 (defmethod container-remove ((dialog dialog) (child widget))
368 (container-remove (slot-value dialog 'main-area) child))
370 (defmethod container-children ((dialog dialog))
371 (container-children (dialog-main-area dialog)))
373 (defmethod (setf container-children) (children (dialog dialog))
374 (setf (container-children (dialog-main-area dialog)) children))
378 ;;; Drawing area -- no functions
383 (defbinding entry-get-layout () pango:layout
386 (defbinding entry-get-layout-offsets () nil
395 (defbinding label-get-layout-offsets () nil
400 (defbinding label-select-region () nil
405 (defbinding label-get-text () string
408 (defbinding label-get-layout () pango:layout
411 (defbinding label-get-selection-bounds () boolean
420 (defbinding %radio-button-get-group () pointer
421 (radio-button radio-button))
423 (defbinding %radio-button-set-group () nil
424 (radio-button radio-button)
427 (defun radio-button-add-to-group (button1 button2)
428 "Add BUTTON1 to the group which BUTTON2 belongs to."
429 (%radio-button-set-group button1 (%radio-button-get-group button2)))
432 (defmethod initialize-instance ((button radio-button)
433 &rest initargs &key group-with)
434 (declare (ignore initargs))
437 (radio-button-add-to-group button group-with)))
442 (defbinding %option-menu-set-menu () nil
443 (option-menu option-menu)
446 (defbinding %option-menu-remove-menu () nil
447 (option-menu option-menu))
449 (defun (setf option-menu-menu) (menu option-menu)
451 (%option-menu-remove-menu option-menu)
452 (%option-menu-set-menu option-menu menu))
459 (defbinding item-select () nil
462 (defbinding item-deselect () nil
465 (defbinding item-toggle () nil
472 (defun (setf menu-item-label) (label menu-item)
473 (make-instance 'accel-label
474 :label label :xalign 0.0 :yalign 0.5 :accel-widget menu-item
475 :visible t :parent menu-item)
478 (defun menu-item-label (menu-item)
479 (with-slots (child) menu-item
480 (when (typep child 'label)
481 (label-label child))))
483 (defbinding %menu-item-set-submenu () nil
484 (menu-item menu-item)
487 (defbinding %menu-item-remove-submenu () nil
488 (menu-item menu-item))
490 (defun (setf menu-item-submenu) (submenu menu-item)
492 (%menu-item-remove-submenu menu-item)
493 (%menu-item-set-submenu menu-item submenu))
496 (defbinding menu-item-set-accel-path () nil
497 (menu-item menu-item)
500 (defbinding menu-item-select () nil
501 (menu-item menu-item))
503 (defbinding menu-item-deselect () nil
504 (menu-item menu-item))
506 (defbinding menu-item-activate () nil
507 (menu-item menu-item))
509 (defbinding menu-item-toggle-size-request () nil
510 (menu-item menu-item)
511 (requisition int :out))
513 (defbinding menu-item-toggle-size-allocate () nil
514 (menu-item menu-item)
521 (defbinding %radio-menu-item-get-group () pointer
522 (radio-menu-item radio-menu-item))
524 (defbinding %radio-menu-item-set-group () nil
525 (radio-menu-item radio-menu-item)
528 (defun radio-menu-item-add-to-group (item1 item2)
529 "Add ITEM1 to the group which ITEM2 belongs to."
530 (%radio-menu-item-set-group item1 (%radio-menu-item-get-group item2)))
532 (defmethod initialize-instance ((item radio-menu-item)
533 &rest initargs &key group-with)
534 (declare (ignore initargs))
538 (radio-menu-item-add-to-group item group-with))))
544 (defbinding toggle-button-toggled () nil
545 (toggle-button toggle-button))
551 (defbinding window-set-wmclass () nil
553 (wmclass-name string)
554 (wmclass-class string))
556 (defbinding window-add-accel-group () nil
558 (accel-group accel-group))
560 (defbinding window-remove-accel-group () nil
562 (accel-group accel-group))
564 (defbinding window-activate-focus () int
567 (defbinding window-activate-default () int
570 (defbinding window-set-default-size (window width height) int
573 ((or height -1) int))
575 ;(defbinding window-set-geometry-hints)
577 (defbinding window-list-toplevels () (glist window))
579 (defbinding window-add-mnemonic (window key target) nil
581 ((gdk:keyval-from-name key) unsigned-int)
584 (defbinding window-remove-mnemonic (window key target) nil
586 ((gdk:keyval-from-name key) unsigned-int)
589 (defbinding window-mnemonic-activate (window key modifier) nil
591 ((gdk:keyval-from-name key) unsigned-int)
592 (modifier gdk:modifier-type))
594 (defbinding window-present () nil
597 (defbinding window-iconify () nil
600 (defbinding window-deiconify () nil
603 (defbinding window-stick () nil
606 (defbinding window-unstick () nil
609 (defbinding window-maximize () nil
612 (defbinding window-unmaximize () nil
615 (defbinding window-begin-resize-drag () nil
617 (edge gdk:window-edge)
619 (root-x int) (root-y int)
620 (timestamp (unsigned-int 32)))
622 (defbinding window-begin-move-drag () nil
624 (edge gdk:window-edge)
626 (root-x int) (root-y int)
627 (timestamp (unsigned-int 32)))
629 (defbinding window-set-frame-dimensions () nil
631 (left int) (top int) (rigth int) (bottom int))
633 (defbinding (window-default-icons "gtk_window_get_default_icon_list")
634 () (glist gdk:pixbuf))
636 (defbinding %window-get-default-size () nil
641 (defun window-get-default-size (window)
642 (multiple-value-bind (width height) (%window-get-default-size window)
643 (values (unless (= width -1) width) (unless (= height -1) height))))
645 (defbinding window-get-frame-dimensions () nil
647 (left int :out) (top int :out) (rigth int :out) (bottom int :out))
649 (defbinding %window-get-icon-list () (glist gdk:pixbuf)
652 (defmethod window-icon ((window window))
653 (let ((icon-list (%window-get-icon-list window)))
654 (if (endp (rest icon-list))
658 (defbinding window-get-position () nil
663 (defbinding window-get-size () nil
668 (defbinding window-move () nil
673 (defbinding window-parse-geometry () boolean
677 (defbinding window-reshow-with-initial-size () nil
680 (defbinding window-resize () nil
685 (defbinding %window-set-icon-list () nil
687 (icon-list (glist gdk:pixbuf)))
689 (defmethod (setf window-icon) (icon (window window))
690 (%window-set-icon-list window (mklist icon)))
697 (defbinding file-selection-complete () nil
698 (file-selection file-selection)
705 (defun (setf scrolled-window-scrollbar-policy) (policy window)
706 (setf (scrolled-window-hscrollbar-policy window) policy)
707 (setf (scrolled-window-vscrollbar-policy window) policy))
709 (defbinding scrolled-window-add-with-viewport () nil
710 (scrolled-window scrolled-window)
721 (defbinding (statusbar-context-id "gtk_statusbar_get_context_id")
723 (statusbar statusbar)
724 (context-description string))
726 (defbinding statusbar-push () unsigned-int
727 (statusbar statusbar)
728 (context-id unsigned-int)
731 (defbinding statusbar-pop () nil
732 (statusbar statusbar)
733 (context-id unsigned-int))
735 (defbinding statusbar-remove () nil
736 (statusbar statusbar)
737 (context-id unsigned-int)
738 (message-id unsigned-int))
744 (defbinding fixed-put () nil
749 (defbinding fixed-move () nil
758 (defun %notebook-position (notebook page)
764 (error "Invalid position keyword: ~A" page)))
765 (widget (notebook-page-num notebook page t))))
767 (defun %notebook-child (notebook position)
770 (t (notebook-nth-page-child notebook position))))
773 (defbinding (notebook-insert "gtk_notebook_insert_page_menu")
774 (notebook position child tab-label &optional menu-label) nil
777 ((if (stringp tab-label)
778 (make-instance 'label :label tab-label)
780 ((if (stringp menu-label)
781 (make-instance 'label :label menu-label)
782 menu-label) (or null widget))
783 ((%notebook-position notebook position) int))
785 (defun notebook-append (notebook child tab-label &optional menu-label)
786 (notebook-insert notebook :last child tab-label menu-label))
788 (defun notebook-prepend (notebook child tab-label &optional menu-label)
789 (notebook-insert notebook :first child tab-label menu-label))
791 (defbinding notebook-remove-page (notebook page) nil
793 ((%notebook-position notebook position) int))
795 (defbinding %notebook-page-num () int
799 (defun notebook-page-num (notebook child &optional error-p)
800 (let ((page-num (%notebook-page-num notebook child)))
803 (error "~A is not a child of ~A" child notebook))
806 (defbinding notebook-next-page () nil
809 (defbinding notebook-prev-page () nil
812 (defbinding notebook-reorder-child (notebook child position) nil
815 ((%notebook-position notebook position) int))
817 (defbinding notebook-popup-enable () nil
820 (defbinding notebook-popup-disable () nil
823 (defbinding (notebook-nth-page-child "gtk_notebook_get_nth_page")
824 (notebook page) widget
831 (defbinding (notebook-current-page-num "gtk_notebook_get_current_page") () int
834 (defun notebook-current-page (notebook)
835 (notebook-nth-page-child notebook (notebook-current-page-num notebook)))
837 (defbinding %notebook-set-current-page () nil
841 (defun (setf notebook-current-page) (page notebook)
842 (%notebook-set-current-page notebook (%notebook-position notebook page))
846 ;; (defbinding (notebook-tab-label "gtk_notebook_get_tab_label")
847 ;; (notebook page) widget
848 ;; (notebook notebook)
849 ;; ((%notebook-child notebook page) widget))
851 ;; (defbinding (notebook-tab-label-text "gtk_notebook_get_tab_label_text")
852 ;; (notebook page) string
853 ;; (notebook notebook)
854 ;; ((%notebook-child notebook page) widget))
856 ;; (defbinding %notebook-set-tab-label () nil
857 ;; (notebook notebook)
859 ;; (tab-label widget))
861 ;; (defun (setf notebook-tab-label) (tab-label notebook page)
862 ;; (let ((widget (if (stringp tab-label)
863 ;; (make-instance 'label :label tab-label)
865 ;; (%notebook-set-tab-label notebook (%notebook-child notebook page) widget)
869 ;; (defbinding (notebook-menu-label "gtk_notebook_get_menu_label")
870 ;; (notebook page) widget
871 ;; (notebook notebook)
872 ;; ((%notebook-child notebook page) widget))
874 ;; (defbinding (notebook-menu-label-text "gtk_notebook_get_menu_label_text")
875 ;; (notebook page) string
876 ;; (notebook notebook)
877 ;; ((%notebook-child notebook page) widget))
879 ;; (defbinding %notebook-set-menu-label () nil
880 ;; (notebook notebook)
882 ;; (menu-label widget))
884 ;; (defun (setf notebook-menu-label) (menu-label notebook page)
885 ;; (let ((widget (if (stringp menu-label)
886 ;; (make-instance 'label :label menu-label)
888 ;; (%notebook-set-menu-label notebook (%notebook-child notebook page) widget)
892 (defbinding notebook-query-tab-label-packing (notebook page) nil
894 ((%notebook-child notebook page) widget)
895 (expand boolean :out)
897 (pack-type pack-type :out))
899 (defbinding notebook-set-tab-label-packing
900 (notebook page expand fill pack-type) nil
902 ((%notebook-child notebook page) widget)
905 (pack-type pack-type))
911 (defbinding paned-pack1 () nil
917 (defbinding paned-pack2 () nil
923 (defun (setf paned-child1) (child paned)
924 (paned-pack1 paned child nil t)
927 (defun (setf paned-child2) (child paned)
928 (paned-pack2 paned child t t)
931 ;; Defined in gtkglue.c
932 (defbinding paned-child1 () widget
934 (resize boolean :out)
935 (shrink boolean :out))
937 ;; Defined in gtkglue.c
938 (defbinding paned-child2 () widget
940 (resize boolean :out)
941 (shrink boolean :out))
947 (defbinding layout-put () nil
953 (defbinding layout-move () nil
963 (defbinding menu-shell-insert (menu-shell menu-item position) nil
964 (menu-shell menu-shell)
965 (menu-item menu-item)
971 (defun menu-shell-append (menu-shell menu-item)
972 (menu-shell-insert menu-shell menu-item :last))
974 (defun menu-shell-prepend (menu-shell menu-item)
975 (menu-shell-insert menu-shell menu-item :fisrt))
977 (defbinding menu-shell-deactivate () nil
978 (menu-shell menu-shell))
980 (defbinding menu-shell-select-item () nil
981 (menu-shell menu-shell)
982 (menu-item menu-item))
984 (defbinding menu-shell-deselect () nil
985 (menu-shell menu-shell))
987 (defbinding menu-shell-activate-item () nil
988 (menu-shell menu-shell)
989 (menu-item menu-item)
990 (fore-deactivate boolean))
996 (defun %menu-position (menu child)
1002 (error "Invalid position keyword: ~A" child)))
1003 (widget (menu-child-position menu child))))
1006 (defbinding menu-reorder-child (menu menu-item position) nil
1008 (menu-item menu-item)
1009 ((%menu-position menu position) int))
1011 (defvar *menu-position-callback-marshal*
1012 (system:foreign-symbol-address "gtk_menu_position_callback_marshal"))
1014 (defbinding %menu-popup () nil
1016 (parent-menu-shell (or null menu-shell))
1017 (parent-menu-item (or null menu-item))
1018 (callback-func (or null pointer))
1019 (callback-id unsigned-int)
1020 (button unsigned-int)
1021 (activate-time (unsigned 32)))
1023 (defun menu-popup (menu button activate-time &key callback parent-menu-shell
1026 (let ((callback-id (register-callback-function callback)))
1029 menu parent-menu-shell parent-menu-item
1030 *menu-position-callback-marshal* callback-id button activate-time)
1031 (destroy-user-data callback-id)))
1033 menu parent-menu-shell parent-menu-item nil 0 button activate-time)))
1035 (defbinding menu-set-accel-path () nil
1037 (accel-path string))
1039 (defbinding menu-reposition () nil
1042 (defbinding menu-popdown () nil
1045 (defun menu-child-position (menu child)
1046 (position child (container-children menu)))
1048 (defun menu-active-num (menu)
1049 (menu-child-position menu (menu-active menu)))
1051 (defbinding %menu-set-active () nil
1053 (index unsigned-int))
1055 (defun (setf menu-active) (menu child)
1056 (%menu-set-active menu (%menu-position menu child))
1063 (defbinding table-resize () nil
1066 (columns unsigned-int))
1068 (defbinding table-attach (table child left right top bottom
1069 &key (x-options '(:expand :fill))
1070 (y-options '(:expand :fill))
1071 (x-padding 0) (y-padding 0)) nil
1075 (right unsigned-int)
1077 (bottom unsigned-int)
1078 (x-options attach-options)
1079 (y-options attach-options)
1080 (x-padding unsigned-int)
1081 (y-padding unsigned-int))
1084 (defbinding %table-set-row-spacing () nil
1087 (spacing unsigned-int))
1089 (defbinding %table-set-row-spacings () nil
1091 (spacing unsigned-int))
1093 (defun (setf table-row-spacing) (spacing table &optional row)
1095 (%table-set-row-spacing table row spacing)
1096 (%table-set-row-spacings table spacing))
1099 (defbinding %table-get-row-spacing () unsigned-int
1103 (defbinding %table-get-default-row-spacing () unsigned-int
1106 (defun table-row-spacing (table &optional row)
1108 (%table-get-row-spacing table row)
1109 (%table-get-default-row-spacing table)))
1112 (defbinding %table-set-col-spacing () nil
1115 (spacing unsigned-int))
1117 (defbinding %table-set-col-spacings () nil
1119 (spacing unsigned-int))
1121 (defun (setf table-col-spacing) (spacing table &optional col)
1123 (%table-set-col-spacing table col spacing)
1124 (%table-set-col-spacings table spacing))
1127 (defbinding %table-get-col-spacing () unsigned-int
1131 (defbinding %table-get-default-col-spacing () unsigned-int
1134 (defun table-col-spacing (table &optional col)
1136 (%table-get-col-spacing table col)
1137 (%table-get-default-col-spacing table)))
1143 (defbinding %toolbar-insert-element () widget
1145 (type toolbar-child-type)
1146 (widget (or null widget))
1148 (tooltip-text string)
1149 (tooltip-private-text string)
1150 (icon (or null widget))
1155 (defbinding %toolbar-insert-stock () widget
1158 (tooltip-text string)
1159 (tooltip-private-text string)
1164 (defun toolbar-insert (toolbar position element
1165 &key tooltip-text tooltip-private-text
1166 type icon group callback object)
1167 (let* ((numpos (case position
1175 (and (not type) (eq element :space)))
1176 (%toolbar-insert-element
1177 toolbar :space nil nil
1178 tooltip-text tooltip-private-text nil numpos))
1181 (and (not type) (typep element 'widget)))
1182 (%toolbar-insert-element
1183 toolbar :widget element nil
1184 tooltip-text tooltip-private-text nil numpos))
1189 (typep element 'string)
1190 (stock-lookup element)))
1191 (%toolbar-insert-stock
1192 toolbar element tooltip-text tooltip-private-text numpos))
1193 ((typep element 'string)
1194 (%toolbar-insert-element
1195 toolbar (or type :button) (when (eq type :radio-button) group)
1196 element tooltip-text tooltip-private-text icon numpos))
1197 ((error "Invalid element type: ~A" element)))))
1199 (signal-connect widget 'clicked callback :object object))
1202 (defun toolbar-append (toolbar element &key tooltip-text tooltip-private-text
1203 type icon group callback object)
1205 toolbar :first element :type type :icon icon :group group
1206 :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text
1207 :callback callback :object object))
1209 (defun toolbar-prepend (toolbar element &key tooltip-text tooltip-private-text
1210 type icon group callback object)
1212 toolbar :last element :type type :icon icon :group group
1213 :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text
1214 :callback callback :object object))
1217 (defun toolbar-insert-space (toolbar position)
1218 (toolbar-insert toolbar position :space))
1220 (defun toolbar-append-space (toolbar)
1221 (toolbar-append toolbar :space))
1223 (defun toolbar-prepend-space (toolbar)
1224 (toolbar-prepend toolbar :space))
1227 (defun toolbar-enable-tooltips (toolbar)
1228 (setf (toolbar-tooltips-p toolbar) t))
1230 (defun toolbar-disable-tooltips (toolbar)
1231 (setf (toolbar-tooltips-p toolbar) nil))
1234 (defbinding toolbar-remove-space () nil
1238 (defbinding toolbar-unset-icon-size () nil
1241 (defbinding toolbar-unset-style () nil
1247 (defbinding editable-select-region (editable &optional (start 0) end) nil
1252 (defbinding editable-insert-text
1253 (editable text &optional (position 0)) nil
1257 ((or position -1) int :in-out))
1259 (defun editable-append-text (editable text)
1260 (editable-insert-text editable text nil))
1262 (defun editable-prepend-text (editable text)
1263 (editable-insert-text editable text 0))
1265 (defbinding editable-delete-text (editable &optional (start 0) end) nil
1270 (defbinding (editable-text "gtk_editable_get_chars")
1271 (editable &optional (start 0) end) string
1276 (defun (setf editable-text) (text editable)
1278 (editable-delete-text
1280 (editable-insert-text editable text))
1281 (editable-delete-text editable))
1284 (defbinding editable-cut-clipboard () nil
1285 (editable editable))
1287 (defbinding editable-copy-clipboard () nil
1288 (editable editable))
1290 (defbinding editable-paste-clipboard () nil
1291 (editable editable))
1293 ; (defbinding editable-claim-selection () nil
1294 ; (editable editable)
1296 ; (time unsigned-int))
1298 (defbinding editable-delete-selection () nil
1299 (editable editable))
1301 ; (defbinding editable-changed () nil
1302 ; (editable editable))
1308 (defun spin-button-value-as-int (spin-button)
1309 (round (spin-button-value spin-button)))
1311 (defbinding spin-button-spin () nil
1312 (spin-button spin-button)
1313 (direction spin-type)
1314 (increment single-float))
1316 (defbinding spin-button-update () nil
1317 (spin-button spin-button))
1323 (defbinding ruler-set-range () nil
1325 (lower single-float)
1326 (upper single-float)
1327 (position single-float)
1328 (max-size single-float))
1330 (defbinding ruler-draw-ticks () nil
1333 (defbinding ruler-draw-pos () nil
1340 (defbinding range-draw-background () nil
1343 (defbinding range-clear-background () nil
1346 (defbinding range-draw-trough () nil
1349 (defbinding range-draw-slider () nil
1352 (defbinding range-draw-step-forw () nil
1355 (defbinding range-slider-update () nil
1358 (defbinding range-trough-click () int
1362 (jump-perc single-float :out))
1364 (defbinding range-default-hslider-update () nil
1367 (defbinding range-default-vslider-update () nil
1370 (defbinding range-default-htrough-click () int
1374 (jump-perc single-float :out))
1376 (defbinding range-default-vtrough-click () int
1380 (jump-perc single-float :out))
1382 (defbinding range-default-hmotion () int
1387 (defbinding range-default-vmotion () int
1396 ; (defbinding scale-draw-value () nil
1403 (defbinding progress-bar-pulse () nil
1404 (progress-bar progress-bar))
1410 (defbinding stock-lookup () boolean
1412 (stock-item stock-item :out))
1419 (defbinding tooltips-enable () nil
1420 (tooltips tooltips))
1422 (defbinding tooltips-disable () nil
1423 (tooltips tooltips))
1425 (defun (setf tooltips-enabled-p) (enable tooltips)
1427 (tooltips-enable tooltips)
1428 (tooltips-disable tooltips)))
1430 (defbinding tooltips-set-tip () nil
1434 (tip-private string))
1436 (defbinding tooltips-force-window () nil
1437 (tooltips tooltips))
1443 (defbinding rc-add-default-file (filename) nil
1444 ((namestring (truename filename)) string))
1446 (defbinding rc-parse (filename) nil
1447 ((namestring (truename filename)) string))
1449 (defbinding rc-parse-string () nil
1452 (defbinding rc-reparse-all () nil)
1454 (defbinding rc-get-style () style
1459 ;;; Accelerator Groups
1461 (defbinding accel-group-get-default () accel-group)
1463 (deftype-method alien-ref accel-group (type-spec)
1464 (declare (ignore type-spec))
1467 (deftype-method alien-unref accel-group (type-spec)
1468 (declare (ignore type-spec))
1469 '%accel-group-unref)
1471 (defbinding %accel-group-ref () accel-group
1472 (accel-group (or accel-group pointer)))
1474 (defbinding %accel-group-unref () nil
1475 (accel-group (or accel-group pointer)))
1477 (defbinding accel-group-activate (accel-group key modifiers) boolean
1478 (accel-group accel-group)
1479 ((gdk:keyval-from-name key) unsigned-int)
1480 (modifiers gdk:modifier-type))
1482 (defbinding accel-groups-activate (object key modifiers) boolean
1484 ((gdk:keyval-from-name key) unsigned-int)
1485 (modifiers gdk:modifier-type))
1487 (defbinding accel-group-attach () nil
1488 (accel-group accel-group)
1491 (defbinding accel-group-detach () nil
1492 (accel-group accel-group)
1495 (defbinding accel-group-lock () nil
1496 (accel-group accel-group))
1498 (defbinding accel-group-unlock () nil
1499 (accel-group accel-group))
1502 ;;; Accelerator Groups Entries
1504 (defbinding accel-group-get-entry (accel-group key modifiers) accel-entry
1505 (accel-group accel-group)
1506 ((gdk:keyval-from-name key) unsigned-int)
1507 (modifiers gdk:modifier-type))
1509 (defbinding accel-group-lock-entry (accel-group key modifiers) nil
1510 (accel-group accel-group)
1511 ((gdk:keyval-from-name key) unsigned-int)
1512 (modifiers gdk:modifier-type))
1514 (defbinding accel-group-unlock-entry (accel-group key modifiers) nil
1515 (accel-group accel-group)
1516 ((gdk:keyval-from-name key) unsigned-int)
1517 (modifiers gdk:modifier-type))
1519 (defbinding accel-group-add
1520 (accel-group key modifiers flags object signal) nil
1521 (accel-group accel-group)
1522 ((gdk:keyval-from-name key) unsigned-int)
1523 (modifiers gdk:modifier-type)
1526 ((name-to-string signal) string))
1528 (defbinding accel-group-add (accel-group key modifiers object) nil
1529 (accel-group accel-group)
1530 ((gdk:keyval-from-name key) unsigned-int)
1531 (modifiers gdk:modifier-type)
1535 ;;; Accelerator Signals
1537 (defbinding accel-group-handle-add
1538 (object signal-id accel-group key modifiers flags) nil
1540 (signal-id unsigned-int)
1541 (accel-group accel-group)
1542 ((gdk:keyval-from-name key) unsigned-int)
1543 (modifiers gdk:modifier-type)
1544 (flags accel-flags))
1546 (defbinding accel-group-handle-remove
1547 (object accel-group key modifiers) nil
1549 (accel-group accel-group)
1550 ((gdk:keyval-from-name key) unsigned-int)
1551 (modifiers gdk:modifier-type))