55212af1 |
1 | ;; Common Lisp bindings for GTK+ v2.x |
2 | ;; Copyright 1999-2005 Espen S. Johnsen <espen@users.sf.net> |
0d07716f |
3 | ;; |
55212af1 |
4 | ;; Permission is hereby granted, free of charge, to any person obtaining |
5 | ;; a copy of this software and associated documentation files (the |
6 | ;; "Software"), to deal in the Software without restriction, including |
7 | ;; without limitation the rights to use, copy, modify, merge, publish, |
8 | ;; distribute, sublicense, and/or sell copies of the Software, and to |
9 | ;; permit persons to whom the Software is furnished to do so, subject to |
10 | ;; the following conditions: |
0d07716f |
11 | ;; |
55212af1 |
12 | ;; The above copyright notice and this permission notice shall be |
13 | ;; included in all copies or substantial portions of the Software. |
0d07716f |
14 | ;; |
55212af1 |
15 | ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
16 | ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
17 | ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
18 | ;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
19 | ;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
20 | ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
21 | ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
0d07716f |
22 | |
a92553bd |
23 | ;; $Id: gtk.lisp,v 1.54 2006/02/19 19:31:14 espen Exp $ |
0d07716f |
24 | |
25 | |
26 | (in-package "GTK") |
27 | |
28 | ;;; Gtk version |
29 | |
84967144 |
30 | (defbinding check-version () (copy-of string) |
0d07716f |
31 | (required-major unsigned-int) |
32 | (required-minor unsigned-int) |
33 | (required-micro unsigned-int)) |
34 | |
a60bd055 |
35 | (defbinding query-version () nil |
0d07716f |
36 | (major unsigned-int :out) |
37 | (minor unsigned-int :out) |
38 | (micro unsigned-int :out)) |
39 | |
40 | (defun gtk-version () |
41 | (multiple-value-bind (major minor micro) |
42 | (query-version) |
43 | (if (zerop micro) |
44 | (format nil "Gtk+ v~A.~A" major minor) |
45 | (format nil "Gtk+ v~A.~A.~A" major minor micro)))) |
46 | |
e69138cc |
47 | (defun clg-version () |
2cd56180 |
48 | "clg 0.91 version") |
0d07716f |
49 | |
50 | |
6baf860c |
51 | ;;;; Initalization |
52 | |
30628c63 |
53 | (defbinding (gtk-init "gtk_parse_args") () boolean |
6baf860c |
54 | "Initializes the library without opening the display." |
55 | (nil null) |
56 | (nil null)) |
57 | |
58 | (defun clg-init (&optional display) |
59 | "Initializes the system and starts the event handling" |
c1ef6223 |
60 | #+sbcl(when (and |
61 | (find-package "SWANK") |
62 | (eq (symbol-value (find-symbol "*COMMUNICATION-STYLE*" "SWANK")) :spawn)) |
63 | (error "When running clg in Slime the communication style :spawn can not be used. See the README file and <http://common-lisp.net/project/slime/doc/html/slime_45.html> for more information.")) |
64 | |
6baf860c |
65 | (unless (gdk:display-get-default) |
66 | (gdk:gdk-init) |
30628c63 |
67 | (unless (gtk-init) |
68 | (error "Initialization of GTK+ failed.")) |
6baf860c |
69 | (prog1 |
70 | (gdk:display-open display) |
3d36c5d6 |
71 | (add-fd-handler (gdk:display-connection-number) :input #'main-iterate-all) |
72 | (setq *periodic-polling-function* #'main-iterate-all) |
73 | (setq *max-event-to-sec* 0) |
74 | (setq *max-event-to-usec* 1000)))) |
6baf860c |
75 | |
76 | |
17707159 |
77 | ;;; Misc |
78 | |
79 | (defbinding grab-add () nil |
80 | (widget widget)) |
81 | |
3a476d4e |
82 | (defbinding grab-get-current () widget) |
17707159 |
83 | |
84 | (defbinding grab-remove () nil |
85 | (widget widget)) |
86 | |
e69138cc |
87 | (defbinding get-default-language () (copy-of pango:language)) |
88 | |
17707159 |
89 | |
1448a84f |
90 | ;;; About dialog |
91 | |
92 | #+gtk2.6 |
93 | (progn |
a92553bd |
94 | (define-callback-marshal %about-dialog-activate-link-callback nil |
95 | (about-dialog (link string))) |
1448a84f |
96 | |
97 | (defbinding about-dialog-set-email-hook (function) nil |
a92553bd |
98 | (%about-dialog-activate-link-callback callback) |
1448a84f |
99 | ((register-callback-function function) unsigned-int) |
a92553bd |
100 | (user-data-destroy-callback callback)) |
1448a84f |
101 | |
102 | (defbinding about-dialog-set-url-hook (function) nil |
a92553bd |
103 | (%about-dialog-activate-link-callback callback) |
1448a84f |
104 | ((register-callback-function function) unsigned-int) |
a92553bd |
105 | (user-data-destroy-callback callback))) |
1448a84f |
106 | |
107 | |
d404b3af |
108 | ;;; Acccel group |
0d07716f |
109 | |
213cf4d0 |
110 | (defbinding %accel-group-connect () nil |
111 | (accel-group accel-group) |
112 | (key unsigned-int) |
113 | (modifiers gdk:modifier-type) |
114 | (flags accel-flags) |
115 | (gclosure gclosure)) |
116 | |
117 | (defun accel-group-connect (group accelerator function &optional flags) |
7b6c693b |
118 | (multiple-value-bind (key modifiers) (parse-accelerator accelerator) |
213cf4d0 |
119 | (let ((gclosure (make-callback-closure function))) |
120 | (%accel-group-connect group key modifiers flags gclosure) |
121 | gclosure))) |
122 | |
123 | (defbinding accel-group-connect-by-path (group path function) nil |
124 | (group accel-group) |
125 | (path string) |
126 | ((make-callback-closure function) gclosure :return)) |
127 | |
128 | (defbinding %accel-group-disconnect (group gclosure) boolean |
129 | (group accel-group) |
130 | (gclosure gclosure)) |
131 | |
132 | (defbinding %accel-group-disconnect-key () boolean |
133 | (group accel-group) |
134 | (key unsigned-int) |
135 | (modifiers gdk:modifier-type)) |
136 | |
137 | (defun accel-group-disconnect (group accelerator) |
138 | (etypecase accelerator |
139 | (gclosure (%accel-group-disconnect group accelerator)) |
140 | (string |
7b6c693b |
141 | (multiple-value-bind (key modifiers) (parse-accelerator accelerator) |
213cf4d0 |
142 | (%accel-group-disconnect-key group key modifiers))))) |
143 | |
7b6c693b |
144 | (defbinding %accel-group-query () (copy-of (vector (inlined accel-group-entry) n)) |
145 | (accel-group accel-group) |
146 | (key unsigned-int) |
147 | (modifiers gdk:modifier-type) |
148 | (n int :out)) |
149 | |
150 | (defun accel-group-query (accel-group accelerator) |
151 | (multiple-value-bind (key modifiers) (parse-accelerator accelerator) |
152 | (%accel-group-query accel-group key modifiers))) |
153 | |
154 | (defbinding %accel-group-activate () boolean |
155 | (accel-group accel-group) |
156 | (acceleratable gobject) |
157 | (key unsigned-int) |
158 | (modifiers gdk:modifier-type)) |
159 | |
160 | (defun accel-group-activate (accel-group acceleratable accelerator) |
161 | (multiple-value-bind (key modifiers) (parse-accelerator accelerator) |
162 | (%accel-group-activate accel-group acceleratable key modifiers))) |
163 | |
213cf4d0 |
164 | (defbinding accel-group-lock () nil |
165 | (accel-group accel-group)) |
166 | |
167 | (defbinding accel-group-unlock () nil |
168 | (accel-group accel-group)) |
169 | |
7b6c693b |
170 | (defbinding accel-group-from-accel-closure () accel-group |
171 | (closure gclosure)) |
172 | |
213cf4d0 |
173 | (defbinding %accel-groups-activate () boolean |
174 | (object gobject) |
175 | (key unsigned-int) |
176 | (modifiers gdk:modifier-type)) |
177 | |
178 | (defun accel-groups-activate (object accelerator) |
7b6c693b |
179 | (multiple-value-bind (key modifiers) (parse-accelerator accelerator) |
213cf4d0 |
180 | (%accel-groups-activate object key modifiers))) |
181 | |
182 | (defbinding accel-groups-from-object () (gslist accel-groups) |
183 | (object gobject)) |
184 | |
3d36c5d6 |
185 | (defbinding accelerator-valid-p (key &optional modifiers) boolean |
213cf4d0 |
186 | (key unsigned-int) |
187 | (modifiers gdk:modifier-type)) |
188 | |
189 | (defbinding %accelerator-parse () nil |
190 | (accelerator string) |
191 | (key unsigned-int :out) |
192 | (modifiers gdk:modifier-type :out)) |
193 | |
7b6c693b |
194 | (defgeneric parse-accelerator (accelerator)) |
195 | |
196 | (defmethod parse-accelerator ((accelerator string)) |
213cf4d0 |
197 | (multiple-value-bind (key modifiers) (%accelerator-parse accelerator) |
198 | (if (zerop key) |
199 | (error "Invalid accelerator: ~A" accelerator) |
200 | (values key modifiers)))) |
201 | |
7b6c693b |
202 | (defmethod parse-accelerator ((accelerator cons)) |
203 | (destructuring-bind (key modifiers) accelerator |
204 | (values |
205 | (etypecase key |
206 | (integer key) |
207 | (string |
208 | (or |
209 | (gdk:keyval-from-name key) |
210 | (error "Invalid key name: ~A" key))) |
211 | (character (parse-accelerator key))) |
212 | modifiers))) |
213 | |
214 | (defmethod parse-accelerator ((key integer)) |
215 | key) |
216 | |
217 | (defmethod parse-accelerator ((key character)) |
218 | (or |
219 | (gdk:keyval-from-name (string key)) |
220 | (error "Invalid key name: ~A" key))) |
221 | |
222 | |
213cf4d0 |
223 | (defbinding accelerator-name () string |
224 | (key unsigned-int) |
225 | (modifiers gdk:modifier-type)) |
226 | |
227 | #+gtk2.6 |
228 | (defbinding accelerator-get-label () string |
229 | (key unsigned-int) |
230 | (modifiers gdk:modifier-type)) |
231 | |
232 | (defbinding %accelerator-set-default-mod-mask () nil |
233 | (default-modifiers gdk:modifier-type)) |
234 | |
235 | (defun (setf accelerator-default-modifier-mask) (default-modifiers) |
236 | (%accelerator-set-default-mod-mask default-modifiers)) |
237 | |
238 | (defbinding (accelerator-default-modifier-mask "gtk_accelerator_get_default_mod_mask") () gdk:modifier-type) |
0d07716f |
239 | |
eb4f580c |
240 | |
0d07716f |
241 | ;;; Acccel label |
242 | |
7b6c693b |
243 | (defbinding accel-label-get-accel-width () unsigned-int |
244 | (accel-label accel-label)) |
245 | |
a60bd055 |
246 | (defbinding accel-label-refetch () boolean |
0d07716f |
247 | (accel-label accel-label)) |
248 | |
249 | |
213cf4d0 |
250 | |
251 | ;;; Accel map |
252 | |
7b6c693b |
253 | (defbinding (accel-map-init "_gtk_accel_map_init") () nil) |
30628c63 |
254 | |
213cf4d0 |
255 | (defbinding %accel-map-add-entry () nil |
256 | (path string) |
257 | (key unsigned-int) |
258 | (modifiers gdk:modifier-type)) |
259 | |
260 | (defun accel-map-add-entry (path accelerator) |
7b6c693b |
261 | (multiple-value-bind (key modifiers) (parse-accelerator accelerator) |
213cf4d0 |
262 | (%accel-map-add-entry path key modifiers))) |
263 | |
7b6c693b |
264 | (defbinding %accel-map-lookup-entry () boolean |
213cf4d0 |
265 | (path string) |
7b6c693b |
266 | ((make-instance 'accel-key) accel-key :return)) |
267 | |
268 | (defun accel-map-lookup-entry (path) |
269 | (multiple-value-bind (found-p accel-key) (%accel-map-lookup-entry path) |
270 | (when found-p |
271 | (values |
272 | (slot-value accel-key 'key) |
273 | (slot-value accel-key 'modifiers) |
274 | (slot-value accel-key 'flags))))) |
213cf4d0 |
275 | |
276 | (defbinding %accel-map-change-entry () boolean |
277 | (path string) |
278 | (key unsigned-int) |
279 | (modifiers gdk:modifier-type) |
280 | (replace boolean)) |
281 | |
282 | (defun accel-map-change-entry (path accelerator &optional replace) |
7b6c693b |
283 | (multiple-value-bind (key modifiers) (parse-accelerator accelerator) |
213cf4d0 |
284 | (%accel-map-change-entry path key modifiers replace))) |
285 | |
286 | (defbinding accel-map-load () nil |
287 | (filename pathname)) |
288 | |
289 | (defbinding accel-map-save () nil |
290 | (filename pathname)) |
291 | |
a92553bd |
292 | (define-callback-marshal %accel-map-foreach-callback nil |
293 | ((accel-path string) (key unsigned-int) |
294 | (modifiers gdk:modifier-type) (changed boolean)) :callback-id :first) |
7b6c693b |
295 | |
296 | (defbinding %accel-map-foreach (callback-id) nil |
297 | (callback-id unsigned-int) |
a92553bd |
298 | (%accel-map-foreach-callback callback)) |
7b6c693b |
299 | |
300 | (defbinding %accel-map-foreach-unfiltered (callback-id) nil |
301 | (callback-id unsigned-int) |
a92553bd |
302 | (%accel-map-foreach-callback callback)) |
7b6c693b |
303 | |
304 | (defun accel-map-foreach (function &optional (filter-p t)) |
305 | (with-callback-function (id function) |
306 | (if filter-p |
307 | (%accel-map-foreach id) |
308 | (%accel-map-foreach-unfiltered id)))) |
309 | |
310 | (defbinding accel-map-add-filter () nil |
311 | (filter string)) |
312 | |
213cf4d0 |
313 | (defbinding accel-map-get () accel-map) |
314 | |
315 | (defbinding accel-map-lock-path () nil |
316 | (path string)) |
317 | |
318 | (defbinding accel-map-unlock-path () nil |
319 | (path string)) |
320 | |
321 | |
322 | |
7b6c693b |
323 | ;;; Accessibility |
14eaa563 |
324 | |
325 | (defbinding accessible-connect-widget-destroyed () nil |
326 | (accessible accessible)) |
327 | |
328 | |
d404b3af |
329 | ;;; Adjustment |
0d07716f |
330 | |
14eaa563 |
331 | (defmethod initialize-instance ((adjustment adjustment) &key value) |
eb4f580c |
332 | (prog1 |
333 | (call-next-method) |
334 | ;; we need to make sure that the value is set last, otherwise it |
14eaa563 |
335 | ;; may be outside current limits and ignored |
eb4f580c |
336 | (when value |
337 | (setf (slot-value adjustment 'value) value)))) |
338 | |
339 | |
d404b3af |
340 | (defbinding adjustment-changed () nil |
341 | (adjustment adjustment)) |
342 | |
343 | (defbinding adjustment-value-changed () nil |
344 | (adjustment adjustment)) |
345 | |
346 | (defbinding adjustment-clamp-page () nil |
347 | (adjustment adjustment) |
348 | (lower single-float) |
349 | (upper single-float)) |
0d07716f |
350 | |
d404b3af |
351 | |
49043b9a |
352 | ;;; Alignment |
353 | |
354 | (defbinding alignment-set () nil |
355 | (alognment alignment) |
356 | (x-align single-float) |
357 | (y-align single-float) |
358 | (x-scale single-float) |
359 | (y-scale single-float)) |
360 | |
361 | (defbinding alignment-get-padding () nil |
362 | (alognment alignment) |
363 | (top unsigned-int :out) |
364 | (bottom unsigned-int :out) |
365 | (left unsigned-int :out) |
366 | (right unsigned-int :out)) |
367 | |
368 | (defbinding alignment-set-padding () nil |
369 | (alognment alignment) |
370 | (top unsigned-int) |
371 | (bottom unsigned-int) |
372 | (left unsigned-int) |
373 | (right unsigned-int)) |
374 | |
375 | |
d404b3af |
376 | ;;; Aspect frame |
377 | |
378 | |
379 | ;;; Bin |
0d07716f |
380 | |
381 | (defun (setf bin-child) (child bin) |
d404b3af |
382 | (when-bind (current-child (bin-child bin)) |
383 | (container-remove bin current-child)) |
0d07716f |
384 | (container-add bin child) |
385 | child) |
386 | |
d79b3413 |
387 | (defmethod compute-signal-function ((bin bin) signal function object) |
388 | (declare (ignore signal)) |
389 | (if (eq object :child) |
9617dc95 |
390 | #'(lambda (&rest args) |
391 | (apply function (bin-child bin) (rest args))) |
392 | (call-next-method))) |
d404b3af |
393 | |
394 | |
395 | ;;; Box |
396 | |
397 | (defbinding box-pack-start () nil |
398 | (box box) |
399 | (child widget) |
400 | (expand boolean) |
401 | (fill boolean) |
402 | (padding unsigned-int)) |
403 | |
404 | (defbinding box-pack-end () nil |
405 | (box box) |
406 | (child widget) |
407 | (expand boolean) |
408 | (fill boolean) |
409 | (padding unsigned-int)) |
410 | |
14eaa563 |
411 | (defun box-pack (box child &key end (expand t) (fill t) (padding 0)) |
4886872c |
412 | (if end |
378b3c5f |
413 | (box-pack-end box child expand fill padding) |
414 | (box-pack-start box child expand fill padding))) |
d404b3af |
415 | |
416 | (defbinding box-reorder-child () nil |
417 | (box box) |
418 | (child widget) |
419 | (position int)) |
420 | |
421 | (defbinding box-query-child-packing () nil |
422 | (box box) |
423 | (child widget) |
424 | (expand boolean :out) |
425 | (fill boolean :out) |
426 | (padding unsigned-int :out) |
427 | (pack-type pack-type :out)) |
428 | |
429 | (defbinding box-set-child-packing () nil |
430 | (box box) |
431 | (child widget) |
432 | (expand boolean) |
433 | (fill boolean) |
434 | (padding unsigned-int) |
435 | (pack-type pack-type)) |
436 | |
437 | |
438 | |
0d07716f |
439 | ;;; Button |
440 | |
14eaa563 |
441 | (defmethod initialize-instance ((button button) &rest initargs &key stock) |
442 | (if stock |
443 | (apply #'call-next-method button :label stock :use-stock t initargs) |
444 | (call-next-method))) |
445 | |
446 | |
a60bd055 |
447 | (defbinding button-pressed () nil |
0d07716f |
448 | (button button)) |
449 | |
d404b3af |
450 | (defbinding button-released () nil |
451 | (button button)) |
452 | |
453 | (defbinding button-clicked () nil |
454 | (button button)) |
455 | |
456 | (defbinding button-enter () nil |
457 | (button button)) |
458 | |
459 | (defbinding button-leave () nil |
460 | (button button)) |
461 | |
462 | |
463 | |
464 | ;;; Calendar |
465 | |
466 | (defbinding calendar-select-month () int |
467 | (calendar calendar) |
468 | (month unsigned-int) |
469 | (year unsigned-int)) |
470 | |
471 | (defbinding calendar-select-day () nil |
472 | (calendar calendar) |
473 | (day unsigned-int)) |
474 | |
475 | (defbinding calendar-mark-day () int |
476 | (calendar calendar) |
477 | (day unsigned-int)) |
478 | |
479 | (defbinding calendar-unmark-day () int |
480 | (calendar calendar) |
481 | (day unsigned-int)) |
482 | |
483 | (defbinding calendar-clear-marks () nil |
484 | (calendar calendar)) |
485 | |
14eaa563 |
486 | (defbinding calendar-get-date () nil |
d404b3af |
487 | (calendar calendar) |
488 | (year unsigned-int :out) |
489 | (month unsigned-int :out) |
490 | (day unsigned-int :out)) |
491 | |
492 | (defbinding calendar-freeze () nil |
493 | (calendar calendar)) |
494 | |
495 | (defbinding calendar-thaw () nil |
496 | (calendar calendar)) |
497 | |
498 | |
d404b3af |
499 | ;;; Check menu item |
500 | |
501 | (defbinding check-menu-item-toggled () nil |
502 | (check-menu-item check-menu-item)) |
503 | |
504 | |
d404b3af |
505 | ;;; Color selection |
506 | |
507 | (defbinding (color-selection-is-adjusting-p |
508 | "gtk_color_selection_is_adjusting") () boolean |
509 | (colorsel color-selection)) |
510 | |
511 | |
512 | |
513 | ;;; Color selection dialog -- no functions |
514 | |
515 | |
516 | |
4886872c |
517 | ;;;; Combo Box |
d404b3af |
518 | |
14eaa563 |
519 | (defmethod initialize-instance ((combo-box combo-box) &rest initargs |
520 | &key model content active) |
521 | (remf initargs :active) |
522 | (if model |
523 | (apply #'call-next-method combo-box initargs) |
524 | (progn |
525 | (apply #'call-next-method combo-box |
526 | :model (make-instance 'list-store :column-types '(string)) |
527 | initargs) |
528 | (unless (typep combo-box 'combo-box-entry) |
529 | (let ((cell (make-instance 'cell-renderer-text))) |
530 | (cell-layout-pack combo-box cell :expand t) |
531 | (cell-layout-add-attribute combo-box cell :text 0))))) |
532 | (when content |
533 | (mapc #'(lambda (text) |
534 | (combo-box-append-text combo-box text)) |
535 | content)) |
536 | (when active |
537 | (setf (combo-box-active combo-box) active))) |
538 | |
4886872c |
539 | |
540 | ;; (defmethod shared-initialize :after ((combo-box combo-box) names &key active) |
541 | ;; (when active |
542 | ;; (signal-emit combo-box 'changed))) |
543 | |
544 | (defbinding combo-box-append-text () nil |
545 | (combo-box combo-box) |
546 | (text string)) |
547 | |
548 | (defbinding combo-box-insert-text () nil |
549 | (combo-box combo-box) |
550 | (position int) |
551 | (text string)) |
552 | |
553 | (defbinding combo-box-prepend-text () nil |
554 | (combo-box combo-box) |
555 | (text string)) |
556 | |
557 | #+gtk2.6 |
558 | (defbinding combo-box-get-active-text () string |
559 | (combo-box combo-box)) |
d404b3af |
560 | |
4886872c |
561 | (defbinding combo-box-popup () nil |
562 | (combo-box combo-box)) |
d404b3af |
563 | |
4886872c |
564 | (defbinding combo-box-popdown () nil |
565 | (combo-box combo-box)) |
566 | |
567 | |
568 | |
569 | ;;;; Combo Box Entry |
570 | |
14eaa563 |
571 | (defmethod initialize-instance ((combo-box-entry combo-box-entry) &key model) |
4886872c |
572 | (call-next-method) |
573 | (unless model |
574 | (setf (combo-box-entry-text-column combo-box-entry) 0))) |
d404b3af |
575 | |
576 | |
0ebef6c1 |
577 | ;;;; Dialog |
d404b3af |
578 | |
362f1795 |
579 | (defmethod shared-initialize ((dialog dialog) names &rest initargs |
580 | &key button buttons) |
581 | (declare (ignore button buttons)) |
582 | (prog1 |
583 | (call-next-method) |
584 | (initial-apply-add dialog #'dialog-add-button initargs :button :buttons))) |
0ebef6c1 |
585 | |
d404b3af |
586 | |
d79b3413 |
587 | (defun dialog-response-id (dialog response &optional create-p error-p) |
588 | "Returns a numeric response id" |
589 | (if (typep response 'response-type) |
590 | (response-type-to-int response) |
591 | (let ((responses (object-data dialog 'responses))) |
592 | (cond |
593 | ((and responses (position response responses :test #'equal))) |
594 | (create-p |
eb4f580c |
595 | (cond |
d79b3413 |
596 | (responses |
597 | (vector-push-extend response responses) |
598 | (1- (length responses))) |
eb4f580c |
599 | (t |
600 | (setf |
d79b3413 |
601 | (object-data dialog 'responses) |
602 | (make-array 1 :adjustable t :fill-pointer t |
603 | :initial-element response)) |
eb4f580c |
604 | 0))) |
605 | (error-p |
d79b3413 |
606 | (error "Invalid response: ~A" response)))))) |
d404b3af |
607 | |
d79b3413 |
608 | (defun dialog-find-response (dialog id) |
609 | "Finds a symbolic response given a numeric id" |
610 | (if (< id 0) |
611 | (int-to-response-type id) |
612 | (aref (object-data dialog 'responses) id))) |
613 | |
614 | |
615 | (defmethod compute-signal-id ((dialog dialog) signal) |
616 | (if (dialog-response-id dialog signal) |
617 | (ensure-signal-id 'response dialog) |
618 | (call-next-method))) |
619 | |
620 | (defmethod compute-signal-function ((dialog dialog) signal function object) |
621 | (declare (ignore function object)) |
622 | (let ((callback (call-next-method)) |
623 | (id (dialog-response-id dialog signal))) |
624 | (if id |
625 | #'(lambda (dialog response) |
626 | (when (= response id) |
627 | (funcall callback dialog))) |
628 | callback))) |
d404b3af |
629 | |
0ebef6c1 |
630 | (defbinding dialog-run () nil |
631 | (dialog dialog)) |
d404b3af |
632 | |
d79b3413 |
633 | (defbinding dialog-response (dialog response) nil |
d404b3af |
634 | (dialog dialog) |
d79b3413 |
635 | ((dialog-response-id dialog response nil t) int)) |
d404b3af |
636 | |
637 | |
638 | (defbinding %dialog-add-button () button |
639 | (dialog dialog) |
640 | (text string) |
d79b3413 |
641 | (response-id int)) |
d404b3af |
642 | |
eb4f580c |
643 | (defun dialog-add-button (dialog label &optional (response label) |
644 | &key default object after) |
fe67c0ec |
645 | "Adds a button to the dialog." |
d79b3413 |
646 | (let* ((signal (if (functionp response) |
647 | label |
648 | response)) |
649 | (id (dialog-response-id dialog signal t)) |
650 | (button (%dialog-add-button dialog label id))) |
eb4f580c |
651 | (when (functionp response) |
d79b3413 |
652 | (signal-connect dialog signal response :object object :after after)) |
eb4f580c |
653 | (when default |
d79b3413 |
654 | (%dialog-set-default-response dialog id)) |
d404b3af |
655 | button)) |
656 | |
657 | |
d79b3413 |
658 | (defbinding %dialog-add-action-widget () nil |
d404b3af |
659 | (dialog dialog) |
660 | (action-widget widget) |
d79b3413 |
661 | (response-id int)) |
d404b3af |
662 | |
eb4f580c |
663 | (defun dialog-add-action-widget (dialog widget &optional (response widget) |
664 | &key default object after) |
d79b3413 |
665 | (let* ((signal (if (functionp response) |
666 | widget |
667 | response)) |
668 | (id (dialog-response-id dialog signal t))) |
669 | (unless (widget-hidden-p widget) |
670 | (widget-show widget)) |
671 | (%dialog-add-action-widget dialog widget id) |
eb4f580c |
672 | (when (functionp response) |
d79b3413 |
673 | (signal-connect dialog signal response :object object :after after)) |
eb4f580c |
674 | (when default |
d79b3413 |
675 | (%dialog-set-default-response dialog id)) |
d404b3af |
676 | widget)) |
d404b3af |
677 | |
d404b3af |
678 | |
0ebef6c1 |
679 | (defbinding %dialog-set-default-response () nil |
680 | (dialog dialog) |
d79b3413 |
681 | (response-id int)) |
d404b3af |
682 | |
d79b3413 |
683 | (defun dialog-set-default-response (dialog response) |
0ebef6c1 |
684 | (%dialog-set-default-response |
d79b3413 |
685 | dialog (dialog-response-id dialog response nil t))) |
d404b3af |
686 | |
d79b3413 |
687 | (defbinding dialog-set-response-sensitive (dialog response sensitive) nil |
0ebef6c1 |
688 | (dialog dialog) |
d79b3413 |
689 | ((dialog-response-id dialog response nil t) int) |
0ebef6c1 |
690 | (sensitive boolean)) |
d404b3af |
691 | |
fe67c0ec |
692 | #+gtk2.6 |
1448a84f |
693 | (defbinding alternative-dialog-button-order-p (&optional screen) boolean |
694 | (screen (or null gdk:screen))) |
fe67c0ec |
695 | |
696 | #+gtk2.6 |
697 | (defbinding (dialog-set-alternative-button-order |
698 | "gtk_dialog_set_alternative_button_order_from_array") |
699 | (dialog new-order) |
700 | (dialog dialog) |
701 | ((length new-order) int) |
d79b3413 |
702 | ((map 'vector #'(lambda (response) |
703 | (dialog-response-id dialog response nil t)) |
fe67c0ec |
704 | new-order) (vector int))) |
d404b3af |
705 | |
0ebef6c1 |
706 | |
92ba85d4 |
707 | #+gtk2.8 |
708 | (progn |
709 | (defbinding %dialog-get-response-for-widget () int |
710 | (dialog dialog) |
711 | (widget widget)) |
712 | |
713 | (defun dialog-get-response-for-widget (dialog widget) |
714 | (dialog-find-response dialog (dialog-get-response-for-widget dialog widget)))) |
715 | |
716 | |
0ebef6c1 |
717 | (defmethod container-add ((dialog dialog) (child widget) &rest args) |
eb4f580c |
718 | (apply #'container-add (dialog-vbox dialog) child args)) |
0ebef6c1 |
719 | |
d79b3413 |
720 | |
0ebef6c1 |
721 | (defmethod container-remove ((dialog dialog) (child widget)) |
eb4f580c |
722 | (container-remove (dialog-vbox dialog) child)) |
d404b3af |
723 | |
0ebef6c1 |
724 | (defmethod container-children ((dialog dialog)) |
eb4f580c |
725 | (container-children (dialog-vbox dialog))) |
0ebef6c1 |
726 | |
727 | (defmethod (setf container-children) (children (dialog dialog)) |
eb4f580c |
728 | (setf (container-children (dialog-vbox dialog)) children)) |
0d07716f |
729 | |
0d07716f |
730 | |
c2c4a7e9 |
731 | ;;; Entry |
0d07716f |
732 | |
c2c4a7e9 |
733 | (defbinding entry-get-layout-offsets () nil |
734 | (entry entry) |
735 | (x int :out) |
736 | (y int :out)) |
0d07716f |
737 | |
14eaa563 |
738 | (defbinding entry-layout-index-to-text-index () int |
739 | (entry entry) |
740 | (layout-index int)) |
741 | |
742 | (defbinding entry-text-index-to-layout-index () int |
743 | (entry entry) |
744 | (text-index int)) |
745 | |
0d07716f |
746 | |
a03a718a |
747 | ;;; Entry Completion |
748 | |
a92553bd |
749 | (define-callback-marshal %entry-completion-match-callback boolean |
750 | (entry-completion string tree-iter)) |
a03a718a |
751 | |
752 | (defbinding entry-completion-set-match-func (completion function) nil |
753 | (completion entry-completion) |
a92553bd |
754 | (%entry-completion-match-callback callback) |
a03a718a |
755 | ((register-callback-function function) unsigned-int) |
a92553bd |
756 | (user-data-destroy-callback callback)) |
a03a718a |
757 | |
758 | (defbinding entry-completion-complete () nil |
759 | (completion entry-completion)) |
760 | |
761 | #+gtk2.6 |
762 | (defbinding entry-completion-insert-prefix () nil |
763 | (completion entry-completion)) |
764 | |
765 | (defbinding entry-completion-insert-action-text () nil |
766 | (completion entry-completion) |
767 | (index int) |
768 | (text string)) |
769 | |
770 | (defbinding entry-completion-insert-action-markup () nil |
771 | (completion entry-completion) |
772 | (index int) |
773 | (markup string)) |
774 | |
775 | (defbinding entry-completion-delete-action () nil |
776 | (completion entry-completion) |
777 | (index int)) |
778 | |
779 | |
49043b9a |
780 | ;;; File Chooser |
781 | |
782 | (defmethod initialize-instance ((file-chooser file-chooser) &rest initargs |
783 | &key filter filters shortcut-folder |
784 | shortcut-folders shortcut-folder-uti |
785 | shortcut-folder-uris) |
786 | (declare (ignore filter filters shortcut-folder shortcut-folders |
787 | shortcut-folder-uti shortcut-folder-uris)) |
788 | (prog1 |
789 | (call-next-method) |
790 | (initial-add file-chooser #'file-chooser-add-filter |
791 | initargs :filer :filters) |
792 | (initial-add file-chooser #'file-chooser-add-shortcut-folder |
793 | initargs :shortcut-folder :shortcut-folders) |
794 | (initial-add file-chooser #'file-chooser-add-shortcut-folder-uri |
795 | initargs :shortcut-folder-uri :shortcut-folders-uris))) |
796 | |
797 | |
798 | (defbinding file-chooser-select-filename () boolean |
799 | (file-chooser file-chooser) |
800 | (filename string)) |
801 | |
802 | (defbinding file-chooser-unselect-filename () nil |
803 | (file-chooser file-chooser) |
804 | (filename string)) |
805 | |
806 | (defbinding file-chooser-select-all () boolean |
807 | (file-chooser file-chooser)) |
808 | |
809 | (defbinding file-chooser-unselect-all () boolean |
810 | (file-chooser file-chooser)) |
811 | |
812 | (defbinding file-chooser-get-filenames () (gslist string) |
813 | (file-chooser file-chooser)) |
814 | |
815 | (defbinding file-chooser-select-uri () boolean |
816 | (file-chooser file-chooser) |
817 | (uri string)) |
818 | |
819 | (defbinding file-chooser-unselect-uri () nil |
820 | (file-chooser file-chooser) |
821 | (uri string)) |
822 | |
823 | (defbinding file-chooser-get-uris () (gslist string) |
824 | (file-chooser file-chooser)) |
825 | |
826 | (defbinding file-chooser-add-filter () nil |
827 | (file-chooser file-chooser) |
828 | (filter file-filter)) |
829 | |
830 | (defbinding file-chooser-remove-filter () nil |
831 | (file-chooser file-chooser) |
832 | (filter file-filter)) |
833 | |
834 | (defbinding file-chooser-list-filters () (gslist file-filter) |
835 | (file-chooser file-chooser)) |
836 | |
837 | (defbinding file-chooser-add-shortcut-folder () boolean |
838 | (file-chooser file-chooser) |
839 | (folder string) |
840 | (nil null)) |
841 | |
842 | (defbinding file-chooser-remove-shortcut-folder () nil |
843 | (file-chooser file-chooser) |
844 | (folder string) |
845 | (nil null)) |
846 | |
847 | (defbinding file-chooser-list-shortcut-folders () (gslist string) |
848 | (file-chooser file-chooser)) |
849 | |
850 | (defbinding file-chooser-add-shortcut-folder-uri () boolean |
851 | (file-chooser file-chooser) |
852 | (uri string) |
853 | (nil null)) |
854 | |
855 | (defbinding file-chooser-remove-shortcut-folder-uri () nil |
856 | (file-chooser file-chooser) |
857 | (uri string) |
858 | (nil null)) |
859 | |
860 | (defbinding file-chooser-list-shortcut-folder-uris () (gslist string) |
861 | (file-chooser file-chooser)) |
862 | |
863 | |
864 | ;;; File Filter |
865 | |
866 | (defmethod initialize-instance ((file-filter file-filter) &rest initargs |
867 | &key mime-type mime-types pattern patterns |
868 | pixbuf-formats) |
869 | (declare (ignore mime-type mime-types pattern patterns)) |
870 | (prog1 |
871 | (call-next-method) |
872 | (when pixbuf-formats |
873 | #-gtk2.6(warn "Initarg :PIXBUF-FORMATS not supportet in this version of Gtk") |
874 | #+gtk2.6(file-filter-add-pixbuf-formats file-filter)) |
875 | (initial-add file-filter #'file-filter-add-mime-type |
876 | initargs :mime-type :mime-types) |
877 | (initial-add file-filter #'file-filter-add-pattern |
878 | initargs :pattern :patterns))) |
879 | |
880 | |
881 | (defbinding file-filter-add-mime-type () nil |
882 | (filter file-filter) |
883 | (mime-type string)) |
884 | |
885 | (defbinding file-filter-add-pattern () nil |
886 | (filter file-filter) |
887 | (pattern string)) |
888 | |
889 | #+gtk2.6 |
890 | (defbinding file-filter-add-pixbuf-formats () nil |
1448a84f |
891 | (filter file-filter)) |
49043b9a |
892 | |
a92553bd |
893 | (define-callback-marshal %file-filter-callback boolean (file-filter-info)) |
49043b9a |
894 | |
3d36c5d6 |
895 | (defbinding file-filter-add-custom (filter needed function) nil |
49043b9a |
896 | (filter file-filter) |
897 | (needed file-filter-flags) |
a92553bd |
898 | (%file-filter-callback callback) |
49043b9a |
899 | ((register-callback-function function) unsigned-int) |
a92553bd |
900 | (user-data-destroy-callback callback)) |
49043b9a |
901 | |
902 | (defbinding file-filter-get-needed () file-filter-flags |
903 | (filter file-filter)) |
904 | |
905 | (defbinding file-filter-filter () boolean |
906 | (filter file-filter) |
907 | (filter-info file-filter-info)) |
908 | |
909 | |
910 | |
eb4f580c |
911 | ;;; Image |
912 | |
913 | (defbinding image-set-from-file () nil |
914 | (image image) |
915 | (filename pathname)) |
916 | |
14eaa563 |
917 | (defmethod (setf image-pixmap) ((data vector) (image image)) |
918 | (multiple-value-bind (pixmap mask) (gdk:pixmap-create data) |
919 | (setf (image-pixmap image) pixmap) |
920 | (setf (image-mask image) mask))) |
921 | |
922 | (defmethod initialize-instance ((image image) &rest initargs &key pixmap file) |
923 | (cond |
924 | ((typep pixmap 'vector) |
925 | (multiple-value-bind (pixmap mask) (gdk:pixmap-create pixmap) |
926 | (apply #'call-next-method image :pixmap pixmap :mask mask initargs))) |
927 | (file |
928 | (prog1 |
929 | (call-next-method) |
930 | (image-set-from-file image file))) |
931 | ((call-next-method)))) |
eb4f580c |
932 | |
9617dc95 |
933 | (defun create-image-widget (source &optional mask) |
14eaa563 |
934 | (etypecase source |
935 | (gdk:pixbuf (make-instance 'image :pixbuf source)) |
936 | (string (make-instance 'image :stock source)) |
937 | (pathname (make-instance 'image :file source)) |
938 | ((or list vector) (make-instance 'image :pixmap source)) |
939 | (gdk:pixmap (make-instance 'image :pixmap source :mask mask)))) |
eb4f580c |
940 | |
92ba85d4 |
941 | #+gtk2.8 |
942 | (defbinding image-clear () nil |
943 | (image image)) |
944 | |
945 | |
eb4f580c |
946 | |
14eaa563 |
947 | ;;; Image menu item |
eb4f580c |
948 | |
14eaa563 |
949 | (defmethod initialize-instance ((item image-menu-item) &rest initargs &key image) |
950 | (if (and image (not (typep image 'widget))) |
9617dc95 |
951 | (apply #'call-next-method item :image (create-image-widget image) initargs) |
14eaa563 |
952 | (call-next-method))) |
eb4f580c |
953 | |
14eaa563 |
954 | |
955 | (defmethod (setf image-menu-item-image) ((widget widget) (item image-menu-item)) |
956 | (setf (slot-value item 'image) widget)) |
957 | |
958 | (defmethod (setf image-menu-item-image) (image (item image-menu-item)) |
9617dc95 |
959 | (setf (image-menu-item-image item) (create-image-widget image))) |
eb4f580c |
960 | |
0d07716f |
961 | |
d404b3af |
962 | ;;; Label |
0d07716f |
963 | |
29aa1cc3 |
964 | (defmethod shared-initialize ((label label) names &key pattern) |
965 | (declare (ignore names)) |
966 | (call-next-method) |
967 | (when pattern |
968 | (setf (label-pattern label) pattern))) |
969 | |
c2c4a7e9 |
970 | (defbinding label-get-layout-offsets () nil |
eb4f580c |
971 | (label label) |
c2c4a7e9 |
972 | (x int :out) |
973 | (y int :out)) |
974 | |
d404b3af |
975 | (defbinding label-select-region () nil |
976 | (label label) |
977 | (start int) |
978 | (end int)) |
0d07716f |
979 | |
eb4f580c |
980 | (defbinding label-get-selection-bounds () boolean |
c2c4a7e9 |
981 | (label label) |
982 | (start int :out) |
983 | (end int :out)) |
30481825 |
984 | |
0d07716f |
985 | |
986 | |
987 | ;;; Radio button |
988 | |
dd392521 |
989 | (defbinding %radio-button-get-group () pointer |
2afcd8bd |
990 | (radio-button radio-button)) |
991 | |
a60bd055 |
992 | (defbinding %radio-button-set-group () nil |
2afcd8bd |
993 | (radio-button radio-button) |
994 | (group pointer)) |
0d07716f |
995 | |
9617dc95 |
996 | (defmethod add-to-radio-group ((button1 radio-button) (button2 radio-button)) |
2afcd8bd |
997 | "Add BUTTON1 to the group which BUTTON2 belongs to." |
998 | (%radio-button-set-group button1 (%radio-button-get-group button2))) |
999 | |
30628c63 |
1000 | (defun %add-activate-callback (widget signal function object after) |
1001 | (if object |
1002 | (signal-connect widget signal |
1003 | #'(lambda (object) |
1004 | (when (slot-value widget 'active) |
1005 | (funcall function object (slot-value widget 'value)))) |
1006 | :object object :after after) |
1007 | (signal-connect widget signal |
1008 | #'(lambda () |
1009 | (when (slot-value widget 'active) |
1010 | (funcall function (slot-value widget 'value)))) |
1011 | :after after))) |
1012 | |
1013 | (defmethod activate-radio-widget ((button radio-button)) |
1014 | (signal-emit button 'clicked)) |
1015 | |
1016 | (defmethod add-activate-callback ((button radio-button) function &key object after) |
1017 | (%add-activate-callback button 'clicked function object after)) |
1018 | |
14eaa563 |
1019 | (defmethod initialize-instance ((button radio-button) &key group) |
1020 | (prog1 |
1021 | (call-next-method) |
1022 | (when group |
9617dc95 |
1023 | (add-to-radio-group button group)))) |
0d07716f |
1024 | |
1025 | |
0d07716f |
1026 | ;;; Item |
1027 | |
a60bd055 |
1028 | (defbinding item-select () nil |
0d07716f |
1029 | (item item)) |
1030 | |
a60bd055 |
1031 | (defbinding item-deselect () nil |
0d07716f |
1032 | (item item)) |
1033 | |
a60bd055 |
1034 | (defbinding item-toggle () nil |
0d07716f |
1035 | (item item)) |
1036 | |
1037 | |
1038 | |
1039 | ;;; Menu item |
1040 | |
14eaa563 |
1041 | (defmethod initialize-instance ((item menu-item) &key label) |
1042 | (prog1 |
1043 | (call-next-method) |
1044 | (when label |
1045 | (setf (menu-item-label item) label)))) |
1046 | |
1047 | |
30481825 |
1048 | (defun (setf menu-item-label) (label menu-item) |
1049 | (make-instance 'accel-label |
1050 | :label label :xalign 0.0 :yalign 0.5 :accel-widget menu-item |
14eaa563 |
1051 | :use-underline (menu-item-use-underline-p menu-item) |
1052 | :visible t :parent menu-item) |
30481825 |
1053 | label) |
0d07716f |
1054 | |
378b3c5f |
1055 | (defun menu-item-label (menu-item) |
14eaa563 |
1056 | (when (and (slot-boundp menu-item 'child) |
1057 | (typep (bin-child menu-item) 'label)) |
1058 | (label-label (bin-child menu-item)))) |
378b3c5f |
1059 | |
14eaa563 |
1060 | (defbinding menu-item-remove-submenu () nil |
30481825 |
1061 | (menu-item menu-item)) |
0d07716f |
1062 | |
378b3c5f |
1063 | (defbinding menu-item-set-accel-path () nil |
1064 | (menu-item menu-item) |
1065 | (accel-path string)) |
1066 | |
a60bd055 |
1067 | (defbinding menu-item-select () nil |
30481825 |
1068 | (menu-item menu-item)) |
0d07716f |
1069 | |
a60bd055 |
1070 | (defbinding menu-item-deselect () nil |
30481825 |
1071 | (menu-item menu-item)) |
0d07716f |
1072 | |
a60bd055 |
1073 | (defbinding menu-item-activate () nil |
30481825 |
1074 | (menu-item menu-item)) |
0d07716f |
1075 | |
378b3c5f |
1076 | (defbinding menu-item-toggle-size-request () nil |
1077 | (menu-item menu-item) |
1078 | (requisition int :out)) |
1079 | |
1080 | (defbinding menu-item-toggle-size-allocate () nil |
1081 | (menu-item menu-item) |
1082 | (allocation int)) |
1083 | |
0d07716f |
1084 | |
14eaa563 |
1085 | ;;; Menu tool button |
1086 | |
1087 | #+gtk2.6 |
1448a84f |
1088 | (defbinding menu-tool-button-set-arrow-tooltip () nil |
14eaa563 |
1089 | (menu-tool-button menu-tool-button) |
1090 | (tooltips tooltips) |
1091 | (tip-text string) |
1092 | (tip-private string)) |
1093 | |
1094 | |
30e8a60a |
1095 | ;;; Message dialog |
1096 | |
39db92d4 |
1097 | (defmethod allocate-foreign ((dialog message-dialog) &key (message-type :info) |
1098 | (buttons :close) flags transient-parent) |
1099 | (%message-dialog-new transient-parent flags message-type buttons)) |
1100 | |
1101 | |
1102 | (defmethod shared-initialize ((dialog message-dialog) names |
1103 | &key text #+gtk 2.6 secondary-text) |
1104 | (declare (ignore names)) |
4c308d58 |
1105 | (when text |
1106 | (message-dialog-set-markup dialog text)) |
1107 | #+gtk2.6 |
1108 | (when secondary-text |
1109 | (message-dialog-format-secondary-markup dialog secondary-text)) |
1110 | (call-next-method)) |
30e8a60a |
1111 | |
1112 | |
1113 | (defbinding %message-dialog-new () pointer |
1114 | (parent (or null window)) |
1115 | (flags dialog-flags) |
1116 | (type message-type) |
1117 | (buttons buttons-type) |
4c308d58 |
1118 | (nil null)) |
30e8a60a |
1119 | |
1120 | (defbinding message-dialog-set-markup () nil |
1121 | (message-dialog message-dialog) |
1122 | (markup string)) |
1123 | |
1124 | #+gtk2.6 |
1125 | (defbinding message-dialog-format-secondary-text () nil |
1126 | (message-dialog message-dialog) |
1127 | (text string)) |
1128 | |
1129 | #+gtk2.6 |
1130 | (defbinding message-dialog-format-secondary-markup () nil |
1131 | (message-dialog message-dialog) |
1132 | (markup string)) |
1133 | |
1134 | |
0d07716f |
1135 | |
30481825 |
1136 | ;;; Radio menu item |
0d07716f |
1137 | |
dd392521 |
1138 | (defbinding %radio-menu-item-get-group () pointer |
2afcd8bd |
1139 | (radio-menu-item radio-menu-item)) |
1140 | |
a60bd055 |
1141 | (defbinding %radio-menu-item-set-group () nil |
2afcd8bd |
1142 | (radio-menu-item radio-menu-item) |
1143 | (group pointer)) |
1144 | |
30628c63 |
1145 | (defmethod activate-radio-widget ((item radio-menu-item)) |
1146 | (menu-item-activate item)) |
1147 | |
9617dc95 |
1148 | (defmethod add-to-radio-group ((item1 radio-menu-item) (item2 radio-menu-item)) |
2afcd8bd |
1149 | "Add ITEM1 to the group which ITEM2 belongs to." |
1150 | (%radio-menu-item-set-group item1 (%radio-menu-item-get-group item2))) |
1151 | |
30628c63 |
1152 | (defmethod add-activate-callback ((item radio-menu-item) function &key object after) |
1153 | (%add-activate-callback item 'activate function object after)) |
1154 | |
14eaa563 |
1155 | (defmethod initialize-instance ((item radio-menu-item) &key group) |
378b3c5f |
1156 | (prog1 |
1157 | (call-next-method) |
14eaa563 |
1158 | (when group |
9617dc95 |
1159 | (add-to-radio-group item group)))) |
1160 | |
2afcd8bd |
1161 | |
0d07716f |
1162 | |
14eaa563 |
1163 | ;;; Radio tool button |
1164 | |
1165 | (defbinding %radio-tool-button-get-group () pointer |
1166 | (radio-tool-button radio-tool-button)) |
1167 | |
1168 | (defbinding %radio-tool-button-set-group () nil |
1169 | (radio-tool-button radio-tool-button) |
1170 | (group pointer)) |
1171 | |
30628c63 |
1172 | (defmethod activate-radio-widget ((button radio-tool-button)) |
1173 | (signal-emit button 'clicked)) |
1174 | |
9617dc95 |
1175 | (defmethod add-to-radio-group ((button1 radio-tool-button) (button2 radio-tool-button)) |
14eaa563 |
1176 | "Add BUTTON1 to the group which BUTTON2 belongs to." |
1177 | (%radio-tool-button-set-group button1 (%radio-tool-button-get-group button2))) |
30628c63 |
1178 | (defmethod add-activate-callback ((button radio-tool-button) function &key object after) |
1179 | (%add-activate-callback button 'clicked function object after)) |
14eaa563 |
1180 | |
1181 | (defmethod initialize-instance ((button radio-tool-button) &key group) |
1182 | (prog1 |
1183 | (call-next-method) |
1184 | (when group |
9617dc95 |
1185 | (add-to-radio-group button group)))) |
1186 | |
14eaa563 |
1187 | |
0d07716f |
1188 | |
c2c4a7e9 |
1189 | ;;; Toggle button |
1190 | |
1191 | (defbinding toggle-button-toggled () nil |
1192 | (toggle-button toggle-button)) |
1193 | |
1194 | |
0d07716f |
1195 | ;;; Window |
1196 | |
362f1795 |
1197 | (defmethod initialize-instance ((window window) &rest initargs |
1198 | &key accel-group accel-groups) |
1199 | (declare (ignore accel-group accel-groups)) |
1200 | (prog1 |
1201 | (call-next-method) |
1202 | (initial-add window #'window-add-accel-group |
1203 | initargs :accel-group :accel-groups))) |
99821988 |
1204 | |
1205 | |
304cfb76 |
1206 | (defbinding window-set-wmclass () nil |
0d07716f |
1207 | (window window) |
1208 | (wmclass-name string) |
1209 | (wmclass-class string)) |
1210 | |
a60bd055 |
1211 | (defbinding window-add-accel-group () nil |
0d07716f |
1212 | (window window) |
1213 | (accel-group accel-group)) |
1214 | |
a60bd055 |
1215 | (defbinding window-remove-accel-group () nil |
0d07716f |
1216 | (window window) |
1217 | (accel-group accel-group)) |
1218 | |
a60bd055 |
1219 | (defbinding window-activate-focus () int |
0d07716f |
1220 | (window window)) |
1221 | |
a60bd055 |
1222 | (defbinding window-activate-default () int |
0d07716f |
1223 | (window window)) |
1224 | |
304cfb76 |
1225 | (defbinding window-set-default-size (window width height) int |
0d07716f |
1226 | (window window) |
304cfb76 |
1227 | ((or width -1) int) |
1228 | ((or height -1) int)) |
0d07716f |
1229 | |
4eed43f1 |
1230 | (defbinding %window-set-geometry-hints () nil |
1231 | (window window) |
1232 | (geometry gdk:geometry) |
1233 | (geometry-mask gdk:window-hints)) |
1234 | |
1235 | (defun window-set-geometry-hints (window &key min-width min-height |
1236 | max-width max-height base-width base-height |
1237 | width-inc height-inc min-aspect max-aspect |
1238 | (gravity nil gravity-p) min-size max-size) |
1239 | (let ((geometry (make-instance 'gdk:geometry |
1240 | :min-width (or min-width -1) |
1241 | :min-height (or min-height -1) |
1242 | :max-width (or max-width -1) |
1243 | :max-height (or max-height -1) |
1244 | :base-width (or base-width 0) |
1245 | :base-height (or base-height 0) |
1246 | :width-inc (or width-inc 0) |
1247 | :height-inc (or height-inc 0) |
1248 | :min-aspect (or min-aspect 0) |
1249 | :max-aspect (or max-aspect 0) |
1250 | :gravity gravity)) |
1251 | (mask ())) |
1252 | (when (or min-size min-width min-height) |
1253 | (push :min-size mask)) |
1254 | (when (or max-size max-width max-height) |
1255 | (push :max-size mask)) |
1256 | (when (or base-width base-height) |
1257 | (push :base-size mask)) |
1258 | (when (or width-inc height-inc) |
1259 | (push :resize-inc mask)) |
1260 | (when (or min-aspect max-aspect) |
1261 | (push :aspect mask)) |
1262 | (when gravity-p |
1263 | (push :win-gravity mask)) |
1264 | (%window-set-geometry-hints window geometry mask))) |
0d07716f |
1265 | |
99821988 |
1266 | (defbinding window-list-toplevels () (glist (copy-of window)) |
1267 | "Returns a list of all existing toplevel windows.") |
304cfb76 |
1268 | |
1269 | (defbinding window-add-mnemonic (window key target) nil |
1270 | (window window) |
1271 | ((gdk:keyval-from-name key) unsigned-int) |
1272 | (target widget)) |
1273 | |
1274 | (defbinding window-remove-mnemonic (window key target) nil |
1275 | (window window) |
1276 | ((gdk:keyval-from-name key) unsigned-int) |
1277 | (target widget)) |
1278 | |
1279 | (defbinding window-mnemonic-activate (window key modifier) nil |
1280 | (window window) |
1281 | ((gdk:keyval-from-name key) unsigned-int) |
1282 | (modifier gdk:modifier-type)) |
1283 | |
4eed43f1 |
1284 | (defbinding window-activate-key () boolean |
1285 | (window window) |
1286 | (event gdk:key-event)) |
1287 | |
1288 | (defbinding window-propagate-key-event () boolean |
1289 | (window window) |
1290 | (event gdk:key-event)) |
1291 | |
92ba85d4 |
1292 | #-gtk2.8 |
304cfb76 |
1293 | (defbinding window-present () nil |
1294 | (window window)) |
1295 | |
92ba85d4 |
1296 | #+gtk2.8 |
1297 | (progn |
1298 | (defbinding %window-present () nil |
1299 | (window window)) |
1300 | |
12cae344 |
1301 | (defbinding %window-present-with-time () nil |
92ba85d4 |
1302 | (window window) |
1303 | (timespamp unsigned-int)) |
1304 | |
1305 | (defun window-present (window &optional timestamp) |
1306 | (if timestamp |
12cae344 |
1307 | (%window-present-with-time window timestamp) |
92ba85d4 |
1308 | (%window-present window)))) |
1309 | |
304cfb76 |
1310 | (defbinding window-iconify () nil |
1311 | (window window)) |
1312 | |
1313 | (defbinding window-deiconify () nil |
1314 | (window window)) |
1315 | |
1316 | (defbinding window-stick () nil |
1317 | (window window)) |
1318 | |
1319 | (defbinding window-unstick () nil |
1320 | (window window)) |
1321 | |
1322 | (defbinding window-maximize () nil |
1323 | (window window)) |
1324 | |
1325 | (defbinding window-unmaximize () nil |
1326 | (window window)) |
1327 | |
4eed43f1 |
1328 | (defbinding window-fullscreen () nil |
1329 | (window window)) |
1330 | |
1331 | (defbinding window-unfullscreen () nil |
1332 | (window window)) |
1333 | |
1334 | (defbinding window-set-keep-above () nil |
1335 | (window window) |
1336 | (setting boolean)) |
1337 | |
1338 | (defbinding window-set-keep-below () nil |
1339 | (window window) |
1340 | (setting boolean)) |
1341 | |
304cfb76 |
1342 | (defbinding window-begin-resize-drag () nil |
1343 | (window window) |
1344 | (edge gdk:window-edge) |
1345 | (button int) |
1346 | (root-x int) (root-y int) |
6baf860c |
1347 | (timestamp unsigned-int)) |
304cfb76 |
1348 | |
1349 | (defbinding window-begin-move-drag () nil |
1350 | (window window) |
1351 | (edge gdk:window-edge) |
1352 | (button int) |
1353 | (root-x int) (root-y int) |
6baf860c |
1354 | (timestamp unsigned-int)) |
304cfb76 |
1355 | |
1356 | (defbinding window-set-frame-dimensions () nil |
1357 | (window window) |
1358 | (left int) (top int) (rigth int) (bottom int)) |
1359 | |
304cfb76 |
1360 | (defbinding %window-get-default-size () nil |
1361 | (window window) |
1362 | (width int :out) |
1363 | (height int :out)) |
1364 | |
1365 | (defun window-get-default-size (window) |
1366 | (multiple-value-bind (width height) (%window-get-default-size window) |
1367 | (values (unless (= width -1) width) (unless (= height -1) height)))) |
1368 | |
1369 | (defbinding window-get-frame-dimensions () nil |
1370 | (window window) |
1371 | (left int :out) (top int :out) (rigth int :out) (bottom int :out)) |
1372 | |
ad98b596 |
1373 | (defbinding %window-get-icon-list () (glist (copy-of gdk:pixbuf)) |
304cfb76 |
1374 | (window window)) |
1375 | |
304cfb76 |
1376 | (defbinding window-get-position () nil |
1377 | (window window) |
1378 | (root-x int :out) |
1379 | (root-y int :out)) |
1380 | |
1381 | (defbinding window-get-size () nil |
1382 | (window window) |
1383 | (width int :out) |
1384 | (height int :out)) |
1385 | |
1386 | (defbinding window-move () nil |
1387 | (window window) |
1388 | (x int) |
1389 | (y int)) |
1390 | |
1391 | (defbinding window-parse-geometry () boolean |
1392 | (window window) |
1393 | (geometry string)) |
1394 | |
1395 | (defbinding window-reshow-with-initial-size () nil |
1396 | (window window)) |
1397 | |
1398 | (defbinding window-resize () nil |
1399 | (window window) |
1400 | (width int) |
1401 | (heigth int)) |
1402 | |
4eed43f1 |
1403 | (defbinding (window-default-icon-list "gtk_window_get_default_icon_list") |
1404 | () (glist gdk:pixbuf)) |
1405 | |
1406 | (defun window-default-icon () |
1407 | (first (window-default-icon-list))) |
1408 | |
1409 | (defbinding %window-set-default-icon-list () nil |
1410 | (icons (glist gdk:pixbuf))) |
1411 | |
1412 | (defun (setf window-default-icon-list) (icons) |
1413 | (%window-set-default-icon-list icons) |
1414 | icons) |
1415 | |
1416 | (defbinding %window-set-default-icon () nil |
1417 | (icons (glist gdk:pixbuf))) |
1418 | |
1419 | (defmethod (setf window-default-icon) ((icon gdk:pixbuf)) |
1420 | (%window-set-default-icon icon) |
1421 | icon) |
1422 | |
1423 | (defmethod (setf window-group) ((group window-group) (window window)) |
1424 | (window-group-add-window group window) |
1425 | group) |
1426 | |
1427 | (defbinding %window-set-default-icon-from-file () boolean |
1428 | (filename pathname) |
1429 | (nil null)) |
1430 | |
1431 | (defmethod (setf window-default-icon) ((icon-file pathname)) |
1432 | (%window-set-default-icon-from-file icon-file) |
1433 | icon-file) |
1434 | |
1435 | (defbinding %window-set-icon-from-file () boolean |
1436 | (window window) |
1437 | (filename pathname) |
1438 | (nil null)) |
1439 | |
1440 | (defmethod (setf window-icon) ((icon-file pathname) (window window)) |
1441 | (%window-set-icon-from-file window icon-file) |
1442 | icon-file) |
1443 | |
1444 | (defbinding window-set-auto-startup-notification () nil |
1445 | (setting boolean)) |
1446 | |
1447 | (defbinding decorated-window-init () nil |
1448 | (window window)) |
1449 | |
1450 | (defbinding decorated-window-calculate-frame-size () nil |
1451 | (window window)) |
1452 | |
1453 | (defbinding decorated-window-set-title () nil |
304cfb76 |
1454 | (window window) |
4eed43f1 |
1455 | (title string)) |
304cfb76 |
1456 | |
4eed43f1 |
1457 | (defbinding decorated-window-move-resize-window () nil |
1458 | (window window) |
1459 | (x int) |
1460 | (y int) |
1461 | (width int) |
1462 | (heigth int)) |
304cfb76 |
1463 | |
1464 | |
4eed43f1 |
1465 | ;;; Window group |
0d07716f |
1466 | |
4eed43f1 |
1467 | (defmethod initialize-instance ((window-group window-group) &rest initargs |
1468 | &key window windows) |
1469 | (declare (ignore window windows)) |
1470 | (prog1 |
1471 | (call-next-method) |
1472 | (initial-add window-group #'window-group-add-window |
1473 | initargs :window :windows))) |
0d07716f |
1474 | |
0d07716f |
1475 | |
4eed43f1 |
1476 | (defbinding window-group-add-window () nil |
1477 | (window-group window-group) |
1478 | (window window)) |
0d07716f |
1479 | |
4eed43f1 |
1480 | (defbinding window-group-remove-window () nil |
1481 | (window-group window-group) |
1482 | (window window)) |
0d07716f |
1483 | |
1484 | |
30481825 |
1485 | ;;; Scrolled window |
0d07716f |
1486 | |
0d07716f |
1487 | (defun (setf scrolled-window-scrollbar-policy) (policy window) |
1488 | (setf (scrolled-window-hscrollbar-policy window) policy) |
1489 | (setf (scrolled-window-vscrollbar-policy window) policy)) |
1490 | |
a60bd055 |
1491 | (defbinding scrolled-window-add-with-viewport () nil |
0d07716f |
1492 | (scrolled-window scrolled-window) |
1493 | (child widget)) |
1494 | |
4c308d58 |
1495 | (defmethod shared-initialize ((window scrolled-window) names &key policy) |
1496 | (declare (ignore names)) |
1497 | (when policy |
1498 | (setf (slot-value window 'hscrollbar-policy) policy) |
1499 | (setf (slot-value window 'vscrollbar-policy) policy)) |
1500 | (call-next-method)) |
2afcd8bd |
1501 | |
0d07716f |
1502 | |
30481825 |
1503 | ;;; Statusbar |
0d07716f |
1504 | |
14eaa563 |
1505 | (defbinding statusbar-get-context-id () unsigned-int |
30481825 |
1506 | (statusbar statusbar) |
1507 | (context-description string)) |
0d07716f |
1508 | |
a60bd055 |
1509 | (defbinding statusbar-push () unsigned-int |
30481825 |
1510 | (statusbar statusbar) |
1511 | (context-id unsigned-int) |
1512 | (text string)) |
0d07716f |
1513 | |
a60bd055 |
1514 | (defbinding statusbar-pop () nil |
30481825 |
1515 | (statusbar statusbar) |
1516 | (context-id unsigned-int)) |
0d07716f |
1517 | |
a60bd055 |
1518 | (defbinding statusbar-remove () nil |
30481825 |
1519 | (statusbar statusbar) |
1520 | (context-id unsigned-int) |
1521 | (message-id unsigned-int)) |
0d07716f |
1522 | |
0d07716f |
1523 | |
1524 | |
1525 | ;;; Fixed |
1526 | |
a60bd055 |
1527 | (defbinding fixed-put () nil |
30481825 |
1528 | (fixed fixed) |
1529 | (widget widget) |
378b3c5f |
1530 | (x int) (y int)) |
0d07716f |
1531 | |
a60bd055 |
1532 | (defbinding fixed-move () nil |
30481825 |
1533 | (fixed fixed) |
1534 | (widget widget) |
378b3c5f |
1535 | (x int) (y int)) |
0d07716f |
1536 | |
1537 | |
1538 | |
2afcd8bd |
1539 | ;;; Notebook |
0d07716f |
1540 | |
49043b9a |
1541 | (defun %ensure-notebook-position (notebook page) |
378b3c5f |
1542 | (etypecase page |
49043b9a |
1543 | (position page) |
378b3c5f |
1544 | (widget (notebook-page-num notebook page t)))) |
1545 | |
49043b9a |
1546 | (defun %ensure-notebook-child (notebook position) |
378b3c5f |
1547 | (typecase position |
1548 | (widget position) |
49043b9a |
1549 | (t (notebook-get-nth-page notebook position)))) |
378b3c5f |
1550 | |
1551 | (defbinding (notebook-insert "gtk_notebook_insert_page_menu") |
30481825 |
1552 | (notebook position child tab-label &optional menu-label) nil |
1553 | (notebook notebook) |
1554 | (child widget) |
1555 | ((if (stringp tab-label) |
378b3c5f |
1556 | (make-instance 'label :label tab-label) |
30481825 |
1557 | tab-label) widget) |
1558 | ((if (stringp menu-label) |
378b3c5f |
1559 | (make-instance 'label :label menu-label) |
30481825 |
1560 | menu-label) (or null widget)) |
49043b9a |
1561 | ((%ensure-notebook-position notebook position) position)) |
0d07716f |
1562 | |
378b3c5f |
1563 | (defun notebook-append (notebook child tab-label &optional menu-label) |
1564 | (notebook-insert notebook :last child tab-label menu-label)) |
0d07716f |
1565 | |
378b3c5f |
1566 | (defun notebook-prepend (notebook child tab-label &optional menu-label) |
1567 | (notebook-insert notebook :first child tab-label menu-label)) |
0d07716f |
1568 | |
378b3c5f |
1569 | (defbinding notebook-remove-page (notebook page) nil |
30481825 |
1570 | (notebook notebook) |
49043b9a |
1571 | ((%ensure-notebook-position notebook page) position)) |
0d07716f |
1572 | |
a60bd055 |
1573 | (defbinding %notebook-page-num () int |
30481825 |
1574 | (notebook notebook) |
1575 | (child widget)) |
1576 | |
378b3c5f |
1577 | (defun notebook-page-num (notebook child &optional error-p) |
30481825 |
1578 | (let ((page-num (%notebook-page-num notebook child))) |
1579 | (if (= page-num -1) |
378b3c5f |
1580 | (when error-p |
49043b9a |
1581 | (error "~A is not a page in ~A" child notebook)) |
30481825 |
1582 | page-num))) |
1583 | |
a60bd055 |
1584 | (defbinding notebook-next-page () nil |
30481825 |
1585 | (notebook notebook)) |
0d07716f |
1586 | |
a60bd055 |
1587 | (defbinding notebook-prev-page () nil |
30481825 |
1588 | (notebook notebook)) |
1589 | |
378b3c5f |
1590 | (defbinding notebook-reorder-child (notebook child position) nil |
1591 | (notebook notebook) |
1592 | (child widget) |
92ba85d4 |
1593 | ((%ensure-notebook-position notebook position) int)) |
378b3c5f |
1594 | |
a60bd055 |
1595 | (defbinding notebook-popup-enable () nil |
30481825 |
1596 | (notebook notebook)) |
1597 | |
a60bd055 |
1598 | (defbinding notebook-popup-disable () nil |
30481825 |
1599 | (notebook notebook)) |
1600 | |
49043b9a |
1601 | (defbinding notebook-get-nth-page () widget |
378b3c5f |
1602 | (notebook notebook) |
49043b9a |
1603 | (page position)) |
378b3c5f |
1604 | |
49043b9a |
1605 | (defun %notebook-current-page (notebook) |
1606 | (when (slot-boundp notebook 'current-page-num) |
1607 | (notebook-get-nth-page notebook (notebook-current-page-num notebook)))) |
378b3c5f |
1608 | |
1609 | (defun (setf notebook-current-page) (page notebook) |
49043b9a |
1610 | (setf (notebook-current-page notebook) (notebook-page-num notebook page))) |
378b3c5f |
1611 | |
eb4f580c |
1612 | (defbinding (notebook-tab-label "gtk_notebook_get_tab_label") |
1613 | (notebook page) widget |
1614 | (notebook notebook) |
49043b9a |
1615 | ((%ensure-notebook-child notebook page) widget)) |
378b3c5f |
1616 | |
eb4f580c |
1617 | (defbinding (notebook-tab-label-text "gtk_notebook_get_tab_label_text") |
84967144 |
1618 | (notebook page) (copy-of string) |
eb4f580c |
1619 | (notebook notebook) |
49043b9a |
1620 | ((%ensure-notebook-child notebook page) widget)) |
378b3c5f |
1621 | |
eb4f580c |
1622 | (defbinding %notebook-set-tab-label () nil |
1623 | (notebook notebook) |
1624 | (page widget) |
1625 | (tab-label widget)) |
1626 | |
1627 | (defun (setf notebook-tab-label) (tab-label notebook page) |
1628 | (let ((widget (if (stringp tab-label) |
1629 | (make-instance 'label :label tab-label) |
1630 | tab-label))) |
49043b9a |
1631 | (%notebook-set-tab-label notebook (%ensure-notebook-child notebook page) widget) |
eb4f580c |
1632 | widget)) |
378b3c5f |
1633 | |
378b3c5f |
1634 | |
eb4f580c |
1635 | (defbinding (notebook-menu-label "gtk_notebook_get_menu_label") |
1636 | (notebook page) widget |
1637 | (notebook notebook) |
49043b9a |
1638 | ((%ensure-notebook-child notebook page) widget)) |
378b3c5f |
1639 | |
eb4f580c |
1640 | (defbinding (notebook-menu-label-text "gtk_notebook_get_menu_label_text") |
84967144 |
1641 | (notebook page) (copy-of string) |
eb4f580c |
1642 | (notebook notebook) |
49043b9a |
1643 | ((%ensure-notebook-child notebook page) widget)) |
378b3c5f |
1644 | |
eb4f580c |
1645 | (defbinding %notebook-set-menu-label () nil |
1646 | (notebook notebook) |
1647 | (page widget) |
1648 | (menu-label widget)) |
1649 | |
1650 | (defun (setf notebook-menu-label) (menu-label notebook page) |
1651 | (let ((widget (if (stringp menu-label) |
1652 | (make-instance 'label :label menu-label) |
1653 | menu-label))) |
49043b9a |
1654 | (%notebook-set-menu-label notebook (%ensure-notebook-child notebook page) widget) |
eb4f580c |
1655 | widget)) |
378b3c5f |
1656 | |
1657 | |
1658 | (defbinding notebook-query-tab-label-packing (notebook page) nil |
30481825 |
1659 | (notebook notebook) |
92ba85d4 |
1660 | ((%ensure-notebook-child notebook page) widget) |
30481825 |
1661 | (expand boolean :out) |
1662 | (fill boolean :out) |
1663 | (pack-type pack-type :out)) |
1664 | |
378b3c5f |
1665 | (defbinding notebook-set-tab-label-packing |
1666 | (notebook page expand fill pack-type) nil |
30481825 |
1667 | (notebook notebook) |
92ba85d4 |
1668 | ((%ensure-notebook-child notebook page) widget) |
30481825 |
1669 | (expand boolean) |
1670 | (fill boolean) |
1671 | (pack-type pack-type)) |
1672 | |
0d07716f |
1673 | |
1674 | |
2afcd8bd |
1675 | ;;; Paned |
0d07716f |
1676 | |
a60bd055 |
1677 | (defbinding paned-pack1 () nil |
2afcd8bd |
1678 | (paned paned) |
1679 | (child widget) |
1680 | (resize boolean) |
1681 | (shrink boolean)) |
0d07716f |
1682 | |
a60bd055 |
1683 | (defbinding paned-pack2 () nil |
2afcd8bd |
1684 | (paned paned) |
1685 | (child widget) |
1686 | (resize boolean) |
1687 | (shrink boolean)) |
0d07716f |
1688 | |
0d07716f |
1689 | |
2afcd8bd |
1690 | ;;; Layout |
0d07716f |
1691 | |
a60bd055 |
1692 | (defbinding layout-put () nil |
2afcd8bd |
1693 | (layout layout) |
49043b9a |
1694 | (child widget) |
2afcd8bd |
1695 | (x int) |
1696 | (y int)) |
0d07716f |
1697 | |
a60bd055 |
1698 | (defbinding layout-move () nil |
2afcd8bd |
1699 | (layout layout) |
49043b9a |
1700 | (child widget) |
2afcd8bd |
1701 | (x int) |
1702 | (y int)) |
0d07716f |
1703 | |
49043b9a |
1704 | (defbinding layout-set-size () nil |
1705 | (layout layout) |
1706 | (width unsigned-int) |
1707 | (height unsigned-int)) |
1708 | |
1709 | (defbinding layout-get-size () nil |
1710 | (layout layout) |
1711 | (width unsigned-int :out) |
1712 | (height unsigned-int :out)) |
0d07716f |
1713 | |
1714 | |
0d07716f |
1715 | ;;; Menu shell |
1716 | |
378b3c5f |
1717 | (defbinding menu-shell-insert (menu-shell menu-item position) nil |
30481825 |
1718 | (menu-shell menu-shell) |
1719 | (menu-item menu-item) |
378b3c5f |
1720 | ((case position |
1721 | (:first 0) |
1722 | (:last -1) |
1723 | (t position)) int)) |
0d07716f |
1724 | |
30481825 |
1725 | (defun menu-shell-append (menu-shell menu-item) |
378b3c5f |
1726 | (menu-shell-insert menu-shell menu-item :last)) |
0d07716f |
1727 | |
30481825 |
1728 | (defun menu-shell-prepend (menu-shell menu-item) |
378b3c5f |
1729 | (menu-shell-insert menu-shell menu-item :fisrt)) |
0d07716f |
1730 | |
a60bd055 |
1731 | (defbinding menu-shell-deactivate () nil |
30481825 |
1732 | (menu-shell menu-shell)) |
0d07716f |
1733 | |
a60bd055 |
1734 | (defbinding menu-shell-select-item () nil |
30481825 |
1735 | (menu-shell menu-shell) |
1736 | (menu-item menu-item)) |
0d07716f |
1737 | |
14eaa563 |
1738 | (defbinding menu-shell-select-first () nil |
1739 | (menu-shell menu-shell) |
1740 | (search-sensitive boolean)) |
1741 | |
a60bd055 |
1742 | (defbinding menu-shell-deselect () nil |
30481825 |
1743 | (menu-shell menu-shell)) |
0d07716f |
1744 | |
a60bd055 |
1745 | (defbinding menu-shell-activate-item () nil |
30481825 |
1746 | (menu-shell menu-shell) |
1747 | (menu-item menu-item) |
1748 | (fore-deactivate boolean)) |
0d07716f |
1749 | |
14eaa563 |
1750 | (defbinding menu-shell-cancel () nil |
1751 | (menu-shell menu-shell)) |
0d07716f |
1752 | |
1753 | |
378b3c5f |
1754 | ;;; Menu |
0d07716f |
1755 | |
378b3c5f |
1756 | (defun %menu-position (menu child) |
1757 | (etypecase child |
1758 | (int child) |
1759 | (keyword (case child |
1760 | (:first 0) |
1761 | (:last -1) |
eb4f580c |
1762 | (t (error "Invalid position keyword: ~A" child)))) |
378b3c5f |
1763 | (widget (menu-child-position menu child)))) |
0d07716f |
1764 | |
1765 | |
378b3c5f |
1766 | (defbinding menu-reorder-child (menu menu-item position) nil |
1767 | (menu menu) |
1768 | (menu-item menu-item) |
1769 | ((%menu-position menu position) int)) |
0d07716f |
1770 | |
14eaa563 |
1771 | (defbinding menu-attach () nil |
1772 | (menu menu) |
1773 | (menu-item menu-item) |
1774 | (left-attach unsigned-int) |
1775 | (right-attach unsigned-int) |
1776 | (top-attach unsigned-int) |
1777 | (bottom-attach unsigned-int)) |
1778 | |
a92553bd |
1779 | (define-callback-marshal %menu-position-callback nil |
1780 | (menu (x int) (y int) (push-in boolean))) |
0d07716f |
1781 | |
378b3c5f |
1782 | (defbinding %menu-popup () nil |
1783 | (menu menu) |
1784 | (parent-menu-shell (or null menu-shell)) |
1785 | (parent-menu-item (or null menu-item)) |
a92553bd |
1786 | (callback (or null callback)) |
378b3c5f |
1787 | (callback-id unsigned-int) |
1788 | (button unsigned-int) |
1789 | (activate-time (unsigned 32))) |
1790 | |
1791 | (defun menu-popup (menu button activate-time &key callback parent-menu-shell |
1792 | parent-menu-item) |
1793 | (if callback |
4886872c |
1794 | (with-callback-function (id callback) |
1795 | (%menu-popup |
1796 | menu parent-menu-shell parent-menu-item |
a92553bd |
1797 | %menu-position-callback id button activate-time)) |
378b3c5f |
1798 | (%menu-popup |
1799 | menu parent-menu-shell parent-menu-item nil 0 button activate-time))) |
1800 | |
1801 | (defbinding menu-set-accel-path () nil |
1802 | (menu menu) |
1803 | (accel-path string)) |
0d07716f |
1804 | |
a60bd055 |
1805 | (defbinding menu-reposition () nil |
30481825 |
1806 | (menu menu)) |
0d07716f |
1807 | |
a60bd055 |
1808 | (defbinding menu-popdown () nil |
30481825 |
1809 | (menu menu)) |
0d07716f |
1810 | |
378b3c5f |
1811 | (defun menu-child-position (menu child) |
1812 | (position child (container-children menu))) |
1813 | |
1814 | (defun menu-active-num (menu) |
1815 | (menu-child-position menu (menu-active menu))) |
1816 | |
a60bd055 |
1817 | (defbinding %menu-set-active () nil |
30481825 |
1818 | (menu menu) |
1819 | (index unsigned-int)) |
0d07716f |
1820 | |
378b3c5f |
1821 | (defun (setf menu-active) (menu child) |
1822 | (%menu-set-active menu (%menu-position menu child)) |
1823 | child) |
2afcd8bd |
1824 | |
a92553bd |
1825 | (define-callback %menu-detach-callback nil ((widget widget) (menu menu)) |
14eaa563 |
1826 | (funcall (object-data menu 'detach-func) widget menu)) |
1827 | |
1828 | (defbinding %menu-attach-to-widget () nil |
1829 | (menu menu) |
1830 | (widget widget) |
a92553bd |
1831 | (%menu-detach-callback callback)) |
14eaa563 |
1832 | |
1833 | (defun menu-attach-to-widget (menu widget function) |
1834 | (setf (object-data menu 'detach-func) function) |
1835 | (%menu-attach-to-widget menu widget)) |
1836 | |
1837 | (defbinding menu-detach () nil |
1838 | (menu menu)) |
1839 | |
1840 | #+gtk2.6 |
1841 | (defbinding menu-get-for-attach-widget () (copy-of (glist widget)) |
1842 | (widget widget)) |
1843 | |
1844 | (defbinding menu-set-monitor () nil |
1845 | (menu menu) |
1846 | (monitor-num int)) |
0d07716f |
1847 | |
1848 | |
30481825 |
1849 | ;;; Table |
0d07716f |
1850 | |
a60bd055 |
1851 | (defbinding table-resize () nil |
30481825 |
1852 | (table table) |
1853 | (rows unsigned-int) |
1854 | (columns unsigned-int)) |
0d07716f |
1855 | |
a60bd055 |
1856 | (defbinding table-attach (table child left right top bottom |
362f1795 |
1857 | &key options x-options y-options |
1858 | (x-padding 0) (y-padding 0)) nil |
30481825 |
1859 | (table table) |
1860 | (child widget) |
1861 | (left unsigned-int) |
1862 | (right unsigned-int) |
1863 | (top unsigned-int) |
1864 | (bottom unsigned-int) |
362f1795 |
1865 | ((append (mklist options) (mklist x-options)) attach-options) |
1866 | ((append (mklist options) (mklist y-options)) attach-options) |
30481825 |
1867 | (x-padding unsigned-int) |
1868 | (y-padding unsigned-int)) |
1869 | |
dd392521 |
1870 | |
a60bd055 |
1871 | (defbinding %table-set-row-spacing () nil |
30481825 |
1872 | (table table) |
1873 | (row unsigned-int) |
1874 | (spacing unsigned-int)) |
1875 | |
dd392521 |
1876 | (defbinding %table-set-row-spacings () nil |
1877 | (table table) |
1878 | (spacing unsigned-int)) |
1879 | |
1880 | (defun (setf table-row-spacing) (spacing table &optional row) |
1881 | (if row |
1882 | (%table-set-row-spacing table row spacing) |
1883 | (%table-set-row-spacings table spacing)) |
30481825 |
1884 | spacing) |
1885 | |
dd392521 |
1886 | (defbinding %table-get-row-spacing () unsigned-int |
30481825 |
1887 | (table table) |
dd392521 |
1888 | (row unsigned-int)) |
1889 | |
1890 | (defbinding %table-get-default-row-spacing () unsigned-int |
1891 | (table table)) |
1892 | |
1893 | (defun table-row-spacing (table &optional row) |
1894 | (if row |
1895 | (%table-get-row-spacing table row) |
1896 | (%table-get-default-row-spacing table))) |
1897 | |
30481825 |
1898 | |
a60bd055 |
1899 | (defbinding %table-set-col-spacing () nil |
30481825 |
1900 | (table table) |
1901 | (col unsigned-int) |
1902 | (spacing unsigned-int)) |
1903 | |
dd392521 |
1904 | (defbinding %table-set-col-spacings () nil |
1905 | (table table) |
1906 | (spacing unsigned-int)) |
1907 | |
1908 | (defun (setf table-col-spacing) (spacing table &optional col) |
1909 | (if col |
1910 | (%table-set-col-spacing table col spacing) |
1911 | (%table-set-col-spacings table spacing)) |
30481825 |
1912 | spacing) |
1913 | |
dd392521 |
1914 | (defbinding %table-get-col-spacing () unsigned-int |
30481825 |
1915 | (table table) |
dd392521 |
1916 | (col unsigned-int)) |
1917 | |
1918 | (defbinding %table-get-default-col-spacing () unsigned-int |
1919 | (table table)) |
1920 | |
1921 | (defun table-col-spacing (table &optional col) |
1922 | (if col |
1923 | (%table-get-col-spacing table col) |
1924 | (%table-get-default-col-spacing table))) |
1925 | |
1926 | |
30481825 |
1927 | |
1928 | ;;; Toolbar |
1929 | |
9617dc95 |
1930 | (defmethod initialize-instance ((toolbar toolbar) &rest initargs &key tooltips) |
1931 | (if (eq tooltips t) |
1932 | (apply #'call-next-method toolbar |
1933 | :tooltips (make-instance 'tooltips) initargs) |
1934 | (call-next-method))) |
0d07716f |
1935 | |
9617dc95 |
1936 | (defbinding %toolbar-insert () nil |
378b3c5f |
1937 | (toolbar toolbar) |
9617dc95 |
1938 | (tool-item tool-item) |
1939 | (position position)) |
30481825 |
1940 | |
9617dc95 |
1941 | (defun toolbar-insert (toolbar tool-item &optional (position :end)) |
1942 | (%toolbar-insert toolbar tool-item position) |
1943 | (%tool-item-update-tooltips tool-item)) |
378b3c5f |
1944 | |
9617dc95 |
1945 | (defbinding toolbar-get-item-index () int |
1946 | (toolbar toolbar) |
1947 | (item tool-item)) |
30481825 |
1948 | |
9617dc95 |
1949 | (defbinding toolbar-get-nth-item () tool-item |
1950 | (toolbar toolbar) |
1951 | (n int)) |
30481825 |
1952 | |
9617dc95 |
1953 | (defbinding toolbar-get-drop-index () int |
1954 | (toolbar toolbar) |
1955 | (x int) (y int)) |
30481825 |
1956 | |
9617dc95 |
1957 | (defbinding toolbar-set-drop-highlight-item () nil |
1958 | (toolbar toolbar) |
1959 | (tool-item tool-item) |
1960 | (index int)) |
30481825 |
1961 | |
0d07716f |
1962 | |
9617dc95 |
1963 | ;;; Tool button |
0d07716f |
1964 | |
9617dc95 |
1965 | (defmethod initialize-instance ((button tool-button) &rest initargs &key icon) |
1966 | (if (and icon (not (typep icon 'widget))) |
1967 | (apply #'call-next-method button :icon (create-image-widget icon) initargs) |
1968 | (call-next-method))) |
0d07716f |
1969 | |
1970 | |
9617dc95 |
1971 | ;;; Tool item |
0d07716f |
1972 | |
9617dc95 |
1973 | (defbinding tool-item-set-tooltip () nil |
1974 | (tool-item tool-item) |
1975 | (tooltips tooltips) |
1976 | (tip-text string) |
1977 | (tip-private string)) |
0d07716f |
1978 | |
0d07716f |
1979 | |
9617dc95 |
1980 | (defun %tool-item-update-tooltips (tool-item) |
1981 | (when (and |
1982 | (slot-boundp tool-item 'parent) |
1983 | (or |
1984 | (user-data-p tool-item 'tip-text) |
1985 | (user-data-p tool-item 'tip-private))) |
1986 | (tool-item-set-tooltip |
1987 | tool-item (toolbar-tooltips (widget-parent tool-item)) |
1988 | (or (user-data tool-item 'tip-text) "") |
1989 | (or (user-data tool-item 'tip-private) "")))) |
1990 | |
1991 | (defmethod (setf tool-item-tip-text) ((tip-text string) (tool-item tool-item)) |
1992 | (setf (user-data tool-item 'tip-text) tip-text) |
1993 | (%tool-item-update-tooltips tool-item) |
1994 | tip-text) |
1995 | |
1996 | (defmethod (setf tool-item-tip-private) ((tip-private string) (tool-item tool-item)) |
1997 | (setf (user-data tool-item 'tip-private) tip-private) |
1998 | (%tool-item-update-tooltips tool-item) |
1999 | tip-private) |
2000 | |
2001 | (defmethod container-add ((toolbar toolbar) (tool-item tool-item) &rest args) |
2002 | (declare (ignore args)) |
2003 | (prog1 |
2004 | (call-next-method) |
2005 | (%tool-item-update-tooltips tool-item))) |
0d07716f |
2006 | |
14eaa563 |
2007 | |
2008 | (defbinding tool-item-retrieve-proxy-menu-item () widget |
2009 | (tool-item tool-item)) |
2010 | |
2011 | (defbinding (tool-item-proxy-menu-item |
2012 | "gtk_tool_item_get_proxy_menu_item") () menu-item |
2013 | (tool-item tool-item) |
2014 | (menu-item-id string)) |
2015 | |
2016 | (defbinding %tool-item-set-proxy-menu-item () nil |
2017 | (tool-item tool-item) |
2018 | (menu-item-id string) |
2019 | (menu-item menu-item)) |
2020 | |
2021 | (defun (setf tool-item-proxy-menu-item) (menu-item menu-item-id tool-item) |
2022 | (%tool-item-set-proxy-menu-item menu-item-id tool-item menu-item) |
2023 | menu-item) |
2024 | |
2025 | #+gtk2.6 |
2026 | (defbinding tool-item-rebuild-menu () nil |
2027 | (tool-item tool-item)) |
2028 | |
2029 | |
a60bd055 |
2030 | ;;; Editable |
eb4f580c |
2031 | |
a60bd055 |
2032 | (defbinding editable-select-region (editable &optional (start 0) end) nil |
30481825 |
2033 | (editable editable) |
2034 | (start int) |
2035 | ((or end -1) int)) |
0d07716f |
2036 | |
eb4f580c |
2037 | (defbinding editable-get-selection-bounds (editable) nil |
2038 | (editable editable) |
2039 | (start int :out) |
2040 | (end int :out)) |
2041 | |
14eaa563 |
2042 | (defbinding editable-insert-text (editable text &optional (position 0)) nil |
30481825 |
2043 | (editable editable) |
2044 | (text string) |
2045 | ((length text) int) |
5a3bf471 |
2046 | (position position :in-out)) |
0d07716f |
2047 | |
30481825 |
2048 | (defun editable-append-text (editable text) |
2049 | (editable-insert-text editable text nil)) |
0d07716f |
2050 | |
30481825 |
2051 | (defun editable-prepend-text (editable text) |
2052 | (editable-insert-text editable text 0)) |
0d07716f |
2053 | |
a60bd055 |
2054 | (defbinding editable-delete-text (editable &optional (start 0) end) nil |
30481825 |
2055 | (editable editable) |
2056 | (start int) |
2057 | ((or end -1) int)) |
0d07716f |
2058 | |
a60bd055 |
2059 | (defbinding (editable-text "gtk_editable_get_chars") |
30481825 |
2060 | (editable &optional (start 0) end) string |
2061 | (editable editable) |
2062 | (start int) |
2063 | ((or end -1) int)) |
0d07716f |
2064 | |
30481825 |
2065 | (defun (setf editable-text) (text editable) |
2066 | (if text |
2067 | (editable-delete-text |
2068 | editable |
2069 | (editable-insert-text editable text)) |
2070 | (editable-delete-text editable)) |
2071 | text) |
0d07716f |
2072 | |
a60bd055 |
2073 | (defbinding editable-cut-clipboard () nil |
30481825 |
2074 | (editable editable)) |
0d07716f |
2075 | |
a60bd055 |
2076 | (defbinding editable-copy-clipboard () nil |
30481825 |
2077 | (editable editable)) |
0d07716f |
2078 | |
a60bd055 |
2079 | (defbinding editable-paste-clipboard () nil |
30481825 |
2080 | (editable editable)) |
0d07716f |
2081 | |
a60bd055 |
2082 | (defbinding editable-delete-selection () nil |
30481825 |
2083 | (editable editable)) |
0d07716f |
2084 | |
0d07716f |
2085 | |
0d07716f |
2086 | |
30481825 |
2087 | ;;; Spin button |
0d07716f |
2088 | |
14eaa563 |
2089 | (defbinding spin-button-configure () nil |
2090 | (spin-button spin-button) |
2091 | (adjustment adjustment) |
2092 | (climb-rate double-float) |
2093 | (digits unsigned-int)) |
2094 | |
2095 | (defbinding spin-button-set-range () nil |
2096 | (spin-button spin-button) |
2097 | (min double-float) |
2098 | (max double-float)) |
2099 | |
2100 | (defbinding spin-button-get-range () nil |
2101 | (spin-button spin-button) |
2102 | (min double-float :out) |
2103 | (max double-float :out)) |
2104 | |
30481825 |
2105 | (defun spin-button-value-as-int (spin-button) |
2106 | (round (spin-button-value spin-button))) |
0d07716f |
2107 | |
45314d76 |
2108 | (defbinding %spin-button-spin () nil |
30481825 |
2109 | (spin-button spin-button) |
2110 | (direction spin-type) |
45314d76 |
2111 | (increment double-float)) |
2112 | |
2113 | (defun spin-button-spin (spin-button value) |
2114 | (etypecase value |
2115 | (real (%spin-button-spin spin-button :spin-user-defined value)) |
2116 | (spin-type (%spin-button-spin spin-button value 0)))) |
2117 | |
0d07716f |
2118 | |
a60bd055 |
2119 | (defbinding spin-button-update () nil |
30481825 |
2120 | (spin-button spin-button)) |
0d07716f |
2121 | |
2122 | |
2123 | |
2124 | ; ;;; Ruler |
2125 | |
a60bd055 |
2126 | (defbinding ruler-set-range () nil |
30481825 |
2127 | (ruler ruler) |
2128 | (lower single-float) |
2129 | (upper single-float) |
2130 | (position single-float) |
2131 | (max-size single-float)) |
0d07716f |
2132 | |
49043b9a |
2133 | (defbinding ruler-get-range () nil |
2134 | (ruler ruler) |
2135 | (lower single-float :out) |
2136 | (upper single-float :out) |
2137 | (position single-float :out) |
2138 | (max-size single-float :out)) |
0d07716f |
2139 | |
0d07716f |
2140 | |
0d07716f |
2141 | |
2afcd8bd |
2142 | ;;; Range |
0d07716f |
2143 | |
eb4f580c |
2144 | (defun range-lower (range) |
2145 | (adjustment-lower (range-adjustment range))) |
0d07716f |
2146 | |
eb4f580c |
2147 | (defun range-upper (range) |
2148 | (adjustment-upper (range-adjustment range))) |
0d07716f |
2149 | |
eb4f580c |
2150 | (defun (setf range-lower) (value range) |
2151 | (setf (adjustment-lower (range-adjustment range)) value)) |
0d07716f |
2152 | |
eb4f580c |
2153 | (defun (setf range-upper) (value range) |
2154 | (setf (adjustment-upper (range-adjustment range)) value)) |
0d07716f |
2155 | |
eb4f580c |
2156 | (defun range-page-increment (range) |
2157 | (adjustment-page-increment (range-adjustment range))) |
0d07716f |
2158 | |
eb4f580c |
2159 | (defun range-step-increment (range) |
2160 | (adjustment-step-increment (range-adjustment range))) |
0d07716f |
2161 | |
eb4f580c |
2162 | (defun (setf range-page-increment) (value range) |
2163 | (setf (adjustment-page-increment (range-adjustment range)) value)) |
0d07716f |
2164 | |
eb4f580c |
2165 | (defun (setf range-step-increment) (value range) |
2166 | (setf (adjustment-step-increment (range-adjustment range)) value)) |
0d07716f |
2167 | |
eb4f580c |
2168 | (defbinding range-set-range () nil |
2afcd8bd |
2169 | (range range) |
eb4f580c |
2170 | (lower double-float) |
2171 | (upper double-float)) |
0d07716f |
2172 | |
eb4f580c |
2173 | (defbinding range-set-increments () nil |
2afcd8bd |
2174 | (range range) |
eb4f580c |
2175 | (step double-float) |
2176 | (page double-float)) |
0d07716f |
2177 | |
0d07716f |
2178 | |
2afcd8bd |
2179 | ;;; Scale |
0d07716f |
2180 | |
49043b9a |
2181 | (defbinding scale-get-layout-offsets () nil |
2182 | (scale scale) |
2183 | (x int :out) |
2184 | (y int :out)) |
0d07716f |
2185 | |
0d07716f |
2186 | |
2afcd8bd |
2187 | ;;; Progress bar |
0d07716f |
2188 | |
a60bd055 |
2189 | (defbinding progress-bar-pulse () nil |
2afcd8bd |
2190 | (progress-bar progress-bar)) |
0d07716f |
2191 | |
2192 | |
362f1795 |
2193 | ;;; Size group |
2194 | |
2195 | (defmethod initialize-instance ((size-group size-group) &rest initargs |
2196 | &key widget widgets) |
2197 | (declare (ignore widget widgets)) |
2198 | (prog1 |
2199 | (call-next-method) |
2200 | (initial-add size-group #'size-group-add-widget |
2201 | initargs :widget :widgets))) |
2202 | |
2203 | |
2204 | (defbinding size-group-add-widget () nil |
2205 | (size-group size-group) |
2206 | (widget widget)) |
2207 | |
2208 | (defbinding size-group-remove-widget () nil |
2209 | (size-group size-group) |
2210 | (widget widget)) |
2211 | |
0d07716f |
2212 | |
378b3c5f |
2213 | ;;; Stock items |
2214 | |
99821988 |
2215 | (defbinding %stock-item-copy () pointer |
2216 | (location pointer)) |
2217 | |
2218 | (defbinding %stock-item-free () nil |
2219 | (location pointer)) |
378b3c5f |
2220 | |
99821988 |
2221 | (defmethod reference-foreign ((class (eql (find-class 'stock-item))) location) |
2222 | (%stock-item-copy location)) |
2223 | |
2224 | (defmethod unreference-foreign ((class (eql (find-class 'stock-item))) location) |
2225 | (%stock-item-free location)) |
2226 | |
2227 | (defbinding stock-add (stock-item) nil |
2228 | (stock-item stock-item) |
2229 | (1 unsigned-int)) |
2230 | |
2231 | (defbinding stock-list-ids () (gslist string)) |
2232 | |
2233 | (defbinding %stock-lookup () boolean |
2234 | (stock-id string) |
2235 | (location pointer)) |
2236 | |
2237 | (defun stock-lookup (stock-id) |
2238 | (let ((location |
8dcd91d7 |
2239 | (allocate-memory (foreign-size (find-class 'stock-item))))) |
99821988 |
2240 | (unwind-protect |
2241 | (when (%stock-lookup stock-id location) |
2242 | (ensure-proxy-instance 'stock-item (%stock-item-copy location))) |
2243 | (deallocate-memory location)))) |
0d07716f |
2244 | |
2245 | |
2246 | ;;; Tooltips |
2247 | |
a60bd055 |
2248 | (defbinding tooltips-enable () nil |
2afcd8bd |
2249 | (tooltips tooltips)) |
0d07716f |
2250 | |
a60bd055 |
2251 | (defbinding tooltips-disable () nil |
2afcd8bd |
2252 | (tooltips tooltips)) |
0d07716f |
2253 | |
dd392521 |
2254 | (defun (setf tooltips-enabled-p) (enable tooltips) |
2255 | (if enable |
2256 | (tooltips-enable tooltips) |
2257 | (tooltips-disable tooltips))) |
2258 | |
a60bd055 |
2259 | (defbinding tooltips-set-tip () nil |
2afcd8bd |
2260 | (tooltips tooltips) |
2261 | (widget widget) |
2262 | (tip-text string) |
2263 | (tip-private string)) |
0d07716f |
2264 | |
14eaa563 |
2265 | (defbinding tooltips-data-get () tooltips-data |
2266 | (widget widget)) |
2267 | |
a60bd055 |
2268 | (defbinding tooltips-force-window () nil |
2afcd8bd |
2269 | (tooltips tooltips)) |
0d07716f |
2270 | |
14eaa563 |
2271 | (defbinding tooltips-get-info-from-tip-window () boolean |
2272 | (tip-window window) |
2273 | (tooltips tooltips :out) |
2274 | (current-widget widget :out)) |
0d07716f |
2275 | |
2276 | |
e69138cc |
2277 | ;;; Resource Files |
0d07716f |
2278 | |
a60bd055 |
2279 | (defbinding rc-add-default-file (filename) nil |
2afcd8bd |
2280 | ((namestring (truename filename)) string)) |
0d07716f |
2281 | |
a60bd055 |
2282 | (defbinding rc-parse (filename) nil |
2afcd8bd |
2283 | ((namestring (truename filename)) string)) |
0d07716f |
2284 | |
a60bd055 |
2285 | (defbinding rc-parse-string () nil |
2afcd8bd |
2286 | (rc-string string)) |
0d07716f |
2287 | |
a60bd055 |
2288 | (defbinding rc-reparse-all () nil) |
0d07716f |
2289 | |
a60bd055 |
2290 | (defbinding rc-get-style () style |
2afcd8bd |
2291 | (widget widget)) |