1 // 2 // Cairo.cs - a simplistic binding of the Cairo API to C#. 3 // 4 // Authors: Duncan Mak (duncan@ximian.com) 5 // Hisham Mardam Bey (hisham.mardambey@gmail.com) 6 // John Luke (john.luke@gmail.com) 7 // Alp Toker (alp@atoker.com) 8 // 9 // (C) Ximian, Inc. 2003 10 // Copyright (C) 2004 Novell, Inc (http://www.novell.com) 11 // Copyright (C) 2005 John Luke 12 // Copyright (C) 2006 Alp Toker 13 // 14 // Permission is hereby granted, free of charge, to any person obtaining 15 // a copy of this software and associated documentation files (the 16 // "Software"), to deal in the Software without restriction, including 17 // without limitation the rights to use, copy, modify, merge, publish, 18 // distribute, sublicense, and/or sell copies of the Software, and to 19 // permit persons to whom the Software is furnished to do so, subject to 20 // the following conditions: 21 // 22 // The above copyright notice and this permission notice shall be 23 // included in all copies or substantial portions of the Software. 24 // 25 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 26 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 27 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 28 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 29 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 30 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 31 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 32 // 33 34 using System; 35 using System.Runtime.InteropServices; 36 37 namespace Cairo 38 { 39 // sort these so it is easier to find what is missing 40 // http://www.cairographics.org/manual/ix01.html 41 42 public class NativeMethods 43 { 44 NativeMethods()45 private NativeMethods () {} 46 47 const string cairo = "libcairo-2.dll"; 48 49 //[DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 50 //internal static extern void cairo_append_path (IntPtr cr, Path path); 51 52 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_arc(IntPtr cr, double xc, double yc, double radius, double angle1, double angle2)53 internal static extern void cairo_arc (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2); 54 55 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_arc_negative(IntPtr cr, double xc, double yc, double radius, double angle1, double angle2)56 internal static extern void cairo_arc_negative (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2); 57 58 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_atsui_font_face_create_for_atsu_font_id(IntPtr font_id)59 internal static extern IntPtr cairo_atsui_font_face_create_for_atsu_font_id (IntPtr font_id); 60 61 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_clip(IntPtr cr)62 internal static extern void cairo_clip (IntPtr cr); 63 64 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_clip_preserve(IntPtr cr)65 internal static extern void cairo_clip_preserve (IntPtr cr); 66 67 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_clip_extents(IntPtr cr, out double x1, out double y1, out double x2, out double y2)68 internal static extern void cairo_clip_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); 69 70 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_close_path(IntPtr cr)71 internal static extern void cairo_close_path (IntPtr cr); 72 73 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_copy_page(IntPtr cr)74 internal static extern void cairo_copy_page (IntPtr cr); 75 76 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_copy_path(IntPtr cr)77 internal static extern IntPtr cairo_copy_path (IntPtr cr); 78 79 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_copy_path_flat(IntPtr cr)80 internal static extern IntPtr cairo_copy_path_flat (IntPtr cr); 81 82 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_append_path(IntPtr cr, IntPtr path)83 internal static extern IntPtr cairo_append_path (IntPtr cr, IntPtr path); 84 85 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_create(IntPtr target)86 internal static extern IntPtr cairo_create (IntPtr target); 87 88 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_reference_count(IntPtr surface)89 internal static extern uint cairo_get_reference_count (IntPtr surface); 90 91 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_curve_to(IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3)92 internal static extern void cairo_curve_to (IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3); 93 94 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_debug_reset_static_data()95 internal static extern void cairo_debug_reset_static_data (); 96 97 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_destroy(IntPtr cr)98 internal static extern void cairo_destroy (IntPtr cr); 99 100 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_device_to_user(IntPtr cr, ref double x, ref double y)101 internal static extern void cairo_device_to_user (IntPtr cr, ref double x, ref double y); 102 103 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_device_to_user_distance(IntPtr cr, ref double dx, ref double dy)104 internal static extern void cairo_device_to_user_distance (IntPtr cr, ref double dx, ref double dy); 105 106 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_fill(IntPtr cr)107 internal static extern void cairo_fill (IntPtr cr); 108 109 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_fill_extents(IntPtr cr, out double x1, out double y1, out double x2, out double y2)110 internal static extern void cairo_fill_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); 111 112 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_fill_preserve(IntPtr cr)113 internal static extern void cairo_fill_preserve (IntPtr cr); 114 115 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_extents(IntPtr cr, out FontExtents extents)116 internal static extern void cairo_font_extents (IntPtr cr, out FontExtents extents); 117 118 // FontFace 119 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_face_destroy(IntPtr font_face)120 internal static extern void cairo_font_face_destroy (IntPtr font_face); 121 122 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_face_get_type(IntPtr font_face)123 internal static extern FontType cairo_font_face_get_type (IntPtr font_face); 124 125 //[DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 126 //internal static extern void cairo_font_face_get_user_data (IntPtr font_face); 127 128 //[DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 129 //internal static extern void cairo_font_face_set_user_data (IntPtr font_face); 130 131 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_face_reference(IntPtr font_face)132 internal static extern IntPtr cairo_font_face_reference (IntPtr font_face); 133 134 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_face_status(IntPtr font_face)135 internal static extern Status cairo_font_face_status (IntPtr font_face); 136 137 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_face_get_reference_count(IntPtr surface)138 internal static extern uint cairo_font_face_get_reference_count (IntPtr surface); 139 140 // FontOptions 141 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_copy(IntPtr original)142 internal static extern IntPtr cairo_font_options_copy (IntPtr original); 143 144 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_create()145 internal static extern IntPtr cairo_font_options_create (); 146 147 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_destroy(IntPtr options)148 internal static extern void cairo_font_options_destroy (IntPtr options); 149 150 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 151 [return: MarshalAs (UnmanagedType.U1)] cairo_font_options_equal(IntPtr options, IntPtr other)152 internal static extern bool cairo_font_options_equal (IntPtr options, IntPtr other); 153 154 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_get_antialias(IntPtr options)155 internal static extern Antialias cairo_font_options_get_antialias (IntPtr options); 156 157 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_get_hint_metrics(IntPtr options)158 internal static extern HintMetrics cairo_font_options_get_hint_metrics (IntPtr options); 159 160 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_get_hint_style(IntPtr options)161 internal static extern HintStyle cairo_font_options_get_hint_style (IntPtr options); 162 163 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_get_subpixel_order(IntPtr options)164 internal static extern SubpixelOrder cairo_font_options_get_subpixel_order (IntPtr options); 165 166 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_hash(IntPtr options)167 internal static extern long cairo_font_options_hash (IntPtr options); 168 169 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_merge(IntPtr options, IntPtr other)170 internal static extern void cairo_font_options_merge (IntPtr options, IntPtr other); 171 172 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_set_antialias(IntPtr options, Antialias aa)173 internal static extern void cairo_font_options_set_antialias (IntPtr options, Antialias aa); 174 175 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_set_hint_metrics(IntPtr options, HintMetrics metrics)176 internal static extern void cairo_font_options_set_hint_metrics (IntPtr options, HintMetrics metrics); 177 178 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_set_hint_style(IntPtr options, HintStyle style)179 internal static extern void cairo_font_options_set_hint_style (IntPtr options, HintStyle style); 180 181 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_set_subpixel_order(IntPtr options, SubpixelOrder order)182 internal static extern void cairo_font_options_set_subpixel_order (IntPtr options, SubpixelOrder order); 183 184 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_font_options_status(IntPtr options)185 internal static extern Status cairo_font_options_status (IntPtr options); 186 187 // Freetype / FontConfig 188 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_ft_font_face_create_for_ft_face(IntPtr face, int load_flags)189 internal static extern IntPtr cairo_ft_font_face_create_for_ft_face (IntPtr face, int load_flags); 190 191 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_ft_font_face_create_for_pattern(IntPtr fc_pattern)192 internal static extern IntPtr cairo_ft_font_face_create_for_pattern (IntPtr fc_pattern); 193 194 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_ft_font_options_substitute(FontOptions options, IntPtr pattern)195 internal static extern void cairo_ft_font_options_substitute (FontOptions options, IntPtr pattern); 196 197 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_ft_scaled_font_lock_face(IntPtr scaled_font)198 internal static extern IntPtr cairo_ft_scaled_font_lock_face (IntPtr scaled_font); 199 200 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_ft_scaled_font_unlock_face(IntPtr scaled_font)201 internal static extern void cairo_ft_scaled_font_unlock_face (IntPtr scaled_font); 202 203 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_antialias(IntPtr cr)204 internal static extern Antialias cairo_get_antialias (IntPtr cr); 205 206 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_current_point(IntPtr cr, out double x, out double y)207 internal static extern void cairo_get_current_point (IntPtr cr, out double x, out double y); 208 209 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_fill_rule(IntPtr cr)210 internal static extern FillRule cairo_get_fill_rule (IntPtr cr); 211 212 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_font_face(IntPtr cr)213 internal static extern IntPtr cairo_get_font_face (IntPtr cr); 214 215 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_font_matrix(IntPtr cr, out Matrix matrix)216 internal static extern void cairo_get_font_matrix (IntPtr cr, out Matrix matrix); 217 218 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_font_options(IntPtr cr, IntPtr options)219 internal static extern void cairo_get_font_options (IntPtr cr, IntPtr options); 220 221 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_group_target(IntPtr cr)222 internal static extern IntPtr cairo_get_group_target (IntPtr cr); 223 224 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_line_cap(IntPtr cr)225 internal static extern LineCap cairo_get_line_cap (IntPtr cr); 226 227 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_line_join(IntPtr cr)228 internal static extern LineJoin cairo_get_line_join (IntPtr cr); 229 230 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_line_width(IntPtr cr)231 internal static extern double cairo_get_line_width (IntPtr cr); 232 233 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_matrix(IntPtr cr, Matrix matrix)234 internal static extern void cairo_get_matrix (IntPtr cr, Matrix matrix); 235 236 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_miter_limit(IntPtr cr)237 internal static extern double cairo_get_miter_limit (IntPtr cr); 238 239 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_operator(IntPtr cr)240 internal static extern Operator cairo_get_operator (IntPtr cr); 241 242 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_source(IntPtr cr)243 internal static extern IntPtr cairo_get_source (IntPtr cr); 244 245 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_target(IntPtr cr)246 internal static extern IntPtr cairo_get_target (IntPtr cr); 247 248 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_tolerance(IntPtr cr)249 internal static extern double cairo_get_tolerance (IntPtr cr); 250 251 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_glitz_surface_create(IntPtr surface)252 internal static extern IntPtr cairo_glitz_surface_create (IntPtr surface); 253 254 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_glyph_extents(IntPtr cr, IntPtr glyphs, int num_glyphs, out TextExtents extents)255 internal static extern void cairo_glyph_extents (IntPtr cr, IntPtr glyphs, int num_glyphs, out TextExtents extents); 256 257 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_glyph_path(IntPtr cr, IntPtr glyphs, int num_glyphs)258 internal static extern void cairo_glyph_path (IntPtr cr, IntPtr glyphs, int num_glyphs); 259 260 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_identity_matrix(IntPtr cr)261 internal static extern void cairo_identity_matrix (IntPtr cr); 262 263 // ImageSurface 264 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_image_surface_create(Cairo.Format format, int width, int height)265 internal static extern IntPtr cairo_image_surface_create (Cairo.Format format, int width, int height); 266 267 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_image_surface_create_for_data(byte[] data, Cairo.Format format, int width, int height, int stride)268 internal static extern IntPtr cairo_image_surface_create_for_data (byte[] data, Cairo.Format format, int width, int height, int stride); 269 270 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_image_surface_create_for_data(IntPtr data, Cairo.Format format, int width, int height, int stride)271 internal static extern IntPtr cairo_image_surface_create_for_data (IntPtr data, Cairo.Format format, int width, int height, int stride); 272 273 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_image_surface_create_from_png(string filename)274 internal static extern IntPtr cairo_image_surface_create_from_png (string filename); 275 276 //[DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 277 //internal static extern IntPtr cairo_image_surface_create_from_png_stream (string filename); 278 279 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_image_surface_get_data(IntPtr surface)280 internal static extern IntPtr cairo_image_surface_get_data (IntPtr surface); 281 282 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_image_surface_get_format(IntPtr surface)283 internal static extern Format cairo_image_surface_get_format (IntPtr surface); 284 285 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_image_surface_get_height(IntPtr surface)286 internal static extern int cairo_image_surface_get_height (IntPtr surface); 287 288 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_image_surface_get_stride(IntPtr surface)289 internal static extern int cairo_image_surface_get_stride (IntPtr surface); 290 291 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_image_surface_get_width(IntPtr surface)292 internal static extern int cairo_image_surface_get_width (IntPtr surface); 293 294 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_get_reference_count(IntPtr surface)295 internal static extern uint cairo_surface_get_reference_count (IntPtr surface); 296 297 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 298 [return: MarshalAs (UnmanagedType.U1)] cairo_in_fill(IntPtr cr, double x, double y)299 internal static extern bool cairo_in_fill (IntPtr cr, double x, double y); 300 301 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 302 [return: MarshalAs (UnmanagedType.U1)] cairo_in_stroke(IntPtr cr, double x, double y)303 internal static extern bool cairo_in_stroke (IntPtr cr, double x, double y); 304 305 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_line_to(IntPtr cr, double x, double y)306 internal static extern void cairo_line_to (IntPtr cr, double x, double y); 307 308 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_mask(IntPtr cr, IntPtr pattern)309 internal static extern void cairo_mask (IntPtr cr, IntPtr pattern); 310 311 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_mask_surface(IntPtr cr, IntPtr surface, double x, double y)312 internal static extern void cairo_mask_surface (IntPtr cr, IntPtr surface, double x, double y); 313 314 // Matrix 315 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_init(Matrix matrix, double xx, double yx, double xy, double yy, double x0, double y0)316 internal static extern void cairo_matrix_init (Matrix matrix, double xx, double yx, double xy, double yy, double x0, double y0); 317 318 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_init_identity(Matrix matrix)319 internal static extern void cairo_matrix_init_identity (Matrix matrix); 320 321 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_init_rotate(Matrix matrix, double radians)322 internal static extern void cairo_matrix_init_rotate (Matrix matrix, double radians); 323 324 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_init_scale(Matrix matrix, double sx, double sy)325 internal static extern void cairo_matrix_init_scale (Matrix matrix, double sx, double sy); 326 327 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_init_translate(Matrix matrix, double tx, double ty)328 internal static extern void cairo_matrix_init_translate (Matrix matrix, double tx, double ty); 329 330 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_invert(Matrix matrix)331 internal static extern Status cairo_matrix_invert (Matrix matrix); 332 333 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_multiply(Matrix result, Matrix a, Matrix b)334 internal static extern void cairo_matrix_multiply (Matrix result, Matrix a, Matrix b); 335 336 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_scale(Matrix matrix, double sx, double sy)337 internal static extern void cairo_matrix_scale (Matrix matrix, double sx, double sy); 338 339 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_rotate(Matrix matrix, double radians)340 internal static extern void cairo_matrix_rotate (Matrix matrix, double radians); 341 342 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_transform_distance(Matrix matrix, ref double dx, ref double dy)343 internal static extern void cairo_matrix_transform_distance (Matrix matrix, ref double dx, ref double dy); 344 345 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_transform_point(Matrix matrix, ref double x, ref double y)346 internal static extern void cairo_matrix_transform_point (Matrix matrix, ref double x, ref double y); 347 348 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_matrix_translate(Matrix matrix, double tx, double ty)349 internal static extern void cairo_matrix_translate (Matrix matrix, double tx, double ty); 350 351 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_move_to(IntPtr cr, double x, double y)352 internal static extern void cairo_move_to (IntPtr cr, double x, double y); 353 354 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_new_path(IntPtr cr)355 internal static extern void cairo_new_path (IntPtr cr); 356 357 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_new_sub_path(IntPtr cr)358 internal static extern void cairo_new_sub_path (IntPtr cr); 359 360 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_paint(IntPtr cr)361 internal static extern void cairo_paint (IntPtr cr); 362 363 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_paint_with_alpha(IntPtr cr, double alpha)364 internal static extern void cairo_paint_with_alpha (IntPtr cr, double alpha); 365 366 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_path_destroy(IntPtr path)367 internal static extern void cairo_path_destroy (IntPtr path); 368 369 // Pattern 370 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_add_color_stop_rgb(IntPtr pattern, double offset, double red, double green, double blue)371 internal static extern void cairo_pattern_add_color_stop_rgb (IntPtr pattern, double offset, double red, double green, double blue); 372 373 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_add_color_stop_rgba(IntPtr pattern, double offset, double red, double green, double blue, double alpha)374 internal static extern void cairo_pattern_add_color_stop_rgba (IntPtr pattern, double offset, double red, double green, double blue, double alpha); 375 376 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_get_color_stop_count(IntPtr pattern, out int count)377 internal static extern Status cairo_pattern_get_color_stop_count (IntPtr pattern, out int count); 378 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_get_color_stop_rgba(IntPtr pattern, int index, out double offset, out double red, out double green, out double blue, out double alpha)379 internal static extern Status cairo_pattern_get_color_stop_rgba (IntPtr pattern, int index, out double offset, out double red, out double green, out double blue, out double alpha); 380 381 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_create_for_surface(IntPtr surface)382 internal static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface); 383 384 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_get_surface(IntPtr pattern, out IntPtr surface)385 internal static extern Status cairo_pattern_get_surface (IntPtr pattern, out IntPtr surface); 386 387 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_create_linear(double x0, double y0, double x1, double y1)388 internal static extern IntPtr cairo_pattern_create_linear (double x0, double y0, double x1, double y1); 389 390 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_get_linear_points(IntPtr pattern, out double x0, out double y0, out double x1, out double y1)391 internal static extern Status cairo_pattern_get_linear_points (IntPtr pattern, out double x0, out double y0, out double x1, out double y1); 392 393 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_create_radial(double cx0, double cy0, double radius0, double cx1, double cy1, double radius1)394 internal static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1); 395 396 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_get_radial_circles(IntPtr pattern, out double x0, out double y0, out double r0, out double x1, out double y1, out double r1)397 internal static extern Status cairo_pattern_get_radial_circles (IntPtr pattern, out double x0, out double y0, out double r0, out double x1, out double y1, out double r1); 398 399 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_create_rgb(double r, double g, double b)400 internal static extern IntPtr cairo_pattern_create_rgb (double r, double g, double b); 401 402 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_create_rgba(double r, double g, double b, double a)403 internal static extern IntPtr cairo_pattern_create_rgba (double r, double g, double b, double a); 404 405 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_get_rgba(IntPtr pattern, out double red, out double green, out double blue, out double alpha)406 internal static extern Status cairo_pattern_get_rgba (IntPtr pattern, out double red, out double green, out double blue, out double alpha); 407 408 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_destroy(IntPtr pattern)409 internal static extern void cairo_pattern_destroy (IntPtr pattern); 410 411 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_get_extend(IntPtr pattern)412 internal static extern Extend cairo_pattern_get_extend (IntPtr pattern); 413 414 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_get_filter(IntPtr pattern)415 internal static extern Filter cairo_pattern_get_filter (IntPtr pattern); 416 417 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_get_matrix(IntPtr pattern, Matrix matrix)418 internal static extern void cairo_pattern_get_matrix (IntPtr pattern, Matrix matrix); 419 420 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_get_type(IntPtr pattern)421 internal static extern PatternType cairo_pattern_get_type (IntPtr pattern); 422 423 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_reference(IntPtr pattern)424 internal static extern IntPtr cairo_pattern_reference (IntPtr pattern); 425 426 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_set_extend(IntPtr pattern, Extend extend)427 internal static extern void cairo_pattern_set_extend (IntPtr pattern, Extend extend); 428 429 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_set_filter(IntPtr pattern, Filter filter)430 internal static extern void cairo_pattern_set_filter (IntPtr pattern, Filter filter); 431 432 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_set_matrix(IntPtr pattern, Matrix matrix)433 internal static extern void cairo_pattern_set_matrix (IntPtr pattern, Matrix matrix); 434 435 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pattern_status(IntPtr pattern)436 internal static extern Status cairo_pattern_status (IntPtr pattern); 437 438 // PdfSurface 439 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pdf_surface_create(string filename, double width, double height)440 internal static extern IntPtr cairo_pdf_surface_create (string filename, double width, double height); 441 442 //[DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 443 //internal static extern IntPtr cairo_pdf_surface_create_for_stream (string filename, double width, double height); 444 445 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pdf_surface_set_size(IntPtr surface, double x, double y)446 internal static extern void cairo_pdf_surface_set_size (IntPtr surface, double x, double y); 447 448 // PostscriptSurface 449 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_ps_surface_create(string filename, double width, double height)450 internal static extern IntPtr cairo_ps_surface_create (string filename, double width, double height); 451 452 //[DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 453 //internal static extern IntPtr cairo_ps_surface_create_for_stream (string filename, double width, double height); 454 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_ps_surface_begin_page_setup(IntPtr surface)455 internal static extern void cairo_ps_surface_begin_page_setup (IntPtr surface); 456 457 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_ps_surface_begin_setup(IntPtr surface)458 internal static extern void cairo_ps_surface_begin_setup (IntPtr surface); 459 460 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_ps_surface_dsc_comment(IntPtr surface, string comment)461 internal static extern void cairo_ps_surface_dsc_comment (IntPtr surface, string comment); 462 463 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_ps_surface_set_size(IntPtr surface, double x, double y)464 internal static extern void cairo_ps_surface_set_size (IntPtr surface, double x, double y); 465 466 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pop_group(IntPtr cr)467 internal static extern IntPtr cairo_pop_group (IntPtr cr); 468 469 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_pop_group_to_source(IntPtr cr)470 internal static extern void cairo_pop_group_to_source (IntPtr cr); 471 472 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_push_group(IntPtr cr)473 internal static extern void cairo_push_group (IntPtr cr); 474 475 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_push_group_with_content(IntPtr cr, Content content)476 internal static extern void cairo_push_group_with_content (IntPtr cr, Content content); 477 478 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_quartz_surface_create(IntPtr context, bool flipped, int width, int height)479 internal static extern IntPtr cairo_quartz_surface_create (IntPtr context, bool flipped, int width, int height); 480 481 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_rectangle(IntPtr cr, double x, double y, double width, double height)482 internal static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height); 483 484 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_reference(IntPtr cr)485 internal static extern void cairo_reference (IntPtr cr); 486 487 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_rel_curve_to(IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3)488 internal static extern void cairo_rel_curve_to (IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3); 489 490 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_rel_line_to(IntPtr cr, double dx, double dy)491 internal static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy); 492 493 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_rel_move_to(IntPtr cr, double dx, double dy)494 internal static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy); 495 496 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_reset_clip(IntPtr cr)497 internal static extern void cairo_reset_clip (IntPtr cr); 498 499 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_restore(IntPtr cr)500 internal static extern void cairo_restore (IntPtr cr); 501 502 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_rotate(IntPtr cr, double angle)503 internal static extern void cairo_rotate (IntPtr cr, double angle); 504 505 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_save(IntPtr cr)506 internal static extern void cairo_save (IntPtr cr); 507 508 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scale(IntPtr cr, double sx, double sy)509 internal static extern void cairo_scale (IntPtr cr, double sx, double sy); 510 511 // ScaledFont 512 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_create(IntPtr fontFace, Matrix matrix, Matrix ctm, IntPtr options)513 internal static extern IntPtr cairo_scaled_font_create (IntPtr fontFace, Matrix matrix, Matrix ctm, IntPtr options); 514 515 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_destroy(IntPtr scaled_font)516 internal static extern IntPtr cairo_scaled_font_destroy (IntPtr scaled_font); 517 518 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_extents(IntPtr scaled_font, out FontExtents extents)519 internal static extern void cairo_scaled_font_extents (IntPtr scaled_font, out FontExtents extents); 520 521 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_get_ctm(IntPtr scaled_font, out Matrix matrix)522 internal static extern void cairo_scaled_font_get_ctm (IntPtr scaled_font, out Matrix matrix); 523 524 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_get_font_face(IntPtr scaled_font)525 internal static extern IntPtr cairo_scaled_font_get_font_face (IntPtr scaled_font); 526 527 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_get_font_matrix(IntPtr scaled_font, out Matrix matrix)528 internal static extern void cairo_scaled_font_get_font_matrix (IntPtr scaled_font, out Matrix matrix); 529 530 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_get_font_options(IntPtr scaled_font)531 internal static extern IntPtr cairo_scaled_font_get_font_options (IntPtr scaled_font); 532 533 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_get_type(IntPtr scaled_font)534 internal static extern FontType cairo_scaled_font_get_type (IntPtr scaled_font); 535 536 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_glyph_extents(IntPtr scaled_font, IntPtr glyphs, int num_glyphs, out TextExtents extents)537 internal static extern void cairo_scaled_font_glyph_extents (IntPtr scaled_font, IntPtr glyphs, int num_glyphs, out TextExtents extents); 538 539 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_reference(IntPtr scaled_font)540 internal static extern IntPtr cairo_scaled_font_reference (IntPtr scaled_font); 541 542 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_status(IntPtr scaled_font)543 internal static extern Status cairo_scaled_font_status (IntPtr scaled_font); 544 545 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_scaled_font(IntPtr cr, IntPtr scaled_font)546 internal static extern void cairo_set_scaled_font (IntPtr cr, IntPtr scaled_font); 547 548 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_scaled_font(IntPtr cr)549 internal static extern IntPtr cairo_get_scaled_font (IntPtr cr); 550 551 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_scaled_font_text_extents(IntPtr scaled_font, string utf8, out TextExtents extents)552 internal static extern void cairo_scaled_font_text_extents (IntPtr scaled_font, string utf8, out TextExtents extents); 553 554 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_select_font_face(IntPtr cr, string family, FontSlant slant, FontWeight weight)555 internal static extern void cairo_select_font_face (IntPtr cr, string family, FontSlant slant, FontWeight weight); 556 557 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_antialias(IntPtr cr, Antialias antialias)558 internal static extern void cairo_set_antialias (IntPtr cr, Antialias antialias); 559 560 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_dash(IntPtr cr, double [] dashes, int ndash, double offset)561 internal static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset); 562 563 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_dash(IntPtr cr, IntPtr dashes, out double offset)564 internal static extern void cairo_get_dash (IntPtr cr, IntPtr dashes, out double offset); 565 566 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_get_dash_count(IntPtr cr)567 internal static extern int cairo_get_dash_count (IntPtr cr); 568 569 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_fill_rule(IntPtr cr, Cairo.FillRule fill_rule)570 internal static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule); 571 572 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_font_face(IntPtr cr, IntPtr fontFace)573 internal static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace); 574 575 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_font_matrix(IntPtr cr, Matrix matrix)576 internal static extern void cairo_set_font_matrix (IntPtr cr, Matrix matrix); 577 578 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_font_options(IntPtr cr, IntPtr options)579 internal static extern void cairo_set_font_options (IntPtr cr, IntPtr options); 580 581 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_font_size(IntPtr cr, double size)582 internal static extern void cairo_set_font_size (IntPtr cr, double size); 583 584 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_line_cap(IntPtr cr, LineCap line_cap)585 internal static extern void cairo_set_line_cap (IntPtr cr, LineCap line_cap); 586 587 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_line_join(IntPtr cr, LineJoin line_join)588 internal static extern void cairo_set_line_join (IntPtr cr, LineJoin line_join); 589 590 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_line_width(IntPtr cr, double width)591 internal static extern void cairo_set_line_width (IntPtr cr, double width); 592 593 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_matrix(IntPtr cr, Matrix matrix)594 internal static extern void cairo_set_matrix (IntPtr cr, Matrix matrix); 595 596 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_miter_limit(IntPtr cr, double limit)597 internal static extern void cairo_set_miter_limit (IntPtr cr, double limit); 598 599 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_operator(IntPtr cr, Cairo.Operator op)600 internal static extern void cairo_set_operator (IntPtr cr, Cairo.Operator op); 601 602 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_source(IntPtr cr, IntPtr pattern)603 internal static extern void cairo_set_source (IntPtr cr, IntPtr pattern); 604 605 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_source_rgb(IntPtr cr, double red, double green, double blue)606 internal static extern void cairo_set_source_rgb (IntPtr cr, double red, double green, double blue); 607 608 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_source_rgba(IntPtr cr, double red, double green, double blue, double alpha)609 internal static extern void cairo_set_source_rgba (IntPtr cr, double red, double green, double blue, double alpha); 610 611 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_source_surface(IntPtr cr, IntPtr surface, double x, double y)612 internal static extern void cairo_set_source_surface (IntPtr cr, IntPtr surface, double x, double y); 613 614 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_set_tolerance(IntPtr cr, double tolerance)615 internal static extern void cairo_set_tolerance (IntPtr cr, double tolerance); 616 617 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_show_glyphs(IntPtr ct, IntPtr glyphs, int num_glyphs)618 internal static extern void cairo_show_glyphs (IntPtr ct, IntPtr glyphs, int num_glyphs); 619 620 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_show_page(IntPtr cr)621 internal static extern void cairo_show_page (IntPtr cr); 622 623 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_show_text(IntPtr cr, string utf8)624 internal static extern void cairo_show_text (IntPtr cr, string utf8); 625 626 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_status(IntPtr cr)627 internal static extern Status cairo_status (IntPtr cr); 628 629 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_status_to_string(Status status)630 internal static extern IntPtr cairo_status_to_string (Status status); 631 632 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_stroke(IntPtr cr)633 internal static extern void cairo_stroke (IntPtr cr); 634 635 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_stroke_extents(IntPtr cr, out double x1, out double y1, out double x2, out double y2)636 internal static extern void cairo_stroke_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2); 637 638 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_stroke_preserve(IntPtr cr)639 internal static extern void cairo_stroke_preserve (IntPtr cr); 640 641 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_rectangle_list_destroy(IntPtr rectangle_list)642 internal static extern void cairo_rectangle_list_destroy (IntPtr rectangle_list); 643 644 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_copy_clip_rectangle_list(IntPtr cr)645 internal static extern IntPtr cairo_copy_clip_rectangle_list (IntPtr cr); 646 647 // Surface 648 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_create_similar(IntPtr surface, Cairo.Content content, int width, int height)649 internal static extern IntPtr cairo_surface_create_similar (IntPtr surface, Cairo.Content content, int width, int height); 650 651 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_destroy(IntPtr surface)652 internal static extern void cairo_surface_destroy (IntPtr surface); 653 654 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_finish(IntPtr surface)655 internal static extern void cairo_surface_finish (IntPtr surface); 656 657 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_flush(IntPtr surface)658 internal static extern void cairo_surface_flush (IntPtr surface); 659 660 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_get_content(IntPtr surface)661 internal static extern Content cairo_surface_get_content (IntPtr surface); 662 663 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_get_device_offset(IntPtr surface, out double x, out double y)664 internal static extern void cairo_surface_get_device_offset (IntPtr surface, out double x, out double y); 665 666 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_get_font_options(IntPtr surface, IntPtr FontOptions)667 internal static extern void cairo_surface_get_font_options (IntPtr surface, IntPtr FontOptions); 668 669 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_get_type(IntPtr surface)670 internal static extern SurfaceType cairo_surface_get_type (IntPtr surface); 671 672 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_mark_dirty(IntPtr surface)673 internal static extern void cairo_surface_mark_dirty (IntPtr surface); 674 675 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_mark_dirty_rectangle(IntPtr surface, int x, int y, int width, int height)676 internal static extern void cairo_surface_mark_dirty_rectangle (IntPtr surface, int x, int y, int width, int height); 677 678 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_reference(IntPtr surface)679 internal static extern IntPtr cairo_surface_reference (IntPtr surface); 680 681 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_set_device_offset(IntPtr surface, double x, double y)682 internal static extern void cairo_surface_set_device_offset (IntPtr surface, double x, double y); 683 684 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_set_fallback_resolution(IntPtr surface, double x, double y)685 internal static extern void cairo_surface_set_fallback_resolution (IntPtr surface, double x, double y); 686 687 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_status(IntPtr surface)688 internal static extern Status cairo_surface_status (IntPtr surface); 689 690 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_surface_write_to_png(IntPtr surface, string filename)691 internal static extern void cairo_surface_write_to_png (IntPtr surface, string filename); 692 693 //[DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 694 //internal static extern void cairo_surface_write_to_png_stream (IntPtr surface, WriteFunc writeFunc); 695 696 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_svg_surface_create(string fileName, double width, double height)697 internal static extern IntPtr cairo_svg_surface_create (string fileName, double width, double height); 698 699 //[DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] 700 //internal static extern IntPtr cairo_svg_surface_create_for_stream (double width, double height); 701 702 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_svg_surface_restrict_to_version(IntPtr surface, SvgVersion version)703 internal static extern IntPtr cairo_svg_surface_restrict_to_version (IntPtr surface, SvgVersion version); 704 705 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_text_extents(IntPtr cr, string utf8, out TextExtents extents)706 internal static extern void cairo_text_extents (IntPtr cr, string utf8, out TextExtents extents); 707 708 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_text_path(IntPtr ct, string utf8)709 internal static extern void cairo_text_path (IntPtr ct, string utf8); 710 711 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_transform(IntPtr cr, Matrix matrix)712 internal static extern void cairo_transform (IntPtr cr, Matrix matrix); 713 714 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_translate(IntPtr cr, double tx, double ty)715 internal static extern void cairo_translate (IntPtr cr, double tx, double ty); 716 717 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_user_to_device(IntPtr cr, ref double x, ref double y)718 internal static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y); 719 720 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_user_to_device_distance(IntPtr cr, ref double dx, ref double dy)721 internal static extern void cairo_user_to_device_distance (IntPtr cr, ref double dx, ref double dy); 722 723 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_version()724 internal static extern int cairo_version (); 725 726 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_version_string()727 internal static extern IntPtr cairo_version_string (); 728 729 // DirectFBSurface 730 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_directfb_surface_create(IntPtr dfb, IntPtr surface)731 internal static extern IntPtr cairo_directfb_surface_create (IntPtr dfb, IntPtr surface); 732 733 // win32 fonts 734 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_win32_font_face_create_for_logfontw(IntPtr logfontw)735 internal static extern IntPtr cairo_win32_font_face_create_for_logfontw (IntPtr logfontw); 736 737 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_win32_scaled_font_done_font(IntPtr scaled_font)738 internal static extern void cairo_win32_scaled_font_done_font (IntPtr scaled_font); 739 740 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_win32_scaled_font_get_metrics_factor(IntPtr scaled_font)741 internal static extern double cairo_win32_scaled_font_get_metrics_factor (IntPtr scaled_font); 742 743 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_win32_scaled_font_select_font(IntPtr scaled_font, IntPtr hdc)744 internal static extern Status cairo_win32_scaled_font_select_font (IntPtr scaled_font, IntPtr hdc); 745 746 // win32 surface 747 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_win32_surface_create(IntPtr hdc)748 internal static extern IntPtr cairo_win32_surface_create (IntPtr hdc); 749 750 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_win32_surface_create_with_ddb(IntPtr hdc, Format format, int width, int height)751 internal static extern IntPtr cairo_win32_surface_create_with_ddb (IntPtr hdc, Format format, int width, int height); 752 753 // XcbSurface 754 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xcb_surface_create(IntPtr connection, uint drawable, IntPtr visual, int width, int height)755 internal static extern IntPtr cairo_xcb_surface_create (IntPtr connection, uint drawable, IntPtr visual, int width, int height); 756 757 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xcb_surface_create_for_bitmap(IntPtr connection, uint bitmap, IntPtr screen, int width, int height)758 internal static extern IntPtr cairo_xcb_surface_create_for_bitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height); 759 760 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xcb_surface_set_size(IntPtr surface, int width, int height)761 internal static extern void cairo_xcb_surface_set_size (IntPtr surface, int width, int height); 762 763 // XlibSurface 764 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_create(IntPtr display, IntPtr drawable, IntPtr visual, int width, int height)765 internal static extern IntPtr cairo_xlib_surface_create (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height); 766 767 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_create_for_bitmap(IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height)768 internal static extern IntPtr cairo_xlib_surface_create_for_bitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height); 769 770 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_get_depth(IntPtr surface)771 internal static extern int cairo_xlib_surface_get_depth (IntPtr surface); 772 773 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_get_display(IntPtr surface)774 internal static extern IntPtr cairo_xlib_surface_get_display (IntPtr surface); 775 776 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_get_drawable(IntPtr surface)777 internal static extern IntPtr cairo_xlib_surface_get_drawable (IntPtr surface); 778 779 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_get_height(IntPtr surface)780 internal static extern int cairo_xlib_surface_get_height (IntPtr surface); 781 782 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_get_screen(IntPtr surface)783 internal static extern IntPtr cairo_xlib_surface_get_screen (IntPtr surface); 784 785 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_get_visual(IntPtr surface)786 internal static extern IntPtr cairo_xlib_surface_get_visual (IntPtr surface); 787 788 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_get_width(IntPtr surface)789 internal static extern int cairo_xlib_surface_get_width (IntPtr surface); 790 791 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_set_drawable(IntPtr surface, IntPtr drawable, int width, int height)792 internal static extern void cairo_xlib_surface_set_drawable (IntPtr surface, IntPtr drawable, int width, int height); 793 794 [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)] cairo_xlib_surface_set_size(IntPtr surface, int width, int height)795 internal static extern void cairo_xlib_surface_set_size (IntPtr surface, int width, int height); 796 } 797 } 798