summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_edit.h118
1 files changed, 118 insertions, 0 deletions
diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h
index 640d97ed05..d151c5c6ab 100644
--- a/public/fpdf_edit.h
+++ b/public/fpdf_edit.h
@@ -27,6 +27,9 @@
#define FPDF_PAGEOBJ_SHADING 4
#define FPDF_PAGEOBJ_FORM 5
+#define FPDF_FILLMODE_ALTERNATE 1
+#define FPDF_FILLMODE_WINDING 2
+
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
@@ -260,6 +263,121 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,
FPDF_PAGEOBJECT image_object,
FPDF_BITMAP bitmap);
+// Create a new path object at an initial position.
+//
+// x - initial horizontal position.
+// y - initial vertical position.
+//
+// Returns a handle to a new path object.
+DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewPath(float x, float y);
+
+// Create a closed path consisting of a rectangle.
+//
+// x - horizontal position for the left boundary of the rectangle.
+// y - vertical position for the bottom boundary of the rectangle.
+// w - width of the rectangle.
+// h - height of the rectangle.
+//
+// Returns a handle to the new path object.
+DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewRect(float x,
+ float y,
+ float w,
+ float h);
+
+// Set the stroke RGBA of a path. Range of values: 0 - 255.
+//
+// path - the handle to the path object.
+// R - the red component for the path stroke color.
+// G - the green component for the path stroke color.
+// B - the blue component for the path stroke color.
+// A - the stroke alpha for the path.
+//
+// Returns TRUE on success.
+DLLEXPORT FPDF_BOOL FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path,
+ unsigned int R,
+ unsigned int G,
+ unsigned int B,
+ unsigned int A);
+
+// Set the fill RGBA of a path. Range of values: 0 - 255.
+//
+// path - the handle to the path object.
+// R - the red component for the path fill color.
+// G - the green component for the path fill color.
+// B - the blue component for the path fill color.
+// A - the fill alpha for the path.
+//
+// Returns TRUE on success.
+DLLEXPORT FPDF_BOOL FPDFPath_SetFillColor(FPDF_PAGEOBJECT path,
+ unsigned int R,
+ unsigned int G,
+ unsigned int B,
+ unsigned int A);
+
+// Move a path's current point.
+//
+// path - the handle to the path object.
+// x - the horizontal position of the new current point.
+// y - the vertical position of the new current point.
+//
+// Note that no line will be created between the previous current point and the
+// new one.
+//
+// Returns TRUE on success
+DLLEXPORT FPDF_BOOL FPDFPath_MoveTo(FPDF_PAGEOBJECT path, float x, float y);
+
+// Add a line between the current point and a new point in the path.
+//
+// path - the handle to the path object.
+// x - the horizontal position of the new point.
+// y - the vertical position of the new point.
+//
+// The path's current point is changed to (x, y).
+//
+// Returns TRUE on success
+DLLEXPORT FPDF_BOOL FPDFPath_LineTo(FPDF_PAGEOBJECT path, float x, float y);
+
+// Add a cubic Bezier curve to the given path, starting at the current point.
+//
+// path - the handle to the path object.
+// x1 - the horizontal position of the first Bezier control point.
+// y1 - the vertical position of the first Bezier control point.
+// x2 - the horizontal position of the second Bezier control point.
+// y2 - the vertical position of the second Bezier control point.
+// x3 - the horizontal position of the ending point of the Bezier curve.
+// y3 - the vertical position of the ending point of the Bezier curve.
+//
+// Returns TRUE on success
+DLLEXPORT FPDF_BOOL FPDFPath_BezierTo(FPDF_PAGEOBJECT path,
+ float x1,
+ float y1,
+ float x2,
+ float y2,
+ float x3,
+ float y3);
+
+// Close the current subpath of a given path.
+//
+// path - the handle to the path object.
+//
+// This will add a line between the current point and the initial point of the
+// subpath, thus terminating the current subpath.
+//
+// Returns TRUE on success
+DLLEXPORT FPDF_BOOL FPDFPath_Close(FPDF_PAGEOBJECT path);
+
+// Set the drawing mode of a path.
+//
+// path - the handle to the path object.
+// fillmode - the filling mode to be set: 0 for no fill, 1 for alternate, 2 for
+// winding.
+// stroke - a boolean specifying if the path should be stroked or not.
+//
+// Returns TRUE on success
+DLLEXPORT FPDF_BOOL FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path,
+ int fillmode,
+ FPDF_BOOL stroke);
+
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus