chiark / gitweb /
Added bindings to message dialog widget
[clg] / gtk / gtk.lisp
1 ;; Common Lisp bindings for GTK+ v2.0
2 ;; Copyright (C) 1999-2001 Espen S. Johnsen <esj@stud.cs.uit.no>
3 ;;
4 ;; This library is free software; you can redistribute it and/or
5 ;; modify it under the terms of the GNU Lesser General Public
6 ;; License as published by the Free Software Foundation; either
7 ;; version 2 of the License, or (at your option) any later version.
8 ;;
9 ;; This library is distributed in the hope that it will be useful,
10 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 ;; Lesser General Public License for more details.
13 ;;
14 ;; You should have received a copy of the GNU Lesser General Public
15 ;; License along with this library; if not, write to the Free Software
16 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18 ;; $Id: gtk.lisp,v 1.26 2004/12/21 00:15:19 espen Exp $
19
20
21 (in-package "GTK")
22
23 ;;; Gtk version
24
25 (defbinding check-version () (copy-of string)
26   (required-major unsigned-int)
27   (required-minor unsigned-int)
28   (required-micro unsigned-int))
29
30 (defbinding query-version () nil
31   (major unsigned-int :out)
32   (minor unsigned-int :out)
33   (micro unsigned-int :out))
34
35 (defun gtk-version ()
36   (multiple-value-bind (major minor micro)
37       (query-version)
38     (if (zerop micro)
39         (format nil "Gtk+ v~A.~A" major minor) 
40       (format nil "Gtk+ v~A.~A.~A" major minor micro))))
41
42 (defbinding get-default-language () (copy-of pango:language))
43
44
45 ;;;; Initalization
46
47 (defbinding (gtk-init "gtk_parse_args") () nil
48   "Initializes the library without opening the display."
49   (nil null)
50   (nil null))
51
52 (defun clg-init (&optional display)
53   "Initializes the system and starts the event handling"
54   (unless (gdk:display-get-default)
55     (gdk:gdk-init)
56     (gtk-init)
57     (prog1
58         (gdk:display-open display)
59       (system:add-fd-handler 
60        (gdk:display-connection-number) :input #'main-iterate-all)
61       (setq lisp::*periodic-polling-function* #'main-iterate-all)
62       (setq lisp::*max-event-to-sec* 0)
63       (setq lisp::*max-event-to-usec* 1000))))
64
65
66 ;;; Acccel group
67
68
69
70 ;;; Acccel label
71
72 (defbinding accel-label-refetch () boolean
73   (accel-label accel-label))
74
75
76 ;;; Adjustment
77
78 (defmethod shared-initialize ((adjustment adjustment) names &key value)
79   (prog1
80       (call-next-method)
81     ;; we need to make sure that the value is set last, otherwise it
82     ;; may be outside current limits
83     (when value
84       (setf (slot-value adjustment 'value) value))))
85
86
87 (defbinding adjustment-changed () nil
88   (adjustment adjustment))
89
90 (defbinding adjustment-value-changed () nil
91   (adjustment adjustment))
92
93 (defbinding adjustment-clamp-page () nil
94   (adjustment adjustment)
95   (lower single-float)
96   (upper single-float))
97
98
99 ;;; Arrow -- no functions
100
101
102
103 ;;; Aspect frame
104
105
106 ;;; Bin
107
108 (defun (setf bin-child) (child bin)
109   (when-bind (current-child (bin-child bin))
110     (container-remove bin current-child))
111   (container-add bin child)
112   child)
113
114
115 ;;; Binding
116
117
118
119 ;;; Box
120
121 (defbinding box-pack-start () nil
122   (box box)
123   (child widget)
124   (expand boolean)
125   (fill boolean)
126   (padding unsigned-int))
127
128 (defbinding box-pack-end () nil
129   (box box)
130   (child widget)
131   (expand boolean)
132   (fill boolean)
133   (padding unsigned-int))
134
135 (defun box-pack (box child &key end expand fill (padding 0))
136   (if end
137       (box-pack-end box child expand fill padding)
138     (box-pack-start box child expand fill padding)))
139
140 (defbinding box-reorder-child () nil
141   (box box)
142   (child widget)
143   (position int))
144
145 (defbinding box-query-child-packing () nil
146   (box box)
147   (child widget)
148   (expand boolean :out)
149   (fill boolean :out)
150   (padding unsigned-int :out)
151   (pack-type pack-type :out))
152
153 (defbinding box-set-child-packing () nil
154   (box box)
155   (child widget)
156   (expand boolean)
157   (fill boolean)
158   (padding unsigned-int)
159   (pack-type pack-type))
160
161
162
163 ;;; Button
164
165 (defbinding button-pressed () nil
166   (button button))
167
168 (defbinding button-released () nil
169   (button button))
170
171 (defbinding button-clicked () nil
172   (button button))
173
174 (defbinding button-enter () nil
175   (button button))
176
177 (defbinding button-leave () nil
178   (button button))
179
180
181
182 ;;; Calendar
183
184 (defbinding calendar-select-month () int
185   (calendar calendar)
186   (month unsigned-int)
187   (year unsigned-int))
188
189 (defbinding calendar-select-day () nil
190   (calendar calendar)
191   (day unsigned-int))
192
193 (defbinding calendar-mark-day () int
194   (calendar calendar)
195   (day unsigned-int))
196
197 (defbinding calendar-unmark-day () int
198   (calendar calendar)
199   (day unsigned-int))
200
201 (defbinding calendar-clear-marks () nil
202   (calendar calendar))
203
204 (defbinding calendar-display-options () nil
205   (calendar calendar)
206   (options calendar-display-options))
207
208 (defbinding (calendar-date "gtk_calendar_get_date") () nil
209   (calendar calendar)
210   (year unsigned-int :out)
211   (month unsigned-int :out)
212   (day unsigned-int :out))
213
214 (defbinding calendar-freeze () nil
215   (calendar calendar))
216
217 (defbinding calendar-thaw () nil
218   (calendar calendar))
219
220
221
222 ;;; Cell editable
223
224
225
226 ;;; Cell renderer
227
228
229
230 ;;; Cell renderer pixbuf -- no functions
231
232
233
234 ;;; Cell renderer text
235
236
237
238 ;;; Cell renderer toggle -- no functions
239
240
241
242 ;;; Check button -- no functions
243
244
245
246 ;;; Check menu item
247
248 (defbinding check-menu-item-toggled () nil
249   (check-menu-item check-menu-item))
250
251
252
253 ;;; Clipboard
254
255
256 ;;; Color selection
257
258 (defbinding (color-selection-is-adjusting-p
259              "gtk_color_selection_is_adjusting") () boolean
260   (colorsel color-selection))
261
262
263
264 ;;; Color selection dialog -- no functions
265
266
267
268 ;;;; Combo Box
269
270 (defmethod shared-initialize ((combo-box combo-box) names &key model content)
271   (unless model
272     (setf 
273      (combo-box-model combo-box) 
274      (make-instance 'list-store :column-types '(string)))
275     (unless (typep combo-box 'combo-box-entry)
276       (let ((cell (make-instance 'cell-renderer-text)))
277         (cell-layout-pack combo-box cell :expand t)
278         (cell-layout-add-attribute combo-box cell :text 0)))
279     (when content
280       (map 'nil #'(lambda (text)
281                     (combo-box-append-text combo-box text))
282            content)))
283     (call-next-method))
284
285 ;; (defmethod shared-initialize :after ((combo-box combo-box) names &key active)
286 ;;   (when active
287 ;;     (signal-emit combo-box 'changed)))
288
289 (defbinding combo-box-append-text () nil
290   (combo-box combo-box)
291   (text string))
292
293 (defbinding combo-box-insert-text () nil
294   (combo-box combo-box)
295   (position int)
296   (text string))
297
298 (defbinding combo-box-prepend-text () nil
299   (combo-box combo-box)
300   (text string))
301
302 #+gtk2.6
303 (defbinding combo-box-get-active-text () string
304   (combo-box combo-box))
305
306 (defbinding combo-box-popup () nil
307   (combo-box combo-box))
308
309 (defbinding combo-box-popdown () nil
310   (combo-box combo-box))
311
312
313
314 ;;;; Combo Box Entry
315
316 (defmethod shared-initialize ((combo-box-entry combo-box-entry) names &key model)
317   (call-next-method)
318   (unless model
319     (setf (combo-box-entry-text-column combo-box-entry) 0)))
320
321
322 ;;;; Dialog
323
324 (defmethod shared-initialize ((dialog dialog) names &rest initargs 
325                               &key button buttons)
326   (declare (ignore button buttons))
327   (prog1
328       (call-next-method)
329     (initial-apply-add dialog #'dialog-add-button initargs :button :buttons)))
330   
331
332 (defun %dialog-find-response-id-num (dialog id &optional create-p error-p)
333   (or
334    (cadr (assoc id (rest (type-expand-1 'response-type))))
335    (let ((response-ids (object-data dialog 'response-id-key)))
336     (cond
337       ((and response-ids (position id response-ids :test #'equal)))
338       (create-p
339        (cond
340          (response-ids
341           (vector-push-extend id response-ids)
342           (1- (length response-ids)))
343          (t
344           (setf 
345            (object-data dialog 'response-id-key)
346            (make-array 1 :adjustable t :fill-pointer t :initial-element id))
347           0)))
348       (error-p
349        (error "Invalid response: ~A" id))))))
350
351 (defun %dialog-find-response-id (dialog response-id-num)
352   (if (< response-id-num 0)
353       (car
354        (rassoc
355         (list response-id-num)
356         (rest (type-expand-1 'response-type)) :test #'equal))
357     (aref (object-data dialog 'response-id-key) response-id-num )))
358
359
360 (defmethod signal-connect ((dialog dialog) signal function &key object after)
361   (let ((response-id-num (%dialog-find-response-id-num dialog signal)))
362     (cond
363      (response-id-num
364       (call-next-method
365        dialog 'response
366        #'(lambda (dialog id)
367            (when (= id response-id-num)
368              (cond
369               ((eq object t) (funcall function dialog))
370               (object (funcall function object))
371               (t (funcall function)))))
372        :object t :after after))
373     ((call-next-method)))))
374
375
376 (defbinding dialog-run () nil
377   (dialog dialog))
378
379 (defbinding dialog-response (dialog response-id) nil
380   (dialog dialog)
381   ((%dialog-find-response-id-num dialog response-id nil t) int))
382
383
384 (defbinding %dialog-add-button () button
385   (dialog dialog)
386   (text string)
387   (response-id-num int))
388
389 (defun dialog-add-button (dialog label &optional (response label)
390                           &key default object after)
391   "Adds a button to the dialog."
392   (let* ((id (if (functionp response)
393                  label
394                response))
395          (id-num (%dialog-find-response-id-num dialog id t))
396          (button (%dialog-add-button dialog label id-num)))
397     (when (functionp response)
398        (signal-connect dialog id response :object object :after after))
399     (when default
400       (%dialog-set-default-response dialog id-num))
401     button))
402
403
404 (defbinding %dialog-add-action-widget () button
405   (dialog dialog)
406   (action-widget widget)
407   (response-id-num int))
408
409 (defun dialog-add-action-widget (dialog widget &optional (response widget)
410                                  &key default object after)
411   (let* ((id (if (functionp response)
412                  widget
413                response))
414          (id-num (%dialog-find-response-id-num dialog id t)))
415     (%dialog-add-action-widget dialog widget id-num)
416     (when (functionp response)
417        (signal-connect dialog id response :object object :after after))
418     (when default
419       (%dialog-set-default-response dialog id-num))
420     widget))
421
422
423 (defbinding %dialog-set-default-response () nil
424   (dialog dialog)
425   (response-id-num int))
426
427 (defun dialog-set-default-response (dialog response-id)
428   (%dialog-set-default-response
429    dialog (%dialog-find-response-id-num dialog response-id nil t)))
430
431 (defbinding dialog-set-response-sensitive (dialog response-id sensitive) nil
432   (dialog dialog)
433   ((%dialog-find-response-id-num dialog response-id nil t) int)
434   (sensitive boolean))
435
436 #+gtk2.6
437 (defbinding alternative-dialog-button-order-p(&optional screen)
438   (screen (or null screen)))
439
440 #+gtk2.6
441 (defbinding (dialog-set-alternative-button-order 
442              "gtk_dialog_set_alternative_button_order_from_array") 
443     (dialog new-order)
444   (dialog dialog)
445   ((length new-order) int)
446   ((map 'vector #'(lambda (id)
447                     (%dialog-find-response-id-num dialog id nil t))
448         new-order) (vector int)))
449
450
451 (defmethod container-add ((dialog dialog) (child widget) &rest args)
452   (apply #'container-add (dialog-vbox dialog) child args))
453
454 (defmethod container-remove ((dialog dialog) (child widget))
455   (container-remove (dialog-vbox dialog) child))
456
457 (defmethod container-children ((dialog dialog))
458   (container-children (dialog-vbox dialog)))
459
460 (defmethod (setf container-children) (children (dialog dialog))
461   (setf (container-children (dialog-vbox dialog)) children))
462
463
464
465 ;;; Drawing area
466
467 (defbinding drawing-area-get-size () nil
468   (drawing-area drawing-area)
469   (width int :out)
470   (height int :out))
471
472
473 ;;; Entry
474
475 (defbinding  entry-get-layout () pango:layout
476   (entry entry))
477
478 (defbinding entry-get-layout-offsets () nil
479   (entry entry)
480   (x int :out)
481   (y int :out))
482
483
484 ;;; Entry Completion
485
486 (def-callback-marshal %entry-completion-match-func
487     (boolean entry-completion string (copy-of tree-iter)))
488
489 (defbinding entry-completion-set-match-func (completion function) nil
490   (completion entry-completion)
491   ((callback %entry-completion-match-func) pointer)
492   ((register-callback-function function) unsigned-int)
493   ((callback %destroy-user-data) pointer))
494
495 (defbinding entry-completion-complete () nil
496   (completion entry-completion))
497
498 #+gtk2.6
499 (defbinding entry-completion-insert-prefix () nil
500   (completion entry-completion))
501
502 (defbinding entry-completion-insert-action-text () nil
503   (completion entry-completion)
504   (index int)
505   (text string))
506
507 (defbinding entry-completion-insert-action-markup () nil
508   (completion entry-completion)
509   (index int)
510   (markup string))
511
512 (defbinding entry-completion-delete-action () nil
513   (completion entry-completion)
514   (index int))
515
516
517 ;;; Image
518
519 (defbinding image-set-from-file () nil
520   (image image)
521   (filename pathname))
522
523 (defbinding image-set-from-pixmap () nil
524   (image image)
525   (pixmap gdk:pixmap)
526   (mask gdk:bitmap))
527
528 (defbinding image-set-from-stock () nil
529   (image image)
530   (stock-id string)
531   (icon-size icon-size))
532
533 (defun image-set-from-pixmap-data (image pixmap-data)
534   (multiple-value-bind (pixmap mask) (gdk:pixmap-create pixmap-data)
535     (image-set-from-pixmap image pixmap mask)))
536
537 (defun image-set-from-source (image source)
538   (etypecase source
539     (pathname (image-set-from-file image source))
540     (string (if (stock-lookup source)
541                 (setf (image-stock image) source)
542               (image-set-from-file image source)))
543     (vector (image-set-from-pixmap-data image source))))
544
545
546 (defmethod shared-initialize ((image image) names &rest initargs 
547                               &key file pixmap source)
548   (prog1
549       (if (vectorp pixmap)
550           (progn
551             (remf initargs :pixmap)
552             (apply #'call-next-method image names initargs))
553         (call-next-method))
554     (cond
555       (file (image-set-from-file image file))
556       ((vectorp pixmap) (image-set-from-pixmap-data image pixmap))
557       (source (image-set-from-source image source)))))
558
559
560 ;;; Label
561
562 (defbinding label-get-layout-offsets () nil
563   (label label)
564   (x int :out)
565   (y int :out))
566
567 (defbinding label-select-region () nil
568   (label label)
569   (start int)
570   (end int))
571
572 (defbinding label-get-text () string
573   (label label))
574
575 (defbinding label-get-layout () pango:layout
576   (label label))
577
578 (defbinding label-get-selection-bounds () boolean
579   (label label)
580   (start int :out)
581   (end int :out))
582
583
584
585 ;;; Radio button
586
587 (defbinding %radio-button-get-group () pointer
588   (radio-button radio-button))
589
590 (defbinding %radio-button-set-group () nil
591   (radio-button radio-button)
592   (group pointer))
593
594 (defun radio-button-add-to-group (button1 button2)
595   "Add BUTTON1 to the group which BUTTON2 belongs to."
596   (%radio-button-set-group button1 (%radio-button-get-group button2)))
597
598
599 (defmethod initialize-instance ((button radio-button)
600                                 &rest initargs &key group-with)
601   (declare (ignore initargs))
602   (call-next-method)
603   (when group-with
604     (radio-button-add-to-group button group-with)))
605
606
607 ;;; Item
608
609 (defbinding item-select () nil
610   (item item))
611
612 (defbinding item-deselect () nil
613   (item item))
614
615 (defbinding item-toggle () nil
616   (item item))
617
618
619
620 ;;; Menu item
621
622 (defun (setf menu-item-label) (label menu-item)
623   (make-instance 'accel-label
624    :label label :xalign 0.0 :yalign 0.5 :accel-widget menu-item
625    :visible t :parent menu-item)
626   label)
627
628 (defun menu-item-label (menu-item)
629   (with-slots (child) menu-item
630     (when (typep child 'label)
631       (label-label child))))
632
633 (defbinding %menu-item-set-submenu () nil
634   (menu-item menu-item)
635   (submenu menu))
636
637 (defbinding %menu-item-remove-submenu () nil
638   (menu-item menu-item))
639
640 (defun (setf menu-item-submenu) (submenu menu-item)
641   (if (not submenu)
642       (%menu-item-remove-submenu menu-item)
643     (%menu-item-set-submenu menu-item submenu))
644   submenu)
645
646 (defbinding menu-item-set-accel-path () nil
647   (menu-item menu-item)
648   (accel-path string))
649
650 (defbinding menu-item-select () nil
651   (menu-item menu-item))
652
653 (defbinding menu-item-deselect () nil
654   (menu-item menu-item))
655
656 (defbinding menu-item-activate () nil
657   (menu-item menu-item))
658
659 (defbinding menu-item-toggle-size-request () nil
660   (menu-item menu-item)
661   (requisition int :out))
662
663 (defbinding menu-item-toggle-size-allocate () nil
664   (menu-item menu-item)
665   (allocation int))
666
667
668 ;;; Message dialog
669
670 (defmethod initialize-instance ((dialog message-dialog) &rest initargs 
671                                 &key (type :info) (buttons :close) ; or :ok? 
672                                 flags message parent)
673   (remf initargs :parent)
674   (setf 
675    (slot-value dialog 'location)
676    (%message-dialog-new parent flags type buttons nil))
677   (message-dialog-set-markup dialog message)
678   (apply #'call-next-method dialog initargs))
679
680
681 (defbinding %message-dialog-new () pointer
682   (parent (or null window))
683   (flags dialog-flags)
684   (type message-type)
685   (buttons buttons-type)
686   (message (or null string)))
687
688 (defbinding %message-dialog-new-with-markup () pointer
689   (parent (or null window))
690   (flags dialog-flags)
691   (type message-type)
692   (buttons buttons-type)
693   (message string))
694
695 (defbinding message-dialog-set-markup () nil
696   (message-dialog message-dialog)
697   (markup string))
698
699 #+gtk2.6
700 (defbinding message-dialog-format-secondary-text () nil
701   (message-dialog message-dialog)
702   (text string))
703
704 #+gtk2.6
705 (defbinding message-dialog-format-secondary-markup () nil
706   (message-dialog message-dialog)
707   (markup string))
708
709
710
711 ;;; Radio menu item
712
713 (defbinding %radio-menu-item-get-group () pointer
714   (radio-menu-item radio-menu-item))
715
716 (defbinding %radio-menu-item-set-group () nil
717   (radio-menu-item radio-menu-item)
718   (group pointer))
719
720 (defun radio-menu-item-add-to-group (item1 item2)
721   "Add ITEM1 to the group which ITEM2 belongs to."
722   (%radio-menu-item-set-group item1 (%radio-menu-item-get-group item2)))
723
724 (defmethod initialize-instance ((item radio-menu-item)
725                                 &rest initargs &key group-with)
726   (declare (ignore initargs))
727   (prog1
728       (call-next-method)
729     (when group-with
730       (radio-menu-item-add-to-group item group-with))))
731   
732
733
734 ;;; Toggle button
735
736 (defbinding toggle-button-toggled () nil
737   (toggle-button toggle-button))
738
739
740
741 ;;; Window
742
743 (defmethod initialize-instance ((window window) &rest initargs 
744                                 &key accel-group accel-groups)
745   (declare (ignore accel-group accel-groups))
746   (prog1
747       (call-next-method)
748     (initial-add window #'window-add-accel-group 
749      initargs :accel-group :accel-groups)))
750
751
752 (defbinding window-set-wmclass () nil
753   (window window)
754   (wmclass-name string)
755   (wmclass-class string))
756
757 (defbinding window-add-accel-group () nil
758   (window window)
759   (accel-group accel-group))
760
761 (defbinding window-remove-accel-group () nil
762   (window window)
763   (accel-group accel-group))
764
765 (defbinding window-activate-focus () int
766   (window window))
767
768 (defbinding window-activate-default () int
769   (window window))
770
771 (defbinding window-set-default-size (window width height) int
772   (window window)
773   ((or width -1) int)
774   ((or height -1) int))
775
776 ;(defbinding window-set-geometry-hints)
777
778 (defbinding window-list-toplevels () (glist (copy-of window))
779   "Returns a list of all existing toplevel windows.")
780
781 (defbinding window-add-mnemonic (window key target) nil
782   (window window)
783   ((gdk:keyval-from-name key) unsigned-int)
784   (target widget))
785
786 (defbinding window-remove-mnemonic (window key target) nil
787   (window window)
788   ((gdk:keyval-from-name key) unsigned-int)
789   (target widget))
790
791 (defbinding window-mnemonic-activate (window key modifier) nil
792   (window window)
793   ((gdk:keyval-from-name key) unsigned-int)
794   (modifier gdk:modifier-type))
795
796 (defbinding window-present () nil
797   (window window))
798
799 (defbinding window-iconify () nil
800   (window window))
801
802 (defbinding window-deiconify () nil
803   (window window))
804
805 (defbinding window-stick () nil
806   (window window))
807
808 (defbinding window-unstick () nil
809   (window window))
810
811 (defbinding window-maximize () nil
812   (window window))
813
814 (defbinding window-unmaximize () nil
815   (window window))
816
817 (defbinding window-begin-resize-drag () nil
818   (window window)
819   (edge gdk:window-edge)
820   (button int)
821   (root-x int) (root-y int)
822   (timestamp unsigned-int))
823
824 (defbinding window-begin-move-drag () nil
825   (window window)
826   (edge gdk:window-edge)
827   (button int)
828   (root-x int) (root-y int)
829   (timestamp unsigned-int))
830
831 (defbinding window-set-frame-dimensions () nil
832   (window window)
833   (left int) (top int) (rigth int) (bottom int))
834
835 (defbinding (window-default-icons "gtk_window_get_default_icon_list")
836     () (glist gdk:pixbuf))
837
838 (defbinding %window-get-default-size () nil
839   (window window)
840   (width int :out)
841   (height int :out))
842
843 (defun window-get-default-size (window)
844   (multiple-value-bind (width height) (%window-get-default-size window)
845     (values (unless (= width -1) width) (unless (= height -1) height))))
846
847 (defbinding window-get-frame-dimensions () nil
848   (window window)
849   (left int :out) (top int :out) (rigth int :out) (bottom int :out))
850
851 (defbinding %window-get-icon-list () (glist gdk:pixbuf)
852   (window window))
853
854 (defmethod window-icon ((window window))
855   (let ((icon-list (%window-get-icon-list window)))
856     (if (endp (rest icon-list))
857         (first icon-list)
858       icon-list)))
859
860 (defbinding window-get-position () nil
861   (window window)
862   (root-x int :out)
863   (root-y int :out))
864
865 (defbinding window-get-size () nil
866   (window window)
867   (width int :out)
868   (height int :out))
869
870 (defbinding window-move () nil
871   (window window)
872   (x int)
873   (y int))
874
875 (defbinding window-parse-geometry () boolean
876   (window window)
877   (geometry string))
878
879 (defbinding window-reshow-with-initial-size () nil
880   (window window))
881
882 (defbinding window-resize () nil
883   (window window)
884   (width int)
885   (heigth int))
886
887 (defbinding %window-set-icon-list () nil
888   (window window)
889   (icon-list (glist gdk:pixbuf)))
890
891 (defmethod (setf window-icon) (icon (window window))
892   (%window-set-icon-list window (mklist icon)))
893
894
895
896
897 ;;; File chooser
898
899
900
901
902 ;;; Scrolled window
903
904 (defun (setf scrolled-window-scrollbar-policy) (policy window)
905   (setf (scrolled-window-hscrollbar-policy window) policy)
906   (setf (scrolled-window-vscrollbar-policy window) policy))
907
908 (defbinding scrolled-window-add-with-viewport () nil
909    (scrolled-window scrolled-window)
910    (child widget))
911
912
913
914
915
916
917
918 ;;; Statusbar
919
920 (defbinding (statusbar-context-id "gtk_statusbar_get_context_id")
921     () unsigned-int
922   (statusbar statusbar)
923   (context-description string))
924
925 (defbinding statusbar-push () unsigned-int
926   (statusbar statusbar)
927   (context-id unsigned-int)  
928   (text string))
929
930 (defbinding statusbar-pop () nil
931   (statusbar statusbar)
932   (context-id unsigned-int))
933
934 (defbinding statusbar-remove () nil
935   (statusbar statusbar)
936   (context-id unsigned-int)
937   (message-id unsigned-int))
938
939
940
941 ;;; Fixed
942
943 (defbinding fixed-put () nil
944   (fixed fixed)
945   (widget widget)
946   (x int) (y int))
947
948 (defbinding fixed-move () nil
949   (fixed fixed)
950   (widget widget)
951   (x int) (y int))
952
953
954
955 ;;; Notebook
956
957 (defun %notebook-position (notebook page)
958   (etypecase page
959     (int page)
960     (keyword (case page
961                (:first 0)
962                (:last -1)
963                (t (error "Invalid position keyword: ~A" page))))
964     (widget (notebook-page-num notebook page t))))
965
966 (defun %notebook-child (notebook position)
967   (typecase position
968      (widget position)
969      (t (notebook-nth-page-child notebook position))))
970
971
972 (defbinding (notebook-insert "gtk_notebook_insert_page_menu")
973     (notebook position child tab-label &optional menu-label) nil
974   (notebook notebook)
975   (child widget)
976   ((if (stringp tab-label)
977        (make-instance 'label :label tab-label)
978      tab-label) widget)
979   ((if (stringp menu-label)
980        (make-instance 'label :label menu-label)
981      menu-label) (or null widget))
982   ((%notebook-position notebook position) int))
983
984 (defun notebook-append (notebook child tab-label &optional menu-label)
985   (notebook-insert notebook :last child tab-label menu-label))
986
987 (defun notebook-prepend (notebook child tab-label &optional menu-label)
988   (notebook-insert notebook :first child tab-label menu-label))
989   
990 (defbinding notebook-remove-page (notebook page) nil
991   (notebook notebook)
992   ((%notebook-position notebook page) int))
993
994 (defbinding %notebook-page-num () int
995   (notebook notebook)
996   (child widget))
997
998 (defun notebook-page-num (notebook child &optional error-p)
999   (let ((page-num (%notebook-page-num notebook child)))
1000     (if (= page-num -1)
1001         (when error-p
1002           (error "~A is not a child of ~A" child notebook))
1003       page-num)))
1004
1005 (defbinding notebook-next-page () nil
1006   (notebook notebook))
1007
1008 (defbinding notebook-prev-page () nil
1009   (notebook notebook))
1010
1011 (defbinding notebook-reorder-child (notebook child position) nil
1012   (notebook notebook)
1013   (child widget)
1014   ((%notebook-position notebook position) int))
1015
1016 (defbinding notebook-popup-enable () nil
1017   (notebook notebook))
1018
1019 (defbinding notebook-popup-disable () nil
1020   (notebook notebook))
1021
1022 (defbinding (notebook-nth-page-child "gtk_notebook_get_nth_page")
1023     (notebook page) widget
1024   (notebook notebook)
1025   ((case page
1026      (:first 0)
1027      (:last -1)
1028      (t page)) int))
1029
1030
1031 (defbinding %notebook-get-current-page () int
1032   (notebook notebook))
1033
1034 (defun notebook-current-page-num (notebook)
1035   (let ((num (%notebook-get-current-page notebook)))
1036     (when (>= num 0)
1037       num)))
1038
1039 (defun notebook-current-page (notebook)
1040   (let ((page-num (notebook-current-page-num notebook)))
1041     (when page-num
1042       (notebook-nth-page-child notebook page-num))))
1043
1044 (defbinding  %notebook-set-current-page () nil
1045   (notebook notebook)
1046   (page-num int))
1047
1048 (defun (setf notebook-current-page) (page notebook)
1049   (%notebook-set-current-page notebook (%notebook-position notebook page))
1050   page)
1051
1052
1053 (defbinding (notebook-tab-label "gtk_notebook_get_tab_label")
1054     (notebook page) widget
1055   (notebook notebook)
1056   ((%notebook-child notebook page) widget))
1057
1058 (defbinding (notebook-tab-label-text "gtk_notebook_get_tab_label_text")
1059     (notebook page) (copy-of string)
1060   (notebook notebook)
1061   ((%notebook-child notebook page) widget))
1062
1063 (defbinding %notebook-set-tab-label () nil
1064   (notebook notebook)
1065   (page widget)
1066   (tab-label widget))
1067
1068 (defun (setf notebook-tab-label) (tab-label notebook page)
1069   (let ((widget (if (stringp tab-label)
1070                     (make-instance 'label :label tab-label)
1071                   tab-label)))
1072     (%notebook-set-tab-label notebook (%notebook-child notebook page) widget)
1073     widget))
1074
1075
1076 (defbinding (notebook-menu-label "gtk_notebook_get_menu_label")
1077     (notebook page) widget
1078   (notebook notebook)
1079   ((%notebook-child notebook page) widget))
1080
1081 (defbinding (notebook-menu-label-text "gtk_notebook_get_menu_label_text")
1082     (notebook page) (copy-of string)
1083   (notebook notebook)
1084   ((%notebook-child notebook page) widget))
1085
1086 (defbinding %notebook-set-menu-label () nil
1087   (notebook notebook)
1088   (page widget)
1089   (menu-label widget))
1090
1091 (defun (setf notebook-menu-label) (menu-label notebook page)
1092   (let ((widget (if (stringp menu-label)
1093                     (make-instance 'label :label menu-label)
1094                   menu-label)))
1095     (%notebook-set-menu-label notebook (%notebook-child notebook page) widget)
1096     widget))
1097
1098
1099 (defbinding notebook-query-tab-label-packing (notebook page) nil
1100   (notebook notebook)
1101   ((%notebook-child notebook page) widget)
1102   (expand boolean :out)
1103   (fill boolean :out)
1104   (pack-type pack-type :out))
1105
1106 (defbinding notebook-set-tab-label-packing
1107     (notebook page expand fill pack-type) nil
1108   (notebook notebook)
1109   ((%notebook-child notebook page) widget)
1110   (expand boolean)
1111   (fill boolean)
1112   (pack-type pack-type))
1113
1114
1115
1116 ;;; Paned
1117
1118 (defbinding paned-pack1 () nil
1119   (paned paned)
1120   (child widget)
1121   (resize boolean)
1122   (shrink boolean))
1123
1124 (defbinding paned-pack2 () nil
1125   (paned paned)
1126   (child widget)
1127   (resize boolean)
1128   (shrink boolean))
1129
1130
1131 ;;; Layout
1132
1133 (defbinding layout-put () nil
1134   (layout layout)
1135   (widget widget)
1136   (x int)
1137   (y int))
1138
1139 (defbinding layout-move () nil
1140   (layout layout)
1141   (widget widget)
1142   (x int)
1143   (y int))
1144
1145
1146
1147 ;;; Menu shell
1148
1149 (defbinding menu-shell-insert (menu-shell menu-item position) nil
1150   (menu-shell menu-shell)
1151   (menu-item menu-item)
1152   ((case position
1153      (:first 0)
1154      (:last -1)
1155      (t position)) int))
1156
1157 (defun menu-shell-append (menu-shell menu-item)
1158   (menu-shell-insert menu-shell menu-item :last))
1159
1160 (defun menu-shell-prepend (menu-shell menu-item)
1161   (menu-shell-insert menu-shell menu-item :fisrt))
1162
1163 (defbinding menu-shell-deactivate () nil
1164   (menu-shell menu-shell))
1165
1166 (defbinding menu-shell-select-item () nil
1167   (menu-shell menu-shell)
1168   (menu-item menu-item))
1169
1170 (defbinding menu-shell-deselect () nil
1171   (menu-shell menu-shell))
1172
1173 (defbinding menu-shell-activate-item () nil
1174   (menu-shell menu-shell)
1175   (menu-item menu-item)
1176   (fore-deactivate boolean))
1177
1178
1179
1180 ;;; Menu
1181
1182 (defun %menu-position (menu child)
1183   (etypecase child
1184     (int child)
1185     (keyword (case child
1186                (:first 0)
1187                (:last -1)
1188                (t (error "Invalid position keyword: ~A" child))))
1189     (widget (menu-child-position menu child))))
1190
1191
1192 (defbinding menu-reorder-child (menu menu-item position) nil
1193   (menu menu)
1194   (menu-item menu-item)
1195   ((%menu-position menu position) int))
1196
1197 (def-callback-marshal %menu-popup-callback (nil (x int) (y int) (push-in boolean)))
1198
1199 (defbinding %menu-popup () nil
1200   (menu menu)
1201   (parent-menu-shell (or null menu-shell))
1202   (parent-menu-item (or null menu-item))
1203   (callback-func (or null pointer))
1204   (callback-id unsigned-int)
1205   (button unsigned-int)
1206   (activate-time (unsigned 32)))
1207
1208 (defun menu-popup (menu button activate-time &key callback parent-menu-shell
1209                    parent-menu-item)
1210   (if callback
1211       (with-callback-function (id callback)
1212         (%menu-popup 
1213          menu parent-menu-shell parent-menu-item 
1214          (callback %menu-popup-callback) id button activate-time))
1215     (%menu-popup
1216      menu parent-menu-shell parent-menu-item nil 0 button activate-time)))
1217  
1218 (defbinding menu-set-accel-path () nil
1219   (menu menu)
1220   (accel-path string))
1221
1222 (defbinding menu-reposition () nil
1223   (menu menu))
1224
1225 (defbinding menu-popdown () nil
1226   (menu menu))
1227
1228 (defun menu-child-position (menu child)
1229   (position child (container-children menu)))
1230
1231 (defun menu-active-num (menu)
1232   (menu-child-position menu (menu-active menu)))
1233
1234 (defbinding %menu-set-active () nil
1235   (menu menu)
1236   (index unsigned-int))
1237
1238 (defun (setf menu-active) (menu child)
1239   (%menu-set-active menu (%menu-position menu child))
1240   child)
1241   
1242
1243
1244 ;;; Table
1245
1246 (defbinding table-resize () nil
1247   (table table)
1248   (rows unsigned-int)
1249   (columns unsigned-int))
1250
1251 (defbinding table-attach (table child left right top bottom
1252                           &key options x-options y-options
1253                           (x-padding 0) (y-padding 0)) nil
1254   (table table)
1255   (child widget)
1256   (left unsigned-int)
1257   (right unsigned-int)
1258   (top unsigned-int)
1259   (bottom unsigned-int)
1260   ((append (mklist options) (mklist x-options)) attach-options)
1261   ((append (mklist options) (mklist y-options)) attach-options)
1262   (x-padding unsigned-int)
1263   (y-padding unsigned-int))
1264
1265
1266 (defbinding %table-set-row-spacing () nil
1267   (table table)
1268   (row unsigned-int)
1269   (spacing unsigned-int))
1270
1271 (defbinding %table-set-row-spacings () nil
1272   (table table)
1273   (spacing unsigned-int))
1274
1275 (defun (setf table-row-spacing) (spacing table &optional row)
1276   (if row
1277       (%table-set-row-spacing table row spacing)
1278     (%table-set-row-spacings table spacing))
1279   spacing)
1280
1281 (defbinding %table-get-row-spacing () unsigned-int
1282   (table table)
1283   (row unsigned-int))
1284
1285 (defbinding %table-get-default-row-spacing () unsigned-int
1286   (table table))
1287
1288 (defun table-row-spacing (table &optional row)
1289   (if row
1290       (%table-get-row-spacing table row)
1291     (%table-get-default-row-spacing table)))
1292
1293
1294 (defbinding %table-set-col-spacing () nil
1295   (table table)
1296   (col unsigned-int)
1297   (spacing unsigned-int))
1298
1299 (defbinding %table-set-col-spacings () nil
1300   (table table)
1301   (spacing unsigned-int))
1302
1303 (defun (setf table-col-spacing) (spacing table &optional col)
1304   (if col
1305       (%table-set-col-spacing table col spacing)
1306     (%table-set-col-spacings table spacing))
1307   spacing)
1308
1309 (defbinding %table-get-col-spacing () unsigned-int
1310   (table table)
1311   (col unsigned-int))
1312
1313 (defbinding %table-get-default-col-spacing () unsigned-int
1314   (table table))
1315
1316 (defun table-col-spacing (table &optional col)
1317   (if col
1318       (%table-get-col-spacing table col)
1319     (%table-get-default-col-spacing table)))
1320   
1321
1322
1323 ;;; Toolbar
1324
1325 (defbinding %toolbar-insert-element () widget
1326   (toolbar toolbar)
1327   (type toolbar-child-type)
1328   (widget (or null widget))
1329   (text string)
1330   (tooltip-text string)
1331   (tooltip-private-text string)
1332   (icon (or null widget))
1333   (nil null)
1334   (nil null)
1335   (position int))
1336
1337 (defbinding %toolbar-insert-stock () widget
1338   (toolbar toolbar)
1339   (stock-id string)
1340   (tooltip-text string)
1341   (tooltip-private-text string)
1342   (nil null)
1343   (nil null)
1344   (position int))
1345
1346 (defun toolbar-insert (toolbar position element
1347                        &key tooltip-text tooltip-private-text
1348                        type icon group callback object)
1349   (let* ((numpos (case position
1350                    (:first -1)
1351                    (:last 0)
1352                    (t position)))
1353          (widget
1354           (cond
1355            ((or
1356              (eq type :space)
1357              (and (not type) (eq element :space)))
1358             (%toolbar-insert-element
1359              toolbar :space nil nil
1360              tooltip-text tooltip-private-text nil numpos))
1361            ((or
1362              (eq type :widget)
1363              (and (not type) (typep element 'widget)))
1364             (%toolbar-insert-element
1365              toolbar :widget element nil
1366              tooltip-text tooltip-private-text nil numpos))
1367            ((or
1368              (eq type :stock)
1369              (and
1370               (not type)
1371               (typep element 'string)
1372               (stock-lookup element)))
1373             (%toolbar-insert-stock
1374              toolbar element tooltip-text tooltip-private-text numpos))
1375            ((typep element 'string)
1376             (%toolbar-insert-element
1377              toolbar (or type :button) (when (eq type :radio-button) group)
1378              element tooltip-text tooltip-private-text 
1379              (etypecase icon
1380                (null nil)
1381                (widget icon)
1382                ((or pathname string vector)
1383                 (make-instance 'image 
1384                  :source icon ; :icon-size (toolbar-icon-size toolbar)
1385                  )))
1386              numpos))
1387            ((error "Invalid element type: ~A" element)))))
1388     (when callback
1389       (signal-connect widget 'clicked callback :object object))
1390     widget))
1391
1392 (defun toolbar-append (toolbar element &key tooltip-text tooltip-private-text
1393                        type icon group callback object)
1394   (toolbar-insert
1395    toolbar :first element :type type :icon icon :group group
1396    :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text
1397    :callback callback :object object))
1398
1399 (defun toolbar-prepend (toolbar element &key tooltip-text tooltip-private-text
1400                         type icon group callback object)
1401   (toolbar-insert
1402    toolbar :last element :type type :icon icon :group group
1403    :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text
1404    :callback callback :object object))
1405
1406
1407 (defun toolbar-insert-space (toolbar position)
1408   (toolbar-insert toolbar position :space))
1409
1410 (defun toolbar-append-space (toolbar)
1411   (toolbar-append toolbar :space))
1412
1413 (defun toolbar-prepend-space (toolbar)
1414   (toolbar-prepend toolbar :space))
1415
1416
1417 (defun toolbar-enable-tooltips (toolbar)
1418   (setf (toolbar-tooltips-p toolbar) t))
1419
1420 (defun toolbar-disable-tooltips (toolbar)
1421   (setf (toolbar-tooltips-p toolbar) nil))
1422
1423
1424 (defbinding toolbar-remove-space () nil
1425   (toolbar toolbar)
1426   (position int))
1427
1428 (defbinding toolbar-unset-icon-size () nil
1429   (toolbar toolbar))
1430
1431 (defbinding toolbar-unset-style () nil
1432   (toolbar toolbar))
1433
1434
1435 ;;; Editable
1436
1437 (defbinding editable-select-region (editable &optional (start 0) end) nil
1438   (editable editable)
1439   (start int)
1440   ((or end -1) int))
1441
1442 (defbinding editable-get-selection-bounds (editable) nil
1443   (editable editable)
1444   (start int :out)
1445   (end int :out))
1446
1447 (defbinding editable-insert-text
1448     (editable text &optional (position 0)) nil
1449   (editable editable)
1450   (text string)
1451   ((length text) int)
1452   ((or position -1) int :in-out))
1453
1454 (defun editable-append-text (editable text)
1455   (editable-insert-text editable text nil))
1456
1457 (defun editable-prepend-text (editable text)
1458   (editable-insert-text editable text 0))
1459
1460 (defbinding editable-delete-text (editable &optional (start 0) end) nil
1461   (editable editable)
1462   (start int)
1463   ((or end -1) int))
1464
1465 (defbinding (editable-text "gtk_editable_get_chars")
1466     (editable &optional (start 0) end) string
1467   (editable editable)
1468   (start int)
1469   ((or end -1) int))
1470
1471 (defun (setf editable-text) (text editable)
1472   (if text
1473       (editable-delete-text
1474        editable
1475        (editable-insert-text editable text))
1476     (editable-delete-text editable))
1477   text)
1478
1479 (defbinding editable-cut-clipboard () nil
1480   (editable editable))
1481
1482 (defbinding editable-copy-clipboard () nil
1483   (editable editable))
1484
1485 (defbinding editable-paste-clipboard () nil
1486   (editable editable))
1487
1488 (defbinding editable-delete-selection () nil
1489   (editable editable))
1490
1491
1492
1493 ;;; Spin button
1494
1495 (defun spin-button-value-as-int (spin-button)
1496   (round (spin-button-value spin-button)))
1497
1498 (defbinding spin-button-spin () nil
1499   (spin-button spin-button)
1500   (direction spin-type)
1501   (increment single-float))
1502
1503 (defbinding spin-button-update () nil
1504   (spin-button spin-button))
1505
1506
1507
1508 ; ;;; Ruler
1509
1510 (defbinding ruler-set-range () nil
1511   (ruler ruler)
1512   (lower single-float)
1513   (upper single-float)
1514   (position single-float)
1515   (max-size single-float))
1516
1517 (defbinding ruler-draw-ticks () nil
1518   (ruler ruler))
1519
1520 (defbinding ruler-draw-pos () nil
1521   (ruler ruler))
1522
1523
1524
1525 ;;; Range
1526
1527 (defun range-lower (range)
1528   (adjustment-lower (range-adjustment range)))
1529
1530 (defun range-upper (range)
1531   (adjustment-upper (range-adjustment range)))
1532
1533 (defun (setf range-lower) (value range)
1534   (setf (adjustment-lower (range-adjustment range)) value))
1535
1536 (defun (setf range-upper) (value range)
1537   (setf (adjustment-upper (range-adjustment range)) value))
1538
1539 (defun range-page-increment (range)
1540   (adjustment-page-increment (range-adjustment range)))
1541
1542 (defun range-step-increment (range)
1543   (adjustment-step-increment (range-adjustment range)))
1544
1545 (defun (setf range-page-increment) (value range)
1546   (setf (adjustment-page-increment (range-adjustment range)) value))
1547
1548 (defun (setf range-step-increment) (value range)
1549   (setf (adjustment-step-increment (range-adjustment range)) value))
1550
1551 (defbinding range-set-range () nil
1552   (range range)
1553   (lower double-float)
1554   (upper double-float))
1555
1556 (defbinding range-set-increments () nil
1557   (range range)
1558   (step double-float)
1559   (page double-float))
1560
1561
1562 ;;; Scale
1563
1564 ; (defbinding scale-draw-value () nil
1565 ;   (scale scale))
1566
1567
1568
1569 ;;; Progress bar
1570
1571 (defbinding progress-bar-pulse () nil
1572   (progress-bar progress-bar))
1573
1574
1575 ;;; Size group
1576
1577 (defmethod initialize-instance ((size-group size-group) &rest initargs 
1578                                 &key widget widgets)
1579   (declare (ignore widget widgets))
1580   (prog1
1581       (call-next-method)
1582     (initial-add size-group #'size-group-add-widget 
1583      initargs :widget :widgets)))
1584
1585
1586 (defbinding size-group-add-widget () nil
1587   (size-group size-group)
1588   (widget widget))
1589
1590 (defbinding size-group-remove-widget () nil
1591   (size-group size-group)
1592   (widget widget))
1593
1594
1595 ;;; Stock items
1596
1597 (defbinding %stock-item-copy () pointer
1598   (location pointer))
1599
1600 (defbinding %stock-item-free () nil
1601   (location pointer))
1602
1603 (defmethod reference-foreign ((class (eql (find-class 'stock-item))) location)
1604   (%stock-item-copy location))
1605
1606 (defmethod unreference-foreign ((class (eql (find-class 'stock-item))) location)
1607   (%stock-item-free location))
1608
1609 (defbinding stock-add (stock-item) nil
1610   (stock-item stock-item)
1611   (1 unsigned-int))
1612
1613 (defbinding stock-list-ids () (gslist string))
1614
1615 (defbinding %stock-lookup () boolean
1616   (stock-id string)
1617   (location pointer))
1618
1619 (defun stock-lookup (stock-id)
1620   (let ((location 
1621          (allocate-memory (proxy-instance-size (find-class 'stock-item)))))
1622     (unwind-protect
1623         (when (%stock-lookup stock-id location)
1624           (ensure-proxy-instance 'stock-item (%stock-item-copy location)))
1625         (deallocate-memory location))))
1626
1627
1628 ;;; Tooltips
1629
1630 (defbinding tooltips-enable () nil
1631   (tooltips tooltips))
1632
1633 (defbinding tooltips-disable () nil
1634   (tooltips tooltips))
1635
1636 (defun (setf tooltips-enabled-p) (enable tooltips)
1637   (if enable
1638       (tooltips-enable tooltips)
1639     (tooltips-disable tooltips)))
1640
1641 (defbinding tooltips-set-tip () nil
1642   (tooltips tooltips)
1643   (widget widget)
1644   (tip-text string)
1645   (tip-private string))
1646
1647 (defbinding tooltips-force-window () nil
1648   (tooltips tooltips))
1649
1650
1651
1652 ;;; Rc
1653
1654 (defbinding rc-add-default-file (filename) nil
1655   ((namestring (truename filename)) string))
1656
1657 (defbinding rc-parse (filename) nil
1658   ((namestring (truename filename)) string))
1659
1660 (defbinding rc-parse-string () nil
1661   (rc-string string))
1662
1663 (defbinding rc-reparse-all () nil)
1664
1665 (defbinding rc-get-style () style
1666   (widget widget))
1667
1668
1669
1670 ;;; Accelerator Groups
1671 #|
1672 (defbinding accel-group-activate (accel-group key modifiers) boolean
1673   (accel-group accel-group)
1674   ((gdk:keyval-from-name key) unsigned-int)
1675   (modifiers gdk:modifier-type))
1676
1677 (defbinding accel-groups-activate (object key modifiers) boolean
1678   (object object)
1679   ((gdk:keyval-from-name key) unsigned-int)
1680   (modifiers gdk:modifier-type))
1681
1682 (defbinding accel-group-attach () nil
1683   (accel-group accel-group)
1684   (object object))
1685
1686 (defbinding accel-group-detach () nil
1687   (accel-group accel-group)
1688   (object object))
1689
1690 (defbinding accel-group-lock () nil
1691   (accel-group accel-group))
1692
1693 (defbinding accel-group-unlock () nil
1694   (accel-group accel-group))
1695
1696
1697 ;;; Accelerator Groups Entries
1698
1699 (defbinding accel-group-get-entry (accel-group key modifiers) accel-entry
1700   (accel-group accel-group)
1701   ((gdk:keyval-from-name key) unsigned-int)
1702   (modifiers gdk:modifier-type))
1703
1704 (defbinding accel-group-lock-entry (accel-group key modifiers) nil
1705   (accel-group accel-group)
1706   ((gdk:keyval-from-name key) unsigned-int)
1707   (modifiers gdk:modifier-type))
1708
1709 (defbinding accel-group-unlock-entry (accel-group key modifiers) nil
1710   (accel-group accel-group)
1711   ((gdk:keyval-from-name key) unsigned-int)
1712   (modifiers gdk:modifier-type))
1713
1714 (defbinding accel-group-add
1715     (accel-group key modifiers flags object signal) nil
1716   (accel-group accel-group)
1717   ((gdk:keyval-from-name key) unsigned-int)
1718   (modifiers gdk:modifier-type)
1719   (flags accel-flags)
1720   (object object)
1721   ((name-to-string signal) string))
1722
1723 (defbinding accel-group-add (accel-group key modifiers object) nil
1724   (accel-group accel-group)
1725   ((gdk:keyval-from-name key) unsigned-int)
1726   (modifiers gdk:modifier-type)
1727   (object object))
1728
1729
1730 ;;; Accelerator Signals
1731
1732 (defbinding accel-group-handle-add
1733     (object signal-id accel-group key modifiers flags) nil
1734   (object object)
1735   (signal-id unsigned-int)
1736   (accel-group accel-group)
1737   ((gdk:keyval-from-name key) unsigned-int)
1738   (modifiers gdk:modifier-type)
1739   (flags accel-flags))
1740
1741 (defbinding accel-group-handle-remove
1742     (object accel-group key modifiers) nil
1743   (object object)
1744   (accel-group accel-group)
1745   ((gdk:keyval-from-name key) unsigned-int)
1746   (modifiers gdk:modifier-type))
1747 |#