After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 617568 - [cairo] Wrap cairo_copy_path, cairo_copy_path_flat, and cairo_append_path
[cairo] Wrap cairo_copy_path, cairo_copy_path_flat, and cairo_append_path
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2010-05-03 20:12 UTC by Colin Walters
Modified: 2010-05-03 20:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[cairo] Wrap cairo_copy_path, cairo_copy_path_flat, and cairo_append_path (9.79 KB, patch)
2010-05-03 20:12 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2010-05-03 20:12:38 UTC
Currently we don't support iterating over the path as the language
binding guide suggests; this simply allows one to call .copyPath()
and then later call .appendPath() basically.
Comment 1 Colin Walters 2010-05-03 20:12:41 UTC
Created attachment 160222 [details] [review]
[cairo] Wrap cairo_copy_path, cairo_copy_path_flat, and cairo_append_path
Comment 2 Johan (not receiving bugmail) Dahlin 2010-05-03 20:17:29 UTC
Review of attachment 160222 [details] [review]:

Rest looks good, cheers.

::: modules/cairo-context.c
@@ +399,3 @@
+
+    cr = gjs_cairo_context_get_context(context, obj);
+    cairo_append_path (cr, path);

Extra space before (

@@ +414,3 @@
+    cairo_t *cr;
+
+    if (!gjs_parse_args(context, "", "", argc, argv))

Not needed, you can just do a if (argc > 0) { gjs_throw(context, "..."); }

@@ +419,3 @@
+    cr = gjs_cairo_context_get_context(context, obj);
+    path = cairo_copy_path (cr);
+    *retval = OBJECT_TO_JSVAL(gjs_cairo_path_from_path (context, path));

You can remove a bunch of spaces before ( here too.

@@ +438,3 @@
+    cr = gjs_cairo_context_get_context(context, obj);
+    path = cairo_copy_path_flat (cr);
+    *retval = OBJECT_TO_JSVAL(gjs_cairo_path_from_path (context, path));

Ditto, see above.
Comment 3 Johan (not receiving bugmail) Dahlin 2010-05-03 20:17:30 UTC
Review of attachment 160222 [details] [review]:

Rest looks good, cheers.

::: modules/cairo-context.c
@@ +399,3 @@
+
+    cr = gjs_cairo_context_get_context(context, obj);
+    cairo_append_path (cr, path);

Extra space before (

@@ +414,3 @@
+    cairo_t *cr;
+
+    if (!gjs_parse_args(context, "", "", argc, argv))

Not needed, you can just do a if (argc > 0) { gjs_throw(context, "..."); }

@@ +419,3 @@
+    cr = gjs_cairo_context_get_context(context, obj);
+    path = cairo_copy_path (cr);
+    *retval = OBJECT_TO_JSVAL(gjs_cairo_path_from_path (context, path));

You can remove a bunch of spaces before ( here too.

@@ +438,3 @@
+    cr = gjs_cairo_context_get_context(context, obj);
+    path = cairo_copy_path_flat (cr);
+    *retval = OBJECT_TO_JSVAL(gjs_cairo_path_from_path (context, path));

Ditto, see above.
Comment 4 Colin Walters 2010-05-03 20:43:16 UTC
Attachment 160222 [details] pushed as a39c342 - [cairo] Wrap cairo_copy_path, cairo_copy_path_flat, and cairo_append_path