MediaWiki  REL1_20
SVGReader Class Reference

List of all members.

Public Member Functions

 __construct ($source)
 Constructor.
 getMetadata ()

Static Public Member Functions

static scaleSVGUnit ($length, $viewportSize=512)
 Return a rounded pixel equivalent for a labeled CSS/SVG length.

Public Attributes

const DEFAULT_HEIGHT = 512
const DEFAULT_WIDTH = 512
const NS_SVG = 'http://www.w3.org/2000/svg'

Protected Member Functions

 read ()
 Read the SVG.

Private Member Functions

 animateFilter ($name)
 Filter all children, looking for animate elements.
 debug ($data)
 handleSVGAttribs ()
 Parse the attributes of an SVG element.
 notice ($data)
 readField ($name, $metafield=null)
 Read a textelement from an element.
 readXml ($metafield=null)
 Read an XML snippet from an element.
 throwXmlError ($err)
 warn ($data)

Private Attributes

 $mDebug = false
 $metadata = Array()
 $reader = null

Detailed Description

Definition at line 41 of file SVGMetadataExtractor.php.


Constructor & Destructor Documentation

SVGReader::__construct ( source)

Constructor.

Creates an SVGReader drawing from the source provided

Parameters:
$sourceString: URI from which to read

Definition at line 56 of file SVGMetadataExtractor.php.

References $size, $source, debug(), DEFAULT_HEIGHT, DEFAULT_WIDTH, read(), wfRestoreWarnings(), and wfSuppressWarnings().


Member Function Documentation

SVGReader::animateFilter ( name) [private]

Filter all children, looking for animate elements.

Parameters:
String$nameof the element that we are reading from

Definition at line 226 of file SVGMetadataExtractor.php.

References debug().

Referenced by read().

SVGReader::debug ( data) [private]

Definition at line 266 of file SVGMetadataExtractor.php.

References wfDebug().

Referenced by __construct(), animateFilter(), read(), readField(), readXml(), and throwXmlError().

Returns:
Array with the known metadata

Definition at line 117 of file SVGMetadataExtractor.php.

Parse the attributes of an SVG element.

The parser has to be in the start element of "<svg>"

Definition at line 285 of file SVGMetadataExtractor.php.

References DEFAULT_HEIGHT, DEFAULT_WIDTH, and scaleSVGUnit().

Referenced by read().

SVGReader::notice ( data) [private]

Definition at line 276 of file SVGMetadataExtractor.php.

References wfDebug().

SVGReader::read ( ) [protected]

Read the SVG.

Returns:
bool

Definition at line 125 of file SVGMetadataExtractor.php.

References animateFilter(), debug(), handleSVGAttribs(), NS_SVG, readField(), and readXml().

Referenced by __construct().

SVGReader::readField ( name,
metafield = null 
) [private]

Read a textelement from an element.

Parameters:
String$nameof the element that we are reading from
String$metafieldthat we will fill with the result

Definition at line 186 of file SVGMetadataExtractor.php.

References debug().

Referenced by read().

SVGReader::readXml ( metafield = null) [private]

Read an XML snippet from an element.

Parameters:
String$metafieldthat we will fill with the result

Definition at line 207 of file SVGMetadataExtractor.php.

References debug().

Referenced by read().

static SVGReader::scaleSVGUnit ( length,
viewportSize = 512 
) [static]

Return a rounded pixel equivalent for a labeled CSS/SVG length.

http://www.w3.org/TR/SVG11/coords.html#UnitIdentifiers

Parameters:
$lengthString: CSS/SVG length.
$viewportSize,:Float optional scale for percentage units...
Returns:
float: length in pixels

Definition at line 336 of file SVGMetadataExtractor.php.

References $matches.

Referenced by handleSVGAttribs().

SVGReader::throwXmlError ( err) [private]

Definition at line 261 of file SVGMetadataExtractor.php.

References debug(), and wfDebug().

SVGReader::warn ( data) [private]

Definition at line 272 of file SVGMetadataExtractor.php.

References wfDebug().


Member Data Documentation

SVGReader::$mDebug = false [private]

Definition at line 47 of file SVGMetadataExtractor.php.

SVGReader::$metadata = Array() [private]

Definition at line 48 of file SVGMetadataExtractor.php.

SVGReader::$reader = null [private]

Definition at line 46 of file SVGMetadataExtractor.php.

Definition at line 43 of file SVGMetadataExtractor.php.

Referenced by __construct(), and handleSVGAttribs().

Definition at line 42 of file SVGMetadataExtractor.php.

Referenced by __construct(), and handleSVGAttribs().

const SVGReader::NS_SVG = 'http://www.w3.org/2000/svg'

Definition at line 44 of file SVGMetadataExtractor.php.

Referenced by read().


The documentation for this class was generated from the following file: