[cairo-commit] cairo-ocaml/src ml_cairo_ft.c, 1.6, 1.7 caml_io.h, 1.1.1.1, NONE cairo_png.mli, 1.2, 1.3 cairo_png.ml, 1.2, 1.3 cairo_ft.mli, 1.4, 1.5 cairo_ft.ml, 1.4, 1.5 cairo.mli, 1.18, 1.19 cairo.ml, 1.16, 1.17 Makefile, 1.10, 1.11

Olivier Andrieu commit at pdx.freedesktop.org
Mon Jul 18 14:10:29 PDT 2005


Committed by: oandrieu

Update of /cvs/cairo/cairo-ocaml/src
In directory gabe:/tmp/cvs-serv5619/src

Modified Files:
	ml_cairo_ft.c cairo_png.mli cairo_png.ml cairo_ft.mli 
	cairo_ft.ml cairo.mli cairo.ml Makefile 
Removed Files:
	caml_io.h 
Log Message:
* src/cairo_ft.ml, src/cairo_ft.mli, src/ml_cairo_ft.c: re-enable
freetype font backend bindings

* test/font.ml: adapt

* src/cairo.mli, src/cairo_png.mli: use `Any surface instead of 'a
surface everywhere


Index: ml_cairo_ft.c
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ml_cairo_ft.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- ml_cairo_ft.c	22 May 2005 20:03:15 -0000	1.6
+++ ml_cairo_ft.c	18 Jul 2005 21:10:27 -0000	1.7
@@ -24,13 +24,21 @@
     {
       caml_exn = caml_named_value ("FT_exn");
       if (caml_exn == NULL)
-	failwith ("freetype error");
+	caml_failwith ("freetype error");
     }
 
-  raise_with_arg (*caml_exn, Val_int (err));
+  caml_raise_with_arg (*caml_exn, Val_int (err));
 }
 
-#define FT_Library_val(v) (FT_Library)Pointer_val(v)
+static value
+Val_ptr (void *p)
+{
+  value v = caml_alloc_small (1, Abstract_tag);
+  Field (v, 0) = Val_bp (p);
+  return v;
+}
+
+#define FT_Library_val(v) (FT_Library)(Field(v, 0))
 
 CAMLprim value
 ml_FT_Init_FreeType (value unit)
@@ -47,13 +55,13 @@
   return Val_unit;
 }
 
-#define FT_Face_val(v) (FT_Face)Pointer_val(v)
+#define FT_Face_val(v) (FT_Face)(Field(v, 0))
 
 CAMLprim value
 ml_FT_New_Face (value lib, value o_index, value path)
 {
   FT_Face face;
-  FT_Long index = Option_val(o_index, Long_val, 0);
+  FT_Long index = Is_block(o_index) ? Long_val(Field(o_index, 0)) : 0;
   ml_raise_FT_Error (FT_New_Face (FT_Library_val (lib),
 				  String_val (path),
 				  index, &face));
@@ -68,10 +76,23 @@
 }
 
 /* minimal Fontconfig interface */
-Make_Val_final_pointer (FcPattern, Id, FcPatternDestroy, 10)
-#define FcPattern_val(v) (FcPattern *)Pointer_val(v)
+wMake_Val_final_pointer (FcPattern, FcPatternDestroy, 10)
+#define FcPattern_val(v) wPointer_val(FcPattern,v)
 
-ML_1 (FcNameParse, String_val, Val_FcPattern)
+#define UString_val(v) ((unsigned char *) (v))
+
+CAMLprim value
+ml_FcNameParse (value s)
+{
+  FcPattern *p1, *p2;
+  FcResult res;
+  p1 = FcNameParse (UString_val(s));
+  FcConfigSubstitute (NULL, p1, FcMatchPattern);
+  FcDefaultSubstitute (p1);
+  p2 = FcFontMatch (NULL, p1, &res);
+  FcPatternDestroy (p1);
+  return Val_FcPattern (p2);
+}
 
 CAMLprim value
 ml_FcNameUnparse (value patt)
@@ -80,27 +101,17 @@
   value r;
   s = FcNameUnparse (FcPattern_val (patt));
   if (s == NULL)
-    failwith ("FcNameUnparse");
-  r = copy_string (s);
+    caml_failwith ("FcNameUnparse");
+  r = caml_copy_string ((char *) s);
   free (s);
   return r;
 }
 
 /* cairo Fontconfig/Freetype font backend */
-ML_2 (cairo_ft_font_create, FcPattern_val, cairo_matrix_t_val, Val_cairo_font_t)
-ML_3 (cairo_ft_font_create_for_ft_face, FT_Face_val, Int_val, cairo_matrix_t_val, Val_cairo_font_t)
-ML_1 (cairo_ft_font_lock_face, cairo_font_t_val, Val_ptr)
-ML_1 (cairo_ft_font_unlock_face, cairo_font_t_val, Unit)
-CAMLprim value
-ml_cairo_ft_font_get_pattern (value font)
-{
-  FcPattern *p;
-  p = cairo_ft_font_get_pattern (cairo_font_t_val (font));
-  if (p == NULL)
-    failwith ("cairo_ft_font_get_pattern: NULL pointer");
-  FcPatternReference (p);
-  return Val_FcPattern (p);
-}
+wML_1 (cairo_ft_font_face_create_for_pattern, FcPattern_val, Val_cairo_font_face_t)
+wML_2 (cairo_ft_font_face_create_for_ft_face, FT_Face_val, Int_val, Val_cairo_font_face_t)
+wML_1 (cairo_ft_scaled_font_lock_face, cairo_scaled_font_t_val, Val_ptr)
+wML_1 (cairo_ft_scaled_font_unlock_face, cairo_scaled_font_t_val, Unit)
 
 #else
 
@@ -110,10 +121,9 @@
 Unsupported (ml_FT_Done_Face)
 Unsupported (ml_FcNameParse)
 Unsupported (ml_FcNameUnparse)
-Unsupported (ml_cairo_ft_font_create)
+Unsupported (ml_cairo_ft_font_create_for_pattern)
 Unsupported (ml_cairo_ft_font_create_for_ft_face)
-Unsupported (ml_cairo_ft_font_lock_face)
-Unsupported (ml_cairo_ft_font_unlock_face)
-Unsupported (ml_cairo_ft_font_get_pattern)
+Unsupported (ml_cairo_ft_scaled_font_lock_face)
+Unsupported (ml_cairo_ft_scaled_font_unlock_face)
 
 #endif /* CAIRO_HAS_FT_FONT */

--- caml_io.h DELETED ---

Index: cairo_png.mli
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/cairo_png.mli,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo_png.mli	26 May 2005 23:56:11 -0000	1.2
+++ cairo_png.mli	18 Jul 2005 21:10:27 -0000	1.3
@@ -19,10 +19,10 @@
 
 
 val surface_write_to_channel : 
-  'a Cairo.surface -> out_channel -> unit
+  [> `Any] Cairo.surface -> out_channel -> unit
 
 val surface_write_to_file : 
-  'a Cairo.surface -> string -> unit
+  [> `Any] Cairo.surface -> string -> unit
 
 external surface_write_to_stream : 
-  'a Cairo.surface -> (string -> unit) -> unit = "ml_cairo_surface_write_to_png_stream"
+  [> `Any] Cairo.surface -> (string -> unit) -> unit = "ml_cairo_surface_write_to_png_stream"

Index: cairo_png.ml
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/cairo_png.ml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo_png.ml	26 May 2005 23:56:11 -0000	1.2
+++ cairo_png.ml	18 Jul 2005 21:10:27 -0000	1.3
@@ -32,7 +32,7 @@
 
 
 external surface_write_to_stream_unsafe : 
-  'a Cairo.surface -> (string -> int -> unit) -> unit = "ml_cairo_surface_write_to_png_stream_unsafe"
+  [> `Any] Cairo.surface -> (string -> int -> unit) -> unit = "ml_cairo_surface_write_to_png_stream_unsafe"
 
 let unsafe_output_string oc s n =
   for i = 0 to n - 1 do
@@ -45,7 +45,7 @@
     (unsafe_output_string oc)
 
 let surface_write_to_file surf fname =
-  let oc = open_out fname in
+  let oc = open_out_bin fname in
   try
     surface_write_to_channel surf oc ;
     close_out oc
@@ -54,4 +54,4 @@
     raise exn
 
 external surface_write_to_stream : 
-  'a Cairo.surface -> (string -> unit) -> unit = "ml_cairo_surface_write_to_png_stream"
+  [> `Any] Cairo.surface -> (string -> unit) -> unit = "ml_cairo_surface_write_to_png_stream"

Index: cairo_ft.mli
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/cairo_ft.mli,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cairo_ft.mli	9 Mar 2005 00:40:22 -0000	1.4
+++ cairo_ft.mli	18 Jul 2005 21:10:27 -0000	1.5
@@ -22,15 +22,16 @@
 
 type fc_pattern
 external fc_name_parse : string -> fc_pattern = "ml_FcNameParse"
+(** this is a hack: this actually calls FcNameParse, FcConfigSubstitute, 
+    FcDefaultSubstitute and FcFontMatch *)
 external fc_name_unparse : fc_pattern -> string = "ml_FcNameUnparse"
 
-external font_create : ft_library -> fc_pattern -> Cairo.font
-  = "ml_cairo_ft_font_create"
-external font_create_for_ft_face : ft_face -> Cairo.font
-  = "ml_cairo_ft_font_create_for_ft_face"
-
+type font_face = [`Any|`FT] Cairo.font_face
 
-external font_lock_face : Cairo.font -> ft_face = "ml_cairo_ft_font_lock_face"
-external font_unlock_face : Cairo.font -> unit = "ml_cairo_ft_font_unlock_face"
+external font_face_create_for_pattern : fc_pattern -> font_face
+  = "ml_cairo_ft_font_face_create_for_pattern"
+external font_face_create_for_ft_face : ft_face -> int -> font_face
+  = "ml_cairo_ft_font_face_create_for_ft_face"
 
-external font_get_pattern : Cairo.font -> fc_pattern = "ml_cairo_ft_font_get_pattern"
+external font_lock_face   : [>`FT] Cairo.Scaled_Font.t -> ft_face = "ml_cairo_ft_scaled_font_lock_face"
+external font_unlock_face : [>`FT] Cairo.Scaled_Font.t -> unit    = "ml_cairo_ft_scaled_font_unlock_face"

Index: cairo_ft.ml
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/cairo_ft.ml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cairo_ft.ml	9 Mar 2005 00:40:22 -0000	1.4
+++ cairo_ft.ml	18 Jul 2005 21:10:27 -0000	1.5
@@ -22,9 +22,10 @@
 external fc_name_parse   : string -> fc_pattern = "ml_FcNameParse"
 external fc_name_unparse : fc_pattern -> string = "ml_FcNameUnparse"
 
-external font_create : ft_library -> fc_pattern -> Cairo.font = "ml_cairo_ft_font_create"
-external font_create_for_ft_face : ft_face -> Cairo.font = "ml_cairo_ft_font_create_for_ft_face"
-external font_lock_face : Cairo.font -> ft_face = "ml_cairo_ft_font_lock_face"
-external font_unlock_face : Cairo.font -> unit = "ml_cairo_ft_font_unlock_face"
+type font_face = [`Any|`FT] Cairo.font_face
 
-external font_get_pattern : Cairo.font -> fc_pattern = "ml_cairo_ft_font_get_pattern"
+external font_face_create_for_pattern : fc_pattern -> font_face     = "ml_cairo_ft_font_face_create_for_pattern"
+external font_face_create_for_ft_face : ft_face -> int -> font_face = "ml_cairo_ft_font_face_create_for_ft_face"
+
+external font_lock_face   : [> `FT] Cairo.Scaled_Font.t -> ft_face = "ml_cairo_ft_scaled_font_lock_face"
+external font_unlock_face : [> `FT] Cairo.Scaled_Font.t -> unit    = "ml_cairo_ft_scaled_font_unlock_face"

Index: cairo.mli
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/cairo.mli,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cairo.mli	18 Jul 2005 19:11:05 -0000	1.18
+++ cairo.mli	18 Jul 2005 21:10:27 -0000	1.19
@@ -34,7 +34,7 @@
 type t
 type -'a surface
 type -'a pattern
-type font_face
+type -'a font_face
 
 type point = { x : float ; y : float }
 type matrix = {
@@ -45,7 +45,7 @@
 
 (** {3 Core API} *)
 
-val create : 'a surface -> t
+val create : [> `Any] surface -> t
 external save    : t -> unit = "ml_cairo_save"
 external restore : t -> unit = "ml_cairo_restore"
 
@@ -78,8 +78,8 @@
 
 external set_source_rgb  : t -> red:float -> green:float -> blue:float -> unit = "ml_cairo_set_source_rgb"
 external set_source_rgba : t -> red:float -> green:float -> blue:float -> alpha:float ->unit = "ml_cairo_set_source_rgba"
-external set_source : t -> 'a pattern -> unit = "ml_cairo_set_source"
-external set_source_surface : t -> 'a surface -> float -> float -> unit = "ml_cairo_set_source_surface"
+external set_source : t -> [> `Any] pattern -> unit = "ml_cairo_set_source"
+external set_source_surface : t -> [> `Any] surface -> float -> float -> unit = "ml_cairo_set_source_surface"
 
 external set_tolerance : t -> float -> unit = "ml_cairo_set_tolerance"
 
@@ -135,8 +135,8 @@
 external paint : t -> unit = "ml_cairo_paint"
 external paint_with_alpha : t -> float -> unit = "ml_cairo_paint_with_alpha"
 
-external mask : t -> 'a pattern -> unit = "ml_cairo_mask"
-external mask_surface : t -> 'a surface -> surface_x:float -> surface_y:float -> unit = "ml_cairo_mask_surface"
+external mask : t -> [> `Any] pattern -> unit = "ml_cairo_mask"
+external mask_surface : t -> [> `Any] surface -> surface_x:float -> surface_y:float -> unit = "ml_cairo_mask_surface"
 
 external stroke : t -> unit = "ml_cairo_stroke"
 external stroke_preserve : t -> unit = "ml_cairo_stroke_preserve"
@@ -186,9 +186,9 @@
 external get_font_matrix : t -> matrix = "ml_cairo_get_font_matrix"
 external show_text : t -> string -> unit = "ml_cairo_show_text"
 external show_glyphs : t -> glyph array -> unit = "ml_cairo_show_glyphs"
-external get_font_face : t -> font_face = "ml_cairo_get_font_face"
+external get_font_face : t -> [`Any] font_face = "ml_cairo_get_font_face"
 external font_extents : t -> font_extents = "ml_cairo_font_extents"
-external set_font_face : t -> font_face -> unit = "ml_cairo_set_font_face"
+external set_font_face : t -> [> `Any] font_face -> unit = "ml_cairo_set_font_face"
 external text_extents : t -> string -> text_extents = "ml_cairo_text_extents"
 external glyph_extents : t -> glyph array -> text_extents = "ml_cairo_glyph_extents"
 external text_path : t -> string -> unit = "ml_cairo_text_path"
@@ -197,7 +197,7 @@
 (** {4 Renderer state querying} *)
 
 external get_operator : t -> operator = "ml_cairo_get_operator"
-external get_source : t -> 'a pattern = "ml_cairo_get_source"
+external get_source : t -> [`Any] pattern = "ml_cairo_get_source"
 external get_tolerance : t -> float = "ml_cairo_get_tolerance"
 external get_current_point : t -> point = "ml_cairo_get_current_point"
 external get_fill_rule : t -> fill_rule = "ml_cairo_get_fill_rule"
@@ -206,7 +206,7 @@
 external get_line_join : t -> line_join = "ml_cairo_get_line_join"
 external get_miter_limit : t -> float = "ml_cairo_get_miter_limit"
 external get_matrix : t -> matrix = "ml_cairo_get_matrix"
-external get_target : t -> 'a surface = "ml_cairo_get_target"
+external get_target : t -> [`Any] surface = "ml_cairo_get_target"
 
 type flat_path = [
   | `MOVE_TO of point
@@ -227,11 +227,11 @@
   | CONTENT_ALPHA
   | CONTENT_COLOR_ALPHA
 
-external surface_create_similar : 'a surface -> content -> width:int -> height:int -> 'a surface = "ml_cairo_surface_create_similar"
+external surface_create_similar : [> `Any] surface -> content -> width:int -> height:int -> [`Any] surface = "ml_cairo_surface_create_similar"
 
-external surface_finish : 'a surface -> unit = "ml_cairo_surface_finish"
+external surface_finish : [> `Any] surface -> unit = "ml_cairo_surface_finish"
 
-external surface_set_device_offset : 'a surface -> float -> float -> unit = "ml_cairo_surface_set_device_offset"
+external surface_set_device_offset : [> `Any] surface -> float -> float -> unit = "ml_cairo_surface_set_device_offset"
 
 (** {4 Image surface} *)
 
@@ -270,15 +270,15 @@
 module Pattern : sig
 external create_rgb  : red:float -> green:float -> blue:float -> solid_pattern = "ml_cairo_pattern_create_rgb"
 external create_rgba : red:float -> green:float -> blue:float -> alpha:float -> solid_pattern = "ml_cairo_pattern_create_rgba"
-external create_for_surface : 'a surface -> surface_pattern = "ml_cairo_pattern_create_for_surface"
+external create_for_surface : [> `Any] surface -> surface_pattern = "ml_cairo_pattern_create_for_surface"
 external create_linear : x0:float -> y0:float -> x1:float -> y1:float -> gradient_pattern = "ml_cairo_pattern_create_linear"
 external create_radial : cx0:float -> cy0:float -> radius0:float -> cx1:float -> cy1:float -> radius1:float -> gradient_pattern = "ml_cairo_pattern_create_radial_bc" "ml_cairo_pattern_create_radial"
 
 external add_color_stop_rgb  : [>`Gradient] pattern -> off:float -> red:float -> green:float -> blue:float -> unit = "ml_cairo_pattern_add_color_stop_rgb"
 external add_color_stop_rgba : [>`Gradient] 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 : 'a pattern -> matrix -> unit = "ml_cairo_pattern_set_matrix"
-external get_matrix : 'a pattern -> matrix = "ml_cairo_pattern_get_matrix"
+external set_matrix : [> `Any] pattern -> matrix -> unit = "ml_cairo_pattern_set_matrix"
+external get_matrix : [> `Any] pattern -> matrix = "ml_cairo_pattern_get_matrix"
 
 external set_extend : [> `Surface] pattern -> extend -> unit = "ml_cairo_pattern_set_extend"
 external get_extend : [> `Surface] pattern -> extend = "ml_cairo_pattern_get_extend"
@@ -310,9 +310,9 @@
 
 (** Scaled fonts functions *)
 module Scaled_Font : sig
-type t
+type -'a t
 
-external create : font_face -> matrix -> matrix -> t = "ml_cairo_scaled_font_create"
-external font_extents : t -> font_extents = "ml_cairo_scaled_font_extents"
-external glyph_extents : t -> glyph array -> text_extents = "ml_cairo_scaled_font_glyph_extents"
+external create : ([>`Any] as 'a) font_face -> matrix -> matrix -> 'a t = "ml_cairo_scaled_font_create"
+external font_extents : [> `Any] t -> font_extents = "ml_cairo_scaled_font_extents"
+external glyph_extents : [>`Any] t -> glyph array -> text_extents = "ml_cairo_scaled_font_glyph_extents"
 end

Index: cairo.ml
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/cairo.ml,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cairo.ml	18 Jul 2005 19:11:05 -0000	1.16
+++ cairo.ml	18 Jul 2005 21:10:27 -0000	1.17
@@ -28,7 +28,7 @@
 type t
 type -'a surface
 type -'a pattern
-type font_face
+type -'a font_face
 
 type point = { x : float ; y : float }
 type matrix = {
@@ -37,7 +37,7 @@
     x0 : float ; y0 : float 
   }
 
-external create : 'a surface -> t = "ml_cairo_create"
+external create : [> `Any] surface -> t = "ml_cairo_create"
 external save : t -> unit = "ml_cairo_save"
 external restore : t -> unit = "ml_cairo_restore"
 
@@ -64,8 +64,8 @@
 
 external set_source_rgb  : t -> red:float -> green:float -> blue:float -> unit = "ml_cairo_set_source_rgb"
 external set_source_rgba : t -> red:float -> green:float -> blue:float -> alpha:float ->unit = "ml_cairo_set_source_rgba"
-external set_source : t -> 'a pattern -> unit = "ml_cairo_set_source"
-external set_source_surface : t -> 'a surface -> float -> float -> unit = "ml_cairo_set_source_surface"
+external set_source : t -> [> `Any] pattern -> unit = "ml_cairo_set_source"
+external set_source_surface : t -> [> `Any] surface -> float -> float -> unit = "ml_cairo_set_source_surface"
 
 external set_tolerance : t -> float -> unit = "ml_cairo_set_tolerance"
 
@@ -115,8 +115,8 @@
 external paint : t -> unit = "ml_cairo_paint"
 external paint_with_alpha : t -> float -> unit = "ml_cairo_paint_with_alpha"
 
-external mask : t -> 'a pattern -> unit = "ml_cairo_mask"
-external mask_surface : t -> 'a surface -> surface_x:float -> surface_y:float -> unit = "ml_cairo_mask_surface"
+external mask : t -> [> `Any] pattern -> unit = "ml_cairo_mask"
+external mask_surface : t -> [> `Any] surface -> surface_x:float -> surface_y:float -> unit = "ml_cairo_mask_surface"
 
 external stroke : t -> unit = "ml_cairo_stroke"
 external stroke_preserve : t -> unit = "ml_cairo_stroke_preserve"
@@ -162,16 +162,16 @@
 external get_font_matrix : t -> matrix = "ml_cairo_get_font_matrix"
 external show_text : t -> string -> unit = "ml_cairo_show_text"
 external show_glyphs : t -> glyph array -> unit = "ml_cairo_show_glyphs"
-external get_font_face : t -> font_face = "ml_cairo_get_font_face"
+external get_font_face : t -> [`Any] font_face = "ml_cairo_get_font_face"
 external font_extents : t -> font_extents = "ml_cairo_font_extents"
-external set_font_face : t -> font_face -> unit = "ml_cairo_set_font_face"
+external set_font_face : t -> [> `Any] font_face -> unit = "ml_cairo_set_font_face"
 external text_extents : t -> string -> text_extents = "ml_cairo_text_extents"
 external glyph_extents : t -> glyph array -> text_extents = "ml_cairo_glyph_extents"
 external text_path : t -> string -> unit = "ml_cairo_text_path"
 external glyph_path : t -> glyph array -> unit = "ml_cairo_glyph_path"
 
 external get_operator : t -> operator = "ml_cairo_get_operator"
-external get_source : t -> 'a pattern = "ml_cairo_get_source"
+external get_source : t -> [`Any] pattern = "ml_cairo_get_source"
 external get_tolerance : t -> float = "ml_cairo_get_tolerance"
 external get_current_point : t -> point = "ml_cairo_get_current_point"
 external get_fill_rule : t -> fill_rule = "ml_cairo_get_fill_rule"
@@ -180,7 +180,7 @@
 external get_line_join : t -> line_join = "ml_cairo_get_line_join"
 external get_miter_limit : t -> float = "ml_cairo_get_miter_limit"
 external get_matrix : t -> matrix = "ml_cairo_get_matrix"
-external get_target : t -> 'a surface = "ml_cairo_get_target"
+external get_target : t -> [`Any] surface = "ml_cairo_get_target"
 
 type flat_path = [
   | `MOVE_TO of point
@@ -210,11 +210,11 @@
   | CONTENT_ALPHA
   | CONTENT_COLOR_ALPHA
 
-external surface_create_similar : 'a surface -> content -> width:int -> height:int -> 'a surface = "ml_cairo_surface_create_similar"
+external surface_create_similar : [> `Any] surface -> content -> width:int -> height:int -> [`Any] surface = "ml_cairo_surface_create_similar"
 
-external surface_finish : 'a surface -> unit = "ml_cairo_surface_finish"
+external surface_finish : [> `Any] surface -> unit = "ml_cairo_surface_finish"
 
-external surface_set_device_offset : 'a surface -> float -> float -> unit = "ml_cairo_surface_set_device_offset"
+external surface_set_device_offset : [> `Any] surface -> float -> float -> unit = "ml_cairo_surface_set_device_offset"
 
 
 type image_surface = [`Any|`Image] surface
@@ -252,15 +252,15 @@
 module Pattern = struct
 external create_rgb  : red:float -> green:float -> blue:float -> solid_pattern = "ml_cairo_pattern_create_rgb"
 external create_rgba : red:float -> green:float -> blue:float -> alpha:float -> solid_pattern = "ml_cairo_pattern_create_rgba"
-external create_for_surface : 'a surface -> surface_pattern = "ml_cairo_pattern_create_for_surface"
+external create_for_surface : [> `Any] surface -> surface_pattern = "ml_cairo_pattern_create_for_surface"
 external create_linear : x0:float -> y0:float -> x1:float -> y1:float -> gradient_pattern = "ml_cairo_pattern_create_linear"
 external create_radial : cx0:float -> cy0:float -> radius0:float -> cx1:float -> cy1:float -> radius1:float -> gradient_pattern = "ml_cairo_pattern_create_radial_bc" "ml_cairo_pattern_create_radial"
 
 external add_color_stop_rgb  : [>`Gradient] pattern -> off:float -> red:float -> green:float -> blue:float -> unit = "ml_cairo_pattern_add_color_stop_rgb"
 external add_color_stop_rgba : [>`Gradient] 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 : 'a pattern -> matrix -> unit = "ml_cairo_pattern_set_matrix"
-external get_matrix : 'a pattern -> matrix = "ml_cairo_pattern_get_matrix"
+external set_matrix : [> `Any] pattern -> matrix -> unit = "ml_cairo_pattern_set_matrix"
+external get_matrix : [> `Any] pattern -> matrix = "ml_cairo_pattern_get_matrix"
 
 external set_extend : [> `Surface] pattern -> extend -> unit = "ml_cairo_pattern_set_extend"
 external get_extend : [> `Surface] pattern -> extend = "ml_cairo_pattern_get_extend"
@@ -294,9 +294,9 @@
 
 (* fonts *)
 module Scaled_Font = struct
-type t
+type -'a t
 
-external create : font_face -> matrix -> matrix -> t = "ml_cairo_scaled_font_create"
-external font_extents : t -> font_extents = "ml_cairo_scaled_font_extents"
-external glyph_extents : t -> glyph array -> text_extents = "ml_cairo_scaled_font_glyph_extents"
+external create : ([>`Any] as 'a) font_face -> matrix -> matrix -> 'a t = "ml_cairo_scaled_font_create"
+external font_extents : [> `Any] t -> font_extents = "ml_cairo_scaled_font_extents"
+external glyph_extents : [> `Any] t -> glyph array -> text_extents = "ml_cairo_scaled_font_glyph_extents"
 end

Index: Makefile
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/Makefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Makefile	22 May 2005 20:03:15 -0000	1.10
+++ Makefile	18 Jul 2005 21:10:27 -0000	1.11
@@ -30,10 +30,11 @@
 	    cairo_png.mli cairo_png.ml \
 	    cairo_pdf.mli cairo_pdf.ml \
 	    cairo_ps.mli cairo_ps.ml \
+            cairo_ft.mli cairo_ft.ml \
             ml_cairo_wrappers.c \
             ml_cairo.c ml_cairo_status.c ml_cairo_bigarr.c ml_cairo_path.c \
 	    ml_cairo_surface.c ml_cairo_pattern.c ml_cairo_matrix.c \
-	    ml_cairo_font.c \
+	    ml_cairo_font.c ml_cairo_ft.c \
 	    ml_cairo_png.c ml_cairo_pdf.c ml_cairo_ps.c
 
 cairo.cma : $(call mlobjs,$(cairo_SRC))
@@ -92,7 +93,7 @@
           for lib in dll*.so ; do \
             ln -s $(INSTALLDIR)/$$lib $(DESTDIR)$(OCAMLLIB)/stublibs ; done ; fi
 
-DOCFILES = cairo.mli cairo_bigarray.mli cairo_png.mli cairo_pdf.mli cairo_ps.mli
+DOCFILES = cairo.mli cairo_bigarray.mli cairo_png.mli cairo_pdf.mli cairo_ps.mli cairo_ft.mli
 ifdef LABLGTKDIR
 DOCFILES += cairo_lablgtk.mli
 ifdef GTKCAIRO_CFLAGS




More information about the cairo-commit mailing list