chiark / gitweb /
Initial bindings for tree and list widgets
[clg] / gtk / gtk.lisp
CommitLineData
560af5c5 1;; Common Lisp bindings for GTK+ v2.0
bbaeff4b 2;; Copyright (C) 1999-2001 Espen S. Johnsen <esj@stud.cs.uit.no>
560af5c5 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
8755b1a5 18;; $Id: gtk.lisp,v 1.16 2004-11-07 01:23:38 espen Exp $
560af5c5 19
20
21(in-package "GTK")
22
23;;; Gtk version
24
bbaeff4b 25(defbinding check-version () string
560af5c5 26 (required-major unsigned-int)
27 (required-minor unsigned-int)
28 (required-micro unsigned-int))
29
bbaeff4b 30(defbinding query-version () nil
560af5c5 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
0f476ab5 42(defbinding get-default-language () string)
560af5c5 43
44
9adccb27 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
0f476ab5 66;;; Acccel group
560af5c5 67
68
1047e159 69
560af5c5 70;;; Acccel label
71
bbaeff4b 72(defbinding accel-label-refetch () boolean
560af5c5 73 (accel-label accel-label))
74
75
0f476ab5 76;;; Adjustment
560af5c5 77
1047e159 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
0f476ab5 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))
560af5c5 97
0f476ab5 98
0f476ab5 99;;; Arrow -- no functions
100
101
102
103;;; Aspect frame
104
105
106;;; Bin
560af5c5 107
108(defun (setf bin-child) (child bin)
0f476ab5 109 (when-bind (current-child (bin-child bin))
110 (container-remove bin current-child))
560af5c5 111 (container-add bin child)
112 child)
113
f36ca6af 114
0f476ab5 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
1047e159 135(defun box-pack (box child &key from-end expand fill (padding 0))
f5b67f2b 136 (if from-end
137 (box-pack-end box child expand fill padding)
138 (box-pack-start box child expand fill padding)))
0f476ab5 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
560af5c5 163;;; Button
164
bbaeff4b 165(defbinding button-pressed () nil
560af5c5 166 (button button))
167
0f476ab5 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
269
f5b67f2b 270(defmethod shared-initialize ((combo combo) names &rest initargs
271 &key popdown-strings)
9adccb27 272 (declare (ignore initargs))
f5b67f2b 273 (call-next-method)
274 (when popdown-strings
275 (combo-set-popdown-strings combo popdown-strings)))
276
0f476ab5 277(defbinding combo-set-popdown-strings () nil
278 (combo combo)
279 (strings (glist string)))
280
281(defbinding combo-disable-activate () nil
282 (combo combo))
283
284
285
48da76bf 286;;;; Dialog
0f476ab5 287
1047e159 288(defmethod shared-initialize ((dialog dialog) names &rest initargs &key button)
9adccb27 289 (declare (ignore button))
48da76bf 290 (call-next-method)
0f476ab5 291 (dolist (button-definition (get-all initargs :button))
1047e159 292 (apply #'dialog-add-button dialog (mklist button-definition))))
48da76bf 293
0f476ab5 294
295(defvar %*response-id-key* (gensym))
296
1047e159 297(defun %dialog-find-response-id-num (dialog id &optional create-p error-p)
0f476ab5 298 (or
1047e159 299 (cadr (assoc id (rest (type-expand-1 'response-type))))
300 (let ((response-ids (object-data dialog %*response-id-key*)))
0f476ab5 301 (cond
1047e159 302 ((and response-ids (position id response-ids :test #'equal)))
303 (create-p
304 (cond
305 (response-ids
306 (vector-push-extend id response-ids)
307 (1- (length response-ids)))
308 (t
309 (setf
310 (object-data dialog %*response-id-key*)
311 (make-array 1 :adjustable t :fill-pointer t :initial-element id))
312 0)))
313 (error-p
314 (error "Invalid response: ~A" id))))))
0f476ab5 315
316(defun %dialog-find-response-id (dialog response-id-num)
317 (if (< response-id-num 0)
318 (car
319 (rassoc
320 (list response-id-num)
1047e159 321 (rest (type-expand-1 'response-type)) :test #'equal))
322 (aref (object-data dialog %*response-id-key*) response-id-num )))
0f476ab5 323
324
48da76bf 325(defmethod signal-connect ((dialog dialog) signal function &key object after)
326 (let ((response-id-num (%dialog-find-response-id-num dialog signal)))
327 (cond
328 (response-id-num
329 (call-next-method
330 dialog 'response
331 #'(lambda (dialog id)
332 (when (= id response-id-num)
333 (cond
334 ((eq object t) (funcall function dialog))
335 (object (funcall function object))
336 (t (funcall function)))))
337 :object t :after after))
1047e159 338 ((call-next-method)))))
0f476ab5 339
340
48da76bf 341(defbinding dialog-run () nil
342 (dialog dialog))
0f476ab5 343
48da76bf 344(defbinding dialog-response (dialog response-id) nil
0f476ab5 345 (dialog dialog)
48da76bf 346 ((%dialog-find-response-id-num dialog response-id nil t) int))
0f476ab5 347
348
349(defbinding %dialog-add-button () button
350 (dialog dialog)
351 (text string)
352 (response-id-num int))
353
1047e159 354(defun dialog-add-button (dialog label &optional (response label)
355 &key default object after)
356 "Adds a button to the dialog. If no response is given, then label
357 will be used."
358 (let* ((id (if (functionp response)
359 label
360 response))
361 (id-num (%dialog-find-response-id-num dialog id t))
362 (button (%dialog-add-button dialog label id-num)))
363 (when (functionp response)
364 (signal-connect dialog id response :object object :after after))
365 (when default
366 (%dialog-set-default-response dialog id-num))
0f476ab5 367 button))
368
369
370(defbinding %dialog-add-action-widget () button
371 (dialog dialog)
372 (action-widget widget)
373 (response-id-num int))
374
1047e159 375(defun dialog-add-action-widget (dialog widget &optional (response widget)
376 &key default object after)
377 (let* ((id (if (functionp response)
378 widget
379 response))
380 (id-num (%dialog-find-response-id-num dialog id t)))
381 (%dialog-add-action-widget dialog widget id-num)
382 (when (functionp response)
383 (signal-connect dialog id response :object object :after after))
384 (when default
385 (%dialog-set-default-response dialog id-num))
0f476ab5 386 widget))
0f476ab5 387
0f476ab5 388
48da76bf 389(defbinding %dialog-set-default-response () nil
390 (dialog dialog)
391 (response-id-num int))
0f476ab5 392
48da76bf 393(defun dialog-set-default-response (dialog response-id)
394 (%dialog-set-default-response
395 dialog (%dialog-find-response-id-num dialog response-id nil t)))
0f476ab5 396
48da76bf 397(defbinding dialog-set-response-sensitive (dialog response-id sensitive) nil
398 (dialog dialog)
399 ((%dialog-find-response-id-num dialog response-id nil t) int)
400 (sensitive boolean))
0f476ab5 401
402
48da76bf 403;; Addition dialog functions
404
405(defmethod container-add ((dialog dialog) (child widget) &rest args)
1047e159 406 (apply #'container-add (dialog-vbox dialog) child args))
48da76bf 407
408(defmethod container-remove ((dialog dialog) (child widget))
1047e159 409 (container-remove (dialog-vbox dialog) child))
0f476ab5 410
48da76bf 411(defmethod container-children ((dialog dialog))
1047e159 412 (container-children (dialog-vbox dialog)))
48da76bf 413
414(defmethod (setf container-children) (children (dialog dialog))
1047e159 415 (setf (container-children (dialog-vbox dialog)) children))
560af5c5 416
560af5c5 417
560af5c5 418
48da76bf 419;;; Drawing area -- no functions
560af5c5 420
421
aaa6e6cb 422;;; Entry
560af5c5 423
aaa6e6cb 424(defbinding entry-get-layout () pango:layout
425 (entry entry))
426
427(defbinding entry-get-layout-offsets () nil
428 (entry entry)
429 (x int :out)
430 (y int :out))
560af5c5 431
560af5c5 432
1047e159 433;;; Image
434
435(defbinding image-set-from-file () nil
436 (image image)
437 (filename pathname))
438
439(defbinding image-set-from-pixmap () nil
440 (image image)
441 (pixmap gdk:pixmap)
442 (mask gdk:bitmap))
443
444(defbinding image-set-from-stock () nil
445 (image image)
446 (stock-id string)
447 (icon-size icon-size))
448
449(defun image-set-from-pixmap-data (image pixmap-data)
450 (multiple-value-bind (pixmap mask) (gdk:pixmap-create pixmap-data)
451 (image-set-from-pixmap image pixmap mask)))
452
453(defun image-set-from-source (image source)
454 (etypecase source
455 (pathname (image-set-from-file image source))
456 (string (if (stock-lookup source)
457 (setf (image-stock image) source)
458 (image-set-from-file image source)))
459 (vector (image-set-from-pixmap-data image source))))
460
461
462(defmethod shared-initialize ((image image) names &rest initargs
463 &key file pixmap source)
464 (prog1
465 (if (vectorp pixmap)
466 (progn
467 (remf initargs :pixmap)
468 (apply #'call-next-method image names initargs))
469 (call-next-method))
470 (cond
471 (file (image-set-from-file image file))
472 ((vectorp pixmap) (image-set-from-pixmap-data image pixmap))
473 (source (image-set-from-source image source)))))
474
560af5c5 475
0f476ab5 476;;; Label
560af5c5 477
aaa6e6cb 478(defbinding label-get-layout-offsets () nil
1047e159 479 (label label)
aaa6e6cb 480 (x int :out)
481 (y int :out))
482
0f476ab5 483(defbinding label-select-region () nil
484 (label label)
485 (start int)
486 (end int))
560af5c5 487
1047e159 488(defbinding label-get-text () string
aaa6e6cb 489 (label label))
490
491(defbinding label-get-layout () pango:layout
492 (label label))
493
1047e159 494(defbinding label-get-selection-bounds () boolean
aaa6e6cb 495 (label label)
496 (start int :out)
497 (end int :out))
f36ca6af 498
560af5c5 499
500
501;;; Radio button
502
e5b416f0 503(defbinding %radio-button-get-group () pointer
d520140e 504 (radio-button radio-button))
505
bbaeff4b 506(defbinding %radio-button-set-group () nil
d520140e 507 (radio-button radio-button)
508 (group pointer))
560af5c5 509
d520140e 510(defun radio-button-add-to-group (button1 button2)
511 "Add BUTTON1 to the group which BUTTON2 belongs to."
512 (%radio-button-set-group button1 (%radio-button-get-group button2)))
513
e5b416f0 514
d520140e 515(defmethod initialize-instance ((button radio-button)
e5b416f0 516 &rest initargs &key group-with)
517 (declare (ignore initargs))
d520140e 518 (call-next-method)
e5b416f0 519 (when group-with
f5b67f2b 520 (radio-button-add-to-group button group-with)))
560af5c5 521
522
523;;; Option menu
524
bbaeff4b 525(defbinding %option-menu-set-menu () nil
f36ca6af 526 (option-menu option-menu)
527 (menu widget))
560af5c5 528
bbaeff4b 529(defbinding %option-menu-remove-menu () nil
f36ca6af 530 (option-menu option-menu))
560af5c5 531
f36ca6af 532(defun (setf option-menu-menu) (menu option-menu)
533 (if (not menu)
534 (%option-menu-remove-menu option-menu)
535 (%option-menu-set-menu option-menu menu))
536 menu)
560af5c5 537
538
539
540;;; Item
541
bbaeff4b 542(defbinding item-select () nil
560af5c5 543 (item item))
544
bbaeff4b 545(defbinding item-deselect () nil
560af5c5 546 (item item))
547
bbaeff4b 548(defbinding item-toggle () nil
560af5c5 549 (item item))
550
551
552
553;;; Menu item
554
f36ca6af 555(defun (setf menu-item-label) (label menu-item)
556 (make-instance 'accel-label
557 :label label :xalign 0.0 :yalign 0.5 :accel-widget menu-item
558 :visible t :parent menu-item)
559 label)
560af5c5 560
f5b67f2b 561(defun menu-item-label (menu-item)
562 (with-slots (child) menu-item
563 (when (typep child 'label)
564 (label-label child))))
565
bbaeff4b 566(defbinding %menu-item-set-submenu () nil
f36ca6af 567 (menu-item menu-item)
568 (submenu menu))
560af5c5 569
bbaeff4b 570(defbinding %menu-item-remove-submenu () nil
f36ca6af 571 (menu-item menu-item))
560af5c5 572
f36ca6af 573(defun (setf menu-item-submenu) (submenu menu-item)
574 (if (not submenu)
575 (%menu-item-remove-submenu menu-item)
576 (%menu-item-set-submenu menu-item submenu))
577 submenu)
560af5c5 578
f5b67f2b 579(defbinding menu-item-set-accel-path () nil
580 (menu-item menu-item)
581 (accel-path string))
582
bbaeff4b 583(defbinding menu-item-select () nil
f36ca6af 584 (menu-item menu-item))
560af5c5 585
bbaeff4b 586(defbinding menu-item-deselect () nil
f36ca6af 587 (menu-item menu-item))
560af5c5 588
bbaeff4b 589(defbinding menu-item-activate () nil
f36ca6af 590 (menu-item menu-item))
560af5c5 591
f5b67f2b 592(defbinding menu-item-toggle-size-request () nil
593 (menu-item menu-item)
594 (requisition int :out))
595
596(defbinding menu-item-toggle-size-allocate () nil
597 (menu-item menu-item)
598 (allocation int))
599
560af5c5 600
601
f36ca6af 602;;; Radio menu item
560af5c5 603
e5b416f0 604(defbinding %radio-menu-item-get-group () pointer
d520140e 605 (radio-menu-item radio-menu-item))
606
bbaeff4b 607(defbinding %radio-menu-item-set-group () nil
d520140e 608 (radio-menu-item radio-menu-item)
609 (group pointer))
610
d520140e 611(defun radio-menu-item-add-to-group (item1 item2)
612 "Add ITEM1 to the group which ITEM2 belongs to."
613 (%radio-menu-item-set-group item1 (%radio-menu-item-get-group item2)))
614
615(defmethod initialize-instance ((item radio-menu-item)
e5b416f0 616 &rest initargs &key group-with)
617 (declare (ignore initargs))
f5b67f2b 618 (prog1
619 (call-next-method)
620 (when group-with
621 (radio-menu-item-add-to-group item group-with))))
d520140e 622
560af5c5 623
624
aaa6e6cb 625;;; Toggle button
626
627(defbinding toggle-button-toggled () nil
628 (toggle-button toggle-button))
629
630
631
560af5c5 632;;; Window
633
7625ebd8 634(defbinding window-set-wmclass () nil
560af5c5 635 (window window)
636 (wmclass-name string)
637 (wmclass-class string))
638
bbaeff4b 639(defbinding window-add-accel-group () nil
560af5c5 640 (window window)
641 (accel-group accel-group))
642
bbaeff4b 643(defbinding window-remove-accel-group () nil
560af5c5 644 (window window)
645 (accel-group accel-group))
646
bbaeff4b 647(defbinding window-activate-focus () int
560af5c5 648 (window window))
649
bbaeff4b 650(defbinding window-activate-default () int
560af5c5 651 (window window))
652
7625ebd8 653(defbinding window-set-default-size (window width height) int
560af5c5 654 (window window)
7625ebd8 655 ((or width -1) int)
656 ((or height -1) int))
560af5c5 657
bbaeff4b 658;(defbinding window-set-geometry-hints)
560af5c5 659
7625ebd8 660(defbinding window-list-toplevels () (glist window))
661
662(defbinding window-add-mnemonic (window key target) nil
663 (window window)
664 ((gdk:keyval-from-name key) unsigned-int)
665 (target widget))
666
667(defbinding window-remove-mnemonic (window key target) nil
668 (window window)
669 ((gdk:keyval-from-name key) unsigned-int)
670 (target widget))
671
672(defbinding window-mnemonic-activate (window key modifier) nil
673 (window window)
674 ((gdk:keyval-from-name key) unsigned-int)
675 (modifier gdk:modifier-type))
676
677(defbinding window-present () nil
678 (window window))
679
680(defbinding window-iconify () nil
681 (window window))
682
683(defbinding window-deiconify () nil
684 (window window))
685
686(defbinding window-stick () nil
687 (window window))
688
689(defbinding window-unstick () nil
690 (window window))
691
692(defbinding window-maximize () nil
693 (window window))
694
695(defbinding window-unmaximize () nil
696 (window window))
697
698(defbinding window-begin-resize-drag () nil
699 (window window)
700 (edge gdk:window-edge)
701 (button int)
702 (root-x int) (root-y int)
9adccb27 703 (timestamp unsigned-int))
7625ebd8 704
705(defbinding window-begin-move-drag () nil
706 (window window)
707 (edge gdk:window-edge)
708 (button int)
709 (root-x int) (root-y int)
9adccb27 710 (timestamp unsigned-int))
7625ebd8 711
712(defbinding window-set-frame-dimensions () nil
713 (window window)
714 (left int) (top int) (rigth int) (bottom int))
715
716(defbinding (window-default-icons "gtk_window_get_default_icon_list")
717 () (glist gdk:pixbuf))
718
719(defbinding %window-get-default-size () nil
720 (window window)
721 (width int :out)
722 (height int :out))
723
724(defun window-get-default-size (window)
725 (multiple-value-bind (width height) (%window-get-default-size window)
726 (values (unless (= width -1) width) (unless (= height -1) height))))
727
728(defbinding window-get-frame-dimensions () nil
729 (window window)
730 (left int :out) (top int :out) (rigth int :out) (bottom int :out))
731
732(defbinding %window-get-icon-list () (glist gdk:pixbuf)
733 (window window))
734
735(defmethod window-icon ((window window))
736 (let ((icon-list (%window-get-icon-list window)))
737 (if (endp (rest icon-list))
738 (first icon-list)
739 icon-list)))
740
741(defbinding window-get-position () nil
742 (window window)
743 (root-x int :out)
744 (root-y int :out))
745
746(defbinding window-get-size () nil
747 (window window)
748 (width int :out)
749 (height int :out))
750
751(defbinding window-move () nil
752 (window window)
753 (x int)
754 (y int))
755
756(defbinding window-parse-geometry () boolean
757 (window window)
758 (geometry string))
759
760(defbinding window-reshow-with-initial-size () nil
761 (window window))
762
763(defbinding window-resize () nil
764 (window window)
765 (width int)
766 (heigth int))
767
768(defbinding %window-set-icon-list () nil
769 (window window)
770 (icon-list (glist gdk:pixbuf)))
771
772(defmethod (setf window-icon) (icon (window window))
773 (%window-set-icon-list window (mklist icon)))
774
775
560af5c5 776
777
1047e159 778;;; File chooser
560af5c5 779
560af5c5 780
560af5c5 781
782
f36ca6af 783;;; Scrolled window
560af5c5 784
560af5c5 785(defun (setf scrolled-window-scrollbar-policy) (policy window)
786 (setf (scrolled-window-hscrollbar-policy window) policy)
787 (setf (scrolled-window-vscrollbar-policy window) policy))
788
bbaeff4b 789(defbinding scrolled-window-add-with-viewport () nil
560af5c5 790 (scrolled-window scrolled-window)
791 (child widget))
792
793
794
d520140e 795
796
797
560af5c5 798
f36ca6af 799;;; Statusbar
560af5c5 800
bbaeff4b 801(defbinding (statusbar-context-id "gtk_statusbar_get_context_id")
802 () unsigned-int
f36ca6af 803 (statusbar statusbar)
804 (context-description string))
560af5c5 805
bbaeff4b 806(defbinding statusbar-push () unsigned-int
f36ca6af 807 (statusbar statusbar)
808 (context-id unsigned-int)
809 (text string))
560af5c5 810
bbaeff4b 811(defbinding statusbar-pop () nil
f36ca6af 812 (statusbar statusbar)
813 (context-id unsigned-int))
560af5c5 814
bbaeff4b 815(defbinding statusbar-remove () nil
f36ca6af 816 (statusbar statusbar)
817 (context-id unsigned-int)
818 (message-id unsigned-int))
560af5c5 819
560af5c5 820
821
822;;; Fixed
823
bbaeff4b 824(defbinding fixed-put () nil
f36ca6af 825 (fixed fixed)
826 (widget widget)
f5b67f2b 827 (x int) (y int))
560af5c5 828
bbaeff4b 829(defbinding fixed-move () nil
f36ca6af 830 (fixed fixed)
831 (widget widget)
f5b67f2b 832 (x int) (y int))
560af5c5 833
834
835
d520140e 836;;; Notebook
560af5c5 837
f5b67f2b 838(defun %notebook-position (notebook page)
839 (etypecase page
840 (int page)
841 (keyword (case page
842 (:first 0)
843 (:last -1)
1047e159 844 (t (error "Invalid position keyword: ~A" page))))
f5b67f2b 845 (widget (notebook-page-num notebook page t))))
846
847(defun %notebook-child (notebook position)
848 (typecase position
849 (widget position)
850 (t (notebook-nth-page-child notebook position))))
851
852
853(defbinding (notebook-insert "gtk_notebook_insert_page_menu")
f36ca6af 854 (notebook position child tab-label &optional menu-label) nil
855 (notebook notebook)
856 (child widget)
857 ((if (stringp tab-label)
f5b67f2b 858 (make-instance 'label :label tab-label)
f36ca6af 859 tab-label) widget)
860 ((if (stringp menu-label)
f5b67f2b 861 (make-instance 'label :label menu-label)
f36ca6af 862 menu-label) (or null widget))
f5b67f2b 863 ((%notebook-position notebook position) int))
560af5c5 864
f5b67f2b 865(defun notebook-append (notebook child tab-label &optional menu-label)
866 (notebook-insert notebook :last child tab-label menu-label))
560af5c5 867
f5b67f2b 868(defun notebook-prepend (notebook child tab-label &optional menu-label)
869 (notebook-insert notebook :first child tab-label menu-label))
560af5c5 870
f5b67f2b 871(defbinding notebook-remove-page (notebook page) nil
f36ca6af 872 (notebook notebook)
1047e159 873 ((%notebook-position notebook page) int))
560af5c5 874
bbaeff4b 875(defbinding %notebook-page-num () int
f36ca6af 876 (notebook notebook)
877 (child widget))
878
f5b67f2b 879(defun notebook-page-num (notebook child &optional error-p)
f36ca6af 880 (let ((page-num (%notebook-page-num notebook child)))
881 (if (= page-num -1)
f5b67f2b 882 (when error-p
883 (error "~A is not a child of ~A" child notebook))
f36ca6af 884 page-num)))
885
bbaeff4b 886(defbinding notebook-next-page () nil
f36ca6af 887 (notebook notebook))
560af5c5 888
bbaeff4b 889(defbinding notebook-prev-page () nil
f36ca6af 890 (notebook notebook))
891
f5b67f2b 892(defbinding notebook-reorder-child (notebook child position) nil
893 (notebook notebook)
894 (child widget)
895 ((%notebook-position notebook position) int))
896
bbaeff4b 897(defbinding notebook-popup-enable () nil
f36ca6af 898 (notebook notebook))
899
bbaeff4b 900(defbinding notebook-popup-disable () nil
f36ca6af 901 (notebook notebook))
902
f5b67f2b 903(defbinding (notebook-nth-page-child "gtk_notebook_get_nth_page")
904 (notebook page) widget
905 (notebook notebook)
906 ((case page
907 (:first 0)
908 (:last -1)
909 (t page)) int))
910
1047e159 911
912(defbinding %notebook-get-current-page () int
f5b67f2b 913 (notebook notebook))
914
1047e159 915(defun notebook-current-page-num (notebook)
916 (let ((num (%notebook-get-current-page notebook)))
917 (when (>= num 0)
918 num)))
919
f5b67f2b 920(defun notebook-current-page (notebook)
1047e159 921 (let ((page-num (notebook-current-page-num notebook)))
922 (when page-num
923 (notebook-nth-page-child notebook page-num))))
f5b67f2b 924
925(defbinding %notebook-set-current-page () nil
926 (notebook notebook)
927 (page-num int))
928
929(defun (setf notebook-current-page) (page notebook)
930 (%notebook-set-current-page notebook (%notebook-position notebook page))
931 page)
932
933
1047e159 934(defbinding (notebook-tab-label "gtk_notebook_get_tab_label")
935 (notebook page) widget
936 (notebook notebook)
937 ((%notebook-child notebook page) widget))
f5b67f2b 938
1047e159 939(defbinding (notebook-tab-label-text "gtk_notebook_get_tab_label_text")
940 (notebook page) string
941 (notebook notebook)
942 ((%notebook-child notebook page) widget))
f5b67f2b 943
1047e159 944(defbinding %notebook-set-tab-label () nil
945 (notebook notebook)
946 (page widget)
947 (tab-label widget))
948
949(defun (setf notebook-tab-label) (tab-label notebook page)
950 (let ((widget (if (stringp tab-label)
951 (make-instance 'label :label tab-label)
952 tab-label)))
953 (%notebook-set-tab-label notebook (%notebook-child notebook page) widget)
954 widget))
f5b67f2b 955
f5b67f2b 956
1047e159 957(defbinding (notebook-menu-label "gtk_notebook_get_menu_label")
958 (notebook page) widget
959 (notebook notebook)
960 ((%notebook-child notebook page) widget))
f5b67f2b 961
1047e159 962(defbinding (notebook-menu-label-text "gtk_notebook_get_menu_label_text")
963 (notebook page) string
964 (notebook notebook)
965 ((%notebook-child notebook page) widget))
f5b67f2b 966
1047e159 967(defbinding %notebook-set-menu-label () nil
968 (notebook notebook)
969 (page widget)
970 (menu-label widget))
971
972(defun (setf notebook-menu-label) (menu-label notebook page)
973 (let ((widget (if (stringp menu-label)
974 (make-instance 'label :label menu-label)
975 menu-label)))
976 (%notebook-set-menu-label notebook (%notebook-child notebook page) widget)
977 widget))
f5b67f2b 978
979
980(defbinding notebook-query-tab-label-packing (notebook page) nil
f36ca6af 981 (notebook notebook)
f5b67f2b 982 ((%notebook-child notebook page) widget)
f36ca6af 983 (expand boolean :out)
984 (fill boolean :out)
985 (pack-type pack-type :out))
986
f5b67f2b 987(defbinding notebook-set-tab-label-packing
988 (notebook page expand fill pack-type) nil
f36ca6af 989 (notebook notebook)
f5b67f2b 990 ((%notebook-child notebook page) widget)
f36ca6af 991 (expand boolean)
992 (fill boolean)
993 (pack-type pack-type))
994
560af5c5 995
996
d520140e 997;;; Paned
560af5c5 998
bbaeff4b 999(defbinding paned-pack1 () nil
d520140e 1000 (paned paned)
1001 (child widget)
1002 (resize boolean)
1003 (shrink boolean))
560af5c5 1004
bbaeff4b 1005(defbinding paned-pack2 () nil
d520140e 1006 (paned paned)
1007 (child widget)
1008 (resize boolean)
1009 (shrink boolean))
560af5c5 1010
f5b67f2b 1011(defun (setf paned-child1) (child paned)
1012 (paned-pack1 paned child nil t)
1013 child)
1014
1015(defun (setf paned-child2) (child paned)
1016 (paned-pack2 paned child t t)
1017 child)
1018
1019;; Defined in gtkglue.c
bbaeff4b 1020(defbinding paned-child1 () widget
d520140e 1021 (paned paned)
1022 (resize boolean :out)
1023 (shrink boolean :out))
560af5c5 1024
f5b67f2b 1025;; Defined in gtkglue.c
bbaeff4b 1026(defbinding paned-child2 () widget
d520140e 1027 (paned paned)
1028 (resize boolean :out)
1029 (shrink boolean :out))
560af5c5 1030
560af5c5 1031
560af5c5 1032
d520140e 1033;;; Layout
560af5c5 1034
bbaeff4b 1035(defbinding layout-put () nil
d520140e 1036 (layout layout)
1037 (widget widget)
1038 (x int)
1039 (y int))
560af5c5 1040
bbaeff4b 1041(defbinding layout-move () nil
d520140e 1042 (layout layout)
1043 (widget widget)
1044 (x int)
1045 (y int))
560af5c5 1046
560af5c5 1047
1048
560af5c5 1049;;; Menu shell
1050
f5b67f2b 1051(defbinding menu-shell-insert (menu-shell menu-item position) nil
f36ca6af 1052 (menu-shell menu-shell)
1053 (menu-item menu-item)
f5b67f2b 1054 ((case position
1055 (:first 0)
1056 (:last -1)
1057 (t position)) int))
560af5c5 1058
f36ca6af 1059(defun menu-shell-append (menu-shell menu-item)
f5b67f2b 1060 (menu-shell-insert menu-shell menu-item :last))
560af5c5 1061
f36ca6af 1062(defun menu-shell-prepend (menu-shell menu-item)
f5b67f2b 1063 (menu-shell-insert menu-shell menu-item :fisrt))
560af5c5 1064
bbaeff4b 1065(defbinding menu-shell-deactivate () nil
f36ca6af 1066 (menu-shell menu-shell))
560af5c5 1067
bbaeff4b 1068(defbinding menu-shell-select-item () nil
f36ca6af 1069 (menu-shell menu-shell)
1070 (menu-item menu-item))
560af5c5 1071
bbaeff4b 1072(defbinding menu-shell-deselect () nil
f36ca6af 1073 (menu-shell menu-shell))
560af5c5 1074
bbaeff4b 1075(defbinding menu-shell-activate-item () nil
f36ca6af 1076 (menu-shell menu-shell)
1077 (menu-item menu-item)
1078 (fore-deactivate boolean))
560af5c5 1079
1080
1081
f5b67f2b 1082;;; Menu
560af5c5 1083
f5b67f2b 1084(defun %menu-position (menu child)
1085 (etypecase child
1086 (int child)
1087 (keyword (case child
1088 (:first 0)
1089 (:last -1)
1047e159 1090 (t (error "Invalid position keyword: ~A" child))))
f5b67f2b 1091 (widget (menu-child-position menu child))))
560af5c5 1092
1093
f5b67f2b 1094(defbinding menu-reorder-child (menu menu-item position) nil
1095 (menu menu)
1096 (menu-item menu-item)
1097 ((%menu-position menu position) int))
560af5c5 1098
8755b1a5 1099(def-callback-marshal %menu-popup-callback (nil (x int) (y int) (push-in boolean)))
560af5c5 1100
f5b67f2b 1101(defbinding %menu-popup () nil
1102 (menu menu)
1103 (parent-menu-shell (or null menu-shell))
1104 (parent-menu-item (or null menu-item))
1105 (callback-func (or null pointer))
1106 (callback-id unsigned-int)
1107 (button unsigned-int)
1108 (activate-time (unsigned 32)))
1109
1110(defun menu-popup (menu button activate-time &key callback parent-menu-shell
1111 parent-menu-item)
1112 (if callback
1113 (let ((callback-id (register-callback-function callback)))
1114 (unwind-protect
1115 (%menu-popup
1116 menu parent-menu-shell parent-menu-item
8755b1a5 1117 (callback %menu-popup-callback)
ff9c4b4c 1118 callback-id button activate-time)
f5b67f2b 1119 (destroy-user-data callback-id)))
1120 (%menu-popup
1121 menu parent-menu-shell parent-menu-item nil 0 button activate-time)))
1122
1123(defbinding menu-set-accel-path () nil
1124 (menu menu)
1125 (accel-path string))
560af5c5 1126
bbaeff4b 1127(defbinding menu-reposition () nil
f36ca6af 1128 (menu menu))
560af5c5 1129
bbaeff4b 1130(defbinding menu-popdown () nil
f36ca6af 1131 (menu menu))
560af5c5 1132
f5b67f2b 1133(defun menu-child-position (menu child)
1134 (position child (container-children menu)))
1135
1136(defun menu-active-num (menu)
1137 (menu-child-position menu (menu-active menu)))
1138
bbaeff4b 1139(defbinding %menu-set-active () nil
f36ca6af 1140 (menu menu)
1141 (index unsigned-int))
560af5c5 1142
f5b67f2b 1143(defun (setf menu-active) (menu child)
1144 (%menu-set-active menu (%menu-position menu child))
1145 child)
d520140e 1146
560af5c5 1147
1148
f36ca6af 1149;;; Table
560af5c5 1150
bbaeff4b 1151(defbinding table-resize () nil
f36ca6af 1152 (table table)
1153 (rows unsigned-int)
1154 (columns unsigned-int))
560af5c5 1155
bbaeff4b 1156(defbinding table-attach (table child left right top bottom
f5b67f2b 1157 &key (x-options '(:expand :fill))
1158 (y-options '(:expand :fill))
1159 (x-padding 0) (y-padding 0)) nil
f36ca6af 1160 (table table)
1161 (child widget)
1162 (left unsigned-int)
1163 (right unsigned-int)
1164 (top unsigned-int)
1165 (bottom unsigned-int)
1166 (x-options attach-options)
1167 (y-options attach-options)
1168 (x-padding unsigned-int)
1169 (y-padding unsigned-int))
1170
e5b416f0 1171
bbaeff4b 1172(defbinding %table-set-row-spacing () nil
f36ca6af 1173 (table table)
1174 (row unsigned-int)
1175 (spacing unsigned-int))
1176
e5b416f0 1177(defbinding %table-set-row-spacings () nil
1178 (table table)
1179 (spacing unsigned-int))
1180
1181(defun (setf table-row-spacing) (spacing table &optional row)
1182 (if row
1183 (%table-set-row-spacing table row spacing)
1184 (%table-set-row-spacings table spacing))
f36ca6af 1185 spacing)
1186
e5b416f0 1187(defbinding %table-get-row-spacing () unsigned-int
f36ca6af 1188 (table table)
e5b416f0 1189 (row unsigned-int))
1190
1191(defbinding %table-get-default-row-spacing () unsigned-int
1192 (table table))
1193
1194(defun table-row-spacing (table &optional row)
1195 (if row
1196 (%table-get-row-spacing table row)
1197 (%table-get-default-row-spacing table)))
1198
f36ca6af 1199
bbaeff4b 1200(defbinding %table-set-col-spacing () nil
f36ca6af 1201 (table table)
1202 (col unsigned-int)
1203 (spacing unsigned-int))
1204
e5b416f0 1205(defbinding %table-set-col-spacings () nil
1206 (table table)
1207 (spacing unsigned-int))
1208
1209(defun (setf table-col-spacing) (spacing table &optional col)
1210 (if col
1211 (%table-set-col-spacing table col spacing)
1212 (%table-set-col-spacings table spacing))
f36ca6af 1213 spacing)
1214
e5b416f0 1215(defbinding %table-get-col-spacing () unsigned-int
f36ca6af 1216 (table table)
e5b416f0 1217 (col unsigned-int))
1218
1219(defbinding %table-get-default-col-spacing () unsigned-int
1220 (table table))
1221
1222(defun table-col-spacing (table &optional col)
1223 (if col
1224 (%table-get-col-spacing table col)
1225 (%table-get-default-col-spacing table)))
1226
1227
f36ca6af 1228
1229;;; Toolbar
1230
bbaeff4b 1231(defbinding %toolbar-insert-element () widget
f36ca6af 1232 (toolbar toolbar)
1233 (type toolbar-child-type)
1234 (widget (or null widget))
1235 (text string)
1236 (tooltip-text string)
1237 (tooltip-private-text string)
1238 (icon (or null widget))
1239 (nil null)
1240 (nil null)
1241 (position int))
560af5c5 1242
f5b67f2b 1243(defbinding %toolbar-insert-stock () widget
1244 (toolbar toolbar)
1245 (stock-id string)
1246 (tooltip-text string)
1247 (tooltip-private-text string)
1248 (nil null)
1249 (nil null)
1250 (position int))
1251
1252(defun toolbar-insert (toolbar position element
1253 &key tooltip-text tooltip-private-text
1254 type icon group callback object)
1255 (let* ((numpos (case position
1047e159 1256 (:first -1)
1257 (:last 0)
f5b67f2b 1258 (t position)))
1259 (widget
1260 (cond
1261 ((or
1262 (eq type :space)
1263 (and (not type) (eq element :space)))
1264 (%toolbar-insert-element
1265 toolbar :space nil nil
1266 tooltip-text tooltip-private-text nil numpos))
1267 ((or
1268 (eq type :widget)
1269 (and (not type) (typep element 'widget)))
1270 (%toolbar-insert-element
1271 toolbar :widget element nil
1272 tooltip-text tooltip-private-text nil numpos))
1273 ((or
1274 (eq type :stock)
1275 (and
1276 (not type)
1277 (typep element 'string)
1278 (stock-lookup element)))
1279 (%toolbar-insert-stock
1280 toolbar element tooltip-text tooltip-private-text numpos))
1281 ((typep element 'string)
1282 (%toolbar-insert-element
1283 toolbar (or type :button) (when (eq type :radio-button) group)
1047e159 1284 element tooltip-text tooltip-private-text
1285 (etypecase icon
1286 (null nil)
1287 (widget icon)
1288 ((or pathname string vector)
1289 (make-instance 'image
1290 :source icon ; :icon-size (toolbar-icon-size toolbar)
1291 )))
1292 numpos))
f5b67f2b 1293 ((error "Invalid element type: ~A" element)))))
f36ca6af 1294 (when callback
f5b67f2b 1295 (signal-connect widget 'clicked callback :object object))
1296 widget))
f36ca6af 1297
f5b67f2b 1298(defun toolbar-append (toolbar element &key tooltip-text tooltip-private-text
1299 type icon group callback object)
1300 (toolbar-insert
1301 toolbar :first element :type type :icon icon :group group
f36ca6af 1302 :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text
f5b67f2b 1303 :callback callback :object object))
f36ca6af 1304
f5b67f2b 1305(defun toolbar-prepend (toolbar element &key tooltip-text tooltip-private-text
1306 type icon group callback object)
1307 (toolbar-insert
1308 toolbar :last element :type type :icon icon :group group
f36ca6af 1309 :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text
f5b67f2b 1310 :callback callback :object object))
1311
f36ca6af 1312
1313(defun toolbar-insert-space (toolbar position)
f5b67f2b 1314 (toolbar-insert toolbar position :space))
f36ca6af 1315
1316(defun toolbar-append-space (toolbar)
f5b67f2b 1317 (toolbar-append toolbar :space))
f36ca6af 1318
1319(defun toolbar-prepend-space (toolbar)
f5b67f2b 1320 (toolbar-prepend toolbar :space))
f36ca6af 1321
560af5c5 1322
f36ca6af 1323(defun toolbar-enable-tooltips (toolbar)
1324 (setf (toolbar-tooltips-p toolbar) t))
560af5c5 1325
f36ca6af 1326(defun toolbar-disable-tooltips (toolbar)
1327 (setf (toolbar-tooltips-p toolbar) nil))
560af5c5 1328
1329
f5b67f2b 1330(defbinding toolbar-remove-space () nil
1331 (toolbar toolbar)
1332 (position int))
560af5c5 1333
f5b67f2b 1334(defbinding toolbar-unset-icon-size () nil
1335 (toolbar toolbar))
560af5c5 1336
f5b67f2b 1337(defbinding toolbar-unset-style () nil
1338 (toolbar toolbar))
560af5c5 1339
1340
bbaeff4b 1341;;; Editable
1047e159 1342
bbaeff4b 1343(defbinding editable-select-region (editable &optional (start 0) end) nil
f36ca6af 1344 (editable editable)
1345 (start int)
1346 ((or end -1) int))
560af5c5 1347
1047e159 1348(defbinding editable-get-selection-bounds (editable) nil
1349 (editable editable)
1350 (start int :out)
1351 (end int :out))
1352
bbaeff4b 1353(defbinding editable-insert-text
f36ca6af 1354 (editable text &optional (position 0)) nil
1355 (editable editable)
1356 (text string)
1357 ((length text) int)
1358 ((or position -1) int :in-out))
560af5c5 1359
f36ca6af 1360(defun editable-append-text (editable text)
1361 (editable-insert-text editable text nil))
560af5c5 1362
f36ca6af 1363(defun editable-prepend-text (editable text)
1364 (editable-insert-text editable text 0))
560af5c5 1365
bbaeff4b 1366(defbinding editable-delete-text (editable &optional (start 0) end) nil
f36ca6af 1367 (editable editable)
1368 (start int)
1369 ((or end -1) int))
560af5c5 1370
bbaeff4b 1371(defbinding (editable-text "gtk_editable_get_chars")
f36ca6af 1372 (editable &optional (start 0) end) string
1373 (editable editable)
1374 (start int)
1375 ((or end -1) int))
560af5c5 1376
f36ca6af 1377(defun (setf editable-text) (text editable)
1378 (if text
1379 (editable-delete-text
1380 editable
1381 (editable-insert-text editable text))
1382 (editable-delete-text editable))
1383 text)
560af5c5 1384
bbaeff4b 1385(defbinding editable-cut-clipboard () nil
f36ca6af 1386 (editable editable))
560af5c5 1387
bbaeff4b 1388(defbinding editable-copy-clipboard () nil
f36ca6af 1389 (editable editable))
560af5c5 1390
bbaeff4b 1391(defbinding editable-paste-clipboard () nil
f36ca6af 1392 (editable editable))
560af5c5 1393
bbaeff4b 1394(defbinding editable-delete-selection () nil
f36ca6af 1395 (editable editable))
560af5c5 1396
560af5c5 1397
560af5c5 1398
f36ca6af 1399;;; Spin button
560af5c5 1400
f36ca6af 1401(defun spin-button-value-as-int (spin-button)
1402 (round (spin-button-value spin-button)))
560af5c5 1403
bbaeff4b 1404(defbinding spin-button-spin () nil
f36ca6af 1405 (spin-button spin-button)
1406 (direction spin-type)
1407 (increment single-float))
560af5c5 1408
bbaeff4b 1409(defbinding spin-button-update () nil
f36ca6af 1410 (spin-button spin-button))
560af5c5 1411
1412
1413
1414; ;;; Ruler
1415
bbaeff4b 1416(defbinding ruler-set-range () nil
f36ca6af 1417 (ruler ruler)
1418 (lower single-float)
1419 (upper single-float)
1420 (position single-float)
1421 (max-size single-float))
560af5c5 1422
bbaeff4b 1423(defbinding ruler-draw-ticks () nil
f36ca6af 1424 (ruler ruler))
560af5c5 1425
bbaeff4b 1426(defbinding ruler-draw-pos () nil
f36ca6af 1427 (ruler ruler))
560af5c5 1428
560af5c5 1429
560af5c5 1430
d520140e 1431;;; Range
560af5c5 1432
1047e159 1433(defun range-lower (range)
1434 (adjustment-lower (range-adjustment range)))
560af5c5 1435
1047e159 1436(defun range-upper (range)
1437 (adjustment-upper (range-adjustment range)))
560af5c5 1438
1047e159 1439(defun (setf range-lower) (value range)
1440 (setf (adjustment-lower (range-adjustment range)) value))
560af5c5 1441
1047e159 1442(defun (setf range-upper) (value range)
1443 (setf (adjustment-upper (range-adjustment range)) value))
560af5c5 1444
1047e159 1445(defun range-page-increment (range)
1446 (adjustment-page-increment (range-adjustment range)))
560af5c5 1447
1047e159 1448(defun range-step-increment (range)
1449 (adjustment-step-increment (range-adjustment range)))
560af5c5 1450
1047e159 1451(defun (setf range-page-increment) (value range)
1452 (setf (adjustment-page-increment (range-adjustment range)) value))
560af5c5 1453
1047e159 1454(defun (setf range-step-increment) (value range)
1455 (setf (adjustment-step-increment (range-adjustment range)) value))
560af5c5 1456
1047e159 1457(defbinding range-set-range () nil
d520140e 1458 (range range)
1047e159 1459 (lower double-float)
1460 (upper double-float))
560af5c5 1461
1047e159 1462(defbinding range-set-increments () nil
d520140e 1463 (range range)
1047e159 1464 (step double-float)
1465 (page double-float))
560af5c5 1466
560af5c5 1467
d520140e 1468;;; Scale
560af5c5 1469
e5b416f0 1470; (defbinding scale-draw-value () nil
1471; (scale scale))
560af5c5 1472
560af5c5 1473
560af5c5 1474
d520140e 1475;;; Progress bar
560af5c5 1476
bbaeff4b 1477(defbinding progress-bar-pulse () nil
d520140e 1478 (progress-bar progress-bar))
560af5c5 1479
1480
1481
f5b67f2b 1482;;; Stock items
1483
1484(defbinding stock-lookup () boolean
1485 (stock-id string)
1486 (stock-item stock-item :out))
1487
1488
560af5c5 1489
1490
1491;;; Tooltips
1492
bbaeff4b 1493(defbinding tooltips-enable () nil
d520140e 1494 (tooltips tooltips))
560af5c5 1495
bbaeff4b 1496(defbinding tooltips-disable () nil
d520140e 1497 (tooltips tooltips))
560af5c5 1498
e5b416f0 1499(defun (setf tooltips-enabled-p) (enable tooltips)
1500 (if enable
1501 (tooltips-enable tooltips)
1502 (tooltips-disable tooltips)))
1503
bbaeff4b 1504(defbinding tooltips-set-tip () nil
d520140e 1505 (tooltips tooltips)
1506 (widget widget)
1507 (tip-text string)
1508 (tip-private string))
560af5c5 1509
bbaeff4b 1510(defbinding tooltips-force-window () nil
d520140e 1511 (tooltips tooltips))
560af5c5 1512
1513
1514
d520140e 1515;;; Rc
560af5c5 1516
bbaeff4b 1517(defbinding rc-add-default-file (filename) nil
d520140e 1518 ((namestring (truename filename)) string))
560af5c5 1519
bbaeff4b 1520(defbinding rc-parse (filename) nil
d520140e 1521 ((namestring (truename filename)) string))
560af5c5 1522
bbaeff4b 1523(defbinding rc-parse-string () nil
d520140e 1524 (rc-string string))
560af5c5 1525
bbaeff4b 1526(defbinding rc-reparse-all () nil)
560af5c5 1527
bbaeff4b 1528(defbinding rc-get-style () style
d520140e 1529 (widget widget))
560af5c5 1530
1531
1532
1533;;; Accelerator Groups
bbaeff4b 1534#|
1535(defbinding accel-group-get-default () accel-group)
560af5c5 1536
f36ca6af 1537(deftype-method alien-ref accel-group (type-spec)
1538 (declare (ignore type-spec))
1539 '%accel-group-ref)
560af5c5 1540
f36ca6af 1541(deftype-method alien-unref accel-group (type-spec)
1542 (declare (ignore type-spec))
1543 '%accel-group-unref)
1544
bbaeff4b 1545(defbinding %accel-group-ref () accel-group
f36ca6af 1546 (accel-group (or accel-group pointer)))
1547
bbaeff4b 1548(defbinding %accel-group-unref () nil
f36ca6af 1549 (accel-group (or accel-group pointer)))
560af5c5 1550
bbaeff4b 1551(defbinding accel-group-activate (accel-group key modifiers) boolean
560af5c5 1552 (accel-group accel-group)
1553 ((gdk:keyval-from-name key) unsigned-int)
1554 (modifiers gdk:modifier-type))
1555
bbaeff4b 1556(defbinding accel-groups-activate (object key modifiers) boolean
560af5c5 1557 (object object)
1558 ((gdk:keyval-from-name key) unsigned-int)
1559 (modifiers gdk:modifier-type))
1560
bbaeff4b 1561(defbinding accel-group-attach () nil
560af5c5 1562 (accel-group accel-group)
1563 (object object))
1564
bbaeff4b 1565(defbinding accel-group-detach () nil
560af5c5 1566 (accel-group accel-group)
1567 (object object))
1568
bbaeff4b 1569(defbinding accel-group-lock () nil
560af5c5 1570 (accel-group accel-group))
1571
bbaeff4b 1572(defbinding accel-group-unlock () nil
560af5c5 1573 (accel-group accel-group))
1574
1575
1576;;; Accelerator Groups Entries
1577
bbaeff4b 1578(defbinding accel-group-get-entry (accel-group key modifiers) accel-entry
560af5c5 1579 (accel-group accel-group)
1580 ((gdk:keyval-from-name key) unsigned-int)
1581 (modifiers gdk:modifier-type))
1582
bbaeff4b 1583(defbinding accel-group-lock-entry (accel-group key modifiers) nil
560af5c5 1584 (accel-group accel-group)
1585 ((gdk:keyval-from-name key) unsigned-int)
1586 (modifiers gdk:modifier-type))
1587
bbaeff4b 1588(defbinding accel-group-unlock-entry (accel-group key modifiers) nil
560af5c5 1589 (accel-group accel-group)
1590 ((gdk:keyval-from-name key) unsigned-int)
1591 (modifiers gdk:modifier-type))
1592
bbaeff4b 1593(defbinding accel-group-add
560af5c5 1594 (accel-group key modifiers flags object signal) nil
1595 (accel-group accel-group)
1596 ((gdk:keyval-from-name key) unsigned-int)
1597 (modifiers gdk:modifier-type)
1598 (flags accel-flags)
1599 (object object)
1600 ((name-to-string signal) string))
1601
bbaeff4b 1602(defbinding accel-group-add (accel-group key modifiers object) nil
560af5c5 1603 (accel-group accel-group)
1604 ((gdk:keyval-from-name key) unsigned-int)
1605 (modifiers gdk:modifier-type)
1606 (object object))
1607
1608
1609;;; Accelerator Signals
1610
bbaeff4b 1611(defbinding accel-group-handle-add
560af5c5 1612 (object signal-id accel-group key modifiers flags) nil
1613 (object object)
1614 (signal-id unsigned-int)
1615 (accel-group accel-group)
1616 ((gdk:keyval-from-name key) unsigned-int)
1617 (modifiers gdk:modifier-type)
1618 (flags accel-flags))
1619
bbaeff4b 1620(defbinding accel-group-handle-remove
560af5c5 1621 (object accel-group key modifiers) nil
1622 (object object)
1623 (accel-group accel-group)
1624 ((gdk:keyval-from-name key) unsigned-int)
1625 (modifiers gdk:modifier-type))
bbaeff4b 1626|#