Advertisement
rotrevrep

cairo(-gobject).vapi

Apr 18th, 2017
3,771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 35.37 KB | None | 0 0
  1. /* cairo.vala
  2.  *
  3.  * Copyright (C) 2006-2009  Jürg Billeter
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Lesser General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2.1 of the License, or (at your option) any later version.
  9.  
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * Lesser General Public License for more details.
  14.  
  15.  * You should have received a copy of the GNU Lesser General Public
  16.  * License along with this library; if not, write to the Free Software
  17.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  18.  *
  19.  * Author:
  20.  *  Jürg Billeter <j@bitron.ch>
  21.  */
  22.  
  23. [CCode (cheader_filename = "cairo.h,cairo-gobject.h", gir_namespace = "cairo", gir_version = "1.0")]
  24. namespace Cairo {
  25.     [CCode (lower_case_cprefix = "CAIRO_MIME_TYPE_")]
  26.     namespace MimeType {
  27.         public const string JBIG2;
  28.         public const string JBIG2_GLOBAL;
  29.         public const string JBIG2_GLOBAL_ID;
  30.         public const string JP2;
  31.         public const string JPEG;
  32.         public const string PNG;
  33.         public const string UNIQUE_ID;
  34.         public const string URI;
  35.     }
  36.     [CCode (cname = "cairo_t", cprefix = "cairo_", ref_function = "cairo_reference", unref_function = "cairo_destroy")]
  37.     [Compact]
  38.     public class Context {
  39.         [CCode (cname = "cairo_create")]
  40.         public Context (Cairo.Surface target);
  41.         public void append_path (Cairo.Path path);
  42.         public void arc (double xc, double yc, double radius, double angle1, double angle2);
  43.         public void arc_negative (double xc, double yc, double radius, double angle1, double angle2);
  44.         public void clip ();
  45.         public void clip_extents (out double x1, out double y1, out double x2, out double y2);
  46.         public void clip_preserve ();
  47.         public void close_path ();
  48.         public Cairo.RectangleList copy_clip_rectangle_list ();
  49.         public void copy_page ();
  50.         public Cairo.Path copy_path ();
  51.         public Cairo.Path copy_path_flat ();
  52.         public void curve_to (double x1, double y1, double x2, double y2, double x3, double y3);
  53.         public void device_to_user (ref double x, ref double y);
  54.         public void device_to_user_distance (ref double dx, ref double dy);
  55.         public void fill ();
  56.         public void fill_extents (out double x1, out double y1, out double x2, out double y2);
  57.         public void fill_preserve ();
  58.         public void font_extents (out Cairo.FontExtents extents);
  59.         public Cairo.Antialias get_antialias ();
  60.         public void get_current_point (out double x, out double y);
  61.         public void get_dash (double[]? dashes, double[]? offset);
  62.         public int get_dash_count ();
  63.         public Cairo.FillRule get_fill_rule ();
  64.         public unowned Cairo.FontFace get_font_face ();
  65.         public void get_font_matrix (out Cairo.Matrix matrix);
  66.         public void get_font_options (out Cairo.FontOptions options);
  67.         public unowned Cairo.Surface get_group_target ();
  68.         public Cairo.LineCap get_line_cap ();
  69.         public Cairo.LineJoin get_line_join ();
  70.         public double get_line_width ();
  71.         public Cairo.Matrix get_matrix ();
  72.         public double get_miter_limit ();
  73.         public Cairo.Operator get_operator ();
  74.         public uint get_reference_count ();
  75.         public unowned Cairo.ScaledFont get_scaled_font ();
  76.         public unowned Cairo.Pattern get_source ();
  77.         public unowned Cairo.Surface get_target ();
  78.         public double get_tolerance ();
  79.         public void glyph_extents (Cairo.Glyph[] glyphs, out Cairo.TextExtents extents);
  80.         public void glyph_path (Cairo.Glyph[] glyphs);
  81.         public bool has_current_point ();
  82.         public void identity_matrix ();
  83.         public bool in_clip (double x, double y);
  84.         public bool in_fill (double x, double y);
  85.         public bool in_stroke (double x, double y);
  86.         public void line_to (double x, double y);
  87.         public void mask (Cairo.Pattern pattern);
  88.         public void mask_surface (Cairo.Surface surface, double surface_x, double surface_y);
  89.         public void move_to (double x, double y);
  90.         public void new_path ();
  91.         public void new_sub_path ();
  92.         public void paint ();
  93.         public void paint_with_alpha (double alpha);
  94.         public void path_extents (out double x1, out double y1, out double x2, out double y2);
  95.         public Cairo.Pattern pop_group ();
  96.         public void pop_group_to_source ();
  97.         public void push_group ();
  98.         public void push_group_with_content (Cairo.Content content);
  99.         public void rectangle (double x, double y, double width, double height);
  100.         public void rel_curve_to (double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
  101.         public void rel_line_to (double dx, double dy);
  102.         public void rel_move_to (double dx, double dy);
  103.         public void reset_clip ();
  104.         public void restore ();
  105.         public void rotate (double angle);
  106.         public void save ();
  107.         public void scale (double sx, double sy);
  108.         public void select_font_face (string family, Cairo.FontSlant slant, Cairo.FontWeight weight);
  109.         public void set_antialias (Cairo.Antialias antialias);
  110.         public void set_dash (double[]? dashes, double offset);
  111.         public void set_fill_rule (Cairo.FillRule fill_rule);
  112.         public void set_font_face (Cairo.FontFace font_face);
  113.         public void set_font_matrix (Cairo.Matrix matrix);
  114.         public void set_font_options (Cairo.FontOptions options);
  115.         public void set_font_size (double size);
  116.         public void set_line_cap (Cairo.LineCap line_cap);
  117.         public void set_line_join (Cairo.LineJoin line_join);
  118.         public void set_line_width (double width);
  119.         public void set_matrix (Cairo.Matrix matrix);
  120.         public void set_miter_limit (double limit);
  121.         public void set_operator (Cairo.Operator op);
  122.         public void set_scaled_font (Cairo.ScaledFont font);
  123.         public void set_source (Cairo.Pattern source);
  124.         public void set_source_rgb (double red, double green, double blue);
  125.         public void set_source_rgba (double red, double green, double blue, double alpha);
  126.         public void set_source_surface (Cairo.Surface surface, double x, double y);
  127.         public void set_tolerance (double tolerance);
  128.         public void show_glyphs (Cairo.Glyph[] glyphs);
  129.         public void show_page ();
  130.         public void show_text (string utf8);
  131.         public Cairo.Status show_text_glyphs (string utf8, int utf8_len, Cairo.Glyph[] glyphs, Cairo.TextCluster[] clusters, out Cairo.TextClusterFlags cluster_flags);
  132.         public Cairo.Status status ();
  133.         public void stroke ();
  134.         public void stroke_extents (out double x1, out double y1, out double x2, out double y2);
  135.         public void stroke_preserve ();
  136.         public void text_extents (string utf8, out Cairo.TextExtents extents);
  137.         public void text_path (string utf8);
  138.         public void transform (Cairo.Matrix matrix);
  139.         public void translate (double tx, double ty);
  140.         public void user_to_device (ref double x, ref double y);
  141.         public void user_to_device_distance (ref double dx, ref double dy);
  142.     }
  143.     [CCode (cname = "cairo_device_t", ref_function = "cairo_device_reference", unref_function = "cairo_device_destroy")]
  144.     [Compact]
  145.     public class Device {
  146.         public Cairo.Status acquire ();
  147.         public void finish ();
  148.         public void flush ();
  149.         public uint get_reference_count ();
  150.         public Cairo.DeviceType get_type ();
  151.         public void release ();
  152.         public Cairo.Status status ();
  153.     }
  154.     [CCode (cname = "cairo_device_t", ref_function = "cairo_device_reference", unref_function = "cairo_device_destroy")]
  155.     [Compact]
  156.     public class DeviceObserver {
  157.         protected DeviceObserver ();
  158.         public double elapsed ();
  159.         public double fill_elapsed ();
  160.         public double glyphs_elapsed ();
  161.         public double mask_elapsed ();
  162.         public double paint_elapsed ();
  163.         public Cairo.Status print (Cairo.WriteFunc write_func);
  164.         public double stroke_elapsed ();
  165.     }
  166.     [CCode (cname = "cairo_font_face_t", ref_function = "cairo_font_face_reference", unref_function = "cairo_font_face_destroy")]
  167.     [Compact]
  168.     public class FontFace {
  169.         public uint get_reference_count ();
  170.         public Cairo.FontType get_type ();
  171.         public Cairo.Status status ();
  172.     }
  173.     [CCode (cname = "cairo_font_options_t", copy_function = "cairo_font_options_copy", free_function = "cairo_font_options_destroy")]
  174.     [Compact]
  175.     public class FontOptions {
  176.         [CCode (cname = "cairo_font_options_create")]
  177.         public FontOptions ();
  178.         public bool equal (Cairo.FontOptions other);
  179.         public Cairo.Antialias get_antialias ();
  180.         public Cairo.HintMetrics get_hint_metrics ();
  181.         public Cairo.HintStyle get_hint_style ();
  182.         public Cairo.SubpixelOrder get_subpixel_order ();
  183.         public ulong hash ();
  184.         public void merge (Cairo.FontOptions other);
  185.         public void set_antialias (Cairo.Antialias antialias);
  186.         public void set_hint_metrics (Cairo.HintMetrics hint_metrics);
  187.         public void set_hint_style (Cairo.HintStyle hint_style);
  188.         public void set_subpixel_order (Cairo.SubpixelOrder subpixel_order);
  189.         public Cairo.Status status ();
  190.     }
  191.     [CCode (cname = "cairo_surface_t")]
  192.     [Compact]
  193.     public class ImageSurface : Cairo.Surface {
  194.         [CCode (cname = "cairo_image_surface_create")]
  195.         public ImageSurface (Cairo.Format format, int width, int height);
  196.         [CCode (cname = "cairo_image_surface_create_for_data")]
  197.         public ImageSurface.for_data ([CCode (array_length = false)] uchar[] data, Cairo.Format format, int width, int height, int stride);
  198.         [CCode (cname = "cairo_image_surface_create_from_png")]
  199.         public ImageSurface.from_png (string filename);
  200.         [CCode (cname = "cairo_image_surface_create_from_png_stream")]
  201.         public ImageSurface.from_png_stream (Cairo.ReadFunc read_func);
  202.         [CCode (array_length = false)]
  203.         public unowned uchar[] get_data ();
  204.         public Cairo.Format get_format ();
  205.         public int get_height ();
  206.         public int get_stride ();
  207.         public int get_width ();
  208.     }
  209.     [CCode (cname = "cairo_pattern_t", ref_function = "cairo_pattern_reference", unref_function = "cairo_pattern_destroy")]
  210.     [Compact]
  211.     public class MeshPattern : Cairo.Pattern {
  212.         [CCode (cname = "cairo_pattern_create_mesh")]
  213.         public MeshPattern ();
  214.         public void begin_patch ();
  215.         public void curve_to (double x1, double y1, double x2, double y2, double x3, double y3);
  216.         public void end_patch ();
  217.         public Cairo.Status get_control_point (uint patch_num, uint point_num, out double x, out double y);
  218.         public Cairo.Status get_corner_color_rgba (uint patch_num, uint corner_num, out double red, out double green, out double blue, out double alpha);
  219.         public Cairo.Status get_patch_count (out uint count);
  220.         public Cairo.Path get_path (uint patch_num);
  221.         public void line_to (double x, double y);
  222.         public void move_to (double x, double y);
  223.         public void set_control_point (uint point_num, double x, double y);
  224.         public void set_corner_color_rgb (uint corner_num, double red, double green, double blue);
  225.         public void set_corner_color_rgba (uint corner_num, double red, double green, double blue, double alpha);
  226.     }
  227.     [CCode (cname = "cairo_path_t", free_function = "cairo_path_destroy")]
  228.     [Compact]
  229.     public class Path {
  230.         [CCode (array_length = false)]
  231.         public Cairo.PathData[] data;
  232.         public int num_data;
  233.         public Cairo.Status status;
  234.     }
  235.     [CCode (cname = "cairo_pattern_t", ref_function = "cairo_pattern_reference", unref_function = "cairo_pattern_destroy")]
  236.     [Compact]
  237.     public class Pattern {
  238.         public void add_color_stop_rgb (double offset, double red, double green, double blue);
  239.         public void add_color_stop_rgba (double offset, double red, double green, double blue, double alpha);
  240.         [CCode (cname = "cairo_pattern_create_for_surface")]
  241.         public Pattern.for_surface (Cairo.Surface surface);
  242.         public Cairo.Status get_color_stop_count (out int count);
  243.         public Cairo.Status get_color_stop_rgba (int index, out double offset, out double red, out double green, out double blue, out double alpha);
  244.         public Cairo.Extend get_extend ();
  245.         public Cairo.Filter get_filter ();
  246.         public Cairo.Status get_linear_points (out double x0, out double y0, out double x1, out double y1);
  247.         public void get_matrix (out Cairo.Matrix matrix);
  248.         public Cairo.Status get_surface (out unowned Cairo.Surface surface);
  249.         public Cairo.PatternType get_type ();
  250.         [CCode (cname = "cairo_pattern_create_linear")]
  251.         public Pattern.linear (double x0, double y0, double x1, double y1);
  252.         [CCode (cname = "cairo_pattern_create_radial")]
  253.         public Pattern.radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1);
  254.         [CCode (cname = "cairo_pattern_create_rgb")]
  255.         public Pattern.rgb (double red, double green, double blue);
  256.         [CCode (cname = "cairo_pattern_create_rgba")]
  257.         public Pattern.rgba (double red, double green, double blue, double alpha);
  258.         public void set_extend (Cairo.Extend extend);
  259.         public void set_filter (Cairo.Filter filter);
  260.         public void set_matrix (Cairo.Matrix matrix);
  261.         public Cairo.Status status ();
  262.     }
  263.     [CCode (cheader_filename = "cairo-pdf.h", cname = "cairo_surface_t")]
  264.     [Compact]
  265.     public class PdfSurface : Cairo.Surface {
  266.         [CCode (cname = "cairo_pdf_surface_create")]
  267.         public PdfSurface (string? filename, double width_in_points, double height_in_points);
  268.         [CCode (cname = "cairo_pdf_surface_create_for_stream")]
  269.         public PdfSurface.for_stream (Cairo.WriteFunc write_func, double width_in_points, double height_in_points);
  270.         public void restrict_to_version (Cairo.PdfVersion version);
  271.         public void set_size (double width_in_points, double height_in_points);
  272.     }
  273.     [CCode (cheader_filename = "cairo-ps.h", cname = "cairo_surface_t")]
  274.     [Compact]
  275.     public class PsSurface : Cairo.Surface {
  276.         [CCode (cname = "cairo_ps_surface_create")]
  277.         public PsSurface (string filename, double width_in_points, double height_in_points);
  278.         public void dsc_begin_page_setup ();
  279.         public void dsc_begin_setup ();
  280.         public void dsc_comment (string comment);
  281.         [CCode (cname = "cairo_ps_surface_create_for_stream")]
  282.         public PsSurface.for_stream (Cairo.WriteFunc write_func, double width_in_points, double height_in_points);
  283.         public bool get_eps ();
  284.         public static void get_levels (out unowned Cairo.PsLevel[] levels);
  285.         public void restrict_to_level (Cairo.PsLevel level);
  286.         public void set_eps (bool eps);
  287.         public void set_size (double width_in_points, double height_in_points);
  288.     }
  289.     [CCode (cname = "cairo_pattern_t", ref_function = "cairo_pattern_reference", unref_function = "cairo_pattern_destroy")]
  290.     [Compact]
  291.     public class RasterSourcePattern : Cairo.Pattern {
  292.         [CCode (cname = "cairo_pattern_create_raster_source")]
  293.         public RasterSourcePattern ();
  294.         public void get_acquire (out Cairo.RasterSourceAcquireFunc acquire, out Cairo.RasterSourceReleaseFunc release);
  295.         public void* get_callback_data ();
  296.         public Cairo.RasterSourceCopyFunc get_copy ();
  297.         public Cairo.RasterSourceFinishFunc get_finish ();
  298.         public Cairo.RasterSourceSnapshotFunc get_snapshot ();
  299.         public void set_acquire (Cairo.RasterSourceAcquireFunc acquire, Cairo.RasterSourceReleaseFunc release);
  300.         public void set_callback_data (void* data);
  301.         public void set_copy (Cairo.RasterSourceCopyFunc copy);
  302.         public void set_finish (Cairo.RasterSourceFinishFunc finish);
  303.         public void set_snapshot (Cairo.RasterSourceSnapshotFunc snapshot);
  304.     }
  305.     [CCode (cname = "cairo_surface_t")]
  306.     [Compact]
  307.     public class RecordingSurface : Cairo.Surface {
  308.         [CCode (cname = "cairo_recording_surface_create")]
  309.         public RecordingSurface (Cairo.Content content, Cairo.Rectangle? extents = null);
  310.         public bool get_extents (out Cairo.Rectangle extents);
  311.         public void ink_extents (out double x0, out double y0, out double width, out double height);
  312.     }
  313.     [CCode (cname = "cairo_rectangle_list_t", free_function = "cairo_rectangle_list_destroy")]
  314.     [Compact]
  315.     public class RectangleList {
  316.         [CCode (array_length_cname = "num_rectangles")]
  317.         public Cairo.Rectangle[] rectangles;
  318.         public Cairo.Status status;
  319.     }
  320.     [CCode (cname = "cairo_region_t", ref_function = "cairo_region_reference", unref_function = "cairo_region_destroy")]
  321.     [Compact]
  322.     public class Region {
  323.         [CCode (cname = "cairo_region_create")]
  324.         public Region ();
  325.         public bool contains_point (int x, int y);
  326.         public Cairo.RegionOverlap contains_rectangle (Cairo.RectangleInt rectangle);
  327.         public Cairo.Region copy ();
  328.         public bool equal (Cairo.Region other);
  329.         public Cairo.RectangleInt get_extents ();
  330.         public Cairo.RectangleInt get_rectangle (int nth);
  331.         public Cairo.Status intersect (Cairo.Region other);
  332.         public Cairo.Status intersect_rectangle (Cairo.RectangleInt rectangle);
  333.         public bool is_empty ();
  334.         public int num_rectangles ();
  335.         [CCode (cname = "cairo_region_create_rectangle")]
  336.         public Region.rectangle (Cairo.RectangleInt rectangle);
  337.         [CCode (cname = "cairo_region_create_rectangles")]
  338.         public Region.rectangles (Cairo.RectangleInt[] rects);
  339.         public Cairo.Status status ();
  340.         public Cairo.Status subtract (Cairo.Region other);
  341.         public Cairo.Status subtract_rectangle (Cairo.RectangleInt rectangle);
  342.         public void translate (int dx, int dy);
  343.         public Cairo.Status union (Cairo.Region other);
  344.         public Cairo.Status union_rectangle (Cairo.RectangleInt rectangle);
  345.         public Cairo.Status xor (Cairo.Region other);
  346.         public Cairo.Status xor_rectangle (Cairo.RectangleInt rectangle);
  347.     }
  348.     [CCode (cname = "cairo_scaled_font_t", ref_function = "cairo_scaled_font_reference", unref_function = "cairo_scaled_font_destroy")]
  349.     [Compact]
  350.     public class ScaledFont {
  351.         [CCode (cname = "cairo_scaled_font_create")]
  352.         public ScaledFont (Cairo.FontFace font_face, Cairo.Matrix font_matrix, Cairo.Matrix ctm, Cairo.FontOptions options);
  353.         public void extents (out Cairo.FontExtents extents);
  354.         public void get_ctm (out Cairo.Matrix ctm);
  355.         public unowned Cairo.FontFace get_font_face ();
  356.         public void get_font_matrix (out Cairo.Matrix font_matrix);
  357.         public void get_font_options (out Cairo.FontOptions options);
  358.         public uint get_reference_count ();
  359.         public void get_scale_matrix (out Cairo.Matrix scale_matrix);
  360.         public Cairo.FontType get_type ();
  361.         public void glyph_extents (Cairo.Glyph[] glyphs, out Cairo.TextExtents extents);
  362.         public Cairo.Status status ();
  363.         public void text_extents (string utf8, out Cairo.TextExtents extents);
  364.         public Cairo.Status text_to_glyphs (double x, double y, string utf8, int utf8_len, out Cairo.Glyph[] glyphs, out Cairo.TextCluster[] clusters, out Cairo.TextClusterFlags cluster_flags);
  365.         [CCode (cname = "cairo_win32_scaled_font_get_device_to_logical")]
  366.         public Cairo.Matrix win32_get_device_to_logical ();
  367.         [CCode (cname = "cairo_win32_scaled_font_get_logical_to_device")]
  368.         public Cairo.Matrix win32_get_logical_to_device ();
  369.     }
  370.     [CCode (cname = "cairo_device_t", ref_function = "cairo_device_reference", unref_function = "cairo_device_destroy")]
  371.     [Compact]
  372.     public class Script : Cairo.Device {
  373.         [CCode (cname = "cairo_script_create")]
  374.         public Script (string filename);
  375.         [CCode (cname = "cairo_script_create_for_stream")]
  376.         public Script.for_stream (Cairo.WriteFunc write_func);
  377.         [CCode (cname = "cairo_script_from_recording_surface")]
  378.         public Script.from_recording_surface ([CCode (type = "cairo_surface_t")] Cairo.RecordingSurface recording_surface);
  379.         public Cairo.ScriptMode get_mode ();
  380.         public void set_mode (Cairo.ScriptMode mode);
  381.         public void write_comment (string comment, int len = -1);
  382.     }
  383.     [CCode (cheader_filename = "cairo-svg.h", cname = "cairo_surface_t")]
  384.     [Compact]
  385.     public class ScriptSurface : Cairo.Surface {
  386.         [CCode (cname = "cairo_script_surface_create")]
  387.         public ScriptSurface (Cairo.Script script, Cairo.Content content, double width, double height);
  388.         [CCode (cname = "cairo_script_surface_create_for_target")]
  389.         public ScriptSurface.for_target (Cairo.Script script, Cairo.Surface target);
  390.     }
  391.     [CCode (cname = "cairo_surface_t", ref_function = "cairo_surface_reference", unref_function = "cairo_surface_destroy", type_id = "CAIRO_GOBJECT_TYPE_SURFACE")]
  392.     [Compact]
  393.     public class Surface {
  394.         public void copy_page ();
  395.         public void finish ();
  396.         public void flush ();
  397.         [CCode (cname = "cairo_surface_create_for_rectangle")]
  398.         public Surface.for_rectangle (Cairo.Surface target, double x, double y, double width, double height);
  399.         public Cairo.Content get_content ();
  400.         public Cairo.Device get_device ();
  401.         public void get_device_offset (out double x_offset, out double y_offset);
  402.         public void get_device_scale (out double x_scale, out double y_scale);
  403.         public void get_fallback_resolution (out double x_pixels_per_inch, out double y_pixels_per_inch);
  404.         public void get_font_options (out Cairo.FontOptions options);
  405.         public uint get_reference_count ();
  406.         public Cairo.SurfaceType get_type ();
  407.         public bool has_show_text_glyphs ();
  408.         public Cairo.Surface map_to_image (Cairo.RectangleInt extents);
  409.         public void mark_dirty ();
  410.         public void mark_dirty_rectangle (int x, int y, int width, int height);
  411.         public void set_device_offset (double x_offset, double y_offset);
  412.         public void set_device_scale (double x_scale, double y_scale);
  413.         public void set_fallback_resolution (double x_pixels_per_inch, double y_pixels_per_inch);
  414.         public void show_page ();
  415.         [CCode (cname = "cairo_surface_create_similar")]
  416.         public Surface.similar (Cairo.Surface other, Cairo.Content content, int width, int height);
  417.         [CCode (cname = "cairo_surface_create_similar_image")]
  418.         public Surface.similar_image (Cairo.Surface other, Cairo.Format format, int width, int height);
  419.         public Cairo.Status status ();
  420.         public bool supports_mime_type (string mime_type);
  421.         public void unmap_image (Cairo.Surface image);
  422.         [CCode (cname = "cairo_win32_surface_get_image")]
  423.         public Cairo.Surface? win32_get_image ();
  424.         public Cairo.Status write_to_png (string filename);
  425.         public Cairo.Status write_to_png_stream (Cairo.WriteFunc write_func);
  426.     }
  427.     [CCode (cname = "cairo_surface_t", ref_function = "cairo_surface_reference", unref_function = "cairo_surface_destroy")]
  428.     [Compact]
  429.     public class SurfaceObserver {
  430.         [CCode (cname = "cairo_surface_create_observer")]
  431.         public SurfaceObserver (Cairo.Surface target, Cairo.SurfaceObserverMode mode);
  432.         public Cairo.Status add_fill_callback (Cairo.SurfaceObserverCallback func);
  433.         public Cairo.Status add_finish_callback (Cairo.SurfaceObserverCallback func);
  434.         public Cairo.Status add_flush_callback (Cairo.SurfaceObserverCallback func);
  435.         public Cairo.Status add_glyphs_callback (Cairo.SurfaceObserverCallback func);
  436.         public Cairo.Status add_mask_callback (Cairo.SurfaceObserverCallback func);
  437.         public Cairo.Status add_paint_callback (Cairo.SurfaceObserverCallback func);
  438.         public Cairo.Status add_stroke_callback (Cairo.SurfaceObserverCallback func);
  439.         public double elapsed ();
  440.         public Cairo.Status print (Cairo.WriteFunc write_func);
  441.     }
  442.     [CCode (cheader_filename = "cairo-svg.h", cname = "cairo_surface_t")]
  443.     [Compact]
  444.     public class SvgSurface : Cairo.Surface {
  445.         [CCode (cname = "cairo_svg_surface_create")]
  446.         public SvgSurface (string filename, double width_in_points, double height_in_points);
  447.         [CCode (cname = "cairo_svg_surface_create_for_stream")]
  448.         public SvgSurface.for_stream (Cairo.WriteFunc write_func, double width_in_points, double height_in_points);
  449.         public void restrict_to_version (Cairo.SvgVersion version);
  450.     }
  451.     [CCode (cname = "cairo_font_face_t", ref_function = "cairo_font_face_reference", unref_function = "cairo_font_face_destroy")]
  452.     [Compact]
  453.     public class ToyFontFace : Cairo.FontFace {
  454.         [CCode (cname = "cairo_toy_font_face_create")]
  455.         public ToyFontFace (string family, Cairo.FontSlant slant, Cairo.FontWeight weight);
  456.         public unowned string get_family ();
  457.         public Cairo.FontSlant get_slant ();
  458.         public Cairo.FontWeight get_weight ();
  459.     }
  460.     [CCode (cname = "cairo_font_face_t", ref_function = "cairo_font_face_reference", unref_function = "cairo_font_face_destroy")]
  461.     [Compact]
  462.     public class UserFontFace : Cairo.FontFace {
  463.         [CCode (cname = "cairo_user_font_face_create")]
  464.         public UserFontFace ();
  465.         public Cairo.UserScaledFontInitFunc get_init_func ();
  466.         public Cairo.UserScaledFontRenderGlyphFunc get_render_glyph_func ();
  467.         public Cairo.UserScaledFontTextToGlyphsFunc get_text_to_glyphs_func ();
  468.         public Cairo.UserScaledFontUnicodeToGlyphFunc get_unicode_to_glyph_func ();
  469.         public void set_init_func (Cairo.UserScaledFontInitFunc init_func);
  470.         public void set_render_glyph_func (Cairo.UserScaledFontRenderGlyphFunc render_glyph_func);
  471.         public void set_text_to_glyphs_func (Cairo.UserScaledFontTextToGlyphsFunc text_to_glyphs_func);
  472.         public void set_unicode_to_glyph_func (Cairo.UserScaledFontUnicodeToGlyphFunc unicode_to_glyph_func);
  473.     }
  474.     [CCode (cname = "cairo_scaled_font_t", ref_function = "cairo_scaled_font_reference", unref_function = "cairo_scaled_font_destroy")]
  475.     [Compact]
  476.     public class UserScaledFont {
  477.     }
  478.     [CCode (cheader_filename = "cairo-xlib.h", cname = "cairo_surface_t")]
  479.     [Compact]
  480.     public class XlibSurface : Cairo.Surface {
  481.         [CCode (cname = "cairo_xlib_surface_create")]
  482.         public XlibSurface (void* dpy, int drawable, void* visual, int width, int height);
  483.         [CCode (cname = "cairo_xlib_surface_create_for_bitmap")]
  484.         public XlibSurface.for_bitmap (void* dpy, int bitmap, void* screen, int width, int height);
  485.         public int get_depth ();
  486.         public void* get_display ();
  487.         public int get_drawable ();
  488.         public int get_height ();
  489.         public void* get_screen ();
  490.         public void* get_visual ();
  491.         public int get_width ();
  492.         public void set_drawable (int drawable, int width, int height);
  493.         public void set_size (int width, int height);
  494.     }
  495.     [CCode (cname = "cairo_font_extents_t", has_type_id = false)]
  496.     public struct FontExtents {
  497.         public double ascent;
  498.         public double descent;
  499.         public double height;
  500.         public double max_x_advance;
  501.         public double max_y_advance;
  502.     }
  503.     [CCode (cname = "cairo_glyph_t", has_type_id = false)]
  504.     public struct Glyph {
  505.         public ulong index;
  506.         public double x;
  507.         public double y;
  508.     }
  509.     [CCode (cname = "cairo_matrix_t", has_type_id = false)]
  510.     public struct Matrix {
  511.         public double xx;
  512.         public double yx;
  513.         public double xy;
  514.         public double yy;
  515.         public double x0;
  516.         public double y0;
  517.         [CCode (cname = "cairo_matrix_init")]
  518.         public Matrix (double xx, double yx, double xy, double yy, double x0, double y0);
  519.         [CCode (cname = "cairo_matrix_init_identity")]
  520.         public Matrix.identity ();
  521.         public Cairo.Status invert ();
  522.         public void multiply (Cairo.Matrix a, Cairo.Matrix b);
  523.         public void rotate (double radians);
  524.         public void scale (double sx, double sy);
  525.         public void transform_distance (ref double dx, ref double dy);
  526.         public void transform_point (ref double x, ref double y);
  527.         public void translate (double tx, double ty);
  528.     }
  529.     [CCode (cname = "cairo_path_data_t", has_type_id = false)]
  530.     public struct PathData {
  531.         public Cairo.PathDataHeader header;
  532.         public Cairo.PathDataPoint point;
  533.     }
  534.     [CCode (cname = "struct { cairo_path_data_type_t type; int length; }", has_type_id = false)]
  535.     public struct PathDataHeader {
  536.         public Cairo.PathDataType type;
  537.         public int length;
  538.     }
  539.     [CCode (cname = "struct { double x, y; }", has_type_id = false)]
  540.     public struct PathDataPoint {
  541.         public double x;
  542.         public double y;
  543.     }
  544.     [CCode (cname = "cairo_rectangle_t", has_type_id = false)]
  545.     public struct Rectangle {
  546.         public double x;
  547.         public double y;
  548.         public double width;
  549.         public double height;
  550.     }
  551.     [CCode (cname = "cairo_rectangle_int_t", has_type_id = false)]
  552.     public struct RectangleInt {
  553.         public int x;
  554.         public int y;
  555.         public int width;
  556.         public int height;
  557.     }
  558.     [CCode (cname = "cairo_text_cluster_t", has_type_id = false)]
  559.     public struct TextCluster {
  560.         public int num_bytes;
  561.         public int num_glyphs;
  562.     }
  563.     [CCode (cname = "cairo_text_extents_t", has_type_id = false)]
  564.     public struct TextExtents {
  565.         public double x_bearing;
  566.         public double y_bearing;
  567.         public double width;
  568.         public double height;
  569.         public double x_advance;
  570.         public double y_advance;
  571.     }
  572.     [CCode (cname = "cairo_antialias_t", has_type_id = false)]
  573.     public enum Antialias {
  574.         DEFAULT,
  575.         NONE,
  576.         GRAY,
  577.         SUBPIXEL,
  578.         FAST,
  579.         GOOD,
  580.         BEST
  581.     }
  582.     [CCode (cname = "cairo_content_t", has_type_id = false)]
  583.     public enum Content {
  584.         COLOR,
  585.         ALPHA,
  586.         COLOR_ALPHA
  587.     }
  588.     [CCode (cname = "cairo_device_type_t", has_type_id = false)]
  589.     public enum DeviceType {
  590.         DRM,
  591.         GL,
  592.         SCRIPT,
  593.         XCB,
  594.         XLIB,
  595.         XML,
  596.         COGL,
  597.         WIN32
  598.     }
  599.     [CCode (cname = "cairo_extend_t", has_type_id = false)]
  600.     public enum Extend {
  601.         NONE,
  602.         REPEAT,
  603.         REFLECT,
  604.         PAD
  605.     }
  606.     [CCode (cname = "cairo_fill_rule_t", has_type_id = false)]
  607.     public enum FillRule {
  608.         WINDING,
  609.         EVEN_ODD
  610.     }
  611.     [CCode (cname = "cairo_filter_t", has_type_id = false)]
  612.     public enum Filter {
  613.         FAST,
  614.         GOOD,
  615.         BEST,
  616.         NEAREST,
  617.         BILINEAR,
  618.         GAUSSIAN
  619.     }
  620.     [CCode (cname = "cairo_font_slant_t", has_type_id = false)]
  621.     public enum FontSlant {
  622.         NORMAL,
  623.         ITALIC,
  624.         OBLIQUE
  625.     }
  626.     [CCode (cname = "cairo_font_type_t", has_type_id = false)]
  627.     public enum FontType {
  628.         TOY,
  629.         FT,
  630.         WIN32,
  631.         QUARTZ,
  632.         USER
  633.     }
  634.     [CCode (cname = "cairo_font_weight_t", has_type_id = false)]
  635.     public enum FontWeight {
  636.         NORMAL,
  637.         BOLD
  638.     }
  639.     [CCode (cname = "cairo_format_t", has_type_id = false)]
  640.     public enum Format {
  641.         ARGB32,
  642.         RGB24,
  643.         A8,
  644.         A1,
  645.         RGB16_565,
  646.         RGB30;
  647.         public int stride_for_width (int width);
  648.     }
  649.     [CCode (cname = "cairo_hint_metrics_t", has_type_id = false)]
  650.     public enum HintMetrics {
  651.         DEFAULT,
  652.         OFF,
  653.         ON
  654.     }
  655.     [CCode (cname = "cairo_hint_style_t", has_type_id = false)]
  656.     public enum HintStyle {
  657.         DEFAULT,
  658.         NONE,
  659.         SLIGHT,
  660.         MEDIUM,
  661.         FULL
  662.     }
  663.     [CCode (cname = "cairo_line_cap_t", has_type_id = false)]
  664.     public enum LineCap {
  665.         BUTT,
  666.         ROUND,
  667.         SQUARE
  668.     }
  669.     [CCode (cname = "cairo_line_join_t", has_type_id = false)]
  670.     public enum LineJoin {
  671.         MITER,
  672.         ROUND,
  673.         BEVEL
  674.     }
  675.     [CCode (cname = "cairo_operator_t", has_type_id = false)]
  676.     public enum Operator {
  677.         CLEAR,
  678.         SOURCE,
  679.         OVER,
  680.         IN,
  681.         OUT,
  682.         ATOP,
  683.         DEST,
  684.         DEST_OVER,
  685.         DEST_IN,
  686.         DEST_OUT,
  687.         DEST_ATOP,
  688.         XOR,
  689.         ADD,
  690.         SATURATE,
  691.         MULTIPLY,
  692.         SCREEN,
  693.         OVERLAY,
  694.         DARKEN,
  695.         LIGHTEN,
  696.         COLOR_DODGE,
  697.         COLOR_BURN,
  698.         HARD_LIGHT,
  699.         SOFT_LIGHT,
  700.         DIFFERENCE,
  701.         EXCLUSION,
  702.         HSL_HUE,
  703.         HSL_SATURATION,
  704.         HSL_COLOR,
  705.         HSL_LUMINOSITY
  706.     }
  707.     [CCode (cname = "cairo_path_data_type_t", cprefix = "CAIRO_PATH_", has_type_id = false)]
  708.     public enum PathDataType {
  709.         MOVE_TO,
  710.         LINE_TO,
  711.         CURVE_TO,
  712.         CLOSE_PATH
  713.     }
  714.     [CCode (cname = "cairo_pattern_type_t", has_type_id = false)]
  715.     public enum PatternType {
  716.         SOLID,
  717.         SURFACE,
  718.         LINEAR,
  719.         RADIAL,
  720.         MESH,
  721.         RASTER_SOURCE
  722.     }
  723.     [CCode (cname = "cairo_pdf_version_t", cprefix = "CAIRO_PDF_", has_type_id = false)]
  724.     public enum PdfVersion {
  725.         VERSION_1_4,
  726.         VERSION_1_5;
  727.         [CCode (cname = "cairo_pdf_version_to_string")]
  728.         public unowned string to_string ();
  729.         [CCode (cname = "cairo_pdf_get_versions")]
  730.         public static void get_versions (out unowned Cairo.PdfVersion[] versions);
  731.     }
  732.     [CCode (cname = "cairo_ps_level_t", cprefix = "CAIRO_PS_", has_type_id = false)]
  733.     public enum PsLevel {
  734.         LEVEL_2,
  735.         LEVEL_3;
  736.         [CCode (cname = "cairo_ps_level_to_string")]
  737.         public unowned string to_string ();
  738.         [CCode (cname = "cairo_ps_get_levels")]
  739.         public static void get_levels (out unowned Cairo.PsLevel[] levels);
  740.     }
  741.     [CCode (cname = "cairo_region_overlap_t", has_type_id = false)]
  742.     public enum RegionOverlap {
  743.         IN,
  744.         OUT,
  745.         PART
  746.     }
  747.     [CCode (cname = "cairo_script_mode_t", has_type_id = false)]
  748.     public enum ScriptMode {
  749.         ASCII,
  750.         BINARY
  751.     }
  752.     [CCode (cname = "cairo_status_t", has_type_id = false)]
  753.     public enum Status {
  754.         SUCCESS,
  755.         NO_MEMORY,
  756.         INVALID_RESTORE,
  757.         INVALID_POP_GROUP,
  758.         NO_CURRENT_POINT,
  759.         INVALID_MATRIX,
  760.         INVALID_STATUS,
  761.         NULL_POINTER,
  762.         INVALID_STRING,
  763.         INVALID_PATH_DATA,
  764.         READ_ERROR,
  765.         WRITE_ERROR,
  766.         SURFACE_FINISHED,
  767.         SURFACE_TYPE_MISMATCH,
  768.         PATTERN_TYPE_MISMATCH,
  769.         INVALID_CONTENT,
  770.         INVALID_FORMAT,
  771.         INVALID_VISUAL,
  772.         FILE_NOT_FOUND,
  773.         INVALID_DASH,
  774.         INVALID_DSC_COMMENT,
  775.         INVALID_INDEX,
  776.         CLIP_NOT_REPRESENTABLE,
  777.         TEMP_FILE_ERROR,
  778.         INVALID_STRIDE,
  779.         FONT_TYPE_MISMATCH,
  780.         USER_FONT_IMMUTABLE,
  781.         USER_FONT_ERROR,
  782.         NEGATIVE_COUNT,
  783.         INVALID_CLUSTERS,
  784.         INVALID_SLANT,
  785.         INVALID_WEIGHT,
  786.         INVALID_SIZE,
  787.         USER_FONT_NOT_IMPLEMENTED,
  788.         DEVICE_TYPE_MISMATCH,
  789.         DEVICE_ERROR,
  790.         INVALID_MESH_CONSTRUCTION,
  791.         DEVICE_FINISHED,
  792.         JBIG2_GLOBAL_MISSING,
  793.         PNG_ERROR,
  794.         FREETYPE_ERROR,
  795.         WIN32_GDI_ERROR;
  796.         [CCode (cname = "cairo_status_to_string")]
  797.         public unowned string to_string ();
  798.     }
  799.     [CCode (cname = "cairo_subpixel_order_t", has_type_id = false)]
  800.     public enum SubpixelOrder {
  801.         DEFAULT,
  802.         RGB,
  803.         BGR,
  804.         VRGB,
  805.         VBGR
  806.     }
  807.     [CCode (cname = "cairo_surface_observer_mode_t", has_type_id = false)]
  808.     public enum SurfaceObserverMode {
  809.         NORMAL,
  810.         RECORD_OPERATIONS
  811.     }
  812.     [CCode (cname = "cairo_surface_type_t", has_type_id = false)]
  813.     public enum SurfaceType {
  814.         IMAGE,
  815.         PDF,
  816.         PS,
  817.         XLIB,
  818.         XCB,
  819.         GLITZ,
  820.         QUARTZ,
  821.         WIN32,
  822.         BEOS,
  823.         DIRECTFB,
  824.         SVG,
  825.         OS2,
  826.         WIN32_PRINTING,
  827.         QUARTZ_IMAGE,
  828.         SCRIPT,
  829.         QT,
  830.         RECORDING,
  831.         VG,
  832.         GL,
  833.         DRM,
  834.         TEE,
  835.         XML,
  836.         SKIA,
  837.         SUBSURFACE,
  838.         COGL
  839.     }
  840.     [CCode (cname = "cairo_svg_version_t", cprefix = "CAIRO_SVG_", has_type_id = false)]
  841.     public enum SvgVersion {
  842.         VERSION_1_1,
  843.         VERSION_1_2;
  844.         [CCode (cname = "cairo_svg_version_to_string")]
  845.         public unowned string to_string ();
  846.         [CCode (cname = "cairo_svg_get_versions")]
  847.         public static void get_versions (out unowned Cairo.SvgVersion[] versions);
  848.     }
  849.     [CCode (cname = "cairo_text_cluster_flags_t", cprefix = "CAIRO_TEXT_CLUSTER_FLAG_", has_type_id = false)]
  850.     public enum TextClusterFlags {
  851.         BACKWARD
  852.     }
  853.     [CCode (cname = "cairo_raster_source_acquire_func_t", has_target = false)]
  854.     public delegate Cairo.Surface RasterSourceAcquireFunc (Cairo.Pattern pattern, void* callback_data, Cairo.Surface target, Cairo.RectangleInt? extents);
  855.     [CCode (cname = "cairo_raster_source_copy_func_t", has_target = false)]
  856.     public delegate Cairo.Status RasterSourceCopyFunc (Cairo.Pattern pattern, void* callback_data, Cairo.Pattern other_pattern);
  857.     [CCode (cname = "cairo_raster_source_finish_func_t", has_target = false)]
  858.     public delegate void RasterSourceFinishFunc (Cairo.Pattern pattern, void* callback_data);
  859.     [CCode (cname = "cairo_raster_source_release_func_t", has_target = false)]
  860.     public delegate void RasterSourceReleaseFunc (Cairo.Pattern pattern, void* callback_data, Cairo.Surface surface);
  861.     [CCode (cname = "cairo_raster_source_snapshot_func_t", has_target = false)]
  862.     public delegate Cairo.Status RasterSourceSnapshotFunc (Cairo.Pattern pattern, void* callback_data);
  863.     [CCode (cname = "cairo_read_func_t", instance_pos = 0)]
  864.     public delegate Cairo.Status ReadFunc (uchar[] data);
  865.     [CCode (cname = "cairo_surface_observer_callback_t", instance_pos = 2.9)]
  866.     public delegate void SurfaceObserverCallback (Cairo.SurfaceObserver observer, Cairo.Surface target);
  867.     [CCode (cname = "cairo_user_scaled_font_init_func_t", has_target = false)]
  868.     public delegate Cairo.Status UserScaledFontInitFunc (Cairo.UserScaledFont scaled_font, Cairo.Context cr, Cairo.FontExtents extents);
  869.     [CCode (cname = "cairo_user_scaled_font_render_glyph_func_t", has_target = false)]
  870.     public delegate Cairo.Status UserScaledFontRenderGlyphFunc (Cairo.UserScaledFont scaled_font, ulong glyph, Cairo.Context cr, out Cairo.TextExtents extents);
  871.     [CCode (cname = "cairo_user_font_face_get_text_to_glyphs_func", has_target = false)]
  872.     public delegate Cairo.Status UserScaledFontTextToGlyphsFunc (Cairo.UserScaledFont scaled_font, string utf8, int utf8_len, out Cairo.Glyph[] glyphs, out Cairo.TextCluster[] clusters, out Cairo.TextClusterFlags cluster_flags);
  873.     [CCode (cname = "cairo_user_scaled_font_unicode_to_glyph_func_t", has_target = false)]
  874.     public delegate Cairo.Status UserScaledFontUnicodeToGlyphFunc (Cairo.UserScaledFont scaled_font, ulong unicode, out ulong glyph_index);
  875.     [CCode (cname = "cairo_write_func_t", instance_pos = 0)]
  876.     public delegate Cairo.Status WriteFunc (uchar[] data);
  877.     public static int version ();
  878.     public static unowned string version_string ();
  879. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement