[cairo-commit] cairo-ocaml/src Makefile,1.2,1.3 cairo.ml,1.3,1.4 cairo.mli,1.3,1.4 ml_cairo.c,1.5,1.6 ml_cairo_bigarr.c,1.2,1.3 ml_cairo_channel.c,1.1.1.1,1.2 ml_cairo_wrappers.h,1.1.1.1,1.2 ocairo.ml,1.3,1.4 ocairo.mli,1.3,1.4

Olivier Andrieu commit at pdx.freedesktop.org
Mon Aug 15 11:12:59 PDT 2005


Committed by: oandrieu

Update of /cvs/cairo/cairo-ocaml/src
In directory pdx:/tmp/cvs-serv30873/src

Modified Files:
	Makefile cairo.ml cairo.mli ml_cairo.c ml_cairo_bigarr.c 
	ml_cairo_channel.c ml_cairo_wrappers.h ocairo.ml ocairo.mli 
Log Message:
various small fixes

Index: Makefile
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/Makefile	26 Nov 2003 19:45:24 -0000	1.2
--- b/Makefile	22 Feb 2004 19:21:08 -0000	1.3
***************
*** 84,88 ****
  doc: $(DOCFILES:%.mli=%.cmi)
  	mkdir -p ../doc/html
! 	ocamldoc -v -html -d ../doc/html $(if $(LABLGTKDIR),-I $(LABLGTKDIR)) $(DOCFILES) 
  
  clean :
--- 84,88 ----
  doc: $(DOCFILES:%.mli=%.cmi)
  	mkdir -p ../doc/html
! 	ocamldoc -v -html -d ../doc/html -t Cairo-ocaml $(if $(LABLGTKDIR),-I $(LABLGTKDIR)) $(DOCFILES) 
  
  clean :

Index: cairo.ml
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/cairo.ml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/cairo.ml	17 Dec 2003 01:15:31 -0000	1.3
--- b/cairo.ml	22 Feb 2004 19:21:08 -0000	1.4
***************
*** 242,245 ****
  external matrix_transform_point :
    matrix:matrix -> point -> unit = "ml_cairo_matrix_transform_point"
! external finalise_target_ps : cr:t -> unit = "ml_cairo_finalise_target_ps"
! external ps_surface_finalise : surface -> unit = "ml_cairo_ps_surface_finalise"
--- 242,245 ----
  external matrix_transform_point :
    matrix:matrix -> point -> unit = "ml_cairo_matrix_transform_point"
! external finalise_target : cr:t -> unit = "ml_cairo_finalise_target"
! external surface_finalise : surface -> unit = "ml_cairo_surface_finalise"

Index: cairo.mli
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/cairo.mli,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/cairo.mli	17 Dec 2003 01:15:31 -0000	1.3
--- b/cairo.mli	22 Feb 2004 19:21:08 -0000	1.4
***************
*** 41,45 ****
    x_pixels_per_inch:float -> y_pixels_per_inch:float -> unit
    = "ml_cairo_set_target_ps_bc" "ml_cairo_set_target_ps"
! external finalise_target_ps : cr:t -> unit = "ml_cairo_finalise_target_ps"
  
  (** {4 Renderer state} *)
--- 41,45 ----
    x_pixels_per_inch:float -> y_pixels_per_inch:float -> unit
    = "ml_cairo_set_target_ps_bc" "ml_cairo_set_target_ps"
! external finalise_target : cr:t -> unit = "ml_cairo_finalise_target"
  
  (** {4 Renderer state} *)
***************
*** 245,248 ****
--- 245,249 ----
  external surface_set_filter : surface:surface -> filter:filter -> unit
    = "ml_cairo_surface_set_filter"
+ external surface_finalise : surface -> unit = "ml_cairo_surface_finalise"
  
  (** {4 Image surface} *)
***************
*** 262,266 ****
    x_pixels_per_inch:float -> y_pixels_per_inch:float -> surface
    = "ml_cairo_ps_surface_create"
- external ps_surface_finalise : surface -> unit = "ml_cairo_ps_surface_finalise"
  
  (** {3 Matrix API} *)
--- 263,266 ----
***************
*** 291,295 ****
    = "ml_cairo_matrix_transform_point"
  
! (** {4 Font API}
  
     Mostly unusable ATM. It needs other libraries (freetype2/fontconfig). 
--- 291,295 ----
    = "ml_cairo_matrix_transform_point"
  
! (** {3 Font API}
  
     Mostly unusable ATM. It needs other libraries (freetype2/fontconfig). 

Index: ml_cairo.c
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ml_cairo.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** a/ml_cairo.c	17 Dec 2003 01:15:31 -0000	1.5
--- b/ml_cairo.c	22 Feb 2004 19:21:08 -0000	1.6
***************
*** 276,281 ****
--- 276,291 ----
  ml_cairo_set_dash(value cr, value d, value off)
  {
+ #ifndef ARCH_ALIGN_DOUBLE
    cairo_set_dash(cairo_t_val(cr), Double_array_val(d),
  		 Double_array_length(d), Double_val(off));
+ #else
+   int i, ndash = Double_array_length(d);
+   double *dashes = stat_alloc(ndash * sizeof (double));
+   for (i=0; i<ndash, i++)
+     dashes[i] = Double_field(d, i);
+   cairo_set_dash(cairo_t_val(cr), dashes, ndash, Double_val(off));
+   stat_free(dashes);
+ #endif
+   check_cairo_status(cr);
    return Val_unit;
  }
***************
*** 994,998 ****
  
  CAMLprim value
! ml_cairo_finalise_target_ps(value cr)
  {
    cairo_set_target_surface(cairo_t_val(cr), NULL);
--- 1004,1008 ----
  
  CAMLprim value
! ml_cairo_finalise_target(value cr)
  {
    cairo_set_target_surface(cairo_t_val(cr), NULL);
***************
*** 1001,1005 ****
  
  CAMLprim value
! ml_cairo_ps_surface_finalise(value s)
  {
    cairo_surface_t *surf = cairo_surface_t_val(s);
--- 1011,1015 ----
  
  CAMLprim value
! ml_cairo_surface_finalise(value s)
  {
    cairo_surface_t *surf = cairo_surface_t_val(s);

Index: ml_cairo_bigarr.c
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ml_cairo_bigarr.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/ml_cairo_bigarr.c	17 Dec 2003 01:15:31 -0000	1.2
--- b/ml_cairo_bigarr.c	22 Feb 2004 19:21:08 -0000	1.3
***************
*** 7,11 ****
  ml_bigarray_byte_size(value b)
  {
!   return Val_int(bigarray_byte_size(Bigarray_val(b)));
  }
  
--- 7,11 ----
  ml_bigarray_byte_size(value b)
  {
!   return Val_long(bigarray_byte_size(Bigarray_val(b)));
  }
  

Index: ml_cairo_channel.c
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ml_cairo_channel.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** a/ml_cairo_channel.c	18 Nov 2003 19:02:25 -0000	1.1.1.1
--- b/ml_cairo_channel.c	22 Feb 2004 19:21:08 -0000	1.2
***************
*** 14,26 ****
  #include "ml_cairo_channel.h"
  
! CAMLprim value
! ml_FILE_of_channel(value v)
  {
-   struct channel *c = Channel(v);
    int new_fd;
    FILE *f;
  
!   flush(c);
!   new_fd = dup(c->fd);
    if (new_fd < 0)
      goto fail;
--- 14,23 ----
  #include "ml_cairo_channel.h"
  
! static value ml_FILE_of_fd(int fd)
  {
    int new_fd;
    FILE *f;
  
!   new_fd = dup(fd);
    if (new_fd < 0)
      goto fail;
***************
*** 35,53 ****
  
  CAMLprim value
! ml_FILE_of_file_descr(value v)
  {
!   int new_fd;
!   FILE *f;
! 
!   new_fd = dup(Int_val(v));
!   if (new_fd < 0)
!     goto fail;
!   f = fdopen(new_fd, "w");
!   if (!f)
!     goto fail;
!   return Val_ptr(f);
  
! fail:
!   raise_sys_error(copy_string(strerror(errno)));
  }
  
--- 32,50 ----
  
  CAMLprim value
! ml_FILE_of_channel(value v)
  {
!   struct channel *c = Channel(v);
!   flush(c);
!   return ml_FILE_of_fd (c->fd);
! }
  
! CAMLprim value
! ml_FILE_of_file_descr(value v)
! {
! #ifndef _WIN32
!   return ml_FILE_of_fd (Int_val(v));
! #else
!   return failwith("unsupported");
! #endif
  }
  

Index: ml_cairo_wrappers.h
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ml_cairo_wrappers.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** a/ml_cairo_wrappers.h	18 Nov 2003 19:02:25 -0000	1.1.1.1
--- b/ml_cairo_wrappers.h	22 Feb 2004 19:21:08 -0000	1.2
***************
*** 20,24 ****
--- 20,26 ----
  }
  
+ #ifndef ARCH_ALIGN_DOUBLE
  #define Double_array_val(v)    ((double *)(v))
+ #endif
  #define Double_array_length(v) (Wosize_val(v) / Double_wosize)
  

Index: ocairo.ml
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ocairo.ml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/ocairo.ml	17 Dec 2003 01:15:31 -0000	1.3
--- b/ocairo.ml	22 Feb 2004 19:21:08 -0000	1.4
***************
*** 83,87 ****
      method set_target_ps chan w h xpi ypi =
        Cairo.set_target_ps c chan w h xpi ypi
!     method finalise_target_ps = Cairo.finalise_target_ps
  
      method current_point = Cairo.current_point c
--- 83,87 ----
      method set_target_ps chan w h xpi ypi =
        Cairo.set_target_ps c chan w h xpi ypi
!     method finalise_target = Cairo.finalise_target
  
      method current_point = Cairo.current_point c
***************
*** 204,208 ****
  	m
        method set_filter f = Cairo.surface_set_filter s f
!       method ps_finalise = Cairo.ps_surface_finalise s
      end
  
--- 204,208 ----
  	m
        method set_filter f = Cairo.surface_set_filter s f
!       method finalise = Cairo.surface_finalise s
      end
  

Index: ocairo.mli
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ocairo.mli,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/ocairo.mli	17 Dec 2003 01:15:31 -0000	1.3
--- b/ocairo.mli	22 Feb 2004 19:21:08 -0000	1.4
***************
*** 86,90 ****
      method fill : unit
      method fill_rule : Cairo.fill_rule
!     method finalise_target_ps : cr:Cairo.t -> unit
      method font_extents : Cairo.font_extents
      method get_cairo : Cairo.t
--- 86,90 ----
      method fill : unit
      method fill_rule : Cairo.fill_rule
!     method finalise_target : cr:Cairo.t -> unit
      method font_extents : Cairo.font_extents
      method get_cairo : Cairo.t
***************
*** 178,182 ****
      method set_matrix : matrix -> unit
      method set_repeat : bool -> unit
!     method ps_finalise : unit
    end
  
--- 178,182 ----
      method set_matrix : matrix -> unit
      method set_repeat : bool -> unit
!     method finalise : unit
    end
  





More information about the cairo-commit mailing list