sig
  type status =
      SUCCESS
    | NO_MEMORY
    | INVALID_RESTORE
    | INVALID_POP_GROUP
    | NO_CURRENT_POINT
    | INVALID_MATRIX
    | INVALID_STATUS
    | NULL_POINTER
    | INVALID_STRING
    | INVALID_PATH_DATA
    | READ_ERROR
    | WRITE_ERROR
    | SURFACE_FINISHED
    | SURFACE_TYPE_MISMATCH
    | PATTERN_TYPE_MISMATCH
    | INVALID_CONTENT
    | INVALID_FORMAT
    | INVALID_VISUAL
    | FILE_NOT_FOUND
    | INVALID_DASH
    | INVALID_DSC_COMMENT
    | INVALID_INDEX
    | CLIP_NOT_REPRESENTABLE
  exception Error of Cairo.status
  val init : unit
  external version_encode : int -> int -> int -> int
    = "ml_CAIRO_VERSION_ENCODE"
  external run_time_version : unit -> int = "ml_cairo_version"
  external run_time_version_string : unit -> string
    = "ml_cairo_version_string"
  val compile_time_version : int
  val compile_time_version_string : string
  type t
  type -'a surface
  type -'a pattern
  type -'a font_face
  type surface_type =
      [ `BeOS
      | `DirectFB
      | `Glitz
      | `Image
      | `PDF
      | `PS
      | `Quartz
      | `SVG
      | `Win32
      | `XCB
      | `Xlib ]
  type pattern_type = [ `Linear | `Radial | `Solid | `Surface ]
  type font_type = [ `ATSUI | `FT | `TOY | `Win32 ]
  type content = CONTENT_COLOR | CONTENT_ALPHA | CONTENT_COLOR_ALPHA
  type point = { x : float; y : float; }
  type matrix = {
    xx : float;
    yx : float;
    xy : float;
    yy : float;
    x0 : float;
    y0 : float;
  }
  val create : [> `Any ] Cairo.surface -> Cairo.t
  external save : Cairo.t -> unit = "ml_cairo_save"
  external restore : Cairo.t -> unit = "ml_cairo_restore"
  val push_group : ?content:Cairo.content -> Cairo.t -> unit
  external pop_group : Cairo.t -> [ `Any ] Cairo.pattern
    = "ml_cairo_pop_group"
  external pop_group_to_source : Cairo.t -> unit
    = "ml_cairo_pop_group_to_source"
  external status : Cairo.t -> Cairo.status = "ml_cairo_status"
  external surface_status : [> `Any ] Cairo.surface -> Cairo.status
    = "ml_cairo_surface_status"
  external pattern_status : [> `Any ] Cairo.pattern -> Cairo.status
    = "ml_cairo_pattern_status"
  external font_face_status : [> `Any ] Cairo.font_face -> Cairo.status
    = "ml_cairo_font_face_status"
  external string_of_status : Cairo.status -> string
    = "ml_cairo_status_to_string"
  type operator =
      OPERATOR_CLEAR
    | OPERATOR_SOURCE
    | OPERATOR_OVER
    | OPERATOR_IN
    | OPERATOR_OUT
    | OPERATOR_ATOP
    | OPERATOR_DEST
    | OPERATOR_DEST_OVER
    | OPERATOR_DEST_IN
    | OPERATOR_DEST_OUT
    | OPERATOR_DEST_ATOP
    | OPERATOR_XOR
    | OPERATOR_ADD
    | OPERATOR_SATURATE
  external set_operator : Cairo.t -> Cairo.operator -> unit
    = "ml_cairo_set_operator"
  external set_source : Cairo.t -> [> `Any ] Cairo.pattern -> unit
    = "ml_cairo_set_source"
  external set_source_rgb :
    Cairo.t -> red:float -> green:float -> blue:float -> unit
    = "ml_cairo_set_source_rgb"
  external set_source_rgba :
    Cairo.t -> red:float -> green:float -> blue:float -> alpha:float -> unit
    = "ml_cairo_set_source_rgba"
  external set_source_surface :
    Cairo.t -> [> `Any ] Cairo.surface -> float -> float -> unit
    = "ml_cairo_set_source_surface"
  external set_tolerance : Cairo.t -> float -> unit
    = "ml_cairo_set_tolerance"
  type antialias =
      ANTIALIAS_DEFAULT
    | ANTIALIAS_NONE
    | ANTIALIAS_GRAY
    | ANTIALIAS_SUBPIXEL
  external set_antialias : Cairo.t -> Cairo.antialias -> unit
    = "ml_cairo_set_antialias"
  type fill_rule = FILL_RULE_WINDING | FILL_RULE_EVEN_ODD
  external set_fill_rule : Cairo.t -> Cairo.fill_rule -> unit
    = "ml_cairo_set_fill_rule"
  external set_line_width : Cairo.t -> float -> unit
    = "ml_cairo_set_line_width"
  type line_cap = LINE_CAP_BUTT | LINE_CAP_ROUND | LINE_CAP_SQUARE
  external set_line_cap : Cairo.t -> Cairo.line_cap -> unit
    = "ml_cairo_set_line_cap"
  type line_join = LINE_JOIN_MITER | LINE_JOIN_ROUND | LINE_JOIN_BEVEL
  external set_line_join : Cairo.t -> Cairo.line_join -> unit
    = "ml_cairo_set_line_join"
  external set_dash : Cairo.t -> float array -> float -> unit
    = "ml_cairo_set_dash"
  external set_miter_limit : Cairo.t -> float -> unit
    = "ml_cairo_set_miter_limit"
  external translate : Cairo.t -> tx:float -> ty:float -> unit
    = "ml_cairo_translate"
  external scale : Cairo.t -> sx:float -> sy:float -> unit = "ml_cairo_scale"
  external rotate : Cairo.t -> angle:float -> unit = "ml_cairo_rotate"
  external transform : Cairo.t -> Cairo.matrix -> unit = "ml_cairo_transform"
  external set_matrix : Cairo.t -> Cairo.matrix -> unit
    = "ml_cairo_set_matrix"
  external identity_matrix : Cairo.t -> unit = "ml_cairo_identity_matrix"
  external user_to_device : Cairo.t -> Cairo.point -> Cairo.point
    = "ml_cairo_user_to_device"
  external user_to_device_distance : Cairo.t -> Cairo.point -> Cairo.point
    = "ml_cairo_user_to_device_distance"
  external device_to_user : Cairo.t -> Cairo.point -> Cairo.point
    = "ml_cairo_device_to_user"
  external device_to_user_distance : Cairo.t -> Cairo.point -> Cairo.point
    = "ml_cairo_device_to_user_distance"
  external new_path : Cairo.t -> unit = "ml_cairo_new_path"
  external move_to : Cairo.t -> x:float -> y:float -> unit
    = "ml_cairo_move_to"
  val move_to_point : Cairo.t -> Cairo.point -> unit
  external new_sub_path : Cairo.t -> unit = "ml_cairo_new_sub_path"
  external line_to : Cairo.t -> x:float -> y:float -> unit
    = "ml_cairo_line_to"
  val line_to_point : Cairo.t -> Cairo.point -> unit
  external curve_to :
    Cairo.t ->
    x1:float ->
    y1:float -> x2:float -> y2:float -> x3:float -> y3:float -> unit
    = "ml_cairo_curve_to_bc" "ml_cairo_curve_to"
  val curve_to_point :
    Cairo.t -> Cairo.point -> Cairo.point -> Cairo.point -> unit
  external arc :
    Cairo.t ->
    xc:float ->
    yc:float -> radius:float -> angle1:float -> angle2:float -> unit
    = "ml_cairo_arc_bc" "ml_cairo_arc"
  external arc_negative :
    Cairo.t ->
    xc:float ->
    yc:float -> radius:float -> angle1:float -> angle2:float -> unit
    = "ml_cairo_arc_negative_bc" "ml_cairo_arc_negative"
  external rel_move_to : Cairo.t -> dx:float -> dy:float -> unit
    = "ml_cairo_rel_move_to"
  external rel_line_to : Cairo.t -> dx:float -> dy:float -> unit
    = "ml_cairo_rel_line_to"
  external rel_curve_to :
    Cairo.t ->
    dx1:float ->
    dy1:float -> dx2:float -> dy2:float -> dx3:float -> dy3:float -> unit
    = "ml_cairo_rel_curve_to_bc" "ml_cairo_rel_curve_to"
  external rectangle :
    Cairo.t -> x:float -> y:float -> width:float -> height:float -> unit
    = "ml_cairo_rectangle"
  external close_path : Cairo.t -> unit = "ml_cairo_close_path"
  external paint : Cairo.t -> unit = "ml_cairo_paint"
  external paint_with_alpha : Cairo.t -> float -> unit
    = "ml_cairo_paint_with_alpha"
  external mask : Cairo.t -> [> `Any ] Cairo.pattern -> unit
    = "ml_cairo_mask"
  external mask_surface :
    Cairo.t ->
    [> `Any ] Cairo.surface -> surface_x:float -> surface_y:float -> unit
    = "ml_cairo_mask_surface"
  external stroke : Cairo.t -> unit = "ml_cairo_stroke"
  external stroke_preserve : Cairo.t -> unit = "ml_cairo_stroke_preserve"
  external fill : Cairo.t -> unit = "ml_cairo_fill"
  external fill_preserve : Cairo.t -> unit = "ml_cairo_fill_preserve"
  external copy_page : Cairo.t -> unit = "ml_cairo_copy_page"
  external show_page : Cairo.t -> unit = "ml_cairo_show_page"
  external in_stroke : Cairo.t -> Cairo.point -> bool = "ml_cairo_in_stroke"
  external in_fill : Cairo.t -> Cairo.point -> bool = "ml_cairo_in_fill"
  external stroke_extents : Cairo.t -> float * float * float * float
    = "ml_cairo_stroke_extents"
  external fill_extents : Cairo.t -> float * float * float * float
    = "ml_cairo_fill_extents"
  external reset_clip : Cairo.t -> unit = "ml_cairo_reset_clip"
  external clip : Cairo.t -> unit = "ml_cairo_clip"
  external clip_preserve : Cairo.t -> unit = "ml_cairo_clip_preserve"
  type glyph = { index : int; glyph_x : float; glyph_y : float; }
  type text_extents = {
    x_bearing : float;
    y_bearing : float;
    text_width : float;
    text_height : float;
    x_advance : float;
    y_advance : float;
  }
  type font_extents = {
    ascent : float;
    descent : float;
    font_height : float;
    max_x_advance : float;
    max_y_advance : float;
  }
  type font_slant =
      FONT_SLANT_NORMAL
    | FONT_SLANT_ITALIC
    | FONT_SLANT_OBLIQUE
  type font_weight = FONT_WEIGHT_NORMAL | FONT_WEIGHT_BOLD
  type subpixel_order =
      SUBPIXEL_ORDER_DEFAULT
    | SUBPIXEL_ORDER_RGB
    | SUBPIXEL_ORDER_BGR
    | SUBPIXEL_ORDER_VRGB
    | SUBPIXEL_ORDER_VBGR
  type hint_style =
      HINT_STYLE_DEFAULT
    | HINT_STYLE_NONE
    | HINT_STYLE_SLIGHT
    | HINT_STYLE_MEDIUM
    | HINT_STYLE_FULL
  type hint_metrics =
      HINT_METRICS_DEFAULT
    | HINT_METRICS_OFF
    | HINT_METRICS_ON
  val font_face_get_type :
    [> `Any ] Cairo.font_face -> [ `ATSUI | `Any | `FT | `TOY | `Win32 ]
  val font_face_downcast_to_toy :
    [> `Any ] Cairo.font_face -> [ `Any | `TOY ] Cairo.font_face
  module Font_Options :
    sig
      type t
      external create : unit -> Cairo.Font_Options.t
        = "ml_cairo_font_options_create"
      external merge : Cairo.Font_Options.t -> Cairo.Font_Options.t -> unit
        = "ml_cairo_font_options_merge"
      external get_antialias : Cairo.Font_Options.t -> Cairo.antialias
        = "ml_cairo_font_options_get_antialias"
      external set_antialias :
        Cairo.Font_Options.t -> Cairo.antialias -> unit
        = "ml_cairo_font_options_set_antialias"
      external get_subpixel_order :
        Cairo.Font_Options.t -> Cairo.subpixel_order
        = "ml_cairo_font_options_get_subpixel_order"
      external set_subpixel_order :
        Cairo.Font_Options.t -> Cairo.subpixel_order -> unit
        = "ml_cairo_font_options_set_subpixel_order"
      external get_hint_style : Cairo.Font_Options.t -> Cairo.hint_style
        = "ml_cairo_font_options_get_hint_style"
      external set_hint_style :
        Cairo.Font_Options.t -> Cairo.hint_style -> unit
        = "ml_cairo_font_options_set_hint_style"
      external get_hint_metrics : Cairo.Font_Options.t -> Cairo.hint_metrics
        = "ml_cairo_font_options_get_hint_metrics"
      external set_hint_metrics :
        Cairo.Font_Options.t -> Cairo.hint_metrics -> unit
        = "ml_cairo_font_options_set_hint_metrics"
      type all =
          [ `ANTIALIAS_DEFAULT
          | `ANTIALIAS_GRAY
          | `ANTIALIAS_NONE
          | `ANTIALIAS_SUBPIXEL
          | `HINT_METRICS_DEFAULT
          | `HINT_METRICS_OFF
          | `HINT_METRICS_ON
          | `HINT_STYLE_DEFAULT
          | `HINT_STYLE_FULL
          | `HINT_STYLE_MEDIUM
          | `HINT_STYLE_NONE
          | `HINT_STYLE_SLIGHT
          | `SUBPIXEL_ORDER_BGR
          | `SUBPIXEL_ORDER_DEFAULT
          | `SUBPIXEL_ORDER_RGB
          | `SUBPIXEL_ORDER_VBGR
          | `SUBPIXEL_ORDER_VRGB ]
      val make : [< Cairo.Font_Options.all ] list -> Cairo.Font_Options.t
    end
  module Scaled_Font :
    sig
      type -'a t
      external create :
        ([> `Any ] as 'a) Cairo.font_face ->
        Cairo.matrix ->
        Cairo.matrix -> Cairo.Font_Options.t -> 'Cairo.Scaled_Font.t
        = "ml_cairo_scaled_font_create"
      val get_type :
        [> `Any ] Cairo.Scaled_Font.t ->
        [ `ATSUI | `Any | `FT | `TOY | `Win32 ]
      val downcast_to_toy :
        [> `Any ] Cairo.Scaled_Font.t -> [ `Any | `TOY ] Cairo.Scaled_Font.t
      external font_extents :
        [> `Any ] Cairo.Scaled_Font.t -> Cairo.font_extents
        = "ml_cairo_scaled_font_extents"
      external text_extents :
        [> `Any ] Cairo.Scaled_Font.t -> string -> Cairo.text_extents
        = "ml_cairo_scaled_font_text_extents"
      external glyph_extents :
        [> `Any ] Cairo.Scaled_Font.t ->
        Cairo.glyph array -> Cairo.text_extents
        = "ml_cairo_scaled_font_glyph_extents"
      external get_font_face :
        ([> `Any ] as 'a) Cairo.Scaled_Font.t -> 'Cairo.font_face
        = "ml_cairo_scaled_font_get_font_face"
      external get_font_matrix :
        [> `Any ] Cairo.Scaled_Font.t -> Cairo.matrix
        = "ml_cairo_scaled_font_get_font_matrix"
      external get_ctm : [> `Any ] Cairo.Scaled_Font.t -> Cairo.matrix
        = "ml_cairo_scaled_font_get_ctm"
      val get_font_options :
        [> `Any ] Cairo.Scaled_Font.t -> Cairo.Font_Options.t
    end
  external select_font_face :
    Cairo.t -> string -> Cairo.font_slant -> Cairo.font_weight -> unit
    = "ml_cairo_select_font_face"
  external set_font_size : Cairo.t -> float -> unit
    = "ml_cairo_set_font_size"
  external set_font_matrix : Cairo.t -> Cairo.matrix -> unit
    = "ml_cairo_set_font_matrix"
  external get_font_matrix : Cairo.t -> Cairo.matrix
    = "ml_cairo_get_font_matrix"
  external set_font_options : Cairo.t -> Cairo.Font_Options.t -> unit
    = "ml_cairo_set_font_matrix"
  val merge_font_options : Cairo.t -> Cairo.Font_Options.t -> unit
  val get_font_options : Cairo.t -> Cairo.Font_Options.t
  external set_scaled_font : Cairo.t -> [> `Any ] Cairo.Scaled_Font.t -> unit
    = "ml_cairo_set_scaled_font"
  external show_text : Cairo.t -> string -> unit = "ml_cairo_show_text"
  external show_glyphs : Cairo.t -> Cairo.glyph array -> unit
    = "ml_cairo_show_glyphs"
  external get_font_face : Cairo.t -> [ `Any ] Cairo.font_face
    = "ml_cairo_get_font_face"
  external font_extents : Cairo.t -> Cairo.font_extents
    = "ml_cairo_font_extents"
  external set_font_face : Cairo.t -> [> `Any ] Cairo.font_face -> unit
    = "ml_cairo_set_font_face"
  external text_extents : Cairo.t -> string -> Cairo.text_extents
    = "ml_cairo_text_extents"
  external glyph_extents : Cairo.t -> Cairo.glyph array -> Cairo.text_extents
    = "ml_cairo_glyph_extents"
  external text_path : Cairo.t -> string -> unit = "ml_cairo_text_path"
  external glyph_path : Cairo.t -> Cairo.glyph array -> unit
    = "ml_cairo_glyph_path"
  external get_operator : Cairo.t -> Cairo.operator = "ml_cairo_get_operator"
  external get_source : Cairo.t -> [ `Any ] Cairo.pattern
    = "ml_cairo_get_source"
  external get_tolerance : Cairo.t -> float = "ml_cairo_get_tolerance"
  external get_antialias : Cairo.t -> Cairo.antialias
    = "ml_cairo_get_antialias"
  external get_current_point : Cairo.t -> Cairo.point
    = "ml_cairo_get_current_point"
  external get_fill_rule : Cairo.t -> Cairo.fill_rule
    = "ml_cairo_get_fill_rule"
  external get_line_width : Cairo.t -> float = "ml_cairo_get_line_width"
  external get_line_cap : Cairo.t -> Cairo.line_cap = "ml_cairo_get_line_cap"
  external get_line_join : Cairo.t -> Cairo.line_join
    = "ml_cairo_get_line_join"
  external get_miter_limit : Cairo.t -> float = "ml_cairo_get_miter_limit"
  external get_matrix : Cairo.t -> Cairo.matrix = "ml_cairo_get_matrix"
  external get_target : Cairo.t -> [ `Any ] Cairo.surface
    = "ml_cairo_get_target"
  external get_group_target : Cairo.t -> [ `Any ] Cairo.surface
    = "ml_cairo_get_group_target"
  type flat_path =
      [ `CLOSE | `LINE_TO of Cairo.point | `MOVE_TO of Cairo.point ]
  type path =
      [ `CLOSE
      | `CURVE_TO of Cairo.point * Cairo.point * Cairo.point
      | `LINE_TO of Cairo.point
      | `MOVE_TO of Cairo.point ]
  external fold_path : Cairo.t -> ('-> [> Cairo.path ] -> 'a) -> '-> 'a
    = "ml_cairo_copy_path"
  external fold_path_flat :
    Cairo.t -> ('-> [> Cairo.flat_path ] -> 'a) -> '-> 'a
    = "ml_cairo_copy_path_flat"
  val append_path : Cairo.t -> [< Cairo.path ] -> unit
  external surface_create_similar :
    [> `Any ] Cairo.surface ->
    Cairo.content -> width:int -> height:int -> [ `Any ] Cairo.surface
    = "ml_cairo_surface_create_similar"
  external surface_finish : [> `Any ] Cairo.surface -> unit
    = "ml_cairo_surface_finish"
  val surface_get_type :
    [> `Any ] Cairo.surface ->
    [ `Any
    | `BeOS
    | `DirectFB
    | `Glitz
    | `Image
    | `PDF
    | `PS
    | `Quartz
    | `SVG
    | `Win32
    | `XCB
    | `Xlib ]
  external surface_get_content : [> `Any ] Cairo.surface -> Cairo.content
    = "ml_cairo_surface_get_content"
  val surface_get_font_options :
    [> `Any ] Cairo.surface -> Cairo.Font_Options.t
  external surface_flush : [> `Any ] Cairo.surface -> unit
    = "ml_cairo_surface_flush"
  external mark_dirty : [> `Any ] Cairo.surface -> unit
    = "ml_cairo_surface_mark_dirty"
  external mark_dirty_rectangle :
    [> `Any ] Cairo.surface -> int -> int -> int -> int -> unit
    = "ml_cairo_surface_mark_dirty_rectangle"
  external surface_set_device_offset :
    [> `Any ] Cairo.surface -> float -> float -> unit
    = "ml_cairo_surface_set_device_offset"
  external surface_get_device_offset :
    [> `Any ] Cairo.surface -> float * float
    = "ml_cairo_surface_get_device_offset"
  external surface_set_fallback_resolution :
    [> `Any ] Cairo.surface -> float -> float -> unit
    = "ml_cairo_surface_set_fallback_resolution"
  type image_surface = [ `Any | `Image ] Cairo.surface
  type format = FORMAT_ARGB32 | FORMAT_RGB24 | FORMAT_A8 | FORMAT_A1
  external image_surface_create :
    Cairo.format -> width:int -> height:int -> Cairo.image_surface
    = "ml_cairo_image_surface_create"
  external image_surface_get_format :
    [> `Image ] Cairo.surface -> Cairo.format
    = "ml_cairo_image_surface_get_format"
  external image_surface_get_width : [> `Image ] Cairo.surface -> int
    = "ml_cairo_image_surface_get_width"
  external image_surface_get_height : [> `Image ] Cairo.surface -> int
    = "ml_cairo_image_surface_get_height"
  external image_surface_get_stride : [> `Image ] Cairo.surface -> int
    = "ml_cairo_image_surface_get_stride"
  type solid_pattern = [ `Any | `Solid ] Cairo.pattern
  type surface_pattern = [ `Any | `Surface ] Cairo.pattern
  type gradient_pattern = [ `Any | `Gradient ] Cairo.pattern
  type extend = EXTEND_NONE | EXTEND_REPEAT | EXTEND_REFLECT
  type filter =
      FILTER_FAST
    | FILTER_GOOD
    | FILTER_BEST
    | FILTER_NEAREST
    | FILTER_BILINEAR
    | FILTER_GAUSSIAN
  module Pattern :
    sig
      val get_type :
        [> `Any ] Cairo.pattern ->
        [ `Any | `Linear | `Radial | `Solid | `Surface ]
      val downcast_to_solid : [> `Any ] Cairo.pattern -> Cairo.solid_pattern
      val downcast_to_surface :
        [> `Any ] Cairo.pattern -> Cairo.surface_pattern
      val downcast_to_gradient :
        [> `Any ] Cairo.pattern -> Cairo.gradient_pattern
      external create_rgb :
        red:float -> green:float -> blue:float -> Cairo.solid_pattern
        = "ml_cairo_pattern_create_rgb"
      external create_rgba :
        red:float ->
        green:float -> blue:float -> alpha:float -> Cairo.solid_pattern
        = "ml_cairo_pattern_create_rgba"
      external create_for_surface :
        [> `Any ] Cairo.surface -> Cairo.surface_pattern
        = "ml_cairo_pattern_create_for_surface"
      external create_linear :
        x0:float ->
        y0:float -> x1:float -> y1:float -> Cairo.gradient_pattern
        = "ml_cairo_pattern_create_linear"
      external create_radial :
        cx0:float ->
        cy0:float ->
        radius0:float ->
        cx1:float -> cy1:float -> radius1:float -> Cairo.gradient_pattern
        = "ml_cairo_pattern_create_radial_bc"
        "ml_cairo_pattern_create_radial"
      external add_color_stop_rgb :
        [> `Gradient ] Cairo.pattern ->
        off:float -> red:float -> green:float -> blue:float -> unit
        = "ml_cairo_pattern_add_color_stop_rgb"
      external add_color_stop_rgba :
        [> `Gradient ] Cairo.pattern ->
        off:float ->
        red:float -> green:float -> blue:float -> alpha:float -> unit
        = "ml_cairo_pattern_add_color_stop_rgba_bc"
        "ml_cairo_pattern_add_color_stop_rgba"
      external set_matrix : [> `Any ] Cairo.pattern -> Cairo.matrix -> unit
        = "ml_cairo_pattern_set_matrix"
      external get_matrix : [> `Any ] Cairo.pattern -> Cairo.matrix
        = "ml_cairo_pattern_get_matrix"
      external set_extend :
        [> `Surface ] Cairo.pattern -> Cairo.extend -> unit
        = "ml_cairo_pattern_set_extend"
      external get_extend : [> `Surface ] Cairo.pattern -> Cairo.extend
        = "ml_cairo_pattern_get_extend"
      external set_filter :
        [> `Surface ] Cairo.pattern -> Cairo.filter -> unit
        = "ml_cairo_pattern_set_filter"
      external get_filter : [> `Surface ] Cairo.pattern -> Cairo.filter
        = "ml_cairo_pattern_get_filter"
    end
  module Matrix :
    sig
      val init_identity : Cairo.matrix
      val init_translate : float -> float -> Cairo.matrix
      val init_scale : float -> float -> Cairo.matrix
      val init_rotate : float -> Cairo.matrix
      external translate : Cairo.matrix -> float -> float -> Cairo.matrix
        = "ml_cairo_matrix_translate"
      external scale : Cairo.matrix -> float -> float -> Cairo.matrix
        = "ml_cairo_matrix_scale"
      external rotate : Cairo.matrix -> float -> Cairo.matrix
        = "ml_cairo_matrix_rotate"
      external invert : Cairo.matrix -> Cairo.matrix
        = "ml_cairo_matrix_invert"
      external multiply : Cairo.matrix -> Cairo.matrix -> Cairo.matrix
        = "ml_cairo_matrix_multiply"
      external transform_distance :
        Cairo.matrix -> Cairo.point -> Cairo.point
        = "ml_cairo_matrix_transform_distance"
      external transform_point : Cairo.matrix -> Cairo.point -> Cairo.point
        = "ml_cairo_matrix_transform_point"
    end
end