------------------------------------------------------------------------------
--                                                                          --
--                  CairoAda - Ada95 binding for Cairo                      --
--                                                                          --
-- Copyright (C) 2006-2009, Damien Carbonne                                 --
--                                                                          --
-- This library is free software; you can redistribute it and/or modify it  --
-- under the terms of the GNU General Public License as published by the    --
-- Free Software Foundation; either version 2 of the License, or (at your   --
-- option) any later version.                                               --
--                                                                          --
-- This library is distributed in the hope that it will be useful,          --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of           --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details.                                         --
--                                                                          --
-- You should have received a copy of the GNU General Public License along  --
-- with this library; if not, write to the Free Software Foundation,        --
-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.           --
--                                                                          --
-- As a special exception, if other files instantiate generics from this    --
-- unit, or you link this unit with other files to produce an executable,   --
-- this unit does not by itself cause the resulting executable to be        --
-- covered by the GNU General Public License. This exception does not       --
-- however invalidate any other reasons why the executable file might be    --
-- covered by the GNU Public License.                                       --
------------------------------------------------------------------------------

with System;
with Interfaces.C.Strings;
with Ada.Unchecked_Conversion;
with Ada.Streams;

private package Cairo.Support is

   pragma Elaborate_Body;

   -- Thin binding for Cairo functions (1.8)

   function To_Chars_Ptr is new Ada.Unchecked_Conversion (System.Address, Interfaces.C.Strings.chars_ptr);

   function To_Glyph_Ptr is new Ada.Unchecked_Conversion (System.Address, Glyph_Ptr);
   function To_Text_Cluster_Ptr is new Ada.Unchecked_Conversion (System.Address, Text_Cluster_Ptr);
   type Double_Ptr is access all double;
   function To_Double_Ptr is new Ada.Unchecked_Conversion (System.Address, Double_Ptr);
   type Int_Ptr is access all int;

   function To_Address is new Ada.Unchecked_Conversion (Void_Ptr, System.Address);

   type Cairo_Bool is new Interfaces.C.int;

   type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class;
   type Cairo_Closure is new Void_Ptr;
   function To_Closure is new Ada.Unchecked_Conversion (Stream_Access, Cairo_Closure);
   type Cairo_Write_Func is access function (Closure : Cairo_Closure; Data : Void_Ptr; Length : unsigned) return Cairo.Cairo_Status;
   pragma Convention (C, Cairo_Write_Func);
   type Cairo_Read_Func is access function (Closure : Cairo_Closure; Data : Void_Ptr; Length : unsigned) return Cairo.Cairo_Status;
   pragma Convention (C, Cairo_Read_Func);
   function Stream_Write (Closure : Cairo_Closure; Data : Void_Ptr; Length : unsigned) return Cairo.Cairo_Status;
   pragma Convention (C, Stream_Write);
   function Stream_Read (Closure : Cairo_Closure; Data : Void_Ptr; Length : unsigned) return Cairo.Cairo_Status;
   pragma Convention (C, Stream_Read);

   type Glyph_Ptr_Ptr is access all Glyph_Ptr;
   type Text_Cluster_Ptr_Ptr is access all Text_Cluster_Ptr;
   type Text_Cluster_Flags_Ptr is access all Cairo_Text_Cluster_Flags;

   type Cairo_User_Scaled_Font_Init_Func is access function
     (Scaled_Font : Scaled_Font_Ptr;
      Context : Context_Ptr;
      Extents : access Cairo_Font_Extents)
      return Cairo.Cairo_Status;
   pragma Convention (C, Cairo_User_Scaled_Font_Init_Func);

   type Cairo_User_Scaled_Font_Render_Glyph_Func is access function
     (Scaled_Font : Scaled_Font_Ptr;
      Glyph : unsigned_long;
      Context : Context_Ptr;
      Extents : access Cairo_Text_Extents)
      return Cairo.Cairo_Status;
   pragma Convention (C, Cairo_User_Scaled_Font_Render_Glyph_Func);

   type Cairo_User_Scaled_Font_Text_To_Glyphs_Func is access function
     (Scaled_Font : Scaled_Font_Ptr;
      UTF8 : Interfaces.C.Strings.chars_ptr;
      UTF8_Len : int;
      Glyphs : Glyph_Ptr_Ptr;
      Num_Glyphs : Int_Ptr;
      Clusters : Text_Cluster_Ptr_Ptr;
      Num_Clusters : Int_Ptr;
      Cluster_Flags : Text_Cluster_Flags_Ptr)
      return Cairo.Cairo_Status;
   pragma Convention (C, Cairo_User_Scaled_Font_Text_To_Glyphs_Func);

   type Cairo_User_Scaled_Font_Unicode_To_Glyph_Func is access function
     (Scaled_Font : Scaled_Font_Ptr;
      Unicode : unsigned_long;
      Glyph_Index : access unsigned_long)
      return Cairo.Cairo_Status;
   pragma Convention (C, Cairo_User_Scaled_Font_Unicode_To_Glyph_Func);

   function cairo_version return int;
   function cairo_version_string return Interfaces.C.Strings.chars_ptr;
   function cairo_create (Target : Surface_Ptr) return Context_Ptr;
   function cairo_reference (Context : Context_Ptr) return Context_Ptr;
   procedure cairo_destroy (Context : Context_Ptr);
   function cairo_get_reference_count (Context : Context_Ptr) return unsigned;
   function cairo_get_user_data (Context : Context_Ptr; Key : Cairo.Cairo_User_Data_Key) return Cairo.Cairo_User_Data;
   function cairo_set_user_data (Context : Context_Ptr; Key : Cairo.Cairo_User_Data_Key; User_Data : Cairo.Cairo_User_Data; Destroy : Cairo.Cairo_Destroy_Func) return Cairo.Cairo_Status;
   procedure cairo_save (Context : Context_Ptr);
   procedure cairo_restore (Context : Context_Ptr);
   procedure cairo_push_group (Context : Context_Ptr);
   procedure cairo_push_group_with_content (Context : Context_Ptr; Content : Cairo.Cairo_Content);
   function cairo_pop_group (Context : Context_Ptr) return Pattern_Ptr;
   procedure cairo_pop_group_to_source (Context : Context_Ptr);
   procedure cairo_set_operator (Context : Context_Ptr; Operator : Cairo.Cairo_Operator);
   procedure cairo_set_source (Context : Context_Ptr; Source : Pattern_Ptr);
   procedure cairo_set_source_rgb (Context : Context_Ptr; Red : double; Green : double; Blue : double);
   procedure cairo_set_source_rgba (Context : Context_Ptr; Red : double; Green : double; Blue : double; Alpha : double);
   procedure cairo_set_source_surface (Context : Context_Ptr; Surface : Surface_Ptr; X : double; Y : double);
   procedure cairo_set_tolerance (Context : Context_Ptr; Tolerance : double);
   procedure cairo_set_antialias (Context : Context_Ptr; Antialias : Cairo.Cairo_Antialias);
   procedure cairo_set_fill_rule (Context : Context_Ptr; Fill_Rule : Cairo.Cairo_Fill_Rule);
   procedure cairo_set_line_width (Context : Context_Ptr; Width : double);
   procedure cairo_set_line_cap (Context : Context_Ptr; Line_Cap : Cairo.Cairo_Line_Cap);
   procedure cairo_set_line_join (Context : Context_Ptr; Line_Join : Cairo.Cairo_Line_Join);
   procedure cairo_set_dash (Context : Context_Ptr; Dashes : access double; Num_Dashes : int; Offset : double);
   procedure cairo_set_miter_limit (Context : Context_Ptr; Limit : double);
   procedure cairo_translate (Context : Context_Ptr; TX : double; TY : double);
   procedure cairo_scale (Context : Context_Ptr; SX : double; SY : double);
   procedure cairo_rotate (Context : Context_Ptr; Angle : double);
   procedure cairo_transform (Context : Context_Ptr; Matrix : Cairo.Cairo_Matrix);
   procedure cairo_set_matrix (Context : Context_Ptr; Matrix : Cairo.Cairo_Matrix);
   procedure cairo_identity_matrix (Context : Context_Ptr);
   procedure cairo_user_to_device (Context : Context_Ptr; X : in out double; Y : in out double);
   procedure cairo_user_to_device_distance (Context : Context_Ptr; DX : in out double; DY : in out double);
   procedure cairo_device_to_user (Context : Context_Ptr; X : in out double; Y : in out double);
   procedure cairo_device_to_user_distance (Context : Context_Ptr; DX : in out double; DY : in out double);
   procedure cairo_new_path (Context : Context_Ptr);
   procedure cairo_move_to (Context : Context_Ptr; X : double; Y : double);
   procedure cairo_new_sub_path (Context : Context_Ptr);
   procedure cairo_line_to (Context : Context_Ptr; X : double; Y : double);
   procedure cairo_curve_to (Context : Context_Ptr; X1 : double; Y1 : double; X2 : double; Y2 : double; X3 : double; Y3 : double);
   procedure cairo_arc (Context : Context_Ptr; XC : double; YC : double; Radius : double; Angle1 : double; Angle2 : double);
   procedure cairo_arc_negative (Context : Context_Ptr; XC : double; YC : double; Radius : double; Angle1 : double; Angle2 : double);
   --NYI procedure cairo_arc_to (Context : Context_Ptr; X1 : double; Y1 : double; X2 : double; Y2 : double; Radius : double);
   procedure cairo_rel_move_to (Context : Context_Ptr; DX : double; DY : double);
   procedure cairo_rel_line_to (Context : Context_Ptr; DX : double; DY : double);
   procedure cairo_rel_curve_to (Context : Context_Ptr; DX1 : double; DY1 : double; DX2 : double; DY2 : double; DX3 : double; DY3 : double);
   procedure cairo_rectangle (Context : Context_Ptr; X : double; Y : double; Width : double; Height : double);
   --NYI procedure cairo_stroke_to_path (Context : Context_Ptr);
   procedure cairo_close_path (Context : Context_Ptr);
   procedure cairo_path_extents (Context : Context_Ptr; X1 : out double; Y1 : out double; X2 : out double; Y2 : out double);
   procedure cairo_paint (Context : Context_Ptr);
   procedure cairo_paint_with_alpha (Context : Context_Ptr; Alpha : double);
   procedure cairo_mask (Context : Context_Ptr; Pattern : Pattern_Ptr);
   procedure cairo_mask_surface (Context : Context_Ptr; Surface : Surface_Ptr; Surface_X : double; Surface_Y : double);
   procedure cairo_stroke (Context : Context_Ptr);
   procedure cairo_stroke_preserve (Context : Context_Ptr);
   procedure cairo_fill (Context : Context_Ptr);
   procedure cairo_fill_preserve (Context : Context_Ptr);
   procedure cairo_copy_page (Context : Context_Ptr);
   procedure cairo_show_page (Context : Context_Ptr);
   function cairo_in_stroke (Context : Context_Ptr; X : double; Y : double) return Cairo_Bool;
   function cairo_in_fill (Context : Context_Ptr; X : double; Y : double) return Cairo_Bool;
   procedure cairo_stroke_extents (Context : Context_Ptr; X1 : out double; Y1 : out double; X2 : out double; Y2 : out double);
   procedure cairo_fill_extents (Context : Context_Ptr; X1 : out double; Y1 : out double; X2 : out double; Y2 : out double);
   procedure cairo_reset_clip (Context : Context_Ptr);
   procedure cairo_clip (Context : Context_Ptr);
   procedure cairo_clip_preserve (Context : Context_Ptr);
   procedure cairo_clip_extents (Context : Context_Ptr; X1 : out double; Y1 : out double; X2 : out double; Y2 : out double);
   function cairo_copy_clip_rectangle_list (Context : Context_Ptr) return Rectangle_List_Ptr;
   procedure cairo_rectangle_list_destroy (Rectangle_List : Rectangle_List_Ptr);
   function cairo_glyph_allocate (Num_Glyphs : int) return Glyph_Ptr;
   procedure cairo_glyph_free (Glyphs : Glyph_Ptr);
   function cairo_text_cluster_allocate (Num_Clusters : int) return Text_Cluster_Ptr;
   procedure cairo_text_cluster_free (Clusters : Text_Cluster_Ptr);
   function cairo_font_options_create return Font_Options_Ptr;
   function cairo_font_options_copy (Original : Font_Options_Ptr) return Font_Options_Ptr;
   procedure cairo_font_options_destroy (Options : Font_Options_Ptr);
   function cairo_font_options_status (Options : Font_Options_Ptr) return Cairo.Cairo_Status;
   procedure cairo_font_options_merge (Options : Font_Options_Ptr; Other : Font_Options_Ptr);
   function cairo_font_options_equal (Options : Font_Options_Ptr; Other : Font_Options_Ptr) return Cairo_Bool;
   function cairo_font_options_hash (Options : Font_Options_Ptr) return unsigned_long;
   procedure cairo_font_options_set_antialias (Options : Font_Options_Ptr; Antialias : Cairo.Cairo_Antialias);
   function cairo_font_options_get_antialias (Options : Font_Options_Ptr) return Cairo.Cairo_Antialias;
   procedure cairo_font_options_set_subpixel_order (Options : Font_Options_Ptr; Subpixel_Order : Cairo.Cairo_Subpixel_Order);
   function cairo_font_options_get_subpixel_order (Options : Font_Options_Ptr) return Cairo.Cairo_Subpixel_Order;
   procedure cairo_font_options_set_hint_style (Options : Font_Options_Ptr; Hint_Style : Cairo.Cairo_Hint_Style);
   function cairo_font_options_get_hint_style (Options : Font_Options_Ptr) return Cairo.Cairo_Hint_Style;
   procedure cairo_font_options_set_hint_metrics (Options : Font_Options_Ptr; Hint_Metrics : Cairo.Cairo_Hint_Metrics);
   function cairo_font_options_get_hint_metrics (Options : Font_Options_Ptr) return Cairo.Cairo_Hint_Metrics;
   procedure cairo_select_font_face (Context : Context_Ptr; Family : Interfaces.C.Strings.chars_ptr; Slant : Cairo.Cairo_Font_Slant; Weight : Cairo.Cairo_Font_Weight);
   procedure cairo_set_font_size (Context : Context_Ptr; Size : double);
   procedure cairo_set_font_matrix (Context : Context_Ptr; Matrix : Cairo.Cairo_Matrix);
   procedure cairo_get_font_matrix (Context : Context_Ptr; Matrix : out Cairo.Cairo_Matrix);
   procedure cairo_set_font_options (Context : Context_Ptr; Options : Font_Options_Ptr);
   procedure cairo_get_font_options (Context : Context_Ptr; Options : Font_Options_Ptr);
   procedure cairo_set_font_face (Context : Context_Ptr; Font_Face : Font_Face_Ptr);
   function cairo_get_font_face (Context : Context_Ptr) return Font_Face_Ptr;
   procedure cairo_set_scaled_font (Context : Context_Ptr; Scaled_Font : Scaled_Font_Ptr);
   function cairo_get_scaled_font (Context : Context_Ptr) return Scaled_Font_Ptr;
   procedure cairo_show_text (Context : Context_Ptr; UTF8 : Interfaces.C.Strings.chars_ptr);
   procedure cairo_show_glyphs (Context : Context_Ptr; Glyphs : access Cairo.Cairo_Glyph; Num_Glyphs : int);
   procedure cairo_show_text_glyphs
     (Context : Context_Ptr;
      UTF8 : Interfaces.C.Strings.chars_ptr;
      Utf8_Len : int;
      Glyphs : access Cairo.Cairo_Glyph;
      Num_Glyphs : int;
      Clusters : access Cairo.Cairo_Text_Cluster;
      Num_Clusters : int;
      Cluster_Flags : Cairo.Cairo_Text_Cluster_Flags);
   procedure cairo_text_path (Context : Context_Ptr; UTF8 : Interfaces.C.Strings.chars_ptr);
   procedure cairo_glyph_path (Context : Context_Ptr; Glyphs : access Cairo.Cairo_Glyph; Num_Glyphs : int);
   procedure cairo_text_extents (Context : Context_Ptr; UTF8 : Interfaces.C.Strings.chars_ptr; Extents : out Cairo.Cairo_Text_Extents);
   procedure cairo_glyph_extents (Context : Context_Ptr; Glyphs : access Cairo.Cairo_Glyph; Num_Glyphs : int; Extents : out Cairo.Cairo_Text_Extents);
   procedure cairo_font_extents (Context : Context_Ptr; Extents : out Cairo.Cairo_Font_Extents);
   function cairo_font_face_reference (Font_Face : Font_Face_Ptr) return Font_Face_Ptr;
   procedure cairo_font_face_destroy (Font_Face : Font_Face_Ptr);
   function cairo_font_face_get_reference_count (Font_Face : Font_Face_Ptr) return unsigned;
   function cairo_font_face_status (Font_Face : Font_Face_Ptr) return Cairo.Cairo_Status;
   function cairo_font_face_get_type (Font_Face : Font_Face_Ptr) return Cairo.Cairo_Font_Type;
   function cairo_font_face_get_user_data (Font_Face : Font_Face_Ptr; Key : Cairo.Cairo_User_Data_Key) return Cairo.Cairo_User_Data;
   function cairo_font_face_set_user_data (Font_Face : Font_Face_Ptr; Key : Cairo.Cairo_User_Data_Key; User_Data : Cairo.Cairo_User_Data; Destroy : Cairo.Cairo_Destroy_Func) return Cairo.Cairo_Status;
   function cairo_scaled_font_create (Font_Face : Font_Face_Ptr; Font_Matrix : Cairo.Cairo_Matrix; CTM : Cairo.Cairo_Matrix; Options : Font_Options_Ptr) return Scaled_Font_Ptr;
   function cairo_scaled_font_reference (Scaled_Font : Scaled_Font_Ptr) return Scaled_Font_Ptr;
   procedure cairo_scaled_font_destroy (Scaled_Font : Scaled_Font_Ptr);
   function cairo_scaled_font_get_reference_count (Scaled_Font : Scaled_Font_Ptr) return unsigned;
   function cairo_scaled_font_status (Scaled_Font : Scaled_Font_Ptr) return Cairo.Cairo_Status;
   function cairo_scaled_font_get_type (Scaled_Font : Scaled_Font_Ptr) return Cairo.Cairo_Font_Type;
   function cairo_scaled_font_get_user_data (Scaled_Font : Scaled_Font_Ptr; Key : Cairo.Cairo_User_Data_Key) return Cairo.Cairo_User_Data;
   function cairo_scaled_font_set_user_data (Scaled_Font : Scaled_Font_Ptr; Key : Cairo.Cairo_User_Data_Key; User_Data : Cairo.Cairo_User_Data; Destroy : Cairo.Cairo_Destroy_Func) return Cairo.Cairo_Status;
   procedure cairo_scaled_font_extents (Scaled_Font : Scaled_Font_Ptr; Extents : out Cairo.Cairo_Font_Extents);
   procedure cairo_scaled_font_text_extents (Scaled_Font : Scaled_Font_Ptr; UTF8 : Interfaces.C.Strings.chars_ptr; Extents : out Cairo.Cairo_Text_Extents);
   procedure cairo_scaled_font_glyph_extents (Scaled_Font : Scaled_Font_Ptr; Glyphs : access Cairo.Cairo_Glyph; Num_Glyphs : int; Extents : out Cairo.Cairo_Text_Extents);
   function cairo_scaled_font_text_to_glyphs
     (Scaled_Font : Scaled_Font_Ptr;
      X : double;
      Y : double;
      UTF8 : Interfaces.C.Strings.chars_ptr;
      UTF8_Len : int;
      Glyphs : access Glyph_Ptr;
      Num_Glyphs : access int;
      Clusters : Text_Cluster_Ptr_Ptr;
      Num_Clusters : Int_Ptr;
      Cluster_Flags : Text_Cluster_Flags_Ptr)
      return Cairo.Cairo_Status;
   function cairo_scaled_font_get_font_face (Scaled_Font : Scaled_Font_Ptr) return Font_Face_Ptr;
   procedure cairo_scaled_font_get_font_matrix (Scaled_Font : Scaled_Font_Ptr; Font_Matrix : out Cairo.Cairo_Matrix);
   procedure cairo_scaled_font_get_ctm (Scaled_Font : Scaled_Font_Ptr; CTM : out Cairo.Cairo_Matrix);
   procedure cairo_scaled_font_get_scale_matrix (Scaled_Font : Scaled_Font_Ptr; Scale_Matrix : out Cairo.Cairo_Matrix);
   procedure cairo_scaled_font_get_font_options (Scaled_Font : Scaled_Font_Ptr; Options : Font_Options_Ptr);
   function cairo_toy_font_face_create (Family : Interfaces.C.Strings.chars_ptr; Slant : Cairo.Cairo_Font_Slant; Weight : Cairo.Cairo_Font_Weight) return Font_Face_Ptr;
   function cairo_toy_font_face_get_family (Font_Face : Font_Face_Ptr) return Interfaces.C.Strings.chars_ptr;
   function cairo_toy_font_face_get_slant (Font_Face : Font_Face_Ptr) return Cairo.Cairo_Font_Slant;
   function cairo_toy_font_face_get_weight (Font_Face : Font_Face_Ptr) return Cairo.Cairo_Font_Weight;
   function cairo_user_font_face_create return Font_Face_Ptr;
   procedure cairo_user_font_face_set_init_func (Font_Face : Font_Face_Ptr; Init_Func : Cairo_User_Scaled_Font_Init_Func);
   procedure cairo_user_font_face_set_render_glyph_func (Font_Face : Font_Face_Ptr; Render_Glyph_Func : Cairo_User_Scaled_Font_Render_Glyph_Func);
   procedure cairo_user_font_face_set_text_to_glyphs_func (Font_Face : Font_Face_Ptr; Text_To_Glyphs_Func : Cairo_User_Scaled_Font_Text_To_Glyphs_Func);
   procedure cairo_user_font_face_set_unicode_to_glyph_func (Font_Face : Font_Face_Ptr; Unicode_To_Glyph_Func : Cairo_User_Scaled_Font_Unicode_To_Glyph_Func);
   function cairo_user_font_face_get_init_func (Font_Face : Font_Face_Ptr) return Cairo_User_Scaled_Font_Init_Func;
   function cairo_user_font_face_get_render_glyph_func (Font_Face : Font_Face_Ptr) return Cairo_User_Scaled_Font_Render_Glyph_Func;
   function cairo_user_font_face_get_text_to_glyphs_func (Font_Face : Font_Face_Ptr) return Cairo_User_Scaled_Font_Text_To_Glyphs_Func;
   function cairo_user_font_face_get_unicode_to_glyph_func (Font_Face : Font_Face_Ptr) return Cairo_User_Scaled_Font_Unicode_To_Glyph_Func;
   function cairo_get_operator (Context : Context_Ptr) return Cairo.Cairo_Operator;
   function cairo_get_source (Context : Context_Ptr) return Pattern_Ptr;
   function cairo_get_tolerance (Context : Context_Ptr) return double;
   function cairo_get_antialias (Context : Context_Ptr) return Cairo.Cairo_Antialias;
   function cairo_has_current_point (Context : Context_Ptr) return Cairo_Bool;
   procedure cairo_get_current_point (Context : Context_Ptr; X : out double; Y : out double);
   function cairo_get_fill_rule (Context : Context_Ptr) return Cairo.Cairo_Fill_Rule;
   function cairo_get_line_width (Context : Context_Ptr) return double;
   function cairo_get_line_cap (Context : Context_Ptr) return Cairo.Cairo_Line_Cap;
   function cairo_get_line_join (Context : Context_Ptr) return Cairo.Cairo_Line_Join;
   function cairo_get_miter_limit (Context : Context_Ptr) return double;
   function cairo_get_dash_count (Context : Context_Ptr) return int;
   procedure cairo_get_dash (Context : Context_Ptr; Dashes : access double; Offset : access double);
   procedure cairo_get_matrix (Context : Context_Ptr; Matrix : in out Cairo.Cairo_Matrix);
   function cairo_get_target (Context : Context_Ptr) return Surface_Ptr;
   function cairo_get_group_target (Context : Context_Ptr) return Surface_Ptr;
   function cairo_copy_path (Context : Context_Ptr) return Path_Ptr;
   function cairo_copy_path_flat (Context : Context_Ptr) return Path_Ptr;
   procedure cairo_append_path (Context : Context_Ptr; Path : Path_Ptr);
   procedure cairo_path_destroy (Path : Path_Ptr);
   function cairo_status (Context : Context_Ptr) return Cairo.Cairo_Status;
   function cairo_status_to_string (Status : Cairo.Cairo_Status) return Interfaces.C.Strings.chars_ptr;
   function cairo_surface_create_similar (Other : Surface_Ptr; Content : Cairo.Cairo_Content; Width : int; Height : int) return Surface_Ptr;
   function cairo_surface_reference (Surface : Surface_Ptr) return Surface_Ptr;
   procedure cairo_surface_finish (Surface : Surface_Ptr);
   procedure cairo_surface_destroy (Surface : Surface_Ptr);
   function cairo_surface_get_reference_count (Surface : Surface_Ptr) return unsigned;
   function cairo_surface_status (Surface : Surface_Ptr) return Cairo.Cairo_Status;
   function cairo_surface_get_type (Surface : Surface_Ptr) return Cairo.Cairo_Surface_Type;
   function cairo_surface_get_content (Surface : Surface_Ptr) return Cairo.Cairo_Content;
   function cairo_surface_write_to_png (Surface : Surface_Ptr; Filename : Interfaces.C.Strings.chars_ptr) return Cairo.Cairo_Status;
   function cairo_surface_write_to_png_stream (Surface : Surface_Ptr; Write_Func : Cairo_Write_Func; Closure : Cairo_Closure) return Cairo.Cairo_Status;
   function cairo_surface_get_user_data (Surface : Surface_Ptr; Key : Cairo.Cairo_User_Data_Key) return Cairo.Cairo_User_Data;
   function cairo_surface_set_user_data (Surface : Surface_Ptr; Key : Cairo.Cairo_User_Data_Key; User_Data : Cairo.Cairo_User_Data; Destroy : Cairo.Cairo_Destroy_Func) return Cairo.Cairo_Status;
   procedure cairo_surface_get_font_options (Surface : Surface_Ptr; Options : Font_Options_Ptr);
   procedure cairo_surface_flush (Surface : Surface_Ptr);
   procedure cairo_surface_mark_dirty (Surface : Surface_Ptr);
   procedure cairo_surface_mark_dirty_rectangle (Surface : Surface_Ptr; X : int; Y : int; Width : int; Height : int);
   procedure cairo_surface_set_device_offset (Surface : Surface_Ptr; X_Offset : double; Y_Offset : double);
   procedure cairo_surface_get_device_offset (Surface : Surface_Ptr; X_Offset : out double; Y_Offset : out double);
   procedure cairo_surface_set_fallback_resolution (Surface : Surface_Ptr; X_Pixels_Per_Inch : double; Y_Pixels_Per_Inch : double);
   procedure cairo_surface_get_fallback_resolution (Surface : Surface_Ptr; X_Pixels_Per_Inch : out double; Y_Pixels_Per_Inch : out double);
   procedure cairo_surface_copy_page (Surface : Surface_Ptr);
   procedure cairo_surface_show_page (Surface : Surface_Ptr);
   function cairo_surface_has_show_text_glyphs (Surface : Surface_Ptr) return Cairo_Bool;
   function cairo_image_surface_create (Format : Cairo.Cairo_Format; Width : int; Height : int) return Surface_Ptr;
   function cairo_format_stride_for_width (Format : Cairo.Cairo_Format; Width : int) return int;
   function cairo_image_surface_create_for_data (Data : System.Address; Format : Cairo.Cairo_Format; Width : int; Height : int; Stride : int) return Surface_Ptr;
   function cairo_image_surface_get_data (Surface : Surface_Ptr) return System.Address;
   function cairo_image_surface_get_format (Surface : Surface_Ptr) return Cairo.Cairo_Format;
   function cairo_image_surface_get_width (Surface : Surface_Ptr) return int;
   function cairo_image_surface_get_height (Surface : Surface_Ptr) return int;
   function cairo_image_surface_get_stride (Surface : Surface_Ptr) return int;
   function cairo_image_surface_create_from_png (Filename : Interfaces.C.Strings.chars_ptr) return Surface_Ptr;
   function cairo_image_surface_create_from_png_stream (Read_Func : Cairo_Read_Func; Closure : Cairo_Closure) return Surface_Ptr;
   function cairo_pattern_create_rgb (Red : double; Green : double; Blue : double) return Pattern_Ptr;
   function cairo_pattern_create_rgba (Red : double; Green : double; Blue : double; Alpha : double) return Pattern_Ptr;
   function cairo_pattern_create_for_surface (Surface : Surface_Ptr) return Pattern_Ptr;
   function cairo_pattern_create_linear (X0 : double; Y0 : double; X1 : double; Y1 : double) return Pattern_Ptr;
   function cairo_pattern_create_radial (CX0 : double; CY0 : double; Radius0 : double; CX1 : double; CY1 : double; Radius1 : double) return Pattern_Ptr;
   function cairo_pattern_reference (Pattern : Pattern_Ptr) return Pattern_Ptr;
   procedure cairo_pattern_destroy (Pattern : Pattern_Ptr);
   function cairo_pattern_get_reference_count (Pattern : Pattern_Ptr) return unsigned;
   function cairo_pattern_status (Pattern : Pattern_Ptr) return Cairo.Cairo_Status;
   function cairo_pattern_get_user_data (Pattern : Pattern_Ptr; Key : Cairo.Cairo_User_Data_Key) return Cairo.Cairo_User_Data;
   function cairo_pattern_set_user_data (Pattern : Pattern_Ptr; Key : Cairo.Cairo_User_Data_Key; User_Data : Cairo.Cairo_User_Data; Destroy : Cairo.Cairo_Destroy_Func) return Cairo.Cairo_Status;
   function cairo_pattern_get_type (Pattern : Pattern_Ptr) return Cairo.Cairo_Pattern_Type;
   procedure cairo_pattern_add_color_stop_rgb (Pattern : Pattern_Ptr; Offset : double; Red : double; Green : double; Blue : double);
   procedure cairo_pattern_add_color_stop_rgba (Pattern : Pattern_Ptr; Offset : double; Red : double; Green : double; Blue : double; Alpha : double);
   procedure cairo_pattern_set_matrix (Pattern : Pattern_Ptr; Matrix : Cairo.Cairo_Matrix);
   procedure cairo_pattern_get_matrix (Pattern : Pattern_Ptr; Matrix : out Cairo.Cairo_Matrix);
   procedure cairo_pattern_set_extend (Pattern : Pattern_Ptr; Extend : Cairo.Cairo_Extend);
   function cairo_pattern_get_extend (Pattern : Pattern_Ptr) return Cairo.Cairo_Extend;
   procedure cairo_pattern_set_filter (Pattern : Pattern_Ptr; Filter : Cairo.Cairo_Filter);
   function cairo_pattern_get_filter (Pattern : Pattern_Ptr) return Cairo.Cairo_Filter;
   function cairo_pattern_get_rgba (Pattern : Pattern_Ptr; Red : access double; Green : access double; Blue : access double; Alpha : access double) return Cairo.Cairo_Status;
   function cairo_pattern_get_surface (Pattern : Pattern_Ptr; Surface : access Surface_Ptr) return Cairo.Cairo_Status;
   function cairo_pattern_get_color_stop_rgba (Pattern : Pattern_Ptr; index : int; Offset : access double; Red : access double; Green : access double; Blue : access double; Alpha : access double) return Cairo.Cairo_Status;
   function cairo_pattern_get_color_stop_count (Pattern : Pattern_Ptr; Count : access int) return Cairo.Cairo_Status;
   function cairo_pattern_get_linear_points (Pattern : Pattern_Ptr; X0 : access double; Y0 : access double; X1 : access double; Y1 : access double) return Cairo.Cairo_Status;
   function cairo_pattern_get_radial_circles (Pattern : Pattern_Ptr; X0 : access double; Y0 : access double; R0 : access double; X1 : access double; Y1 : access double; R1 : access double) return Cairo.Cairo_Status;
   procedure cairo_matrix_init (Matrix : out Cairo.Cairo_Matrix; XX : double; YX : double; XY : double; YY : double; X0 : double; Y0 : double);
   procedure cairo_matrix_init_identity (Matrix : out Cairo.Cairo_Matrix);
   procedure cairo_matrix_init_translate (Matrix : out Cairo.Cairo_Matrix; TX : double; TY : double);
   procedure cairo_matrix_init_scale (Matrix : out Cairo.Cairo_Matrix; SX : double; SY : double);
   procedure cairo_matrix_init_rotate (Matrix : out Cairo.Cairo_Matrix; Radians : double);
   procedure cairo_matrix_translate (Matrix : in out Cairo.Cairo_Matrix; TX : double; TY : double);
   procedure cairo_matrix_scale (Matrix : in out Cairo.Cairo_Matrix; SX : double; SY : double);
   procedure cairo_matrix_rotate (Matrix : in out Cairo.Cairo_Matrix; Radians : double);
   function cairo_matrix_invert (Matrix : access Cairo.Cairo_Matrix) return Cairo.Cairo_Status;
   procedure cairo_matrix_multiply (Result : out Cairo.Cairo_Matrix; A : Cairo.Cairo_Matrix; B : Cairo.Cairo_Matrix);
   procedure cairo_matrix_transform_distance (Matrix : Cairo.Cairo_Matrix; DX : in out double; DY : in out double);
   procedure cairo_matrix_transform_point (Matrix : Cairo.Cairo_Matrix; X : in out double; Y : in out double);
   procedure cairo_debug_reset_static_data;

   pragma Import (C, cairo_version, "cairo_version");
   pragma Import (C, cairo_version_string, "cairo_version_string");
   pragma Import (C, cairo_create, "cairo_create");
   pragma Import (C, cairo_reference, "cairo_reference");
   pragma Import (C, cairo_destroy, "cairo_destroy");
   pragma Import (C, cairo_get_reference_count, "cairo_get_reference_count");
   pragma Import (C, cairo_get_user_data, "cairo_get_user_data");
   pragma Import (C, cairo_set_user_data, "cairo_set_user_data");
   pragma Import (C, cairo_save, "cairo_save");
   pragma Import (C, cairo_restore, "cairo_restore");
   pragma Import (C, cairo_push_group, "cairo_push_group");
   pragma Import (C, cairo_push_group_with_content, "cairo_push_group_with_content");
   pragma Import (C, cairo_pop_group, "cairo_pop_group");
   pragma Import (C, cairo_pop_group_to_source, "cairo_pop_group_to_source");
   pragma Import (C, cairo_set_operator, "cairo_set_operator");
   pragma Import (C, cairo_set_source, "cairo_set_source");
   pragma Import (C, cairo_set_source_rgb, "cairo_set_source_rgb");
   pragma Import (C, cairo_set_source_rgba, "cairo_set_source_rgba");
   pragma Import (C, cairo_set_source_surface, "cairo_set_source_surface");
   pragma Import (C, cairo_set_tolerance, "cairo_set_tolerance");
   pragma Import (C, cairo_set_antialias, "cairo_set_antialias");
   pragma Import (C, cairo_set_fill_rule, "cairo_set_fill_rule");
   pragma Import (C, cairo_set_line_width, "cairo_set_line_width");
   pragma Import (C, cairo_set_line_cap, "cairo_set_line_cap");
   pragma Import (C, cairo_set_line_join, "cairo_set_line_join");
   pragma Import (C, cairo_set_dash, "cairo_set_dash");
   pragma Import (C, cairo_set_miter_limit, "cairo_set_miter_limit");
   pragma Import (C, cairo_translate, "cairo_translate");
   pragma Import (C, cairo_scale, "cairo_scale");
   pragma Import (C, cairo_rotate, "cairo_rotate");
   pragma Import (C, cairo_transform, "cairo_transform");
   pragma Import (C, cairo_set_matrix, "cairo_set_matrix");
   pragma Import (C, cairo_identity_matrix, "cairo_identity_matrix");
   pragma Import (C, cairo_user_to_device, "cairo_user_to_device");
   pragma Import (C, cairo_user_to_device_distance, "cairo_user_to_device_distance");
   pragma Import (C, cairo_device_to_user, "cairo_device_to_user");
   pragma Import (C, cairo_device_to_user_distance, "cairo_device_to_user_distance");
   pragma Import (C, cairo_new_path, "cairo_new_path");
   pragma Import (C, cairo_move_to, "cairo_move_to");
   pragma Import (C, cairo_new_sub_path, "cairo_new_sub_path");
   pragma Import (C, cairo_line_to, "cairo_line_to");
   pragma Import (C, cairo_curve_to, "cairo_curve_to");
   pragma Import (C, cairo_arc, "cairo_arc");
   pragma Import (C, cairo_arc_negative, "cairo_arc_negative");
   --NYI: pragma Import (C, cairo_arc_to, "cairo_arc_to");
   pragma Import (C, cairo_rel_move_to, "cairo_rel_move_to");
   pragma Import (C, cairo_rel_line_to, "cairo_rel_line_to");
   pragma Import (C, cairo_rel_curve_to, "cairo_rel_curve_to");
   pragma Import (C, cairo_rectangle, "cairo_rectangle");
   --NYI: pragma Import (C, cairo_stroke_to_path, "cairo_stroke_to_path");
   pragma Import (C, cairo_close_path, "cairo_close_path");
   pragma Import (C, cairo_path_extents, "cairo_path_extents");
   pragma Import (C, cairo_paint, "cairo_paint");
   pragma Import (C, cairo_paint_with_alpha, "cairo_paint_with_alpha");
   pragma Import (C, cairo_mask, "cairo_mask");
   pragma Import (C, cairo_mask_surface, "cairo_mask_surface");
   pragma Import (C, cairo_stroke, "cairo_stroke");
   pragma Import (C, cairo_stroke_preserve, "cairo_stroke_preserve");
   pragma Import (C, cairo_fill, "cairo_fill");
   pragma Import (C, cairo_fill_preserve, "cairo_fill_preserve");
   pragma Import (C, cairo_copy_page, "cairo_copy_page");
   pragma Import (C, cairo_show_page, "cairo_show_page");
   pragma Import (C, cairo_in_stroke, "cairo_in_stroke");
   pragma Import (C, cairo_in_fill, "cairo_in_fill");
   pragma Import (C, cairo_stroke_extents, "cairo_stroke_extents");
   pragma Import (C, cairo_fill_extents, "cairo_fill_extents");
   pragma Import (C, cairo_reset_clip, "cairo_reset_clip");
   pragma Import (C, cairo_clip, "cairo_clip");
   pragma Import (C, cairo_clip_preserve, "cairo_clip_preserve");
   pragma Import (C, cairo_clip_extents, "cairo_clip_extents");
   pragma Import (C, cairo_copy_clip_rectangle_list, "cairo_copy_clip_rectangle_list");
   pragma Import (C, cairo_rectangle_list_destroy, "cairo_rectangle_list_destroy");
   pragma Import (C, cairo_glyph_allocate, "cairo_glyph_allocate");
   pragma Import (C, cairo_glyph_free, "cairo_glyph_free");
   pragma Import (C, cairo_text_cluster_allocate, "cairo_text_cluster_allocate");
   pragma Import (C, cairo_text_cluster_free, "cairo_text_cluster_free");
   pragma Import (C, cairo_font_options_create, "cairo_font_options_create");
   pragma Import (C, cairo_font_options_copy, "cairo_font_options_copy");
   pragma Import (C, cairo_font_options_destroy, "cairo_font_options_destroy");
   pragma Import (C, cairo_font_options_status, "cairo_font_options_status");
   pragma Import (C, cairo_font_options_merge, "cairo_font_options_merge");
   pragma Import (C, cairo_font_options_equal, "cairo_font_options_equal");
   pragma Import (C, cairo_font_options_hash, "cairo_font_options_hash");
   pragma Import (C, cairo_font_options_set_antialias, "cairo_font_options_set_antialias");
   pragma Import (C, cairo_font_options_get_antialias, "cairo_font_options_get_antialias");
   pragma Import (C, cairo_font_options_set_subpixel_order, "cairo_font_options_set_subpixel_order");
   pragma Import (C, cairo_font_options_get_subpixel_order, "cairo_font_options_get_subpixel_order");
   pragma Import (C, cairo_font_options_set_hint_style, "cairo_font_options_set_hint_style");
   pragma Import (C, cairo_font_options_get_hint_style, "cairo_font_options_get_hint_style");
   pragma Import (C, cairo_font_options_set_hint_metrics, "cairo_font_options_set_hint_metrics");
   pragma Import (C, cairo_font_options_get_hint_metrics, "cairo_font_options_get_hint_metrics");
   pragma Import (C, cairo_select_font_face, "cairo_select_font_face");
   pragma Import (C, cairo_set_font_size, "cairo_set_font_size");
   pragma Import (C, cairo_set_font_matrix, "cairo_set_font_matrix");
   pragma Import (C, cairo_get_font_matrix, "cairo_get_font_matrix");
   pragma Import (C, cairo_set_font_options, "cairo_set_font_options");
   pragma Import (C, cairo_get_font_options, "cairo_get_font_options");
   pragma Import (C, cairo_set_font_face, "cairo_set_font_face");
   pragma Import (C, cairo_get_font_face, "cairo_get_font_face");
   pragma Import (C, cairo_set_scaled_font, "cairo_set_scaled_font");
   pragma Import (C, cairo_get_scaled_font, "cairo_get_scaled_font");
   pragma Import (C, cairo_show_text, "cairo_show_text");
   pragma Import (C, cairo_show_glyphs, "cairo_show_glyphs");
   pragma Import (C, cairo_show_text_glyphs, "cairo_show_text_glyphs");
   pragma Import (C, cairo_text_path, "cairo_text_path");
   pragma Import (C, cairo_glyph_path, "cairo_glyph_path");
   pragma Import (C, cairo_text_extents, "cairo_text_extents");
   pragma Import (C, cairo_glyph_extents, "cairo_glyph_extents");
   pragma Import (C, cairo_font_extents, "cairo_font_extents");
   pragma Import (C, cairo_font_face_reference, "cairo_font_face_reference");
   pragma Import (C, cairo_font_face_destroy, "cairo_font_face_destroy");
   pragma Import (C, cairo_font_face_get_reference_count, "cairo_font_face_get_reference_count");
   pragma Import (C, cairo_font_face_status, "cairo_font_face_status");
   pragma Import (C, cairo_font_face_get_type, "cairo_font_face_get_type");
   pragma Import (C, cairo_font_face_get_user_data, "cairo_font_face_get_user_data");
   pragma Import (C, cairo_font_face_set_user_data, "cairo_font_face_set_user_data");
   pragma Import (C, cairo_scaled_font_create, "cairo_scaled_font_create");
   pragma Import (C, cairo_scaled_font_reference, "cairo_scaled_font_reference");
   pragma Import (C, cairo_scaled_font_destroy, "cairo_scaled_font_destroy");
   pragma Import (C, cairo_scaled_font_get_reference_count, "cairo_scaled_font_get_reference_count");
   pragma Import (C, cairo_scaled_font_status, "cairo_scaled_font_status");
   pragma Import (C, cairo_scaled_font_get_type, "cairo_scaled_font_get_type");
   pragma Import (C, cairo_scaled_font_get_user_data, "cairo_scaled_font_get_user_data");
   pragma Import (C, cairo_scaled_font_set_user_data, "cairo_scaled_font_set_user_data");
   pragma Import (C, cairo_scaled_font_extents, "cairo_scaled_font_extents");
   pragma Import (C, cairo_scaled_font_text_extents, "cairo_scaled_font_text_extents");
   pragma Import (C, cairo_scaled_font_glyph_extents, "cairo_scaled_font_glyph_extents");
   pragma Import (C, cairo_scaled_font_text_to_glyphs, "cairo_scaled_font_text_to_glyphs");
   pragma Import (C, cairo_scaled_font_get_font_face, "cairo_scaled_font_get_font_face");
   pragma Import (C, cairo_scaled_font_get_font_matrix, "cairo_scaled_font_get_font_matrix");
   pragma Import (C, cairo_scaled_font_get_ctm, "cairo_scaled_font_get_ctm");
   pragma Import (C, cairo_scaled_font_get_scale_matrix, "cairo_scaled_font_get_scale_matrix");
   pragma Import (C, cairo_scaled_font_get_font_options, "cairo_scaled_font_get_font_options");
   pragma Import (C, cairo_toy_font_face_create, "cairo_toy_font_face_create");
   pragma Import (C, cairo_toy_font_face_get_family, "cairo_toy_font_face_get_family");
   pragma Import (C, cairo_toy_font_face_get_slant, "cairo_toy_font_face_get_slant");
   pragma Import (C, cairo_toy_font_face_get_weight, "cairo_toy_font_face_get_weight");
   pragma Import (C, cairo_user_font_face_create, "cairo_user_font_face_create");
   pragma Import (C, cairo_user_font_face_set_init_func, "cairo_user_font_face_set_init_func");
   pragma Import (C, cairo_user_font_face_set_render_glyph_func, "cairo_user_font_face_set_render_glyph_func");
   pragma Import (C, cairo_user_font_face_set_text_to_glyphs_func, "cairo_user_font_face_set_text_to_glyphs_func");
   pragma Import (C, cairo_user_font_face_set_unicode_to_glyph_func, "cairo_user_font_face_set_unicode_to_glyph_func");
   pragma Import (C, cairo_user_font_face_get_init_func, "cairo_user_font_face_get_init_func");
   pragma Import (C, cairo_user_font_face_get_render_glyph_func, "cairo_user_font_face_get_render_glyph_func");
   pragma Import (C, cairo_user_font_face_get_text_to_glyphs_func, "cairo_user_font_face_get_text_to_glyphs_func");
   pragma Import (C, cairo_user_font_face_get_unicode_to_glyph_func, "cairo_user_font_face_get_unicode_to_glyph_func");
   pragma Import (C, cairo_get_operator, "cairo_get_operator");
   pragma Import (C, cairo_get_source, "cairo_get_source");
   pragma Import (C, cairo_get_tolerance, "cairo_get_tolerance");
   pragma Import (C, cairo_get_antialias, "cairo_get_antialias");
   pragma Import (C, cairo_has_current_point, "cairo_has_current_point");
   pragma Import (C, cairo_get_current_point, "cairo_get_current_point");
   pragma Import (C, cairo_get_fill_rule, "cairo_get_fill_rule");
   pragma Import (C, cairo_get_line_width, "cairo_get_line_width");
   pragma Import (C, cairo_get_line_cap, "cairo_get_line_cap");
   pragma Import (C, cairo_get_line_join, "cairo_get_line_join");
   pragma Import (C, cairo_get_miter_limit, "cairo_get_miter_limit");
   pragma Import (C, cairo_get_dash_count, "cairo_get_dash_count");
   pragma Import (C, cairo_get_dash, "cairo_get_dash");
   pragma Import (C, cairo_get_matrix, "cairo_get_matrix");
   pragma Import (C, cairo_get_target, "cairo_get_target");
   pragma Import (C, cairo_get_group_target, "cairo_get_group_target");
   pragma Import (C, cairo_copy_path, "cairo_copy_path");
   pragma Import (C, cairo_copy_path_flat, "cairo_copy_path_flat");
   pragma Import (C, cairo_append_path, "cairo_append_path");
   pragma Import (C, cairo_path_destroy, "cairo_path_destroy");
   pragma Import (C, cairo_status, "cairo_status");
   pragma Import (C, cairo_status_to_string, "cairo_status_to_string");
   pragma Import (C, cairo_surface_create_similar, "cairo_surface_create_similar");
   pragma Import (C, cairo_surface_reference, "cairo_surface_reference");
   pragma Import (C, cairo_surface_finish, "cairo_surface_finish");
   pragma Import (C, cairo_surface_destroy, "cairo_surface_destroy");
   pragma Import (C, cairo_surface_get_reference_count, "cairo_surface_get_reference_count");
   pragma Import (C, cairo_surface_status, "cairo_surface_status");
   pragma Import (C, cairo_surface_get_type, "cairo_surface_get_type");
   pragma Import (C, cairo_surface_get_content, "cairo_surface_get_content");
   pragma Import (C, cairo_surface_write_to_png, "cairo_surface_write_to_png");
   pragma Import (C, cairo_surface_write_to_png_stream, "cairo_surface_write_to_png_stream");
   pragma Import (C, cairo_surface_get_user_data, "cairo_surface_get_user_data");
   pragma Import (C, cairo_surface_set_user_data, "cairo_surface_set_user_data");
   pragma Import (C, cairo_surface_get_font_options, "cairo_surface_get_font_options");
   pragma Import (C, cairo_surface_flush, "cairo_surface_flush");
   pragma Import (C, cairo_surface_mark_dirty, "cairo_surface_mark_dirty");
   pragma Import (C, cairo_surface_mark_dirty_rectangle, "cairo_surface_mark_dirty_rectangle");
   pragma Import (C, cairo_surface_set_device_offset, "cairo_surface_set_device_offset");
   pragma Import (C, cairo_surface_get_device_offset, "cairo_surface_get_device_offset");
   pragma Import (C, cairo_surface_set_fallback_resolution, "cairo_surface_set_fallback_resolution");
   pragma Import (C, cairo_surface_get_fallback_resolution, "cairo_surface_get_fallback_resolution");
   pragma Import (C, cairo_surface_copy_page, "cairo_surface_copy_page");
   pragma Import (C, cairo_surface_show_page, "cairo_surface_show_page");
   pragma Import (C, cairo_surface_has_show_text_glyphs, "cairo_surface_has_show_text_glyphs");
   pragma Import (C, cairo_image_surface_create, "cairo_image_surface_create");
   pragma Import (C, cairo_format_stride_for_width, "cairo_format_stride_for_width");
   pragma Import (C, cairo_image_surface_create_for_data, "cairo_image_surface_create_for_data");
   pragma Import (C, cairo_image_surface_get_data, "cairo_image_surface_get_data");
   pragma Import (C, cairo_image_surface_get_format, "cairo_image_surface_get_format");
   pragma Import (C, cairo_image_surface_get_width, "cairo_image_surface_get_width");
   pragma Import (C, cairo_image_surface_get_height, "cairo_image_surface_get_height");
   pragma Import (C, cairo_image_surface_get_stride, "cairo_image_surface_get_stride");
   pragma Import (C, cairo_image_surface_create_from_png, "cairo_image_surface_create_from_png");
   pragma Import (C, cairo_image_surface_create_from_png_stream, "cairo_image_surface_create_from_png_stream");
   pragma Import (C, cairo_pattern_create_rgb, "cairo_pattern_create_rgb");
   pragma Import (C, cairo_pattern_create_rgba, "cairo_pattern_create_rgba");
   pragma Import (C, cairo_pattern_create_for_surface, "cairo_pattern_create_for_surface");
   pragma Import (C, cairo_pattern_create_linear, "cairo_pattern_create_linear");
   pragma Import (C, cairo_pattern_create_radial, "cairo_pattern_create_radial");
   pragma Import (C, cairo_pattern_reference, "cairo_pattern_reference");
   pragma Import (C, cairo_pattern_destroy, "cairo_pattern_destroy");
   pragma Import (C, cairo_pattern_get_reference_count, "cairo_pattern_get_reference_count");
   pragma Import (C, cairo_pattern_status, "cairo_pattern_status");
   pragma Import (C, cairo_pattern_get_user_data, "cairo_pattern_get_user_data");
   pragma Import (C, cairo_pattern_set_user_data, "cairo_pattern_set_user_data");
   pragma Import (C, cairo_pattern_get_type, "cairo_pattern_get_type");
   pragma Import (C, cairo_pattern_add_color_stop_rgb, "cairo_pattern_add_color_stop_rgb");
   pragma Import (C, cairo_pattern_add_color_stop_rgba, "cairo_pattern_add_color_stop_rgba");
   pragma Import (C, cairo_pattern_set_matrix, "cairo_pattern_set_matrix");
   pragma Import (C, cairo_pattern_get_matrix, "cairo_pattern_get_matrix");
   pragma Import (C, cairo_pattern_set_extend, "cairo_pattern_set_extend");
   pragma Import (C, cairo_pattern_get_extend, "cairo_pattern_get_extend");
   pragma Import (C, cairo_pattern_set_filter, "cairo_pattern_set_filter");
   pragma Import (C, cairo_pattern_get_filter, "cairo_pattern_get_filter");
   pragma Import (C, cairo_pattern_get_rgba, "cairo_pattern_get_rgba");
   pragma Import (C, cairo_pattern_get_surface, "cairo_pattern_get_surface");
   pragma Import (C, cairo_pattern_get_color_stop_rgba, "cairo_pattern_get_color_stop_rgba");
   pragma Import (C, cairo_pattern_get_color_stop_count, "cairo_pattern_get_color_stop_count");
   pragma Import (C, cairo_pattern_get_linear_points, "cairo_pattern_get_linear_points");
   pragma Import (C, cairo_pattern_get_radial_circles, "cairo_pattern_get_radial_circles");
   pragma Import (C, cairo_matrix_init, "cairo_matrix_init");
   pragma Import (C, cairo_matrix_init_identity, "cairo_matrix_init_identity");
   pragma Import (C, cairo_matrix_init_translate, "cairo_matrix_init_translate");
   pragma Import (C, cairo_matrix_init_scale, "cairo_matrix_init_scale");
   pragma Import (C, cairo_matrix_init_rotate, "cairo_matrix_init_rotate");
   pragma Import (C, cairo_matrix_translate, "cairo_matrix_translate");
   pragma Import (C, cairo_matrix_scale, "cairo_matrix_scale");
   pragma Import (C, cairo_matrix_rotate, "cairo_matrix_rotate");
   pragma Import (C, cairo_matrix_invert, "cairo_matrix_invert");
   pragma Import (C, cairo_matrix_multiply, "cairo_matrix_multiply");
   pragma Import (C, cairo_matrix_transform_distance, "cairo_matrix_transform_distance");
   pragma Import (C, cairo_matrix_transform_point, "cairo_matrix_transform_point");
   pragma Import (C, cairo_debug_reset_static_data, "cairo_debug_reset_static_data");

end Cairo.Support;
