MediaWiki  REL1_22
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:
string$sourceURI from which to read
Exceptions:
MWException|Exception

Definition at line 57 of file SVGMetadataExtractor.php.

References $size, $source, debug(), DEFAULT_HEIGHT, DEFAULT_WIDTH, global, 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 229 of file SVGMetadataExtractor.php.

References $name, and debug().

Referenced by read().

SVGReader::debug ( data) [private]

Definition at line 269 of file SVGMetadataExtractor.php.

References wfDebug().

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

Returns:
Array with the known metadata

Definition at line 118 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 288 of file SVGMetadataExtractor.php.

References DEFAULT_HEIGHT, DEFAULT_WIDTH, and scaleSVGUnit().

Referenced by read().

SVGReader::notice ( data) [private]

Definition at line 279 of file SVGMetadataExtractor.php.

References wfDebug().

SVGReader::read ( ) [protected]

Read the SVG.

Exceptions:
MWException
Returns:
bool

Definition at line 127 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 188 of file SVGMetadataExtractor.php.

References $name, and 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
Exceptions:
MWException

Definition at line 210 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:
string$lengthCSS/SVG length.
$viewportSize,:Float optional scale for percentage units...
Returns:
float: length in pixels

Definition at line 339 of file SVGMetadataExtractor.php.

References $matches, and array().

Referenced by handleSVGAttribs().

SVGReader::throwXmlError ( err) [private]

Definition at line 264 of file SVGMetadataExtractor.php.

References debug(), and wfDebug().

SVGReader::warn ( data) [private]

Definition at line 275 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: