svgparser.c File Reference

#include "svgparser.h"

Go to the source code of this file.

Data Structures

struct  STRINGFILE
struct  SVGNUMBER
struct  SVGPATHPARSER

Defines

#define MID(lo, hi)   (lo + ((hi - lo) >> 1))
#define CHAR_EOF   -1
#define CHAR_BAD   -2
#define SvgIsSpaceChar(x)   ((x)==0x20 || (x)==0x0A || (x)==0x0D || (x)==0x09)

Functions

LONG PEEKCHAR (STRINGFILE *sf)
LONG NEXTCHAR (STRINGFILE *sf)
int SvgParseSep (STRINGFILE *sbuf)
int SvgParseSepOrParen (STRINGFILE *sbuf)
BOOL SvgParseSpace (STRINGFILE *sbuf)
BOOL SvgParseString (STRINGFILE *sbuf, char *string)
BOOL SvgParseInteger (STRINGFILE *sbuf, LONG *pint)
BOOL SvgParseNumberEx (STRINGFILE *sbuf, SVGNUMBER *num, BOOL lax)
BOOL SvgParseDouble (STRINGFILE *sbuf, double *v)
BOOL SvgParseDoubleSpace (STRINGFILE *sbuf, double *v)
BOOL SvgParseDoubleSep (STRINGFILE *sbuf, double *v)
BOOL SvgParseDoubleLax (STRINGFILE *sbuf, double *v)
BOOL SvgParseDoubleSepLax (STRINGFILE *sbuf, double *v)
BOOL SvgParseFlag (STRINGFILE *sbuf, BOOL *v)
int SvgPathParserNext (LPVOID pspp, PATHSEGMENT *ps)
LPVOID SvgPathParserCreate (char *path)
void SvgPathParserFree (LPVOID pspp)
int SvgPathParserGetWinding (LPVOID p)
static int SvgNextMarker (SVGPATHPARSER *spp)

Variables

PATHITERATOR SvgPathParser
 Path iterator for SVG path data.


Define Documentation

#define CHAR_BAD   -2
 

Definition at line 7 of file svgparser.c.

#define CHAR_EOF   -1
 

Definition at line 6 of file svgparser.c.

#define MID lo,
hi   )     (lo + ((hi - lo) >> 1))
 

Definition at line 3 of file svgparser.c.

#define SvgIsSpaceChar  )     ((x)==0x20 || (x)==0x0A || (x)==0x0D || (x)==0x09)
 

Definition at line 9 of file svgparser.c.


Function Documentation

LONG NEXTCHAR STRINGFILE sf  ) 
 

Definition at line 36 of file svgparser.c.

LONG PEEKCHAR STRINGFILE sf  ) 
 

Definition at line 26 of file svgparser.c.

static int SvgNextMarker SVGPATHPARSER spp  )  [static]
 

Definition at line 364 of file svgparser.c.

BOOL SvgParseDouble STRINGFILE sbuf,
double *  v
 

Definition at line 263 of file svgparser.c.

BOOL SvgParseDoubleLax STRINGFILE sbuf,
double *  v
 

Definition at line 285 of file svgparser.c.

BOOL SvgParseDoubleSep STRINGFILE sbuf,
double *  v
 

Definition at line 280 of file svgparser.c.

BOOL SvgParseDoubleSepLax STRINGFILE sbuf,
double *  v
 

Definition at line 297 of file svgparser.c.

BOOL SvgParseDoubleSpace STRINGFILE sbuf,
double *  v
 

Definition at line 275 of file svgparser.c.

BOOL SvgParseFlag STRINGFILE sbuf,
BOOL v
 

Definition at line 302 of file svgparser.c.

BOOL SvgParseInteger STRINGFILE sbuf,
LONG pint
 

Definition at line 114 of file svgparser.c.

BOOL SvgParseNumberEx STRINGFILE sbuf,
SVGNUMBER num,
BOOL  lax
 

Definition at line 147 of file svgparser.c.

int SvgParseSep STRINGFILE sbuf  ) 
 

Definition at line 45 of file svgparser.c.

int SvgParseSepOrParen STRINGFILE sbuf  ) 
 

Definition at line 66 of file svgparser.c.

BOOL SvgParseSpace STRINGFILE sbuf  ) 
 

Definition at line 90 of file svgparser.c.

BOOL SvgParseString STRINGFILE sbuf,
char *  string
 

Definition at line 101 of file svgparser.c.

LPVOID SvgPathParserCreate char *  path  ) 
 

Definition at line 336 of file svgparser.c.

void SvgPathParserFree LPVOID  pspp  ) 
 

Definition at line 357 of file svgparser.c.

int SvgPathParserGetWinding LPVOID  p  ) 
 

Definition at line 332 of file svgparser.c.

int SvgPathParserNext LPVOID  pspp,
PATHSEGMENT ps
 

Definition at line 399 of file svgparser.c.


Variable Documentation

PATHITERATOR SvgPathParser
 

Initial value:

Path iterator for SVG path data.

This iterator accepts null-terminated character strings that contain data on a graphics path according to the W3C's SVG specification and converts them into path segments. An SVG path is a set of commands constisting of a single letter followed by parameters that are separated by whitespace or commas. The commands can be separated by whitespace. Whitespace and commas can be eliminated if doing so makes the path remain unambiguous. Uppercase commands use absolute coordinates, and lowercase commands use relative coordinates. A list of commands follows:
CommandParametersNotes
M m x y [x y ...] Moves the starting point to (x,y). If further coordinates follow, they are interpreted as line commands.
L l x y [x y ...] Draws a line from the starting point to (x,y). Coordinates that follow cause further lines to be drawn.
H h x [x ...] Draws a horizontal line to the end point at x. Coordinates that follow cause further lines to be drawn.
V v y [y ...] Draws a vertical line to the end point at y. Coordinates that follow cause further lines to be drawn.
Q q x0 y0 x y [x0 y0 x y ...] Draws a quadratic curve from the current point to (x,y). Its control point has the coordinates (x0,y0). Coordinates that follow cause further curves to be drawn.
C c x0 y0 x1 y1 x y [x0 y0 x1 y1 x y ...] Draws a cubic curve from the current point to (x,y). Its control points have the coordinates (x0,y0) and (x1,y1). Coordinates that follow cause further curves to be drawn.
T t x y [x y ...] Draws a quadratic curve from the current point to (x,y). Its control point is the reflection of the previous command's control point relative to the current point. Coordinates that follow cause further curves to be drawn.
S s x1 y1 x y [x1 y1 x y ...] Draws a cubic curve from the current point to (x,y). This curve's first control point is the reflection of the previous command's second control point relative to the current point. This curve's second control point has the coordinates (x1,y1). Coordinates that follow cause further curves to be drawn.
A a rx ry rot largearc sweep x y [rx ry rot largearc sweep x y ...] Draws an arc from the current point to (x,y). The arc is described as part of an ellipse with X-radius rx and Y-radius ry and rotated rot degrees. The flags largearc (0: 180 degrees or less; 1: 180 degrees or greater) and sweep (0: counterclockwise; 1: clockwise) narrow the ellipse choices. Parameters that follow cause further arcs to be drawn.
Z z (none) Closes the path by drawing a line from the current point to the starting point.

Definition at line 720 of file svgparser.c.


Generated on Thu Mar 27 01:46:58 2008 for Item Arrays by  doxygen 1.4.6-NO