package.xml0000664000175000017500000001660711671115025013772 0ustar clockwerxclockwerx 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.php0000664000175000017500000000476011671115025020024 0ustar clockwerxclockwerx 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.php0000664000175000017500000000246611671115025021656 0ustar clockwerxclockwerx 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.php0000664000175000017500000000226011671115025015265 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000247211671115025016650 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000166611671115025016477 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000107011671115025016144 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000111111671115025016135 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000160111671115025017041 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000576411671115025016672 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000177211671115025016671 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000151711671115025016516 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000102411671115025020275 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000475511671115025020416 0ustar clockwerxclockwerx * @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 ''; } 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.php0000664000175000017500000000165711671115025017041 0ustar clockwerxclockwerx * @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 'printParams('id', 'width', 'height', 'x', 'y', 'viewBox', 'style'); echo ' xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' . "\n"; parent::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.php0000664000175000017500000000110411671115025016355 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000222211671115025016305 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000174011671115025016156 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000243411671115025016511 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000151511671115025016163 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000156511671115025016723 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000156711671115025017071 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000114611671115025020141 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000207511671115025016166 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000112211671115025016206 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000110511671115025016206 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000222211671115025017064 0ustar clockwerxclockwerx * @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 "\n"; } function setShape($x, $y, $text) { $this->_x = $x; $this->_y = $y; $this->_text = $text; } } XML_SVG-1.1.0/XML/SVG/Title.php0000664000175000017500000000114511671115025016347 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000143111671115025016164 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000174311671115025016357 0ustar clockwerxclockwerx * @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.php0000664000175000017500000000117011671115025016020 0ustar clockwerxclockwerx * @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/README0000664000175000017500000000101311671115025014330 0ustar clockwerxclockwerxThis 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