[cairo-commit] cairomm/cairomm context.h,1.13,1.14 path.h,1.6,1.7
Jonathon Jongsma
commit at pdx.freedesktop.org
Mon May 8 20:38:37 PDT 2006
Committed by: jjongsma
Update of /cvs/cairo/cairomm/cairomm
In directory kemper:/tmp/cvs-serv21451/cairomm
Modified Files:
context.h path.h
Log Message:
2006-05-08 Jonathon Jongsma <jonathon.jongsma at gmail.com>
* cairomm/context.h:
* cairomm/path.h: added some preliminary documentation explaining that the
caller is responsible for freeing Path objects returned from
Context::copy_path() and Context::copy_path_flat().
Index: context.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/context.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- context.h 20 Apr 2006 16:35:41 -0000 1.13
+++ context.h 9 May 2006 03:38:35 -0000 1.14
@@ -746,7 +746,30 @@
RefPtr<const Surface> get_target() const;
//TODO: Copy or reference-count a Path somethow instead of asking the caller to delete it?
+ /** Creates a copy of the current path and returns it to the user.
+ *
+ * \todo See cairo_path_data_t for hints on how to iterate over the returned
+ * data structure.
+ *
+ * \note The caller owns the Path object returned from this function. The
+ * Path object must be freed when you are finished with it.
+ */
Path* copy_path() const;
+
+ /** Gets a flattened copy of the current path and returns it to the user
+ *
+ * \todo See cairo_path_data_t for hints on how to iterate over the returned
+ * data structure.
+ *
+ * This function is like copy_path() except that any curves in the path will
+ * be approximated with piecewise-linear approximations, (accurate to within
+ * the current tolerance value). That is, the result is guaranteed to not have
+ * any elements of type CAIRO_PATH_CURVE_TO which will instead be
+ * replaced by a series of CAIRO_PATH_LINE_TO elements.
+ *
+ * \note The caller owns the Path object returned from this function. The
+ * Path object must be freed when you are finished with it.
+ */
Path* copy_path_flat() const;
/** Append the path onto the current path. The path may be either the return
Index: path.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/path.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- path.h 15 Mar 2006 01:00:59 -0000 1.6
+++ path.h 9 May 2006 03:38:35 -0000 1.7
@@ -28,7 +28,12 @@
{
/** A data structure for holding a path.
- * Use Context::copy_path() or Context::copy_path_flat() to instantiate a new Path.
+ * Use Context::copy_path() or Context::copy_path_flat() to instantiate a new
+ * Path. The application is responsible for freeing the Path object when it is
+ * no longer needed.
+ *
+ * \todo There's currently no way to access the path data without reverting to
+ * the C object (see cobj())
*/
class Path
{
More information about the cairo-commit
mailing list