MediaWiki  REL1_19
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 35 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 50 of file SVGMetadataExtractor.php.

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

Here is the call graph for this function:


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 206 of file SVGMetadataExtractor.php.

References debug().

Referenced by read().

Here is the call graph for this function:

Here is the caller graph for this function:

SVGReader::debug ( data) [private]

Definition at line 241 of file SVGMetadataExtractor.php.

References wfDebug().

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

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
Array with the known metadata

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

References DEFAULT_HEIGHT, DEFAULT_WIDTH, and scaleSVGUnit().

Referenced by read().

Here is the call graph for this function:

Here is the caller graph for this function:

SVGReader::notice ( data) [private]

Definition at line 251 of file SVGMetadataExtractor.php.

References wfDebug().

Here is the call graph for this function:

SVGReader::read ( ) [protected]

Read the SVG.

Definition at line 110 of file SVGMetadataExtractor.php.

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

Referenced by __construct().

Here is the call graph for this function:

Here is the caller graph for this function:

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 166 of file SVGMetadataExtractor.php.

References debug().

Referenced by read().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Read an XML snippet from an element.

Parameters:
String$metafieldthat we will fill with the result

Definition at line 187 of file SVGMetadataExtractor.php.

References debug().

Referenced by read().

Here is the call graph for this function:

Here is the caller graph for this function:

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 309 of file SVGMetadataExtractor.php.

References $matches.

Referenced by handleSVGAttribs().

Here is the caller graph for this function:

SVGReader::throwXmlError ( err) [private]

Definition at line 236 of file SVGMetadataExtractor.php.

References debug(), and wfDebug().

Here is the call graph for this function:

SVGReader::warn ( data) [private]

Definition at line 247 of file SVGMetadataExtractor.php.

References wfDebug().

Here is the call graph for this function:


Member Data Documentation

SVGReader::$mDebug = false [private]

Definition at line 41 of file SVGMetadataExtractor.php.

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

Definition at line 42 of file SVGMetadataExtractor.php.

SVGReader::$reader = null [private]

Definition at line 40 of file SVGMetadataExtractor.php.

Definition at line 37 of file SVGMetadataExtractor.php.

Referenced by __construct(), and handleSVGAttribs().

Definition at line 36 of file SVGMetadataExtractor.php.

Referenced by __construct(), and handleSVGAttribs().

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

Definition at line 38 of file SVGMetadataExtractor.php.

Referenced by read().


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