(define-entity Surface
  (in-module "Cairo")
  (c-name "cairo_surface_t")
  (import-header "cairo-svg.h")
  (import-header "cairo-pdf.h")
)

(define-method destroy
  (of-object "cairo_surface_t")
  (c-name "cairo_surface_destroy")
  (return-type "none")
)

(define-method flush
  (of-object "cairo_surface_t")
  (c-name "cairo_surface_flush")
  (return-type "none")
)

(define-method finish
  (of-object "cairo_surface_t")
  (c-name "cairo_surface_finish")
  (return-type "none")
)

(define-method write_to_png
  (of-object "cairo_surface_t")
  (c-name "cairo_surface_write_to_png")
  (return-type "cairo_status_t")
  (parameters
    '("const-char*" "filename")
  )
)

(define-function create_similar
  (of-object "cairo_surface_t")
  (c-name "cairo_surface_create_similar")
  (caller-owns-return #t)
  (return-type "cairo_surface_t*")
  (parameters
    '("cairo_surface_t*" "other")
    '("cairo_content_t" "content")
    '("int" "width")
    '("int" "height")
  )
)

(define-method status
  (of-object "cairo_surface_t")
  (c-name "cairo_surface_status")
  (return-type "cairo_status_t")
)

(define-function cairo_image_surface_new
  (is-constructor-of "cairo_surface_t")
  (c-name "cairo_image_surface_create")
  (caller-owns-return #t)
  (return-type "cairo_surface_t*")
  (parameters
    '("cairo_format_t" "format")
    '("int" "width")
    '("int" "height")
  )
)

(define-function cairo_surface_new_svg
  (is-constructor-of "cairo_surface_t")
  (c-name "cairo_svg_surface_create")
  (caller-owns-return #t)
  (return-type "cairo_surface_t*")
  (parameters
    '("const-char*" "filename")
    '("double" "width_in_points")
    '("double" "height_in_points")
  )
)

(define-function cairo_surface_new_pdf
  (is-constructor-of "cairo_surface_t")
  (c-name "cairo_pdf_surface_create")
  (caller-owns-return #t)
  (return-type "cairo_surface_t*")
  (parameters
    '("const-char*" "filename" (null-ok))
    '("double" "width_in_points")
    '("double" "height_in_points")
  )
)

(define-method show_page
  (of-object "cairo_surface_t")
  (c-name "cairo_surface_show_page")
  (return-type "none")
)

(define-method copy_page
  (of-object "cairo_surface_t")
  (c-name "cairo_surface_copy_page")
  (return-type "none")
)

