fglsvgcanvas: SVG drawing module

Table 1. fglsvgcanvas types (fglsvgcanvas.4gl)
Type Description
PUBLIC TYPE t_svg_rect RECORD
    x DECIMAL,
    y DECIMAL,
    width DECIMAL,
    height DECIMAL
  END RECORD
The t_svg_rect type defines the position and dimensions of a rectangle.
Table 2. fglsvgcanvas constants (fglsvgcanvas.4gl)
Constant Description
SVGATT_* constants List of predefined SVG attributes.
Table 3. fglsvgcanvas functions (fglsvgcanvas.4gl)
Function Description
animateTransform(
   attributeName STRING,
   attributeType STRING,
   type STRING,
   from STRING,
   to STRING,
   by STRING,
   begin STRING,
   dur STRING,
   repeatCount STRING )
  RETURNS om.DomNode
Produces an SVG "animateTransform" element.
circle(
   cx STRING,
   cy STRING,
   r STRING )
  RETURNS om.DomNode
Produces an SVG "circle" element.
clean( cid SMALLINT )
Deletes all SVG elements inside the SVG canvas.
clipPath_rect(
   id STRING,
   x STRING,
   y STRING,
   width STRING,
   height STRING )
  RETURNS om.DomNode
Produces an SVG "clipPath" element with a "rect" element.
color_shade(
   source STRING,
   factor DECIMAL )
 RETURNS STRING
Applies a shade factor to an RGB color.
color_tint(
   source STRING,
   factor DECIMAL )
 RETURNS STRING
Applies a tint factor to an RGB color.
create( name STRING )
 RETURNS SMALLINT
Creates a new SVG canvas handler.
createChars( value STRING )
  RETURNS om.DomNode
Produces an SVG DOM text node.
createElement(
   tagName STRING,
   id STRING )
  RETURNS om.DomNode
Produces an SVG DOM element with the tag name specified as parameter.
defs(
   id STRING )
  RETURNS om.DomNode
Produces an SVG "defs" element.
destroy( cid SMALLINT )
Releases resources allocated for the SVG canvas.
display( cid SMALLINT )
Displays the SVG canvas.
ellipse(
   cx STRING,
   cy STRING,
   rx STRING,
   ry STRING )
  RETURNS om.DomNode
Produces an SVG "ellipse" element.
filter(
   id STRING,
   x STRING,
   y STRING,
   width STRING,
   height STRING )
  RETURNS om.DomNode
Produces the SVG "filter" element.
finalize( )
Releases the fglsvgcanvas library.
g(
   id STRING )
  RETURNS om.DomNode
Produces an SVG "g" element.
getBBox( cid SMALLINT, id STRING )
     RETURNS t_svg_rect
Returns the bounding box of an SVG element.
getItemId( cid SMALLINT )
     RETURNS STRING
Returns SVG element id after a user action.
image(
   href STRING,
   x STRING,
   y STRING,
   width STRING,
   height STRING,
   preserveAspectRatio STRING )
  RETURNS om.DomNode
Produces an SVG "image" element.
initialize( )
Prepares the fglsvgcanvas library for use.
line(
   x1 STRING,
   y1 STRING,
   x2 STRING,
   y2 STRING )
  RETURNS om.DomNode
Produces an SVG "line" element.
linearGradient(
   id STRING,
   x1 STRING,
   y1 STRING,
   x2 STRING,
   y2 STRING,
   spreadMethod STRING,
   gradientTransform STRING,
   gradientUnits STRING )
  RETURNS om.DomNode
Produces an SVG "linearGradient" element.
marker(
   id STRING,
   markerUnits STRING,
   refX STRING,
   refY STRING,
   markerWidth STRING,
   markerHeight STRING,
   orient STRING )
  RETURNS om.DomNode
Produces an SVG "marker" element.
mask(
   id STRING,
   x STRING,
   y STRING,
   width STRING,
   height STRING,
    node om.DomNode,
    name STRING )
Produces an SVG "mask" element.
nl_to_tspan(
   text om.DomNode,
   x STRING,
   y STRING,
   dx STRING,
   dy STRING,
   content STRING )
Converts a string to an SVG "text" element with "tspan" sub-elements.
path(
   d STRING )
  RETURNS om.DomNode
Produces an SVG "path" element.
pattern(
   id STRING,
   x STRING,
   y STRING,
   width STRING,
   height STRING,
   patternUnits STRING,
   patternContentUnits STRING,
   patternTransform STRING,
   preserveAspectRatio STRING )
  RETURNS om.DomNode
Produces an SVG "pattern" element.
polygon(
   points STRING )
  RETURNS om.DomNode
Produces an SVG "polygon" element.
polyline(
   points STRING )
  RETURNS om.DomNode
Produces an SVG "polyline" element.
radialgradient(
   id STRING,
   cx STRING,
   cy STRING,
   fx STRING,
   fy STRING,
   r STRING,
   spreadMethod STRING,
   gradientTransform STRING,
   gradientUnits STRING )
  RETURNS om.DomNode
Produces an SVG "radialGradient" element.
rect(
   x STRING,
   y STRING,
   width STRING,
   height STRING,
   rx STRING,
   ry STRING )
  RETURNS om.DomNode
Produces an SVG "rect" element.
removeElement(
    node om.DomNode )
Deletes an SVG element from the SVG canvas.
setAttributes(
    node om.DomNode,
    attrs om.SaxAttributes )
Sets the SVG attributes from an attribute set.
setCurrent(
   cid SMALLINT )
Selects the SVG canvas handler for subsequent SVG canvas API calls.
setRootSVGAttributes(
   id STRING,
   width STRING,
   height STRING,
   viewBox STRING,
   preserveAspectRatio STRING )
  RETURNS om.DomNode
Produces the root SVG element.
stop(
   offset STRING,
   color STRING,
   opacity STRING )
  RETURNS om.DomNode
Produces an SVG "stop" element for gradients.
styleAttributeList(
   attrs om.SaxAttributes )
 RETURNS STRING
Builds a string with a list of attributes to be used in a style attribute.
styleDefinition(
   selector STRING,
   attrs om.SaxAttributes )
 RETURNS STRING
Produces a CSS style definition with a selection and list of attributes.
styleList(
    content STRING )
  RETURNS om.DomNode
Produces a CSS style list.
svg(
   id STRING,
   x STRING,
   y STRING,
   width STRING,
   height STRING,
   viewBox STRING,
   preserveAspectRatio STRING
  RETURNS om.DomNode
Produces an SVG "svg" element.
text(
   x STRING,
   y STRING,
   content STRING,
   class STRING )
  RETURNS om.DomNode
Produces an SVG "text" element.
text_path(
   x STRING,
   y STRING,
   content STRING,
   path STRING
   class STRING )
  RETURNS om.DomNode
Produces the SVG "text" element with a "textPath" sub-element.
text_tref(
   x STRING,
   y STRING,
   tref STRING,
   class STRING )
  RETURNS om.DomNode
Produces the SVG "text" element with a "tref" sub-element.
title( text STRING )
  RETURNS om.DomNode
Produces an SVG "title" element.
tspan(
   x STRING,
   y STRING,
   dx STRING,
   dy STRING,
   style STRING,
   content STRING )
  RETURNS om.DomNode
Produces an SVG "tspan" element.
url( name STRING )
 RETURNS STRING
Produces a "url(#name)" reference for SVG elements.
use(
   name STRING,
   x STRING,
   y STRING )
  RETURNS om.DomNode
Produces an SVG "use" element.