Use gobject:with-foreign-boxed-array in Gdk
[cl-gtk2.git] / gdk / gdk.pixbufs.lisp
blob91c7427485ecec51337a0c61e6ecd57aa3f1b82a
1 (in-package :gdk)
3 (defcfun (pixbuf-render-threshold-alpha "gdk_pixbuf_render_threshold_alpha") :void
4 (pixbuf (g-object pixbuf))
5 (bitmap (g-object bitmap))
6 (src-x :int)
7 (src-y :int)
8 (dest-x :int)
9 (dest-y :int)
10 (width :int)
11 (height :int)
12 (alpha-threshold :int))
14 (export 'pixbuf-render-threshold-alpha)
16 (defcfun (pixbuf-render-to-drawable "gdk_pixbuf_render_to_drawable") :void
17 (pixbuf (g-object pixbuf))
18 (drawable (g-object drawable))
19 (gc (g-object graphics-context))
20 (src-x :int)
21 (src-y :int)
22 (dest-x :int)
23 (dest-y :int)
24 (width :int)
25 (height :int)
26 (dither rgb-dither)
27 (x-dither :int)
28 (y-dither :int))
30 (export 'pixbuf-render-to-drawable)
32 (defcfun (pixbuf-render-to-drawable-alpha "gdk_pixbuf_render_to_drawable_alpha") :void
33 (pixbuf (g-object pixbuf))
34 (drawable (g-object drawable))
35 (src-x :int)
36 (src-y :int)
37 (dest-x :int)
38 (dest-y :int)
39 (width :int)
40 (height :int)
41 (alpha-mode pixbuf-alpha-mode)
42 (alpha-threshold :int)
43 (dither rgb-dither)
44 (x-dither :int)
45 (y-dither :int))
47 (export 'pixbuf-render-to-drawable-alpha)
49 (defcfun gdk-pixbuf-render-pixmap-and-mask :void
50 (pixbuf (g-object pixbuf))
51 (pixmap-return :pointer)
52 (mask-return :pointer)
53 (alpha-threshold :int))
55 (defun pixbuf-render-pixmap-and-mask (pixbuf alpha-threshold)
56 (with-foreign-objects ((pixmap-return :pointer) (mask-return :pointer))
57 (gdk-pixbuf-render-pixmap-and-mask pixbuf pixmap-return mask-return alpha-threshold)
58 (values (convert-from-foreign (mem-ref pixmap-return :pointer) '(g-object pixmap :already-referenced))
59 (convert-from-foreign (mem-ref mask-return :pointer) '(g-object pixmap :already-referenced)))))
61 (export 'pixbuf-render-pixmap-and-mask)
63 (defcfun gdk-pixbuf-render-pixmap-and-mask-for-colormap :void
64 (pixbuf (g-object pixbuf))
65 (colormap (g-object colormap))
66 (pixmap-return :pointer)
67 (mask-return :pointer)
68 (alpha-threshold :int))
70 (defun pixbuf-render-pixmap-and-mask-for-colormap (pixbuf colormap alpha-threshold)
71 (with-foreign-objects ((pixmap-return :pointer) (mask-return :pointer))
72 (gdk-pixbuf-render-pixmap-and-mask-for-colormap pixbuf colormap pixmap-return mask-return alpha-threshold)
73 (values (convert-from-foreign (mem-ref pixmap-return :pointer) '(g-object pixmap :already-referenced))
74 (convert-from-foreign (mem-ref mask-return :pointer) '(g-object pixmap :already-referenced)))))
76 (export 'pixbuf-render-pixmap-and-mask-for-colormap)
78 (defcfun gdk-pixbuf-get-from-drawable (g-object pixbuf :already-referenced)
79 (dest (g-object pixbuf))
80 (src (g-object drawable))
81 (colormap :pointer)
82 (src-x :int)
83 (src-y :int)
84 (dest-x :int)
85 (dest-y :int)
86 (width :int)
87 (height :int))
89 (defun pixbuf-get-from-drawable (pixbuf drawable &key (src-x 0) (src-y 0) (dest-x 0) (dest-y 0) (width -1) (height -1))
90 (gdk-pixbuf-get-from-drawable pixbuf drawable (null-pointer) src-x src-y dest-x dest-y width height))
92 (export 'pixbuf-get-from-drawable)
94 (defcfun gdk-pixbuf-get-from-image (g-object pixbuf :already-referenced)
95 (dest (g-object pixbuf))
96 (src (g-object gdk-image))
97 (colormap :pointer)
98 (src-x :int)
99 (src-y :int)
100 (dest-x :int)
101 (dest-y :int)
102 (width :int)
103 (height :int))
105 (defun pixbuf-get-from-image (pixbuf image &key (src-x 0) (src-y 0) (dest-x 0) (dest-y 0) (width -1) (height -1))
106 (gdk-pixbuf-get-from-image pixbuf image (null-pointer) src-x src-y dest-x dest-y width height))
108 (export 'pixbuf-get-from-image)