From 906aa3faf23f5631fc6a716fc899eed0e778a0c7 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Wed, 14 Nov 2018 17:03:36 +0000 Subject: [PATCH] Bug 1510247. Fix some unified build issues in widget code. r=spohl Differential Revision: https://phabricator.services.mozilla.com/D13061 --HG-- extra : rebase_source : 919f43d45fc9bc4fe8502b0acf3d01ed067cdd49 --- widget/cocoa/GfxInfo.mm | 1 + widget/cocoa/RectTextureImage.h | 7 +++++++ widget/cocoa/ScreenHelperCocoa.mm | 2 ++ widget/cocoa/SwipeTracker.h | 2 ++ widget/cocoa/TextInputHandler.h | 1 + widget/cocoa/VibrancyManager.mm | 2 ++ widget/cocoa/ViewRegion.h | 4 +++- widget/cocoa/ViewRegion.mm | 2 ++ widget/cocoa/nsAppShell.mm | 1 + widget/cocoa/nsCocoaUtils.mm | 1 + widget/cocoa/nsDeviceContextSpecX.h | 2 ++ widget/cocoa/nsMacSharingService.mm | 2 ++ widget/cocoa/nsMenuItemIconX.h | 1 + widget/cocoa/nsMenuItemIconX.mm | 2 ++ widget/cocoa/nsMenuItemX.mm | 2 ++ widget/cocoa/nsMenuX.h | 1 + widget/cocoa/nsPrintSettingsX.mm | 1 + widget/headless/HeadlessWidget.cpp | 4 ++++ widget/nsDragServiceProxy.cpp | 15 +++++++++------ widget/nsIDeviceContextSpec.h | 1 + widget/nsNativeTheme.cpp | 1 + widget/nsNativeTheme.h | 1 + widget/nsPrintSettingsService.h | 3 +-- widget/nsTransferable.cpp | 1 + 24 files changed, 51 insertions(+), 9 deletions(-) diff --git a/widget/cocoa/GfxInfo.mm b/widget/cocoa/GfxInfo.mm index 65cd0b2657ba..915dde72873b 100644 --- a/widget/cocoa/GfxInfo.mm +++ b/widget/cocoa/GfxInfo.mm @@ -12,6 +12,7 @@ #include "nsUnicharUtils.h" #include "nsExceptionHandler.h" #include "nsCocoaFeatures.h" +#include "nsCocoaUtils.h" #include "nsICrashReporter.h" #include "mozilla/Preferences.h" #include diff --git a/widget/cocoa/RectTextureImage.h b/widget/cocoa/RectTextureImage.h index 9c9c6eebb48f..4d49c9a95bc6 100644 --- a/widget/cocoa/RectTextureImage.h +++ b/widget/cocoa/RectTextureImage.h @@ -6,7 +6,10 @@ #ifndef RectTextureImage_h_ #define RectTextureImage_h_ +#include "GLTypes.h" +#include "mozilla/gfx/2D.h" #include "mozilla/RefPtr.h" +#include "Units.h" class MacIOSurface; @@ -16,6 +19,10 @@ namespace gl { class GLContext; } // namespace gl +namespace layers { +class GLManager; +} // namespace layers + namespace widget { // Manages a texture which can resize dynamically, binds to the diff --git a/widget/cocoa/ScreenHelperCocoa.mm b/widget/cocoa/ScreenHelperCocoa.mm index 266ed919d71f..b8314b572e98 100644 --- a/widget/cocoa/ScreenHelperCocoa.mm +++ b/widget/cocoa/ScreenHelperCocoa.mm @@ -12,6 +12,8 @@ #include "nsCocoaUtils.h" #include "nsObjCExceptions.h" +using namespace mozilla; + static LazyLogModule sScreenLog("WidgetScreen"); @interface ScreenHelperDelegate : NSObject diff --git a/widget/cocoa/SwipeTracker.h b/widget/cocoa/SwipeTracker.h index 6574636f109c..37841529e2ef 100644 --- a/widget/cocoa/SwipeTracker.h +++ b/widget/cocoa/SwipeTracker.h @@ -14,7 +14,9 @@ #include "nsRefreshDriver.h" #include "Units.h" +class nsChildView; class nsIPresShell; +class nsIWidget; namespace mozilla { diff --git a/widget/cocoa/TextInputHandler.h b/widget/cocoa/TextInputHandler.h index 66a0688a7038..a4490584deb2 100644 --- a/widget/cocoa/TextInputHandler.h +++ b/widget/cocoa/TextInputHandler.h @@ -16,6 +16,7 @@ #include "nsCOMPtr.h" #include "nsITimer.h" #include "nsTArray.h" +#include "mozilla/BasicEvents.h" #include "mozilla/EventForwards.h" #include "mozilla/TextEventDispatcherListener.h" #include "WritingModes.h" diff --git a/widget/cocoa/VibrancyManager.mm b/widget/cocoa/VibrancyManager.mm index e6c84adfea2c..c38603fc9ec4 100644 --- a/widget/cocoa/VibrancyManager.mm +++ b/widget/cocoa/VibrancyManager.mm @@ -5,7 +5,9 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "VibrancyManager.h" + #include "nsChildView.h" +#include "nsCocoaFeatures.h" #import using namespace mozilla; diff --git a/widget/cocoa/ViewRegion.h b/widget/cocoa/ViewRegion.h index a8efccaff3e9..a403fc63e71a 100644 --- a/widget/cocoa/ViewRegion.h +++ b/widget/cocoa/ViewRegion.h @@ -10,6 +10,8 @@ #include "Units.h" #include "nsTArray.h" +class nsChildView; + @class NSView; namespace mozilla { @@ -41,7 +43,7 @@ public: /** * Return an NSView from the region, if there is any. */ - NSView* GetAnyView() { return mViews.Length() > 0 ? mViews[0] : nil; } + NSView* GetAnyView() { return mViews.Length() > 0 ? mViews[0] : NULL; } private: mozilla::LayoutDeviceIntRegion mRegion; diff --git a/widget/cocoa/ViewRegion.mm b/widget/cocoa/ViewRegion.mm index b3605caa21a1..290d17cbf45b 100644 --- a/widget/cocoa/ViewRegion.mm +++ b/widget/cocoa/ViewRegion.mm @@ -7,6 +7,8 @@ #include "ViewRegion.h" #import +#include "nsChildView.h" + using namespace mozilla; ViewRegion::~ViewRegion() diff --git a/widget/cocoa/nsAppShell.mm b/widget/cocoa/nsAppShell.mm index 1e6245effb5d..8187b269ba83 100644 --- a/widget/cocoa/nsAppShell.mm +++ b/widget/cocoa/nsAppShell.mm @@ -45,6 +45,7 @@ #include "nsIDOMWakeLockListener.h" #include "nsIPowerManagerService.h" +using namespace mozilla; using namespace mozilla::widget; #define WAKE_LOCK_LOG(...) MOZ_LOG(gMacWakeLockLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) diff --git a/widget/cocoa/nsCocoaUtils.mm b/widget/cocoa/nsCocoaUtils.mm index 0737ab31dacd..eb94e93f7be5 100644 --- a/widget/cocoa/nsCocoaUtils.mm +++ b/widget/cocoa/nsCocoaUtils.mm @@ -14,6 +14,7 @@ #include "nsCocoaUtils.h" #include "nsChildView.h" #include "nsMenuBarX.h" +#include "nsCocoaFeatures.h" #include "nsCocoaWindow.h" #include "nsCOMPtr.h" #include "nsIInterfaceRequestorUtils.h" diff --git a/widget/cocoa/nsDeviceContextSpecX.h b/widget/cocoa/nsDeviceContextSpecX.h index ba37a3db329f..fc68271e4298 100644 --- a/widget/cocoa/nsDeviceContextSpecX.h +++ b/widget/cocoa/nsDeviceContextSpecX.h @@ -8,6 +8,8 @@ #include "nsIDeviceContextSpec.h" +#include "nsCOMPtr.h" + #include class nsDeviceContextSpecX : public nsIDeviceContextSpec diff --git a/widget/cocoa/nsMacSharingService.mm b/widget/cocoa/nsMacSharingService.mm index 86f69079693f..02409a4edc7d 100644 --- a/widget/cocoa/nsMacSharingService.mm +++ b/widget/cocoa/nsMacSharingService.mm @@ -6,6 +6,8 @@ #import #include "nsMacSharingService.h" + +#include "jsapi.h" #include "nsCocoaUtils.h" #include "mozilla/MacStringHelpers.h" diff --git a/widget/cocoa/nsMenuItemIconX.h b/widget/cocoa/nsMenuItemIconX.h index 764c2814f12b..59ab9c3a0bfc 100644 --- a/widget/cocoa/nsMenuItemIconX.h +++ b/widget/cocoa/nsMenuItemIconX.h @@ -17,6 +17,7 @@ class nsIURI; class nsIContent; +class nsIPrincipal; class imgRequestProxy; class nsMenuObjectX; diff --git a/widget/cocoa/nsMenuItemIconX.mm b/widget/cocoa/nsMenuItemIconX.mm index b42a5fd60bf1..fcb14646423a 100644 --- a/widget/cocoa/nsMenuItemIconX.mm +++ b/widget/cocoa/nsMenuItemIconX.mm @@ -40,6 +40,8 @@ #include "nsIContentPolicy.h" #include "nsComputedDOMStyle.h" +using namespace mozilla; + using mozilla::dom::Element; using mozilla::gfx::SourceSurface; diff --git a/widget/cocoa/nsMenuItemX.mm b/widget/cocoa/nsMenuItemX.mm index 92799c941ceb..48698d2f4470 100644 --- a/widget/cocoa/nsMenuItemX.mm +++ b/widget/cocoa/nsMenuItemX.mm @@ -21,6 +21,8 @@ #include "nsIWidget.h" #include "nsIDocument.h" +using namespace mozilla; + using mozilla::dom::Event; using mozilla::dom::CallerType; diff --git a/widget/cocoa/nsMenuX.h b/widget/cocoa/nsMenuX.h index 7b5146a0b84c..38b08c99010a 100644 --- a/widget/cocoa/nsMenuX.h +++ b/widget/cocoa/nsMenuX.h @@ -8,6 +8,7 @@ #import +#include "mozilla/EventForwards.h" #include "mozilla/RefPtr.h" #include "mozilla/UniquePtr.h" #include "nsMenuBaseX.h" diff --git a/widget/cocoa/nsPrintSettingsX.mm b/widget/cocoa/nsPrintSettingsX.mm index 2e80be12f138..c6c9f7178855 100644 --- a/widget/cocoa/nsPrintSettingsX.mm +++ b/widget/cocoa/nsPrintSettingsX.mm @@ -10,6 +10,7 @@ #include "plstr.h" #include "nsCocoaUtils.h" +#include "nsXULAppAPI.h" #include "mozilla/Preferences.h" diff --git a/widget/headless/HeadlessWidget.cpp b/widget/headless/HeadlessWidget.cpp index 7e538a31d83c..c0304d87878d 100644 --- a/widget/headless/HeadlessWidget.cpp +++ b/widget/headless/HeadlessWidget.cpp @@ -11,8 +11,12 @@ #include "mozilla/gfx/gfxVars.h" #include "mozilla/ClearOnShutdown.h" #include "mozilla/TextEvents.h" +#include "mozilla/widget/HeadlessWidgetTypes.h" +#include "mozilla/widget/PlatformWidgetTypes.h" +#include "nsIScreen.h" #include "HeadlessKeyBindings.h" +using namespace mozilla; using namespace mozilla::gfx; using namespace mozilla::layers; diff --git a/widget/nsDragServiceProxy.cpp b/widget/nsDragServiceProxy.cpp index d68ed44c4ba4..cadad8dc1a98 100644 --- a/widget/nsDragServiceProxy.cpp +++ b/widget/nsDragServiceProxy.cpp @@ -13,9 +13,13 @@ #include "mozilla/Unused.h" #include "nsContentUtils.h" +using mozilla::CSSIntRegion; using mozilla::ipc::Shmem; using mozilla::dom::TabChild; using mozilla::dom::OptionalShmem; +using mozilla::gfx::DataSourceSurface; +using mozilla::gfx::SourceSurface; +using mozilla::gfx::SurfaceFormat; using mozilla::LayoutDeviceIntRect; using mozilla::Maybe; @@ -66,12 +70,11 @@ nsDragServiceProxy::InvokeDragSessionImpl(nsIArray* aArrayTransferables, LayoutDeviceIntRect dragRect; if (mHasImage || mSelection) { nsPresContext* pc; - RefPtr surface; + RefPtr surface; DrawDrag(mSourceNode, aRegion, mScreenPosition, &dragRect, &surface, &pc); if (surface) { - RefPtr dataSurface = - surface->GetDataSurface(); + RefPtr dataSurface = surface->GetDataSurface(); if (dataSurface) { size_t length; int32_t stride; @@ -101,9 +104,9 @@ nsDragServiceProxy::InvokeDragSessionImpl(nsIArray* aArrayTransferables, } } - mozilla::Unused << child->SendInvokeDragSession(dataTransfers, aActionType, - mozilla::void_t(), 0, static_cast(0), dragRect, - principalURISpec); + mozilla::Unused << child->SendInvokeDragSession( + dataTransfers, aActionType, mozilla::void_t(), 0, + static_cast(0), dragRect, principalURISpec); StartDragSession(); return NS_OK; } diff --git a/widget/nsIDeviceContextSpec.h b/widget/nsIDeviceContextSpec.h index 1113c4424b1d..dcc0f6e23f61 100644 --- a/widget/nsIDeviceContextSpec.h +++ b/widget/nsIDeviceContextSpec.h @@ -6,6 +6,7 @@ #ifndef nsIDeviceContextSpec_h___ #define nsIDeviceContextSpec_h___ +#include "gfxPoint.h" #include "nsISupports.h" class nsIWidget; diff --git a/widget/nsNativeTheme.cpp b/widget/nsNativeTheme.cpp index 487f1834b116..affa858177d2 100644 --- a/widget/nsNativeTheme.cpp +++ b/widget/nsNativeTheme.cpp @@ -22,6 +22,7 @@ #include "nsMenuFrame.h" #include "nsRangeFrame.h" #include "nsCSSRendering.h" +#include "mozilla/ComputedStyle.h" #include "mozilla/EventStates.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/HTMLBodyElement.h" diff --git a/widget/nsNativeTheme.h b/widget/nsNativeTheme.h index ea33ea368ff8..69ed9575b5a0 100644 --- a/widget/nsNativeTheme.h +++ b/widget/nsNativeTheme.h @@ -11,6 +11,7 @@ #include "nsAlgorithm.h" #include "nsAtom.h" +#include "nsColor.h" #include "nsCOMPtr.h" #include "nsString.h" #include "nsMargin.h" diff --git a/widget/nsPrintSettingsService.h b/widget/nsPrintSettingsService.h index 6fb556c50918..5b27e535bd2b 100644 --- a/widget/nsPrintSettingsService.h +++ b/widget/nsPrintSettingsService.h @@ -9,12 +9,11 @@ #include "mozilla/embedding/PPrinting.h" #include "nsCOMPtr.h" +#include "nsIPrintSettings.h" #include "nsIPrintSettingsService.h" #include "nsString.h" #include "nsFont.h" -class nsIPrintSettings; - /** * Class nsPrintSettingsService. Base class for the platform specific widget * subclasses to inherit from. diff --git a/widget/nsTransferable.cpp b/widget/nsTransferable.cpp index 969bb7931860..4bbc4c6d57dc 100644 --- a/widget/nsTransferable.cpp +++ b/widget/nsTransferable.cpp @@ -34,6 +34,7 @@ Notes to self: #include "nsIOutputStream.h" #include "nsIInputStream.h" #include "nsILoadContext.h" +#include "nsXULAppAPI.h" #include "mozilla/UniquePtr.h" using namespace mozilla;