~ubuntu-branches/ubuntu/intrepid/xulrunner-1.9/intrepid

« back to all changes in this revision

Viewing changes to mozilla/gfx/src/nsRenderingContextImpl.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack, Alexander Sack, Fabien Tassin
  • Date: 2008-02-13 11:47:21 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080213114721-7om0mgzngvuk9czv
Tags: 1.9~b3+nobinonly-0ubuntu1
* release FIREFOX_3_0b3_RELEASE

[ Alexander Sack ]
* submit patch that ships xpcshell to bugzilla
  - rename debian/patches/ship_xpcshell.patch =>
           debian/patches/bz410617_att295212_ship_xpcshell.patch
  - update debian/patches/series
* fix tooltip in epiphany: previously displayed out of screen bounds
  (LP: #37507)
  - add debian/patches/bz233371_att297343_fix_outofscreen_embed_tooltip.patch
  - update debian/patches/series
* use default upstream gcc tweaks for improved performance - especially of the
  javascript engine
  - update debian/rules
* update global extension/plugin patch to apply cleanly against latest code
  - update debian/patches/bzXXX_gre_extension_plugin_support.patch
* fix pyxpcom build failure introduced by recent commit
  - add debian/patches/bzXXX_fix_pyxpcom_build_failure.patch
  - update debian/patches/series
* add distro independent global install locations for extensions,
  /usr/lib/mozilla/extensions and /usr/share/mozilla/extensions
  - update debian/xulrunner-1.9.dirs
* support embedded tarball layout when either there is a *.tar.bz2 in orig tarball
  or if DEBIAN_MOZCLIENT_EMBEDDED is not unset (you will need this to produce embedded
  tarballs during |get-orig-source|
  - update debian/rules
* bump minimum libnss3-dev build requirements to >= 3.12.0~1.9b3
  - update debian/control
* bump minimum libnspr4-dev build requirements to >= 4.7.0~1.9b3
  - update debian/control

[ Fabien Tassin ]
* Drop patches applied upstream
  - drop debian/patches/bz410617_att295212_ship_xpcshell.patch
  - drop debian/patches/bz404634_att294921.patch
  - drop debian/patches/bz386610_python2.5_ftbfs_amd64.patch
  - drop debian/patches/bz373918_att295042.patch
  - drop debian/patches/bz408062_unstable_pc.patch
  - drop debian/patches/bz384304_fix_recursive_symlinks.patch
  - update debian/patches/series
* Refresh diverged patches:
  - update debian/patches/bzXXX_pc_honour_system_nspr_nss.patch
  - update debian/patches/rename_venkman_addon.patch
  - update debian/patches/bz344818_cairo_xrender.patch
* Install links for all .so libs in the -dev package
  - update debian/patches/dont_install_so_in_dev.patch
* Bump gtk requirement to 2.12 as per Mozilla bug 412432
  - update debian/control
* Add #DEBHELPER# token to postinst/prerm scripts
  - update debian/xulrunner-1.9.{postinst,prerm}
* Install previously missed libdbusservice.so
  - update debian/xulrunner-1.9.install
* Update venkman patch to also rename locales
  - update debian/patches/rename_venkman_addon.patch
* Bump requirement for system cairo to >= 1.5.8 as we now need
  the newly added cairo_path_extents()
  - update debian/rules
* Include mozilla-devscripts file using -include so ifneq could be omitted
  - update debian/rules
* Fix missing .so symlinks regression
  - update debian/patches/dont_install_so_in_dev.patch

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 Version
6
 
 * 1.1 (the "License"); you may not use this file except in compliance with
7
 
 * 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 mozilla.org code.
16
 
 *
17
 
 * The Initial Developer of the Original Code is
18
 
 * Netscape Communications Corporation.
19
 
 * Portions created by the Initial Developer are Copyright (C) 1998
20
 
 * the Initial Developer. All Rights Reserved.
21
 
 *
22
 
 * Contributor(s):
23
 
 *
24
 
 * Alternatively, the contents of this file may be used under the terms of
25
 
 * either of the GNU General Public License Version 2 or later (the "GPL"),
26
 
 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
 
 * in which case the provisions of the GPL or the LGPL are applicable instead
28
 
 * of those above. If you wish to allow use of your version of this file only
29
 
 * under the terms of either the GPL or the LGPL, and not to allow others to
30
 
 * use your version of this file under the terms of the MPL, indicate your
31
 
 * decision by deleting the provisions above and replace them with the notice
32
 
 * and other provisions required by the GPL or the LGPL. If you do not delete
33
 
 * the provisions above, a recipient may use your version of this file under
34
 
 * the terms of any one of the MPL, the GPL or the LGPL.
35
 
 *
36
 
 * ***** END LICENSE BLOCK ***** */
37
 
 
38
 
#ifndef nsRenderingContextImpl_h___
39
 
#define nsRenderingContextImpl_h___
40
 
 
41
 
#include "gfxCore.h"
42
 
#include "nsIRenderingContext.h"
43
 
#include "nsPoint.h"
44
 
#include "nsSize.h"
45
 
 
46
 
#ifdef MOZ_CAIRO_GFX
47
 
class gfxContext;
48
 
#endif
49
 
 
50
 
class nsRenderingContextImpl : public nsIRenderingContext
51
 
{
52
 
 
53
 
// CLASS MEMBERS
54
 
 
55
 
public:
56
 
  nsRenderingContextImpl();
57
 
 
58
 
 
59
 
// CLASS METHODS
60
 
 
61
 
  /**
62
 
   * Return the maximum length of a string that can be handled by the platform
63
 
   * using the current font metrics.
64
 
   * The implementation here is just a stub; classes that don't override
65
 
   * the safe string methods need to implement this.
66
 
   */
67
 
  virtual PRInt32 GetMaxStringLength() = 0;
68
 
 
69
 
  /**
70
 
   * Let the device context know whether we want text reordered with
71
 
   * right-to-left base direction
72
 
   */
73
 
  NS_IMETHOD GetRightToLeftText(PRBool* aIsRTL);
74
 
 
75
 
  // Safe string method variants: by default, these defer to the more
76
 
  // elaborate methods below
77
 
  NS_IMETHOD GetWidth(const nsString& aString, nscoord &aWidth,
78
 
                      PRInt32 *aFontID = nsnull);
79
 
  NS_IMETHOD GetWidth(const char* aString, nscoord& aWidth);
80
 
  NS_IMETHOD DrawString(const nsString& aString, nscoord aX, nscoord aY,
81
 
                        PRInt32 aFontID = -1,
82
 
                        const nscoord* aSpacing = nsnull);
83
 
 
84
 
  // Safe string methods
85
 
  NS_IMETHOD GetWidth(const char* aString, PRUint32 aLength,
86
 
                      nscoord& aWidth);
87
 
  NS_IMETHOD GetWidth(const PRUnichar *aString, PRUint32 aLength,
88
 
                      nscoord &aWidth, PRInt32 *aFontID = nsnull);
89
 
 
90
 
  NS_IMETHOD GetTextDimensions(const char* aString, PRUint32 aLength,
91
 
                               nsTextDimensions& aDimensions);
92
 
  NS_IMETHOD GetTextDimensions(const PRUnichar* aString, PRUint32 aLength,
93
 
                               nsTextDimensions& aDimensions, PRInt32* aFontID = nsnull);
94
 
 
95
 
#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11) || defined(XP_BEOS)
96
 
  NS_IMETHOD GetTextDimensions(const char*       aString,
97
 
                               PRInt32           aLength,
98
 
                               PRInt32           aAvailWidth,
99
 
                               PRInt32*          aBreaks,
100
 
                               PRInt32           aNumBreaks,
101
 
                               nsTextDimensions& aDimensions,
102
 
                               PRInt32&          aNumCharsFit,
103
 
                               nsTextDimensions& aLastWordDimensions,
104
 
                               PRInt32*          aFontID = nsnull);
105
 
 
106
 
  NS_IMETHOD GetTextDimensions(const PRUnichar*  aString,
107
 
                               PRInt32           aLength,
108
 
                               PRInt32           aAvailWidth,
109
 
                               PRInt32*          aBreaks,
110
 
                               PRInt32           aNumBreaks,
111
 
                               nsTextDimensions& aDimensions,
112
 
                               PRInt32&          aNumCharsFit,
113
 
                               nsTextDimensions& aLastWordDimensions,
114
 
                               PRInt32*          aFontID = nsnull);
115
 
#endif
116
 
#ifdef MOZ_MATHML
117
 
  NS_IMETHOD
118
 
  GetBoundingMetrics(const char*        aString,
119
 
                     PRUint32           aLength,
120
 
                     nsBoundingMetrics& aBoundingMetrics);
121
 
  NS_IMETHOD
122
 
  GetBoundingMetrics(const PRUnichar*   aString,
123
 
                     PRUint32           aLength,
124
 
                     nsBoundingMetrics& aBoundingMetrics,
125
 
                     PRInt32*           aFontID = nsnull);
126
 
#endif
127
 
  NS_IMETHOD DrawString(const char *aString, PRUint32 aLength,
128
 
                        nscoord aX, nscoord aY,
129
 
                        const nscoord* aSpacing = nsnull);
130
 
  NS_IMETHOD DrawString(const PRUnichar *aString, PRUint32 aLength,
131
 
                        nscoord aX, nscoord aY,
132
 
                        PRInt32 aFontID = -1,
133
 
                        const nscoord* aSpacing = nsnull);
134
 
 
135
 
  // Unsafe platform-specific implementations
136
 
  NS_IMETHOD GetWidthInternal(const char* aString, PRUint32 aLength,
137
 
                              nscoord& aWidth)
138
 
  { return NS_ERROR_NOT_IMPLEMENTED; }
139
 
  NS_IMETHOD GetWidthInternal(const PRUnichar *aString, PRUint32 aLength,
140
 
                              nscoord &aWidth, PRInt32 *aFontID = nsnull)
141
 
  { return NS_ERROR_NOT_IMPLEMENTED; }
142
 
 
143
 
  NS_IMETHOD GetTextDimensionsInternal(const char* aString, PRUint32 aLength,
144
 
                                       nsTextDimensions& aDimensions)
145
 
  { return NS_ERROR_NOT_IMPLEMENTED; }
146
 
  NS_IMETHOD GetTextDimensionsInternal(const PRUnichar* aString, PRUint32 aLength,
147
 
                                       nsTextDimensions& aDimensions, PRInt32* aFontID = nsnull)
148
 
  { return NS_ERROR_NOT_IMPLEMENTED; }
149
 
 
150
 
#if defined(_WIN32) || defined(XP_OS2) || defined(MOZ_X11) || defined(XP_BEOS)
151
 
  NS_IMETHOD GetTextDimensionsInternal(const char*       aString,
152
 
                                       PRInt32           aLength,
153
 
                                       PRInt32           aAvailWidth,
154
 
                                       PRInt32*          aBreaks,
155
 
                                       PRInt32           aNumBreaks,
156
 
                                       nsTextDimensions& aDimensions,
157
 
                                       PRInt32&          aNumCharsFit,
158
 
                                       nsTextDimensions& aLastWordDimensions,
159
 
                                       PRInt32*          aFontID = nsnull)
160
 
  { return NS_ERROR_NOT_IMPLEMENTED; }
161
 
 
162
 
  NS_IMETHOD GetTextDimensionsInternal(const PRUnichar*  aString,
163
 
                                       PRInt32           aLength,
164
 
                                       PRInt32           aAvailWidth,
165
 
                                       PRInt32*          aBreaks,
166
 
                                       PRInt32           aNumBreaks,
167
 
                                       nsTextDimensions& aDimensions,
168
 
                                       PRInt32&          aNumCharsFit,
169
 
                                       nsTextDimensions& aLastWordDimensions,
170
 
                                       PRInt32*          aFontID = nsnull)
171
 
  { return NS_ERROR_NOT_IMPLEMENTED; }
172
 
#endif
173
 
#ifdef MOZ_MATHML
174
 
  NS_IMETHOD
175
 
  GetBoundingMetricsInternal(const char*        aString,
176
 
                             PRUint32           aLength,
177
 
                             nsBoundingMetrics& aBoundingMetrics)
178
 
  { return NS_ERROR_NOT_IMPLEMENTED; }
179
 
  NS_IMETHOD
180
 
  GetBoundingMetricsInternal(const PRUnichar*   aString,
181
 
                             PRUint32           aLength,
182
 
                             nsBoundingMetrics& aBoundingMetrics,
183
 
                             PRInt32*           aFontID = nsnull)
184
 
  { return NS_ERROR_NOT_IMPLEMENTED; }
185
 
#endif
186
 
  NS_IMETHOD DrawStringInternal(const char *aString, PRUint32 aLength,
187
 
                                nscoord aX, nscoord aY,
188
 
                                const nscoord* aSpacing = nsnull)
189
 
  { return NS_ERROR_NOT_IMPLEMENTED; }
190
 
  NS_IMETHOD DrawStringInternal(const PRUnichar *aString, PRUint32 aLength,
191
 
                                nscoord aX, nscoord aY,
192
 
                                PRInt32 aFontID = -1,
193
 
                                const nscoord* aSpacing = nsnull)
194
 
  { return NS_ERROR_NOT_IMPLEMENTED; }
195
 
 
196
 
  gfxContext *ThebesContext() { return nsnull; }
197
 
 
198
 
protected:
199
 
  virtual ~nsRenderingContextImpl();
200
 
 
201
 
};
202
 
 
203
 
#endif /* nsRenderingContextImpl */