Common Lisp Package: CL-SVG

README:

FUNCTION

Public

DESC (SCENE TEXT)

add a description to any SVG element

SCRIPT (SCENE SCRIPT)

add inline javascript to a scene

STYLE (SCENE CSS)

add inline CSS to a scene

TITLE (SCENE TEXT)

add a title to any SVG element

Undocumented

ARC-TO (RX RY X-ROTATION LARGE-ARC-FLAG SWEEP-FLAG X Y)

ARC-TO-R (RX RY X-ROTATION LARGE-ARC-FLAG SWEEP-FLAG X Y)

CLOSE-PATH

COMMENT (SCENE TEXT)

CURVE-TO (CONTROL-X1 CONTROL-Y1 CONTROL-X2 CONTROL-Y2 X Y)

CURVE-TO-R (CONTROL-X1 CONTROL-Y1 CONTROL-X2 CONTROL-Y2 X Y)

DRAW* (&REST X)

GRADIENT-STOP (&KEY COLOR OFFSET (OPACITY 1.0))

HORIZONTAL-TO (X)

HORIZONTAL-TO-R (X)

LINE-TO (X Y)

LINE-TO-R (X Y)

MAKE-PATH

MAKE-SVG-TOPLEVEL (CLASS &REST ATTRIBUTES)

MATRIX (A B C D E F)

MOVE-TO (X Y)

MOVE-TO-R (X Y)

QUADRATIC-CURVE-TO (CONTROL-X1 CONTROL-Y1 X Y)

QUADRATIC-CURVE-TO-R (CONTROL-X1 CONTROL-Y1 X Y)

ROTATE (ANGLE &OPTIONAL (CX 0) (CY 0))

SCALE (SX &OPTIONAL SY)

SKEW-X (ANGLE)

SKEW-Y (ANGLE)

SMOOTH-CURVE-TO (CONTROL-X2 CONTROL-Y2 X Y)

SMOOTH-CURVE-TO-R (CONTROL-X2 CONTROL-Y2 X Y)

SMOOTH-QUADRATIC-CURVE-TO (X Y)

SMOOTH-QUADRATIC-CURVE-TO-R (X Y)

TRANSLATE (TX &OPTIONAL TY)

VERTICAL-TO (Y)

VERTICAL-TO-R (Y)

Private

XMLIFY-KEYWORD (KW)

Convert a ':view-box' lisp-style name into XMLish 'viewBox'.

Undocumented

BEGIN-GROUP->XML (STREAM ELEMENT PROPERTIES)

COMPOSE-TSPAN (OPTS TEXT)

ELEMENT->XML (STREAM ELEMENT PROPERTIES)

END-GROUP->XML (STREAM ELEMENT)

ERROR-UNLESS-STRING (S)

FORMAT-INSTRUCTION (INSTRUCTION &REST ARGS)

POINTS (POINTS)

STRING->XML (STREAM STRING)

MACRO

Public

Undocumented

DRAW (SCENE (SHAPE &REST PARAMS) &REST OPTS)

MAKE-FOREIGN-OBJECT (SCENE (&REST OPTS) &BODY SHAPES)

MAKE-GROUP (SCENE (&REST OPTS) &BODY SHAPES)

MAKE-LINEAR-GRADIENT (SCENE (&REST OPTS) &BODY STOPS)

MAKE-MARKER (SCENE (&REST OPTS) &BODY SHAPES)

MAKE-MASK (SCENE (&REST OPTS) &BODY SHAPES)

MAKE-PATTERN (SCENE (&REST OPTS) &BODY SHAPES)

MAKE-RADIAL-GRADIENT (SCENE (&REST OPTS) &BODY STOPS)

MAKE-SVG-SYMBOL (SCENE (&REST OPTS) &BODY SHAPES)

PATH (&BODY CMDS)

TEXT (SCENE (&REST OPTS) &BODY ELEMENTS)

TRANSFORM ((&REST TRANSFORMATIONS) &BODY ELEMENT)

TSPAN ((&REST OPTS) TEXT)

WITH-PATH (PATH &BODY CMDS)

WITH-SVG-TO-FILE ((SVG &REST SVG-ATTRIBUTES) (FILENAME &REST OPEN-OPTIONS) &BODY BODY)

WITHOUT-ATTRIBUTE-CHECK (&BODY BODY)

Private

Undocumented

DEFINE-DEFS-GROUP-MAKER (MACRO-NAME ELEMENT-NAME)

DEFINE-ELEMENT-MAKER (ELEMENT NAME REQUIRED-ATTRIBUTES)

DEFINE-GRADIENT-MAKER (MACRO-NAME ELEMENT-NAME)

DEFINE-PATH-INSTRUCTION-PAIR (NAME INSTRUCTION (&REST ARGS))

DEFINE-TOPLEVEL-GROUP-MAKER (MACRO-NAME ELEMENT-NAME)

WITH-INDENTATION (&BODY BODY)

WITH-PATH-INSTRUCTION (INSTRUCTION &BODY BODY)

WITH-XML-GROUP-ELEMENT ((STREAM ELEMENT PROPERTIES) &BODY BODY)

GENERIC-FUNCTION

Public

ADD-CLASS (ELEMENT CLASS)

Push an XML class into an element. If the property already has contents the new transform is simply appended.

Undocumented

ADD-ELEMENT (CONTAINER ELEMENT)

ADD-NAMESPACE (ELEMENT NAME URL)

ADD-STYLESHEET (SVG-TOPLEVEL URL)

STREAM-OUT (STREAM ELEMENT)

Private

ADD-TRANSFORM (ELEMENT TRANSFORM)

Push a transformation into an element. If the property already has contents the new transform is simply appended.

PP-XML-ATTR (STREAM KEYWORD &OPTIONAL COLON-P AT-P)

This turns a keyword slot of a p-list into something XML will recognize, in particular making the case correct. It is intended for ~/pp-xml-attr/ use in a FORMAT string.

PP-XML-VALUE (STREAM VALUE &OPTIONAL COLON-P AT-P)

This function exists entirely to restrain the floating point representation in the SVG, which is bloated by pointless precision. *FLOAT-FORMAT-PRECISION* (2, by default) determines how many digits are printed after the decimal point.

Undocumented

ADD-DEFS-ELEMENT (SVG-TOPLEVEL ELEMENT)

ASSERT-REQUIRED-ATTRIBUTES (ELEMENT ATTRIBUTE-LIST)

ELEMENT-ID (ELEMENT)

SETFELEMENT-ID (ID ELEMENT)

GET-ATTRIBUTE (ELEMENT ATTRIBUTE)

HAS-ATTRIBUTE-P (ELEMENT ATTRIBUTE)

HAS-CONTENTS-P (ELEMENT)

MAKE-SVG-ELEMENT (ELEMENT-NAME ATTRIBUTES)

MISSING-ATTRIBUTE-MESSAGE (CONDITION)

SETFMISSING-ATTRIBUTE-MESSAGE (NEW-VALUE CONDITION)

PUSH-ATTRIBUTE (ELEMENT ATTRIBUTE VALUE)

SLOT-ACCESSOR

Private

Undocumented

ELEMENT-ATTRIBUTES (OBJECT)

SETFELEMENT-ATTRIBUTES (NEW-VALUE OBJECT)

ELEMENT-CONTENTS (OBJECT)

SETFELEMENT-CONTENTS (NEW-VALUE OBJECT)

ELEMENT-NAME (OBJECT)

SETFELEMENT-NAME (NEW-VALUE OBJECT)

SVG-DEFS (OBJECT)

SETFSVG-DEFS (NEW-VALUE OBJECT)

VARIABLE

Public

*FLOAT-FORMAT-PRECISION*

Constrains how many digits are printed after the decimal point in XML attribute values.

Undocumented

*INDENT-SPACING*

Private

*CHECK-REQUIRED-ATTRIBUTES*

Determines if the shape element attribute list is checked for completeness.

*INSERT-INSTRUCTION-P*

Works with *PREVIOUS-PATH-INSTRUCTION* to decide if a path command needs to be expressed.

*PREVIOUS-PATH-INSTRUCTION*

Keeps track of the previously called path instruction - SVG will assume a repetition of the this on its own if it keeps seeing points.

Undocumented

*INDENT-LEVEL*

CLASS

Public

Undocumented

SVG-1.1-TOPLEVEL

SVG-TOPLEVEL

Private

Undocumented

SVG-ELEMENT

CONDITION

Public

Undocumented

MISSING-ATTRIBUTES