 : cairo_set_font_size ( cairo_t scale -- )
     "void" "cairo" "cairo_set_font_size" [ "cairo_t*" "double" ] alien-invoke ;
 
-: cairo_identity_matrix ( cairo_t -- )
-    "void" "cairo" "cairo_identity_matrix" [ "cairo_t*" ] alien-invoke ;
+: cairo_set_font_matrix ( cairo_t cairo_matrix_t -- )
+  	"void" "cairo" "cairo_set_font_matrix" [ "cairo_t*" "cairo_matrix_t*" ] alien-invoke ;
+
+: cairo_get_font_matrix ( cairo_t cairo_matrix_t -- )
+  	"void" "cairo" "cairo_get_font_matrix" [ "cairo_t*" "cairo_matrix_t*" ] alien-invoke ;
+
+
+
+! Cairo pdf
+
+: cairo_pdf_surface_create ( filename width height -- surface )
+  "void*" "cairo" "cairo_pdf_surface_create" [ "char*" "double" "double" ] alien-invoke ;
+
+! Missing:
+
+! cairo_public cairo_surface_t *
+! cairo_pdf_surface_create_for_stream (cairo_write_func_t write_func,
+!                                      void              *closure,
+!                                      double             width_in_points,
+!                                      double             height_in_points);
+
+: cairo_pdf_surface_set_size ( surface width height -- )
+  "void" "cairo" "cairo_pdf_surface_set_size" [ "void*" "double" "double" ] alien-invoke ;

: cairo_clip_preserve ( cairo_t -- )
    "void" "cairo" "cairo_clip_preserve" [ "cairo_t*" ] alien-invoke ;

: cairo_set_source ( cairo_t cairo_pattern_t -- )
    "void" "cairo" "cairo_set_source" [ "cairo_t*" "void*" ] alien-invoke ;

: cairo_pattern_create_linear ( x0 y0 x1 y1 -- cairo_pattern_t )
    "void*" "cairo" "cairo_pattern_create_linear" [ "double" "double" "double" "double" ] alien-invoke ;

! Bindings for Cairo library
!  Copyright (c) 2007 Sampo Vuori
!    License: http://factorcode.org/license.txt

! Unimplemented:
!  - most of the font stuff
!  - most of the matrix stuff
!  - most of the query functions


USING: alien alien.syntax combinators system ;

IN: cairo

: load-cairo-library ( -- )
  "cairo" {
	{ [ win32? ] [ "cairo.dll" ] }
	{ [ macosx? ] [ "libcairo.dylib" ] }
	{ [ unix? ] [ "libcairo.so.2" ] }
  } cond "cdecl" add-library ; parsing

load-cairo-library

! cairo_status_t
C-ENUM:
