diff --git a/view/public/nsView.h b/view/public/nsView.h index 91edc51543c..fdcb52a331d 100644 --- a/view/public/nsView.h +++ b/view/public/nsView.h @@ -11,6 +11,7 @@ #include "nsPoint.h" #include "nsRegion.h" #include "nsCRT.h" +#include "nsWidgetInitData.h" // for nsWindowType #include "nsIWidgetListener.h" #include "mozilla/EventForwards.h" diff --git a/widget/nsIWidgetListener.h b/widget/nsIWidgetListener.h index bafbce35dbc..c5805acb53c 100644 --- a/widget/nsIWidgetListener.h +++ b/widget/nsIWidgetListener.h @@ -5,13 +5,15 @@ #ifndef nsIWidgetListener_h__ #define nsIWidgetListener_h__ -#include "nscore.h" -#include "nsIXULWindow.h" -#include "nsRegion.h" -#include "mozilla/BasicEvents.h" +#include + +#include "mozilla/EventForwards.h" class nsView; +class nsIntRegion; class nsIPresShell; +class nsIWidget; +class nsIXULWindow; /** * sizemode is an adjunct to widget size @@ -43,34 +45,35 @@ public: * this is likely a listener for a view, which can be determined using * GetView. If both methods return null, this will be an nsWebBrowser. */ - virtual nsIXULWindow* GetXULWindow() { return nullptr; } + virtual nsIXULWindow* GetXULWindow(); /** * If this listener is for an nsView, return it. */ - virtual nsView* GetView() { return nullptr; } + virtual nsView* GetView(); /** * Return the presshell for this widget listener. */ - virtual nsIPresShell* GetPresShell() { return nullptr; } + virtual nsIPresShell* GetPresShell(); /** * Called when a window is moved to location (x, y). Returns true if the * notification was handled. Coordinates are outer window screen coordinates. */ - virtual bool WindowMoved(nsIWidget* aWidget, int32_t aX, int32_t aY) { return false; } + virtual bool WindowMoved(nsIWidget* aWidget, int32_t aX, int32_t aY); /** * Called when a window is resized to (width, height). Returns true if the * notification was handled. Coordinates are outer window screen coordinates. */ - virtual bool WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight) { return false; } + virtual bool WindowResized(nsIWidget* aWidget, + int32_t aWidth, int32_t aHeight); /** * Called when the size mode (minimized, maximized, fullscreen) is changed. */ - virtual void SizeModeChanged(nsSizeMode sizeMode) { } + virtual void SizeModeChanged(nsSizeMode aSizeMode); /** * Called when the z-order of the window is changed. Returns true if the @@ -79,36 +82,37 @@ public: * window to place below. On return, aActualBelow will be set to the * window actually behind. This generally only applies to Windows. */ - virtual bool ZLevelChanged(bool aImmediate, nsWindowZ *aPlacement, - nsIWidget* aRequestBelow, nsIWidget** aActualBelow) { return false; } + virtual bool ZLevelChanged(bool aImmediate, nsWindowZ* aPlacement, + nsIWidget* aRequestBelow, + nsIWidget** aActualBelow); /** * Called when the window is activated and focused. */ - virtual void WindowActivated() { } + virtual void WindowActivated(); /** * Called when the window is deactivated and no longer focused. */ - virtual void WindowDeactivated() { } + virtual void WindowDeactivated(); /** * Called when the show/hide toolbar button on the Mac titlebar is pressed. */ - virtual void OSToolbarButtonPressed() { } + virtual void OSToolbarButtonPressed(); /** * Called when a request is made to close the window. Returns true if the * notification was handled. Returns true if the notification was handled. */ - virtual bool RequestWindowClose(nsIWidget* aWidget) { return false; } + virtual bool RequestWindowClose(nsIWidget* aWidget); /* * Indicate that a paint is about to occur on this window. This is called * at a time when it's OK to change the geometry of this widget or of * other widgets. Must be called before every call to PaintWindow. */ - virtual void WillPaintWindow(nsIWidget* aWidget) { } + virtual void WillPaintWindow(nsIWidget* aWidget); /** * Paint the specified region of the window. Returns true if the @@ -116,7 +120,7 @@ public: * This is called at a time when it is not OK to change the geometry of * this widget or of other widgets. */ - virtual bool PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion) { return false; } + virtual bool PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion); /** * Indicates that a paint occurred. @@ -124,21 +128,18 @@ public: * this widget or of other widgets. * Must be called after every call to PaintWindow. */ - virtual void DidPaintWindow() { } + virtual void DidPaintWindow(); /** * Request that layout schedules a repaint on the next refresh driver tick. */ - virtual void RequestRepaint() { } + virtual void RequestRepaint(); /** * Handle an event. */ virtual nsEventStatus HandleEvent(mozilla::WidgetGUIEvent* aEvent, - bool aUseAttachedEvents) - { - return nsEventStatus_eIgnore; - } + bool aUseAttachedEvents); }; #endif diff --git a/widget/xpwidgets/moz.build b/widget/xpwidgets/moz.build index 287fac0f460..ec3da93c0bb 100644 --- a/widget/xpwidgets/moz.build +++ b/widget/xpwidgets/moz.build @@ -29,6 +29,7 @@ CPP_SOURCES += [ 'nsFilePickerProxy.cpp', 'nsHTMLFormatConverter.cpp', 'nsIdleService.cpp', + 'nsIWidgetListener.cpp', 'nsPrimitiveHelpers.cpp', 'nsPrintOptionsImpl.cpp', 'nsPrintSession.cpp', diff --git a/widget/xpwidgets/nsIWidgetListener.cpp b/widget/xpwidgets/nsIWidgetListener.cpp new file mode 100644 index 00000000000..a1ad325fc8e --- /dev/null +++ b/widget/xpwidgets/nsIWidgetListener.cpp @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIWidgetListener.h" + +#include "nsRegion.h" +#include "nsView.h" +#include "nsIPresShell.h" +#include "nsIWidget.h" +#include "nsIXULWindow.h" + +#include "mozilla/BasicEvents.h" + +using namespace mozilla; + +nsIXULWindow* +nsIWidgetListener::GetXULWindow() +{ + return nullptr; +} + +nsView* +nsIWidgetListener::GetView() +{ + return nullptr; +} + +nsIPresShell* +nsIWidgetListener::GetPresShell() +{ + return nullptr; +} + +bool +nsIWidgetListener::WindowMoved(nsIWidget* aWidget, + int32_t aX, + int32_t aY) +{ + return false; +} + +bool +nsIWidgetListener::WindowResized(nsIWidget* aWidget, + int32_t aWidth, + int32_t aHeight) +{ + return false; +} + +void +nsIWidgetListener::SizeModeChanged(nsSizeMode aSizeMode) +{ +} + +bool +nsIWidgetListener::ZLevelChanged(bool aImmediate, + nsWindowZ* aPlacement, + nsIWidget* aRequestBelow, + nsIWidget** aActualBelow) +{ + return false; +} + +void +nsIWidgetListener::WindowActivated() +{ +} + +void +nsIWidgetListener::WindowDeactivated() +{ +} + +void +nsIWidgetListener::OSToolbarButtonPressed() +{ +} + +bool +nsIWidgetListener::RequestWindowClose(nsIWidget* aWidget) +{ + return false; +} + +void +nsIWidgetListener::WillPaintWindow(nsIWidget* aWidget) +{ +} + +bool +nsIWidgetListener::PaintWindow(nsIWidget* aWidget, + nsIntRegion aRegion) +{ + return false; +} + +void +nsIWidgetListener::DidPaintWindow() +{ +} + +void +nsIWidgetListener::RequestRepaint() +{ +} + +nsEventStatus +nsIWidgetListener::HandleEvent(WidgetGUIEvent* aEvent, + bool aUseAttachedEvents) +{ + return nsEventStatus_eIgnore; +} diff --git a/xpfe/appshell/src/nsAppShellService.cpp b/xpfe/appshell/src/nsAppShellService.cpp index 9b65479a810..c7ca8ee1644 100644 --- a/xpfe/appshell/src/nsAppShellService.cpp +++ b/xpfe/appshell/src/nsAppShellService.cpp @@ -23,7 +23,9 @@ #include "nsCRT.h" #include "prprf.h" +#include "nsWidgetInitData.h" #include "nsWidgetsCID.h" +#include "nsIWidget.h" #include "nsIRequestObserver.h" /* For implementing GetHiddenWindowAndJSContext */ diff --git a/xpfe/appshell/src/nsChromeTreeOwner.cpp b/xpfe/appshell/src/nsChromeTreeOwner.cpp index c5dabe5d875..83002cfd79a 100644 --- a/xpfe/appshell/src/nsChromeTreeOwner.cpp +++ b/xpfe/appshell/src/nsChromeTreeOwner.cpp @@ -19,6 +19,7 @@ #include "nsIAuthPrompt.h" #include "nsIBrowserDOMWindow.h" #include "nsIWebProgress.h" +#include "nsIWidget.h" #include "nsIWindowMediator.h" #include "nsIDOMChromeWindow.h" #include "nsIDOMNode.h" diff --git a/xpfe/appshell/src/nsContentTreeOwner.cpp b/xpfe/appshell/src/nsContentTreeOwner.cpp index e55604fcc61..7e28e3c5c2a 100644 --- a/xpfe/appshell/src/nsContentTreeOwner.cpp +++ b/xpfe/appshell/src/nsContentTreeOwner.cpp @@ -34,6 +34,7 @@ #include "nsDocShellCID.h" #include "nsIExternalURLHandlerService.h" #include "nsIMIMEInfo.h" +#include "nsIWidget.h" #include "mozilla/BrowserElementParent.h" #include "nsIDOMDocument.h" diff --git a/xpfe/appshell/src/nsWebShellWindow.cpp b/xpfe/appshell/src/nsWebShellWindow.cpp index 89b88762477..4e7132042bf 100644 --- a/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/xpfe/appshell/src/nsWebShellWindow.cpp @@ -26,6 +26,7 @@ #include "nsIDOMXULElement.h" +#include "nsWidgetInitData.h" #include "nsWidgetsCID.h" #include "nsIWidget.h" #include "nsIWidgetListener.h" diff --git a/xpfe/appshell/src/nsWebShellWindow.h b/xpfe/appshell/src/nsWebShellWindow.h index 89f0fc9eacb..88281bb96ba 100644 --- a/xpfe/appshell/src/nsWebShellWindow.h +++ b/xpfe/appshell/src/nsWebShellWindow.h @@ -16,6 +16,8 @@ /* Forward declarations.... */ class nsIURI; +struct nsWidgetInitData; + namespace mozilla { class WebShellWindowTimerCallback; } // namespace mozilla diff --git a/xpfe/appshell/src/nsXULWindow.h b/xpfe/appshell/src/nsXULWindow.h index cd1f4d978c0..3fc09dec556 100644 --- a/xpfe/appshell/src/nsXULWindow.h +++ b/xpfe/appshell/src/nsXULWindow.h @@ -17,6 +17,7 @@ #include "nsString.h" #include "nsWeakReference.h" #include "nsCOMArray.h" +#include "nsRect.h" // Interfaces needed #include "nsIBaseWindow.h"