~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphGeometryDefault.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
4
 *
 
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/
 
9
 *
 
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
 
13
 * License.
 
14
 *
 
15
 * The Original Code is the Mozilla SVG project.
 
16
 *
 
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.
 
21
 *
 
22
 * Contributor(s):
 
23
 *    Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
 
24
 *
 
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.
 
36
 *
 
37
 * ----- END LICENSE BLOCK ----- */
 
38
 
 
39
 
 
40
#include "nsCOMPtr.h"
 
41
#include "nsISVGRendererGlyphGeometry.h"
 
42
#include "nsIDOMSVGMatrix.h"
 
43
#include "nsISVGGlyphGeometrySource.h"
 
44
#include "nsPromiseFlatString.h"
 
45
#include "nsIPresContext.h"
 
46
#include "nsMemory.h"
 
47
 
 
48
/**
 
49
 * \addtogroup libart_renderer Libart Rendering Engine
 
50
 * @{
 
51
 */
 
52
////////////////////////////////////////////////////////////////////////
 
53
/**
 
54
 *  Libart glyph geometry implementation 
 
55
 */
 
56
class nsSVGLibartGlyphGeometry : public nsISVGRendererGlyphGeometry
 
57
{
 
58
protected:
 
59
  friend nsresult NS_NewSVGLibartGlyphGeometryDefault(nsISVGRendererGlyphGeometry **result,
 
60
                                                      nsISVGGlyphGeometrySource *src);
 
61
 
 
62
  nsSVGLibartGlyphGeometry();
 
63
  ~nsSVGLibartGlyphGeometry();
 
64
  nsresult Init(nsISVGGlyphGeometrySource* src);
 
65
 
 
66
public:
 
67
  // nsISupports interface:
 
68
  NS_DECL_ISUPPORTS
 
69
 
 
70
  // nsISVGRendererGlyphGeometry interface:
 
71
  NS_DECL_NSISVGRENDERERGLYPHGEOMETRY
 
72
  
 
73
};
 
74
 
 
75
/** @} */
 
76
 
 
77
//----------------------------------------------------------------------
 
78
// implementation:
 
79
 
 
80
nsSVGLibartGlyphGeometry::nsSVGLibartGlyphGeometry()
 
81
{
 
82
}
 
83
 
 
84
nsSVGLibartGlyphGeometry::~nsSVGLibartGlyphGeometry()
 
85
{
 
86
}
 
87
 
 
88
nsresult
 
89
nsSVGLibartGlyphGeometry::Init(nsISVGGlyphGeometrySource* src)
 
90
{
 
91
  return NS_OK;
 
92
}
 
93
 
 
94
 
 
95
nsresult
 
96
NS_NewSVGLibartGlyphGeometryDefault(nsISVGRendererGlyphGeometry **result,
 
97
                                    nsISVGGlyphGeometrySource *src)
 
98
{
 
99
  *result = nsnull;
 
100
  
 
101
  nsSVGLibartGlyphGeometry* gg = new nsSVGLibartGlyphGeometry();
 
102
  if (!gg) return NS_ERROR_OUT_OF_MEMORY;
 
103
 
 
104
  NS_ADDREF(gg);
 
105
 
 
106
  nsresult rv = gg->Init(src);
 
107
 
 
108
  if (NS_FAILED(rv)) {
 
109
    NS_RELEASE(gg);
 
110
    return rv;
 
111
  }
 
112
  
 
113
  *result = gg;
 
114
  return rv;
 
115
}
 
116
 
 
117
//----------------------------------------------------------------------
 
118
// nsISupports methods:
 
119
 
 
120
NS_IMPL_ADDREF(nsSVGLibartGlyphGeometry)
 
121
NS_IMPL_RELEASE(nsSVGLibartGlyphGeometry)
 
122
 
 
123
NS_INTERFACE_MAP_BEGIN(nsSVGLibartGlyphGeometry)
 
124
  NS_INTERFACE_MAP_ENTRY(nsISVGRendererGlyphGeometry)
 
125
  NS_INTERFACE_MAP_ENTRY(nsISupports)
 
126
NS_INTERFACE_MAP_END
 
127
 
 
128
 
 
129
//----------------------------------------------------------------------
 
130
// nsISVGRendererGlyphGeometry methods:
 
131
 
 
132
/** Implements void render(in nsISVGRendererCanvas canvas); */
 
133
NS_IMETHODIMP
 
134
nsSVGLibartGlyphGeometry::Render(nsISVGRendererCanvas *canvas)
 
135
{
 
136
  return NS_OK;
 
137
}
 
138
 
 
139
/** Implements nsISVGRendererRegion update(in unsigned long updatemask); */
 
140
NS_IMETHODIMP
 
141
nsSVGLibartGlyphGeometry::Update(PRUint32 updatemask, nsISVGRendererRegion **_retval)
 
142
{
 
143
  *_retval = nsnull;      
 
144
  return NS_OK;
 
145
}
 
146
 
 
147
/** Implements nsISVGRendererRegion getCoveredRegion(); */
 
148
NS_IMETHODIMP
 
149
nsSVGLibartGlyphGeometry::GetCoveredRegion(nsISVGRendererRegion **_retval)
 
150
{
 
151
  *_retval = nsnull;
 
152
  return NS_OK;
 
153
}
 
154
 
 
155
/** Implements boolean containsPoint(in float x, in float y); */
 
156
NS_IMETHODIMP
 
157
nsSVGLibartGlyphGeometry::ContainsPoint(float x, float y, PRBool *_retval)
 
158
{
 
159
  *_retval = PR_FALSE;
 
160
  return NS_OK;
 
161
}
 
162
 
 
163