1 /* Copyright (C) 2001-2006 Artifex Software, Inc.
2    All Rights Reserved.
3 
4    This software is provided AS-IS with no warranty, either express or
5    implied.
6 
7    This software is distributed under license and may not be copied, modified
8    or distributed except as expressly authorized under the terms of that
9    license.  Refer to licensing information at http://www.artifex.com/
10    or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
11    San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12 */
13 
14 /* $Id: gspath.h 10352 2009-11-19 16:48:11Z robin $ */
15 /* Graphics state path procedures */
16 /* Requires gsstate.h */
17 
18 #ifndef gspath_INCLUDED
19 #  define gspath_INCLUDED
20 
21 #include "gspenum.h"
22 
23 /* Path constructors */
24 int gs_newpath(gs_state *),
25     gs_moveto(gs_state *, floatp, floatp),
26     gs_rmoveto(gs_state *, floatp, floatp),
27     gs_lineto(gs_state *, floatp, floatp),
28     gs_rlineto(gs_state *, floatp, floatp),
29     gs_arc(gs_state *, floatp, floatp, floatp, floatp, floatp),
30     gs_arcn(gs_state *, floatp, floatp, floatp, floatp, floatp),
31     /*
32      * Because of an obscure bug in the IBM RS/6000 compiler, one (but not
33      * both) bool argument(s) for gs_arc_add must come before the floatp
34      * arguments.
35      */
36     gs_arc_add(gs_state *, bool, floatp, floatp, floatp, floatp, floatp, bool),
37     gs_arcto(gs_state *, floatp, floatp, floatp, floatp, floatp, float[4]),
38     gs_curveto(gs_state *, floatp, floatp, floatp, floatp, floatp, floatp),
39     gs_rcurveto(gs_state *, floatp, floatp, floatp, floatp, floatp, floatp),
40     gs_closepath(gs_state *);
41 
42 #ifndef gs_imager_state_DEFINED
43 #  define gs_imager_state_DEFINED
44 typedef struct gs_imager_state_s gs_imager_state;
45 #endif
46 #ifndef gx_path_DEFINED
47 #  define gx_path_DEFINED
48 typedef struct gx_path_s gx_path;
49 #endif
50 #ifndef gs_matrix_fixed_DEFINED
51 #define gs_matrix_fixed_DEFINED
52 typedef struct gs_matrix_fixed_s gs_matrix_fixed;
53 #endif
54 
55 /* Imager-level procedures */
56 void make_quadrant_arc(gs_point *p, const gs_point *c,
57 	const gs_point *p0, const gs_point *p1, double r);
58 
59 /* Add the current path to the path in the previous graphics state. */
60 int gs_upmergepath(gs_state *);
61 
62 /* Path accessors and transformers */
63 int gs_currentpoint(gs_state *, gs_point *),
64       gs_upathbbox(gs_state *, gs_rect *, bool),
65       gs_dashpath(gs_state *),
66       gs_flattenpath(gs_state *),
67       gs_reversepath(gs_state *),
68       gs_strokepath(gs_state *),
69       gs_strokepath2(gs_state *);
70 
71 /* The extra argument for gs_upathbbox controls whether to include */
72 /* a trailing moveto in the bounding box. */
73 #define gs_pathbbox(pgs, prect)\
74   gs_upathbbox(pgs, prect, false)
75 
76 /* Path enumeration */
77 
78 /* This interface conditionally makes a copy of the path. */
79 gs_path_enum *gs_path_enum_alloc(gs_memory_t *, client_name_t);
80 int gs_path_enum_copy_init(gs_path_enum *, const gs_state *, bool);
81 
82 #define gs_path_enum_init(penum, pgs)\
83   gs_path_enum_copy_init(penum, pgs, true)
84 int gs_path_enum_next(gs_path_enum *, gs_point[3]);  /* 0 when done */
85 void gs_path_enum_cleanup(gs_path_enum *);
86 
87 /* Clipping */
88 int gs_clippath(gs_state *),
89     gs_initclip(gs_state *),
90     gs_clip(gs_state *),
91     gs_eoclip(gs_state *);
92 
93 #endif /* gspath_INCLUDED */
94