package.xml 0000664 0001750 0001750 00000016607 11671115025 013772 0 ustar clockwerx clockwerx
XML_SVG
pear.php.net
XML_SVG API
This package provides an object-oriented API for building SVG documents.
Chuck Hagenbuch
chagenbu
chuck@horde.org
no
Jan Schneider
yunosh
jan@horde.org
yes
2011-12-11
1.1.0
1.1.0
stable
stable
LGPL
QA release
One class per file
Bug #19074 missing paramater in "XML_SVG_Image" class
4.2.0
1.4.0b1
0.0.1
0.0.1
alpha
alpha
2002-12-29
LGPL
Initial release as a PEAR package
0.0.2
0.0.2
stable
stable
2003-07-07
LGPL
Stable release into the PEAR XML hierarchy.
0.0.3
0.0.3
stable
stable
2003-12-17
LGPL
Updated stable release for the package system.
1.0.0
1.0.0
stable
stable
2005-04-14
LGPL
PHP5 compatible copy() method.
1.0.1
1.0.1
stable
stable
2006-04-12
LGPL
Use htmlspecialchars() instead of htmlentities() in XML_SVG_Textpath::printElement() (PEAR Bug #4961).
1.0.3
1.0.2
stable
stable
2010-10-24
LGPL
QA release
SVN dir layout
Bug #4961 Package echoes text with htmlentities()
Request #7959 RadialGradient support
1.1.0
1.1.0
stable
stable
2011-12-11
LGPL
QA release
One class per file
Bug #19074 missing paramater in "XML_SVG_Image" class
XML_SVG-1.1.0/docs/examples/basic.php 0000664 0001750 0001750 00000004760 11671115025 020024 0 ustar clockwerx clockwerx 200,
'height' => 200));
// Create an instance of XML_SVG_Group. Set the style, transforms for
// child objects.
$g = new XML_SVG_Group(array('style' => 'stroke:black',
'transform' => 'translate(100 100)'));
// Add a parent to the g instance.
$g->addParent($svg);
// The same results can be accomplished by making g a child of the svg.
// $svg->addChild($g);
// Create and animate a circle.
$circle = new XML_SVG_Circle(array('cx' => 0,
'cy' => 0,
'r' => 75,
'style' => 'fill:green;stroke-width:3'));
$circle->addChild(new XML_SVG_Animate(array('attributeName' => 'r',
'attributeType' => 'XML',
'from' => 0,
'to' => 75,
'dur' => '3s',
'fill' => 'freeze')));
$circle->addChild(new XML_SVG_Animate(array('attributeName' => 'fill',
'attributeType' => 'CSS',
'from' => 'green',
'to' => 'red',
'dur' => '3s',
'fill' => 'freeze')));
// Make the circle a child of g.
$g->addChild($circle);
// Create and animate some text.
$text = new XML_SVG_Text(array('text' => 'SVG chart!',
'x' => 0,
'y' => 0,
'style' => 'font-size:20;text-anchor:middle;'));
$text->addChild(new XML_SVG_Animate(array('attributeName' => 'font-size',
'attributeType' => 'auto',
'from' => 0,
'to' => 20,
'dur' => '3s',
'fill' => 'freeze')));
// Make the text a child of g.
$g->addChild($text);
// Send a message to the svg instance to start printing.
$svg->printElement();
XML_SVG-1.1.0/docs/examples/radialGradient.php 0000664 0001750 0001750 00000002466 11671115025 021656 0 ustar clockwerx clockwerx 400,
'height' => 400));
$g = new XML_SVG_Group();
$g->addParent($svg);
$gradient = new XML_SVG_RadialGradient(array('id' => 'ShadowGradient',
'cx' => '50%',
'cy' => '50%',
'r' => '50%',
'fx' => '50%',
'fy' => '50%'));
$stop1 = new XML_SVG_Stop(array('offset' => '90%',
'stop-color' => 'black',
'stop-opacity' => 0.5));
$gradient->addChild($stop1);
$stop2 = new XML_SVG_Stop(array('offset' => '100%',
'style' => 'stop-color:rgb(0,0,0);stop-opacity:0'));
$gradient->addChild($stop2);
$defs = new XML_SVG_Defs();
$defs->addChild($gradient);
$g->addChild($defs);
$shadow = new XML_SVG_Circle(array('cx' => 170,
'cy' => 170,
'r' => 150,
'style' => 'fill:url(#ShadowGradient)'));
$g->addChild($shadow);
$svg->printElement();
XML_SVG-1.1.0/XML/SVG.php 0000664 0001750 0001750 00000002260 11671115025 015265 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Animate.php';
require_once 'XML/SVG/Circle.php';
require_once 'XML/SVG/Defs.php';
require_once 'XML/SVG/Desc.php';
require_once 'XML/SVG/Document.php';
require_once 'XML/SVG/Element.php';
require_once 'XML/SVG/Ellipse.php';
require_once 'XML/SVG/FilterMergeNode.php';
require_once 'XML/SVG/Filter.php';
require_once 'XML/SVG/FilterPrimitive.php';
require_once 'XML/SVG/Fragment.php';
require_once 'XML/SVG/Group.php';
require_once 'XML/SVG/Image.php';
require_once 'XML/SVG/Line.php';
require_once 'XML/SVG/Marker.php';
require_once 'XML/SVG/Path.php';
require_once 'XML/SVG/Polygon.php';
require_once 'XML/SVG/Polyline.php';
require_once 'XML/SVG/RadialGradient.php';
require_once 'XML/SVG/Rect.php';
require_once 'XML/SVG/Stop.php';
require_once 'XML/SVG/Textpath.php';
require_once 'XML/SVG/Text.php';
require_once 'XML/SVG/Title.php';
require_once 'XML/SVG/Tref.php';
require_once 'XML/SVG/Tspan.php';
require_once 'XML/SVG/Use.php';
XML_SVG-1.1.0/XML/SVG/Animate.php 0000664 0001750 0001750 00000002472 11671115025 016650 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Animate
*
* @package XML_SVG
*/
class XML_SVG_Animate extends XML_SVG_Element
{
var $_attributeName;
var $_attributeType;
var $_from;
var $_to;
var $_begin;
var $_dur;
var $_fill;
function printElement()
{
echo 'printParams('id', 'attributeName', 'attributeType', 'from', 'to',
'begin', 'dur', 'fill');
if (is_array($this->_elements)) {
// Print children, start and end tag.
echo ">\n";
parent::printElement();
echo "\n";
} else {
echo " />\n";
}
}
function setShape($attributeName, $attributeType = '', $from = '',
$to = '', $begin = '', $dur = '', $fill = '')
{
$this->_attributeName = $attributeName;
$this->_attributeType = $attributeType;
$this->_from = $from;
$this->_to = $to;
$this->_begin = $begin;
$this->_dur = $dur;
$this->_fill = $fill;
}
}
XML_SVG-1.1.0/XML/SVG/Circle.php 0000664 0001750 0001750 00000001666 11671115025 016477 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Circle
*
* @package XML_SVG
*/
class XML_SVG_Circle extends XML_SVG_Element
{
var $_cx;
var $_cy;
var $_r;
function printElement()
{
echo 'printParams('id', 'cx', 'cy', 'r', 'style', 'transform');
if (is_array($this->_elements)) {
// Print children, start and end tag.
echo ">\n";
parent::printElement();
echo "\n";
} else {
// Print short tag.
echo "/>\n";
}
}
function setShape($cx, $cy, $r)
{
$this->_cx = $cx;
$this->_cy = $cy;
$this->_r = $r;
}
}
XML_SVG-1.1.0/XML/SVG/Defs.php 0000664 0001750 0001750 00000001070 11671115025 016144 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Defs
*
* @package XML_SVG
*/
class XML_SVG_Defs extends XML_SVG_Element
{
function printElement()
{
echo 'printParams('id', 'style', 'transform');
echo ">\n";
parent::printElement();
echo "\n";
}
}
XML_SVG-1.1.0/XML/SVG/Desc.php 0000664 0001750 0001750 00000001111 11671115025 016135 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Desc
*
* @package XML_SVG
*/
class XML_SVG_Desc extends XML_SVG_Element
{
var $_desc;
function printElement()
{
echo 'printParams('id', 'style');
echo '>' . $this->_desc;
parent::printElement();
echo "\n";
}
}
XML_SVG-1.1.0/XML/SVG/Document.php 0000664 0001750 0001750 00000001601 11671115025 017041 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Fragment.php';
/**
* XML_SVG_Document
*
* This extends the XML_SVG_Fragment class. It wraps the XML_SVG_Frament output
* with a content header, xml definition and doctype.
*
* @package XML_SVG
*/
class XML_SVG_Document extends XML_SVG_Fragment
{
var $_encoding = 'iso-8859-1';
function printElement()
{
header('Content-Type: image/svg+xml');
print('_encoding . "\"?>\n");
print('' . "\n");
parent::printElement();
}
}
XML_SVG-1.1.0/XML/SVG/Element.php 0000664 0001750 0001750 00000005764 11671115025 016672 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
/**
* XML_SVG_Element
*
* This is the base class for the different SVG Element
* Objects. Extend this class to create a new SVG Element.
*
* @package XML_SVG
*/
class XML_SVG_Element
{
var $_elements = null;
var $_style = null;
var $_transform = null;
var $_id = null;
function XML_SVG_Element($params = array())
{
foreach ($params as $p => $v) {
$param = '_' . $p;
$this->$param = $v;
}
}
/**
* Most SVG elements can contain child elements. This method calls
* the printElement method of any child element added to this
* object by use of the addChild method.
*/
function printElement()
{
// Loop and call.
if (is_array($this->_elements)) {
foreach ($this->_elements as $child) {
$child->printElement();
}
}
}
/**
* This method adds an object reference (or value, if $copy is
* true) to the _elements array.
*/
function addChild(&$element, $copy = false)
{
if ($copy) {
$this->_elements[] = &$element->copy();
} else {
$this->_elements[] = &$element;
}
}
/**
* This method sends a message to the passed element requesting to
* be added as a child.
*/
function addParent(&$parent)
{
if (is_subclass_of($parent, 'XML_SVG_Element')) {
$parent->addChild($this);
}
}
function copy()
{
if (version_compare(zend_version(), '2', '>')) {
return clone($this);
} else {
$xml_svg = $this;
return $xml_svg;
}
}
/**
* Print each of the passed parameters, if they are set.
*/
function printParams()
{
foreach (func_get_args() as $param) {
$_param = '_' . $param;
if (isset($this->$_param)) {
switch ($param) {
case 'filter':
echo ' filter="url(#' . $this->$_param . ')"';
break;
default:
echo ' ' . str_replace('_', '-', $param) . '="' . $this->$_param . '"';
break;
}
}
}
}
// Set any named attribute of an element to a value.
function setParam($param, $value)
{
$attr = '_' . $param;
$this->$attr = $value;
}
// Get any named attribute of an element.
function getParam($param)
{
$attr = '_' . $param;
if (isset($this->$attr)) {
return $this->$attr;
} else {
return null;
}
}
// Print out the object for debugging.
function debug()
{
echo '
'; var_dump($this); echo '
';
}
}
XML_SVG-1.1.0/XML/SVG/Ellipse.php 0000664 0001750 0001750 00000001772 11671115025 016671 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Ellipse
*
* @package XML_SVG
*/
class XML_SVG_Ellipse extends XML_SVG_Element
{
var $_cx;
var $_cy;
var $_rx;
var $_ry;
function printElement()
{
echo 'printParams('id', 'cx', 'cy', 'rx', 'ry', 'style', 'transform');
if (is_array($this->_elements)) {
// Print children, start and end tag.
print(">\n");
parent::printElement();
print("\n");
} else {
// Print short tag.
print(" />\n");
}
}
function setShape($cx, $cy, $rx, $ry)
{
$this->_cx = $cx;
$this->_cy = $cy;
$this->_rx = $rx;
$this->_ry = $ry;
}
}
XML_SVG-1.1.0/XML/SVG/Filter.php 0000664 0001750 0001750 00000001517 11671115025 016516 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Filter
*
* @package XML_SVG
*/
class XML_SVG_Filter extends XML_SVG_Element
{
function printElement()
{
echo 'printParams('id');
if (is_array($this->_elements)) {
// Print children, start and end tag.
echo ">\n";
parent::printElement();
echo "\n";
} else {
echo " />\n";
}
}
function addPrimitive($primitive, $params)
{
$this->addChild(new XML_SVG_FilterPrimitive($primitive, $params));
}
}
XML_SVG-1.1.0/XML/SVG/FilterMergeNode.php 0000664 0001750 0001750 00000001024 11671115025 020275 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_FilterMergeNode
*
* @package XML_SVG
*/
class XML_SVG_FilterMergeNode extends XML_SVG_Element
{
var $_in;
function printElement()
{
echo 'printParams('in');
echo '/>';
}
}
XML_SVG-1.1.0/XML/SVG/FilterPrimitive.php 0000664 0001750 0001750 00000004755 11671115025 020416 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_FilterPrimitive
*
* @package XML_SVG
*/
class XML_SVG_FilterPrimitive extends XML_SVG_Element
{
var $_primitives = array('Blend',
'ColorMatrix',
'ComponentTransfer',
'Composite',
'ConvolveMatrix',
'DiffuseLighting',
'DisplacementMap',
'Flood',
'GaussianBlur',
'Image',
'Merge',
'Morphology',
'Offset',
'SpecularLighting',
'Tile',
'Turbulence');
var $_primitive;
var $_in;
var $_in2;
var $_result;
var $_x;
var $_y;
var $_dx;
var $_dy;
var $_width;
var $_height;
var $_mode;
var $_type;
var $_values;
var $_operator;
var $_k1;
var $_k2;
var $_k3;
var $_k4;
var $_surfaceScale;
var $_diffuseConstant;
var $_kernelUnitLength;
var $_floor_color;
var $_flood_opacity;
function XML_SVG_FilterPrimitive($primitive, $params = array())
{
parent::XML_SVG_Element($params);
$this->_primitive = $primitive;
}
function printElement()
{
$name = 'fe' . $this->_primitive;
echo '<' . $name;
$this->printParams('id', 'x', 'y', 'dx', 'dy', 'width', 'height', 'in', 'in2',
'result', 'mode', 'type', 'values', 'operator',
'k1', 'k2', 'k3', 'k4', 'surfaceScale', 'stdDeviation',
'diffuseConstant', 'kernelUnitLength',
'flood_color', 'flood_opacity');
if (is_array($this->_elements)) {
// Print children, start and end tag.
echo ">\n";
parent::printElement();
echo '' . $name . '>';
} else {
echo '/>';
}
}
/**
* For feMerge elements.
*/
function addMergeNode($in)
{
$this->addChild(new XML_SVG_FilterMergeNode(array('in' => $in)));
}
}
XML_SVG-1.1.0/XML/SVG/Fragment.php 0000664 0001750 0001750 00000001657 11671115025 017041 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Fragment
*
* @package XML_SVG
*/
class XML_SVG_Fragment extends XML_SVG_Element
{
var $_width;
var $_height;
var $_viewBox;
var $_x;
var $_y;
function printElement()
{
echo '\n";
}
function bufferObject()
{
ob_start();
$this->printElement();
$output = ob_get_contents();
ob_end_clean();
return $output;
}
}
XML_SVG-1.1.0/XML/SVG/Group.php 0000664 0001750 0001750 00000001104 11671115025 016355 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Group
*
* @package XML_SVG
*/
class XML_SVG_Group extends XML_SVG_Element
{
function printElement()
{
echo 'printParams('id', 'style', 'transform', 'filter');
print(">\n");
parent::printElement();
print("\n");
}
}
XML_SVG-1.1.0/XML/SVG/Image.php 0000664 0001750 0001750 00000002222 11671115025 016305 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Image
*
* @package XML_SVG
*/
class XML_SVG_Image extends XML_SVG_Element
{
var $_x;
var $_y;
var $_width;
var $_height;
var $_href;
function printElement()
{
echo 'printParams('id', 'x', 'y', 'width', 'height', 'style');
if (!empty($this->_href)) {
echo ' xlink:href="' . $this->_href . '"';
}
if (is_array($this->_elements)) {
// Print children, start and end tag.
echo ">\n";
parent::printElement();
echo "\n";
} else {
// Print short tag.
echo " />\n";
}
}
function setShape($x, $y, $width, $height, $href)
{
$this->_x = $x;
$this->_y = $y;
$this->_width = $width;
$this->_height = $height;
$this->_href = $href;
}
}
XML_SVG-1.1.0/XML/SVG/Line.php 0000664 0001750 0001750 00000001740 11671115025 016156 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Line
*
* @package XML_SVG
*/
class XML_SVG_Line extends XML_SVG_Element
{
var $_x1;
var $_y1;
var $_x2;
var $_y2;
function printElement()
{
echo 'printParams('id', 'x1', 'y1', 'x2', 'y2', 'style');
if (is_array($this->_elements)) {
// Print children, start and end tag.
print(">\n");
parent::printElement();
print("\n");
} else {
// Print short tag.
print("/>\n");
}
}
function setShape($x1, $y1, $x2, $y2)
{
$this->_x1 = $x1;
$this->_y1 = $y1;
$this->_x2 = $x2;
$this->_y2 = $y2;
}
}
XML_SVG-1.1.0/XML/SVG/Marker.php 0000664 0001750 0001750 00000002434 11671115025 016511 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Marker
*
* @package XML_SVG
*/
class XML_SVG_Marker extends XML_SVG_Element
{
var $_refX;
var $_refY;
var $_markerUnits;
var $_markerWidth;
var $_markerHeight;
var $_orient;
function printElement()
{
echo 'printParams('id', 'refX', 'refY', 'markerUnits',
'markerWidth', 'markerHeight', 'orient');
if (is_array($this->_elements)) { // Print children, start and end tag.
print(">\n");
parent::printElement();
print("\n");
} else {
print("/>\n");
}
}
function setShape($refX = '', $refY = '', $markerUnits = '',
$markerWidth = '', $markerHeight = '', $orient = '')
{
$this->_refX = $refX;
$this->_refY = $refY;
$this->_markerUnits = $markerUnits;
$this->_markerWidth = $markerWidth;
$this->_markerHeight = $markerHeight;
$this->_orient = $orient;
}
}
XML_SVG-1.1.0/XML/SVG/Path.php 0000664 0001750 0001750 00000001515 11671115025 016163 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Path
*
* @package XML_SVG
*/
class XML_SVG_Path extends XML_SVG_Element
{
var $_d;
function printElement()
{
echo 'printParams('id', 'd', 'style', 'transform');
if (is_array($this->_elements)) {
// Print children, start and end tag.
print(">\n");
parent::printElement();
print("\n");
} else {
// Print short tag.
print("/>\n");
}
}
function setShape($d)
{
$this->_d = $d;
}
}
XML_SVG-1.1.0/XML/SVG/Polygon.php 0000664 0001750 0001750 00000001565 11671115025 016723 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Polygon
*
* @package XML_SVG
*/
class XML_SVG_Polygon extends XML_SVG_Element
{
var $_points;
function printElement()
{
echo 'printParams('id', 'points', 'style', 'transform');
if (is_array($this->_elements)) {
// Print children, start and end tag.
print(">\n");
parent::printElement();
print("\n");
} else {
// Print short tag.
print("/>\n");
}
}
function setShape($points)
{
$this->_points = $points;
}
}
XML_SVG-1.1.0/XML/SVG/Polyline.php 0000664 0001750 0001750 00000001567 11671115025 017071 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Polyline
*
* @package XML_SVG
*/
class XML_SVG_Polyline extends XML_SVG_Element
{
var $_points;
function printElement()
{
echo 'printParams('id', 'points', 'style', 'transform');
if (is_array($this->_elements)) {
// Print children, start and end tag.
print(">\n");
parent::printElement();
print("\n");
} else {
// Print short tag.
print("/>\n");
}
}
function setShape($points)
{
$this->_points = $points;
}
}
XML_SVG-1.1.0/XML/SVG/RadialGradient.php 0000664 0001750 0001750 00000001146 11671115025 020141 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_RadialGradient
*
* @package XML_SVG
*/
class XML_SVG_RadialGradient extends XML_SVG_Element
{
function printElement()
{
echo 'printParams('id', 'cx', 'cy', 'r', 'fx', 'fy');
echo '>';
parent::printElement();
echo "\n";
}
}
XML_SVG-1.1.0/XML/SVG/Rect.php 0000664 0001750 0001750 00000002075 11671115025 016166 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Rect
*
* @package XML_SVG
*/
class XML_SVG_Rect extends XML_SVG_Element
{
var $_x;
var $_y;
var $_width;
var $_height;
var $_rx;
var $_ry;
function printElement()
{
echo 'printParams('id', 'x', 'y', 'width', 'height',
'rx', 'ry', 'style');
if (is_array($this->_elements)) {
// Print children, start and end tag.
print(">\n");
parent::printElement();
print("\n");
} else {
// Print short tag.
print("/>\n");
}
}
function setShape($x, $y, $width, $height)
{
$this->_x = $x;
$this->_y = $y;
$this->_width = $width;
$this->_height = $height;
}
}
XML_SVG-1.1.0/XML/SVG/Stop.php 0000664 0001750 0001750 00000001122 11671115025 016206 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Stop
*
* @package XML_SVG
*/
class XML_SVG_Stop extends XML_SVG_Element
{
function printElement()
{
echo 'printParams('id', 'style', 'offset', 'stop-color', 'stop-opacity');
echo '>';
parent::printElement();
echo "\n";
}
}
XML_SVG-1.1.0/XML/SVG/Text.php 0000664 0001750 0001750 00000001105 11671115025 016206 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Textpath.php';
/**
* XML_SVG_Text
*
* @package XML_SVG
*/
class XML_SVG_Text extends XML_SVG_Textpath
{
function printElement()
{
parent::printElement('text');
}
function setShape($x, $y, $text)
{
$this->_x = $x;
$this->_y = $y;
$this->_text = $text;
}
}
XML_SVG-1.1.0/XML/SVG/Textpath.php 0000664 0001750 0001750 00000002222 11671115025 017064 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Textpath
*
* @package XML_SVG
*/
class XML_SVG_Textpath extends XML_SVG_Element
{
var $_text;
var $_x;
var $_y;
var $_dx;
var $_dy;
var $_rotate;
var $_textLength;
var $_lengthAdjust;
var $_charset;
function printElement($element = 'textpath')
{
echo '<' . $element;
$this->printParams('id', 'x', 'y', 'dx', 'dy', 'rotate',
'textLength', 'lengthAdjust', 'style', 'transform');
echo '>';
if (isset($this->_charset)) {
echo @htmlspecialchars($this->_text, ENT_COMPAT, $this->_charset);
} else {
echo htmlspecialchars($this->_text);
}
parent::printElement();
echo "$element>\n";
}
function setShape($x, $y, $text)
{
$this->_x = $x;
$this->_y = $y;
$this->_text = $text;
}
}
XML_SVG-1.1.0/XML/SVG/Title.php 0000664 0001750 0001750 00000001145 11671115025 016347 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Title
*
* @package XML_SVG
*/
class XML_SVG_Title extends XML_SVG_Element
{
var $_title;
function printElement()
{
echo 'printParams('id', 'style');
print(">\n");
print($this->_title);
parent::printElement();
print("\n");
}
}
XML_SVG-1.1.0/XML/SVG/Tref.php 0000664 0001750 0001750 00000001431 11671115025 016164 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Tref
*
* @package XML_SVG
*/
class XML_SVG_Tref extends XML_SVG_Element
{
var $_text;
var $_x;
var $_y;
var $_dx;
var $_dy;
var $_rotate;
var $_textLength;
var $_lengthAdjust;
function printElement()
{
echo 'printParams('id', 'x', 'y', 'dx', 'dy', 'rotate',
'textLength', 'lengthAdjust', 'style');
echo '>' . $this->_text;
parent::printElement();
echo "\n";
}
}
XML_SVG-1.1.0/XML/SVG/Tspan.php 0000664 0001750 0001750 00000001743 11671115025 016357 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Tspan
*
* @package XML_SVG
*/
class XML_SVG_Tspan extends XML_SVG_Element
{
var $_text;
var $_x;
var $_y;
var $_dx;
var $_dy;
var $_rotate;
var $_textLength;
var $_lengthAdjust;
function printElement()
{
echo 'printParams('id', 'x', 'y', 'dx', 'dy', 'rotate',
'textLength', 'lengthAdjust', 'style', 'transform');
echo '>' . $this->_text;
if (is_array($this->_elements)) {
parent::printElement();
}
echo "\n";
}
function setShape($x, $y, $text)
{
$this->_x = $x;
$this->_y = $y;
$this->_text = $text;
}
}
XML_SVG-1.1.0/XML/SVG/Use.php 0000664 0001750 0001750 00000001170 11671115025 016020 0 ustar clockwerx clockwerx
* @package XML_SVG
* @license http://www.fsf.org/copyleft/lgpl.html
*/
require_once 'XML/SVG/Element.php';
/**
* XML_SVG_Use
*
* @package XML_SVG
*/
class XML_SVG_Use extends XML_SVG_Element
{
var $_symbol;
function XML_SVG_Use($symbol, $params = array())
{
parent::XML_SVG_Element($params);
$this->_symbol = $symbol;
}
function printElement()
{
echo '';
}
}
XML_SVG-1.1.0/README 0000664 0001750 0001750 00000001013 11671115025 014330 0 ustar clockwerx clockwerx This package is http://pear.php.net/package/XML_SVG and has been migrated from http://svn.php.net/repository/pear/packages/XML_SVG
Please report all new issues via the PEAR bug tracker.
If this package is marked as unmaintained and you have fixes, please submit your pull requests and start discussion on the pear-qa mailing list.
To test, run either
$ phpunit tests/
or
$ pear run-tests -r
To build, simply
$ pear package
To install from scratch
$ pear install package.xml
To upgrade
$ pear upgrade -f package.xml