[cairo-commit] cairo/src cairo_ps_surface.c,NONE,1.1 Makefile.am,1.12,1.13 cairo.c,1.24,1.25 cairo.h,1.24,1.25 cairo_gstate.c,1.27,1.28 cairo_image_surface.c,1.1,1.2 cairo_surface.c,1.19,1.20 cairo_xlib_surface.c,1.9,1.10 cairoint.h,1.36,1.37

Carl Worth commit at pdx.freedesktop.org
Fri Oct 31 21:30:37 PST 2003


Committed by: cworth

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

Modified Files:
	Makefile.am cairo.c cairo.h cairo_gstate.c 
	cairo_image_surface.c cairo_surface.c cairo_xlib_surface.c 
	cairoint.h 
Added Files:
	cairo_ps_surface.c 
Log Message:
Implemented preliminary PostScript output support.
Added cairo_show_page.
Bumped version number to 0.1.10

--- NEW FILE: cairo_ps_surface.c ---
(This appears to be a binary file; contents omitted.)

Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/src/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Makefile.am	31 Oct 2003 18:41:37 -0000	1.12
--- Makefile.am	1 Nov 2003 05:30:35 -0000	1.13
***************
*** 19,22 ****
--- 19,23 ----
  	cairo_pen.c		\
  	cairo_polygon.c		\
+ 	cairo_ps_surface.c	\
  	cairo_slope.c		\
  	cairo_spline.c		\

Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** cairo.c	31 Oct 2003 18:41:37 -0000	1.24
--- cairo.c	1 Nov 2003 05:30:35 -0000	1.25
***************
*** 585,588 ****
--- 585,597 ----
  
  void
+ cairo_show_page (cairo_t *cr)
+ {
+     if (cr->status)
+ 	return;
+ 
+     cr->status = _cairo_gstate_show_page (cr->gstate);
+ }
+ 
+ void
  cairo_clip (cairo_t *cr)
  {

Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** cairo.h	31 Oct 2003 18:41:37 -0000	1.24
--- cairo.h	1 Nov 2003 05:30:35 -0000	1.25
***************
*** 30,33 ****
--- 30,34 ----
  
  #include <ic.h>
+ #include <stdio.h>
  
  #ifdef _CAIROINT_H_
***************
*** 91,94 ****
--- 92,103 ----
  			int		stride);
  
+ void
+ cairo_set_target_ps (cairo_t	*cr,
+ 		     FILE	*file,
+ 		     double	width_inches,
+ 		     double	height_inches,
+ 		     double	x_pixels_per_inch,
+ 		     double	y_pixels_per_inch);
+ 
  typedef enum cairo_operator { 
      CAIRO_OPERATOR_CLEAR,
***************
*** 287,290 ****
--- 296,302 ----
  cairo_fill (cairo_t *cr);
  
+ void
+ cairo_show_page (cairo_t *cr);
+ 
  /* Clipping */
  extern void __external_linkage
***************
*** 498,510 ****
  cairo_status_string (cairo_t *cr);
  
! /* Surface mainpulation */
! 
  extern cairo_surface_t * __external_linkage
! cairo_surface_create_for_image (char		*data,
! 				cairo_format_t	format,
! 				int		width,
! 				int		height,
! 				int		stride);
  
  extern cairo_surface_t * __external_linkage
  cairo_surface_create_similar (cairo_surface_t	*other,
--- 510,525 ----
  cairo_status_string (cairo_t *cr);
  
! /* Surface manipulation */
! /* XXX: We may want to rename this function in light of the new
!    virtualized surface backends... */
  extern cairo_surface_t * __external_linkage
! cairo_surface_create_for_image (char           *data,
! 				cairo_format_t  format,
! 				int             width,
! 				int             height,
! 				int             stride);
  
+ /* XXX: I want to remove this function, (replace with
+    cairo_set_target_scratch or similar). */
  extern cairo_surface_t * __external_linkage
  cairo_surface_create_similar (cairo_surface_t	*other,
***************
*** 524,527 ****
--- 539,545 ----
  
  extern cairo_status_t __external_linkage
+ cairo_surface_clip_begin (cairo_surface_t *surface);
+ 
+ extern cairo_status_t __external_linkage
  cairo_surface_clip_rectangle (cairo_surface_t *surface,
  			      int x, int y,
***************
*** 531,540 ****
--- 549,561 ----
  /* XXX: Note: The current Render/Ic implementations don't do the right
     thing with repeat when the surface has a non-identity matrix. */
+ /* XXX: Rework this as a cairo function with an enum: cairo_set_pattern_extend */
  extern cairo_status_t __external_linkage
  cairo_surface_set_repeat (cairo_surface_t *surface, int repeat);
  
+ /* XXX: Rework this as a cairo function: cairo_set_pattern_transform */
  extern cairo_status_t __external_linkage
  cairo_surface_set_matrix (cairo_surface_t *surface, cairo_matrix_t *matrix);
  
+ /* XXX: Rework this as a cairo function: cairo_current_pattern_transform */
  extern cairo_status_t __external_linkage
  cairo_surface_get_matrix (cairo_surface_t *surface, cairo_matrix_t *matrix);
***************
*** 548,551 ****
--- 569,573 ----
  } cairo_filter_t;
  
+ /* XXX: Rework this as a cairo function: cairo_set_pattern_filter */
  extern cairo_status_t __external_linkage
  cairo_surface_set_filter (cairo_surface_t *surface, cairo_filter_t filter);
***************
*** 565,570 ****
--- 587,603 ----
  				     int			stride);
  
+ /* PS-surface functions */
+ 
+ cairo_surface_t *
+ cairo_ps_surface_create (FILE	*file,
+ 			 double	width_inches,
+ 			 double height_inches,
+ 			 double	x_pixels_per_inch,
+ 			 double	y_pixels_per_inch);
+ 
  /* Matrix functions */
  
+ /* XXX: Rename all of these to cairo_transform_t */
+ 
  extern cairo_matrix_t * __external_linkage
  cairo_matrix_create (void);

Index: cairo_gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_gstate.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** cairo_gstate.c	1 Nov 2003 03:27:33 -0000	1.27
--- cairo_gstate.c	1 Nov 2003 05:30:35 -0000	1.28
***************
*** 1346,1349 ****
--- 1346,1358 ----
  
  cairo_status_t
+ _cairo_gstate_show_page (cairo_gstate_t *gstate)
+ {
+     if (gstate->surface == NULL)
+ 	return CAIRO_STATUS_NO_TARGET_SURFACE;
+ 
+     return _cairo_surface_show_page (gstate->surface);
+ }
+ 
+ cairo_status_t
  _cairo_gstate_clip (cairo_gstate_t *gstate)
  {

Index: cairo_image_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_image_surface.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** cairo_image_surface.c	31 Oct 2003 18:41:37 -0000	1.1
--- cairo_image_surface.c	1 Nov 2003 05:30:35 -0000	1.2
***************
*** 252,258 ****
  
  static cairo_status_t
! _cairo_image_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
  {
      cairo_image_surface_t *surface = abstract_surface;
      IcFilter ic_filter;
  
--- 252,265 ----
  
  static cairo_status_t
! _cairo_image_abstract_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
  {
      cairo_image_surface_t *surface = abstract_surface;
+ 
+     return _cairo_image_surface_set_filter (surface, filter);
+ }
+ 
+ cairo_status_t
+ _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
+ {
      IcFilter ic_filter;
  
***************
*** 415,418 ****
--- 422,431 ----
  }
  
+ static cairo_int_status_t
+ _cairo_image_surface_show_page (void *abstract_surface)
+ {
+     return CAIRO_INT_STATUS_UNSUPPORTED;
+ }
+ 
  static const cairo_surface_backend_t cairo_image_surface_backend = {
      _cairo_image_surface_create_similar,
***************
*** 422,429 ****
      _cairo_image_surface_set_image,
      _cairo_image_abstract_surface_set_matrix,
!     _cairo_image_surface_set_filter,
      _cairo_image_abstract_surface_set_repeat,
      _cairo_image_surface_composite,
      _cairo_image_surface_fill_rectangles,
      _cairo_image_surface_composite_trapezoids,
  };
--- 435,443 ----
      _cairo_image_surface_set_image,
      _cairo_image_abstract_surface_set_matrix,
!     _cairo_image_abstract_surface_set_filter,
      _cairo_image_abstract_surface_set_repeat,
      _cairo_image_surface_composite,
      _cairo_image_surface_fill_rectangles,
      _cairo_image_surface_composite_trapezoids,
+     _cairo_image_surface_show_page
  };

Index: cairo_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_surface.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** cairo_surface.c	31 Oct 2003 18:41:37 -0000	1.19
--- cairo_surface.c	1 Nov 2003 05:30:35 -0000	1.20
***************
*** 335,336 ****
--- 335,351 ----
  }
  
+ cairo_status_t
+ _cairo_surface_show_page (cairo_surface_t *surface)
+ {
+     cairo_int_status_t status;
+ 
+     status = surface->backend->show_page (surface);
+     /* It's fine if some backends just don't support this. */
+     if (status == CAIRO_INT_STATUS_UNSUPPORTED)
+ 	return CAIRO_STATUS_SUCCESS;
+     if (status)
+ 	return status;
+ 
+     return CAIRO_STATUS_SUCCESS;
+ }
+ 

Index: cairo_xlib_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_xlib_surface.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** cairo_xlib_surface.c	31 Oct 2003 18:41:37 -0000	1.9
--- cairo_xlib_surface.c	1 Nov 2003 05:30:35 -0000	1.10
***************
*** 557,561 ****
  }
  
! 
  
  static const struct cairo_surface_backend cairo_xlib_surface_backend = {
--- 557,565 ----
  }
  
! static cairo_int_status_t
! _cairo_xlib_surface_show_page (void *abstract_surface)
! {
!     return CAIRO_INT_STATUS_UNSUPPORTED;
! }
  
  static const struct cairo_surface_backend cairo_xlib_surface_backend = {
***************
*** 571,574 ****
--- 575,579 ----
      _cairo_xlib_surface_fill_rectangles,
      _cairo_xlib_surface_composite_trapezoids,
+     _cairo_xlib_surface_show_page
  };
  

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** cairoint.h	31 Oct 2003 18:41:37 -0000	1.36
--- cairoint.h	1 Nov 2003 05:30:35 -0000	1.37
***************
*** 354,357 ****
--- 354,360 ----
  				 cairo_trapezoid_t	*traps,
  				 int			num_traps);
+ 
+     cairo_int_status_t
+     (*show_page)		(void			*surface);
  } cairo_surface_backend_t;
  
***************
*** 710,713 ****
--- 713,719 ----
  _cairo_gstate_fill (cairo_gstate_t *gstate);
  
+ cairo_status_t
+ _cairo_gstate_show_page (cairo_gstate_t *gstate);
+ 
  extern cairo_status_t __internal_linkage
  _cairo_gstate_clip (cairo_gstate_t *gstate);
***************
*** 957,960 ****
--- 963,969 ----
  				     int		ntraps);
  
+ cairo_status_t
+ _cairo_surface_show_page (cairo_surface_t *surface);
+ 
  extern double __internal_linkage
  _cairo_surface_pixels_per_inch (cairo_surface_t *surface);
***************
*** 983,988 ****
  				 cairo_matrix_t		*matrix);
  
  extern cairo_status_t __internal_linkage
! _cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat);
  
  /* cairo_pen.c */
--- 992,1002 ----
  				 cairo_matrix_t		*matrix);
  
+ cairo_status_t
+ _cairo_image_surface_set_filter (cairo_image_surface_t	*surface,
+ 				 cairo_filter_t		filter);
+ 
  extern cairo_status_t __internal_linkage
! _cairo_image_surface_set_repeat (cairo_image_surface_t	*surface,
! 				 int			repeat);
  
  /* cairo_pen.c */





More information about the cairo-commit mailing list