Typo.
[cl-gtk2.git] / gdk / gdk.drawing-primitives.lisp
1 (in-package :gdk)
2
3 (defcfun gdk-drawable-get-size :void
4   (drawable (g-object drawable))
5   (width (:pointer :int))
6   (height (:pointer :int)))
7
8 (defun drawable-get-size (drawable)
9   (with-foreign-objects ((x :int)
10                          (y :int))
11     (gdk-drawable-get-size drawable x y)
12     (values (mem-ref x :int) (mem-ref y :int))))
13
14 (export 'drawable-get-size)
15
16 (defcfun (draw-point "gdk_draw_point") :void
17   (drawable (g-object drawable))
18   (gc (g-object graphics-context))
19   (x :int)
20   (y :int))
21
22 (export 'draw-point)
23
24 (defcfun gdk-draw-points :void
25   (drawable (g-object drawable))
26   (gc (g-object graphics-context))
27   (points :pointer)
28   (n :int))
29
30 (defun draw-points (drawable gc points)
31   (with-foreign-boxed-array (n points-ptr point points)
32     (gdk-draw-points drawable gc points-ptr n)))
33
34 (export 'draw-points)
35
36 (defcfun (draw-line "gdk_draw_line") :void
37   (drawable (g-object drawable))
38   (gc (g-object graphics-context))
39   (x1 :int)
40   (y1 :int)
41   (x2 :int)
42   (y2 :int))
43
44 (export 'draw-line)
45
46 (defcfun gdk-draw-lines :void
47   (drawable (g-object drawable))
48   (gc (g-object graphics-context))
49   (points :pointer)
50   (n :int))
51
52 (defun draw-lines (drawable gc points)
53   (with-foreign-boxed-array (n points-ptr point points)
54     (gdk-draw-lines drawable gc points-ptr n)))
55
56 (export 'draw-lines)
57
58 (defcfun (draw-pixbuf "gdk_draw_pixbuf") :void
59   (drawable (g-object drawable))
60   (gc (g-object graphics-context))
61   (pixbuf (g-object pixbuf))
62   (src-x :int)
63   (src-y :int)
64   (dest-x :int)
65   (dest-y :int)
66   (width :int)
67   (height :int)
68   (dither rgb-dither)
69   (x-dither :int)
70   (y-dither :int))
71
72 (export 'draw-pixbuf)
73
74 (defcfun gdk-draw-segments :void
75   (drawable (g-object drawable))
76   (gc (g-object graphics-context))
77   (segments :pointer)
78   (n-segments :int))
79
80 (defun draw-segments (drawable gc segments)
81   (with-foreign-boxed-array (n segments-ptr segment segments)
82     (gdk-draw-segments drawable gc segments-ptr n)))
83
84 (export 'draw-segments)
85
86 (defcfun (draw-rectangle "gdk_draw_rectangle") :void
87   (drawable (g-object drawable))
88   (gc (g-object graphics-context))
89   (filled :boolean)
90   (x :int)
91   (y :int)
92   (width :int)
93   (height :int))
94
95 (export 'draw-rectangle)
96
97 (defcfun (draw-arc "gdk_draw_arc") :void
98   (drawable (g-object drawable))
99   (gc (g-object graphics-context))
100   (filled :boolean)
101   (x :int)
102   (y :int)
103   (width :int)
104   (height :int)
105   (angle1 :int)
106   (angle2 :int))
107
108 (export 'draw-arc)
109
110 (defcfun gdk-draw-polygon :void
111   (drawable (g-object drawable))
112   (gc (g-object graphics-context))
113   (filled :boolean)
114   (points :pointer)
115   (n-points :int))
116
117 (defun draw-polygon (drawable gc filled points)
118   (with-foreign-boxed-array (n points-ptr point points)
119     (gdk-draw-polygon drawable gc filled points-ptr n)))
120
121 (export 'draw-polygon)
122
123 (defcfun gdk-draw-trapezoids :void
124   (drawable (g-object drawable))
125   (gc (g-object graphics-context))
126   (trapezoids :pointer)
127   (n :int))
128
129 (defun draw-trapezoids (drawable gc trapezoids)
130   (with-foreign-boxed-array (n trapezoids-ptr trapezoid trapezoids)
131     (gdk-draw-trapezoids drawable gc trapezoids-ptr n)))
132
133 (export 'draw-trapezoids)
134
135 (defcfun (draw-glyphs "gdk_draw_glyphs") :void
136   (drawable (g-object drawable))
137   (gc (g-object graphics-context))
138   (font (g-object pango-font))
139   (x :int)
140   (y :int)
141   (glyphs (g-boxed-foreign pango-glyph-string)))
142
143 (export 'draw-glyphs)
144
145 (defcfun (draw-glyphs-transformed "gdk_draw_glyphs_transformed") :void
146   (drawable (g-object drawable))
147   (gc (g-object graphics-context))
148   (matrix (g-boxed-foreign pango-matrix))
149   (font (g-object pango-font))
150   (x :int)
151   (y :int))
152
153 (export 'draw-glyphs-transformed)
154
155 (defcfun (draw-layout-line "gdk_draw_layout_line") :void
156   (drawable (g-object drawable))
157   (gc (g-object graphics-context))
158   (x :int)
159   (y :int)
160   (line (g-boxed-foreign pango-layout-line)))
161
162 (export 'draw-layout-line)
163
164 (defcfun (draw-layout-line-with-colors "gdk_draw_layout_line_with_colors") :void
165   (drawable (g-object drawable))
166   (gc (g-object graphics-context))
167   (x :int)
168   (y :int)
169   (line (g-boxed-foreign pango-layout-line))
170   (foreground (g-boxed-foreign color))
171   (background (g-boxed-foreign color)))
172
173 (export 'draw-layout-line-with-colors)
174
175 (defcfun (draw-layout "gdk_draw_layout") :void
176   (drawable (g-object drawable))
177   (gc (g-object graphics-context))
178   (x :int)
179   (y :int)
180   (layout (g-object pango-layout)))
181
182 (export 'draw-layout)
183
184 (defcfun (draw-layout-with-colors "gdk_draw_layout_with_colors") :void
185   (drawable (g-object drawable))
186   (gc (g-object graphics-context))
187   (x :int)
188   (y :int)
189   (layout (g-object pango-layout))
190   (foreground (g-boxed-foreign color))
191   (background (g-boxed-foreign color)))
192
193 (export 'draw-layout-with-colors)
194
195 ;; ignored:
196 ;; void                gdk_draw_string                     (GdkDrawable *drawable,
197 ;;                                                          GdkFont *font,
198 ;;                                                          GdkGC *gc,
199 ;;                                                          gint x,
200 ;;                                                          gint y,
201 ;;                                                          const gchar *string);
202 ;; void                gdk_draw_text                       (GdkDrawable *drawable,
203 ;;                                                          GdkFont *font,
204 ;;                                                          GdkGC *gc,
205 ;;                                                          gint x,
206 ;;                                                          gint y,
207 ;;                                                          const gchar *text,
208 ;;                                                          gint text_length);
209 ;; void                gdk_draw_text_wc                    (GdkDrawable *drawable,
210 ;;                                                          GdkFont *font,
211 ;;                                                          GdkGC *gc,
212 ;;                                                          gint x,
213 ;;                                                          gint y,
214 ;;                                                          const GdkWChar *text,
215 ;;                                                          gint text_length);
216
217
218 (defcfun (draw-drawable "gdk_draw_drawable") :void
219   (drawable (g-object drawable))
220   (gc (g-object graphics-context))
221   (src (g-object drawable))
222   (x-src :int)
223   (y-src :int)
224   (x-dest :int)
225   (y-dest :int)
226   (width :int)
227   (height :int))
228
229 (export 'draw-drawable)
230
231 (defcfun (draw-image "gdk_draw_image") :void
232   (drawable (g-object drawable))
233   (gc (g-object graphics-context))
234   (image (g-object gdk-image))
235   (x-src :int)
236   (y-src :int)
237   (x-dest :int)
238   (y-dest :int)
239   (width :int)
240   (height :int))
241
242 (export 'draw-image)
243
244 (defcfun (drawable-get-image "gdk_drawable_get_image") (g-object gdk-image)
245   (drawable (g-object drawable))
246   (x :int)
247   (y :int)
248   (width :int)
249   (height :int))
250
251 (export 'drawable-get-image)
252
253 (defcfun (drawable-copy-to-image "gdk_drawable_copy_to_image") (g-object gdk-image)
254   (drawable (g-object drawable))
255   (image (g-object gdk-image))
256   (src-x :int)
257   (src-y :int)
258   (dest-x :int)
259   (dest-y :int)
260   (width :int)
261   (height :int))
262
263 (export 'drawable-copy-to-image)