1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* ----- BEGIN LICENSE BLOCK -----
3
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
* The contents of this file are subject to the Mozilla Public License
6
* Version 1.1 (the "License"); you may not use this file except in
7
* compliance with the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/MPL/
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
15
* The Original Code is the Mozilla SVG project.
17
* The Initial Developer of the Original Code is
18
* Crocodile Clips Ltd..
19
* Portions created by the Initial Developer are Copyright (C) 2002
20
* the Initial Developer. All Rights Reserved.
23
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
25
* Alternatively, the contents of this file may be used under the terms of
26
* either the GNU General Public License Version 2 or later (the "GPL"), or
27
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28
* in which case the provisions of the GPL or the LGPL are applicable instead
29
* of those above. If you wish to allow use of your version of this file only
30
* under the terms of either the GPL or the LGPL, and not to allow others to
31
* use your version of this file under the terms of the NPL, indicate your
32
* decision by deleting the provisions above and replace them with the notice
33
* and other provisions required by the GPL or the LGPL. If you do not delete
34
* the provisions above, a recipient may use your version of this file under
35
* the terms of any one of the MPL, the GPL or the LGPL.
37
* ----- END LICENSE BLOCK ----- */
41
#include "nsISVGRendererGlyphGeometry.h"
42
#include "nsIDOMSVGMatrix.h"
43
#include "nsISVGGlyphGeometrySource.h"
44
#include "nsPromiseFlatString.h"
45
#include "nsIPresContext.h"
49
* \addtogroup libart_renderer Libart Rendering Engine
52
////////////////////////////////////////////////////////////////////////
54
* Libart glyph geometry implementation
56
class nsSVGLibartGlyphGeometry : public nsISVGRendererGlyphGeometry
59
friend nsresult NS_NewSVGLibartGlyphGeometryDefault(nsISVGRendererGlyphGeometry **result,
60
nsISVGGlyphGeometrySource *src);
62
nsSVGLibartGlyphGeometry();
63
~nsSVGLibartGlyphGeometry();
64
nsresult Init(nsISVGGlyphGeometrySource* src);
67
// nsISupports interface:
70
// nsISVGRendererGlyphGeometry interface:
71
NS_DECL_NSISVGRENDERERGLYPHGEOMETRY
77
//----------------------------------------------------------------------
80
nsSVGLibartGlyphGeometry::nsSVGLibartGlyphGeometry()
84
nsSVGLibartGlyphGeometry::~nsSVGLibartGlyphGeometry()
89
nsSVGLibartGlyphGeometry::Init(nsISVGGlyphGeometrySource* src)
96
NS_NewSVGLibartGlyphGeometryDefault(nsISVGRendererGlyphGeometry **result,
97
nsISVGGlyphGeometrySource *src)
101
nsSVGLibartGlyphGeometry* gg = new nsSVGLibartGlyphGeometry();
102
if (!gg) return NS_ERROR_OUT_OF_MEMORY;
106
nsresult rv = gg->Init(src);
117
//----------------------------------------------------------------------
118
// nsISupports methods:
120
NS_IMPL_ADDREF(nsSVGLibartGlyphGeometry)
121
NS_IMPL_RELEASE(nsSVGLibartGlyphGeometry)
123
NS_INTERFACE_MAP_BEGIN(nsSVGLibartGlyphGeometry)
124
NS_INTERFACE_MAP_ENTRY(nsISVGRendererGlyphGeometry)
125
NS_INTERFACE_MAP_ENTRY(nsISupports)
129
//----------------------------------------------------------------------
130
// nsISVGRendererGlyphGeometry methods:
132
/** Implements void render(in nsISVGRendererCanvas canvas); */
134
nsSVGLibartGlyphGeometry::Render(nsISVGRendererCanvas *canvas)
139
/** Implements nsISVGRendererRegion update(in unsigned long updatemask); */
141
nsSVGLibartGlyphGeometry::Update(PRUint32 updatemask, nsISVGRendererRegion **_retval)
147
/** Implements nsISVGRendererRegion getCoveredRegion(); */
149
nsSVGLibartGlyphGeometry::GetCoveredRegion(nsISVGRendererRegion **_retval)
155
/** Implements boolean containsPoint(in float x, in float y); */
157
nsSVGLibartGlyphGeometry::ContainsPoint(float x, float y, PRBool *_retval)