diff --git a/widget/src/cocoa/mozView.h b/widget/src/cocoa/mozView.h index b212742f0a2..7ce6b91680e 100644 --- a/widget/src/cocoa/mozView.h +++ b/widget/src/cocoa/mozView.h @@ -62,6 +62,8 @@ class nsIWidget; // called when our corresponding Gecko view goes away - (void)widgetDestroyed; +- (BOOL)isDragInProgress; + @end // An informal protocol implemented by the NSWindow of the host application. diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index 4de140e1856..f38524df5ec 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -215,8 +215,6 @@ PRUint32 nsChildView::sLastInputEventCount = 0; - (BOOL)isFirstResponder; -- (BOOL)isDragInProgress; - - (void)fireKeyEventForFlagsChanged:(NSEvent*)theEvent keyDown:(BOOL)isKeyDown; - (BOOL)inactiveWindowAcceptsMouseEvent:(NSEvent*)aEvent; @@ -1254,7 +1252,7 @@ NS_IMETHODIMP nsChildView::GetPluginClipRect(nsIntRect& outClipRect, nsIntPoint& if (mClipRects) { nsIntRect clipBounds; - for (PRInt32 i = 0; i < mClipRectCount; ++i) { + for (PRUint32 i = 0; i < mClipRectCount; ++i) { clipBounds.UnionRect(clipBounds, mClipRects[i]); } outClipRect.IntersectRect(outClipRect, clipBounds - outOrigin); diff --git a/widget/src/cocoa/nsCocoaWindow.h b/widget/src/cocoa/nsCocoaWindow.h index 09d4fbdd2c5..bca5f1a91b6 100644 --- a/widget/src/cocoa/nsCocoaWindow.h +++ b/widget/src/cocoa/nsCocoaWindow.h @@ -256,6 +256,7 @@ public: NS_IMETHOD Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous); NS_IMETHOD Update(); virtual nsresult ConfigureChildren(const nsTArray& aConfigurations); + virtual LayerManager* GetLayerManager(bool *aAllowRetaining = nsnull); virtual LayerManager* GetLayerManager(LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT, bool* aAllowRetaining = nsnull); NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus) ; diff --git a/widget/src/cocoa/nsCocoaWindow.mm b/widget/src/cocoa/nsCocoaWindow.mm index 47e6b64850a..acbf1910f63 100644 --- a/widget/src/cocoa/nsCocoaWindow.mm +++ b/widget/src/cocoa/nsCocoaWindow.mm @@ -932,6 +932,15 @@ nsCocoaWindow::ConfigureChildren(const nsTArray& aConfigurations) return NS_OK; } +LayerManager* +nsCocoaWindow::GetLayerManager(bool *aAllowRetaining) +{ + if (mPopupContentView) { + return mPopupContentView->GetLayerManager(aAllowRetaining); + } + return nsnull; +} + LayerManager* nsCocoaWindow::GetLayerManager(LayerManagerPersistence, bool* aAllowRetaining) { diff --git a/widget/src/cocoa/nsMenuUtilsX.mm b/widget/src/cocoa/nsMenuUtilsX.mm index 8348625130f..f05a5091434 100644 --- a/widget/src/cocoa/nsMenuUtilsX.mm +++ b/widget/src/cocoa/nsMenuUtilsX.mm @@ -53,8 +53,6 @@ #include "nsPIDOMWindow.h" #include "nsIDOMAbstractView.h" -#include - void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent) { NS_PRECONDITION(aTargetContent, "null ptr"); @@ -88,20 +86,11 @@ NSString* nsMenuUtilsX::GetTruncatedCocoaLabel(const nsString& itemLabel) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; -#ifdef __LP64__ - // Don't do anything on 64-bit Mac OS X for now, there is no API that does - // what we want. We'll probably need to roll our own solution. + // We want to truncate long strings to some reasonable pixel length but there is no + // good API for doing that which works for all OS versions and architectures. For now + // we'll do nothing for consistency and depend on good user interface design to limit + // string lengths. return [NSString stringWithCharacters:itemLabel.get() length:itemLabel.Length()]; -#else - // ::TruncateThemeText() doesn't take the number of characters to truncate to, it takes a pixel with - // to fit the string in. Ugh. I talked it over with sfraser and we couldn't come up with an - // easy way to compute what this should be given the system font, etc, so we're just going - // to hard code it to something reasonable and bigger fonts will just have to deal. - const short kMaxItemPixelWidth = 300; - NSMutableString *label = [NSMutableString stringWithCharacters:itemLabel.get() length:itemLabel.Length()]; - ::TruncateThemeText((CFMutableStringRef)label, kThemeMenuItemFont, kThemeStateActive, kMaxItemPixelWidth, truncMiddle, NULL); - return label; -#endif NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } diff --git a/widget/src/cocoa/nsNativeThemeColors.h b/widget/src/cocoa/nsNativeThemeColors.h index 737ed9c7bcf..48e9829f0e2 100644 --- a/widget/src/cocoa/nsNativeThemeColors.h +++ b/widget/src/cocoa/nsNativeThemeColors.h @@ -80,6 +80,7 @@ static const int sSnowLeopardThemeColors[][2] = { { 0xA7, 0xDE } // gradient end }; +__attribute__((unused)) static int NativeGreyColorAsInt(ColorName name, BOOL isMain) { if (nsToolkit::OnSnowLeopardOrLater()) @@ -88,11 +89,13 @@ static int NativeGreyColorAsInt(ColorName name, BOOL isMain) return sLeopardThemeColors[name][isMain ? 0 : 1]; } +__attribute__((unused)) static float NativeGreyColorAsFloat(ColorName name, BOOL isMain) { return NativeGreyColorAsInt(name, isMain) / 255.0f; } +__attribute__((unused)) static void DrawNativeGreyColorInRect(CGContextRef context, ColorName name, CGRect rect, BOOL isMain) { diff --git a/widget/src/cocoa/nsScreenManagerCocoa.mm b/widget/src/cocoa/nsScreenManagerCocoa.mm index 6201ce0394d..af1ae06b2bd 100644 --- a/widget/src/cocoa/nsScreenManagerCocoa.mm +++ b/widget/src/cocoa/nsScreenManagerCocoa.mm @@ -52,11 +52,10 @@ nsScreenManagerCocoa::~nsScreenManagerCocoa() } nsScreenCocoa* -nsScreenManagerCocoa::ScreenForCocoaScreen (NSScreen *screen) +nsScreenManagerCocoa::ScreenForCocoaScreen(NSScreen *screen) { - for (PRInt32 i = 0; i < mScreenList.Length(); ++i) { + for (PRUint32 i = 0; i < mScreenList.Length(); ++i) { nsScreenCocoa* sc = mScreenList[i]; - if (sc->CocoaScreen() == screen) { // doesn't addref return sc; diff --git a/widget/src/cocoa/nsToolkit.mm b/widget/src/cocoa/nsToolkit.mm index f9c62484a21..2142654317e 100644 --- a/widget/src/cocoa/nsToolkit.mm +++ b/widget/src/cocoa/nsToolkit.mm @@ -783,7 +783,6 @@ void ScanImportedFunctions(const struct mach_header* mh, intptr_t vmaddr_slide) #ifdef __i386__ if (jumpTable) { unsigned char *opcodeAddr = stubs + (i * 5); - unsigned char oldOpcode = opcodeAddr[0]; int32_t *displacementAddr = (int32_t *) (opcodeAddr + 1); int32_t eip = (int32_t) stubs + (i + 1) * 5; int32_t displacement = (int32_t) (gHookedFunctions[j].newAddress) - eip; diff --git a/xpcom/base/nsObjCExceptions.h b/xpcom/base/nsObjCExceptions.h index 07ce51bf6e6..355e5520147 100644 --- a/xpcom/base/nsObjCExceptions.h +++ b/xpcom/base/nsObjCExceptions.h @@ -65,6 +65,7 @@ // See Mozilla bug 163260. // This file can only be included in an Objective-C context. +__attribute__((unused)) static void nsObjCExceptionLog(NSException* aException) { NSLog(@"Mozilla has caught an Obj-C exception [%@: %@]", @@ -149,6 +150,7 @@ static void nsObjCExceptionLog(NSException* aException) #endif } +__attribute__((unused)) static void nsObjCExceptionAbort() { // We need to raise a mach-o signal here, the Mozilla crash reporter on @@ -158,6 +160,7 @@ static void nsObjCExceptionAbort() *foo = 1; } +__attribute__((unused)) static void nsObjCExceptionLogAbort(NSException *e) { nsObjCExceptionLog(e);