From e74c349e2e378902693049c6e337caa5370f4d99 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Tue, 15 Jul 2008 19:05:29 +0000 Subject: [PATCH] indent -kr on the CPML library --- cpml/cpml-pair.c | 163 +++++++++++++------------- cpml/cpml-pair.h | 36 +++--- cpml/cpml-path.c | 341 +++++++++++++++++++++++++++---------------------------- cpml/cpml-path.h | 57 ++++------ 4 files changed, 287 insertions(+), 310 deletions(-) diff --git a/cpml/cpml-pair.c b/cpml/cpml-pair.c index 5d8a3589..d0ee5169 100644 --- a/cpml/cpml-pair.c +++ b/cpml/cpml-pair.c @@ -52,7 +52,7 @@ #include -static CpmlPair fallback_pair = {0., 0.}; +static CpmlPair fallback_pair = { 0., 0. }; /** @@ -67,9 +67,9 @@ static CpmlPair fallback_pair = {0., 0.}; cairo_bool_t cpml_pair_copy(CpmlPair *pair, const CpmlPair *src) { - pair->x = src->x; - pair->y = src->y; - return 1; + pair->x = src->x; + pair->y = src->y; + return 1; } /** @@ -89,13 +89,14 @@ cpml_pair_copy(CpmlPair *pair, const CpmlPair *src) * Return value: 1 if @distance was properly set, 0 on errors */ cairo_bool_t -cpml_pair_distance(const CpmlPair *from, const CpmlPair *to, double *distance) +cpml_pair_distance(const CpmlPair *from, const CpmlPair *to, + double *distance) { - if (!cpml_pair_square_distance(from, to, distance)) - return 0; + if (!cpml_pair_square_distance(from, to, distance)) + return 0; - *distance = sqrt(*distance); - return 1; + *distance = sqrt(*distance); + return 1; } /** @@ -117,17 +118,17 @@ cairo_bool_t cpml_pair_square_distance(const CpmlPair *from, const CpmlPair *to, double *distance) { - double x, y; + double x, y; - if (from == NULL) - from = &fallback_pair; - if (to == NULL) - to = &fallback_pair; + if (from == NULL) + from = &fallback_pair; + if (to == NULL) + to = &fallback_pair; - x = to->x - from->x; - y = to->y - from->y; - *distance = x*x + y*y; - return 1; + x = to->x - from->x; + y = to->y - from->y; + *distance = x * x + y * y; + return 1; } /** @@ -146,43 +147,43 @@ cpml_pair_square_distance(const CpmlPair *from, const CpmlPair *to, cairo_bool_t cpml_pair_angle(const CpmlPair *from, const CpmlPair *to, double *angle) { - static CpmlPair cached_pair = { 1., 0. }; - static double cached_angle = 0.; - CpmlPair pair; + static CpmlPair cached_pair = { 1., 0. }; + static double cached_angle = 0.; + CpmlPair pair; - if (from == NULL) - from = &fallback_pair; - if (to == NULL) - to = &fallback_pair; + if (from == NULL) + from = &fallback_pair; + if (to == NULL) + to = &fallback_pair; - pair.x = to->x - from->x; - pair.y = to->y - from->y; + pair.x = to->x - from->x; + pair.y = to->y - from->y; - /* Check for cached result */ - if (pair.x == cached_pair.x && pair.y == cached_pair.y) { - *angle = cached_angle; - } else if (pair.y == 0.) { - *angle = pair.x >= 0. ? CPML_DIR_RIGHT : CPML_DIR_LEFT; - } else if (pair.x == 0.) { - *angle = pair.y > 0. ? CPML_DIR_UP : CPML_DIR_DOWN; - } else if (pair.x == pair.y) { - *angle = pair.x > 0. ? M_PI / 4. : 5. * M_PI / 4.; - } else if (pair.x == -pair.y) { - *angle = pair.x > 0. ? 7. * M_PI / 4. : 3. * M_PI / 4.; - } else { - *angle = atan(pair.y / pair.x); + /* Check for cached result */ + if (pair.x == cached_pair.x && pair.y == cached_pair.y) { + *angle = cached_angle; + } else if (pair.y == 0.) { + *angle = pair.x >= 0. ? CPML_DIR_RIGHT : CPML_DIR_LEFT; + } else if (pair.x == 0.) { + *angle = pair.y > 0. ? CPML_DIR_UP : CPML_DIR_DOWN; + } else if (pair.x == pair.y) { + *angle = pair.x > 0. ? M_PI / 4. : 5. * M_PI / 4.; + } else if (pair.x == -pair.y) { + *angle = pair.x > 0. ? 7. * M_PI / 4. : 3. * M_PI / 4.; + } else { + *angle = atan(pair.y / pair.x); - if (pair.x < 0.0) - *angle += M_PI; - else if (pair.y < 0.0) - *angle += 2.0 * M_PI; + if (pair.x < 0.0) + *angle += M_PI; + else if (pair.y < 0.0) + *angle += 2.0 * M_PI; - /* Cache registration */ - cached_angle = *angle; - cpml_pair_copy(&cached_pair, &pair); - } + /* Cache registration */ + cached_angle = *angle; + cpml_pair_copy(&cached_pair, &pair); + } - return 1; + return 1; } /** @@ -201,14 +202,14 @@ cpml_pair_angle(const CpmlPair *from, const CpmlPair *to, double *angle) cairo_bool_t cpml_vector_from_pair(CpmlPair *vector, const CpmlPair *pair) { - double length; + double length; - if (!cpml_pair_distance(pair, NULL, &length) || length == 0.) - return 0; + if (!cpml_pair_distance(pair, NULL, &length) || length == 0.) + return 0; - vector->x = pair->x/length; - vector->y = pair->y/length; - return 1; + vector->x = pair->x / length; + vector->y = pair->y / length; + return 1; } /** @@ -224,33 +225,33 @@ cpml_vector_from_pair(CpmlPair *vector, const CpmlPair *pair) cairo_bool_t cpml_vector_from_angle(CpmlPair *vector, double angle) { - static double cached_angle = 0.; - static CpmlPair cached_vector = { 1., 0. }; + static double cached_angle = 0.; + static CpmlPair cached_vector = { 1., 0. }; - /* Check for cached result */ - if (angle == cached_angle) { - vector->x = cached_vector.x; - vector->y = cached_vector.y; - } else if (angle == CPML_DIR_RIGHT) { - vector->x = +1.; - vector->y = 0.; - } else if (angle == CPML_DIR_UP) { - vector->x = 0.; - vector->y = -1.; - } else if (angle == CPML_DIR_LEFT) { - vector->x = -1.; - vector->y = 0.; - } else if (angle == CPML_DIR_DOWN) { - vector->x = 0.; - vector->y = +1.; - } else { - vector->x = cos(angle); - vector->y = sin(angle); + /* Check for cached result */ + if (angle == cached_angle) { + vector->x = cached_vector.x; + vector->y = cached_vector.y; + } else if (angle == CPML_DIR_RIGHT) { + vector->x = +1.; + vector->y = 0.; + } else if (angle == CPML_DIR_UP) { + vector->x = 0.; + vector->y = -1.; + } else if (angle == CPML_DIR_LEFT) { + vector->x = -1.; + vector->y = 0.; + } else if (angle == CPML_DIR_DOWN) { + vector->x = 0.; + vector->y = +1.; + } else { + vector->x = cos(angle); + vector->y = sin(angle); - /* Cache registration */ - cached_angle = angle; - cpml_pair_copy(&cached_vector, vector); - } + /* Cache registration */ + cached_angle = angle; + cpml_pair_copy(&cached_vector, vector); + } - return 1; + return 1; } diff --git a/cpml/cpml-pair.h b/cpml/cpml-pair.h index f3c620e1..08623679 100644 --- a/cpml/cpml-pair.h +++ b/cpml/cpml-pair.h @@ -39,27 +39,21 @@ struct _CpmlPair { }; -cairo_bool_t -cpml_pair_copy (CpmlPair *pair, - const CpmlPair *src); -cairo_bool_t -cpml_pair_distance (const CpmlPair *from, - const CpmlPair *to, - double *distance); -cairo_bool_t -cpml_pair_square_distance (const CpmlPair *from, - const CpmlPair *to, - double *distance); -cairo_bool_t -cpml_pair_angle (const CpmlPair *from, - const CpmlPair *to, - double *angle); -cairo_bool_t -cpml_vector_from_pair (CpmlPair *vector, - const CpmlPair *pair); -cairo_bool_t -cpml_vector_from_angle (CpmlPair *vector, - double angle); +cairo_bool_t cpml_pair_copy (CpmlPair *pair, + const CpmlPair *src); +cairo_bool_t cpml_pair_distance (const CpmlPair *from, + const CpmlPair *to, + double *distance); +cairo_bool_t cpml_pair_square_distance (const CpmlPair *from, + const CpmlPair *to, + double *distance); +cairo_bool_t cpml_pair_angle (const CpmlPair *from, + const CpmlPair *to, + double *angle); +cairo_bool_t cpml_vector_from_pair (CpmlPair *vector, + const CpmlPair *pair); +cairo_bool_t cpml_vector_from_angle (CpmlPair *vector, + double angle); CAIRO_END_DECLS diff --git a/cpml/cpml-path.c b/cpml/cpml-path.c index 1aa1d9d4..fed5649e 100644 --- a/cpml/cpml-path.c +++ b/cpml/cpml-path.c @@ -22,11 +22,11 @@ #include -static cairo_bool_t strip_leadings (CpmlPath *path); -static cairo_bool_t path_to_segment (CpmlPath *segment, - const CpmlPath *path); -static cairo_bool_t path_to_primitive (CpmlPath *primitive, - const CpmlPath *path); +static cairo_bool_t strip_leadings (CpmlPath *path); +static cairo_bool_t path_to_segment (CpmlPath *segment, + const CpmlPath *path); +static cairo_bool_t path_to_primitive (CpmlPath *primitive, + const CpmlPath *path); /** * cpml_path_from_cairo: @@ -47,12 +47,12 @@ static cairo_bool_t path_to_primitive (CpmlPath *primitive, cairo_bool_t cpml_path_from_cairo(CpmlPath *path, const cairo_path_t *src, cairo_t *cr) { - CpmlPair org = {0., 0.}; + CpmlPair org = { 0., 0. }; - if (cr && cairo_has_current_point(cr)) - cairo_get_current_point(cr, &org.x, &org.y); + if (cr && cairo_has_current_point(cr)) + cairo_get_current_point(cr, &org.x, &org.y); - return cpml_path_from_cairo_explicit(path, src, &org); + return cpml_path_from_cairo_explicit(path, src, &org); } /** @@ -74,23 +74,23 @@ cairo_bool_t cpml_path_from_cairo_explicit(CpmlPath *path, const cairo_path_t *src, const CpmlPair *org) { - if (src->status != CAIRO_STATUS_SUCCESS) - return 0; - - if (path != (CpmlPath *) src) - memcpy(path, src, sizeof(cairo_path_t)); - - if (strip_leadings(path)) { - /* org taken from leadings MOVE_TO */ - } else if (path->cairo_path.status != CAIRO_STATUS_SUCCESS) { - /* Error: probably an empty path provided */ - return 0; - } else if (org) { - /* Use the provided org */ - cpml_pair_copy(&path->org, org); - } + if (src->status != CAIRO_STATUS_SUCCESS) + return 0; + + if (path != (CpmlPath *) src) + memcpy(path, src, sizeof(cairo_path_t)); + + if (strip_leadings(path)) { + /* org taken from leadings MOVE_TO */ + } else if (path->cairo_path.status != CAIRO_STATUS_SUCCESS) { + /* Error: probably an empty path provided */ + return 0; + } else if (org) { + /* Use the provided org */ + cpml_pair_copy(&path->org, org); + } - return 1; + return 1; } /** @@ -103,13 +103,12 @@ cpml_path_from_cairo_explicit(CpmlPath *path, const cairo_path_t *src, * * Return value: @path or %NULL on errors */ -CpmlPath * -cpml_path_copy(CpmlPath *path, const CpmlPath *src) +CpmlPath *cpml_path_copy(CpmlPath *path, const CpmlPath *src) { - if (path == NULL || src == NULL) - return NULL; + if (path == NULL || src == NULL) + return NULL; - return memcpy(path, src, sizeof(CpmlPath)); + return memcpy(path, src, sizeof(CpmlPath)); } /** @@ -126,30 +125,30 @@ cpml_path_copy(CpmlPath *path, const CpmlPath *src) cairo_bool_t cpml_segment_from_path(CpmlPath *segment, const CpmlPath *path, int index) { - CpmlPath residue, result; - int i; + CpmlPath residue, result; + int i; - if (!cpml_path_copy(&residue, path)) - return 0; + if (!cpml_path_copy(&residue, path)) + return 0; - i = 0; + i = 0; - do { - if (!path_to_segment(&result, &residue)) - return index == CPML_LAST && i > 0; + do { + if (!path_to_segment(&result, &residue)) + return index == CPML_LAST && i > 0; - residue.cairo_path.data += result.cairo_path.num_data; - residue.cairo_path.num_data -= result.cairo_path.num_data; - ++i; + residue.cairo_path.data += result.cairo_path.num_data; + residue.cairo_path.num_data -= result.cairo_path.num_data; + ++i; - if (index == CPML_LAST) { - cpml_path_copy(segment, &result); - continue; - } - } while (i < index); + if (index == CPML_LAST) { + cpml_path_copy(segment, &result); + continue; + } + } while (i < index); - cpml_path_copy(segment, &result); - return 1; + cpml_path_copy(segment, &result); + return 1; } /** @@ -166,30 +165,30 @@ cpml_segment_from_path(CpmlPath *segment, const CpmlPath *path, int index) cairo_bool_t cpml_primitive_from_path(CpmlPath *primitive, const CpmlPath *path, int index) { - CpmlPath residue, result; - int i; + CpmlPath residue, result; + int i; - if (!cpml_path_copy(&residue, path)) - return 0; + if (!cpml_path_copy(&residue, path)) + return 0; - i = 0; + i = 0; - do { - if (!path_to_primitive(&result, &residue)) - return index == CPML_LAST && i > 0; + do { + if (!path_to_primitive(&result, &residue)) + return index == CPML_LAST && i > 0; - residue.cairo_path.data += result.cairo_path.num_data; - residue.cairo_path.num_data -= result.cairo_path.num_data; - ++i; + residue.cairo_path.data += result.cairo_path.num_data; + residue.cairo_path.num_data -= result.cairo_path.num_data; + ++i; - if (index == CPML_LAST) { - cpml_path_copy(primitive, &result); - continue; - } - } while (i < index); + if (index == CPML_LAST) { + cpml_path_copy(primitive, &result); + continue; + } + } while (i < index); - cpml_path_copy(primitive, &result); - return 1; + cpml_path_copy(primitive, &result); + return 1; } /** @@ -205,14 +204,14 @@ cpml_primitive_from_path(CpmlPath *primitive, const CpmlPath *path, int index) cairo_bool_t cpml_primitive_get_pair(const CpmlPath *primitive, CpmlPair *pair, int index) { - cairo_path_data_t *data = primitive->cairo_path.data; + cairo_path_data_t *data = primitive->cairo_path.data; - if (index == 0 || index > data[0].header.length) - return 0; + if (index == 0 || index > data[0].header.length) + return 0; - pair->x = data[index].point.x; - pair->y = data[index].point.y; - return 1; + pair->x = data[index].point.x; + pair->y = data[index].point.y; + return 1; } /** @@ -228,14 +227,14 @@ cpml_primitive_get_pair(const CpmlPath *primitive, CpmlPair *pair, int index) cairo_bool_t cpml_primitive_set_pair(CpmlPath *primitive, const CpmlPair *pair, int index) { - cairo_path_data_t *data = primitive->cairo_path.data; + cairo_path_data_t *data = primitive->cairo_path.data; - if (index == 0 || index > data[0].header.length) - return 0; + if (index == 0 || index > data[0].header.length) + return 0; - data[index].point.x = pair->x; - data[index].point.y = pair->y; - return 1; + data[index].point.x = pair->x; + data[index].point.y = pair->y; + return 1; } /** @@ -249,25 +248,24 @@ cpml_primitive_set_pair(CpmlPath *primitive, const CpmlPair *pair, int index) * Return value: 1 on success, 0 on errors */ cairo_bool_t -cpml_primitive_get_point(const CpmlPath *primitive, - CpmlPair *point, double pos) +cpml_primitive_get_point(const CpmlPath *primitive, CpmlPair *point, double pos) { - int type = primitive->cairo_path.data[0].header.type; - - if (type != CAIRO_PATH_CLOSE_PATH && type != CAIRO_PATH_LINE_TO && - type != CAIRO_PATH_CURVE_TO) - return 0; - - /* Common cases */ - if (type == CAIRO_PATH_CLOSE_PATH || pos == 0.) { - return cpml_pair_copy(point, &primitive->org); - } else if (pos == 1.0) { - int n = type == CAIRO_PATH_LINE_TO ? 1 : 3; - return cpml_primitive_get_pair(primitive, point, n); - } + int type = primitive->cairo_path.data[0].header.type; - /* TODO */ + if (type != CAIRO_PATH_CLOSE_PATH && type != CAIRO_PATH_LINE_TO && + type != CAIRO_PATH_CURVE_TO) return 0; + + /* Common cases */ + if (type == CAIRO_PATH_CLOSE_PATH || pos == 0.) { + return cpml_pair_copy(point, &primitive->org); + } else if (pos == 1.0) { + int n = type == CAIRO_PATH_LINE_TO ? 1 : 3; + return cpml_primitive_get_pair(primitive, point, n); + } + + /* TODO */ + return 0; } /** @@ -278,34 +276,33 @@ cpml_primitive_get_point(const CpmlPath *primitive, * * Return value: 1 on success, 0 on errors */ -cairo_bool_t -cpml_primitive_reverse(CpmlPath *primitive) +cairo_bool_t cpml_primitive_reverse(CpmlPath *primitive) { - CpmlPair tmp; - - switch (primitive->cairo_path.data[0].header.type) { - case CAIRO_PATH_LINE_TO: - cpml_pair_copy(&tmp, &primitive->org); - cpml_primitive_get_pair(primitive, &primitive->org, 1); - cpml_primitive_set_pair(primitive, &tmp, 1); - break; - case CAIRO_PATH_CURVE_TO: - cpml_pair_copy(&tmp, &primitive->org); - cpml_primitive_get_pair(primitive, &primitive->org, 3); - cpml_primitive_set_pair(primitive, &tmp, 3); - - cpml_primitive_get_pair(primitive, &tmp, 2); - primitive->cairo_path.data[2].point.x = - primitive->cairo_path.data[3].point.x; - primitive->cairo_path.data[2].point.y = - primitive->cairo_path.data[3].point.y; - cpml_primitive_set_pair(primitive, &tmp, 3); - break; - default: - return 0; - } + CpmlPair tmp; + + switch (primitive->cairo_path.data[0].header.type) { + case CAIRO_PATH_LINE_TO: + cpml_pair_copy(&tmp, &primitive->org); + cpml_primitive_get_pair(primitive, &primitive->org, 1); + cpml_primitive_set_pair(primitive, &tmp, 1); + break; + case CAIRO_PATH_CURVE_TO: + cpml_pair_copy(&tmp, &primitive->org); + cpml_primitive_get_pair(primitive, &primitive->org, 3); + cpml_primitive_set_pair(primitive, &tmp, 3); + + cpml_primitive_get_pair(primitive, &tmp, 2); + primitive->cairo_path.data[2].point.x = + primitive->cairo_path.data[3].point.x; + primitive->cairo_path.data[2].point.y = + primitive->cairo_path.data[3].point.y; + cpml_primitive_set_pair(primitive, &tmp, 3); + break; + default: + return 0; + } - return 1; + return 1; } /** @@ -318,26 +315,24 @@ cpml_primitive_reverse(CpmlPath *primitive) * Return value: 1 on success, 0 on no leading MOVE_TOs or on errors * (check for path->cairo_path.status == CAIRO_STATUS_SUCCESS) */ -static cairo_bool_t -strip_leadings(CpmlPath *path) +static cairo_bool_t strip_leadings(CpmlPath *path) { - if (path->cairo_path.data[0].header.type != CAIRO_PATH_MOVE_TO) - return 0; - - do { - ++path->cairo_path.data; - path->org.x = path->cairo_path.data->point.x; - path->org.y = path->cairo_path.data->point.y; - ++path->cairo_path.data; - path->cairo_path.num_data -= 2; - if (path->cairo_path.num_data <= 0) { - path->cairo_path.status = - CAIRO_STATUS_INVALID_PATH_DATA; - return 0; - } - } while (path->cairo_path.data->header.type == CAIRO_PATH_MOVE_TO); - - return 1; + if (path->cairo_path.data[0].header.type != CAIRO_PATH_MOVE_TO) + return 0; + + do { + ++path->cairo_path.data; + path->org.x = path->cairo_path.data->point.x; + path->org.y = path->cairo_path.data->point.y; + ++path->cairo_path.data; + path->cairo_path.num_data -= 2; + if (path->cairo_path.num_data <= 0) { + path->cairo_path.status = CAIRO_STATUS_INVALID_PATH_DATA; + return 0; + } + } while (path->cairo_path.data->header.type == CAIRO_PATH_MOVE_TO); + + return 1; } /** @@ -352,32 +347,32 @@ strip_leadings(CpmlPath *path) static cairo_bool_t path_to_segment(CpmlPath *segment, const CpmlPath *path) { - cairo_path_data_t *path_data; - int i; - - if (segment != path) - cpml_path_copy(segment, path); - - if (!strip_leadings(segment) && - segment->cairo_path.status != CAIRO_STATUS_SUCCESS) - return 0; - - path_data = segment->cairo_path.data; - i = 0; - - do { - if (path_data->header.type == CAIRO_PATH_MOVE_TO) { - --i; - break; - } else if (path_data->header.type == CAIRO_PATH_CLOSE_PATH) { - break; - } - i += path_data->header.length; - path_data += path_data->header.length; - } while (i < segment->cairo_path.num_data); - - segment->cairo_path.num_data = i; - return 1; + cairo_path_data_t *path_data; + int i; + + if (segment != path) + cpml_path_copy(segment, path); + + if (!strip_leadings(segment) && + segment->cairo_path.status != CAIRO_STATUS_SUCCESS) + return 0; + + path_data = segment->cairo_path.data; + i = 0; + + do { + if (path_data->header.type == CAIRO_PATH_MOVE_TO) { + --i; + break; + } else if (path_data->header.type == CAIRO_PATH_CLOSE_PATH) { + break; + } + i += path_data->header.length; + path_data += path_data->header.length; + } while (i < segment->cairo_path.num_data); + + segment->cairo_path.num_data = i; + return 1; } /** @@ -392,15 +387,15 @@ path_to_segment(CpmlPath *segment, const CpmlPath *path) static cairo_bool_t path_to_primitive(CpmlPath *primitive, const CpmlPath *path) { - cairo_path_data_t *path_data; + cairo_path_data_t *path_data; - if (primitive != path) - cpml_path_copy(primitive, path); + if (primitive != path) + cpml_path_copy(primitive, path); - if (!strip_leadings(primitive) && - primitive->cairo_path.status != CAIRO_STATUS_SUCCESS) - return 0; + if (!strip_leadings(primitive) && + primitive->cairo_path.status != CAIRO_STATUS_SUCCESS) + return 0; - primitive->cairo_path.num_data = 1; - return 1; + primitive->cairo_path.num_data = 1; + return 1; } diff --git a/cpml/cpml-path.h b/cpml/cpml-path.h index 709e6635..8d88ec2c 100644 --- a/cpml/cpml-path.h +++ b/cpml/cpml-path.h @@ -37,41 +37,28 @@ struct _CpmlPath { }; -cairo_bool_t -cpml_path_from_cairo (CpmlPath *path, - const cairo_path_t *src, - cairo_t *cr); -cairo_bool_t -cpml_path_from_cairo_explicit (CpmlPath *path, - const cairo_path_t *src, - const CpmlPair *org); -CpmlPath * -cpml_path_copy (CpmlPath *path, - const CpmlPath *src); - -cairo_bool_t -cpml_segment_from_path (CpmlPath *segment, - const CpmlPath *path, - int index); - -cairo_bool_t -cpml_primitive_from_path (CpmlPath *primitive, - const CpmlPath *path, - int index); -cairo_bool_t -cpml_primitive_get_pair (const CpmlPath *primitive, - CpmlPair *pair, - int index); -cairo_bool_t -cpml_primitive_set_pair (CpmlPath *primitive, - const CpmlPair *pair, - int index); -cairo_bool_t -cpml_primitive_get_point (const CpmlPath *primitive, - CpmlPair *point, - double pos); -cairo_bool_t -cpml_primitive_reverse (CpmlPath *primitive); +cairo_bool_t cpml_path_from_cairo (CpmlPath *path, + const cairo_path_t *src, + cairo_t *cr); +cairo_bool_t cpml_path_from_cairo_explicit (CpmlPath *path, + const cairo_path_t *src, + const CpmlPair *org); +CpmlPath * cpml_path_copy (CpmlPath *path, + const CpmlPath *src); +cairo_bool_t cpml_segment_from_path (CpmlPath *segment, + const CpmlPath *path, + int index); +cairo_bool_t cpml_primitive_from_path (CpmlPath *primitive, + const CpmlPath *path, + int index); +cairo_bool_t cpml_primitive_get_pair (const CpmlPath *primitive, + CpmlPair *pair, int index); +cairo_bool_t cpml_primitive_set_pair (CpmlPath *primitive, + const CpmlPair *pair, + int index); +cairo_bool_t cpml_primitive_get_point (const CpmlPath *primitive, + CpmlPair *point, double pos); +cairo_bool_t cpml_primitive_reverse (CpmlPath *primitive); CAIRO_END_DECLS -- 2.11.4.GIT