[goffice] Cleaned GOPath API.
- From: Jean BrÃfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] Cleaned GOPath API.
- Date: Wed, 15 Feb 2012 20:21:41 +0000 (UTC)
commit d60274d000b6ee152c9d1faa167381e7cf75be41
Author: Jean Brefort <jean brefort normalesup org>
Date: Wed Feb 15 21:20:23 2012 +0100
Cleaned GOPath API.
ChangeLog | 6 ++++++
goffice/utils/go-path.c | 40 ++++++++++++++++++++--------------------
goffice/utils/go-path.h | 16 ++++++++--------
3 files changed, 34 insertions(+), 28 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 41bf9a6..b36ad34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-15 Jean Brefort <jean brefort normalesup org>
+
+ * goffice/utils/go-path.c (go_path_interpret), (go_path_to_cairo),
+ (go_path_copy), (go_path_append): cleaned GOPath API.
+ * goffice/utils/go-path.h: ditto.
+
2012-02-14 Morten Welinder <terra gnome org>
* goffice.mk (list_of_sources): Create a list of sources at each
diff --git a/goffice/utils/go-path.c b/goffice/utils/go-path.c
index cdbb33c..91e8508 100644
--- a/goffice/utils/go-path.c
+++ b/goffice/utils/go-path.c
@@ -486,10 +486,10 @@ go_path_rectangle (GOPath *path,
void
go_path_interpret (GOPath const *path,
GOPathDirection direction,
- GOPathMoveToFunc *move_to,
- GOPathLineToFunc *line_to,
- GOPathCurveToFunc *curve_to,
- GOPathClosePathFunc *close_path,
+ GOPathMoveToFunc move_to,
+ GOPathLineToFunc line_to,
+ GOPathCurveToFunc curve_to,
+ GOPathClosePathFunc close_path,
void *closure)
{
GOPathDataBuffer *buffer;
@@ -513,17 +513,17 @@ go_path_interpret (GOPath const *path,
switch (action) {
case GO_PATH_ACTION_MOVE_TO:
- (*move_to) (closure, &points[0]);
+ move_to (closure, &points[0]);
break;
case GO_PATH_ACTION_LINE_TO:
- (*line_to) (closure, &points[0]);
+ line_to (closure, &points[0]);
break;
case GO_PATH_ACTION_CURVE_TO:
- (*curve_to) (closure, &points[0], &points[1], &points[2]);
+ curve_to (closure, &points[0], &points[1], &points[2]);
break;
case GO_PATH_ACTION_CLOSE_PATH:
default:
- (*close_path) (closure);
+ close_path (closure);
break;
}
points += action_n_args[action];
@@ -602,10 +602,10 @@ void
go_path_to_cairo (GOPath const *path, GOPathDirection direction, cairo_t *cr)
{
go_path_interpret (path, direction,
- (GOPathMoveToFunc *) go_path_cairo_move_to,
- (GOPathLineToFunc *) go_path_cairo_line_to,
- (GOPathCurveToFunc *) go_path_cairo_curve_to,
- (GOPathClosePathFunc *) cairo_close_path, cr);
+ (GOPathMoveToFunc) go_path_cairo_move_to,
+ (GOPathLineToFunc) go_path_cairo_line_to,
+ (GOPathCurveToFunc) go_path_cairo_curve_to,
+ (GOPathClosePathFunc) cairo_close_path, cr);
}
static void
@@ -644,10 +644,10 @@ GOPath *go_path_copy (GOPath const *path)
GOPath *new_path = go_path_new ();
new_path->options = path->options;
go_path_interpret (path, GO_PATH_DIRECTION_FORWARD,
- (GOPathMoveToFunc *) go_path_append_move_to,
- (GOPathLineToFunc *) go_path_append_line_to,
- (GOPathCurveToFunc *) go_path_append_curve_to,
- (GOPathClosePathFunc *) go_path_append_close, new_path);
+ (GOPathMoveToFunc) go_path_append_move_to,
+ (GOPathLineToFunc) go_path_append_line_to,
+ (GOPathCurveToFunc) go_path_append_curve_to,
+ (GOPathClosePathFunc) go_path_append_close, new_path);
return new_path;
}
@@ -662,9 +662,9 @@ GOPath *go_path_copy (GOPath const *path)
GOPath *go_path_append (GOPath *path1, GOPath const *path2)
{
go_path_interpret (path2, GO_PATH_DIRECTION_FORWARD,
- (GOPathMoveToFunc *) go_path_append_move_to,
- (GOPathLineToFunc *) go_path_append_line_to,
- (GOPathCurveToFunc *) go_path_append_curve_to,
- (GOPathClosePathFunc *) go_path_append_close, path1);
+ (GOPathMoveToFunc) go_path_append_move_to,
+ (GOPathLineToFunc) go_path_append_line_to,
+ (GOPathCurveToFunc) go_path_append_curve_to,
+ (GOPathClosePathFunc) go_path_append_close, path1);
return path1;
}
diff --git a/goffice/utils/go-path.h b/goffice/utils/go-path.h
index 2a14d23..e92192c 100644
--- a/goffice/utils/go-path.h
+++ b/goffice/utils/go-path.h
@@ -51,12 +51,12 @@ typedef struct {
double y;
} GOPathPoint;
-typedef void (GOPathMoveToFunc) (void *closure, GOPathPoint const *point);
-typedef void (GOPathLineToFunc) (void *closure, GOPathPoint const *point);
-typedef void (GOPathCurveToFunc) (void *closure, GOPathPoint const *point0,
+typedef void (*GOPathMoveToFunc) (void *closure, GOPathPoint const *point);
+typedef void (*GOPathLineToFunc) (void *closure, GOPathPoint const *point);
+typedef void (*GOPathCurveToFunc) (void *closure, GOPathPoint const *point0,
GOPathPoint const *point1,
GOPathPoint const *point2);
-typedef void (GOPathClosePathFunc) (void *closure);
+typedef void (*GOPathClosePathFunc) (void *closure);
GType go_path_get_type (void);
@@ -98,10 +98,10 @@ void go_path_rectangle (GOPath *path, double x, double y,
void go_path_interpret (GOPath const *path,
GOPathDirection direction,
- GOPathMoveToFunc *move_to,
- GOPathLineToFunc *line_to,
- GOPathCurveToFunc *curve_to,
- GOPathClosePathFunc *close_path,
+ GOPathMoveToFunc move_to,
+ GOPathLineToFunc line_to,
+ GOPathCurveToFunc curve_to,
+ GOPathClosePathFunc close_path,
void *closure);
void go_path_to_cairo (GOPath const *path,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]