annotate nodejs/README @ 657:32d0eef1ee46

Force type-casting for member variables. For some member that need a casting for the type is that what we want. For example, casting a void * type to a struct pointer type. This force will skip type checking, but it works for the variables with a generic type and we want to specialize its type.
author Thinker K.F. Li <thinker@branda.to>
date Sat, 31 Jul 2010 14:37:19 +0800
parents d45c928f6523
children 8f49e0235097
rev   line source
624
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
1 svg.js:
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
2 ===============
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
3
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
4 The sample code to load an SVG file. It requires the libxml, which is available at http://github.com/polotek/libxmljs/tree/refactor.
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
5 Please copy the libxmljs.node to the objs/default if you want to test the libxml+mbfly without installing them into the system. The
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
6 path can be defined by the NODE_PATH environment variable.
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
7
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
8 (1) Compile MadButterfly with nodejs support
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
9 ~user/MadButterfly$ ./configure --enable-nodejs; make
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
10
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
11 (2) Compile libxml
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
12 ~user/MadButterfly/nodejs$ git clone http://github.com/polotek/libxmljs.git
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
13 ~user/MadButterfly/nodejs$ cd libxml; make
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
14
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
15 (3) Copy the libxml.node to the nodejs build directory
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
16 ~user/MadButterfly/nodejs$ cp libxml/libxml.node objs/default
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
17 (4) Set the path
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
18 ~user/MadButterfly/nodejs$ export NODE_PATH=objs/default
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
19
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
20 (5) Execute svg.js
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
21 ~user/MadButterfly/nodejs$ node svg.js
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
22