Bug 551298, patch B: Replace uses of THEBES_INLINE_DECL_REFCOUNTING with NS_INLINE_DECL_REFCOUNTING. r=roc
--- a/content/svg/content/src/nsSVGMatrix.cpp
+++ b/content/svg/content/src/nsSVGMatrix.cpp
@@ -36,16 +36,17 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsSVGMatrix.h"
#include "nsDOMError.h"
#include "nsSVGValue.h"
#include <math.h>
#include "nsContentUtils.h"
+#include "nsISupportsImpl.h"
const double radPerDegree = 2.0*3.1415926535 / 360.0;
class nsSVGMatrix : public nsIDOMSVGMatrix,
public nsSVGValue
{
public:
nsSVGMatrix(float a, float b, float c, float d, float e, float f);
--- a/content/svg/content/src/nsSVGMatrix.h
+++ b/content/svg/content/src/nsSVGMatrix.h
@@ -66,16 +66,17 @@
* up.
*/
#ifndef __NS_SVGMATRIX_H__
#define __NS_SVGMATRIX_H__
#include "nsIDOMSVGMatrix.h"
#include "gfxMatrix.h"
+#include "nsAutoPtr.h"
nsresult
NS_NewSVGMatrix(nsIDOMSVGMatrix** result,
float a = 1.0f, float b = 0.0f,
float c = 0.0f, float d = 1.0f,
float e = 0.0f, float f = 0.0f);
already_AddRefed<nsIDOMSVGMatrix>
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -37,16 +37,18 @@
#ifndef GFX_LAYERS_H
#define GFX_LAYERS_H
#include "gfxTypes.h"
#include "nsRegion.h"
#include "nsPoint.h"
#include "nsRect.h"
+#include "nsISupportsImpl.h"
+#include "nsAutoPtr.h"
#include "gfx3DMatrix.h"
class gfxContext;
class nsPaintEvent;
namespace mozilla {
namespace layers {
@@ -101,17 +103,17 @@ class ImageContainer;
* call EndTransaction to complete the transaction.
*
* All layer API calls happen on the main thread.
*
* Layers are refcounted. The layer manager holds a reference to the
* root layer, and each container layer holds a reference to its children.
*/
class THEBES_API LayerManager {
- THEBES_INLINE_DECL_REFCOUNTING(LayerManager)
+ NS_INLINE_DECL_REFCOUNTING(LayerManager)
public:
enum LayersBackend {
LAYERS_BASIC = 0,
LAYERS_OPENGL
};
virtual ~LayerManager() {}
@@ -176,17 +178,17 @@ public:
virtual LayersBackend GetBackendType() = 0;
};
/**
* A Layer represents anything that can be rendered onto a destination
* surface.
*/
class THEBES_API Layer {
- THEBES_INLINE_DECL_REFCOUNTING(Layer)
+ NS_INLINE_DECL_REFCOUNTING(Layer)
public:
virtual ~Layer() {}
/**
* Returns the LayoutManager this Layer belongs to. Cannot be null.
*/
LayerManager* Manager() { return mManager; }
--- a/gfx/thebes/public/gfxASurface.h
+++ b/gfx/thebes/public/gfxASurface.h
@@ -35,16 +35,17 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef GFX_ASURFACE_H
#define GFX_ASURFACE_H
#include "gfxTypes.h"
#include "gfxRect.h"
+#include "nsAutoPtr.h"
typedef struct _cairo_surface cairo_surface_t;
typedef struct _cairo_user_data_key cairo_user_data_key_t;
typedef void (*thebes_destroy_func_t) (void *data);
class gfxImageSurface;
--- a/gfx/thebes/public/gfxContext.h
+++ b/gfx/thebes/public/gfxContext.h
@@ -43,16 +43,17 @@
#include "gfxASurface.h"
#include "gfxColor.h"
#include "gfxPoint.h"
#include "gfxRect.h"
#include "gfxMatrix.h"
#include "gfxPattern.h"
#include "gfxPath.h"
+#include "nsISupportsImpl.h"
typedef struct _cairo cairo_t;
/**
* This is the main class for doing actual drawing. It is initialized using
* a surface and can be drawn on. It manages various state information like
* a current transformation matrix (CTM), a current path, current color,
* etc.
@@ -61,17 +62,17 @@ typedef struct _cairo cairo_t;
* The functions like Rectangle and Arc do not do any drawing themselves.
* When a path is drawn (stroked or filled), it is filled/stroked with a
* pattern set by SetPattern, SetColor or SetSource.
*
* Note that the gfxContext takes coordinates in device pixels,
* as opposed to app units.
*/
class THEBES_API gfxContext {
- THEBES_INLINE_DECL_REFCOUNTING(gfxContext)
+ NS_INLINE_DECL_REFCOUNTING(gfxContext)
public:
/**
* Initialize this context from a surface.
*/
gfxContext(gfxASurface *surface);
~gfxContext();
--- a/gfx/thebes/public/gfxFont.h
+++ b/gfx/thebes/public/gfxFont.h
@@ -50,16 +50,17 @@
#include "nsTHashtable.h"
#include "nsHashKeys.h"
#include "gfxSkipChars.h"
#include "gfxRect.h"
#include "nsExpirationTracker.h"
#include "gfxFontConstants.h"
#include "gfxPlatform.h"
#include "nsIAtom.h"
+#include "nsISupportsImpl.h"
#ifdef DEBUG
#include <stdio.h>
#endif
class gfxContext;
class gfxTextRun;
class gfxFont;
@@ -155,17 +156,17 @@ struct THEBES_API gfxFontStyle {
(stretch == other.stretch) &&
(language == other.language) &&
(sizeAdjust == other.sizeAdjust);
}
};
class gfxFontEntry {
public:
- THEBES_INLINE_DECL_REFCOUNTING(gfxFontEntry)
+ NS_INLINE_DECL_REFCOUNTING(gfxFontEntry)
gfxFontEntry(const nsAString& aName, gfxFontFamily *aFamily = nsnull,
PRBool aIsStandardFace = PR_FALSE) :
mName(aName), mItalic(PR_FALSE), mFixedPitch(PR_FALSE),
mIsProxy(PR_FALSE), mIsValid(PR_TRUE),
mIsBadUnderlineFont(PR_FALSE), mIsUserFont(PR_FALSE),
mStandardFace(aIsStandardFace),
mSymbolFont(PR_FALSE),
@@ -284,17 +285,17 @@ struct FontSearch {
const PRUint32 mCh;
gfxFont* mFontToMatch;
PRInt32 mMatchRank;
nsRefPtr<gfxFontEntry> mBestMatch;
};
class gfxFontFamily {
public:
- THEBES_INLINE_DECL_REFCOUNTING(gfxFontFamily)
+ NS_INLINE_DECL_REFCOUNTING(gfxFontFamily)
gfxFontFamily(const nsAString& aName) :
mName(aName),
mOtherFamilyNamesInitialized(PR_FALSE),
mHasOtherFamilyNames(PR_FALSE),
mFaceNamesInitialized(PR_FALSE),
mHasStyles(PR_FALSE),
mIsSimpleFamily(PR_FALSE),
@@ -950,17 +951,17 @@ protected:
nsAutoPtr<gfxFontShaper> mShaper;
// some fonts have bad metrics, this method sanitize them.
// if this font has bad underline offset, aIsBadUnderlineFont should be true.
void SanitizeMetrics(gfxFont::Metrics *aMetrics, PRBool aIsBadUnderlineFont);
};
class THEBES_API gfxTextRunFactory {
- THEBES_INLINE_DECL_REFCOUNTING(gfxTextRunFactory)
+ NS_INLINE_DECL_REFCOUNTING(gfxTextRunFactory)
public:
// Flags in the mask 0xFFFF0000 are reserved for textrun clients
// Flags in the mask 0x0000F000 are reserved for per-platform fonts
// Flags in the mask 0x00000FFF are set by the textrun creator.
enum {
CACHE_TEXT_FLAGS = 0xF0000000,
USER_TEXT_FLAGS = 0x0FFF0000,
--- a/gfx/thebes/public/gfxGdkNativeRenderer.h
+++ b/gfx/thebes/public/gfxGdkNativeRenderer.h
@@ -34,16 +34,17 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef GFXGDKNATIVERENDER_H_
#define GFXGDKNATIVERENDER_H_
#include "gfxColor.h"
+#include "nsAutoPtr.h"
#include <gdk/gdk.h>
class gfxASurface;
class gfxContext;
/**
* This class lets us take code that draws into an GDK drawable and lets us
* use it to draw into any Thebes context. The user should subclass this class,
--- a/gfx/thebes/public/gfxPath.h
+++ b/gfx/thebes/public/gfxPath.h
@@ -33,27 +33,28 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef GFX_PATH_H
#define GFX_PATH_H
#include "gfxTypes.h"
+#include "nsISupportsImpl.h"
class gfxContext;
struct gfxPoint;
typedef struct cairo_path cairo_path_t;
/**
* Class representing a path. Can be created by copying the current path
* of a gfxContext.
*/
class THEBES_API gfxPath {
- THEBES_INLINE_DECL_REFCOUNTING(gfxPath)
+ NS_INLINE_DECL_REFCOUNTING(gfxPath)
friend class gfxContext;
protected:
gfxPath(cairo_path_t* aPath);
public:
virtual ~gfxPath();
--- a/gfx/thebes/public/gfxPattern.h
+++ b/gfx/thebes/public/gfxPattern.h
@@ -37,24 +37,26 @@
#ifndef GFX_PATTERN_H
#define GFX_PATTERN_H
#include "gfxTypes.h"
#include "gfxColor.h"
#include "gfxMatrix.h"
+#include "nsISupportsImpl.h"
+#include "nsAutoPtr.h"
class gfxContext;
class gfxASurface;
typedef struct _cairo_pattern cairo_pattern_t;
class THEBES_API gfxPattern {
- THEBES_INLINE_DECL_REFCOUNTING(gfxPattern)
+ NS_INLINE_DECL_REFCOUNTING(gfxPattern)
public:
gfxPattern(cairo_pattern_t *aPattern);
gfxPattern(const gfxRGBA& aColor);
gfxPattern(gfxASurface *surface); // from another surface
// linear
gfxPattern(gfxFloat x0, gfxFloat y0, gfxFloat x1, gfxFloat y1); // linear
gfxPattern(gfxFloat cx0, gfxFloat cy0, gfxFloat radius0,
--- a/gfx/thebes/public/gfxRect.h
+++ b/gfx/thebes/public/gfxRect.h
@@ -35,16 +35,17 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef GFX_RECT_H
#define GFX_RECT_H
#include "gfxTypes.h"
#include "gfxPoint.h"
+#include "nsDebug.h"
struct THEBES_API gfxCorner {
typedef int Corner;
enum {
// this order is important!
TOP_LEFT = 0,
TOP_RIGHT = 1,
BOTTOM_RIGHT = 2,
--- a/gfx/thebes/public/gfxTypes.h
+++ b/gfx/thebes/public/gfxTypes.h
@@ -85,26 +85,16 @@ typedef double gfxFloat;
* @see nsLineLayout::NotifyOptionalBreakPosition
*/
enum gfxBreakPriority {
eNoBreak = 0,
eWordWrapBreak,
eNormalBreak
};
-/**
- * Define refcounting for Thebes. For now use the stuff from nsISupportsImpl
- * even though it forces the functions to be virtual...
- */
-#include "nsISupportsImpl.h"
-#include "nsAutoPtr.h"
-
-#define THEBES_INLINE_DECL_REFCOUNTING(_class) \
- NS_INLINE_DECL_REFCOUNTING(_class)
-
#define THEBES_INLINE_DECL_THREADSAFE_REFCOUNTING(_class) \
public: \
nsrefcnt AddRef(void) { \
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt"); \
nsrefcnt count = PR_AtomicIncrement((PRInt32*)&mRefCnt); \
NS_LOG_ADDREF(this, count, #_class, sizeof(*this)); \
return count; \
} \
--- a/gfx/thebes/public/gfxUserFontSet.h
+++ b/gfx/thebes/public/gfxUserFontSet.h
@@ -41,16 +41,17 @@
#include "gfxTypes.h"
#include "gfxFont.h"
#include "gfxFontUtils.h"
#include "nsRefPtrHashtable.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsIURI.h"
#include "nsIFile.h"
+#include "nsISupportsImpl.h"
class nsIURI;
class gfxMixedFontFamily;
// parsed CSS @font-face rule information
// lifetime: from when @font-face rule processed until font is loaded
struct gfxFontFaceSrc {
PRPackedBool mIsLocal; // url or local
@@ -133,17 +134,17 @@ public:
};
class gfxProxyFontEntry;
class THEBES_API gfxUserFontSet {
public:
- THEBES_INLINE_DECL_REFCOUNTING(gfxUserFontSet)
+ NS_INLINE_DECL_REFCOUNTING(gfxUserFontSet)
gfxUserFontSet();
virtual ~gfxUserFontSet();
enum {
// no flags ==> no hint set
// unknown ==> unknown format hint set
FLAG_FORMAT_UNKNOWN = 1,
--- a/gfx/thebes/src/gfxFontconfigUtils.h
+++ b/gfx/thebes/src/gfxFontconfigUtils.h
@@ -39,16 +39,17 @@
#ifndef GFX_FONTCONFIG_UTILS_H
#define GFX_FONTCONFIG_UTILS_H
#include "gfxPlatform.h"
#include "nsAutoRef.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
+#include "nsISupportsImpl.h"
#include <fontconfig/fontconfig.h>
NS_SPECIALIZE_TEMPLATE
class nsAutoRefTraits<FcPattern> : public nsPointerRefTraits<FcPattern>
{
public:
@@ -82,17 +83,17 @@ class gfxIgnoreCaseCStringComparator
{
return a < b;
}
};
class gfxFontNameList : public nsTArray<nsString>
{
public:
- THEBES_INLINE_DECL_REFCOUNTING(gfxFontNameList)
+ NS_INLINE_DECL_REFCOUNTING(gfxFontNameList)
PRBool Exists(nsAString& aName);
};
class gfxFontconfigUtils {
public:
gfxFontconfigUtils();
static gfxFontconfigUtils* GetFontconfigUtils() {
--- a/gfx/thebes/src/gfxPangoFonts.cpp
+++ b/gfx/thebes/src/gfxPangoFonts.cpp
@@ -930,17 +930,17 @@ GetFontGroup(PangoContext *aContext)
* gfxFcPangoFontSet:
*
* Translation from a desired FcPattern to a sorted set of font references
* (fontconfig cache data) and (when needed) PangoFonts.
*/
class gfxFcPangoFontSet {
public:
- THEBES_INLINE_DECL_REFCOUNTING(gfxFcPangoFontSet)
+ NS_INLINE_DECL_REFCOUNTING(gfxFcPangoFontSet)
explicit gfxFcPangoFontSet(FcPattern *aPattern,
gfxUserFontSet *aUserFontSet)
: mSortPattern(aPattern), mUserFontSet(aUserFontSet),
mFcFontSet(SortPreferredFonts()), mFcFontsTrimmed(0),
mHaveFallbackFonts(PR_FALSE)
{
}
--- a/layout/printing/nsPrintData.h
+++ b/layout/printing/nsPrintData.h
@@ -39,16 +39,17 @@
// Interfaces
#include "nsIDOMWindow.h"
#include "nsIDeviceContext.h"
#include "nsIPrintProgressParams.h"
#include "nsIPrintOptions.h"
#include "nsTArray.h"
#include "nsCOMArray.h"
+#include "nsAutoPtr.h"
// Classes
class nsPrintObject;
class nsPrintPreviewListener;
class nsIWebProgressListener;
//------------------------------------------------------------------------
// nsPrintData Class