From c8d8ad51cde1885553dd5d5f79a30d7bbaf1baf2 Mon Sep 17 00:00:00 2001 From: "benjamin%smedbergs.us" Date: Thu, 27 Apr 2006 14:41:11 +0000 Subject: [PATCH] Bug 332115 - hide a bunch of symbols when building libxul, fix the thebes symbols so that they are exported/imported sanely, and some other graphics-related linking/visibility fixups, r=darin+vlad git-svn-id: svn://10.0.0.236/trunk@195565 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/cairo/cairo/src/Makefile.in | 2 + mozilla/gfx/cairo/cairo/src/cairo-platform.h | 18 +- mozilla/gfx/cairo/libpixman/src/Makefile.in | 6 +- mozilla/gfx/public/nsDeviceContext.h | 7 +- mozilla/gfx/src/nsRenderingContextImpl.h | 6 - mozilla/gfx/thebes/public/gfxASurface.h | 4 +- mozilla/gfx/thebes/public/gfxAtsuiFonts.h | 4 +- mozilla/gfx/thebes/public/gfxColor.h | 2 +- mozilla/gfx/thebes/public/gfxContext.h | 2 +- mozilla/gfx/thebes/public/gfxFilter.h | 2 +- mozilla/gfx/thebes/public/gfxFont.h | 8 +- mozilla/gfx/thebes/public/gfxGlitzSurface.h | 2 +- mozilla/gfx/thebes/public/gfxImageSurface.h | 2 +- mozilla/gfx/thebes/public/gfxMatrix.h | 2 +- mozilla/gfx/thebes/public/gfxPDFSurface.h | 2 +- mozilla/gfx/thebes/public/gfxPSSurface.h | 2 +- mozilla/gfx/thebes/public/gfxPangoFonts.h | 4 +- mozilla/gfx/thebes/public/gfxPattern.h | 2 +- mozilla/gfx/thebes/public/gfxPlatform.h | 2 +- mozilla/gfx/thebes/public/gfxPlatformGtk.h | 2 +- mozilla/gfx/thebes/public/gfxPlatformMac.h | 2 +- mozilla/gfx/thebes/public/gfxPoint.h | 4 +- mozilla/gfx/thebes/public/gfxQuartzSurface.h | 2 +- mozilla/gfx/thebes/public/gfxRect.h | 2 +- mozilla/gfx/thebes/public/gfxRegion.h | 2 +- mozilla/gfx/thebes/public/gfxTypes.h | 9 +- mozilla/gfx/thebes/public/gfxWindowsFonts.h | 4 +- .../gfx/thebes/public/gfxWindowsPlatform.h | 2 +- mozilla/gfx/thebes/public/gfxWindowsSurface.h | 2 +- .../gfx/thebes/public/gfxXlibNativeRenderer.h | 2 +- mozilla/gfx/thebes/public/gfxXlibSurface.h | 2 +- mozilla/gfx/thebes/src/Makefile.in | 2 + mozilla/jpeg/jmorecfg.h | 8 +- .../modules/libpr0n/decoders/icon/Makefile.in | 12 +- .../libpr0n/decoders/icon/gtk/Makefile.in | 1 - .../decoders/icon/gtk/nsIconChannel.cpp | 14 +- .../libpr0n/decoders/icon/nsIconDecoder.cpp | 1 + .../libpr0n/decoders/icon/nsIconURI.cpp | 158 ++++++++++-------- .../modules/libpr0n/decoders/icon/nsIconURI.h | 5 +- mozilla/modules/zlib/src/mozzconf.h | 6 +- 40 files changed, 185 insertions(+), 136 deletions(-) diff --git a/mozilla/gfx/cairo/cairo/src/Makefile.in b/mozilla/gfx/cairo/cairo/src/Makefile.in index b151dffab73..794fd8ac0d7 100644 --- a/mozilla/gfx/cairo/cairo/src/Makefile.in +++ b/mozilla/gfx/cairo/cairo/src/Makefile.in @@ -45,7 +45,9 @@ include $(DEPTH)/config/autoconf.mk SUBMAKEFILES += cairo-features.h +ifndef MOZ_ENABLE_LIBXUL VISIBILITY_FLAGS = +endif MODULE = cairo LIBRARY_NAME = mozcairo diff --git a/mozilla/gfx/cairo/cairo/src/cairo-platform.h b/mozilla/gfx/cairo/cairo/src/cairo-platform.h index 519de0c0025..4d75e9027a3 100644 --- a/mozilla/gfx/cairo/cairo/src/cairo-platform.h +++ b/mozilla/gfx/cairo/cairo/src/cairo-platform.h @@ -37,7 +37,21 @@ #ifndef CAIRO_PLATFORM_H #define CAIRO_PLATFORM_H -#if defined(XP_WIN) +#if defined(MOZ_ENABLE_LIBXUL) + +#ifdef HAVE_VISIBILITY_HIDDEN_ATTRIBUTE +#define CVISIBILITY_HIDDEN __attribute__((visibility("hidden"))) +#else +#define CVISIBILITY_HIDDEN +#endif + +// In libxul builds we don't ever want to export cairo symbols +#define cairo_public extern CVISIBILITY_HIDDEN +#define CCALLBACK +#define CCALLBACK_DECL +#define CSTATIC_CALLBACK(__x) static __x + +#elif defined(XP_WIN) #define cairo_public extern __declspec(dllexport) #define CCALLBACK @@ -67,7 +81,7 @@ #else /* Unix */ -#ifdef HAVE_VISIBILITY_PRAGMA +#ifdef HAVE_VISIBILITY_ATTRIBUTE #define CVISIBILITY_DEFAULT __attribute__((visibility("default"))) #else #define CVISIBILITY_DEFAULT diff --git a/mozilla/gfx/cairo/libpixman/src/Makefile.in b/mozilla/gfx/cairo/libpixman/src/Makefile.in index 4d07eeae504..3a562e2b5e9 100644 --- a/mozilla/gfx/cairo/libpixman/src/Makefile.in +++ b/mozilla/gfx/cairo/libpixman/src/Makefile.in @@ -43,12 +43,14 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -VISIBILITY_FLAGS = - MODULE = libpixman LIBRARY_NAME = mozlibpixman LIBXUL_LIBRARY = 1 +ifndef MOZ_ENABLE_LIBXUL +VISIBILITY_FLAGS = +endif + CSRCS = \ fbcompose.c \ fbedge.c \ diff --git a/mozilla/gfx/public/nsDeviceContext.h b/mozilla/gfx/public/nsDeviceContext.h index 0b963c59649..94176e1938d 100644 --- a/mozilla/gfx/public/nsDeviceContext.h +++ b/mozilla/gfx/public/nsDeviceContext.h @@ -78,8 +78,9 @@ protected: // ownership is implied. MMP. }; -#undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT +// inherit visibility from the NS_GFX class declaration +#undef IMETHOD_VISIBILITY +#define IMETHOD_VISIBILITY class NS_GFX DeviceContextImpl : public nsIDeviceContext, public nsIObserver, @@ -169,7 +170,7 @@ public: #endif }; -#undef IMETHOD_VISIBILITY +#undef IMETHOD_VISIBILITY #define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif /* nsDeviceContext_h___ */ diff --git a/mozilla/gfx/src/nsRenderingContextImpl.h b/mozilla/gfx/src/nsRenderingContextImpl.h index 10a8bc5cffa..65d279e8386 100644 --- a/mozilla/gfx/src/nsRenderingContextImpl.h +++ b/mozilla/gfx/src/nsRenderingContextImpl.h @@ -50,9 +50,6 @@ typedef struct { int i; // edge number: edge i goes from mPointList[i] to mPointList[i+1] } Edge; -#undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT - class nsRenderingContextImpl : public nsIRenderingContext { @@ -203,7 +200,4 @@ private: }; -#undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN - #endif /* nsRenderingContextImpl */ diff --git a/mozilla/gfx/thebes/public/gfxASurface.h b/mozilla/gfx/thebes/public/gfxASurface.h index 072370a0630..caea2d4ae14 100644 --- a/mozilla/gfx/thebes/public/gfxASurface.h +++ b/mozilla/gfx/thebes/public/gfxASurface.h @@ -48,7 +48,7 @@ * A surface is something you can draw on. Instantiate a subclass of this * abstract class, and use gfxContext to draw on this surface. */ -class NS_EXPORT gfxASurface { +class THEBES_API gfxASurface { THEBES_DECL_REFCOUNTING_ABSTRACT public: @@ -148,7 +148,7 @@ private: /** * An Unknown surface; used to wrap unknown cairo_surface_t returns from cairo */ -class NS_EXPORT gfxUnknownSurface : public gfxASurface { +class THEBES_API gfxUnknownSurface : public gfxASurface { THEBES_DECL_ISUPPORTS_INHERITED public: diff --git a/mozilla/gfx/thebes/public/gfxAtsuiFonts.h b/mozilla/gfx/thebes/public/gfxAtsuiFonts.h index e1ebdf35bd5..6a38a38753a 100644 --- a/mozilla/gfx/thebes/public/gfxAtsuiFonts.h +++ b/mozilla/gfx/thebes/public/gfxAtsuiFonts.h @@ -72,7 +72,7 @@ protected: gfxFont::Metrics mMetrics; }; -class NS_EXPORT gfxAtsuiFontGroup : public gfxFontGroup { +class THEBES_API gfxAtsuiFontGroup : public gfxFontGroup { public: gfxAtsuiFontGroup(const nsAString& families, const gfxFontStyle *aStyle); @@ -97,7 +97,7 @@ protected: ATSUFontFallbacks mFallbacks; }; -class NS_EXPORT gfxAtsuiTextRun : public gfxTextRun { +class THEBES_API gfxAtsuiTextRun : public gfxTextRun { THEBES_DECL_ISUPPORTS_INHERITED public: gfxAtsuiTextRun(const nsAString& aString, gfxAtsuiFontGroup *aFontGroup); diff --git a/mozilla/gfx/thebes/public/gfxColor.h b/mozilla/gfx/thebes/public/gfxColor.h index 800bbd6ba8f..4736a24980b 100644 --- a/mozilla/gfx/thebes/public/gfxColor.h +++ b/mozilla/gfx/thebes/public/gfxColor.h @@ -49,7 +49,7 @@ * XXX should this use doubles (instead of gfxFloat), for consistency with * cairo? */ -struct NS_EXPORT gfxRGBA { +struct THEBES_API gfxRGBA { gfxFloat r, g, b, a; gfxRGBA() { } diff --git a/mozilla/gfx/thebes/public/gfxContext.h b/mozilla/gfx/thebes/public/gfxContext.h index 16a703b3a5e..2b5f8b73f09 100644 --- a/mozilla/gfx/thebes/public/gfxContext.h +++ b/mozilla/gfx/thebes/public/gfxContext.h @@ -64,7 +64,7 @@ class gfxTextRun; * When a path is drawn (stroked or filled), it is filled/stroked with a * pattern set by SetPattern, SetColor or SetSource. */ -class NS_EXPORT gfxContext { +class THEBES_API gfxContext { THEBES_DECL_REFCOUNTING public: diff --git a/mozilla/gfx/thebes/public/gfxFilter.h b/mozilla/gfx/thebes/public/gfxFilter.h index 79ed098b465..4f014d512e8 100644 --- a/mozilla/gfx/thebes/public/gfxFilter.h +++ b/mozilla/gfx/thebes/public/gfxFilter.h @@ -45,7 +45,7 @@ * * @see gfxContext::PushFilter, gfxContext::PopFilter */ -class NS_EXPORT gfxFilter { +class THEBES_API gfxFilter { static gfxFilter* CreateOpacityFilter(gfxFloat alpha); // CreateGaussianFilter, etc }; diff --git a/mozilla/gfx/thebes/public/gfxFont.h b/mozilla/gfx/thebes/public/gfxFont.h index b7489ca9018..b75d05ef71e 100644 --- a/mozilla/gfx/thebes/public/gfxFont.h +++ b/mozilla/gfx/thebes/public/gfxFont.h @@ -64,7 +64,7 @@ class gfxTextRun; class gfxFontGroup; -struct NS_EXPORT gfxFontStyle { +struct THEBES_API gfxFontStyle { gfxFontStyle(PRUint8 aStyle, PRUint8 aVariant, PRUint16 aWeight, PRUint8 aDecoration, gfxFloat aSize, const nsACString& aLangGroup, @@ -119,7 +119,7 @@ struct NS_EXPORT gfxFontStyle { /* a SPECIFIC single font family */ -class NS_EXPORT gfxFont { +class THEBES_API gfxFont { THEBES_DECL_REFCOUNTING_ABSTRACT public: @@ -162,7 +162,7 @@ protected: }; -class NS_EXPORT gfxFontGroup { +class THEBES_API gfxFontGroup { public: gfxFontGroup(const nsAString& aFamilies, const gfxFontStyle *aStyle); @@ -198,7 +198,7 @@ protected: // these do not copy the text -class NS_EXPORT gfxTextRun { +class THEBES_API gfxTextRun { THEBES_DECL_REFCOUNTING_ABSTRACT public: diff --git a/mozilla/gfx/thebes/public/gfxGlitzSurface.h b/mozilla/gfx/thebes/public/gfxGlitzSurface.h index e30f47c6940..ff329c979f2 100644 --- a/mozilla/gfx/thebes/public/gfxGlitzSurface.h +++ b/mozilla/gfx/thebes/public/gfxGlitzSurface.h @@ -45,7 +45,7 @@ /** * A surface that wraps a glitz surface. */ -class NS_EXPORT gfxGlitzSurface : public gfxASurface { +class THEBES_API gfxGlitzSurface : public gfxASurface { THEBES_DECL_ISUPPORTS_INHERITED public: diff --git a/mozilla/gfx/thebes/public/gfxImageSurface.h b/mozilla/gfx/thebes/public/gfxImageSurface.h index 197a83b328a..a998729d571 100644 --- a/mozilla/gfx/thebes/public/gfxImageSurface.h +++ b/mozilla/gfx/thebes/public/gfxImageSurface.h @@ -48,7 +48,7 @@ * purpose is for storing read-only images and using it as a source surface, * but it can also be drawn to. */ -class NS_EXPORT gfxImageSurface : public gfxASurface { +class THEBES_API gfxImageSurface : public gfxASurface { THEBES_DECL_ISUPPORTS_INHERITED public: diff --git a/mozilla/gfx/thebes/public/gfxMatrix.h b/mozilla/gfx/thebes/public/gfxMatrix.h index f130a64e9b4..b39213bd298 100644 --- a/mozilla/gfx/thebes/public/gfxMatrix.h +++ b/mozilla/gfx/thebes/public/gfxMatrix.h @@ -64,7 +64,7 @@ * \ tx ty 1 / \ 1 / * */ -class NS_EXPORT gfxMatrix { +class THEBES_API gfxMatrix { protected: cairo_matrix_t mat; diff --git a/mozilla/gfx/thebes/public/gfxPDFSurface.h b/mozilla/gfx/thebes/public/gfxPDFSurface.h index 002a06f3f79..dbcc61e019a 100644 --- a/mozilla/gfx/thebes/public/gfxPDFSurface.h +++ b/mozilla/gfx/thebes/public/gfxPDFSurface.h @@ -40,7 +40,7 @@ #include "gfxASurface.h" -class NS_EXPORT gfxPDFSurface : public gfxASurface { +class THEBES_API gfxPDFSurface : public gfxASurface { THEBES_DECL_ISUPPORTS_INHERITED public: diff --git a/mozilla/gfx/thebes/public/gfxPSSurface.h b/mozilla/gfx/thebes/public/gfxPSSurface.h index 67cb65517c7..db32feb0269 100644 --- a/mozilla/gfx/thebes/public/gfxPSSurface.h +++ b/mozilla/gfx/thebes/public/gfxPSSurface.h @@ -40,7 +40,7 @@ #include "gfxASurface.h" -class NS_EXPORT gfxPSSurface : public gfxASurface { +class THEBES_API gfxPSSurface : public gfxASurface { THEBES_DECL_ISUPPORTS_INHERITED public: diff --git a/mozilla/gfx/thebes/public/gfxPangoFonts.h b/mozilla/gfx/thebes/public/gfxPangoFonts.h index b504d410e4d..f72a7b672b5 100644 --- a/mozilla/gfx/thebes/public/gfxPangoFonts.h +++ b/mozilla/gfx/thebes/public/gfxPangoFonts.h @@ -67,7 +67,7 @@ protected: void GetSize(const char *aString, PRUint32 aLength, gfxSize& inkSize, gfxSize& logSize); }; -class NS_EXPORT gfxPangoFontGroup : public gfxFontGroup { +class THEBES_API gfxPangoFontGroup : public gfxFontGroup { public: gfxPangoFontGroup (const nsAString& families, const gfxFontStyle *aStyle); @@ -89,7 +89,7 @@ protected: void *closure); }; -class NS_EXPORT gfxPangoTextRun : public gfxTextRun { +class THEBES_API gfxPangoTextRun : public gfxTextRun { THEBES_DECL_ISUPPORTS_INHERITED public: gfxPangoTextRun(const nsAString& aString, gfxPangoFontGroup *aFontGroup); diff --git a/mozilla/gfx/thebes/public/gfxPattern.h b/mozilla/gfx/thebes/public/gfxPattern.h index ae2aa65e04f..6919d05ee49 100644 --- a/mozilla/gfx/thebes/public/gfxPattern.h +++ b/mozilla/gfx/thebes/public/gfxPattern.h @@ -47,7 +47,7 @@ class gfxContext; -class NS_EXPORT gfxPattern { +class THEBES_API gfxPattern { friend class gfxContext; THEBES_DECL_REFCOUNTING diff --git a/mozilla/gfx/thebes/public/gfxPlatform.h b/mozilla/gfx/thebes/public/gfxPlatform.h index 1980b4fb758..9787fe50245 100644 --- a/mozilla/gfx/thebes/public/gfxPlatform.h +++ b/mozilla/gfx/thebes/public/gfxPlatform.h @@ -46,7 +46,7 @@ class gfxImageSurface; -class NS_EXPORT gfxPlatform { +class THEBES_API gfxPlatform { public: /** * Return a pointer to the current active platform. diff --git a/mozilla/gfx/thebes/public/gfxPlatformGtk.h b/mozilla/gfx/thebes/public/gfxPlatformGtk.h index 2c4c5e8e6fc..952c9044bb6 100644 --- a/mozilla/gfx/thebes/public/gfxPlatformGtk.h +++ b/mozilla/gfx/thebes/public/gfxPlatformGtk.h @@ -42,7 +42,7 @@ #include "gfxPlatform.h" -class NS_EXPORT gfxPlatformGtk : public gfxPlatform { +class THEBES_API gfxPlatformGtk : public gfxPlatform { public: gfxPlatformGtk(); diff --git a/mozilla/gfx/thebes/public/gfxPlatformMac.h b/mozilla/gfx/thebes/public/gfxPlatformMac.h index 8fa812b4752..ba01bfc9e15 100644 --- a/mozilla/gfx/thebes/public/gfxPlatformMac.h +++ b/mozilla/gfx/thebes/public/gfxPlatformMac.h @@ -40,7 +40,7 @@ #include "gfxPlatform.h" -class NS_EXPORT gfxPlatformMac : public gfxPlatform { +class THEBES_API gfxPlatformMac : public gfxPlatform { public: gfxPlatformMac(); diff --git a/mozilla/gfx/thebes/public/gfxPoint.h b/mozilla/gfx/thebes/public/gfxPoint.h index 867732c7cff..b66efad3319 100644 --- a/mozilla/gfx/thebes/public/gfxPoint.h +++ b/mozilla/gfx/thebes/public/gfxPoint.h @@ -42,7 +42,7 @@ #include "gfxTypes.h" -struct NS_EXPORT gfxSize { +struct THEBES_API gfxSize { gfxFloat width, height; gfxSize() {} @@ -71,7 +71,7 @@ struct NS_EXPORT gfxSize { } }; -struct NS_EXPORT gfxPoint { +struct THEBES_API gfxPoint { gfxFloat x, y; gfxPoint() { } diff --git a/mozilla/gfx/thebes/public/gfxQuartzSurface.h b/mozilla/gfx/thebes/public/gfxQuartzSurface.h index a1847d2f713..e3141baaf88 100644 --- a/mozilla/gfx/thebes/public/gfxQuartzSurface.h +++ b/mozilla/gfx/thebes/public/gfxQuartzSurface.h @@ -43,7 +43,7 @@ #include -class NS_EXPORT gfxQuartzSurface : public gfxASurface { +class THEBES_API gfxQuartzSurface : public gfxASurface { THEBES_DECL_ISUPPORTS_INHERITED public: diff --git a/mozilla/gfx/thebes/public/gfxRect.h b/mozilla/gfx/thebes/public/gfxRect.h index 8fff75d2fa3..ba22f363c50 100644 --- a/mozilla/gfx/thebes/public/gfxRect.h +++ b/mozilla/gfx/thebes/public/gfxRect.h @@ -41,7 +41,7 @@ #include "gfxTypes.h" #include "gfxPoint.h" -struct NS_EXPORT gfxRect { +struct THEBES_API gfxRect { // pt? point? gfxPoint pos; gfxSize size; diff --git a/mozilla/gfx/thebes/public/gfxRegion.h b/mozilla/gfx/thebes/public/gfxRegion.h index 6916d3ba394..cc73785cdcb 100644 --- a/mozilla/gfx/thebes/public/gfxRegion.h +++ b/mozilla/gfx/thebes/public/gfxRegion.h @@ -41,7 +41,7 @@ * ********************************************************* */ -class NS_EXPORT gfxRegion { +class THEBES_API gfxRegion { public: gfxRegion(const gfxRegion& r); gfxRegion(const gfxRect& r); diff --git a/mozilla/gfx/thebes/public/gfxTypes.h b/mozilla/gfx/thebes/public/gfxTypes.h index 6c9403d9ca4..601d74f5a19 100644 --- a/mozilla/gfx/thebes/public/gfxTypes.h +++ b/mozilla/gfx/thebes/public/gfxTypes.h @@ -39,13 +39,20 @@ #define GFX_TYPES_H #include "prtypes.h" + /** * Currently needs to be 'double' for Cairo compatibility. Could * become 'float', perhaps, in some configurations. */ typedef double gfxFloat; - +#if defined(MOZ_ENABLE_LIBXUL) +#define THEBES_API +#elif defined(IMPL_THEBES) +#define THEBES_API NS_EXPORT +#else +#define THEBES_API NS_IMPORT +#endif /** * Define refcounting for Thebes. For now use the stuff from nsISupportsImpl diff --git a/mozilla/gfx/thebes/public/gfxWindowsFonts.h b/mozilla/gfx/thebes/public/gfxWindowsFonts.h index 806f319ed61..4fe5bc55d90 100644 --- a/mozilla/gfx/thebes/public/gfxWindowsFonts.h +++ b/mozilla/gfx/thebes/public/gfxWindowsFonts.h @@ -101,7 +101,7 @@ private: * **********************************************************************/ -class NS_EXPORT gfxWindowsFontGroup : public gfxFontGroup { +class THEBES_API gfxWindowsFontGroup : public gfxFontGroup { public: gfxWindowsFontGroup(const nsAString& aFamilies, const gfxFontStyle* aStyle); @@ -128,7 +128,7 @@ private: * **********************************************************************/ -class NS_EXPORT gfxWindowsTextRun : public gfxTextRun { +class THEBES_API gfxWindowsTextRun : public gfxTextRun { THEBES_DECL_ISUPPORTS_INHERITED public: diff --git a/mozilla/gfx/thebes/public/gfxWindowsPlatform.h b/mozilla/gfx/thebes/public/gfxWindowsPlatform.h index 7816642ea33..95708de53f0 100644 --- a/mozilla/gfx/thebes/public/gfxWindowsPlatform.h +++ b/mozilla/gfx/thebes/public/gfxWindowsPlatform.h @@ -46,7 +46,7 @@ #include #include -class NS_EXPORT gfxWindowsPlatform : public gfxPlatform { +class THEBES_API gfxWindowsPlatform : public gfxPlatform { public: gfxWindowsPlatform(); virtual ~gfxWindowsPlatform(); diff --git a/mozilla/gfx/thebes/public/gfxWindowsSurface.h b/mozilla/gfx/thebes/public/gfxWindowsSurface.h index 3ec3b316254..aed12166bad 100644 --- a/mozilla/gfx/thebes/public/gfxWindowsSurface.h +++ b/mozilla/gfx/thebes/public/gfxWindowsSurface.h @@ -42,7 +42,7 @@ #include -class NS_EXPORT gfxWindowsSurface : public gfxASurface { +class THEBES_API gfxWindowsSurface : public gfxASurface { THEBES_DECL_ISUPPORTS_INHERITED public: diff --git a/mozilla/gfx/thebes/public/gfxXlibNativeRenderer.h b/mozilla/gfx/thebes/public/gfxXlibNativeRenderer.h index ec80f3c847b..95db15b9c3f 100644 --- a/mozilla/gfx/thebes/public/gfxXlibNativeRenderer.h +++ b/mozilla/gfx/thebes/public/gfxXlibNativeRenderer.h @@ -50,7 +50,7 @@ class gfxContext; * override NativeDraw, and then call Draw(). The drawing will be subjected * to all Thebes transformations, clipping etc. */ -class NS_EXPORT gfxXlibNativeRenderer { +class THEBES_API gfxXlibNativeRenderer { public: /** * Perform the native drawing. diff --git a/mozilla/gfx/thebes/public/gfxXlibSurface.h b/mozilla/gfx/thebes/public/gfxXlibSurface.h index b09a048d100..2fa8456466a 100644 --- a/mozilla/gfx/thebes/public/gfxXlibSurface.h +++ b/mozilla/gfx/thebes/public/gfxXlibSurface.h @@ -44,7 +44,7 @@ #include #include -class NS_EXPORT gfxXlibSurface : public gfxASurface { +class THEBES_API gfxXlibSurface : public gfxASurface { THEBES_DECL_ISUPPORTS_INHERITED public: diff --git a/mozilla/gfx/thebes/src/Makefile.in b/mozilla/gfx/thebes/src/Makefile.in index 3c6251f62bc..b4d922de75f 100644 --- a/mozilla/gfx/thebes/src/Makefile.in +++ b/mozilla/gfx/thebes/src/Makefile.in @@ -29,6 +29,8 @@ CPPSRCS = \ gfxPlatform.cpp \ $(NULL) +DEFINES += -DIMPL_THEBES + ifdef MOZ_TREE_CAIRO SHARED_LIBRARY_LIBS += \ $(DEPTH)/gfx/cairo/cairo/src/$(LIB_PREFIX)mozcairo.$(LIB_SUFFIX) \ diff --git a/mozilla/jpeg/jmorecfg.h b/mozilla/jpeg/jmorecfg.h index 38ae1b441ac..fd329af9e45 100644 --- a/mozilla/jpeg/jmorecfg.h +++ b/mozilla/jpeg/jmorecfg.h @@ -208,11 +208,17 @@ typedef unsigned int JDIMENSION; #define METHODDEF(type) static type PR_CALLBACK /* a function used only in its module: */ #define LOCAL(type) static type + +PR_BEGIN_EXTERN_C +#ifdef MOZ_ENABLE_LIBXUL +#define GLOBAL(type) type +#define EXTERN(type) extern type +#else /* a function referenced thru EXTERNs: */ #define GLOBAL(type) PR_IMPLEMENT(type) /* a reference to a GLOBAL function: */ -PR_BEGIN_EXTERN_C #define EXTERN(type) PR_EXTERN(type) +#endif PR_END_EXTERN_C diff --git a/mozilla/modules/libpr0n/decoders/icon/Makefile.in b/mozilla/modules/libpr0n/decoders/icon/Makefile.in index 99be40b58e2..8048959019b 100644 --- a/mozilla/modules/libpr0n/decoders/icon/Makefile.in +++ b/mozilla/modules/libpr0n/decoders/icon/Makefile.in @@ -44,11 +44,8 @@ include $(DEPTH)/config/autoconf.mk MODULE = imgicon LIBRARY_NAME = imgicon -EXPORT_LIBRARY = 1 IS_COMPONENT = 1 MODULE_NAME = nsIconDecoderModule -GRE_MODULE = 1 -MOZILLA_INTERNAL_API = 1 PACKAGE_FILE = imgicon.pkg @@ -56,9 +53,9 @@ ifdef MOZ_ENABLE_GNOMEUI EXTRA_DSO_LDOPTS = $(MOZ_GNOMEUI_LIBS) PLATFORM = gtk FORCE_SHARED_LIB = 1 -EXPORT_LIBRARY = else LIBXUL_LIBRARY = 1 +EXPORT_LIBRARY = 1 endif ifeq ($(OS_ARCH),WINNT) @@ -107,10 +104,17 @@ XPIDLSRCS = nsIIconURI.idl SHARED_LIBRARY_LIBS = $(PLATFORM)/$(LIB_PREFIX)imgicon$(PLATFORM)_s.$(LIB_SUFFIX) +ifdef LIBXUL_LIBRARY EXTRA_DSO_LDOPTS += \ $(EXTRA_DSO_LIBS) \ $(MOZ_COMPONENT_LIBS) \ $(NULL) +else +EXTRA_DSO_LDOPTS += \ + $(XPCOM_GLUE_LDOPTS) \ + $(NSPR_LIBS) \ + $(NULL) +endif LOCAL_INCLUDES = -I$(srcdir)/$(PLATFORM) diff --git a/mozilla/modules/libpr0n/decoders/icon/gtk/Makefile.in b/mozilla/modules/libpr0n/decoders/icon/gtk/Makefile.in index 596f303bb89..853eab0ff50 100644 --- a/mozilla/modules/libpr0n/decoders/icon/gtk/Makefile.in +++ b/mozilla/modules/libpr0n/decoders/icon/gtk/Makefile.in @@ -44,7 +44,6 @@ include $(DEPTH)/config/autoconf.mk MODULE = imgicon LIBRARY_NAME = imgicongtk_s -LIBXUL_LIBRARY = 1 REQUIRES = xpcom \ string \ diff --git a/mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp b/mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp index 1e5eb027b96..0285114287c 100644 --- a/mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp +++ b/mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp @@ -60,10 +60,8 @@ extern "C" { #include "nsIStringBundle.h" -#include "nsEscape.h" #include "nsNetUtil.h" #include "nsIURL.h" -#include "nsStringStream.h" #include "nsIconChannel.h" @@ -116,9 +114,11 @@ moz_gdk_pixbuf_to_channel(GdkPixbuf* aPixbuf, nsIURI *aURI, "size miscalculation"); nsresult rv; - nsCOMPtr stream; - rv = NS_NewByteInputStream(getter_AddRefs(stream), (char*)buf, buf_size, - NS_ASSIGNMENT_ADOPT); + nsCOMPtr stream = + do_CreateInstance("@mozilla.org/io/string-input-stream;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stream->AdoptData((char*)buf, buf_size); NS_ENSURE_SUCCESS(rv, rv); rv = NS_NewInputStreamChannel(aChannel, aURI, stream, @@ -199,14 +199,14 @@ nsIconChannel::InitWithGnome(nsIMozIconURI *aIconURI) nsCOMPtr bundle; bundleService->CreateBundle("chrome://branding/locale/brand.properties", getter_AddRefs(bundle)); - nsXPIDLString appName; + nsAutoString appName; if (bundle) { bundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(), getter_Copies(appName)); } else { NS_WARNING("brand.properties not present, using default application name"); - appName.AssignLiteral("Gecko"); + appName.Assign(NS_LITERAL_STRING("Gecko")); } char* empty[] = { "" }; diff --git a/mozilla/modules/libpr0n/decoders/icon/nsIconDecoder.cpp b/mozilla/modules/libpr0n/decoders/icon/nsIconDecoder.cpp index 13c288ec88e..7818e83cf4d 100644 --- a/mozilla/modules/libpr0n/decoders/icon/nsIconDecoder.cpp +++ b/mozilla/modules/libpr0n/decoders/icon/nsIconDecoder.cpp @@ -45,6 +45,7 @@ #include "nspr.h" #include "nsIComponentManager.h" #include "nsRect.h" +#include "nsComponentManagerUtils.h" NS_IMPL_THREADSAFE_ADDREF(nsIconDecoder) NS_IMPL_THREADSAFE_RELEASE(nsIconDecoder) diff --git a/mozilla/modules/libpr0n/decoders/icon/nsIconURI.cpp b/mozilla/modules/libpr0n/decoders/icon/nsIconURI.cpp index 80cc8add65b..63e25cac4a9 100644 --- a/mozilla/modules/libpr0n/decoders/icon/nsIconURI.cpp +++ b/mozilla/modules/libpr0n/decoders/icon/nsIconURI.cpp @@ -41,42 +41,53 @@ #include "nsNetUtil.h" #include "nsIIOService.h" #include "nsIURL.h" -#include "nsCRT.h" -#include "nsReadableUtils.h" -#include "nsPrintfCString.h" #include "nsIAtom.h" -#include "nsStaticAtom.h" +#include "nsIAtomService.h" +#include "prprf.h" +#include "plstr.h" +#include static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); #define DEFAULT_IMAGE_SIZE 16 // helper function for parsing out attributes like size, and contentType // from the icon url. -static void extractAttributeValue(const char * searchString, const char * attributeName, char ** result); +static void extractAttributeValue(const char * searchString, const char * attributeName, nsCString& aResult); -static nsIAtom *sStockSizeButton = nsnull; -static nsIAtom *sStockSizeToolbar = nsnull; -static nsIAtom *sStockSizeToolbarsmall = nsnull; -static nsIAtom *sStockSizeMenu = nsnull; -static nsIAtom *sStockSizeDialog = nsnull; -static nsIAtom *sStockStateNormal = nsnull; -static nsIAtom *sStockStateDisabled = nsnull; - -/* static */ const nsStaticAtom nsMozIconURI::sSizeAtoms[] = -{ - { "button", &sStockSizeButton }, - { "toolbar", &sStockSizeToolbar }, - { "toolbarsmall", &sStockSizeToolbarsmall }, - { "menu", &sStockSizeMenu }, - { "dialog", &sStockSizeDialog } +struct AtomStruct { + const char *string; + nsIAtom *atom; }; -/* static */ const nsStaticAtom nsMozIconURI::sStateAtoms[] = +static AtomStruct gSizeAtoms[] = { - { "normal", &sStockStateNormal }, - { "disabled", &sStockStateDisabled } + { "button", nsnull }, + { "toolbar", nsnull }, + { "toolbarsmall", nsnull }, + { "menu", nsnull }, + { "dialog", nsnull } }; +static AtomStruct gStateAtoms[] = +{ + { "normal", nsnull }, + { "disabled", nsnull } +}; + +static void +FillAtoms(AtomStruct* atoms, PRUint32 length) +{ + nsCOMPtr as(do_GetService(NS_ATOMSERVICE_CONTRACTID)); + if (!as) + return; + + while (length) { + --length; + as->GetPermanentAtomUTF8(atoms[length].string, + &atoms[length].atom); + } +} + //////////////////////////////////////////////////////////////////////////////// nsMozIconURI::nsMozIconURI() @@ -92,8 +103,8 @@ nsMozIconURI::~nsMozIconURI() /* static */ void nsMozIconURI::InitAtoms() { - NS_RegisterStaticAtoms(sSizeAtoms, NS_ARRAY_LENGTH(sSizeAtoms)); - NS_RegisterStaticAtoms(sStateAtoms, NS_ARRAY_LENGTH(sStateAtoms)); + FillAtoms(gSizeAtoms, NS_ARRAY_LENGTH(gSizeAtoms)); + FillAtoms(gStateAtoms, NS_ARRAY_LENGTH(gStateAtoms)); } NS_IMPL_THREADSAFE_ISUPPORTS2(nsMozIconURI, nsIMozIconURI, nsIURI) @@ -138,7 +149,10 @@ nsMozIconURI::FormatSpec(nsACString &spec) { spec += NS_MOZ_ICON_DELIMITER; spec += "size="; - spec.Append(nsPrintfCString("%d", mSize)); + + char buf[20]; + PR_snprintf(buf, sizeof(buf), "%d", mSize); + spec.Append(buf); } if (mIconState) { @@ -170,30 +184,30 @@ nsMozIconURI::GetSpec(nsACString &aSpec) // containing just the attribute value. i.e you could pass in this string with // an attribute name of 'size=', this will return 32 // Assumption: attribute pairs in the string are separated by '&'. -void extractAttributeValue(const char * searchString, const char * attributeName, char ** result) +void extractAttributeValue(const char * searchString, const char * attributeName, nsCString& result) { //NS_ENSURE_ARG_POINTER(extractAttributeValue); - char * attributeValue = nsnull; - if (searchString && attributeName) - { - // search the string for attributeName - PRUint32 attributeNameSize = strlen(attributeName); - const char * startOfAttribute = PL_strcasestr(searchString, attributeName); - if (startOfAttribute) - { - startOfAttribute += attributeNameSize; // skip over the attributeName - if (*startOfAttribute) // is there something after the attribute name - { - const char * endofAttribute = strchr(startOfAttribute, '&'); - attributeValue = endofAttribute // is there text after attribute value ? - ? PL_strndup(startOfAttribute, endofAttribute - startOfAttribute) - : PL_strdup(startOfAttribute); - } // if we have a attribute value - } // if we have a attribute name - } // if we got non-null search string and attribute name values + result.Truncate(); - *result = attributeValue; // passing ownership of attributeValue into result...no need to + if (searchString && attributeName) + { + // search the string for attributeName + PRUint32 attributeNameSize = strlen(attributeName); + const char * startOfAttribute = PL_strcasestr(searchString, attributeName); + if (startOfAttribute) + { + startOfAttribute += attributeNameSize; // skip over the attributeName + if (*startOfAttribute) // is there something after the attribute name + { + const char * endofAttribute = strchr(startOfAttribute, '&'); + if (endofAttribute) + result.Assign(Substring(startOfAttribute, endofAttribute)); + else + result.Assign(startOfAttribute); + } // if we have a attribute value + } // if we have a attribute name + } // if we got non-null search string and attribute name values } NS_IMETHODIMP @@ -210,33 +224,37 @@ nsMozIconURI::SetSpec(const nsACString &aSpec) if (strcmp("moz-icon", scheme.get()) != 0) return NS_ERROR_MALFORMED_URI; - nsXPIDLCString sizeString; - nsXPIDLCString stateString; + nsCAutoString sizeString; + nsCAutoString stateString; nsCAutoString mozIconPath(aSpec); - PRInt32 endPos = mozIconPath.FindChar(':') + 1; // guaranteed to exist! - PRInt32 pos = mozIconPath.FindChar(NS_MOZ_ICON_DELIMITER); - if (pos == -1) // no size or content type specified + // guaranteed to exist! + const char *path = strchr(mozIconPath.get(), ':') + 1; + const char *question = strchr(mozIconPath.get(), NS_MOZ_ICON_DELIMITER); + + if (!question) // no size or content type specified { - mozIconPath.Right(mDummyFilePath, mozIconPath.Length() - endPos); + mDummyFilePath.Assign(path); } else { - mozIconPath.Mid(mDummyFilePath, endPos, pos - endPos); + mDummyFilePath.Assign(Substring(path, question)); + // fill in any size and content type values... - nsXPIDLCString contentTypeString; - extractAttributeValue(mozIconPath.get() + pos, "size=", getter_Copies(sizeString)); - extractAttributeValue(mozIconPath.get() + pos, "state=", getter_Copies(stateString)); - extractAttributeValue(mozIconPath.get() + pos, "contentType=", getter_Copies(contentTypeString)); - mContentType = contentTypeString; + extractAttributeValue(question, "size=", sizeString); + extractAttributeValue(question, "state=", stateString); + extractAttributeValue(question, "contentType=", mContentType); } if (!sizeString.IsEmpty()) { - nsCOMPtr atom = do_GetAtom(sizeString); - for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sSizeAtoms); i++) + nsCOMPtr atoms(do_GetService(NS_ATOMSERVICE_CONTRACTID)); + nsCOMPtr atom; + atoms->GetAtomUTF8(sizeString.get(), + getter_AddRefs(atom)); + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(gSizeAtoms); i++) { - if (atom == *(sSizeAtoms[i].mAtom)) + if (atom == gSizeAtoms[i].atom) { mIconSize = atom; break; @@ -246,10 +264,13 @@ nsMozIconURI::SetSpec(const nsACString &aSpec) if (!stateString.IsEmpty()) { - nsCOMPtr atom = do_GetAtom(stateString); - for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sStateAtoms); i++) + nsCOMPtr atoms(do_GetService(NS_ATOMSERVICE_CONTRACTID)); + nsCOMPtr atom; + atoms->GetAtomUTF8(sizeString.get(), + getter_AddRefs(atom)); + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(gStateAtoms); i++) { - if (atom == *(sStateAtoms[i].mAtom)) + if (atom == gStateAtoms[i].atom) { mIconState = atom; break; @@ -284,7 +305,7 @@ nsMozIconURI::SetSpec(const nsACString &aSpec) } if (!sizeString.IsEmpty()) { - PRInt32 sizeValue = atoi(sizeString); + PRInt32 sizeValue = atoi(sizeString.get()); // if the size value we got back is > 0 then use it if (sizeValue) mSize = sizeValue; @@ -413,7 +434,7 @@ nsMozIconURI::Equals(nsIURI *other, PRBool *result) other->GetSpec(spec2); GetSpec(spec1); - if (!nsCRT::strcasecmp(spec1.get(), spec2.get())) + if (!PL_strcasecmp(spec1.get(), spec2.get())) *result = PR_TRUE; else *result = PR_FALSE; @@ -546,7 +567,8 @@ nsMozIconURI::GetFileExtension(nsACString &aFileExtension) { // unfortunately, this code doesn't give us the required '.' in front of the extension // so we have to do it ourselves.. - aFileExtension = NS_LITERAL_CSTRING(".") + fileExt; + aFileExtension.Assign('.'); + aFileExtension.Append(fileExt); return NS_OK; } } @@ -564,7 +586,7 @@ nsMozIconURI::GetFileExtension(nsACString &aFileExtension) const char * fileExt = strrchr(chFileName, '.'); if (!fileExt) return NS_ERROR_FAILURE; // no file extension to work from. - aFileExtension = nsDependentCString(fileExt); + aFileExtension.Assign(fileExt); return NS_OK; } diff --git a/mozilla/modules/libpr0n/decoders/icon/nsIconURI.h b/mozilla/modules/libpr0n/decoders/icon/nsIconURI.h index b36108af259..04ae300bde1 100644 --- a/mozilla/modules/libpr0n/decoders/icon/nsIconURI.h +++ b/mozilla/modules/libpr0n/decoders/icon/nsIconURI.h @@ -42,7 +42,7 @@ #include "nsIIconURI.h" #include "nsCOMPtr.h" -#include "nsString.h" +#include "nsStringGlue.h" struct nsStaticAtom; class nsIAtom; @@ -77,9 +77,6 @@ protected: nsCOMPtr mIconSize; nsCOMPtr mIconState; - static const nsStaticAtom sSizeAtoms[]; - static const nsStaticAtom sStateAtoms[]; - nsresult FormatSpec(nsACString &result); }; diff --git a/mozilla/modules/zlib/src/mozzconf.h b/mozilla/modules/zlib/src/mozzconf.h index 118185c40bd..830b1046cd7 100644 --- a/mozilla/modules/zlib/src/mozzconf.h +++ b/mozilla/modules/zlib/src/mozzconf.h @@ -37,11 +37,9 @@ #ifndef MOZZCONF_H #define MOZZCONF_H -#if defined(XP_WIN) && defined(ZLIB_DLL) && !defined(MOZ_ENABLE_LIBXUL) +#ifdef MOZ_ENABLE_LIBXUL #undef ZLIB_DLL -#endif - -#ifdef HAVE_VISIBILITY_ATTRIBUTE +#elif defined(HAVE_VISIBILITY_ATTRIBUTE) #define ZEXTERN __attribute__((visibility ("default"))) extern #endif