diff --git a/allmakefiles.sh b/allmakefiles.sh index 4a21ece5e66f..fd344ff58fcf 100755 --- a/allmakefiles.sh +++ b/allmakefiles.sh @@ -128,6 +128,7 @@ gfx/src/ps/Makefile gfx/src/motif/Makefile gfx/src/photon/Makefile gfx/src/rhapsody/Makefile +gfx/src/mac/Makefile gfx/src/qt/Makefile gfx/src/xlib/Makefile gfx/src/xlibrgb/Makefile @@ -464,6 +465,7 @@ widget/src/motif/Makefile widget/src/motif/app_context/Makefile widget/src/photon/Makefile widget/src/rhapsody/Makefile +widget/src/mac/Makefile widget/src/unix_services/Makefile widget/src/unix_services/toolkit_service/Makefile widget/src/xlib/Makefile diff --git a/config/Makefile.in b/config/Makefile.in index 7b27cff8a0fd..cd9fac6e8dad 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -66,6 +66,10 @@ ifeq ($(OS_CONFIG),SunOS4.1) NSPR_CFLAGS += -I$(srcdir)/../nsprpub/pr/include/md endif +ifeq ($(OS_CONFIG),Rhapsody10.0) +NSPR_CFLAGS += -DGETCWD_CANT_MALLOC +endif + export:: $(TARGETS) #update build number from within make script diff --git a/config/config.mk b/config/config.mk index 010ff1c6ba69..f7c153ce24ee 100644 --- a/config/config.mk +++ b/config/config.mk @@ -119,6 +119,11 @@ ifeq ($(OS_ARCH),UnixWare) OS_ARCH := UNIXWARE OS_RELEASE := $(shell uname -v) endif +ifeq ($(OS_ARCH),Mac OS) +ifeq ($(OS_RELEASE),10.0) +OS_ARCH := Rhapsody +endif +endif # # Strip off the excessively long version numbers on these platforms, diff --git a/config/rules.mk b/config/rules.mk index c8e821c56166..e3e24a1a008b 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -318,6 +318,18 @@ EXTRA_DSO_LDOPTS += -L$(DIST)/bin $(BEOS_LINK_LIBS) $(NSPR_LIBS) endif endif +# +# MacOS X specific stuff +# + +ifeq ($(OS_ARCH),Rhapsody) +ifdef IS_COMPONENT +EXTRA_DSO_LDOPTS += -bundle +else +EXTRA_DSO_LDOPTS += -dynamiclib +endif +endif + # # HP-UXBeOS specific section: for COMPONENTS only, add -Bsymbolic flag # which uses internal symbols first @@ -570,7 +582,7 @@ ifneq ($(OS_ARCH),OS2) # that are built using other static libraries. Confused...? # ifdef SHARED_LIBRARY_LIBS -ifneq (,$(filter OSF1 BSD_OS FreeBSD NetBSD OpenBSD SunOS,$(OS_ARCH))) +ifneq (,$(filter OSF1 BSD_OS FreeBSD NetBSD OpenBSD SunOS Rhapsody,$(OS_ARCH))) CLEANUP1 := | egrep -v '(________64ELEL_|__.SYMDEF)' CLEANUP2 := rm -f ________64ELEL_ __.SYMDEF else diff --git a/configure.in b/configure.in index f91b9d2913c5..b10e349e08b7 100644 --- a/configure.in +++ b/configure.in @@ -767,6 +767,20 @@ alpha*-*-osf*) *-rhapsody*) DLL_SUFFIX="dylib" + DSO_LDOPTS='-compatibility_version 1 -current_version 1' + AC_DEFINE(NO_X11) + AC_DEFINE(RHAPSODY) + AC_DEFINE(TARGET_CARBON) + AC_DEFINE(TARGET_API_MAC_CARBON) + ENABLE_TESTS= + MOZ_WIDGET_TOOLKIT='mac' + TK_LIBS='/System/Library/Frameworks/Carbon.framework/Carbon' + CFLAGS="$CFLAGS -traditional-cpp -fno-common -I/System/Library/Frameworks/Carbon.framework/Headers" + CXXFLAGS="$CXXFLAGS -traditional-cpp -fno-common -I/System/Library/Frameworks/Carbon.framework/Headers" + MKSHLIB='$(CXX) -arch ppc $(DSO_LDOPTS)' + MKCSHLIB='$(CC) $(DSO_LDOPTS)' + MKSHLIB_FORCE_ALL='' + MKSHLIB_UNFORCE_ALL='' ;; *-sco*) @@ -2878,6 +2892,13 @@ case "$target" in ;; esac +# so does MacOS +case "$target" in + *-rhapsody*) + MOZ_TIMER_LIBS='$(DIST)/lib/libtimer_mac.dylib' + ;; +esac + dnl ======================================================== dnl = dnl = End MOZ_TIMER_LIBS @@ -3279,6 +3300,11 @@ elif test "$OS_TARGET" = "WINNT"; then AC_DEFINE(XP_PC) elif test "$OS_TARGET" = "BeOS"; then AC_DEFINE(XP_BEOS) +elif test "$OS_TARGET" = "Mac OS"; then + AC_DEFINE(XP_UNIX) + AC_DEFINE(UNIX_EMBED) + AC_DEFINE(UNIX_LDAP) + AC_DEFINE(UNIX_ASYNC_DNS) else AC_DEFINE(XP_UNIX) AC_DEFINE(UNIX_ASYNC_DNS) diff --git a/docshell/build/Makefile.in b/docshell/build/Makefile.in index 0e732f894c3a..99804f940233 100644 --- a/docshell/build/Makefile.in +++ b/docshell/build/Makefile.in @@ -42,8 +42,10 @@ EXTRA_DSO_LDOPTS= \ $(SHARED_LIBRARY_LIBS) \ $(MKSHLIB_UNFORCE_ALL) \ -L$(DIST)/bin \ + -lmozjs \ -ljsdom \ $(MOZ_COMPONENT_LIBS) \ + $(MOZ_TIMER_LIBS) \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/gfx/Makefile.in b/gfx/Makefile.in index a4848397248d..81a4437c89b3 100644 --- a/gfx/Makefile.in +++ b/gfx/Makefile.in @@ -26,7 +26,7 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -DIRS = public src idl +DIRS = public idl src ifdef ENABLE_TESTS DIRS += tests diff --git a/gfx/idl/Makefile.in b/gfx/idl/Makefile.in index 364a93ba4d11..42d9c73c601c 100644 --- a/gfx/idl/Makefile.in +++ b/gfx/idl/Makefile.in @@ -32,6 +32,7 @@ XPIDL_MODULE = gfx XPIDLSRCS = \ nsIFontEnumerator.idl \ nsIScriptableRegion.idl \ + nsIGraphics.idl \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/gfx/public/Makefile.in b/gfx/public/Makefile.in index b37566ed010d..cd717df25af2 100644 --- a/gfx/public/Makefile.in +++ b/gfx/public/Makefile.in @@ -35,6 +35,7 @@ EXPORTS = \ nsCoord.h \ nsFont.h \ nsRect.h \ + nsRepeater.h \ nsPoint.h \ nsSize.h \ nsMargin.h \ diff --git a/gfx/src/Makefile.in b/gfx/src/Makefile.in index dbbd81d7f5a4..920bb862c3c3 100644 --- a/gfx/src/Makefile.in +++ b/gfx/src/Makefile.in @@ -74,6 +74,7 @@ CPPSRCS = \ nsRect.cpp \ nsTransform2D.cpp \ nsScriptableRegion.cpp \ + nsGraphicsImpl.cpp \ $(NULL) EXTRA_DSO_LDOPTS = \ diff --git a/gfx/src/mac/Makefile.in b/gfx/src/mac/Makefile.in new file mode 100644 index 000000000000..8f34c8707c69 --- /dev/null +++ b/gfx/src/mac/Makefile.in @@ -0,0 +1,64 @@ +# +# The contents of this file are subject to the Netscape Public License +# Version 1.1 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. +# + +DEPTH = ../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + + +LIBRARY_NAME = gfx_mac +MODULE = raptor +IS_COMPONENT = 1 + +REQUIRES = util img xpcom raptor netlib + +CPPSRCS = \ + nsATSUIUtils.cpp \ + nsDeviceContextMac.cpp \ + nsDeviceContextSpecFactoryM.cpp \ + nsDeviceContextSpecMac.cpp \ + nsDrawingSurfaceMac.cpp \ + nsFontMetricsMac.cpp \ + nsGfxFactoryMac.cpp \ + nsGraphicState.cpp \ + nsImageMac.cpp \ + nsRegionMac.cpp \ + nsRenderingContextMac.cpp \ + nsUnicodeFontMappingMac.cpp \ + nsUnicodeMappingUtil.cpp \ + nsUnicodeRenderingToolkit.cpp \ + $(NULL) + +EXTRA_DSO_LDOPTS = \ + $(MKSHLIB_FORCE_ALL) \ + $(MOZ_TIMER_LIBS) \ + $(DIST)/lib/libimg_s.a \ + $(DIST)/lib/libmozutil_s.a \ + -lraptorgfx \ + $(MKSHLIB_UNFORCE_ALL) \ + $(TK_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ + $(NULL) + +include $(topsrcdir)/config/rules.mk + +CXXFLAGS += $(TK_CFLAGS) +CFLAGS += $(TK_CFLAGS) +INCLUDES += $(TK_CFLAGS) -I$(srcdir)/.. \ No newline at end of file diff --git a/gfx/src/mac/nsATSUIUtils.cpp b/gfx/src/mac/nsATSUIUtils.cpp index cf331ff7bf90..40fe6af22d63 100644 --- a/gfx/src/mac/nsATSUIUtils.cpp +++ b/gfx/src/mac/nsATSUIUtils.cpp @@ -247,14 +247,17 @@ ATSUTextLayout nsATSUIToolkit::GetTextLayout(short aFontNum, short aSize, PRBool err = ::ATSUCreateTextLayoutWithTextPtr (dmy, 0,0,0,0,NULL, NULL, &txLayout); if(noErr != err) { NS_WARNING("ATSUCreateTextLayoutWithTextPtr failed"); - goto errorDone; + // goto errorDone; + return nsnull; } ATSUStyle theStyle; err = ::ATSUCreateStyle(&theStyle); if(noErr != err) { NS_WARNING("ATSUCreateStyle failed"); - goto errorDoneDestroyTextLayout; + // goto errorDoneDestroyTextLayout; + err = ::ATSUDisposeTextLayout(txLayout); + return nsnull; } ATSUAttributeTag theTag[3]; @@ -267,7 +270,10 @@ ATSUTextLayout nsATSUIToolkit::GetTextLayout(short aFontNum, short aSize, PRBool err = ::ATSUFONDtoFontID(aFontNum, (StyleField)((aBold ? bold : normal) | (aItalic ? italic : normal)), &atsuFontID); if(noErr != err) { NS_WARNING("ATSUFONDtoFontID failed"); - goto errorDoneDestroyStyle; + // goto errorDoneDestroyStyle; + err = ::ATSUDisposeStyle(theStyle); + err = ::ATSUDisposeTextLayout(txLayout); + return nsnull; } theTag[0] = kATSUFontTag; @@ -280,7 +286,8 @@ ATSUTextLayout nsATSUIToolkit::GetTextLayout(short aFontNum, short aSize, PRBool short fontsize = aSize; mContext->GetDevUnitsToAppUnits(dev2app); - Fixed size = FloatToFixed( roundf(float(fontsize) / dev2app)); + // Fixed size = FloatToFixed( roundf(float(fontsize) / dev2app)); + Fixed size = FloatToFixed( (float) rint(float(fontsize) / dev2app)); if( FixRound ( size ) < 9 && !nsDeviceContextMac::DisplayVerySmallFonts()) size = X2Fix(9); @@ -305,33 +312,33 @@ ATSUTextLayout nsATSUIToolkit::GetTextLayout(short aFontNum, short aSize, PRBool err = ::ATSUSetAttributes(theStyle, 3, theTag, theValueSize, theValue); if(noErr != err) { NS_WARNING("ATSUSetAttributes failed"); - goto errorDoneDestroyStyle; + // goto errorDoneDestroyStyle; + err = ::ATSUDisposeStyle(theStyle); + err = ::ATSUDisposeTextLayout(txLayout); + return nsnull; } err = ::ATSUSetRunStyle(txLayout, theStyle, kATSUFromTextBeginning, kATSUToTextEnd); if(noErr != err) { NS_WARNING("ATSUSetRunStyle failed"); - goto errorDoneDestroyStyle; + // goto errorDoneDestroyStyle; + err = ::ATSUDisposeStyle(theStyle); + err = ::ATSUDisposeTextLayout(txLayout); + return nsnull; } err = ::ATSUSetTransientFontMatching(txLayout, true); if(noErr != err) { NS_WARNING( "ATSUSetTransientFontMatching failed"); - goto errorDoneDestroyStyle; + // goto errorDoneDestroyStyle; + err = ::ATSUDisposeStyle(theStyle); + err = ::ATSUDisposeTextLayout(txLayout); + return nsnull; } nsATSUIUtils::gTxLayoutCache->Set(aFontNum, aSize, aBold, aItalic, aColor, txLayout); -okDone: return txLayout; - - -errorDoneDestroyStyle: - err = ::ATSUDisposeStyle(theStyle); -errorDoneDestroyTextLayout: - err = ::ATSUDisposeTextLayout(txLayout); -errorDone: - return nsnull; } //------------------------------------------------------------------------ // PrepareToDraw @@ -397,20 +404,25 @@ NS_IMETHODIMP nsATSUIToolkit::GetWidth( StartDraw(aCharPt, aSize, aFontNum, aBold, aItalic, aColor , savePort, aTxtLayout); if (nsnull == aTxtLayout) - goto done; - + { + // goto done; + return res; + } + OSStatus err = noErr; ATSUTextMeasurement iAfter; err = ATSUMeasureText( aTxtLayout, 0, 1, NULL, &iAfter, NULL, NULL ); if(noErr != err) { - NS_WARNING("ATSUMeasureText failed"); - goto done1; + NS_WARNING("ATSUMeasureText failed"); + // goto done1; + EndDraw(savePort); + return res; } oWidth = FixRound(iAfter); res = NS_OK; -done1: + /* done1: */ EndDraw(savePort); -done: + /* done: */ return res; } @@ -436,25 +448,28 @@ NS_IMETHODIMP nsATSUIToolkit::DrawString( StartDraw(aCharPt, aSize, aFontNum, aBold, aItalic, aColor , savePort, aTxtLayout); if (nsnull == aTxtLayout) - goto done; - + { + return res; + } + OSStatus err = noErr; ATSUTextMeasurement iAfter; err = ATSUMeasureText( aTxtLayout, 0, 1, NULL, &iAfter, NULL, NULL ); if(noErr != err) { NS_WARNING("ATSUMeasureText failed"); - goto done1; + EndDraw(savePort); + return res; } + err = ATSUDrawText( aTxtLayout, 0, 1, Long2Fix(x), Long2Fix(y)); if(noErr != err) { NS_WARNING("ATSUDrawText failed"); - goto done1; + EndDraw(savePort); + return res; } oWidth = FixRound(iAfter); res = NS_OK; -done1: EndDraw(savePort); -done: return res; } diff --git a/gfx/src/mac/nsCarbonHelpers.h b/gfx/src/mac/nsCarbonHelpers.h index 7601c3bdc616..947484771b2a 100644 --- a/gfx/src/mac/nsCarbonHelpers.h +++ b/gfx/src/mac/nsCarbonHelpers.h @@ -141,8 +141,11 @@ inline Boolean IsRegionRectangular ( RgnHandle rgn ) return (**rgn).rgnSize == 10; } +inline GrafPtr GetQDGlobalsThePort ( ) +{ + return qd.thePort; +} #endif /* !TARGET_CARBON */ - -#endif /* CarbonHelpers_h__ */ \ No newline at end of file +#endif /* CarbonHelpers_h__ */ diff --git a/gfx/src/mac/nsDeviceContextMac.h b/gfx/src/mac/nsDeviceContextMac.h index 40b06b12c79c..3b356d82878d 100644 --- a/gfx/src/mac/nsDeviceContextMac.h +++ b/gfx/src/mac/nsDeviceContextMac.h @@ -29,6 +29,8 @@ #include "nsIView.h" #include "nsIRenderingContext.h" #include "nsIFontEnumerator.h" +#include +#include class nsDeviceContextMac : public DeviceContextImpl { diff --git a/gfx/src/mac/nsFontMetricsMac.cpp b/gfx/src/mac/nsFontMetricsMac.cpp index b18fb01cd3b8..083b29588dc4 100644 --- a/gfx/src/mac/nsFontMetricsMac.cpp +++ b/gfx/src/mac/nsFontMetricsMac.cpp @@ -338,7 +338,7 @@ NS_EXPORT void nsFontMetricsMac::GetNativeTextStyle(nsIFontMetrics& inMetrics, const nsIDeviceContext& inDevContext, TextStyle &outStyle) { - nsFont *aFont; + const nsFont *aFont; inMetrics.GetFont(aFont); nsFontHandle fontNum; diff --git a/gfx/src/mac/nsImageMac.cpp b/gfx/src/mac/nsImageMac.cpp index b5272962ade8..5edbc2d0ae69 100644 --- a/gfx/src/mac/nsImageMac.cpp +++ b/gfx/src/mac/nsImageMac.cpp @@ -22,6 +22,10 @@ #include "nsImageMac.h" #include "nsRenderingContextMac.h" #include "nsDeviceContextMac.h" +#include "nsCarbonHelpers.h" + +#include +#include #include "nspr.h" @@ -230,6 +234,7 @@ nsImageMac::Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth, nsMaskRequirem break; case nsMaskRequirements_kNeeds8Bit: + { mAlphaDepth = 8; // make 8-bit grayscale color table @@ -244,6 +249,7 @@ nsImageMac::Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth, nsMaskRequirem ::DisposeHandle((Handle)grayRamp); break; + } default: NS_NOTREACHED("Uknown mask depth"); @@ -327,12 +333,16 @@ NS_IMETHODIMP nsImageMac::Draw(nsIRenderingContext &aContext, nsDrawingSurface a // 1-bit masks? +#if !TARGET_CARBON // can only do this if we are NOT printing aContext.GetDeviceContext(theDevContext); - + if(!theDevContext->IsPrinter()){ +#endif ::CopyDeepMask((BitMap*)*imagePixMap, (BitMap*)*maskPixMap, (BitMap*)*destPixels, &srcRect, &maskRect, &dstRect, srcCopy, nsnull); +#if !TARGET_CARBON } +#endif } else { @@ -444,7 +454,10 @@ void nsImageMac::ClearGWorld(GWorldPtr theGWorld) ::SetGWorld(theGWorld, nil); ::BackColor(whiteColor); - ::EraseRect(&theGWorld->portRect); + + Rect portRect; + ::GetPortBounds(reinterpret_cast(theGWorld), &portRect); + ::EraseRect(&portRect); ::UnlockPixels(thePixels); } diff --git a/gfx/src/mac/nsRegionMac.cpp b/gfx/src/mac/nsRegionMac.cpp index 8aaa24d23ee7..8efe7a9f71e4 100644 --- a/gfx/src/mac/nsRegionMac.cpp +++ b/gfx/src/mac/nsRegionMac.cpp @@ -311,7 +311,7 @@ NS_IMETHODIMP nsRegionMac::GetRects(nsRegionRectSet **aRects) typedef struct { short size; Rect bbox; - short data[]; + short data[0]; } ** Internal; Internal region; diff --git a/gfx/src/mac/nsRenderingContextMac.cpp b/gfx/src/mac/nsRenderingContextMac.cpp index 2ede3ea56b1e..31cd7f2afc1c 100644 --- a/gfx/src/mac/nsRenderingContextMac.cpp +++ b/gfx/src/mac/nsRenderingContextMac.cpp @@ -39,6 +39,7 @@ #include #include +#include #include "nsCarbonHelpers.h" #define STACK_TREASHOLD 1000 @@ -51,7 +52,7 @@ class StPortSetter { public: StPortSetter(GrafPtr newPort) - : mNewPort(newPort), mOldPort(qd.thePort) + : mNewPort(newPort), mOldPort(::GetQDGlobalsThePort()) { if (mOldPort != newPort) ::SetPort(newPort); @@ -541,7 +542,7 @@ NS_IMETHODIMP nsRenderingContextMac::DestroyDrawingSurface(nsDrawingSurface aSur // delete the offscreen nsDrawingSurfaceMac* surface = static_cast(aSurface); GWorldPtr offscreenGWorld; - surface->GetGrafPtr(&(GrafPtr)offscreenGWorld); + surface->GetGrafPtr(reinterpret_cast(&offscreenGWorld)); ::UnlockPixels(::GetGWorldPixMap(offscreenGWorld)); ::DisposeGWorld(offscreenGWorld); @@ -578,8 +579,12 @@ NS_IMETHODIMP nsRenderingContextMac::Reset(void) NS_IMETHODIMP nsRenderingContextMac::GetDeviceContext(nsIDeviceContext *&aContext) { - NS_IF_ADDREF(mContext); - aContext = mContext; + if (mContext) { + aContext = mContext; + NS_ADDREF(aContext); + } else { + aContext = nsnull; + } return NS_OK; } @@ -666,7 +671,7 @@ NS_IMETHODIMP nsRenderingContextMac::GetClipRect(nsRect &aRect, PRBool &aClipVal NS_IMETHODIMP nsRenderingContextMac::SetClipRegion(const nsIRegion& aRegion, nsClipCombine aCombine, PRBool &aClipEmpty) { RgnHandle regionH; - aRegion.GetNativeRegion(regionH); + aRegion.GetNativeRegion((void*&)regionH); RgnHandle clipRgn = mGS->mClipRegion; if (!clipRgn) return NS_ERROR_OUT_OF_MEMORY; diff --git a/gfx/src/mac/nsUnicodeMappingUtil.cpp b/gfx/src/mac/nsUnicodeMappingUtil.cpp index 84098a30263d..742d82487765 100644 --- a/gfx/src/mac/nsUnicodeMappingUtil.cpp +++ b/gfx/src/mac/nsUnicodeMappingUtil.cpp @@ -246,7 +246,7 @@ PrefEnumCallback(const char* aName, void* aClosure) curPrefName.Mid(langGroup, p1+1, curPrefName.Length()-p1-1); curPrefName.Mid(genName, p2+1, p1-p2-1); - if(langGroup == "x-unicode") + if(langGroup == nsCAutoString("x-unicode")) return; ScriptCode script = Self->MapLangGroupToScriptCode(langGroup); if(script >= smUninterp) diff --git a/gfx/src/mac/nsUnicodeRenderingToolkit.cpp b/gfx/src/mac/nsUnicodeRenderingToolkit.cpp index 8e6f90a1a8ba..88cb5edf15ee 100644 --- a/gfx/src/mac/nsUnicodeRenderingToolkit.cpp +++ b/gfx/src/mac/nsUnicodeRenderingToolkit.cpp @@ -449,7 +449,7 @@ nsresult nsUnicodeRenderingToolkit :: GetTextSegmentWidth( #ifndef DISABLE_ATSUI_FALLBACK // Fallback by using ATSUI if(! fallbackDone) { - nsFont *font; + const nsFont *font; mGS->mFontMetrics->GetFont(font); fallbackDone = ATSUIFallbackGetWidth(aString, thisWidth, fontNum, font->size, @@ -571,7 +571,7 @@ nsresult nsUnicodeRenderingToolkit :: DrawTextSegment( #ifndef DISABLE_ATSUI_FALLBACK // Fallback by using ATSUI if(! fallbackDone) { - nsFont *font; + const nsFont *font; mGS->mFontMetrics->GetFont(font); fallbackDone = ATSUIFallbackDrawChar(aString, x, y, thisWidth, fontNum, font->size, @@ -746,4 +746,4 @@ NS_IMETHODIMP nsUnicodeRenderingToolkit :: PrepareToDraw(float aP2T, nsIDeviceCo mGS = aGS; mPort = aPort; return NS_OK; -} \ No newline at end of file +} diff --git a/gfx/src/mac/nsUnicodeRenderingToolkit.h b/gfx/src/mac/nsUnicodeRenderingToolkit.h index 2fa641726925..1736ab3e5e55 100644 --- a/gfx/src/mac/nsUnicodeRenderingToolkit.h +++ b/gfx/src/mac/nsUnicodeRenderingToolkit.h @@ -30,9 +30,10 @@ class nsGraphicState; class nsUnicodeRenderingToolkit { +public: nsUnicodeRenderingToolkit() {}; ~nsUnicodeRenderingToolkit() {}; -public: + NS_IMETHOD PrepareToDraw(float aP2T, nsIDeviceContext* aContext, nsGraphicState* aGS, GrafPtr aPort); NS_IMETHOD GetWidth(const PRUnichar *aString, PRUint32 aLength, nscoord &aWidth, PRInt32 *aFontID); diff --git a/htmlparser/src/nsViewSourceHTML.cpp b/htmlparser/src/nsViewSourceHTML.cpp index e986d605abc9..f691f641c8b8 100644 --- a/htmlparser/src/nsViewSourceHTML.cpp +++ b/htmlparser/src/nsViewSourceHTML.cpp @@ -183,10 +183,7 @@ public: ~CSharedVSContext() { } - static CSharedVSContext& GetSharedContext() { - static CSharedVSContext gSharedVSContext; - return gSharedVSContext; - } + static CSharedVSContext& GetSharedContext(); nsCParserNode mEndNode; nsCParserNode mStartNode; @@ -223,7 +220,12 @@ CViewSourceHTML::CViewSourceHTML() : nsIDTD(), } +static CSharedVSContext __CSharedVSContext_gSharedVSContext; +static CSharedVSContext& CSharedVSContext::GetSharedContext() +{ + return __CSharedVSContext_gSharedVSContext; +} /** * Default destructor diff --git a/intl/uconv/public/nsICharsetAlias.h b/intl/uconv/public/nsICharsetAlias.h index eb119a48f063..37bc8845c2a7 100644 --- a/intl/uconv/public/nsICharsetAlias.h +++ b/intl/uconv/public/nsICharsetAlias.h @@ -28,16 +28,15 @@ #include "nsISupports.h" // {CCD4D374-CCDC-11d2-B3B1-00805F8A6670} -NS_DECLARE_ID(kICharsetAliasIID,\ - 0xccd4d374, 0xccdc, 0x11d2, 0xb3, 0xb1, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 ); - #define NS_ICHARSETALIAS_IID \ { 0xccd4d374, 0xccdc, 0x11d2, { 0xb3, 0xb1, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 }} +static NS_DEFINE_IID(kICharsetAliasIID, NS_ICHARSETALIAS_IID); // {98D41C21-CCF3-11d2-B3B1-00805F8A6670} -NS_DECLARE_ID(kCharsetAliasCID,\ - 0x98d41c21, 0xccf3, 0x11d2, 0xb3, 0xb1, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 ); +#define NS_CHARSETALIAS_CID \ +{ 0x98d41c21, 0xccf3, 0x11d2, { 0xb3, 0xb1, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 }} +static NS_DEFINE_IID(kCharsetAliasCID, NS_CHARSETALIAS_CID); #define NS_CHARSETALIAS_CID \ { 0x98d41c21, 0xccf3, 0x11d2, { 0xb3, 0xb1, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 }} diff --git a/intl/uconv/public/nsIUnicodeDecoder.h b/intl/uconv/public/nsIUnicodeDecoder.h index afc12ca4baac..cc1ada4b2172 100644 --- a/intl/uconv/public/nsIUnicodeDecoder.h +++ b/intl/uconv/public/nsIUnicodeDecoder.h @@ -28,12 +28,13 @@ // Interface ID for our Unicode Decoder interface // {B2F178E1-832A-11d2-8A8E-00600811A836} -NS_DECLARE_ID(kIUnicodeDecoderIID, - 0xb2f178e1, 0x832a, 0x11d2, 0x8a, 0x8e, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36); +//NS_DECLARE_ID(kIUnicodeDecoderIID, +// 0xb2f178e1, 0x832a, 0x11d2, 0x8a, 0x8e, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36); #define NS_IUNICODEDECODER_IID \ { 0xb2f178e1, 0x832a, 0x11d2, \ { 0x8a, 0x8e, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36 }} +static NS_DEFINE_IID(kIUnicodeDecoderIID, NS_IUNICODEDECODER_IID); // XXX deprecated /*---------- BEGIN DEPRECATED */ diff --git a/intl/uconv/public/nsIUnicodeEncodeHelper.h b/intl/uconv/public/nsIUnicodeEncodeHelper.h index 08b21b91526b..f1e1b8466190 100644 --- a/intl/uconv/public/nsIUnicodeEncodeHelper.h +++ b/intl/uconv/public/nsIUnicodeEncodeHelper.h @@ -59,6 +59,8 @@ class nsIUnicodeEncodeHelper : public nsISupports { public: + NS_DEFINE_STATIC_IID_ACCESSOR(kIUnicodeEncodeHelperIID) + /** * Converts data using a lookup table. */ diff --git a/intl/uconv/public/nsIUnicodeEncoder.h b/intl/uconv/public/nsIUnicodeEncoder.h index cfcc534effd5..e004ce5a9f74 100644 --- a/intl/uconv/public/nsIUnicodeEncoder.h +++ b/intl/uconv/public/nsIUnicodeEncoder.h @@ -29,21 +29,17 @@ // Interface ID for our Unicode Encoder interface // {2B2CA3D0-A4C9-11d2-8AA1-00600811A836} -NS_DECLARE_ID(kIUnicodeEncoderIID, - 0x2b2ca3d0, 0xa4c9, 0x11d2, 0x8a, 0xa1, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36); - #define NS_IUNICODEENCODER_IID \ { 0x2b2ca3d0, 0xa4c9, 0x11d2, \ { 0x8a, 0xa1, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36 }} +static NS_DEFINE_IID(kIUnicodeEncoderIID, NS_IUNICODEENCODER_IID); // Interface ID for our Unicode Character Encoder interface // {299BCCD0-C6DF-11d2-8AA8-00600811A836} -NS_DECLARE_ID(kIUnicharEncoderIID, - 0x299bccd0, 0xc6df, 0x11d2, 0x8a, 0xa8, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36); - #define NS_IUNICHARENCODER_IID \ { 0x299bccd0, 0xc6df, 0x11d2, \ {0x8a, 0xa8, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36 }} +static NS_DEFINE_IID(kIUnicharEncoderIID, NS_IUNICHARENCODER_IID); #define NS_OK_UENC_EXACTLENGTH \ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_UCONV, 0x21) diff --git a/intl/uconv/src/nsCharsetConverterManager.cpp b/intl/uconv/src/nsCharsetConverterManager.cpp index 672347e899e7..e8058dd1c2d4 100644 --- a/intl/uconv/src/nsCharsetConverterManager.cpp +++ b/intl/uconv/src/nsCharsetConverterManager.cpp @@ -551,7 +551,7 @@ NS_IMETHODIMP nsCharsetConverterManager::GetUnicodeEncoder( PL_strncpy(progid, NS_UNICODEENCODER_PROGID_BASE, 256); aDest->ToCString(progid + baselen, 256 - baselen); res = comMgr->CreateInstanceByProgID(progid,NULL, - kIUnicodeEncoderIID ,(void**)aResult); + NS_GET_IID(nsIUnicodeEncoder),(void**)aResult); if(NS_FAILED(res)) res = NS_ERROR_UCONV_NOCONV; return res; @@ -572,7 +572,7 @@ NS_IMETHODIMP nsCharsetConverterManager::GetUnicodeDecoder( PL_strncpy(progid, NS_UNICODEDECODER_PROGID_BASE, 256); aSrc->ToCString(progid + baselen, 256 - baselen); res = comMgr->CreateInstanceByProgID(progid,NULL, - kIUnicodeDecoderIID,(void**)aResult); + NS_GET_IID(nsIUnicodeDecoder),(void**)aResult); if(NS_FAILED(res)) res = NS_ERROR_UCONV_NOCONV; return res; diff --git a/intl/uconv/src/nsUnicodeEncodeHelper.cpp b/intl/uconv/src/nsUnicodeEncodeHelper.cpp index 043bca90dccd..5b00b214ec19 100644 --- a/intl/uconv/src/nsUnicodeEncodeHelper.cpp +++ b/intl/uconv/src/nsUnicodeEncodeHelper.cpp @@ -75,7 +75,7 @@ public: //---------------------------------------------------------------------- // Class nsUnicodeEncodeHelper [implementation] -NS_IMPL_ISUPPORTS(nsUnicodeEncodeHelper, kIUnicodeEncodeHelperIID); +NS_IMPL_ISUPPORTS1(nsUnicodeEncodeHelper, nsIUnicodeEncodeHelper) nsUnicodeEncodeHelper::nsUnicodeEncodeHelper() { diff --git a/intl/uconv/ucvcn/nsUCvCnSupport.cpp b/intl/uconv/ucvcn/nsUCvCnSupport.cpp index 49997ad400a1..b34b24e45fd9 100644 --- a/intl/uconv/ucvcn/nsUCvCnSupport.cpp +++ b/intl/uconv/ucvcn/nsUCvCnSupport.cpp @@ -62,7 +62,7 @@ nsresult nsBasicDecoderSupport::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeDecoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeDecoder))) { *aInstancePtr = (void*) ((nsIUnicodeDecoder*)this); NS_ADDREF_THIS(); return NS_OK; @@ -369,7 +369,7 @@ nsresult nsBasicEncoder::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeEncoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeEncoder))) { *aInstancePtr = (void*) ((nsIUnicodeEncoder*)this); NS_ADDREF_THIS(); return NS_OK; diff --git a/intl/uconv/ucvibm/nsUCvIBMSupport.cpp b/intl/uconv/ucvibm/nsUCvIBMSupport.cpp index 7d12e567234b..7fc253350ee2 100644 --- a/intl/uconv/ucvibm/nsUCvIBMSupport.cpp +++ b/intl/uconv/ucvibm/nsUCvIBMSupport.cpp @@ -75,7 +75,7 @@ nsresult nsBasicDecoderSupport::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeDecoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeDecoder))) { *aInstancePtr = (void*) ((nsIUnicodeDecoder*)this); NS_ADDREF_THIS(); return NS_OK; @@ -382,7 +382,7 @@ nsresult nsBasicEncoder::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeEncoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeEncoder))) { *aInstancePtr = (void*) ((nsIUnicodeEncoder*)this); NS_ADDREF_THIS(); return NS_OK; diff --git a/intl/uconv/ucvja/nsUCvJaSupport.cpp b/intl/uconv/ucvja/nsUCvJaSupport.cpp index f231978f6c2e..5ac1f821819c 100644 --- a/intl/uconv/ucvja/nsUCvJaSupport.cpp +++ b/intl/uconv/ucvja/nsUCvJaSupport.cpp @@ -62,7 +62,7 @@ nsresult nsBasicDecoderSupport::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeDecoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeDecoder))) { *aInstancePtr = (void*) ((nsIUnicodeDecoder*)this); NS_ADDREF_THIS(); return NS_OK; diff --git a/intl/uconv/ucvko/nsUCvKOSupport.cpp b/intl/uconv/ucvko/nsUCvKOSupport.cpp index 54d9bb9ea6b1..31f41f5d6fd2 100644 --- a/intl/uconv/ucvko/nsUCvKOSupport.cpp +++ b/intl/uconv/ucvko/nsUCvKOSupport.cpp @@ -62,7 +62,7 @@ nsresult nsBasicDecoderSupport::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeDecoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeDecoder))) { *aInstancePtr = (void*) ((nsIUnicodeDecoder*)this); NS_ADDREF_THIS(); return NS_OK; diff --git a/intl/uconv/ucvko/nsUnicodeToX11Johab.cpp b/intl/uconv/ucvko/nsUnicodeToX11Johab.cpp index 2a9dd3a9afa7..40cd932f6f55 100644 --- a/intl/uconv/ucvko/nsUnicodeToX11Johab.cpp +++ b/intl/uconv/ucvko/nsUnicodeToX11Johab.cpp @@ -69,7 +69,7 @@ nsresult nsUnicodeToX11Johab::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeEncoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeEncoder))) { *aInstancePtr = (void*) ((nsIUnicodeEncoder*)this); NS_ADDREF_THIS(); return NS_OK; diff --git a/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp b/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp index 8e733a3e4eae..a140198da2df 100644 --- a/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp +++ b/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp @@ -62,7 +62,7 @@ nsresult nsBasicDecoderSupport::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeDecoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeDecoder))) { *aInstancePtr = (void*) ((nsIUnicodeDecoder*)this); NS_ADDREF_THIS(); return NS_OK; diff --git a/intl/uconv/ucvtw/nsUCvTWSupport.cpp b/intl/uconv/ucvtw/nsUCvTWSupport.cpp index 5fd6b79a2044..fd8d5c82c6dd 100644 --- a/intl/uconv/ucvtw/nsUCvTWSupport.cpp +++ b/intl/uconv/ucvtw/nsUCvTWSupport.cpp @@ -62,7 +62,7 @@ nsresult nsBasicDecoderSupport::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeDecoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeDecoder))) { *aInstancePtr = (void*) ((nsIUnicodeDecoder*)this); NS_ADDREF_THIS(); return NS_OK; diff --git a/intl/uconv/ucvtw2/nsUCvTW2Support.cpp b/intl/uconv/ucvtw2/nsUCvTW2Support.cpp index 186b1bce59e6..5b9b2f4d8f3d 100644 --- a/intl/uconv/ucvtw2/nsUCvTW2Support.cpp +++ b/intl/uconv/ucvtw2/nsUCvTW2Support.cpp @@ -62,7 +62,7 @@ nsresult nsBasicDecoderSupport::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeDecoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeDecoder))) { *aInstancePtr = (void*) ((nsIUnicodeDecoder*)this); NS_ADDREF_THIS(); return NS_OK; @@ -369,7 +369,7 @@ nsresult nsBasicEncoder::QueryInterface(REFNSIID aIID, static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - if (aIID.Equals(kIUnicodeEncoderIID)) { + if (aIID.Equals(NS_GET_IID(nsIUnicodeEncoder))) { *aInstancePtr = (void*) ((nsIUnicodeEncoder*)this); NS_ADDREF_THIS(); return NS_OK; diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect/loader/mozJSComponentLoader.cpp index 65b29f871a73..9b0c2fbc1a2a 100644 --- a/js/src/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/src/xpconnect/loader/mozJSComponentLoader.cpp @@ -37,10 +37,17 @@ const char mozJSComponentLoaderProgID[] = "moz.jsloader.1"; const char jsComponentTypeName[] = "text/javascript"; + /* XXX export properly from libxpcom, for now this will let Mac build */ +#ifdef RHAPSODY +extern const char fileSizeValueName[]; // = "FileSize"; +extern const char lastModValueName[]; // = "LastModTimeStamp"; +extern const char xpcomKeyName[]; // = "Software/Mozilla/XPCOM"; +#else const char fileSizeValueName[] = "FileSize"; const char lastModValueName[] = "LastModTimeStamp"; const char xpcomKeyName[] = "software/mozilla/XPCOM/components"; +#endif const char kJSRuntimeServiceProgID[] = "nsJSRuntimeService"; const char kXPConnectServiceProgID[] = "nsIXPConnect"; diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 5c7e7371f5bf..8e8b88a84d83 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -4129,7 +4129,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, rv = NS_NewMenuFrame(aPresShell, &newFrame, (aTag != nsXULAtoms::menuitem)); } else if (aTag == nsXULAtoms::menubar) { -#ifdef XP_MAC // The Mac uses its native menu bar. +#if defined(XP_MAC) || defined(RHAPSODY) // The Mac uses its native menu bar. aHaltProcessing = PR_TRUE; return NS_OK; #else diff --git a/layout/build/Makefile.in b/layout/build/Makefile.in index 683556a7cdf7..1db8420ad249 100644 --- a/layout/build/Makefile.in +++ b/layout/build/Makefile.in @@ -57,7 +57,7 @@ SHARED_LIBRARY_LIBS = \ $(DIST)/lib/libraptorxmldoc_s.a \ $(DIST)/lib/libraptorxulcontent_s.a \ $(DIST)/lib/libraptorxulbase_s.a \ - $(DIST)/lib/libraptorxbl_s.a \ + $(DIST)/lib/libraptorxbl_s.a \ $(DIST)/lib/libraptorlayout_s.a \ $(NULL) diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 5c7e7371f5bf..8e8b88a84d83 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -4129,7 +4129,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, rv = NS_NewMenuFrame(aPresShell, &newFrame, (aTag != nsXULAtoms::menuitem)); } else if (aTag == nsXULAtoms::menubar) { -#ifdef XP_MAC // The Mac uses its native menu bar. +#if defined(XP_MAC) || defined(RHAPSODY) // The Mac uses its native menu bar. aHaltProcessing = PR_TRUE; return NS_OK; #else diff --git a/netwerk/protocol/http/src/nsHTTPHandler.cpp b/netwerk/protocol/http/src/nsHTTPHandler.cpp index 9248a06ea549..e8f20d858516 100644 --- a/netwerk/protocol/http/src/nsHTTPHandler.cpp +++ b/netwerk/protocol/http/src/nsHTTPHandler.cpp @@ -598,6 +598,8 @@ nsHTTPHandler::InitUserAgentComponents() // Gather platform. #if defined(XP_PC) mAppPlatform = "Windows"; +#elif defined(RHAPSODY) + mAppPlatform = "Macintosh"; #elif defined (XP_UNIX) mAppPlatform = "X11"; #else diff --git a/parser/htmlparser/src/nsViewSourceHTML.cpp b/parser/htmlparser/src/nsViewSourceHTML.cpp index e986d605abc9..f691f641c8b8 100644 --- a/parser/htmlparser/src/nsViewSourceHTML.cpp +++ b/parser/htmlparser/src/nsViewSourceHTML.cpp @@ -183,10 +183,7 @@ public: ~CSharedVSContext() { } - static CSharedVSContext& GetSharedContext() { - static CSharedVSContext gSharedVSContext; - return gSharedVSContext; - } + static CSharedVSContext& GetSharedContext(); nsCParserNode mEndNode; nsCParserNode mStartNode; @@ -223,7 +220,12 @@ CViewSourceHTML::CViewSourceHTML() : nsIDTD(), } +static CSharedVSContext __CSharedVSContext_gSharedVSContext; +static CSharedVSContext& CSharedVSContext::GetSharedContext() +{ + return __CSharedVSContext_gSharedVSContext; +} /** * Default destructor diff --git a/rdf/chrome/build/Makefile.in b/rdf/chrome/build/Makefile.in index bfc22c6faaa9..56372e39e131 100644 --- a/rdf/chrome/build/Makefile.in +++ b/rdf/chrome/build/Makefile.in @@ -43,7 +43,6 @@ EXTRA_DSO_LDOPTS = \ $(SHARED_LIBRARY_LIBS) \ $(MKSHLIB_UNFORCE_ALL) \ $(MOZ_COMPONENT_LIBS) \ - $(MOZ_TIMER_LIBS) \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/webshell/src/Makefile.in b/webshell/src/Makefile.in index 78814c94cb87..5e8f367a7d88 100644 --- a/webshell/src/Makefile.in +++ b/webshell/src/Makefile.in @@ -29,6 +29,10 @@ include $(DEPTH)/config/autoconf.mk MODULE = raptor LIBRARY_NAME = raptorwebwidget +ifeq ($(OS_ARCH),Rhapsody) +IS_COMPONENT = 1 +endif + CPPSRCS = \ dlldeps.cpp \ nsDLLFactory.cpp \ @@ -39,6 +43,7 @@ EXTRA_DSO_LDOPTS = \ $(MOZ_TIMER_LIBS) \ -L$(DIST)/bin \ -ljsdom \ + -lmozjs \ $(MOZ_COMPONENT_LIBS) \ -ldocshell \ $(NULL) diff --git a/webshell/tests/viewer/Makefile.in b/webshell/tests/viewer/Makefile.in index bfb5ebe48079..f831da2a7be2 100644 --- a/webshell/tests/viewer/Makefile.in +++ b/webshell/tests/viewer/Makefile.in @@ -76,7 +76,7 @@ EXPORT_RESOURCE_SAMPLES := \ EXPORT_RESOURCE_THROBBER := $(wildcard $(srcdir)/throbber/anim*.gif) -ifeq (,$(filter beos os2 rhapsody photon,$(MOZ_WIDGET_TOOLKIT))) +ifeq (,$(filter beos os2 photon mac,$(MOZ_WIDGET_TOOLKIT))) DIRS += unix UNIX_VIEWER_TK_LIBS = unix/$(MOZ_WIDGET_TOOLKIT)/libviewer_$(MOZ_WIDGET_TOOLKIT)_s.a else @@ -87,6 +87,9 @@ endif ifeq ($(MOZ_WIDGET_TOOLKIT),photon) TOOLKIT_CPPSRCS = nsPhMain.cpp nsPhMenu.cpp endif +ifeq ($(MOZ_WIDGET_TOOLKIT),mac) +TOOLKIT_CPPSRCS = nsMacMain.cpp +endif endif ifeq ($(MOZ_WIDGET_TOOLKIT),gtk) @@ -154,6 +157,10 @@ install:: include $(topsrcdir)/config/rules.mk +ifeq ($(OS_ARCH),Rhapsody) +INCLUDES += -I$(topsrcdir)/widget/src/mac +endif + CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS) GARBAGE += $(PROGRAM)_gtk $(PROGRAM)_motif $(PROGRAM)_qt $(PROGRAM)_xlib diff --git a/webshell/tests/viewer/nsMacMain.cpp b/webshell/tests/viewer/nsMacMain.cpp index 40eb2b7464fc..59bffc3cfab1 100644 --- a/webshell/tests/viewer/nsMacMain.cpp +++ b/webshell/tests/viewer/nsMacMain.cpp @@ -37,9 +37,10 @@ #include #include "nsMacMessagePump.h" // for the windowless menu event handler +#if !TARGET_CARBON #include "nsILeakDetector.h" - #include "macstdlibextras.h" +#endif typedef SInt32 MessageT; typedef PRUint32 Uint32; @@ -128,7 +129,7 @@ static nsNativeViewerApp* gTheApp; nsNativeViewerApp::nsNativeViewerApp() { - nsMacMessagePump::SetWindowlessMenuEventHandler(DispatchMenuItemWithoutWindow); + //nsMacMessagePump::SetWindowlessMenuEventHandler(DispatchMenuItemWithoutWindow); } nsNativeViewerApp::~nsNativeViewerApp() @@ -173,9 +174,9 @@ void nsNativeViewerApp::DispatchMenuItemWithoutWindow(PRInt32 menuResult) gTheApp->OpenWindow(); break; case cmd_Open: - nsBrowserWindow * newWindow; - gTheApp->OpenWindow(0, newWindow); - newWindow->DoFileOpen(); + nsIBrowserWindow * newWindow; + gTheApp->OpenWindow((PRUint32)0, newWindow); + ((nsBrowserWindow*)newWindow)->DoFileOpen(); break; case cmd_Quit: gTheApp->Exit(); @@ -340,9 +341,11 @@ nsNativeBrowserWindow::DispatchMenuItem(PRInt32 aID) case cmd_DumpLeaks: { nsresult rv; +#if !TARGET_CARBON NS_WITH_SERVICE(nsILeakDetector, leakDetector, "component://netscape/xpcom/leakdetector", &rv) if (NS_SUCCEEDED(rv)) leakDetector->DumpLeaks(); +#endif } break; } @@ -385,7 +388,7 @@ nsNativeBrowserWindow::DispatchMenuItem(PRInt32 aID) /** * Quit AppleEvent handler. */ -static pascal OSErr handleQuitApplication(const AppleEvent*, AppleEvent*, long) +static pascal OSErr handleQuitApplication(const AppleEvent*, AppleEvent*, UInt32) { if (gTheApp != nsnull) { gTheApp->Exit(); @@ -400,7 +403,9 @@ static pascal OSErr handleQuitApplication(const AppleEvent*, AppleEvent*, long) int main(int argc, char **argv) { // Set up the toolbox and (if DEBUG) the console +#if !TARGET_CARBON InitializeMacToolbox(); +#endif // Install an a Quit AppleEvent handler. OSErr err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, @@ -424,6 +429,9 @@ int main(int argc, char **argv) NS_RELEASE(gTheApp); } +#ifdef RHAPSODY +#undef DETECT_WEBSHELL_LEAKS +#endif #ifdef DETECT_WEBSHELL_LEAKS if ( unsigned long count = NS_TotalWebShellsInExistence() ) { printf("XXX WARNING: Number of webshells being leaked: %d \n", count); diff --git a/webshell/tests/viewer/nsSetupRegistry.cpp b/webshell/tests/viewer/nsSetupRegistry.cpp index 696ccea59e01..fd4980d29aec 100644 --- a/webshell/tests/viewer/nsSetupRegistry.cpp +++ b/webshell/tests/viewer/nsSetupRegistry.cpp @@ -312,10 +312,6 @@ NS_SetupRegistry() #endif /* defined(XP_UNIX) && !defined(MOZ_MONOLITHIC_TOOLKIT) */ - - - - // WIDGET nsComponentManager::RegisterComponentLib(kCLookAndFeelCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); nsComponentManager::RegisterComponentLib(kCWindowCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); diff --git a/webshell/tests/viewer/nsViewerApp.h b/webshell/tests/viewer/nsViewerApp.h index a38e190c1fae..54d7903786f5 100644 --- a/webshell/tests/viewer/nsViewerApp.h +++ b/webshell/tests/viewer/nsViewerApp.h @@ -94,7 +94,7 @@ public: ~nsNativeViewerApp(); virtual int Run(); -#ifdef XP_MAC +#if defined(XP_MAC) || defined(RHAPSODY) static void DispatchMenuItemWithoutWindow(PRInt32 menuResult); #endif }; diff --git a/widget/public/Makefile.in b/widget/public/Makefile.in index a12bdfc270f6..5b67624a4208 100644 --- a/widget/public/Makefile.in +++ b/widget/public/Makefile.in @@ -67,6 +67,7 @@ EXPORTS = \ nsIFontRetrieverService.h \ nsIContextMenu.h \ nsIDragSessionGTK.h \ + nsIDragSessionMac.h \ $(NULL) XPIDLSRCS = \ diff --git a/widget/src/mac/.cvsignore b/widget/src/mac/.cvsignore new file mode 100644 index 000000000000..f3c7a7c5da68 --- /dev/null +++ b/widget/src/mac/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/widget/src/mac/Makefile.in b/widget/src/mac/Makefile.in new file mode 100644 index 000000000000..66df25d86d1b --- /dev/null +++ b/widget/src/mac/Makefile.in @@ -0,0 +1,73 @@ +# +# The contents of this file are subject to the Netscape Public License +# Version 1.1 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. +# + +DEPTH = ../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +MODULE = widget +LIBRARY_NAME = widget_mac +IS_COMPONENT = 1 + +REQUIRES = util img xpcom raptorgfx + +CPPSRCS = nsAppShell.cpp \ + nsButton.cpp \ + nsChildWindow.cpp \ + nsClipboard.cpp \ + nsComboBox.cpp \ + nsContextMenu.cpp \ + nsDeleteObserver.cpp \ + nsDragService.cpp \ + nsFileWidget.cpp \ + nsLabel.cpp \ + nsListBox.cpp \ + nsLookAndFeel.cpp \ + nsMacControl.cpp \ + nsMacEventHandler.cpp \ + nsMacMessagePump.cpp \ + nsMacMessageSink.cpp \ + nsMacResources.cpp \ + nsMacTSMMessagePump.cpp \ + nsMacWindow.cpp \ + nsMenu.cpp \ + nsMenuBar.cpp \ + nsMenuItem.cpp \ + nsMimeMapper.cpp \ + $(topsrcdir)/gfx/src/mac/nsRegionMac.cpp \ + nsScrollbar.cpp \ + nsSound.cpp \ + nsTextWidget.cpp \ + nsToolkit.cpp \ + nsWidgetFactory.cpp \ + nsWidgetSupport.cpp \ + nsWindow.cpp + +include $(topsrcdir)/config/rules.mk + +EXTRA_DSO_LDOPTS += \ + $(MOZ_TIMER_LIBS) \ + $(DIST)/lib/libraptorbasewidget_s.a \ + $(TK_LIBS) \ + -lraptorgfx \ + $(MOZ_COMPONENT_LIBS) \ + $(NULL) + +INCLUDES += $(TK_CFLAGS) -I$(topsrcdir)/gfx/src/mac -I$(srcdir)/../xpwidgets diff --git a/widget/src/mac/nsAppShell.cpp b/widget/src/mac/nsAppShell.cpp index e314d1184e90..346212980781 100644 --- a/widget/src/mac/nsAppShell.cpp +++ b/widget/src/mac/nsAppShell.cpp @@ -48,8 +48,9 @@ #include +#ifndef RHAPSODY #include "macstdlibextras.h" - +#endif PRBool nsAppShell::mInitializedToolbox = PR_FALSE; @@ -60,7 +61,7 @@ PRBool nsAppShell::mInitializedToolbox = PR_FALSE; //------------------------------------------------------------------------- NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); -NS_IMPL_ISUPPORTS1(nsAppShell, nsIAppShell) +NS_IMPL_THREADSAFE_ISUPPORTS1(nsAppShell, nsIAppShell) NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener) { @@ -170,7 +171,11 @@ NS_IMETHODIMP nsAppShell::Spindown(void) // //------------------------------------------------------------------------- nsAppShell::nsAppShell() -{ +{ + +#if TARGET_CARBON + mInitializedToolbox = PR_TRUE; +#else // The toolbox initialization code has moved to NSStdLib (InitializeToolbox) if (!mInitializedToolbox) @@ -178,6 +183,7 @@ nsAppShell::nsAppShell() InitializeMacToolbox(); mInitializedToolbox = PR_TRUE; } +#endif mRefCnt = 0; mExitCalled = PR_FALSE; } diff --git a/widget/src/mac/nsClipboard.cpp b/widget/src/mac/nsClipboard.cpp index 9d79f8df4f1a..a29caafe117b 100644 --- a/widget/src/mac/nsClipboard.cpp +++ b/widget/src/mac/nsClipboard.cpp @@ -84,8 +84,13 @@ nsClipboard :: SetNativeClipboardData() return NS_ERROR_INVALID_ARG; nsMimeMapperMac theMapper; + +#if TARGET_CARBON + ::ClearCurrentScrap(); +#else ::ZeroScrap(); - +#endif + // get flavor list that includes all flavors that can be written (including ones // obtained through conversion) nsCOMPtr flavorList; @@ -116,14 +121,20 @@ nsClipboard :: SetNativeClipboardData() nsCOMPtr genericDataWrapper; errCode = mTransferable->GetTransferData ( flavorStr, getter_AddRefs(genericDataWrapper), &dataSize ); nsPrimitiveHelpers::CreateDataFromPrimitive ( flavorStr, genericDataWrapper, &data, dataSize ); - #ifdef NS_DEBUG +#ifdef NS_DEBUG if ( NS_FAILED(errCode) ) printf("nsClipboard:: Error getting data from transferable\n"); - #endif +#endif // stash on clipboard +#if TARGET_CARBON + ScrapRef scrap; + ::GetCurrentScrap(&scrap); + ::PutScrapFlavor(scrap, macOSFlavor, 0L/*???*/, dataSize, data); +#else long numBytes = ::PutScrap ( dataSize, macOSFlavor, data ); if ( numBytes != noErr ) errCode = NS_ERROR_FAILURE; +#endif // if the flavor was unicode, then we also need to put it on as 'TEXT' after // doing the conversion to the platform charset. @@ -133,9 +144,15 @@ nsClipboard :: SetNativeClipboardData() PRInt32 plainTextLen = 0; nsPrimitiveHelpers::ConvertUnicodeToPlatformPlainText ( castedUnicode, dataSize / 2, &plainTextData, &plainTextLen ); if ( plainTextData ) { +#if TARGET_CARBON + ScrapRef scrap; + ::GetCurrentScrap(&scrap); + ::PutScrapFlavor( scrap, 'TEXT', 0L/*???*/, plainTextLen, plainTextData ); +#else long numTextBytes = ::PutScrap ( plainTextLen, 'TEXT', plainTextData ); if ( numTextBytes != noErr ) - errCode = NS_ERROR_FAILURE; + errCode = NS_ERROR_FAILURE; +#endif nsAllocator::Free ( plainTextData ); } } // if unicode @@ -149,9 +166,15 @@ nsClipboard :: SetNativeClipboardData() short mappingLen = 0; const char* mapping = theMapper.ExportMapping(&mappingLen); if ( mapping && mappingLen ) { +#if TARGET_CARBON + ScrapRef scrap; + ::GetCurrentScrap(&scrap); + ::PutScrapFlavor(scrap, nsMimeMapperMac::MappingFlavor(), 0L/*???*/, mappingLen - 1, mapping); +#else long numBytes = ::PutScrap ( mappingLen - 1, nsMimeMapperMac::MappingFlavor(), mapping ); if ( numBytes != noErr ) errCode = NS_ERROR_FAILURE; +#endif nsCRT::free ( NS_CONST_CAST(char*, mapping) ); } @@ -184,7 +207,7 @@ nsClipboard :: GetNativeClipboardData(nsITransferable * aTransferable) // create a mime mapper. It's ok for this to fail because the data may come from // another app which obviously wouldn't put our mime mapping data on the clipboard. char* mimeMapperData = nsnull; - GetDataOffClipboard ( nsMimeMapperMac::MappingFlavor(), &mimeMapperData, nsnull ); + GetDataOffClipboard ( nsMimeMapperMac::MappingFlavor(), (void**)&mimeMapperData, 0 ); nsMimeMapperMac theMapper ( mimeMapperData ); nsCRT::free ( mimeMapperData ); @@ -241,9 +264,9 @@ nsClipboard :: GetNativeClipboardData(nsITransferable * aTransferable) nsCOMPtr genericDataWrapper; nsPrimitiveHelpers::CreatePrimitiveForData ( flavorStr, clipboardData, dataSize, getter_AddRefs(genericDataWrapper) ); errCode = aTransferable->SetTransferData ( flavorStr, genericDataWrapper, dataSize ); - #ifdef NS_DEBUG +#ifdef NS_DEBUG if ( errCode != NS_OK ) printf("nsClipboard:: Error setting data into transferable\n"); - #endif +#endif nsAllocator::Free ( clipboardData ); // we found one, get out of this loop! @@ -268,6 +291,33 @@ nsClipboard :: GetDataOffClipboard ( ResType inMacFlavor, void** outData, PRInt3 // check if it is on the clipboard long offsetUnused = 0; + +#if TARGET_CARBON + ScrapRef scrap; + long dataSize; + OSStatus err; + + err = ::GetCurrentScrap(&scrap); + if (err != noErr) return NS_ERROR_FAILURE; + err = ::GetScrapFlavorSize(scrap, inMacFlavor, &dataSize); + // check err?? + if (dataSize > 0) { + char* dataBuff = new char[dataSize]; + if ( !dataBuff ) + return NS_ERROR_OUT_OF_MEMORY; + err = ::GetScrapFlavorData(scrap, inMacFlavor, &dataSize, dataBuff); + if (err != noErr) return NS_ERROR_FAILURE; + + // put it into the transferable +#ifdef NS_DEBUG + if ( err != NS_OK ) printf("nsClipboard:: Error setting data into transferable\n"); +#endif + + if ( outDataSize ) + *outDataSize = dataSize; + *outData = dataBuff; + } +#else long clipResult = ::GetScrap(NULL, inMacFlavor, &offsetUnused); if ( clipResult > 0 ) { Handle dataHand = ::NewHandle(0); @@ -289,13 +339,13 @@ nsClipboard :: GetDataOffClipboard ( ResType inMacFlavor, void** outData, PRInt3 *outData = dataBuff; } else { - #ifdef NS_DEBUG +#ifdef NS_DEBUG printf("nsClipboard: Error getting data off the clipboard, #%d\n", dataSize); - #endif +#endif return NS_ERROR_FAILURE; } } - +#endif /* TARGET_CARBON */ return NS_OK; } // GetDataOffClipboard @@ -319,7 +369,7 @@ nsClipboard :: HasDataMatchingFlavors ( nsISupportsArray* aFlavorList, PRBool * // create a mime mapper. It's ok for this to fail because the data may come from // another app which obviously wouldn't put our mime mapping data on the clipboard. char* mimeMapperData = nsnull; - GetDataOffClipboard ( nsMimeMapperMac::MappingFlavor(), &mimeMapperData, nsnull ); + GetDataOffClipboard ( nsMimeMapperMac::MappingFlavor(), (void**)&mimeMapperData, 0 ); nsMimeMapperMac theMapper ( mimeMapperData ); nsAllocator::Free ( mimeMapperData ); @@ -371,9 +421,23 @@ nsClipboard :: CheckIfFlavorPresent ( ResType inMacFlavor ) { PRBool retval = PR_FALSE; long offsetUnused = 0; - long clipResult = ::GetScrap(NULL, inMacFlavor, &offsetUnused); + +#if TARGET_CARBON + ScrapRef scrap; + long dataSize; + OSStatus err; + + err = ::GetCurrentScrap(&scrap); + if (err != noErr) return NS_ERROR_FAILURE; + err = ::GetScrapFlavorSize(scrap, inMacFlavor, &dataSize); + // XXX ? + if ( dataSize > 0 ) + retval = PR_TRUE; +#else + long clipResult = ::GetScrap(NULL, inMacFlavor, &offsetUnused); if ( clipResult > 0 ) retval = PR_TRUE; // we found one! - +#endif + return retval; } // CheckIfFlavorPresent diff --git a/widget/src/mac/nsClipboard.h b/widget/src/mac/nsClipboard.h index d971b5fa4063..5c780e9f6497 100644 --- a/widget/src/mac/nsClipboard.h +++ b/widget/src/mac/nsClipboard.h @@ -33,6 +33,8 @@ #include "nsBaseClipboard.h" +#include "Types.h" + class nsITransferable; diff --git a/widget/src/mac/nsContextMenu.cpp b/widget/src/mac/nsContextMenu.cpp index 5f395df31522..91ce0c048e1d 100644 --- a/widget/src/mac/nsContextMenu.cpp +++ b/widget/src/mac/nsContextMenu.cpp @@ -332,7 +332,7 @@ nsEventStatus nsContextMenu::MenuItemSelected(const nsMenuEvent & aMenuEvent) //PRInt16 menuItemID = LoWord(((nsMenuEvent)aMenuEvent).mCommand); PRInt16 menuItemID = mSelectedMenuItem; nsIMenuListener * menuListener = nsnull; - ((nsIMenuItem*)mMenuItemVoidArray[menuItemID-1])->QueryInterface(NS_GET_IID(nsIMenuListener), &menuListener); + ((nsIMenuItem*)mMenuItemVoidArray[menuItemID-1])->QueryInterface(NS_GET_IID(nsIMenuListener), (void**)&menuListener); if(menuListener) { eventStatus = menuListener->MenuSelected(aMenuEvent); NS_IF_RELEASE(menuListener); @@ -346,11 +346,11 @@ nsEventStatus nsContextMenu::MenuItemSelected(const nsMenuEvent & aMenuEvent) if(nsnull != mMenuItemVoidArray[i-1]) { nsIMenu * submenu = nsnull; - ((nsISupports*)mMenuItemVoidArray[i-1])->QueryInterface(NS_GET_IID(nsIMenu), &submenu); + ((nsISupports*)mMenuItemVoidArray[i-1])->QueryInterface(NS_GET_IID(nsIMenu), (void**)&submenu); if(submenu) { nsIMenuListener * menuListener = nsnull; - ((nsISupports*)mMenuItemVoidArray[i-1])->QueryInterface(NS_GET_IID(nsIMenuListener), &menuListener); + ((nsISupports*)mMenuItemVoidArray[i-1])->QueryInterface(NS_GET_IID(nsIMenuListener), (void**)&menuListener); if(menuListener){ eventStatus = menuListener->MenuSelected(aMenuEvent); NS_IF_RELEASE(menuListener); @@ -654,4 +654,4 @@ void nsContextMenu::NSStringSetMenuItemText(MenuHandle macMenuHandle, short menu delete [] scriptRunText; } - \ No newline at end of file + diff --git a/widget/src/mac/nsDragService.cpp b/widget/src/mac/nsDragService.cpp index ded915b62844..0a789c18ae93 100644 --- a/widget/src/mac/nsDragService.cpp +++ b/widget/src/mac/nsDragService.cpp @@ -42,8 +42,9 @@ #include "nsXPIDLString.h" #include "nsPrimitiveHelpers.h" - +#if !TARGET_CARBON DragSendDataUPP nsDragService::sDragSendDataUPP = NewDragSendDataProc(DragSendDataProc); +#endif // we need our own stuff for MacOS because of nsIDragSessionMac. NS_IMPL_ADDREF_INHERITED(nsDragService, nsBaseDragService) @@ -114,7 +115,9 @@ printf("**** created drag ref %ld\n", theDragRef); // register drag send proc which will call us back when asked for the actual // flavor data (instead of placing it all into the drag manager) +#if !TARGET_CARBON ::SetDragSendProc ( theDragRef, sDragSendDataUPP, this ); +#endif // start the drag. Be careful, mDragRef will be invalid AFTER this call (it is // reset by the dragTrackingHandler). @@ -155,7 +158,7 @@ nsDragService :: BuildDragRegion ( nsIScriptableRegion* inRegion, Point inGlobal // At the end, we are left with an outline of the region in global coordinates. if ( geckoRegion ) { RgnHandle dragRegion = nsnull; - geckoRegion->GetNativeRegion(dragRegion); + geckoRegion->GetNativeRegion((void*&)dragRegion); if ( dragRegion && ioDragRgn ) { ::CopyRgn ( dragRegion, ioDragRgn ); ::InsetRgn ( ioDragRgn, 1, 1 ); @@ -588,7 +591,7 @@ nsDragService :: LookupMimeMappingsForItem ( DragReference inDragRef, ItemRefere { char* mapperData = nsnull; PRInt32 mapperSize = 0; - ExtractDataFromOS(inDragRef, inItemRef, nsMimeMapperMac::MappingFlavor(), &mapperData, &mapperSize); + ExtractDataFromOS(inDragRef, inItemRef, nsMimeMapperMac::MappingFlavor(), (void**)&mapperData, &mapperSize); return mapperData; diff --git a/widget/src/mac/nsDragService.h b/widget/src/mac/nsDragService.h index 0b2461b8cde8..7af6a32e0c83 100644 --- a/widget/src/mac/nsDragService.h +++ b/widget/src/mac/nsDragService.h @@ -37,7 +37,7 @@ #include "nsBaseDragService.h" #include "nsIDragSessionMac.h" #include - +#include class nsNativeDragTarget; diff --git a/widget/src/mac/nsMacControl.cpp b/widget/src/mac/nsMacControl.cpp index ad0ada040145..c1a56b4ab337 100644 --- a/widget/src/mac/nsMacControl.cpp +++ b/widget/src/mac/nsMacControl.cpp @@ -367,8 +367,9 @@ void nsMacControl::SetupMacControlFont() NS_PRECONDITION(mContext != nsnull, "No context metrics in SetupMacControlFont"); TextStyle theStyle; +#if !TARGET_CARBON nsFontMetricsMac::GetNativeTextStyle(*mFontMetrics, *mContext, theStyle); - +#endif // if needed, impose a min size of 9pt on the control font if (theStyle.tsSize < 9) theStyle.tsSize = 9; @@ -482,7 +483,9 @@ void nsMacControl::NSStringSetControlTitle(ControlHandle theControl, nsString ti // // determine the script of the font that the control is supposed to be drawn in // +#if !TARGET_CARBON nsFontMetricsMac::GetNativeTextStyle(*mFontMetrics, *mContext, theStyle); +#endif fontScript = ::FontToScript(theStyle.tsFont); // @@ -562,9 +565,10 @@ void nsMacControl::SetupMacControlFontForScript(short theScript) NS_PRECONDITION(mFontMetrics != nsnull, "No font metrics in SetupMacControlFont"); NS_PRECONDITION(mContext != nsnull, "No context metrics in SetupMacControlFont"); - +#if !TARGET_CARBON nsFontMetricsMac::GetNativeTextStyle(*mFontMetrics, *mContext, theStyle); - +#endif + // // take the script and select and override font // @@ -605,4 +609,4 @@ void nsMacControl::GetFileSystemCharset(nsString & fileSystemCharset) } fileSystemCharset = aCharset; } - \ No newline at end of file + diff --git a/widget/src/mac/nsMacEventHandler.cpp b/widget/src/mac/nsMacEventHandler.cpp index a75582afd82d..fc5c2941be61 100644 --- a/widget/src/mac/nsMacEventHandler.cpp +++ b/widget/src/mac/nsMacEventHandler.cpp @@ -34,8 +34,9 @@ #include #include "nsCarbonHelpers.h" #include "nsIRollupListener.h" +#ifndef RHAPSODY #include - +#endif //#define DEBUG_TSM extern nsIRollupListener * gRollupListener; @@ -297,6 +298,7 @@ nsMacEventHandler::nsMacEventHandler(nsMacWindow* aTopLevelWidget) // each Mac window // mTSMDocument = nsnull; +#if !TARGET_CARBON supportedServices[0] = kTextService; err = ::NewTSMDocument(1,supportedServices,&mTSMDocument,(long)this); NS_ASSERTION(err==noErr,"nsMacEventHandler::nsMacEventHandler: NewTSMDocument failed."); @@ -304,7 +306,8 @@ nsMacEventHandler::nsMacEventHandler(nsMacWindow* aTopLevelWidget) #ifdef DEBUG_TSM printf("nsMacEventHandler::nsMacEventHandler: created TSMDocument[%p]\n",mTSMDocument); #endif - +#endif + mIMEIsComposing = PR_FALSE; mIMECompositionStr=nsnull; @@ -358,6 +361,7 @@ PRBool nsMacEventHandler::HandleOSEvent ( EventRecord& aOSEvent ) break; case osEvt: + { unsigned char eventType = ((aOSEvent.message >> 24) & 0x00ff); if (eventType == suspendResumeMessage) { @@ -375,7 +379,8 @@ PRBool nsMacEventHandler::HandleOSEvent ( EventRecord& aOSEvent ) if (! mInBackground) retVal = HandleMouseMoveEvent(aOSEvent); } - break; + } + break; case nullEvent: if (! mInBackground) @@ -1157,7 +1162,7 @@ PRBool nsMacEventHandler::HandleMouseDownEvent( ConvertOSEventToMouseEvent(aOSEvent, mouseActivateEvent, NS_MOUSE_ACTIVATE); widgetHit->DispatchMouseEvent(mouseActivateEvent); //if( mouseActivateEvent.acceptActivation ) - //gEventDispatchHandler.SetFocus(widgetHit); + gEventDispatchHandler.SetFocus(widgetHit); //gEventDispatchHandler.Special(widgetHit); } @@ -1457,6 +1462,9 @@ nsresult nsMacEventHandler::HandleUpdateInputArea(char* text,Size text_size, Scr OSErr err; ByteCount source_read; nsresult res = NS_OK; + long committedLen = 0; + PRUnichar* ubuf; + //==================================================================================================== // 0. Create Unicode Converter //==================================================================================================== @@ -1496,7 +1504,7 @@ nsresult nsMacEventHandler::HandleUpdateInputArea(char* text,Size text_size, Scr } // Prepare buffer.... mIMECompositionStr->SetCapacity(text_size+1); - PRUnichar* ubuf = (PRUnichar*)mIMECompositionStr->GetUnicode(); + ubuf = (PRUnichar*)mIMECompositionStr->GetUnicode(); size_t len; //==================================================================================================== @@ -1505,7 +1513,7 @@ nsresult nsMacEventHandler::HandleUpdateInputArea(char* text,Size text_size, Scr //==================================================================================================== // 1. Handle the committed text //==================================================================================================== - long committedLen = (fixedLength == -1) ? text_size : fixedLength; + committedLen = (fixedLength == -1) ? text_size : fixedLength; if(0 != committedLen) { #ifdef DEBUG_TSM diff --git a/widget/src/mac/nsMacMessagePump.cpp b/widget/src/mac/nsMacMessagePump.cpp index 9fe42a068ca2..20e7156cb7a9 100644 --- a/widget/src/mac/nsMacMessagePump.cpp +++ b/widget/src/mac/nsMacMessagePump.cpp @@ -56,7 +56,7 @@ #include #include #include - +#include #include "nsCarbonHelpers.h" #ifndef topLeft @@ -68,9 +68,11 @@ #endif #if DEBUG +#if !TARGET_CARBON #include #include "macstdlibextras.h" #endif +#endif #define DRAW_ON_RESIZE 0 // if 1, enable live-resize except when the command key is down @@ -255,11 +257,12 @@ PRBool nsMacMessagePump::GetEvent(EventRecord &theEvent) ::LMSetSysEvtMask(eventMask); // we need keyUp events PRBool haveEvent = ::WaitNextEvent(eventMask, &theEvent, sleep, mMouseRgn) ? PR_TRUE : PR_FALSE; +#if !TARGET_CARBON if (haveEvent && TSMEvent(&theEvent) ) { haveEvent = PR_FALSE; } - +#endif if (mMouseRgn) { Point globalMouse = theEvent.where; @@ -280,8 +283,10 @@ void nsMacMessagePump::DispatchEvent(PRBool aRealEvent, EventRecord *anEvent) { #if DEBUG +#if !TARGET_CARBON if (SIOUXHandleOneEvent(anEvent)) return; +#endif #endif switch(anEvent->what) @@ -313,6 +318,7 @@ void nsMacMessagePump::DispatchEvent(PRBool aRealEvent, EventRecord *anEvent) break; case osEvt: + { unsigned char eventType = ((anEvent->message >> 24) & 0x00ff); switch (eventType) { @@ -328,6 +334,7 @@ void nsMacMessagePump::DispatchEvent(PRBool aRealEvent, EventRecord *anEvent) DoMouseMove(*anEvent); break; } + } break; case kHighLevelEvent: @@ -481,10 +488,12 @@ void nsMacMessagePump::DoMouseDown(EventRecord &anEvent) Boolean haveEvent; EventRecord updateEvent; haveEvent = ::WaitNextEvent(updateMask, &updateEvent, 0, nil); +#if !TARGET_CARBON if (haveEvent && TSMEvent(&updateEvent)) { haveEvent = PR_FALSE; } +#endif if (haveEvent) DoUpdate(updateEvent); } @@ -712,7 +721,9 @@ extern const PRInt16 kAppleMenuID; // Danger Will Robinson!!! - this currently r ::GetMenuItemText(::GetMenuHandle(kAppleMenuID), theItem, daName); ::GetPort(&savePort); +#if !TARGET_CARBON ::OpenDeskAcc(daName); +#endif ::SetPort(savePort); } } diff --git a/widget/src/mac/nsMacMessageSink.h b/widget/src/mac/nsMacMessageSink.h index d41d4bbf9920..e9b0ad19f24e 100644 --- a/widget/src/mac/nsMacMessageSink.h +++ b/widget/src/mac/nsMacMessageSink.h @@ -27,6 +27,9 @@ #include +#include +#include + class nsMacWindow; /*================================================ diff --git a/widget/src/mac/nsMacResources.cpp b/widget/src/mac/nsMacResources.cpp index c30765c0eef5..18ca1e60c948 100644 --- a/widget/src/mac/nsMacResources.cpp +++ b/widget/src/mac/nsMacResources.cpp @@ -27,14 +27,13 @@ short nsMacResources::mRefNum = kResFileNotOpened; short nsMacResources::mSaveResFile = 0; - +#if !TARGET_CARBON pascal OSErr __NSInitialize(const CFragInitBlock *theInitBlock); pascal OSErr __initializeResources(const CFragInitBlock *theInitBlock); pascal void __NSTerminate(void); pascal void __terminateResources(void); - //---------------------------------------------------------------------------------------- // //---------------------------------------------------------------------------------------- @@ -64,6 +63,7 @@ pascal void __terminateResources(void) __NSTerminate(); } +#endif //---------------------------------------------------------------------------------------- // diff --git a/widget/src/mac/nsMacTSMMessagePump.cpp b/widget/src/mac/nsMacTSMMessagePump.cpp index 6c92427395fb..71f24bef5e7e 100644 --- a/widget/src/mac/nsMacTSMMessagePump.cpp +++ b/widget/src/mac/nsMacTSMMessagePump.cpp @@ -220,7 +220,9 @@ pascal OSErr nsMacTSMMessagePump::UpdateHandler(const AppleEvent *theAppleEvent, long fixLength; nsresult res; TextRangeArray* hiliteRangePtr; - + +#if !TARGET_CARBON + // // refcon stores the nsMacEventHandler // @@ -307,6 +309,6 @@ pascal OSErr nsMacTSMMessagePump::UpdateHandler(const AppleEvent *theAppleEvent, (void)AEDisposeDesc(&text); (void)AEDisposeDesc(&hiliteRangeArray); - +#endif return noErr; } diff --git a/widget/src/mac/nsMacWindow.cpp b/widget/src/mac/nsMacWindow.cpp index e46c4f872f1a..1ba9bc0f883b 100644 --- a/widget/src/mac/nsMacWindow.cpp +++ b/widget/src/mac/nsMacWindow.cpp @@ -34,6 +34,7 @@ #include "nsGUIEvent.h" #include "nsCarbonHelpers.h" +#include // Define Class IDs -- i hate having to do this static NS_DEFINE_CID(kCDragServiceCID, NS_DRAGSERVICE_CID); @@ -61,9 +62,10 @@ const short kWindowMarginWidth = 6; const short kDialogTitleBarHeight = 26; const short kDialogMarginWidth = 6; - +#if !TARGET_CARBON DragTrackingHandlerUPP nsMacWindow::sDragTrackingHandlerUPP = NewDragTrackingHandlerProc(DragTrackingHandler); DragReceiveHandlerUPP nsMacWindow::sDragReceiveHandlerUPP = NewDragReceiveHandlerProc(DragReceiveHandler); +#endif void SetDragActionBasedOnModifiers ( nsIDragService* inDragService, short inModifiers ) ; @@ -264,7 +266,8 @@ nsMacWindow::nsMacWindow() : Inherited() , mMacEventHandler(nsnull) , mAcceptsActivation(PR_TRUE) { - mMacEventHandler.reset(new nsMacEventHandler(this)); + //mMacEventHandler.reset(new nsMacEventHandler(this)); + mMacEventHandler = (auto_ptr) new nsMacEventHandler(this); gInstanceClassName = "nsMacWindow"; } @@ -282,9 +285,10 @@ nsMacWindow::~nsMacWindow() ::DisposeWindow(mWindowPtr); // clean up DragManager stuff +#if !TARGET_CARBON ::RemoveTrackingHandler ( sDragTrackingHandlerUPP, mWindowPtr ); ::RemoveReceiveHandler ( sDragReceiveHandlerUPP, mWindowPtr ); - +#endif nsMacMessageSink::RemoveRaptorWindowFromList(mWindowPtr); mWindowPtr = nsnull; } @@ -410,11 +414,12 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent, wRect.right --; wRect.bottom --; #endif + if (eWindowType_popup != mWindowType) ::OffsetRect(&wRect, hOffset, vOffset + ::GetMBarHeight()); else ::OffsetRect(&wRect, hOffset, vOffset); - + // HACK!!!!! This really should be part of the window manager // Make sure window bottom of window doesn't exceed max monitor size Rect tempRect; @@ -425,7 +430,6 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent, bottomPinDelta = wRect.bottom - tempRect.bottom; wRect.bottom -= bottomPinDelta; } - mWindowPtr = ::NewCWindow(nil, &wRect, "\p", false, wDefProcID, (WindowRef)-1, goAwayFlag, (long)nsnull); mWindowMadeHere = PR_TRUE; } @@ -458,6 +462,7 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent, // register tracking and receive handlers with the native Drag Manager +#if !TARGET_CARBON if ( sDragTrackingHandlerUPP ) { OSErr result = ::InstallTrackingHandler ( sDragTrackingHandlerUPP, mWindowPtr, this ); NS_ASSERTION ( result == noErr, "can't install drag tracking handler"); @@ -466,7 +471,7 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent, OSErr result = ::InstallReceiveHandler ( sDragReceiveHandlerUPP, mWindowPtr, this ); NS_ASSERTION ( result == noErr, "can't install drag receive handler"); } - +#endif return NS_OK; } @@ -588,6 +593,7 @@ NS_IMETHODIMP nsMacWindow::Move(PRInt32 aX, PRInt32 aY) Rect portBounds; ::GetWindowPortBounds(mWindowPtr, &portBounds); short windowWidth = portBounds.right - portBounds.left; + if (aX <= screenRect.left - windowWidth) aX = screenRect.left; else if (aX >= screenWidth) diff --git a/widget/src/mac/nsMenu.cpp b/widget/src/mac/nsMenu.cpp index f16879c9ae8b..139006ac298c 100644 --- a/widget/src/mac/nsMenu.cpp +++ b/widget/src/mac/nsMenu.cpp @@ -213,6 +213,7 @@ NS_METHOD nsMenu::SetLabel(const nsString &aText) //mMacMenuHandle = NSStringNewChildMenu(mMacMenuID, mLabel); mMacMenuHandle = ::GetMenuHandle(mMacMenuID); } else { +#if !TARGET_CARBON // Look at the label and figure out if it is the "Help" menu if(mDOMElement) { @@ -223,7 +224,7 @@ NS_METHOD nsMenu::SetLabel(const nsString &aText) ::HMGetHelpMenuHandle(&mMacMenuHandle); mMacMenuID = kHMHelpMenuID; - int numHelpItems = ::CountMItems(mMacMenuHandle); + int numHelpItems = ::CountMenuItems(mMacMenuHandle); if ( mHelpMenuOSItemsCount == 0) mHelpMenuOSItemsCount = numHelpItems; for(int i=0; iGetChecked(&isChecked); if(isChecked) - ::CheckItem(mMacMenuHandle, currItemIndex, true); + ::CheckMenuItem(mMacMenuHandle, currItemIndex, true); else - ::CheckItem(mMacMenuHandle, currItemIndex, false); + ::CheckMenuItem(mMacMenuHandle, currItemIndex, false); } } return NS_OK; @@ -431,10 +434,12 @@ NS_METHOD nsMenu::RemoveItem(const PRUint32 aPos) NS_METHOD nsMenu::RemoveAll() { #ifdef notdef +#if !TARGET_CARBON MenuHandle helpmh; ::HMGetHelpMenuHandle(&helpmh); if ( helpmh != mMacMenuHandle) helpmh = nsnull; +#endif #endif while(mMenuItemVoidArray.Count()) @@ -551,11 +556,14 @@ nsEventStatus nsMenu::MenuItemSelected(const nsMenuEvent & aMenuEvent) return nsEventStatus_eIgnore; } } - + /* set up a default event to query with */ nsMenuEvent event; MenuHandle handle; +#if !TARGET_CARBON + // XXX fix me for carbon! ::HMGetHelpMenuHandle(&handle); +#endif event.mCommand = (unsigned int) handle; /* loop through the top-level menus in the menubar */ @@ -794,7 +802,7 @@ nsEventStatus nsMenu::HelpMenuConstruct( //printf("nsMenu::MenuConstruct called for %s = %d \n", mLabel.ToNewCString(), mMacMenuHandle); // Begin menuitem inner loop - int numHelpItems = ::CountMItems(mMacMenuHandle); + int numHelpItems = ::CountMenuItems(mMacMenuHandle); for(int i=0; i openAtom = NS_NewAtom("open"); - if(aAttribute != openAtom) { + if(aAttribute != openAtom.get()) { nsCOMPtr element(do_QueryInterface(mDOMNode)); if(!element) { @@ -1437,10 +1445,10 @@ nsMenu::AttributeChanged( return NS_OK; } - if(aContent == contentNode){ + if(aContent == contentNode.get()){ nsCOMPtr disabledAtom = NS_NewAtom("disabled"); nsCOMPtr valueAtom = NS_NewAtom("value"); - if(aAttribute == disabledAtom) { + if(aAttribute == disabledAtom.get()) { nsCOMPtr element(do_QueryInterface(aContent)); nsString valueString; element->GetAttribute("disabled", valueString); @@ -1450,7 +1458,7 @@ nsMenu::AttributeChanged( SetEnabled(PR_TRUE); ::DrawMenuBar(); - } else if(aAttribute == valueAtom) { + } else if(aAttribute == valueAtom.get()) { nsCOMPtr element(do_QueryInterface(aContent)); element->GetAttribute("value", mLabel); ::DeleteMenu(mMacMenuID); @@ -1458,6 +1466,7 @@ nsMenu::AttributeChanged( mMacMenuHandle = NSStringNewMenu(mMacMenuID, mLabel); // Replace standard MDEF with our stub MDEF +#if !TARGET_CARBON if(mMacMenuHandle) { SInt8 state = ::HGetState((Handle)mMacMenuHandle); ::HLock((Handle)mMacMenuHandle); @@ -1470,6 +1479,7 @@ nsMenu::AttributeChanged( mMenuBarParent->SetNativeData(::GetMenuBar()); ::DrawMenuBar(); } +#endif } } @@ -1733,4 +1743,4 @@ MenuHelpers :: WebShellToPresContext ( nsIWebShell* inWebShell, nsIPresContext** return retval; -} // WebShellToPresContext \ No newline at end of file +} // WebShellToPresContext diff --git a/widget/src/mac/nsMenuBar.cpp b/widget/src/mac/nsMenuBar.cpp index 1561a7fca3dc..ea3ae74c0327 100644 --- a/widget/src/mac/nsMenuBar.cpp +++ b/widget/src/mac/nsMenuBar.cpp @@ -58,7 +58,9 @@ MenuHandle gLevel3HierMenu = nsnull; MenuHandle gLevel4HierMenu = nsnull; MenuHandle gLevel5HierMenu = nsnull; +#if !TARGET_CARBON extern nsVoidArray gPreviousMenuStack; +#endif extern PRInt16 gCurrentMenuDepth; // #if APPLE_MENU_HACK @@ -95,7 +97,7 @@ nsEventStatus nsMenuBar::MenuItemSelected(const nsMenuEvent & aMenuEvent) for (int i = mMenuVoidArray.Count(); i > 0; --i) { nsIMenuListener * menuListener = nsnull; - ((nsISupports*)mMenuVoidArray[i-1])->QueryInterface(NS_GET_IID(nsIMenuListener), &menuListener); + ((nsISupports*)mMenuVoidArray[i-1])->QueryInterface(NS_GET_IID(nsIMenuListener), (void**)&menuListener); if(menuListener){ eventStatus = menuListener->MenuItemSelected(aMenuEvent); NS_RELEASE(menuListener); @@ -113,11 +115,12 @@ nsEventStatus nsMenuBar::MenuSelected(const nsMenuEvent & aMenuEvent) nsEventStatus eventStatus = nsEventStatus_eIgnore; nsIMenuListener * menuListener = nsnull; - //((nsISupports*)mMenuVoidArray[i-1])->QueryInterface(NS_GET_IID(nsIMenuListener), &menuListener); + //((nsISupports*)mMenuVoidArray[i-1])->QueryInterface(NS_GET_IID(nsIMenuListener), (void**)&menuListener); //printf("gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count()); +#if !TARGET_CARBON if (gPreviousMenuStack[gPreviousMenuStack.Count() - 1]) - ((nsIMenu*)gPreviousMenuStack[gPreviousMenuStack.Count() - 1])->QueryInterface(NS_GET_IID(nsIMenuListener), &menuListener); - + ((nsIMenu*)gPreviousMenuStack[gPreviousMenuStack.Count() - 1])->QueryInterface(NS_GET_IID(nsIMenuListener), (void**)&menuListener); +#endif if (menuListener) { //TODO: MenuSelected is the right thing to call... //eventStatus = menuListener->MenuSelected(aMenuEvent); @@ -129,7 +132,7 @@ nsEventStatus nsMenuBar::MenuSelected(const nsMenuEvent & aMenuEvent) // If it's the help menu, gPreviousMenuStack won't be accurate so we need to get the listener a different way // We'll do it the old fashioned way of looping through and finding it for (int i = mMenuVoidArray.Count(); i > 0; --i) { - ((nsISupports*)mMenuVoidArray[i-1])->QueryInterface(NS_GET_IID(nsIMenuListener), &menuListener); + ((nsISupports*)mMenuVoidArray[i-1])->QueryInterface(NS_GET_IID(nsIMenuListener), (void**)&menuListener); if (menuListener) { //TODO: MenuSelected is the right thing to call... //eventStatus = menuListener->MenuSelected(aMenuEvent); @@ -170,6 +173,7 @@ nsEventStatus nsMenuBar::MenuConstruct( MenuHandle macMenuHandle = ::NewMenu(2, "\psubmenu"); if(macMenuHandle) { gLevel2HierMenu = macMenuHandle; +#if !TARGET_CARBON SInt8 state = ::HGetState((Handle)macMenuHandle); ::HLock((Handle)macMenuHandle); gSystemMDEFHandle = (**macMenuHandle).menuProc; @@ -177,12 +181,14 @@ nsEventStatus nsMenuBar::MenuConstruct( (**macMenuHandle).menuWidth = -1; (**macMenuHandle).menuHeight = -1; ::HSetState((Handle)macMenuHandle, state); +#endif ::InsertMenu(macMenuHandle, hierMenu); } macMenuHandle = ::NewMenu(3, "\psubmenu"); if(macMenuHandle) { gLevel3HierMenu = macMenuHandle; +#if !TARGET_CARBON SInt8 state = ::HGetState((Handle)macMenuHandle); ::HLock((Handle)macMenuHandle); gSystemMDEFHandle = (**macMenuHandle).menuProc; @@ -190,12 +196,14 @@ nsEventStatus nsMenuBar::MenuConstruct( (**macMenuHandle).menuWidth = -1; (**macMenuHandle).menuHeight = -1; ::HSetState((Handle)macMenuHandle, state); +#endif ::InsertMenu(macMenuHandle, hierMenu); } macMenuHandle = ::NewMenu(4, "\psubmenu"); if(macMenuHandle) { gLevel4HierMenu = macMenuHandle; +#if !TARGET_CARBON SInt8 state = ::HGetState((Handle)macMenuHandle); ::HLock((Handle)macMenuHandle); gSystemMDEFHandle = (**macMenuHandle).menuProc; @@ -203,12 +211,14 @@ nsEventStatus nsMenuBar::MenuConstruct( (**macMenuHandle).menuWidth = -1; (**macMenuHandle).menuHeight = -1; ::HSetState((Handle)macMenuHandle, state); +#endif ::InsertMenu(macMenuHandle, hierMenu); } macMenuHandle = ::NewMenu(5, "\psubmenu"); if(macMenuHandle) { gLevel5HierMenu = macMenuHandle; +#if !TARGET_CARBON SInt8 state = ::HGetState((Handle)macMenuHandle); ::HLock((Handle)macMenuHandle); gSystemMDEFHandle = (**macMenuHandle).menuProc; @@ -216,6 +226,7 @@ nsEventStatus nsMenuBar::MenuConstruct( (**macMenuHandle).menuWidth = -1; (**macMenuHandle).menuHeight = -1; ::HSetState((Handle)macMenuHandle, state); +#endif ::InsertMenu(macMenuHandle, hierMenu); } } else { @@ -281,7 +292,9 @@ nsEventStatus nsMenuBar::MenuConstruct( if(menuIDstring == "menu_Help") { nsMenuEvent event; MenuHandle handle; +#ifndef RHAPSODY ::HMGetHelpMenuHandle(&handle); +#endif event.mCommand = (unsigned int) handle; nsCOMPtr listener(do_QueryInterface(pnsMenu)); listener->MenuSelected(event); @@ -333,8 +346,9 @@ nsEventStatus nsMenuBar::MenuDestruct(const nsMenuEvent & aMenuEvent) nsMenuBar::nsMenuBar() : nsIMenuBar(), nsIMenuListener() { gCurrentMenuDepth = 1; +#if !TARGET_CARBON nsPreviousMenuStackUnwind(nsnull, nsnull); - +#endif NS_INIT_REFCNT(); mNumMenus = 0; mParent = nsnull; @@ -342,9 +356,11 @@ nsMenuBar::nsMenuBar() : nsIMenuBar(), nsIMenuListener() mWebShell = nsnull; mDOMNode = nsnull; +#if !TARGET_CARBON MenuDefUPP mdef = NewMenuDefProc( nsDynamicMDEFMain ); InstallDefProc((short)nsMacResources::GetLocalResourceFile(), (ResType)'MDEF', (short)128, (Ptr) mdef ); - +#endif + mOriginalMacMBarHandle = nsnull; mMacMBarHandle = nsnull; @@ -433,7 +449,7 @@ NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu) #endif MenuHandle menuHandle = nsnull; - aMenu->GetNativeData(&menuHandle); + aMenu->GetNativeData((void**)&menuHandle); mNumMenus++; PRBool helpMenu; @@ -512,9 +528,10 @@ NS_METHOD nsMenuBar::Paint() ((nsIMenu*)mMenuVoidArray[i])->IsHelpMenu(&isHelpMenu); if(isHelpMenu){ MenuHandle helpMenuHandle; +#if !TARGET_CARBON ::HMGetHelpMenuHandle(&helpMenuHandle); ((nsIMenu*)mMenuVoidArray[i])->SetNativeData((void*)helpMenuHandle); - +#endif nsMenuEvent event; event.mCommand = (unsigned int) helpMenuHandle; nsCOMPtr listener(do_QueryInterface((nsIMenu*)mMenuVoidArray[i])); diff --git a/widget/src/mac/nsMenuBar.h b/widget/src/mac/nsMenuBar.h index a2d7980019c8..b7b1ed0c42ee 100644 --- a/widget/src/mac/nsMenuBar.h +++ b/widget/src/mac/nsMenuBar.h @@ -27,6 +27,8 @@ #include "nsIMenuListener.h" #include "nsVoidArray.h" +#include "Types.h" + extern nsIMenuBar * gMacMenubar; class nsIWidget; diff --git a/widget/src/mac/nsMenuItem.cpp b/widget/src/mac/nsMenuItem.cpp index 2594667af9f5..a269bcf9c589 100644 --- a/widget/src/mac/nsMenuItem.cpp +++ b/widget/src/mac/nsMenuItem.cpp @@ -250,7 +250,7 @@ nsEventStatus nsMenuItem::MenuItemSelected(const nsMenuEvent & aMenuEvent) parent->GetFirstChild(getter_AddRefs(currSibling)); while ( currSibling ) { // skip this node - if ( currSibling != mDOMNode ) { + if ( currSibling.get() != mDOMNode ) { nsCOMPtr currElement = do_QueryInterface(currSibling); if ( !currElement ) break; @@ -427,4 +427,4 @@ NS_METHOD nsMenuItem::GetShortcutChar(nsString &aText) nsresult res = NS_OK; aText = mKeyEquivalent; return res; -} \ No newline at end of file +} diff --git a/widget/src/mac/nsMimeMapper.h b/widget/src/mac/nsMimeMapper.h index aefd5ab99e8a..571b57c05eca 100644 --- a/widget/src/mac/nsMimeMapper.h +++ b/widget/src/mac/nsMimeMapper.h @@ -51,6 +51,7 @@ #define nsMimeMapper_h__ #include +#include #include "nsString.h" diff --git a/widget/src/mac/nsSound.cpp b/widget/src/mac/nsSound.cpp index 971d8e9366bd..4333e9931124 100644 --- a/widget/src/mac/nsSound.cpp +++ b/widget/src/mac/nsSound.cpp @@ -76,6 +76,7 @@ NS_METHOD nsSound::Beep() // this currently does no cacheing of the sound buffer. It should NS_METHOD nsSound::Play(nsIURI *aURI) { +#if !TARGET_CARBON nsresult rv; nsCOMPtr inputStream; @@ -127,11 +128,13 @@ NS_METHOD nsSound::Play(nsIURI *aURI) rv = PlaySound(dataHandle, writeOffset); ::DisposeHandle(dataHandle); +#endif return NS_OK; } nsresult nsSound::PlaySound(Handle waveDataHandle, long waveDataSize) { +#if !TARGET_CARBON Handle dataRef = nil; Movie movie = nil; MovieImportComponent miComponent = nil; @@ -194,4 +197,7 @@ bail: // gasp, a goto label ::DisposeMovie(movie); return (err == noErr) ? NS_OK : NS_ERROR_FAILURE; +#else + return NS_OK; +#endif } diff --git a/widget/src/mac/nsTextAreaWidget.h b/widget/src/mac/nsTextAreaWidget.h index a58f0e6c3d59..96cda0cd337a 100644 --- a/widget/src/mac/nsTextAreaWidget.h +++ b/widget/src/mac/nsTextAreaWidget.h @@ -25,7 +25,9 @@ #include "nsWindow.h" #include "nsITextAreaWidget.h" +#ifndef RHAPSODY #include "WASTE.h" +#endif #include "nsRepeater.h" /** diff --git a/widget/src/mac/nsTextWidget.cpp b/widget/src/mac/nsTextWidget.cpp index cc0c5e39e5b0..9f0719e5435c 100644 --- a/widget/src/mac/nsTextWidget.cpp +++ b/widget/src/mac/nsTextWidget.cpp @@ -155,6 +155,8 @@ PRBool nsTextWidget::DispatchMouseEvent(nsMouseEvent &aEvent) { PRBool eventHandled = nsWindow::DispatchMouseEvent(aEvent); // we don't want the 'Inherited' nsMacControl behavior + EventRecord* theOSEvent; + if ((! eventHandled) && (mControl != nsnull)) { switch (aEvent.message) @@ -166,7 +168,7 @@ PRBool nsTextWidget::DispatchMouseEvent(nsMouseEvent &aEvent) thePoint.v = aEvent.point.y; short theModifiers; - EventRecord* theOSEvent = (EventRecord*)aEvent.nativeMsg; + theOSEvent = (EventRecord*)aEvent.nativeMsg; if (theOSEvent) { theModifiers = theOSEvent->modifiers; @@ -287,9 +289,15 @@ PRBool nsTextWidget::DispatchWindowEvent(nsGUIEvent &aEvent) selection.ToCString(cRepOfSelection.get(), selectionLen + 1); // copy it to the scrapMgr +#if TARGET_CARBON + ::ClearCurrentScrap(); + ScrapRef scrap; + ::GetCurrentScrap(&scrap); + ::PutScrapFlavor(scrap, 'TEXT', 0L /* ??? */, selectionLen, cRepOfSelection.get()); +#else ::ZeroScrap(); ::PutScrap ( selectionLen, 'TEXT', cRepOfSelection.get() ); - +#endif // if we're cutting, remove the text from the widget if ( menuItem == cmd_Cut ) { unused = 0; @@ -305,9 +313,20 @@ PRBool nsTextWidget::DispatchWindowEvent(nsGUIEvent &aEvent) case cmd_Paste: { long scrapOffset; - Handle scrapH = ::NewHandle(0); + Handle scrapH = ::NewHandle(0); +#if TARGET_CARBON + ScrapRef scrap; + OSStatus err; + err = ::GetCurrentScrap(&scrap); + if (err != noErr) return NS_ERROR_FAILURE; + err = ::GetScrapFlavorSize(scrap, 'TEXT', &scrapOffset); + // XXX uhh.. i don't think this is right.. + long scrapLen = scrapOffset; + if ( scrapOffset > 0 ) +#else long scrapLen = ::GetScrap(scrapH, 'TEXT', &scrapOffset); if (scrapLen > 0) +#endif { ::HLock(scrapH); diff --git a/widget/src/mac/nsToolkit.cpp b/widget/src/mac/nsToolkit.cpp index 31e3dc1f2d26..92134e83253d 100644 --- a/widget/src/mac/nsToolkit.cpp +++ b/widget/src/mac/nsToolkit.cpp @@ -105,7 +105,7 @@ void nsMacNSPREventQueueHandler::RepeatAction(const EventRecord& inMacEvent) #pragma mark - -NS_IMPL_ISUPPORTS1(nsToolkit, nsIToolkit); +NS_IMPL_THREADSAFE_ISUPPORTS1(nsToolkit, nsIToolkit); //------------------------------------------------------------------------- // diff --git a/widget/src/mac/nsWindow.cpp b/widget/src/mac/nsWindow.cpp index 012459df77e1..42e71e0d078d 100644 --- a/widget/src/mac/nsWindow.cpp +++ b/widget/src/mac/nsWindow.cpp @@ -65,6 +65,11 @@ static Boolean gNotificationInstalled = false; // #define PAINT_DEBUGGING // #define BLINK_DEBUGGING +#if TARGET_CARBON +#undef PAINT_DEBUGGING +#undef BLINK_DEBUGGING +#endif + #ifdef BLINK_DEBUGGING static void blinkRect(Rect* r); static void blinkRgn(RgnHandle rgn); @@ -1077,9 +1082,13 @@ NS_IMETHODIMP nsWindow::Update() static Boolean control_key_down() { +#if TARGET_CARBON + return PR_FALSE; +#else EventRecord event; ::OSEventAvail(0, &event); return (event.modifiers & controlKey) != 0; +#endif } static long long microseconds() @@ -1286,7 +1295,23 @@ nsWindow :: ScrollBits ( Rect & inRectToScroll, PRInt32 inLeftDelta, PRInt32 inT if ( !updateRgn ) return; ::RectRgn(updateRgn, &frame); ::DiffRgn (updateRgn, destRgn, updateRgn); - + +#if TARGET_CARBON + RgnHandle visRgn = ::NewRgn(); + ::GetPortVisibleRegion(::GetWindowPort(mWindowPtr), visRgn); + if (::EmptyRgn(visRgn)) + { + PixMapHandle portPixH = ::GetPortPixMap(::GetWindowPort(mWindowPtr)); + ::HLock((Handle) portPixH); + ::CopyBits ( *((BitMapHandle) portPixH), + *((BitMapHandle) portPixH), + &source, + &dest, + srcCopy, + nil); + ::HUnlock((Handle) portPixH); + } +#else if(::EmptyRgn(mWindowPtr->visRgn)) { ::CopyBits ( @@ -1297,12 +1322,18 @@ nsWindow :: ScrollBits ( Rect & inRectToScroll, PRInt32 inLeftDelta, PRInt32 inT srcCopy, nil); } +#endif else { // compute the non-visable region StRegionFromPool nonVisableRgn; if ( !nonVisableRgn ) return; - ::DiffRgn ( totalVisRgn, mWindowPtr->visRgn, nonVisableRgn ); + +#if TARGET_CARBON + ::DiffRgn ( totalVisRgn, visRgn, nonVisableRgn ); +#else + ::DiffRgn ( totalVisRgn, mWindowPtr->visRgn, nonVisableRgn ); +#endif // compute the extra area that may need to be updated // scoll the non-visable region to determine what needs updating @@ -1319,7 +1350,17 @@ nsWindow :: ScrollBits ( Rect & inRectToScroll, PRInt32 inLeftDelta, PRInt32 inT ::RGBForeColor(&black); ::RGBBackColor(&white); ::PenNormal(); - +#if TARGET_CARBON + PixMapHandle portPixH = ::GetPortPixMap(::GetWindowPort(mWindowPtr)); + ::HLock((Handle) portPixH); + ::CopyBits ( *((BitMapHandle) portPixH), + *((BitMapHandle) portPixH), + &source, + &dest, + srcCopy, + copyMaskRgn); + ::HUnlock((Handle) portPixH); +#else ::CopyBits ( &mWindowPtr->portBits, &mWindowPtr->portBits, @@ -1327,11 +1368,15 @@ nsWindow :: ScrollBits ( Rect & inRectToScroll, PRInt32 inLeftDelta, PRInt32 inT &dest, srcCopy, copyMaskRgn); - +#endif + // union the update regions together and invalidate them ::UnionRgn(nonVisableRgn, updateRgn, updateRgn); } +#if TARGET_CARBON + ::DisposeRgn(visRgn); +#endif ::InvalWindowRgn(mWindowPtr, updateRgn); } @@ -1345,16 +1390,18 @@ NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) { if (! mVisible) return NS_OK; - + + nsRect scrollRect; + // If the clipping region is non-rectangular, just force a full update, sorry. - if (IsRegionComplex(mWindowRegion)) { + // XXX ? + if (!IsRegionRectangular(mWindowRegion)) { Invalidate(PR_TRUE); goto scrollChildren; } //-------- // Scroll this widget - nsRect scrollRect; if (aClipRect) scrollRect = *aClipRect; else diff --git a/widget/src/mac/nsWindow.h b/widget/src/mac/nsWindow.h index ef06f81cb6f3..9c06a7e85298 100644 --- a/widget/src/mac/nsWindow.h +++ b/widget/src/mac/nsWindow.h @@ -36,6 +36,8 @@ #include "nsIMenuBar.h" +#include "nsplugindefs.h" +#include #define NSRGB_2_COLOREF(color) \ RGB(NS_GET_R(color),NS_GET_G(color),NS_GET_B(color)) diff --git a/widget/timer/src/Makefile.in b/widget/timer/src/Makefile.in index 7c0bc71c6598..cca19c0b31bc 100644 --- a/widget/timer/src/Makefile.in +++ b/widget/timer/src/Makefile.in @@ -26,7 +26,7 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -ifneq (,$(filter beos os2 rhapsody,$(MOZ_WIDGET_TOOLKIT))) +ifneq (,$(filter beos os2 mac,$(MOZ_WIDGET_TOOLKIT))) DIRS = $(MOZ_WIDGET_TOOLKIT) else DIRS = unix @@ -34,3 +34,4 @@ endif include $(topsrcdir)/config/rules.mk + diff --git a/widget/timer/src/mac/.cvsignore b/widget/timer/src/mac/.cvsignore new file mode 100644 index 000000000000..f3c7a7c5da68 --- /dev/null +++ b/widget/timer/src/mac/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/widget/timer/src/mac/Makefile.in b/widget/timer/src/mac/Makefile.in new file mode 100644 index 000000000000..c617d0de1aaf --- /dev/null +++ b/widget/timer/src/mac/Makefile.in @@ -0,0 +1,43 @@ +# +# The contents of this file are subject to the Netscape Public License +# Version 1.1 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. +# + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +MODULE = timer +LIBRARY_NAME = timer_mac + +REQUIRES = xpcom + +EXPORTS = $(srcdir)/../unix/nsUnixTimerCIID.h + +CPPSRCS = nsTimer.cpp $(topsrcdir)/gfx/src/mac/nsRepeater.cpp + +include $(topsrcdir)/config/rules.mk + +DEFINES += -D_IMPL_NS_TIMER +EXTRA_DSO_LDOPTS+= \ + $(SHARED_LIBRARY_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ + $(TK_LIBS) \ + $(NULL) + +INCLUDES += $(TK_CFLAGS) -I../../../public diff --git a/widget/timer/src/unix/Makefile.in b/widget/timer/src/unix/Makefile.in index bb0124aaf084..ee9376a2ac5b 100644 --- a/widget/timer/src/unix/Makefile.in +++ b/widget/timer/src/unix/Makefile.in @@ -58,6 +58,7 @@ ifdef MOZ_ENABLE_PHOTON DIRS += photon endif + override NO_SHARED_LIB=1 override NO_STATIC_LIB= diff --git a/xpcom/build/Makefile.in b/xpcom/build/Makefile.in index c160484a5783..52395cf6d347 100644 --- a/xpcom/build/Makefile.in +++ b/xpcom/build/Makefile.in @@ -29,8 +29,6 @@ include $(DEPTH)/config/autoconf.mk MODULE = xpcom LIBRARY_NAME = xpcom -REQUIRES = xpcom - CPPSRCS = nsXPComInit.cpp SHARED_LIBRARY_LIBS = \ diff --git a/xpcom/components/nsNativeComponentLoader.cpp b/xpcom/components/nsNativeComponentLoader.cpp index 826592c307e8..ea0751960628 100644 --- a/xpcom/components/nsNativeComponentLoader.cpp +++ b/xpcom/components/nsNativeComponentLoader.cpp @@ -681,7 +681,6 @@ nsNativeComponentLoader::AutoRegisterComponent(PRInt32 when, PRBool validExtension = PR_FALSE; #ifdef XP_MAC // sdagley dougt fix - // rjc - on Mac, check the file's type code (skip checking the creator code) nsCOMPtr localFileMac = do_QueryInterface(component); diff --git a/xpcom/ds/nsIPersistentProperties.h b/xpcom/ds/nsIPersistentProperties.h index d375de5b0a84..349e53020edf 100644 --- a/xpcom/ds/nsIPersistentProperties.h +++ b/xpcom/ds/nsIPersistentProperties.h @@ -36,9 +36,14 @@ { 0x1a180f60, 0x93b2, 0x11d2, \ { 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9 } } +#define NS_IPERSISTENTPROPERTIES_CID \ +{ 0x2245e573, 0x9464, 0x11d2, \ + { 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9 } } + // {2245E573-9464-11d2-9B8B-00805F8A16D9} -NS_DECLARE_ID(kPersistentPropertiesCID, - 0x2245e573, 0x9464, 0x11d2, 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9); +//NS_DECLARE_ID(kPersistentPropertiesCID, +// 0x2245e573, 0x9464, 0x11d2, 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9); +static NS_DEFINE_CID(kPersistentPropertiesCID, NS_IPERSISTENTPROPERTIES_CID); #define NS_PERSISTENTPROPERTIES_PROGID "component://netscape/persistent-properties" #define NS_PERSISTENTPROPERTIES_CLASSNAME "Persistent Properties" @@ -73,8 +78,12 @@ public: { 0xa4, 0x30, 0x0, 0x60, 0xb0, 0xeb, 0x59, 0x63 } } // {579C0568-0E1B-11d3-A430-0060B0EB5963} -NS_DECLARE_ID(kPropertyElementCID, - 0x579c0568, 0xe1b, 0x11d3, 0xa4, 0x30, 0x0, 0x60, 0xb0, 0xeb, 0x59, 0x63); +//NS_DECLARE_ID(kPropertyElementCID, +// 0x579c0568, 0xe1b, 0x11d3, 0xa4, 0x30, 0x0, 0x60, 0xb0, 0xeb, 0x59, 0x63); +#define NS_IPROPERTYELEMENT_CID \ +{ 0x579c0568, 0xe1b, 0x11d3, \ + { 0xa4, 0x30, 0x0, 0x60, 0xb0, 0xeb, 0x59, 0x63 } } +static NS_DEFINE_CID(kPropertyElementCID, NS_IPROPERTYELEMENT_CID); class nsIPropertyElement : public nsISupports { diff --git a/xpcom/io/nsFileSpec.cpp b/xpcom/io/nsFileSpec.cpp index cabdb94782e1..c4b6a409f9c7 100644 --- a/xpcom/io/nsFileSpec.cpp +++ b/xpcom/io/nsFileSpec.cpp @@ -480,6 +480,9 @@ void nsFileSpecHelpers::MakeAllDirectories(const char* inPath, int mode) #elif defined(XP_MAC) //#include "nsFileSpecMac.cpp" // Macintosh-specific implementations // we include the .cpp file in the project now. +#elif defined(RHAPSODY) +#include "nsFileSpecMac.cpp" // Macintosh-specific implementations +#include "nsFileSpecUnix.cpp" // Unix-specific implementations #elif defined(XP_BEOS) #include "nsFileSpecBeOS.cpp" // BeOS-specific implementations #elif defined(XP_UNIX) diff --git a/xpcom/io/nsFileSpec.h b/xpcom/io/nsFileSpec.h index a8b7d61d16e2..e951429108a5 100644 --- a/xpcom/io/nsFileSpec.h +++ b/xpcom/io/nsFileSpec.h @@ -141,9 +141,11 @@ #endif //=========================== End Compiler-specific macros =============================== -#ifdef XP_MAC +#if defined(XP_MAC) || defined(RHAPSODY) #include -#elif defined(XP_UNIX) || defined (XP_OS2) || defined(XP_BEOS) +#endif +// this can't be elif because rhapsody needs both headers +#if defined(XP_UNIX) || defined (XP_OS2) || defined(XP_BEOS) || defined(RHAPSODY) #if defined(XP_OS2) #define INCL_DOS #define INCL_DOSERRORS @@ -367,7 +369,7 @@ class NS_COM nsFileSpec PRBool IsChildOf(nsFileSpec &possibleParent); -#ifdef XP_MAC +#if defined(XP_MAC) || defined(RHAPSODY) // For Macintosh people, this is meant to be useful in its own right as a C++ version // of the FSSpec struct. nsFileSpec( @@ -563,7 +565,7 @@ class NS_COM nsFileSpec friend class nsFilePath; friend class nsFileURL; friend class nsDirectoryIterator; -#ifdef XP_MAC +#if defined(XP_MAC) || defined(RHAPSODY) FSSpec mSpec; #endif nsSimpleCharString mPath; diff --git a/xpcom/io/nsFileSpecMac.cpp b/xpcom/io/nsFileSpecMac.cpp index aecf4f820921..f37ed71d3fd3 100644 --- a/xpcom/io/nsFileSpecMac.cpp +++ b/xpcom/io/nsFileSpecMac.cpp @@ -29,9 +29,11 @@ #include "prtypes.h" #include "nscore.h" +#ifndef RHAPSODY #include "FullPath.h" #include "FileCopy.h" #include "MoreFilesExtras.h" +#endif #include #include @@ -44,6 +46,7 @@ #include "nsEscape.h" +#ifndef RHAPSODY const unsigned char* kAliasHavenFolderName = "\pnsAliasHaven"; //======================================================================================== @@ -608,18 +611,22 @@ Clean: return result; } // MacFileHelpers::PathNameFromFSSpec +#endif + #pragma mark - //======================================================================================== // Macintosh nsFileSpec implementation //======================================================================================== +#ifndef RHAPSODY //---------------------------------------------------------------------------------------- nsFileSpec::nsFileSpec() //---------------------------------------------------------------------------------------- { Clear(); } +#endif //---------------------------------------------------------------------------------------- nsFileSpec::nsFileSpec(const FSSpec& inSpec, PRBool resolveAlias) @@ -642,6 +649,7 @@ void nsFileSpec::operator = (const FSSpec& inSpec) mError = NS_OK; } +#ifndef RHAPSODY //---------------------------------------------------------------------------------------- nsFileSpec::nsFileSpec(const nsFileSpec& inSpec) //---------------------------------------------------------------------------------------- @@ -1504,3 +1512,4 @@ nsDirectoryIterator& nsDirectoryIterator::operator ++ () return *this; } // nsDirectoryIterator::operator ++ +#endif diff --git a/xpcom/io/nsFileSpecUnix.cpp b/xpcom/io/nsFileSpecUnix.cpp index b9f53d4a3482..138388d3afeb 100644 --- a/xpcom/io/nsFileSpecUnix.cpp +++ b/xpcom/io/nsFileSpecUnix.cpp @@ -51,10 +51,8 @@ #ifdef HAVE_SYS_MOUNT_H #include -#ifdef __bsdi__ #undef Free #endif -#endif #ifdef HAVE_STATVFS #define STATFS statvfs diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in index 619abd07641c..f3b370bda5d5 100644 --- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in +++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in @@ -165,6 +165,11 @@ CPPSRCS := xptcinvoke_ppc_linux.cpp xptcstubs_ppc_linux.cpp ASFILES := xptcinvoke_asm_ppc_linux.s xptcstubs_asm_ppc_linux.s endif +ifeq ($(OS_ARCH),Rhapsody) +CPPSRCS := xptcinvoke_ppc_rhapsody.cpp xptcstubs_ppc_rhapsody.cpp +ASFILES := xptcinvoke_asm_ppc_rhapsody.s xptcstubs_asm_ppc_rhapsody.s +endif + ###################################################################### # SPARC ###################################################################### diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_rhapsody.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_rhapsody.s new file mode 100644 index 000000000000..d98e0a2e3685 --- /dev/null +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_rhapsody.s @@ -0,0 +1,120 @@ + # + # -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + # + # The contents of this file are subject to the Netscape Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/NPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is mozilla.org code. + # + # The Initial Developer of the Original Code is Netscape + # Communications Corporation. Portions created by Netscape are + # Copyright (C) 1999 Netscape Communications Corporation. All + # Rights Reserved. + # + # Contributor(s): + # + +.data + .align 2 +# +# XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, +# PRUint32 paramCount, nsXPTCVariant* params) +# + +.globl __XPTC_InvokeByIndex +__XPTC_InvokeByIndex: + mflr r0 + stw r31,-4(r1) +# +# save off the incoming values in the callers parameter area +# + stw r3,24(r1) + stw r4,28(r1) + stw r5,32(r1) + stw r6,36(r1) + stw r0,8(r1) + stwu r1,-136(r1) + +# set up for and call 'invoke_count_words' to get new stack size +# + mr r3,r5 + mr r4,r6 + + stwu r1,-24(r1) + bl _invoke_count_words + lwz r1,0(r1) +# nop + +# prepare args for 'invoke_copy_to_stack' call +# + lwz r4,168(r1) + lwz r5,172(r1) + mr r6,r1 + slwi r3,r3,2 + addi r3,r3,28 + mr r31,r1 + sub r1,r1,r3 + lwz r3,0(r31) + stw r3,0(r1) + addi r3,r1,28 + +# create "temporary" stack frame for _invoke_copy_to_stack to operate in. + stwu r1,-40(r1) + + bl _invoke_copy_to_stack +# nop + +# remove temporary stack frame. + lwz r1,0(r1) + + + lfd f1,0(r31) + lfd f2,8(r31) + lfd f3,16(r31) + lfd f4,24(r31) + lfd f5,32(r31) + lfd f6,40(r31) + lfd f7,48(r31) + lfd f8,56(r31) + lfd f9,64(r31) + lfd f10,72(r31) + lfd f11,80(r31) + lfd f12,88(r31) + lfd f13,96(r31) + + lwz r3,160(r31) + lwz r4,0(r3) + lwz r5,164(r31) + slwi r5,r5,3 + addi r5,r5,8 + add r12,r5,r4 + lwz r12,4(r12) + + lwz r4,28(r1) + lwz r5,32(r1) + lwz r6,36(r1) + lwz r7,40(r1) + lwz r8,44(r1) + lwz r9,48(r1) + lwz r10,52(r1) + +# bl .__ptr_glue +# nop + + mtlr r12 + blrl + + mr r1,r31 + lwz r0,144(r1) + addi r1,r1,136 + mtlr r0 + lwz r31,-4(r1) + + blr diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp new file mode 100644 index 000000000000..6e103a4e3bc3 --- /dev/null +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp @@ -0,0 +1,130 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + */ + +/* Platform specific code to invoke XPCOM methods on native objects */ + +#include "xptcprivate.h" + +extern "C" uint32 +invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) +{ + PRUint32 result = 0; + /* fprintf(stderr,"invoke_count_words(%d,%p)\n",paramCount, s);*/ + + for(PRUint32 i = 0; i < paramCount; i++, s++) + { + if(s->IsPtrData()) + { + result++; + continue; + } + switch(s->type) + { + case nsXPTType::T_I8 : + case nsXPTType::T_I16 : + case nsXPTType::T_I32 : + result++; + break; + case nsXPTType::T_I64 : + result+=2; + break; + case nsXPTType::T_U8 : + case nsXPTType::T_U16 : + case nsXPTType::T_U32 : + result++; + break; + case nsXPTType::T_U64 : + result+=2; + break; + case nsXPTType::T_FLOAT : + result++; + break; + case nsXPTType::T_DOUBLE : + result+=2; + break; + case nsXPTType::T_BOOL : + case nsXPTType::T_CHAR : + case nsXPTType::T_WCHAR : + result++; + break; + default: + // all the others are plain pointer types + result++; + break; + } + } + return result; +} + +extern "C" void +invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPTCVariant* s, double *fprData) +{ + PRUint32 fpCount = 0; + + /* fprintf(stderr,"invoke_copy_to_stack(%p, %d, %p, %p)\n", d, paramCount, s, fprData);*/ + + for(PRUint32 i = 0; i < paramCount; i++, d++, s++) + { + if(s->IsPtrData()) + { + *((void**)d) = s->ptr; + continue; + } + switch(s->type) + { + case nsXPTType::T_I8 : *((PRInt32*) d) = s->val.i8; break; + case nsXPTType::T_I16 : *((PRInt32*) d) = s->val.i16; break; + case nsXPTType::T_I32 : *((PRInt32*) d) = s->val.i32; break; + case nsXPTType::T_I64 : *((PRInt64*) d) = s->val.i64; d++; break; + case nsXPTType::T_U8 : *((PRUint32*) d) = s->val.u8; break; + case nsXPTType::T_U16 : *((PRUint32*)d) = s->val.u16; break; + case nsXPTType::T_U32 : *((PRUint32*)d) = s->val.u32; break; + case nsXPTType::T_U64 : *((PRUint64*)d) = s->val.u64; d++; break; + case nsXPTType::T_FLOAT : *((float*) d) = s->val.f; + if (fpCount < 13) + fprData[fpCount++] = s->val.f; + break; + case nsXPTType::T_DOUBLE : *((double*) d) = s->val.d; d++; + if (fpCount < 13) + fprData[fpCount++] = s->val.d; + break; + case nsXPTType::T_BOOL : *((PRBool*) d) = s->val.b; break; + case nsXPTType::T_CHAR : *((PRInt32*) d) = s->val.c; break; + case nsXPTType::T_WCHAR : *((PRUint32*) d) = s->val.wc; break; + default: + // all the others are plain pointer types + *((void**)d) = s->val.p; + break; + } + } +} + +extern "C" nsresult _XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, + PRUint32 paramCount, nsXPTCVariant* params); + +extern "C" +XPTC_PUBLIC_API(nsresult) +XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, + PRUint32 paramCount, nsXPTCVariant* params) +{ + return _XPTC_InvokeByIndex(that, methodIndex, paramCount, params); +} diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_rhapsody.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_rhapsody.s new file mode 100644 index 000000000000..c3905eaeb931 --- /dev/null +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_rhapsody.s @@ -0,0 +1,71 @@ + # + # -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + # + # The contents of this file are subject to the Netscape Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/NPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is mozilla.org code. + # + # The Initial Developer of the Original Code is Netscape + # Communications Corporation. Portions created by Netscape are + # Copyright (C) 1999 Netscape Communications Corporation. All + # Rights Reserved. + # + # Contributor(s): + # + + .data + .align 2 +# +# on entry SharedStub has the method selector in r12, the rest of the original +# parameters are in r3 thru r10 and f1 thru f13 +# +.globl _SharedStub + +_SharedStub: + mflr r0 + stw r0,8(r1) + + stwu r1,-176(r1) + + stw r4,44(r1) + stw r5,48(r1) + stw r6,52(r1) + stw r7,56(r1) + stw r8,60(r1) + stw r9,64(r1) + stw r10,68(r1) + stfd f1,72(r1) + stfd f2,80(r1) + stfd f3,88(r1) + stfd f4,96(r1) + stfd f5,104(r1) + stfd f6,112(r1) + stfd f7,120(r1) + stfd f8,128(r1) + stfd f9,136(r1) + stfd f10,144(r1) + stfd f11,152(r1) + stfd f12,156(r1) + stfd f13,164(r1) + + addi r6,r1,44 + addi r7,r1,72 + + mr r4,r12 + addi r5,r1,232 + + bl _PrepareAndDispatch + nop + + lwz r0,184(r1) + addi r1,r1,176 + mtlr r0 + blr diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_rhapsody.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_rhapsody.cpp new file mode 100644 index 000000000000..0d1a882af929 --- /dev/null +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_rhapsody.cpp @@ -0,0 +1,260 @@ +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + */ + +/* Implement shared vtbl methods. */ + +#include "xptcprivate.h" + +/* + For mac, the first 8 integral and the first 13 f.p. parameters arrive + in a separate chunk of data that has been loaded from the registers. The + args pointer has been set to the start of the parameters BEYOND the ones + arriving in registers +*/ +extern "C" nsresult +PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args, PRUint32 *gprData, double *fprData) +{ +#define PARAM_BUFFER_COUNT 16 +#define PARAM_GPR_COUNT 7 + + fprintf(stderr, "PrepareAndDispatch %p, %d, %p, %p, %p\n", self, methodIndex, args, gprData, fprData); + + nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; + nsXPTCMiniVariant* dispatchParams = NULL; + nsIInterfaceInfo* iface_info = NULL; + const nsXPTMethodInfo* info; + PRUint8 paramCount; + PRUint8 i; + nsresult result = NS_ERROR_FAILURE; + + NS_ASSERTION(self,"no self"); + + self->GetInterfaceInfo(&iface_info); + NS_ASSERTION(iface_info,"no interface info"); + + iface_info->GetMethodInfo(PRUint16(methodIndex), &info); + NS_ASSERTION(info,"no interface info"); + + paramCount = info->GetParamCount(); + + // setup variant array pointer + if(paramCount > PARAM_BUFFER_COUNT) + dispatchParams = new nsXPTCMiniVariant[paramCount]; + else + dispatchParams = paramBuffer; + NS_ASSERTION(dispatchParams,"no place for params"); + + PRUint32* ap = args; + PRUint32 iCount = 0; + PRUint32 fpCount = 0; + for(i = 0; i < paramCount; i++) + { + const nsXPTParamInfo& param = info->GetParam(i); + const nsXPTType& type = param.GetType(); + nsXPTCMiniVariant* dp = &dispatchParams[i]; + + if(param.IsOut() || !type.IsArithmetic()) + { + if (iCount < PARAM_GPR_COUNT) + dp->val.p = (void*) gprData[iCount++]; + else + dp->val.p = (void*) *ap++; + continue; + } + // else + switch(type) + { + case nsXPTType::T_I8 : if (iCount < PARAM_GPR_COUNT) + dp->val.i8 = (PRInt8) gprData[iCount++]; + else + dp->val.i8 = (PRInt8) *ap++; + break; + case nsXPTType::T_I16 : if (iCount < PARAM_GPR_COUNT) + dp->val.i16 = (PRInt16) gprData[iCount++]; + else + dp->val.i16 = (PRInt16) *ap++; + break; + case nsXPTType::T_I32 : if (iCount < PARAM_GPR_COUNT) + dp->val.i32 = (PRInt32) gprData[iCount++]; + else + dp->val.i32 = (PRInt32) *ap++; + break; + + case nsXPTType::T_I64 : + { + PRUint64 tempu64; + if (iCount & 1) iCount++; // longlongs are aligned in odd/even register pairs, eg. r5/r6 + if ((iCount + 1) < PARAM_GPR_COUNT) { + tempu64 = *(PRUint64*) &gprData[iCount]; + iCount += 2; + } + else { + if ((PRUint32) ap & 4) ap++; // longlongs are 8-byte aligned on stack + tempu64 = *(PRUint64*) ap; + ap += 2; + } + dp->val.i64 = (PRUint64)tempu64; + } + +#if 0 + case nsXPTType::T_I64 : if (iCount < PARAM_GPR_COUNT) + dp->val.i64.hi = (PRInt32) gprData[iCount++]; + else + dp->val.i64.hi = (PRInt32) *ap++; + if (iCount < PARAM_GPR_COUNT) + dp->val.i64.lo = (PRUint32) gprData[iCount++]; + else + dp->val.i64.lo = (PRUint32) *ap++; + break; +#endif + case nsXPTType::T_U8 : if (iCount < PARAM_GPR_COUNT) + dp->val.i8 = (PRUint8) gprData[iCount++]; + else + dp->val.i8 = (PRUint8) *ap++; + break; + case nsXPTType::T_U16 : if (iCount < PARAM_GPR_COUNT) + dp->val.i16 = (PRUint16) gprData[iCount++]; + else + dp->val.i16 = (PRUint16) *ap++; + break; + case nsXPTType::T_U32 : if (iCount < PARAM_GPR_COUNT) + dp->val.i32 = (PRUint32) gprData[iCount++]; + else + dp->val.i32 = (PRUint32) *ap++; + break; + + case nsXPTType::T_U64 : +#if 0 + if (iCount < PARAM_GPR_COUNT) + dp->val.i64.hi = (PRUint32) gprData[iCount++]; + else + dp->val.i64.hi = (PRUint32) *ap++; + if (iCount < PARAM_GPR_COUNT) + dp->val.i64.lo = (PRUint32) gprData[iCount++]; + else + dp->val.i64.lo = (PRUint32) *ap++; +#endif + { + PRUint64 tempu64; + if (iCount & 1) iCount++; // longlongs are aligned in odd/even register pairs, eg. r5/r6 + if ((iCount + 1) < PARAM_GPR_COUNT) { + tempu64 = *(PRUint64*) &gprData[iCount]; + iCount += 2; + } + else { + if ((PRUint32) ap & 4) ap++; // longlongs are 8-byte aligned on stack + tempu64 = *(PRUint64*) ap; + ap += 2; + } + dp->val.i64 = (PRUint64)tempu64; + } + break; + case nsXPTType::T_FLOAT : if (fpCount < 13) { + dp->val.f = (float) fprData[fpCount++]; + if (iCount < PARAM_GPR_COUNT) + ++iCount; + else + ++ap; + } + else + dp->val.f = *((float*) ap++); + break; + case nsXPTType::T_DOUBLE : if (fpCount < 13) { + dp->val.d = (double) fprData[fpCount++]; + if (iCount < PARAM_GPR_COUNT) + ++iCount; + else + ++ap; + if (iCount < PARAM_GPR_COUNT) + ++iCount; + else + ++ap; + } + else { + dp->val.f = *((double*) ap); + ap += 2; + } + break; + case nsXPTType::T_BOOL : if (iCount < PARAM_GPR_COUNT) + dp->val.b = (PRBool) gprData[iCount++]; + else + dp->val.b = (PRBool) *ap++; + break; + case nsXPTType::T_CHAR : if (iCount < PARAM_GPR_COUNT) + dp->val.c = (char) gprData[iCount++]; + else + dp->val.c = (char) *ap++; + break; + case nsXPTType::T_WCHAR : if (iCount < PARAM_GPR_COUNT) + dp->val.wc = (wchar_t) gprData[iCount++]; + else + dp->val.wc = (wchar_t) *ap++; + break; + default: + NS_ASSERTION(0, "bad type"); + break; + } + } + + result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); + + NS_RELEASE(iface_info); + + if(dispatchParams != paramBuffer) + delete [] dispatchParams; + + return result; +} + + +#if 1 +//extern "C" void SharedStub(); +#define STUB_ENTRY(n) \ +__asm__ ( \ + ".data\n\t" \ + ".align 2\n\t" \ + ".globl _Stub"#n"__14nsXPTCStubBase\n" \ + "_Stub"#n"__14nsXPTCStubBase:\n\t" \ + "addi r12,0,"#n"\n\t" \ + "b _SharedStub" \ +); +#else +extern "C" nsresult SharedStub(); +#define STUB_ENTRY(n) \ +nsresult nsXPTCStubBase::Stub##n() \ +{\ + return SharedStub();\ +} +#endif + + +#define SENTINEL_ENTRY(n) \ +nsresult nsXPTCStubBase::Sentinel##n() \ +{ \ + NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ + return NS_ERROR_NOT_IMPLEMENTED; \ +} + + +#include "xptcstubsdef.inc" + + diff --git a/xpcom/threads/plevent.c b/xpcom/threads/plevent.c index c735be352909..e96de659ce89 100644 --- a/xpcom/threads/plevent.c +++ b/xpcom/threads/plevent.c @@ -48,9 +48,16 @@ typedef MPARAM WPARAM,LPARAM; #include #endif +#if defined(RHAPSODY) +#undef XP_UNIX +#define XP_MAC 1 +#endif + #if defined(XP_MAC) #include +#if !defined(RHAPSODY) #include "pprthred.h" +#endif #else #include "private/pprthred.h" #endif /* XP_MAC */ diff --git a/xpfe/appshell/src/nsWebShellWindow.cpp b/xpfe/appshell/src/nsWebShellWindow.cpp index 77c0e12e311e..fa946a16a594 100644 --- a/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/xpfe/appshell/src/nsWebShellWindow.cpp @@ -107,13 +107,19 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); // HACK for M4, should be removed by M5 -#ifdef XP_MAC +// ... its now M15 +#if defined(XP_MAC) || defined(RHAPSODY) #include #endif #include "nsIMenuItem.h" #include "nsIDOMXULDocument.h" // End hack +#if defined(XP_MAC) || defined(RHAPSODY) +#define USE_NATIVE_MENUS +#endif + + #include "nsIWindowMediator.h" #include "nsIPopupSetFrame.h" @@ -356,7 +362,7 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent, NS_METHOD nsWebShellWindow::Close() { -#ifdef XP_MAC // Anyone still using native menus should add themselves here. +#ifdef USE_NATIVE_MENUS // unregister as document listener // this is needed for menus nsCOMPtr cv; @@ -910,7 +916,7 @@ void nsWebShellWindow::DynamicLoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aP nsMenuEvent fake; menuListener->MenuConstruct(fake, aParentWindow, menubarNode, mWebShell); - #ifdef XP_MAC + #ifdef USE_NATIVE_MENUS #else // Resize around the menu. rv = NS_ERROR_FAILURE; @@ -1017,7 +1023,8 @@ void nsWebShellWindow::LoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWi pnsMenuBar->Paint(); // HACK for M4, should be removed by M5 -#ifdef XP_MAC + // ... it is now M15 +#ifdef USE_NATIVE_MENUS Handle tempMenuBar = ::GetMenuBar(); // Get a copy of the menu list pnsMenuBar->SetNativeData((void*)tempMenuBar); #endif @@ -1255,7 +1262,7 @@ nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader, mLockedUntilChromeLoad = PR_FALSE; -#ifdef XP_MAC // Anyone still using native menus should add themselves here. +#ifdef USE_NATIVE_MENUS // register as document listener // this is needed for menus nsCOMPtr cv; @@ -1277,7 +1284,7 @@ nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader, ExecuteStartupCode(); -#ifdef XP_MAC // Anyone still using native menus should add themselves here. +#ifdef USE_NATIVE_MENUS /////////////////////////////// // Find the Menubar DOM and Load the menus, hooking them up to the loaded commands /////////////////////////////// @@ -1298,7 +1305,7 @@ nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader, DynamicLoadMenus(menubarDOMDoc, mWindow); #endif } -#endif // XP_MAC +#endif // USE_NATIVE_MENUS OnChromeLoaded(); LoadContentAreas(); diff --git a/xpfe/bootstrap/Makefile.in b/xpfe/bootstrap/Makefile.in index 766d948d8b1d..79487e7d15e2 100644 --- a/xpfe/bootstrap/Makefile.in +++ b/xpfe/bootstrap/Makefile.in @@ -60,6 +60,10 @@ ifdef MOZ_MONOLITHIC_TOOLKIT XP_LIBS += $(TK_LIBS) endif +ifeq ($(OS_ARCH),Rhapsody) +DETECT_WEBSHELL_LEAKS= +endif + ifdef DETECT_WEBSHELL_LEAKS XP_LIBS += -lraptorwebwidget -ldocshell -ljsdom endif diff --git a/xpfe/bootstrap/nsAppRunner.cpp b/xpfe/bootstrap/nsAppRunner.cpp index c1339e217bf7..5009529460e4 100644 --- a/xpfe/bootstrap/nsAppRunner.cpp +++ b/xpfe/bootstrap/nsAppRunner.cpp @@ -64,10 +64,15 @@ #include "nsIWebBrowserChrome.h" -#ifndef XP_MAC +#ifndef XP_MAC && !defined(RHAPSODY) #include "nsTimeBomb.h" #endif +#ifdef RHAPSODY +// XXX hack because we can't link against libraptorwebwidget (pav) +#undef DETECT_WEBSHELL_LEAKS +#endif + #if defined(DEBUG_sspitzer) || defined(DEBUG_seth) #define DEBUG_CMD_LINE #endif