23f99ee43001dfcb479fcd8f8021278c030ebd5e
[cl-gtk2.git] / gtk / gtk.container.lisp
1 (in-package :gtk)
2
3 (defcfun (container-add "gtk_container_add") :void
4   (container (g-object container))
5   (widget (g-object widget)))
6
7 (export 'container-add)
8
9 (defcfun (container-remove "gtk_container_remove") :void
10   (container (g-object container))
11   (widget (g-object widget)))
12
13 (export 'container-remove)
14
15 (defcfun (container-check-resize "gtk_container_check_resize") :void
16   (container g-object))
17
18 (export 'container-check-resize)
19
20 (defcallback gtk-container-foreach-callback :void
21     ((widget g-object) (data :pointer))
22   (restart-case
23       (funcall (get-stable-pointer-value data)
24                widget)
25     (return () nil)))
26
27 (defcfun gtk-container-foreach :void
28   (container g-object)
29   (callback :pointer)
30   (data :pointer))
31
32 (defun map-container-children (container function)
33   (with-stable-pointer (ptr function)
34     (gtk-container-foreach container (callback gtk-container-foreach-callback) ptr)))
35
36 (export 'map-container-children)
37
38 (defcfun gtk-container-forall :void
39   (container g-object)
40   (callback :pointer)
41   (data :pointer))
42
43 (defun map-container-internal-children (container function)
44   (with-stable-pointer (ptr function)
45     (gtk-container-forall container (callback gtk-container-foreach-callback) ptr)))
46
47 (export 'map-container-internal-children)
48
49 (defcfun (container-children "gtk_container_get_children") (glist g-object :free-from-foreign t)
50   (container g-object))
51
52 ; TODO: ownership issues
53
54 (export 'container-children)
55
56 ; TODO: gtk_container_set_reallocate_redraws
57
58 (defcfun (container-resize-children "gtk_container_resize_children") :void
59   (container g-object))
60
61 (export 'container-resize-children)
62
63 (defcfun gtk-container-child-type g-type
64   (container g-object))
65
66 ; TODO: export gtk-container-child-type, requires better interface
67
68 ; TODO: child properties
69
70 ; TODO: gtk_container_propagate_expose
71
72 ; TODO: gtk_container_get_focus_chain
73
74 ; TODO: gtk_container_set_focus_chain
75
76 ; TODO: gtk_container_unset_focus_chain
77