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 | |
bbaeff4b |
18 | ;; $Id: gtk.lisp,v 1.5 2001-05-31 21:52:57 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 | |
560af5c5 |
42 | |
43 | |
560af5c5 |
44 | ;;; Label |
45 | |
bbaeff4b |
46 | (defbinding label-select-region () nil |
560af5c5 |
47 | (label label) |
bbaeff4b |
48 | (start int) |
49 | (end int)) |
560af5c5 |
50 | |
51 | |
52 | |
53 | ;;; Acccel label |
54 | |
bbaeff4b |
55 | (defbinding accel-label-refetch () boolean |
560af5c5 |
56 | (accel-label accel-label)) |
57 | |
58 | |
59 | |
560af5c5 |
60 | ;;; Bin |
61 | |
62 | (defun bin-child (bin) |
63 | (first (container-children bin))) |
64 | |
65 | (defun (setf bin-child) (child bin) |
66 | (let ((old-child (bin-child bin))) |
67 | (when old-child |
68 | (container-remove bin old-child))) |
69 | (container-add bin child) |
70 | child) |
71 | |
d520140e |
72 | (defmethod initialize-instance ((bin bin) &rest initargs &key child) |
73 | (declare (ignore initargs)) |
74 | (call-next-method) |
75 | (cond |
76 | ((consp child) |
77 | (container-add bin (first child)) |
78 | (setf |
79 | (slot-value (first child) 'child-slots) |
80 | (apply |
81 | #'make-instance |
82 | (slot-value (class-of bin) 'child-class) |
83 | :parent bin :child (first child) (cdr child)))) |
84 | (child |
85 | (container-add bin child)))) |
560af5c5 |
86 | |
f36ca6af |
87 | |
560af5c5 |
88 | ;;; Button |
89 | |
bbaeff4b |
90 | (defbinding button-pressed () nil |
560af5c5 |
91 | (button button)) |
92 | |
bbaeff4b |
93 | (defbinding button-released () nil |
560af5c5 |
94 | (button button)) |
95 | |
bbaeff4b |
96 | (defbinding button-clicked () nil |
560af5c5 |
97 | (button button)) |
98 | |
bbaeff4b |
99 | (defbinding button-enter () nil |
560af5c5 |
100 | (button button)) |
101 | |
bbaeff4b |
102 | (defbinding button-leave () nil |
560af5c5 |
103 | (button button)) |
104 | |
105 | |
106 | |
107 | ;;; Toggle button |
108 | |
bbaeff4b |
109 | (defbinding toggle-button-toggled () nil |
560af5c5 |
110 | (toggle-button toggle-button)) |
111 | |
112 | |
113 | |
114 | ;;; Check button |
115 | |
f36ca6af |
116 | (defmethod (setf button-label) ((label string) (button check-button)) |
117 | (call-next-method) |
118 | (setf (misc-xalign (bin-child button)) 0.0) |
119 | label) |
120 | |
560af5c5 |
121 | |
122 | |
123 | ;;; Radio button |
124 | |
bbaeff4b |
125 | (defbinding (%radio-button-get-group "gtk_radio_button_group") () pointer |
d520140e |
126 | (radio-button radio-button)) |
127 | |
bbaeff4b |
128 | (defbinding %radio-button-set-group () nil |
d520140e |
129 | (radio-button radio-button) |
130 | (group pointer)) |
560af5c5 |
131 | |
d520140e |
132 | (defun radio-button-add-to-group (button1 button2) |
133 | "Add BUTTON1 to the group which BUTTON2 belongs to." |
134 | (%radio-button-set-group button1 (%radio-button-get-group button2))) |
135 | |
136 | (defmethod initialize-instance ((button radio-button) |
137 | &rest initargs &key group) |
138 | (call-next-method) |
139 | (when group |
140 | (radio-button-add-to-group item group))) |
560af5c5 |
141 | |
142 | |
143 | ;;; Option menu |
144 | |
bbaeff4b |
145 | (defbinding %option-menu-set-menu () nil |
f36ca6af |
146 | (option-menu option-menu) |
147 | (menu widget)) |
560af5c5 |
148 | |
bbaeff4b |
149 | (defbinding %option-menu-remove-menu () nil |
f36ca6af |
150 | (option-menu option-menu)) |
560af5c5 |
151 | |
f36ca6af |
152 | (defun (setf option-menu-menu) (menu option-menu) |
153 | (if (not menu) |
154 | (%option-menu-remove-menu option-menu) |
155 | (%option-menu-set-menu option-menu menu)) |
156 | menu) |
560af5c5 |
157 | |
158 | |
159 | |
160 | ;;; Item |
161 | |
bbaeff4b |
162 | (defbinding item-select () nil |
560af5c5 |
163 | (item item)) |
164 | |
bbaeff4b |
165 | (defbinding item-deselect () nil |
560af5c5 |
166 | (item item)) |
167 | |
bbaeff4b |
168 | (defbinding item-toggle () nil |
560af5c5 |
169 | (item item)) |
170 | |
171 | |
172 | |
173 | ;;; Menu item |
174 | |
f36ca6af |
175 | (defun (setf menu-item-label) (label menu-item) |
176 | (make-instance 'accel-label |
177 | :label label :xalign 0.0 :yalign 0.5 :accel-widget menu-item |
178 | :visible t :parent menu-item) |
179 | label) |
560af5c5 |
180 | |
bbaeff4b |
181 | (defbinding %menu-item-set-submenu () nil |
f36ca6af |
182 | (menu-item menu-item) |
183 | (submenu menu)) |
560af5c5 |
184 | |
bbaeff4b |
185 | (defbinding %menu-item-remove-submenu () nil |
f36ca6af |
186 | (menu-item menu-item)) |
560af5c5 |
187 | |
f36ca6af |
188 | (defun (setf menu-item-submenu) (submenu menu-item) |
189 | (if (not submenu) |
190 | (%menu-item-remove-submenu menu-item) |
191 | (%menu-item-set-submenu menu-item submenu)) |
192 | submenu) |
560af5c5 |
193 | |
bbaeff4b |
194 | (defbinding %menu-item-configure () nil |
f36ca6af |
195 | (menu-item menu-item) |
196 | (show-toggle-indicator boolean) |
197 | (show-submenu-indicator boolean)) |
560af5c5 |
198 | |
f36ca6af |
199 | (defun (setf menu-item-toggle-indicator-p) (show menu-item) |
200 | (%menu-item-configure |
201 | menu-item |
202 | show |
203 | (menu-item-submenu-indicator-p menu-item)) |
204 | show) |
560af5c5 |
205 | |
f36ca6af |
206 | (defun (setf menu-item-submenu-indicator-p) (show menu-item) |
207 | (%menu-item-configure |
208 | menu-item |
209 | (menu-item-toggle-indicator-p menu-item) |
210 | show)) |
560af5c5 |
211 | |
bbaeff4b |
212 | (defbinding menu-item-select () nil |
f36ca6af |
213 | (menu-item menu-item)) |
560af5c5 |
214 | |
bbaeff4b |
215 | (defbinding menu-item-deselect () nil |
f36ca6af |
216 | (menu-item menu-item)) |
560af5c5 |
217 | |
bbaeff4b |
218 | (defbinding menu-item-activate () nil |
f36ca6af |
219 | (menu-item menu-item)) |
560af5c5 |
220 | |
bbaeff4b |
221 | (defbinding menu-item-right-justify () nil |
f36ca6af |
222 | (menu-item menu-item)) |
560af5c5 |
223 | |
224 | |
225 | |
f36ca6af |
226 | ;;; Check menu item |
560af5c5 |
227 | |
bbaeff4b |
228 | (defbinding check-menu-item-toggled () nil |
f36ca6af |
229 | (check-menu-item check-menu-item)) |
560af5c5 |
230 | |
231 | |
232 | |
f36ca6af |
233 | ;;; Radio menu item |
560af5c5 |
234 | |
bbaeff4b |
235 | (defbinding (%radio-menu-item-get-group |
236 | "gtk_radio_menu_item_group") () pointer |
d520140e |
237 | (radio-menu-item radio-menu-item)) |
238 | |
bbaeff4b |
239 | (defbinding %radio-menu-item-set-group () nil |
d520140e |
240 | (radio-menu-item radio-menu-item) |
241 | (group pointer)) |
242 | |
d520140e |
243 | (defun radio-menu-item-add-to-group (item1 item2) |
244 | "Add ITEM1 to the group which ITEM2 belongs to." |
245 | (%radio-menu-item-set-group item1 (%radio-menu-item-get-group item2))) |
246 | |
247 | (defmethod initialize-instance ((item radio-menu-item) |
248 | &rest initargs &key group) |
249 | (call-next-method) |
250 | (when group |
251 | (radio-menu-item-add-to-group item group))) |
252 | |
560af5c5 |
253 | |
254 | |
560af5c5 |
255 | ;;; Window |
256 | |
bbaeff4b |
257 | (defbinding %window-set-wmclass () nil |
560af5c5 |
258 | (window window) |
259 | (wmclass-name string) |
260 | (wmclass-class string)) |
261 | |
262 | (defun (setf window-wmclass) (wmclass window) |
263 | (%window-set-wmclass window (svref wmclass 0) (svref wmclass 1)) |
264 | (values (svref wmclass 0) (svref wmclass 1))) |
265 | |
f36ca6af |
266 | ;; gtkglue.c |
bbaeff4b |
267 | (defbinding window-wmclass () nil |
560af5c5 |
268 | (window window) |
269 | (wmclass-name string :out) |
270 | (wmclass-class string :out)) |
271 | |
bbaeff4b |
272 | (defbinding window-add-accel-group () nil |
560af5c5 |
273 | (window window) |
274 | (accel-group accel-group)) |
275 | |
bbaeff4b |
276 | (defbinding window-remove-accel-group () nil |
560af5c5 |
277 | (window window) |
278 | (accel-group accel-group)) |
279 | |
bbaeff4b |
280 | (defbinding window-activate-focus () int |
560af5c5 |
281 | (window window)) |
282 | |
bbaeff4b |
283 | (defbinding window-activate-default () int |
560af5c5 |
284 | (window window)) |
285 | |
bbaeff4b |
286 | (defbinding window-set-transient-for () nil |
560af5c5 |
287 | (window window) |
288 | (parent window)) |
289 | |
bbaeff4b |
290 | ;(defbinding window-set-geometry-hints) |
560af5c5 |
291 | |
292 | |
293 | |
294 | ;;; File selection |
295 | |
bbaeff4b |
296 | (defbinding file-selection-complete () nil |
d520140e |
297 | (file-selection file-selection) |
298 | (pattern string)) |
560af5c5 |
299 | |
bbaeff4b |
300 | (defbinding file-selection-show-fileop-buttons () nil |
d520140e |
301 | (file-selection file-selection)) |
560af5c5 |
302 | |
bbaeff4b |
303 | (defbinding file-selection-hide-fileop-buttons () nil |
d520140e |
304 | (file-selection file-selection)) |
560af5c5 |
305 | |
306 | |
307 | |
f36ca6af |
308 | ;;; Scrolled window |
560af5c5 |
309 | |
560af5c5 |
310 | (defun (setf scrolled-window-scrollbar-policy) (policy window) |
311 | (setf (scrolled-window-hscrollbar-policy window) policy) |
312 | (setf (scrolled-window-vscrollbar-policy window) policy)) |
313 | |
bbaeff4b |
314 | (defbinding scrolled-window-add-with-viewport () nil |
560af5c5 |
315 | (scrolled-window scrolled-window) |
316 | (child widget)) |
317 | |
318 | |
319 | |
560af5c5 |
320 | ;;; Box |
321 | |
bbaeff4b |
322 | (defbinding box-pack-start () nil |
560af5c5 |
323 | (box box) |
324 | (child widget) |
325 | (expand boolean) |
326 | (fill boolean) |
327 | (padding unsigned-int)) |
328 | |
bbaeff4b |
329 | (defbinding box-pack-end () nil |
560af5c5 |
330 | (box box) |
331 | (child widget) |
332 | (expand boolean) |
333 | (fill boolean) |
334 | (padding unsigned-int)) |
335 | |
336 | (defun box-pack (box child &key (pack :start) (expand t) (fill t) (padding 0)) |
337 | (if (eq pack :start) |
338 | (box-pack-start box child expand fill padding) |
339 | (box-pack-end box child expand fill padding))) |
340 | |
bbaeff4b |
341 | (defbinding box-reorder-child () nil |
560af5c5 |
342 | (box box) |
343 | (child widget) |
344 | (position int)) |
345 | |
bbaeff4b |
346 | (defbinding box-query-child-packing () nil |
560af5c5 |
347 | (box box) |
348 | (child widget :out) |
349 | (expand boolean :out) |
350 | (fill boolean :out) |
351 | (padding unsigned-int :out) |
352 | (pack-type pack-type :out)) |
353 | |
bbaeff4b |
354 | (defbinding box-set-child-packing () nil |
560af5c5 |
355 | (box box) |
356 | (child widget) |
357 | (expand boolean) |
358 | (fill boolean) |
359 | (padding unsigned-int) |
360 | (pack-type pack-type)) |
361 | |
362 | |
363 | |
364 | ;;; Button box |
365 | |
bbaeff4b |
366 | (defbinding button-box-get-child-size () nil |
367 | (button-box button-box) |
560af5c5 |
368 | (min-width int :out) |
369 | (min-height int :out)) |
370 | |
bbaeff4b |
371 | (defbinding button-box-set-child-size () nil |
372 | (button-box button-box) |
560af5c5 |
373 | (min-width int) |
374 | (min-height int)) |
375 | |
bbaeff4b |
376 | (defbinding button-box-get-child-ipadding () nil |
377 | (button-box button-box) |
560af5c5 |
378 | (ipad-x int :out) |
379 | (ipad-y int :out)) |
380 | |
bbaeff4b |
381 | (defbinding button-box-set-child-ipadding () nil |
382 | (button-box button-box) |
560af5c5 |
383 | (ipad-x int) |
384 | (ipad-y int)) |
385 | |
560af5c5 |
386 | |
387 | |
560af5c5 |
388 | ;;; Color selection |
389 | |
bbaeff4b |
390 | ; (defbinding %color-selection-get-previous-color () nil |
391 | ; (colorsel color-selection) |
392 | ; (color pointer)) |
560af5c5 |
393 | |
bbaeff4b |
394 | ; (defun color-selection-previous-color (colorsel) |
395 | ; (let ((color (allocate-memory (* (size-of 'double-float) 4)))) |
396 | ; (%color-selection-get-previous-color colorsel color) |
397 | ; (funcall (get-from-alien-function '(vector double-float 4)) color))) |
560af5c5 |
398 | |
bbaeff4b |
399 | ; (defbinding %color-selection-set-previous-color () nil |
400 | ; (colorsel color-selection) |
401 | ; (color (vector double-float 4))) |
560af5c5 |
402 | |
bbaeff4b |
403 | ; (defun (setf color-selection-previous-color) (color colorsel) |
404 | ; (%color-selection-set-previous-color colorsel color) |
405 | ; color) |
d520140e |
406 | |
bbaeff4b |
407 | (defbinding (color-selection-is-adjusting-p |
408 | "gtk_color_selection_is_adjusting") () boolean |
d520140e |
409 | (colorsel color-selection)) |
410 | |
411 | |
412 | |
560af5c5 |
413 | ;;; Combo |
414 | |
bbaeff4b |
415 | (defbinding combo-set-value-in-list () nil |
f36ca6af |
416 | (combo combo) |
417 | (val boolean) |
418 | (ok-if-empty boolean)) |
560af5c5 |
419 | |
bbaeff4b |
420 | ; (defbinding ("gtk_combo_set_item_string" (setf combo-item-string)) () nil |
560af5c5 |
421 | ; (combo combo) |
422 | ; (item item) |
423 | ; (item-value string)) |
424 | |
bbaeff4b |
425 | (defbinding %combo-set-popdown-strings () nil |
f36ca6af |
426 | (combo combo) |
d520140e |
427 | (strings (glist string))) |
560af5c5 |
428 | |
f36ca6af |
429 | (defun (setf combo-popdown-strings) (strings combo) |
430 | (%combo-set-popdown-strings combo strings) |
431 | strings) |
560af5c5 |
432 | |
bbaeff4b |
433 | (defbinding combo-disable-activate () nil |
f36ca6af |
434 | (combo combo)) |
560af5c5 |
435 | |
560af5c5 |
436 | |
560af5c5 |
437 | |
f36ca6af |
438 | ;;; Statusbar |
560af5c5 |
439 | |
bbaeff4b |
440 | (defbinding (statusbar-context-id "gtk_statusbar_get_context_id") |
441 | () unsigned-int |
f36ca6af |
442 | (statusbar statusbar) |
443 | (context-description string)) |
560af5c5 |
444 | |
bbaeff4b |
445 | (defbinding statusbar-push () unsigned-int |
f36ca6af |
446 | (statusbar statusbar) |
447 | (context-id unsigned-int) |
448 | (text string)) |
560af5c5 |
449 | |
bbaeff4b |
450 | (defbinding statusbar-pop () nil |
f36ca6af |
451 | (statusbar statusbar) |
452 | (context-id unsigned-int)) |
560af5c5 |
453 | |
bbaeff4b |
454 | (defbinding statusbar-remove () nil |
f36ca6af |
455 | (statusbar statusbar) |
456 | (context-id unsigned-int) |
457 | (message-id unsigned-int)) |
560af5c5 |
458 | |
560af5c5 |
459 | |
460 | |
461 | ;;; Fixed |
462 | |
bbaeff4b |
463 | (defbinding fixed-put () nil |
f36ca6af |
464 | (fixed fixed) |
465 | (widget widget) |
466 | (x (signed 16)) |
467 | (y (signed 16))) |
560af5c5 |
468 | |
bbaeff4b |
469 | (defbinding fixed-move () nil |
f36ca6af |
470 | (fixed fixed) |
471 | (widget widget) |
472 | (x (signed 16)) |
473 | (y (signed 16))) |
560af5c5 |
474 | |
475 | |
476 | |
d520140e |
477 | ;;; Notebook |
560af5c5 |
478 | |
bbaeff4b |
479 | (defbinding (notebook-insert-page "gtk_notebook_insert_page_menu") |
f36ca6af |
480 | (notebook position child tab-label &optional menu-label) nil |
481 | (notebook notebook) |
482 | (child widget) |
483 | ((if (stringp tab-label) |
484 | (label-new tab-label) |
485 | tab-label) widget) |
486 | ((if (stringp menu-label) |
487 | (label-new menu-label) |
488 | menu-label) (or null widget)) |
489 | (position int)) |
560af5c5 |
490 | |
f36ca6af |
491 | (defun notebook-append-page (notebook child tab-label &optional menu-label) |
492 | (notebook-insert-page notebook -1 child tab-label menu-label)) |
560af5c5 |
493 | |
f36ca6af |
494 | (defun notebook-prepend-page (notebook child tab-label &optional menu-label) |
495 | (notebook-insert-page notebook 0 child tab-label menu-label)) |
560af5c5 |
496 | |
bbaeff4b |
497 | (defbinding notebook-remove-page () nil |
f36ca6af |
498 | (notebook notebook) |
499 | (page-num int)) |
560af5c5 |
500 | |
501 | ; (defun notebook-current-page-num (notebook) |
502 | ; (let ((page-num (notebook-current-page notebook))) |
503 | ; (if (= page-num -1) |
504 | ; nil |
505 | ; page-num))) |
506 | |
bbaeff4b |
507 | (defbinding (notebook-nth-page-child "gtk_notebook_get_nth_page") () widget |
f36ca6af |
508 | (notebook notebook) |
509 | (page-num int)) |
560af5c5 |
510 | |
f36ca6af |
511 | (defun notebook-page-child (notebook) |
512 | (notebook-nth-page-child notebook (notebook-page notebook))) |
560af5c5 |
513 | |
bbaeff4b |
514 | (defbinding %notebook-page-num () int |
f36ca6af |
515 | (notebook notebook) |
516 | (child widget)) |
517 | |
518 | (defun notebook-child-num (notebook child) |
519 | (let ((page-num (%notebook-page-num notebook child))) |
520 | (if (= page-num -1) |
521 | nil |
522 | page-num))) |
523 | |
bbaeff4b |
524 | (defbinding notebook-next-page () nil |
f36ca6af |
525 | (notebook notebook)) |
560af5c5 |
526 | |
bbaeff4b |
527 | (defbinding notebook-prev-page () nil |
f36ca6af |
528 | (notebook notebook)) |
529 | |
bbaeff4b |
530 | (defbinding notebook-popup-enable () nil |
f36ca6af |
531 | (notebook notebook)) |
532 | |
bbaeff4b |
533 | (defbinding notebook-popup-disable () nil |
f36ca6af |
534 | (notebook notebook)) |
535 | |
bbaeff4b |
536 | (defbinding (notebook-tab-label "gtk_notebook_get_tab_label") |
537 | (notebook ref) widget |
f36ca6af |
538 | (notebook notebook) |
539 | ((if (typep ref 'widget) |
540 | ref |
541 | (notebook-nth-page-child notebook ref)) |
542 | widget)) |
543 | |
bbaeff4b |
544 | (defbinding %notebook-set-tab-label () nil |
f36ca6af |
545 | (notebook notebook) |
546 | (reference widget) |
547 | (tab-label widget)) |
548 | |
549 | (defun (setf notebook-tab-label) (tab-label notebook reference) |
550 | (let ((tab-label-widget (if (stringp tab-label) |
551 | (label-new tab-label) |
552 | tab-label))) |
553 | (%notebook-set-tab-label |
554 | notebook |
555 | (if (typep reference 'widget) |
556 | reference |
557 | (notebook-nth-page-child notebook reference)) |
558 | tab-label-widget) |
f36ca6af |
559 | tab-label-widget)) |
560af5c5 |
560 | |
bbaeff4b |
561 | (defbinding (notebook-menu-label "gtk_notebook_get_menu_label") |
562 | (notebook ref) widget |
f36ca6af |
563 | (notebook notebook) |
564 | ((if (typep ref 'widget) |
565 | ref |
566 | (notebook-nth-page-child notebook ref)) |
567 | widget)) |
568 | |
bbaeff4b |
569 | (defbinding %notebook-set-menu-label () nil |
f36ca6af |
570 | (notebook notebook) |
571 | (reference widget) |
572 | (menu-label widget)) |
573 | |
574 | (defun (setf notebook-menu-label) (menu-label notebook reference) |
575 | (let ((menu-label-widget (if (stringp menu-label) |
576 | (label-new menu-label) |
577 | menu-label))) |
578 | (%notebook-set-menu-label |
579 | notebook |
580 | (if (typep reference 'widget) |
581 | reference |
582 | (notebook-nth-page-child notebook reference)) |
583 | menu-label-widget) |
f36ca6af |
584 | menu-label-widget)) |
585 | |
bbaeff4b |
586 | (defbinding notebook-query-tab-label-packing (notebook ref) nil |
f36ca6af |
587 | (notebook notebook) |
588 | ((if (typep ref 'widget) |
589 | ref |
590 | (notebook-nth-page-child notebook ref)) |
591 | widget) |
592 | (expand boolean :out) |
593 | (fill boolean :out) |
594 | (pack-type pack-type :out)) |
595 | |
bbaeff4b |
596 | (defbinding |
f36ca6af |
597 | notebook-set-tab-label-packing (notebook ref expand fill pack-type) nil |
598 | (notebook notebook) |
599 | ((if (typep ref 'widget) |
600 | ref |
601 | (notebook-nth-page-child notebook ref)) |
602 | widget) |
603 | (expand boolean) |
604 | (fill boolean) |
605 | (pack-type pack-type)) |
606 | |
bbaeff4b |
607 | (defbinding notebook-reorder-child () nil |
f36ca6af |
608 | (notebook notebook) |
609 | (child widget) |
610 | (position int)) |
560af5c5 |
611 | |
612 | |
613 | |
d520140e |
614 | ;;; Paned |
560af5c5 |
615 | |
bbaeff4b |
616 | (defbinding paned-pack1 () nil |
d520140e |
617 | (paned paned) |
618 | (child widget) |
619 | (resize boolean) |
620 | (shrink boolean)) |
560af5c5 |
621 | |
bbaeff4b |
622 | (defbinding paned-pack2 () nil |
d520140e |
623 | (paned paned) |
624 | (child widget) |
625 | (resize boolean) |
626 | (shrink boolean)) |
560af5c5 |
627 | |
d520140e |
628 | ;; gtkglue.c |
bbaeff4b |
629 | (defbinding paned-child1 () widget |
d520140e |
630 | (paned paned) |
631 | (resize boolean :out) |
632 | (shrink boolean :out)) |
560af5c5 |
633 | |
d520140e |
634 | ;; gtkglue.c |
bbaeff4b |
635 | (defbinding paned-child2 () widget |
d520140e |
636 | (paned paned) |
637 | (resize boolean :out) |
638 | (shrink boolean :out)) |
560af5c5 |
639 | |
d520140e |
640 | (defun (setf paned-child1) (child paned) |
641 | (paned-pack1 paned child nil t)) |
560af5c5 |
642 | |
d520140e |
643 | (defun (setf paned-child2) (child paned) |
644 | (paned-pack2 paned child t t)) |
560af5c5 |
645 | |
560af5c5 |
646 | |
560af5c5 |
647 | |
d520140e |
648 | ;;; Layout |
560af5c5 |
649 | |
bbaeff4b |
650 | (defbinding layout-put () nil |
d520140e |
651 | (layout layout) |
652 | (widget widget) |
653 | (x int) |
654 | (y int)) |
560af5c5 |
655 | |
bbaeff4b |
656 | (defbinding layout-move () nil |
d520140e |
657 | (layout layout) |
658 | (widget widget) |
659 | (x int) |
660 | (y int)) |
560af5c5 |
661 | |
bbaeff4b |
662 | (defbinding layout-set-size () nil |
d520140e |
663 | (layout layout) |
664 | (width int) |
665 | (height int)) |
560af5c5 |
666 | |
d520140e |
667 | ;; gtkglue.c |
bbaeff4b |
668 | (defbinding layout-get-size () nil |
d520140e |
669 | (layout layout) |
670 | (width int :out) |
671 | (height int :out)) |
560af5c5 |
672 | |
d520140e |
673 | (defun layout-x-size (layout) |
674 | (nth-value 0 (layout-get-size layout))) |
675 | |
676 | (defun layout-y-size (layout) |
677 | (nth-value 1 (layout-get-size layout))) |
678 | |
679 | (defun (setf layout-x-size) (x layout) |
680 | (layout-set-size layout x (layout-y-size layout))) |
560af5c5 |
681 | |
d520140e |
682 | (defun (setf layout-y-size) (y layout) |
683 | (layout-set-size layout (layout-x-size layout) y)) |
560af5c5 |
684 | |
bbaeff4b |
685 | (defbinding layout-freeze () nil |
d520140e |
686 | (layout layout)) |
560af5c5 |
687 | |
bbaeff4b |
688 | (defbinding layout-thaw () nil |
d520140e |
689 | (layout layout)) |
560af5c5 |
690 | |
691 | |
692 | |
560af5c5 |
693 | ;;; Menu shell |
694 | |
bbaeff4b |
695 | (defbinding menu-shell-insert () nil |
f36ca6af |
696 | (menu-shell menu-shell) |
697 | (menu-item menu-item) |
698 | (position int)) |
560af5c5 |
699 | |
f36ca6af |
700 | (defun menu-shell-append (menu-shell menu-item) |
701 | (menu-shell-insert menu-shell menu-item -1)) |
560af5c5 |
702 | |
f36ca6af |
703 | (defun menu-shell-prepend (menu-shell menu-item) |
704 | (menu-shell-insert menu-shell menu-item 0)) |
560af5c5 |
705 | |
bbaeff4b |
706 | (defbinding menu-shell-deactivate () nil |
f36ca6af |
707 | (menu-shell menu-shell)) |
560af5c5 |
708 | |
bbaeff4b |
709 | (defbinding menu-shell-select-item () nil |
f36ca6af |
710 | (menu-shell menu-shell) |
711 | (menu-item menu-item)) |
560af5c5 |
712 | |
bbaeff4b |
713 | (defbinding menu-shell-deselect () nil |
f36ca6af |
714 | (menu-shell menu-shell)) |
560af5c5 |
715 | |
bbaeff4b |
716 | (defbinding menu-shell-activate-item () nil |
f36ca6af |
717 | (menu-shell menu-shell) |
718 | (menu-item menu-item) |
719 | (fore-deactivate boolean)) |
560af5c5 |
720 | |
721 | |
722 | |
723 | ; ;;; Menu bar |
724 | |
bbaeff4b |
725 | ; (defbinding menu-bar-insert () nil |
560af5c5 |
726 | ; (menu-bar menu-bar) |
727 | ; (menu menu) |
728 | ; (position int)) |
729 | |
730 | ; (defun menu-bar-append (menu-bar menu) |
731 | ; (menu-bar-insert menu-bar menu -1)) |
732 | |
733 | ; (defun menu-bar-prepend (menu-bar menu) |
734 | ; (menu-bar-insert menu-bar menu 0)) |
735 | |
736 | |
737 | |
738 | ; ;;; Menu |
739 | |
560af5c5 |
740 | ; (defun menu-insert (menu menu-item position) |
741 | ; (menu-shell-insert menu menu-item position)) |
742 | |
743 | ; (defun menu-append (menu menu-item) |
744 | ; (menu-shell-append menu menu-item)) |
745 | |
746 | ; (defun menu-prepend (menu menu-item) |
747 | ; (menu-shell-prepend menu menu-item)) |
748 | |
f36ca6af |
749 | ;(defun menu-popup ...) |
560af5c5 |
750 | |
bbaeff4b |
751 | (defbinding menu-reposition () nil |
f36ca6af |
752 | (menu menu)) |
560af5c5 |
753 | |
bbaeff4b |
754 | (defbinding menu-popdown () nil |
f36ca6af |
755 | (menu menu)) |
560af5c5 |
756 | |
bbaeff4b |
757 | (defbinding (menu-active "gtk_menu_get_active") () widget |
f36ca6af |
758 | (menu menu)) |
560af5c5 |
759 | |
bbaeff4b |
760 | (defbinding %menu-set-active () nil |
f36ca6af |
761 | (menu menu) |
762 | (index unsigned-int)) |
560af5c5 |
763 | |
d520140e |
764 | (defun (setf menu-active) (menu index) |
765 | (%menu-set-active menu index)) |
766 | |
f36ca6af |
767 | ;(defun menu-attach-to-widget ...) |
560af5c5 |
768 | |
bbaeff4b |
769 | (defbinding menu-detach () nil |
f36ca6af |
770 | (menu menu)) |
560af5c5 |
771 | |
bbaeff4b |
772 | (defbinding (menu-attach-widget "gtk_menu_get_attach_widget") () widget |
f36ca6af |
773 | (menu menu)) |
560af5c5 |
774 | |
bbaeff4b |
775 | (defbinding menu-reorder-child () nil |
f36ca6af |
776 | (menu menu) |
777 | (menu-item menu-item) |
778 | (position int)) |
560af5c5 |
779 | |
780 | |
f36ca6af |
781 | ;;; Table |
560af5c5 |
782 | |
bbaeff4b |
783 | (defbinding table-resize () nil |
f36ca6af |
784 | (table table) |
785 | (rows unsigned-int) |
786 | (columns unsigned-int)) |
560af5c5 |
787 | |
bbaeff4b |
788 | (defbinding table-attach (table child left right top bottom |
f36ca6af |
789 | &key (x-options '(:expand :fill)) |
790 | (y-options '(:expand :fill)) |
791 | (x-padding 0) (y-padding 0)) nil |
792 | (table table) |
793 | (child widget) |
794 | (left unsigned-int) |
795 | (right unsigned-int) |
796 | (top unsigned-int) |
797 | (bottom unsigned-int) |
798 | (x-options attach-options) |
799 | (y-options attach-options) |
800 | (x-padding unsigned-int) |
801 | (y-padding unsigned-int)) |
802 | |
bbaeff4b |
803 | (defbinding %table-set-row-spacing () nil |
f36ca6af |
804 | (table table) |
805 | (row unsigned-int) |
806 | (spacing unsigned-int)) |
807 | |
808 | (defun (setf table-row-spacing) (spacing table row) |
809 | (%table-set-row-spacing table row spacing) |
810 | spacing) |
811 | |
812 | ;; gtkglue.c |
bbaeff4b |
813 | (defbinding table-row-spacing (table row) unsigned-int |
f36ca6af |
814 | (table table) |
815 | ((progn |
816 | (assert (and (>= row 0) (< row (table-rows table)))) |
817 | row) unsigned-int)) |
818 | |
bbaeff4b |
819 | (defbinding %table-set-col-spacing () nil |
f36ca6af |
820 | (table table) |
821 | (col unsigned-int) |
822 | (spacing unsigned-int)) |
823 | |
824 | (defun (setf table-column-spacing) (spacing table column) |
d520140e |
825 | (%table-set-col-spacing table column spacing) |
f36ca6af |
826 | spacing) |
827 | |
828 | ;; gtkglue.c |
bbaeff4b |
829 | (defbinding table-column-spacing (table col) unsigned-int |
f36ca6af |
830 | (table table) |
831 | ((progn |
832 | (assert (and (>= col 0) (< col (table-columns table)))) |
833 | col) unsigned-int)) |
834 | |
835 | |
836 | (defun %set-table-child-option (object slot flag value) |
d520140e |
837 | (let ((options (child-slot-value object slot))) |
f36ca6af |
838 | (cond |
839 | ((and value (not (member flag options))) |
d520140e |
840 | (setf (child-slot-value object slot) (cons flag options))) |
f36ca6af |
841 | ((and (not value) (member flag options)) |
d520140e |
842 | (setf (child-slot-value object slot) (delete flag options)))))) |
f36ca6af |
843 | |
844 | (macrolet ((define-option-accessor (name slot flag) |
845 | `(progn |
846 | (defun ,name (object) |
d520140e |
847 | (member ,flag (child-slot-value object ,slot))) |
f36ca6af |
848 | (defun (setf ,name) (value object) |
849 | (%set-table-child-option object ,slot ,flag value))))) |
850 | (define-option-accessor table-child-x-expand-p :x-options :expand) |
851 | (define-option-accessor table-child-y-expand-p :y-options :expand) |
852 | (define-option-accessor table-child-x-shrink-p :x-options :shrink) |
853 | (define-option-accessor table-child-y-shrink-p :y-options :shrink) |
854 | (define-option-accessor table-child-x-fill-p :x-options :fill) |
855 | (define-option-accessor table-child-y-fill-p :y-options :fill)) |
856 | |
857 | |
858 | |
859 | ;;; Toolbar |
860 | |
f36ca6af |
861 | ;; gtkglue.c |
bbaeff4b |
862 | (defbinding toolbar-num-children () int |
f36ca6af |
863 | (toolbar toolbar)) |
864 | |
865 | (defun %toolbar-position-num (toolbar position) |
866 | (case position |
867 | (:prepend 0) |
868 | (:append (toolbar-num-children toolbar)) |
869 | (t |
870 | (assert (and (>= position 0) (< position (toolbar-num-children toolbar)))) |
871 | position))) |
872 | |
bbaeff4b |
873 | (defbinding %toolbar-insert-element () widget |
f36ca6af |
874 | (toolbar toolbar) |
875 | (type toolbar-child-type) |
876 | (widget (or null widget)) |
877 | (text string) |
878 | (tooltip-text string) |
879 | (tooltip-private-text string) |
880 | (icon (or null widget)) |
881 | (nil null) |
882 | (nil null) |
883 | (position int)) |
560af5c5 |
884 | |
f36ca6af |
885 | (defun toolbar-insert-element (toolbar position |
886 | &key tooltip-text tooltip-private-text |
887 | type widget icon text callback) |
888 | (let* ((icon-widget (typecase icon |
889 | ((or null widget) icon) |
890 | (t (pixmap-new icon)))) |
891 | (toolbar-child |
892 | (%toolbar-insert-element |
893 | toolbar (or type (and widget :widget) :button) |
894 | widget text tooltip-text tooltip-private-text icon-widget |
895 | (%toolbar-position-num toolbar position)))) |
896 | (when callback |
897 | (signal-connect toolbar-child 'clicked callback)) |
898 | toolbar-child)) |
899 | |
900 | (defun toolbar-append-element (toolbar &key tooltip-text tooltip-private-text |
901 | type widget icon text callback) |
902 | (toolbar-insert-element |
903 | toolbar :append :type type :widget widget :icon icon :text text |
904 | :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text |
905 | :callback callback)) |
906 | |
907 | (defun toolbar-prepend-element (toolbar &key tooltip-text tooltip-private-text |
908 | type widget icon text callback) |
909 | (toolbar-insert-element |
910 | toolbar :prepend :type type :widget widget :icon icon :text text |
911 | :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text |
912 | :callback callback)) |
913 | |
914 | (defun toolbar-insert-space (toolbar position) |
915 | (toolbar-insert-element toolbar position :type :space)) |
916 | |
917 | (defun toolbar-append-space (toolbar) |
918 | (toolbar-insert-space toolbar :append)) |
919 | |
920 | (defun toolbar-prepend-space (toolbar) |
921 | (toolbar-insert-space toolbar :prepend)) |
922 | |
923 | (defun toolbar-insert-widget (toolbar widget position &key tooltip-text |
924 | tooltip-private-text callback) |
925 | (toolbar-insert-element |
926 | toolbar position :widget widget :tooltip-text tooltip-text |
927 | :tooltip-private-text tooltip-private-text :callback callback)) |
560af5c5 |
928 | |
f36ca6af |
929 | (defun toolbar-append-widget (toolbar widget &key tooltip-text |
930 | tooltip-private-text callback) |
931 | (toolbar-insert-widget |
932 | toolbar widget :append :tooltip-text tooltip-text |
933 | :tooltip-private-text tooltip-private-text :callback callback)) |
934 | |
935 | (defun toolbar-prepend-widget (toolbar widget &key tooltip-text |
936 | tooltip-private-text callback) |
937 | (toolbar-insert-widget |
938 | toolbar widget :prepend :tooltip-text tooltip-text |
939 | :tooltip-private-text tooltip-private-text :callback callback)) |
940 | |
941 | (defun toolbar-insert-item (toolbar text icon position &key tooltip-text |
942 | tooltip-private-text callback) |
943 | (toolbar-insert-element |
944 | toolbar position :text text :icon icon :callback callback |
945 | :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text)) |
946 | |
947 | (defun toolbar-append-item (toolbar text icon &key tooltip-text |
948 | tooltip-private-text callback) |
949 | (toolbar-insert-item |
950 | toolbar text icon :append :callback callback |
951 | :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text)) |
560af5c5 |
952 | |
953 | |
f36ca6af |
954 | (defun toolbar-prepend-item (toolbar text icon &key tooltip-text |
955 | tooltip-private-text callback) |
956 | (toolbar-insert-item |
957 | toolbar text icon :prepend :callback callback |
958 | :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text)) |
560af5c5 |
959 | |
f36ca6af |
960 | (defun toolbar-enable-tooltips (toolbar) |
961 | (setf (toolbar-tooltips-p toolbar) t)) |
560af5c5 |
962 | |
f36ca6af |
963 | (defun toolbar-disable-tooltips (toolbar) |
964 | (setf (toolbar-tooltips-p toolbar) nil)) |
560af5c5 |
965 | |
966 | |
967 | |
560af5c5 |
968 | ;;; Calendar |
969 | |
bbaeff4b |
970 | (defbinding calendar-select-month () int |
560af5c5 |
971 | (calendar calendar) |
972 | (month unsigned-int) |
973 | (year unsigned-int)) |
974 | |
bbaeff4b |
975 | (defbinding calendar-select-day () nil |
560af5c5 |
976 | (calendar calendar) |
977 | (day unsigned-int)) |
978 | |
bbaeff4b |
979 | (defbinding calendar-mark-day () int |
560af5c5 |
980 | (calendar calendar) |
981 | (day unsigned-int)) |
982 | |
bbaeff4b |
983 | (defbinding calendar-unmark-day () int |
560af5c5 |
984 | (calendar calendar) |
985 | (day unsigned-int)) |
986 | |
bbaeff4b |
987 | (defbinding calendar-clear-marks () nil |
560af5c5 |
988 | (calendar calendar)) |
989 | |
bbaeff4b |
990 | (defbinding calendar-display-options () nil |
560af5c5 |
991 | (calendar calendar) |
992 | (options calendar-display-options)) |
993 | |
bbaeff4b |
994 | (defbinding (calendar-date "gtk_calendar_get_date") () nil |
560af5c5 |
995 | (calendar calendar) |
996 | (year unsigned-int :out) |
997 | (month unsigned-int :out) |
998 | (day unsigned-int :out)) |
999 | |
bbaeff4b |
1000 | (defbinding calendar-freeze () nil |
560af5c5 |
1001 | (calendar calendar)) |
1002 | |
bbaeff4b |
1003 | (defbinding calendar-thaw () nil |
560af5c5 |
1004 | (calendar calendar)) |
1005 | |
1006 | |
1007 | |
1008 | ;;; Drawing area |
1009 | |
560af5c5 |
1010 | |
bbaeff4b |
1011 | ; (defbinding ("gtk_drawing_area_size" %drawing-area-set-size) () nil |
560af5c5 |
1012 | ; (drawing-area drawing-area) |
1013 | ; (width int) |
1014 | ; (height int)) |
1015 | |
1016 | ; (defun (setf drawing-area-size) (size drawing-area) |
1017 | ; (%drawing-area-set-size drawing-area (svref size 0) (svref size 1)) |
1018 | ; (values (svref size 0) (svref size 1))) |
1019 | |
f36ca6af |
1020 | ; ;; gtkglue.c |
bbaeff4b |
1021 | ; (defbinding ("gtk_drawing_area_get_size" drawing-area-size) () nil |
560af5c5 |
1022 | ; (drawing-area drawing-area) |
1023 | ; (width int :out) |
1024 | ; (height int :out)) |
1025 | |
1026 | |
1027 | |
bbaeff4b |
1028 | ;;; Editable |
1029 | #| |
1030 | (defbinding editable-select-region (editable &optional (start 0) end) nil |
f36ca6af |
1031 | (editable editable) |
1032 | (start int) |
1033 | ((or end -1) int)) |
560af5c5 |
1034 | |
bbaeff4b |
1035 | (defbinding editable-insert-text |
f36ca6af |
1036 | (editable text &optional (position 0)) nil |
1037 | (editable editable) |
1038 | (text string) |
1039 | ((length text) int) |
1040 | ((or position -1) int :in-out)) |
560af5c5 |
1041 | |
f36ca6af |
1042 | (defun editable-append-text (editable text) |
1043 | (editable-insert-text editable text nil)) |
560af5c5 |
1044 | |
f36ca6af |
1045 | (defun editable-prepend-text (editable text) |
1046 | (editable-insert-text editable text 0)) |
560af5c5 |
1047 | |
bbaeff4b |
1048 | (defbinding editable-delete-text (editable &optional (start 0) end) nil |
f36ca6af |
1049 | (editable editable) |
1050 | (start int) |
1051 | ((or end -1) int)) |
560af5c5 |
1052 | |
bbaeff4b |
1053 | (defbinding (editable-text "gtk_editable_get_chars") |
f36ca6af |
1054 | (editable &optional (start 0) end) string |
1055 | (editable editable) |
1056 | (start int) |
1057 | ((or end -1) int)) |
560af5c5 |
1058 | |
f36ca6af |
1059 | (defun (setf editable-text) (text editable) |
1060 | (if text |
1061 | (editable-delete-text |
1062 | editable |
1063 | (editable-insert-text editable text)) |
1064 | (editable-delete-text editable)) |
1065 | text) |
560af5c5 |
1066 | |
bbaeff4b |
1067 | (defbinding editable-cut-clipboard () nil |
f36ca6af |
1068 | (editable editable)) |
560af5c5 |
1069 | |
bbaeff4b |
1070 | (defbinding editable-copy-clipboard () nil |
f36ca6af |
1071 | (editable editable)) |
560af5c5 |
1072 | |
bbaeff4b |
1073 | (defbinding editable-paste-clipboard () nil |
f36ca6af |
1074 | (editable editable)) |
560af5c5 |
1075 | |
bbaeff4b |
1076 | ; (defbinding editable-claim-selection () nil |
b9752933 |
1077 | ; (editable editable) |
1078 | ; (claim boolean) |
1079 | ; (time unsigned-int)) |
560af5c5 |
1080 | |
bbaeff4b |
1081 | (defbinding editable-delete-selection () nil |
f36ca6af |
1082 | (editable editable)) |
560af5c5 |
1083 | |
bbaeff4b |
1084 | ; (defbinding editable-changed () nil |
b9752933 |
1085 | ; (editable editable)) |
bbaeff4b |
1086 | |# |
560af5c5 |
1087 | |
560af5c5 |
1088 | |
f36ca6af |
1089 | ;;; Spin button |
560af5c5 |
1090 | |
f36ca6af |
1091 | (defun spin-button-value-as-int (spin-button) |
1092 | (round (spin-button-value spin-button))) |
560af5c5 |
1093 | |
bbaeff4b |
1094 | (defbinding spin-button-spin () nil |
f36ca6af |
1095 | (spin-button spin-button) |
1096 | (direction spin-type) |
1097 | (increment single-float)) |
560af5c5 |
1098 | |
bbaeff4b |
1099 | (defbinding spin-button-update () nil |
f36ca6af |
1100 | (spin-button spin-button)) |
560af5c5 |
1101 | |
1102 | |
1103 | |
1104 | ; ;;; Ruler |
1105 | |
bbaeff4b |
1106 | (defbinding ruler-set-range () nil |
f36ca6af |
1107 | (ruler ruler) |
1108 | (lower single-float) |
1109 | (upper single-float) |
1110 | (position single-float) |
1111 | (max-size single-float)) |
560af5c5 |
1112 | |
bbaeff4b |
1113 | (defbinding ruler-draw-ticks () nil |
f36ca6af |
1114 | (ruler ruler)) |
560af5c5 |
1115 | |
bbaeff4b |
1116 | (defbinding ruler-draw-pos () nil |
f36ca6af |
1117 | (ruler ruler)) |
560af5c5 |
1118 | |
560af5c5 |
1119 | |
560af5c5 |
1120 | |
d520140e |
1121 | ;;; Range |
bbaeff4b |
1122 | #| |
1123 | (defbinding range-draw-background () nil |
d520140e |
1124 | (range range)) |
560af5c5 |
1125 | |
bbaeff4b |
1126 | (defbinding range-clear-background () nil |
d520140e |
1127 | (range range)) |
560af5c5 |
1128 | |
bbaeff4b |
1129 | (defbinding range-draw-trough () nil |
d520140e |
1130 | (range range)) |
560af5c5 |
1131 | |
bbaeff4b |
1132 | (defbinding range-draw-slider () nil |
d520140e |
1133 | (range range)) |
560af5c5 |
1134 | |
bbaeff4b |
1135 | (defbinding range-draw-step-forw () nil |
d520140e |
1136 | (range range)) |
560af5c5 |
1137 | |
bbaeff4b |
1138 | (defbinding range-slider-update () nil |
d520140e |
1139 | (range range)) |
560af5c5 |
1140 | |
bbaeff4b |
1141 | (defbinding range-trough-click () int |
d520140e |
1142 | (range range) |
1143 | (x int) |
1144 | (y int) |
1145 | (jump-perc single-float :out)) |
560af5c5 |
1146 | |
bbaeff4b |
1147 | (defbinding range-default-hslider-update () nil |
d520140e |
1148 | (range range)) |
560af5c5 |
1149 | |
bbaeff4b |
1150 | (defbinding range-default-vslider-update () nil |
d520140e |
1151 | (range range)) |
560af5c5 |
1152 | |
bbaeff4b |
1153 | (defbinding range-default-htrough-click () int |
d520140e |
1154 | (range range) |
1155 | (x int) |
1156 | (y int) |
1157 | (jump-perc single-float :out)) |
560af5c5 |
1158 | |
bbaeff4b |
1159 | (defbinding range-default-vtrough-click () int |
d520140e |
1160 | (range range) |
1161 | (x int) |
1162 | (y int) |
1163 | (jump-perc single-float :out)) |
560af5c5 |
1164 | |
bbaeff4b |
1165 | (defbinding range-default-hmotion () int |
d520140e |
1166 | (range range) |
1167 | (x-delta int) |
1168 | (y-delta int)) |
560af5c5 |
1169 | |
bbaeff4b |
1170 | (defbinding range-default-vmotion () int |
d520140e |
1171 | (range range) |
1172 | (x-delta int) |
1173 | (y-delta int)) |
bbaeff4b |
1174 | |# |
560af5c5 |
1175 | |
560af5c5 |
1176 | |
d520140e |
1177 | ;;; Scale |
560af5c5 |
1178 | |
bbaeff4b |
1179 | (defbinding scale-draw-value () nil |
d520140e |
1180 | (scale scale)) |
560af5c5 |
1181 | |
560af5c5 |
1182 | |
560af5c5 |
1183 | |
d520140e |
1184 | ;;; Progress |
560af5c5 |
1185 | |
bbaeff4b |
1186 | (defbinding progress-configure () adjustment |
d520140e |
1187 | (progress progress) |
1188 | (value single-float) |
1189 | (min single-float) |
1190 | (max single-float)) |
560af5c5 |
1191 | |
bbaeff4b |
1192 | (defbinding (progress-text-from-value |
1193 | "gtk_progress_get_text_from_value") () string |
d520140e |
1194 | (progress progress)) |
560af5c5 |
1195 | |
bbaeff4b |
1196 | (defbinding (progress-percentage-from-value |
1197 | "gtk_progress_get_percentage_from_value") () single-float |
d520140e |
1198 | (progress progress)) |
560af5c5 |
1199 | |
560af5c5 |
1200 | |
560af5c5 |
1201 | |
d520140e |
1202 | ;;; Progress bar |
560af5c5 |
1203 | |
bbaeff4b |
1204 | (defbinding progress-bar-pulse () nil |
d520140e |
1205 | (progress-bar progress-bar)) |
560af5c5 |
1206 | |
1207 | |
1208 | |
1209 | ;;; Adjustment |
1210 | |
bbaeff4b |
1211 | (defbinding adjustment-changed () nil |
560af5c5 |
1212 | (adjustment adjustment)) |
1213 | |
bbaeff4b |
1214 | (defbinding adjustment-value-changed () nil |
560af5c5 |
1215 | (adjustment adjustment)) |
1216 | |
bbaeff4b |
1217 | (defbinding adjustment-clamp-page () nil |
560af5c5 |
1218 | (adjustment adjustment) |
1219 | (lower single-float) |
1220 | (upper single-float)) |
1221 | |
1222 | |
1223 | |
1224 | ;;; Tooltips |
1225 | |
bbaeff4b |
1226 | (defbinding tooltips-enable () nil |
d520140e |
1227 | (tooltips tooltips)) |
560af5c5 |
1228 | |
bbaeff4b |
1229 | (defbinding tooltips-disable () nil |
d520140e |
1230 | (tooltips tooltips)) |
560af5c5 |
1231 | |
bbaeff4b |
1232 | (defbinding tooltips-set-tip () nil |
d520140e |
1233 | (tooltips tooltips) |
1234 | (widget widget) |
1235 | (tip-text string) |
1236 | (tip-private string)) |
560af5c5 |
1237 | |
bbaeff4b |
1238 | (defbinding tooltips-set-colors (tooltips background foreground) nil |
d520140e |
1239 | (tooltips tooltips) |
1240 | ((gdk:ensure-color background) gdk:color) |
1241 | ((gdk:ensure-color foreground) gdk:color)) |
560af5c5 |
1242 | |
bbaeff4b |
1243 | (defbinding tooltips-force-window () nil |
d520140e |
1244 | (tooltips tooltips)) |
560af5c5 |
1245 | |
1246 | |
1247 | |
d520140e |
1248 | ;;; Rc |
560af5c5 |
1249 | |
bbaeff4b |
1250 | (defbinding rc-add-default-file (filename) nil |
d520140e |
1251 | ((namestring (truename filename)) string)) |
560af5c5 |
1252 | |
bbaeff4b |
1253 | (defbinding rc-parse (filename) nil |
d520140e |
1254 | ((namestring (truename filename)) string)) |
560af5c5 |
1255 | |
bbaeff4b |
1256 | (defbinding rc-parse-string () nil |
d520140e |
1257 | (rc-string string)) |
560af5c5 |
1258 | |
bbaeff4b |
1259 | (defbinding rc-reparse-all () nil) |
560af5c5 |
1260 | |
bbaeff4b |
1261 | (defbinding rc-get-style () style |
d520140e |
1262 | (widget widget)) |
560af5c5 |
1263 | |
1264 | |
1265 | |
1266 | ;;; Accelerator Groups |
bbaeff4b |
1267 | #| |
1268 | (defbinding accel-group-get-default () accel-group) |
560af5c5 |
1269 | |
f36ca6af |
1270 | (deftype-method alien-ref accel-group (type-spec) |
1271 | (declare (ignore type-spec)) |
1272 | '%accel-group-ref) |
560af5c5 |
1273 | |
f36ca6af |
1274 | (deftype-method alien-unref accel-group (type-spec) |
1275 | (declare (ignore type-spec)) |
1276 | '%accel-group-unref) |
1277 | |
bbaeff4b |
1278 | (defbinding %accel-group-ref () accel-group |
f36ca6af |
1279 | (accel-group (or accel-group pointer))) |
1280 | |
bbaeff4b |
1281 | (defbinding %accel-group-unref () nil |
f36ca6af |
1282 | (accel-group (or accel-group pointer))) |
560af5c5 |
1283 | |
bbaeff4b |
1284 | (defbinding accel-group-activate (accel-group key modifiers) boolean |
560af5c5 |
1285 | (accel-group accel-group) |
1286 | ((gdk:keyval-from-name key) unsigned-int) |
1287 | (modifiers gdk:modifier-type)) |
1288 | |
bbaeff4b |
1289 | (defbinding accel-groups-activate (object key modifiers) boolean |
560af5c5 |
1290 | (object object) |
1291 | ((gdk:keyval-from-name key) unsigned-int) |
1292 | (modifiers gdk:modifier-type)) |
1293 | |
bbaeff4b |
1294 | (defbinding accel-group-attach () nil |
560af5c5 |
1295 | (accel-group accel-group) |
1296 | (object object)) |
1297 | |
bbaeff4b |
1298 | (defbinding accel-group-detach () nil |
560af5c5 |
1299 | (accel-group accel-group) |
1300 | (object object)) |
1301 | |
bbaeff4b |
1302 | (defbinding accel-group-lock () nil |
560af5c5 |
1303 | (accel-group accel-group)) |
1304 | |
bbaeff4b |
1305 | (defbinding accel-group-unlock () nil |
560af5c5 |
1306 | (accel-group accel-group)) |
1307 | |
1308 | |
1309 | ;;; Accelerator Groups Entries |
1310 | |
bbaeff4b |
1311 | (defbinding accel-group-get-entry (accel-group key modifiers) accel-entry |
560af5c5 |
1312 | (accel-group accel-group) |
1313 | ((gdk:keyval-from-name key) unsigned-int) |
1314 | (modifiers gdk:modifier-type)) |
1315 | |
bbaeff4b |
1316 | (defbinding accel-group-lock-entry (accel-group key modifiers) nil |
560af5c5 |
1317 | (accel-group accel-group) |
1318 | ((gdk:keyval-from-name key) unsigned-int) |
1319 | (modifiers gdk:modifier-type)) |
1320 | |
bbaeff4b |
1321 | (defbinding accel-group-unlock-entry (accel-group key modifiers) nil |
560af5c5 |
1322 | (accel-group accel-group) |
1323 | ((gdk:keyval-from-name key) unsigned-int) |
1324 | (modifiers gdk:modifier-type)) |
1325 | |
bbaeff4b |
1326 | (defbinding accel-group-add |
560af5c5 |
1327 | (accel-group key modifiers flags object signal) nil |
1328 | (accel-group accel-group) |
1329 | ((gdk:keyval-from-name key) unsigned-int) |
1330 | (modifiers gdk:modifier-type) |
1331 | (flags accel-flags) |
1332 | (object object) |
1333 | ((name-to-string signal) string)) |
1334 | |
bbaeff4b |
1335 | (defbinding accel-group-add (accel-group key modifiers object) nil |
560af5c5 |
1336 | (accel-group accel-group) |
1337 | ((gdk:keyval-from-name key) unsigned-int) |
1338 | (modifiers gdk:modifier-type) |
1339 | (object object)) |
1340 | |
1341 | |
1342 | ;;; Accelerator Signals |
1343 | |
bbaeff4b |
1344 | (defbinding accel-group-handle-add |
560af5c5 |
1345 | (object signal-id accel-group key modifiers flags) nil |
1346 | (object object) |
1347 | (signal-id unsigned-int) |
1348 | (accel-group accel-group) |
1349 | ((gdk:keyval-from-name key) unsigned-int) |
1350 | (modifiers gdk:modifier-type) |
1351 | (flags accel-flags)) |
1352 | |
bbaeff4b |
1353 | (defbinding accel-group-handle-remove |
560af5c5 |
1354 | (object accel-group key modifiers) nil |
1355 | (object object) |
1356 | (accel-group accel-group) |
1357 | ((gdk:keyval-from-name key) unsigned-int) |
1358 | (modifiers gdk:modifier-type)) |
bbaeff4b |
1359 | |# |
560af5c5 |
1360 | |
1361 | |
1362 | ;;; Style |
1363 | |
bbaeff4b |
1364 | ; (defbinding style-new () style) |
560af5c5 |
1365 | |
bbaeff4b |
1366 | ; (defbinding style-copy () style |
560af5c5 |
1367 | ; (style style)) |
bbaeff4b |
1368 | #| |
1369 | (defbinding %style-get-color () gdk:color |
d520140e |
1370 | (style style) |
1371 | (color-type color-type) |
1372 | (state-type state-type)) |
560af5c5 |
1373 | |
bbaeff4b |
1374 | (defbinding %style-set-color () gdk:color |
d520140e |
1375 | (style style) |
1376 | (color-type color-type) |
1377 | (state-type state-type) |
1378 | (color gdk:color)) |
560af5c5 |
1379 | |
d520140e |
1380 | (defun style-fg (style state) |
1381 | (%style-get-color style :foreground state)) |
560af5c5 |
1382 | |
d520140e |
1383 | (defun (setf style-fg) (color style state) |
1384 | (%style-set-color style :foreground state color)) |
560af5c5 |
1385 | |
d520140e |
1386 | (defun style-bg (style state) |
1387 | (%style-get-color style :background state)) |
560af5c5 |
1388 | |
d520140e |
1389 | (defun (setf style-bg) (color style state) |
1390 | (%style-set-color style :background state color)) |
560af5c5 |
1391 | |
d520140e |
1392 | (defun style-text (style state) |
1393 | (%style-get-color style :text state)) |
560af5c5 |
1394 | |
d520140e |
1395 | (defun (setf style-text) (color style state) |
1396 | (%style-set-color style :text state color)) |
560af5c5 |
1397 | |
d520140e |
1398 | (defun style-base (style state) |
1399 | (%style-get-color style :base state)) |
560af5c5 |
1400 | |
d520140e |
1401 | (defun (setf style-base) (color style state) |
1402 | (%style-set-color style :base state color)) |
560af5c5 |
1403 | |
d520140e |
1404 | (defun style-white (style) |
1405 | (%style-get-color style :white :normal)) |
560af5c5 |
1406 | |
d520140e |
1407 | (defun (setf style-white) (color style) |
1408 | (%style-set-color style :white :normal color)) |
560af5c5 |
1409 | |
d520140e |
1410 | (defun style-black (style) |
1411 | (%style-get-color style :black :normal)) |
560af5c5 |
1412 | |
d520140e |
1413 | (defun (setf style-black) (color style) |
1414 | (%style-set-color style :black :normal color)) |
560af5c5 |
1415 | |
bbaeff4b |
1416 | (defbinding style-get-gc () gdk:gc |
d520140e |
1417 | (style style) |
1418 | (color-type color-type) |
1419 | (state-type state-type)) |
b9752933 |
1420 | |
bbaeff4b |
1421 | |# |
1422 | (defbinding draw-hline () nil |
b9752933 |
1423 | (style style) |
1424 | (window gdk:window) |
1425 | (state state-type) |
1426 | (x1 int) |
1427 | (x2 int) |
1428 | (y int)) |
1429 | |
bbaeff4b |
1430 | (defbinding draw-vline () nil |
b9752933 |
1431 | (style style) |
1432 | (window gdk:window) |
1433 | (state state-type) |
1434 | (y1 int) |
1435 | (y2 int) |
1436 | (x int)) |
1437 | |
bbaeff4b |
1438 | (defbinding draw-shadow () nil |
b9752933 |
1439 | (style style) |
1440 | (window gdk:window) |
1441 | (state state-type) |
1442 | (shadow shadow-type) |
1443 | (x int) |
1444 | (y int) |
1445 | (width int) |
1446 | (height int)) |
1447 | |
bbaeff4b |
1448 | ; (defbinding draw-polygon () nil |
b9752933 |
1449 | ; (style style) |
1450 | ; (window gdk:window) |
1451 | ; (state state-type) |
1452 | ; (shadow shadow-type) |
1453 | ; (points (vector gdk:point)) |
1454 | ; ((length points) int) |
1455 | ; (fill boolean)) |
1456 | |
bbaeff4b |
1457 | (defbinding draw-arrow () nil |
b9752933 |
1458 | (style style) |
1459 | (window gdk:window) |
1460 | (state state-type) |
1461 | (shadow shadow-type) |
1462 | (arrow arrow-type) |
1463 | (fill boolean) |
1464 | (x int) |
1465 | (y int) |
1466 | (width int) |
1467 | (height int)) |
1468 | |
bbaeff4b |
1469 | (defbinding draw-diamond () nil |
b9752933 |
1470 | (style style) |
1471 | (window gdk:window) |
1472 | (state state-type) |
1473 | (shadow shadow-type) |
1474 | (x int) |
1475 | (y int) |
1476 | (width int) |
1477 | (height int)) |
1478 | |
bbaeff4b |
1479 | ; (defbinding draw-oval () nil |
b9752933 |
1480 | ; (style style) |
1481 | ; (window gdk:window) |
1482 | ; (state state-type) |
1483 | ; (shadow shadow-type) |
1484 | ; (x int) |
1485 | ; (y int) |
1486 | ; (width int) |
1487 | ; (height int)) |
1488 | |
bbaeff4b |
1489 | (defbinding draw-string () nil |
b9752933 |
1490 | (style style) |
1491 | (window gdk:window) |
1492 | (state state-type) |
1493 | (x int) |
1494 | (y int) |
1495 | (string string)) |
1496 | |
bbaeff4b |
1497 | (defbinding draw-box () nil |
b9752933 |
1498 | (style style) |
1499 | (window gdk:window) |
1500 | (state state-type) |
1501 | (shadow shadow-type) |
1502 | (x int) |
1503 | (y int) |
1504 | (width int) |
1505 | (height int)) |
1506 | |
bbaeff4b |
1507 | (defbinding draw-flat-box () nil |
b9752933 |
1508 | (style style) |
1509 | (window gdk:window) |
1510 | (state state-type) |
1511 | (shadow shadow-type) |
1512 | (x int) |
1513 | (y int) |
1514 | (width int) |
1515 | (height int)) |
1516 | |
bbaeff4b |
1517 | (defbinding draw-check () nil |
b9752933 |
1518 | (style style) |
1519 | (window gdk:window) |
1520 | (state state-type) |
1521 | (shadow shadow-type) |
1522 | (x int) |
1523 | (y int) |
1524 | (width int) |
1525 | (height int)) |
1526 | |
bbaeff4b |
1527 | (defbinding draw-option () nil |
b9752933 |
1528 | (style style) |
1529 | (window gdk:window) |
1530 | (state state-type) |
1531 | (shadow shadow-type) |
1532 | (x int) |
1533 | (y int) |
1534 | (width int) |
1535 | (height int)) |
1536 | |
bbaeff4b |
1537 | ; (defbinding draw-cross () nil |
b9752933 |
1538 | ; (style style) |
1539 | ; (window gdk:window) |
1540 | ; (state state-type) |
1541 | ; (shadow shadow-type) |
1542 | ; (x int) |
1543 | ; (y int) |
1544 | ; (width int) |
1545 | ; (height int)) |
1546 | |
bbaeff4b |
1547 | ; (defbinding draw-ramp () nil |
b9752933 |
1548 | ; (style style) |
1549 | ; (window gdk:window) |
1550 | ; (state state-type) |
1551 | ; (shadow shadow-type) |
1552 | ; (arrow arrow-type) |
1553 | ; (x int) |
1554 | ; (y int) |
1555 | ; (width int) |
1556 | ; (height int)) |
1557 | |
bbaeff4b |
1558 | (defbinding draw-tab () nil |
b9752933 |
1559 | (style style) |
1560 | (window gdk:window) |
1561 | (state state-type) |
1562 | (x int) |
1563 | (y int) |
1564 | (width int) |
1565 | (height int)) |
1566 | |
bbaeff4b |
1567 | (defbinding draw-shadow-gap () nil |
b9752933 |
1568 | (style style) |
1569 | (window gdk:window) |
1570 | (state state-type) |
1571 | (x int) |
1572 | (y int) |
1573 | (width int) |
1574 | (height int) |
1575 | (gap-side position-type) |
1576 | (gap-x int) |
1577 | (gap-width int)) |
1578 | |
bbaeff4b |
1579 | (defbinding draw-box-gap () nil |
b9752933 |
1580 | (style style) |
1581 | (window gdk:window) |
1582 | (state state-type) |
1583 | (x int) |
1584 | (y int) |
1585 | (width int) |
1586 | (height int) |
1587 | (gap-side position-type) |
1588 | (gap-x int) |
1589 | (gap-width int)) |
1590 | |
bbaeff4b |
1591 | (defbinding draw-extension () nil |
b9752933 |
1592 | (style style) |
1593 | (window gdk:window) |
1594 | (state state-type) |
1595 | (x int) |
1596 | (y int) |
1597 | (width int) |
1598 | (height int)) |
1599 | |
bbaeff4b |
1600 | (defbinding draw-focus () nil |
b9752933 |
1601 | (style style) |
1602 | (window gdk:window) |
1603 | (x int) |
1604 | (y int) |
1605 | (width int) |
1606 | (height int)) |
1607 | |
bbaeff4b |
1608 | (defbinding draw-slider () nil |
b9752933 |
1609 | (style style) |
1610 | (window gdk:window) |
1611 | (state state-type) |
1612 | (shadow shadow-type) |
1613 | (x int) |
1614 | (y int) |
1615 | (width int) |
1616 | (height int) |
1617 | (orientation orientation)) |
1618 | |
bbaeff4b |
1619 | (defbinding draw-handle () nil |
b9752933 |
1620 | (style style) |
1621 | (window gdk:window) |
1622 | (state state-type) |
1623 | (shadow shadow-type) |
1624 | (x int) |
1625 | (y int) |
1626 | (width int) |
1627 | (height int) |
1628 | (orientation orientation)) |
1629 | |
bbaeff4b |
1630 | (defbinding draw-handle () nil |
b9752933 |
1631 | (style style) |
1632 | (window gdk:window) |
1633 | (state state-type) |
1634 | (shadow shadow-type) |
1635 | (x int) |
1636 | (y int) |
1637 | (width int) |
1638 | (height int) |
1639 | (orientation orientation)) |
1640 | |
bbaeff4b |
1641 | (defbinding paint-hline () nil |
b9752933 |
1642 | (style style) |
1643 | (window gdk:window) |
1644 | (state state-type) |
1645 | (x1 int) |
1646 | (x2 int) |
1647 | (y int)) |