[cairo-commit] [cairo-www] src/cookbook
cworth at freedesktop.org
Thu Aug 9 01:07:01 PDT 2007
src/cookbook/convertctopyandback.mdwn | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
Author: nis.martensen <nis.martensen at web.de>
Date: Thu Aug 9 01:07:00 2007 -0700
fix display of code lines and quote strings
diff --git a/src/cookbook/convertctopyandback.mdwn b/src/cookbook/convertctopyandback.mdwn
index 0c24532..ec58c91 100644
@@ -1,17 +1,19 @@
Converting cairo code between languages is very easy.
##C to Python
the following C code:
cairo_move_to (cr, x + radius_x, y);
- cr.move_to ( x + radius_x, y)
-* replace cairo_ with cr
-* remove cr as first argument
+ cr.move_to (x + radius_x, y)
+* replace "`cairo_`" with "`cr.`"
+* remove "`cr`" as first argument
Note that in some instances the python bindings will try to simplify, and then a direct translation is not possible. In such a case refer to the source code of [[pycairo]], it is relatively easy to read.
More information about the cairo-commit