Skip to content

Commit

Permalink
Bug 1825324 - Make widget/* buildable outside of a unified build envi…
Browse files Browse the repository at this point in the history
…ronment r=andi,geckoview-reviewers,m_kato

Differential Revision: https://phabricator.services.mozilla.com/D173969
  • Loading branch information
serge-sans-paille committed Apr 1, 2023
1 parent a3d6690 commit 13e5127
Show file tree
Hide file tree
Showing 50 changed files with 94 additions and 57 deletions.
2 changes: 2 additions & 0 deletions accessible/windows/msaa/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include <windows.h>
#include "mozilla/Maybe.h"
#include "nsString.h"

#include <stdint.h>

namespace mozilla {
Expand Down
2 changes: 1 addition & 1 deletion docshell/base/nsDocShellLoadState.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class nsIURI;
class nsIDocShell;
class nsIChannel;
class nsIReferrerInfo;
class OriginAttibutes;
namespace mozilla {
class OriginAttributes;
template <typename, class>
class UniquePtr;
namespace dom {
Expand Down
4 changes: 4 additions & 0 deletions dom/interfaces/base/nsIBrowserChild.idl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#include "domstubs.idl"
#include "nsIDroppedLinkHandler.idl"

%{C++
#include "mozilla/dom/BindingDeclarations.h"
%}

interface nsIWebBrowserChrome;

webidl ContentFrameMessageManager;
Expand Down
2 changes: 1 addition & 1 deletion storage/mozStorageAsyncStatementExecution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "mozilla/Telemetry.h"

#ifndef MOZ_STORAGE_SORTWARNING_SQL_DUMP
#include "mozilla/Logging.h"
# include "mozilla/Logging.h"
extern mozilla::LazyLogModule gStorageLog;
#endif

Expand Down
2 changes: 2 additions & 0 deletions widget/GfxInfoBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include "mozilla/widget/ScreenManager.h"
#include "mozilla/widget/Screen.h"

#include "jsapi.h"

#include "gfxPlatform.h"
#include "gfxConfig.h"
#include "DriverCrashGuard.h"
Expand Down
2 changes: 0 additions & 2 deletions widget/PuppetWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1137,8 +1137,6 @@ PuppetWidget::NotifyIME(TextEventDispatcher* aTextEventDispatcher,
default:
return NS_ERROR_NOT_IMPLEMENTED;
}

return NS_ERROR_NOT_IMPLEMENTED;
}

NS_IMETHODIMP_(IMENotificationRequests)
Expand Down
2 changes: 1 addition & 1 deletion widget/VsyncDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void VsyncDispatcher::RemoveMainThreadObserver(VsyncObserver* aObserver) {
void VsyncDispatcher::UpdateVsyncStatus() {
bool wasObservingVsync = false;
bool needVsync = false;
RefPtr<VsyncSource> vsyncSource;
RefPtr<gfx::VsyncSource> vsyncSource;

{
auto state = mState.Lock();
Expand Down
2 changes: 2 additions & 0 deletions widget/WidgetEventImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "nsPrintfCString.h"

#if defined(XP_WIN)
# include "windef.h"
# include "winnetwk.h"
# include "npapi.h"
# include "WinUtils.h"
#endif // #if defined (XP_WIN)
Expand Down
2 changes: 0 additions & 2 deletions widget/android/jni/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ LOCAL_INCLUDES += [
"/widget",
"/widget/android",
]

REQUIRES_UNIFIED_BUILD = True
2 changes: 0 additions & 2 deletions widget/android/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,3 @@ if CONFIG["MOZ_NATIVE_DEVICES"]:
DEFINES["MOZ_NATIVE_DEVICES"] = True

# DEFINES['DEBUG_WIDGETS'] = True

REQUIRES_UNIFIED_BUILD = True
2 changes: 0 additions & 2 deletions widget/cocoa/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,3 @@ OS_LIBS += [
]

SPHINX_TREES["/widget/cocoa"] = "docs"

REQUIRES_UNIFIED_BUILD = True
21 changes: 12 additions & 9 deletions widget/cocoa/nsCursorManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ + (nsMacCursor*)createCursor:(enum nsCursor)aCursor {
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;

switch (aCursor) {
SEL cursorSelector;
case eCursor_standard:
return [nsMacCursor cursorWithCursor:[NSCursor arrowCursor] type:aCursor];
case eCursor_wait:
Expand All @@ -89,24 +88,27 @@ + (nsMacCursor*)createCursor:(enum nsCursor)aCursor {
return [nsMacCursor cursorWithImageNamed:@"move" hotSpot:NSMakePoint(12, 12) type:aCursor];
case eCursor_help:
return [nsMacCursor cursorWithImageNamed:@"help" hotSpot:NSMakePoint(12, 12) type:aCursor];
case eCursor_copy:
cursorSelector = @selector(dragCopyCursor);
case eCursor_copy: {
SEL cursorSelector = @selector(dragCopyCursor);
return [nsMacCursor cursorWithCursor:[NSCursor respondsToSelector:cursorSelector]
? [NSCursor performSelector:cursorSelector]
: [NSCursor arrowCursor]
type:aCursor];
case eCursor_alias:
cursorSelector = @selector(dragLinkCursor);
}
case eCursor_alias: {
SEL cursorSelector = @selector(dragLinkCursor);
return [nsMacCursor cursorWithCursor:[NSCursor respondsToSelector:cursorSelector]
? [NSCursor performSelector:cursorSelector]
: [NSCursor arrowCursor]
type:aCursor];
case eCursor_context_menu:
cursorSelector = @selector(contextualMenuCursor);
}
case eCursor_context_menu: {
SEL cursorSelector = @selector(contextualMenuCursor);
return [nsMacCursor cursorWithCursor:[NSCursor respondsToSelector:cursorSelector]
? [NSCursor performSelector:cursorSelector]
: [NSCursor arrowCursor]
type:aCursor];
}
case eCursor_cell:
return [nsMacCursor cursorWithImageNamed:@"cell" hotSpot:NSMakePoint(12, 12) type:aCursor];
case eCursor_grab:
Expand All @@ -122,12 +124,13 @@ + (nsMacCursor*)createCursor:(enum nsCursor)aCursor {
case eCursor_all_scroll:
return [nsMacCursor cursorWithCursor:[NSCursor openHandCursor] type:aCursor];
case eCursor_not_allowed:
case eCursor_no_drop:
cursorSelector = @selector(operationNotAllowedCursor);
case eCursor_no_drop: {
SEL cursorSelector = @selector(operationNotAllowedCursor);
return [nsMacCursor cursorWithCursor:[NSCursor respondsToSelector:cursorSelector]
? [NSCursor performSelector:cursorSelector]
: [NSCursor arrowCursor]
type:aCursor];
}
// Resize Cursors:
// North
case eCursor_n_resize:
Expand Down
1 change: 1 addition & 0 deletions widget/cocoa/nsMacUserActivityUpdater.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "nsCocoaUtils.h"
#include "nsIBaseWindow.h"
#include "gfxPlatform.h"

NS_IMPL_ISUPPORTS(nsMacUserActivityUpdater, nsIMacUserActivityUpdater)

Expand Down
2 changes: 1 addition & 1 deletion widget/cocoa/nsMenuBarX.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

#include "nsISupports.h"
#include "nsMenuParentX.h"
#include "nsMenuGroupOwnerX.h"
#include "nsChangeObserver.h"
#include "nsTArray.h"
#include "nsString.h"

class nsMenuBarX;
class nsMenuGroupOwnerX;
class nsMenuX;
class nsIWidget;
class nsIContent;
Expand Down
2 changes: 1 addition & 1 deletion widget/cocoa/nsMenuGroupOwnerX.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
#include "nsStubMutationObserver.h"
#include "nsHashKeys.h"
#include "nsIObserver.h"
#include "nsMenuBarX.h"
#include "nsTHashMap.h"
#include "nsString.h"

class nsMenuBarX;
class nsMenuItemX;
class nsChangeObserver;
class nsIWidget;
Expand Down
1 change: 1 addition & 0 deletions widget/cocoa/nsTouchBar.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <objc/runtime.h>

#include "mozilla/MacStringHelpers.h"
#include "mozilla/dom/Document.h"
#include "nsArrayUtils.h"
#include "nsCocoaUtils.h"
#include "nsDirectoryServiceDefs.h"
Expand Down
1 change: 1 addition & 0 deletions widget/headless/HeadlessWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "mozilla/WritingModes.h"
#include "mozilla/widget/HeadlessWidgetTypes.h"
#include "mozilla/widget/PlatformWidgetTypes.h"
#include "mozilla/widget/Screen.h"
#include "nsIScreen.h"
#include "HeadlessKeyBindings.h"

Expand Down
2 changes: 0 additions & 2 deletions widget/headless/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,3 @@ else:
include("/ipc/chromium/chromium-config.mozbuild")

FINAL_LIBRARY = "xul"

REQUIRES_UNIFIED_BUILD = True
2 changes: 0 additions & 2 deletions widget/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -388,5 +388,3 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
if CONFIG["MOZ_WAYLAND"]:
CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]

REQUIRES_UNIFIED_BUILD = True
2 changes: 1 addition & 1 deletion widget/nsIWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <cmath>
#include <cstdint>
#include "imgIContainer.h"
#include "ErrorList.h"
#include "Units.h"
#include "mozilla/AlreadyAddRefed.h"
Expand Down Expand Up @@ -46,7 +47,6 @@
// forward declarations
class nsIBidiKeyboard;
class nsIRollupListener;
class imgIContainer;
class nsIContent;
class ViewWrapper;
class nsIRunnable;
Expand Down
2 changes: 1 addition & 1 deletion widget/nsPrinterListCUPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static void GetDisplayNameForPrinter(const cups_dest_t& aDest,
const char* displayName = CupsShim().cupsGetOption(
"printer-info", aDest.num_options, aDest.options);
if (displayName) {
CopyUTF8toUTF16(MakeStringSpan(displayName), aName);
CopyUTF8toUTF16(mozilla::MakeStringSpan(displayName), aName);
}
#endif
}
Expand Down
2 changes: 0 additions & 2 deletions widget/tests/gtest/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ LOCAL_INCLUDES += [
]

DisableStlWrapping()

REQUIRES_UNIFIED_BUILD = True
3 changes: 3 additions & 0 deletions widget/windows/IMMHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
#include "mozilla/TextEventDispatcher.h"
#include "mozilla/WritingModes.h"

#include "windef.h"
#include "winnetwk.h"
#include "npapi.h"

#include "nsCOMPtr.h"
#include "nsIWidget.h"
#include "nsRect.h"
Expand Down
4 changes: 3 additions & 1 deletion widget/windows/InkCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
*/

#include "InkCollector.h"
#include "nsDebug.h"
#include "nsISupportsUtils.h"

// Msinkaut_i.c and Msinkaut.h should both be included
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms695519.aspx
#include <msinkaut_i.c>

StaticAutoPtr<InkCollector> InkCollector::sInkCollector;
mozilla::StaticAutoPtr<InkCollector> InkCollector::sInkCollector;

InkCollector::~InkCollector() {
Shutdown();
Expand Down
1 change: 1 addition & 0 deletions widget/windows/InkCollector.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#ifndef InkCollector_h__
#define InkCollector_h__

#include <objbase.h>
#include <msinkaut.h>
#include "mozilla/StaticPtr.h"

Expand Down
1 change: 1 addition & 0 deletions widget/windows/JumpListItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "nsCRT.h"
#include "nsNetCID.h"
#include "nsCExternalHandlerService.h"
#include "nsComponentManagerUtils.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Preferences.h"
#include "JumpListBuilder.h"
Expand Down
1 change: 0 additions & 1 deletion widget/windows/KeyboardLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,6 @@ void NativeKey::InitIsSkippableForKeyOrChar(const MSG& aLastKeyMSG) {
// by the auto-repeat feature.
return;
}
return;
case WM_APPCOMMAND:
MOZ_ASSERT_UNREACHABLE(
"WM_APPCOMMAND should be handled in "
Expand Down
14 changes: 8 additions & 6 deletions widget/windows/RemoteBackbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "GeckoProfiler.h"
#include "nsThreadUtils.h"
#include "mozilla/Span.h"
#include "mozilla/gfx/Point.h"
#include "WinUtils.h"
#include <algorithm>
#include <type_traits>

Expand Down Expand Up @@ -163,7 +165,7 @@ class SharedImage {

already_AddRefed<gfx::DrawTarget> CreateDrawTarget() {
return gfx::Factory::CreateDrawTargetForData(
gfx::BackendType::CAIRO, mPixelData, IntSize(mWidth, mHeight),
gfx::BackendType::CAIRO, mPixelData, gfx::IntSize(mWidth, mHeight),
GetStride(), gfx::SurfaceFormat::B8G8R8A8);
}

Expand Down Expand Up @@ -287,8 +289,8 @@ class PresentableSharedImage {
mDeviceContext, &srcPos, 0 /*colorKey*/, &bf, ULW_ALPHA);
}

IntRect sharedImageRect{0, 0, mSharedImage.GetWidth(),
mSharedImage.GetHeight()};
gfx::IntRect sharedImageRect{0, 0, mSharedImage.GetWidth(),
mSharedImage.GetHeight()};

bool result = true;

Expand All @@ -298,9 +300,9 @@ class PresentableSharedImage {
}

for (auto& ipcDirtyRect : aDirtyRects) {
IntRect dirtyRect{ipcDirtyRect.x, ipcDirtyRect.y, ipcDirtyRect.width,
ipcDirtyRect.height};
IntRect bltRect = dirtyRect.Intersect(sharedImageRect);
gfx::IntRect dirtyRect{ipcDirtyRect.x, ipcDirtyRect.y, ipcDirtyRect.width,
ipcDirtyRect.height};
gfx::IntRect bltRect = dirtyRect.Intersect(sharedImageRect);

if (!::BitBlt(windowDC, bltRect.x /*dstX*/, bltRect.y /*dstY*/,
bltRect.width, bltRect.height, mDeviceContext,
Expand Down
1 change: 1 addition & 0 deletions widget/windows/RemoteBackbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "nsIWidget.h"
#include "mozilla/widget/PCompositorWidgetParent.h"
#include "mozilla/Maybe.h"
#include "mozilla/gfx/2D.h"
#include "prthread.h"
#include <windows.h>

Expand Down
2 changes: 2 additions & 0 deletions widget/windows/SystemStatusBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "nsDocShell.h"
#include "nsWindowGfx.h"

#include "shellapi.h"

namespace mozilla::widget {

using mozilla::LinkedListElement;
Expand Down
1 change: 1 addition & 0 deletions widget/windows/SystemStatusBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define widget_windows_SystemStatusBar_h

#include "nsISystemStatusBar.h"
#include "mozilla/LinkedList.h"

namespace mozilla::widget {
class StatusBarEntry;
Expand Down
1 change: 0 additions & 1 deletion widget/windows/TaskbarTabPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ TaskbarTabPreview::WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam) {
return wParam == SC_CLOSE
? ::DefWindowProcW(mProxyWindow, WM_SYSCOMMAND, wParam, lParam)
: ::SendMessageW(mWnd, WM_SYSCOMMAND, wParam, lParam);
return 0;
}
return TaskbarPreview::WndProc(nMsg, wParam, lParam);
}
Expand Down
1 change: 1 addition & 0 deletions widget/windows/WinEventObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "mozilla/Logging.h"
#include "mozilla/StaticPtr.h"
#include "nsHashtablesFwd.h"
#include "nsdefs.h"

namespace mozilla::widget {

Expand Down
2 changes: 2 additions & 0 deletions widget/windows/WinPointerEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
*/

#include "nscore.h"
#include "nsWindowDefs.h"
#include "WinPointerEvents.h"
#include "WinUtils.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/WindowsVersion.h"
Expand Down
3 changes: 2 additions & 1 deletion widget/windows/WinPointerEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#define WinPointerEvents_h__

#include "mozilla/MouseEvents.h"
#include "nsWindow.h"
#include "touchinjection_sdk80.h"
#include <windef.h>

// Define PointerEvent related macros and structures when building code on
// Windows version before Win8.
Expand Down
Loading

0 comments on commit 13e5127

Please sign in to comment.