From 0fbfe07d7efd9b771540d99165056da38e224baf Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Tue, 24 Sep 2013 19:04:14 +0900 Subject: [PATCH] Bug 912956 part.2 Rename nsEvent.h to mozilla/EventForwards.h and sort out it r=roc --HG-- rename : widget/nsEvent.h => widget/EventForwards.h --- content/base/public/Element.h | 2 +- content/base/public/nsContentUtils.h | 4 +- content/events/public/nsEventDispatcher.h | 2 +- content/events/public/nsIPrivateTextEvent.h | 1 - content/events/src/TextComposition.h | 2 +- content/events/src/Touch.h | 2 +- content/events/src/nsContentEventHandler.h | 3 +- content/events/src/nsDOMUIEvent.h | 1 - content/events/src/nsEventStateManager.h | 2 - content/events/src/nsIMEStateManager.h | 2 +- content/svg/content/src/SVGZoomEvent.h | 2 +- docshell/base/nsILinkHandler.h | 2 +- dom/base/nsDOMWindowUtils.h | 1 - dom/base/nsIScriptGlobalObject.h | 3 +- dom/base/nsPIDOMWindow.h | 7 + dom/base/nsQueryContentEventResult.h | 2 +- dom/interfaces/events/nsIDOMEvent.idl | 5 +- dom/interfaces/events/nsIDOMEventTarget.idl | 2 +- dom/plugins/base/nsIPluginInstanceOwner.idl | 2 +- dom/plugins/ipc/PluginLibrary.h | 2 +- editor/libeditor/base/nsEditor.cpp | 1 - editor/libeditor/base/nsEditor.h | 2 +- gfx/layers/Layers.h | 2 +- gfx/layers/composite/APZCTreeManager.h | 3 +- gfx/layers/ipc/AsyncPanZoomController.cpp | 1 - gfx/layers/ipc/AsyncPanZoomController.h | 2 +- gfx/layers/ipc/GestureEventListener.h | 2 +- layout/base/PositionedEventTargeting.h | 2 +- layout/base/nsIPresShell.h | 2 +- layout/forms/nsRangeFrame.h | 2 +- layout/generic/nsCanvasFrame.h | 2 +- layout/generic/nsFrameSetFrame.h | 1 - parser/html/nsHtml5TreeBuilderCppSupplement.h | 2 - view/public/nsView.h | 2 +- view/public/nsViewManager.h | 2 +- widget/{nsEvent.h => EventForwards.h} | 161 +++++++++--------- widget/InputData.h | 3 +- widget/cocoa/TextInputHandler.h | 3 +- widget/cocoa/nsCocoaUtils.h | 3 +- widget/cocoa/nsMenuUtilsX.h | 1 - widget/cocoa/nsStandaloneNativeMenu.mm | 1 - widget/gonk/GonkKeyMapping.h | 2 +- widget/gtk/nsGtkKeyUtils.h | 2 +- widget/moz.build | 2 +- widget/nsGUIEvent.h | 25 +-- widget/nsINativeKeyBindings.h | 2 +- widget/nsIWidget.h | 3 +- widget/nsIWidgetListener.h | 21 +++ widget/qt/nsQtKeyUtils.h | 2 +- widget/shared/WidgetUtils.h | 2 +- widget/windows/KeyboardLayout.h | 2 +- widget/windows/WinIMEHandler.h | 1 - widget/windows/WinMouseScrollHandler.h | 2 +- widget/windows/nsTextStore.h | 1 - widget/windows/nsWindow.h | 2 +- widget/windows/winrt/MetroInput.h | 4 +- widget/xpwidgets/nsBaseWidget.h | 2 + xpfe/appshell/src/nsWebShellWindow.h | 1 - xpfe/appshell/src/nsXULWindow.h | 2 +- 59 files changed, 164 insertions(+), 163 deletions(-) rename widget/{nsEvent.h => EventForwards.h} (55%) diff --git a/content/base/public/Element.h b/content/base/public/Element.h index 3ae358e2cb2f..655200e68566 100644 --- a/content/base/public/Element.h +++ b/content/base/public/Element.h @@ -33,8 +33,8 @@ #include "mozilla/dom/Attr.h" #include "nsISMILAttr.h" #include "nsClientRect.h" -#include "nsEvent.h" #include "nsAttrValue.h" +#include "mozilla/EventForwards.h" #include "mozilla/dom/BindingDeclarations.h" #include "Units.h" diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index 5067c0067ec1..5e590a7c7a05 100644 --- a/content/base/public/nsContentUtils.h +++ b/content/base/public/nsContentUtils.h @@ -21,6 +21,7 @@ #include "js/TypeDecls.h" #include "js/RootingAPI.h" #include "mozilla/Assertions.h" +#include "mozilla/EventForwards.h" #include "mozilla/GuardObjects.h" #include "mozilla/TimeStamp.h" #include "nsContentListDeclarations.h" @@ -34,8 +35,6 @@ class imgIRequest; class imgLoader; class imgRequestProxy; class nsAutoScriptBlockerSuppressNodeRemoved; -class nsDragEvent; -class nsEvent; class nsEventListenerManager; class nsHtml5StringParser; class nsIChannel; @@ -84,7 +83,6 @@ class nsIWidget; class nsIWordBreaker; class nsIXPConnect; class nsIXPConnectJSObjectHolder; -class nsKeyEvent; class nsNodeInfoManager; class nsPIDOMWindow; class nsPresContext; diff --git a/content/events/public/nsEventDispatcher.h b/content/events/public/nsEventDispatcher.h index 8b84612bf88e..1ba5857cdc7b 100644 --- a/content/events/public/nsEventDispatcher.h +++ b/content/events/public/nsEventDispatcher.h @@ -7,8 +7,8 @@ #ifndef nsEventDispatcher_h___ #define nsEventDispatcher_h___ +#include "mozilla/EventForwards.h" #include "nsCOMPtr.h" -#include "nsEvent.h" class nsEventTargetChainItem; class nsIDOMEvent; diff --git a/content/events/public/nsIPrivateTextEvent.h b/content/events/public/nsIPrivateTextEvent.h index d767a85fbf82..e17d793d0014 100644 --- a/content/events/public/nsIPrivateTextEvent.h +++ b/content/events/public/nsIPrivateTextEvent.h @@ -6,7 +6,6 @@ #ifndef nsIPrivateTextEvent_h__ #define nsIPrivateTextEvent_h__ -#include "nsEvent.h" #include "nsISupports.h" #include "nsIPrivateTextRange.h" diff --git a/content/events/src/TextComposition.h b/content/events/src/TextComposition.h index fd25793f01e7..8d9307e9e349 100644 --- a/content/events/src/TextComposition.h +++ b/content/events/src/TextComposition.h @@ -8,12 +8,12 @@ #define mozilla_TextComposition_h #include "nsCOMPtr.h" -#include "nsEvent.h" #include "nsINode.h" #include "nsIWidget.h" #include "nsTArray.h" #include "nsThreadUtils.h" #include "mozilla/Attributes.h" +#include "mozilla/EventForwards.h" class nsDispatchingCallback; class nsIMEStateManager; diff --git a/content/events/src/Touch.h b/content/events/src/Touch.h index 1d55beeeb5dc..58b262e6109e 100644 --- a/content/events/src/Touch.h +++ b/content/events/src/Touch.h @@ -7,12 +7,12 @@ #define mozilla_dom_Touch_h #include "mozilla/Attributes.h" +#include "mozilla/EventForwards.h" #include "nsWrapperCache.h" #include "nsAutoPtr.h" #include "Units.h" class nsPresContext; -class nsEvent; namespace mozilla { namespace dom { diff --git a/content/events/src/nsContentEventHandler.h b/content/events/src/nsContentEventHandler.h index 0eb208d64ee6..725c43d1f314 100644 --- a/content/events/src/nsContentEventHandler.h +++ b/content/events/src/nsContentEventHandler.h @@ -10,11 +10,10 @@ #include "nsISelection.h" #include "nsRange.h" +#include "mozilla/EventForwards.h" class nsCaret; class nsPresContext; -class nsQueryContentEvent; -class nsSelectionEvent; struct nsRect; diff --git a/content/events/src/nsDOMUIEvent.h b/content/events/src/nsDOMUIEvent.h index a54b8d488f52..6057331a49a0 100644 --- a/content/events/src/nsDOMUIEvent.h +++ b/content/events/src/nsDOMUIEvent.h @@ -10,7 +10,6 @@ #include "nsIDOMUIEvent.h" #include "nsDOMEvent.h" #include "nsLayoutUtils.h" -#include "nsEvent.h" #include "mozilla/dom/UIEventBinding.h" #include "nsPresContext.h" #include "nsDeviceContext.h" diff --git a/content/events/src/nsEventStateManager.h b/content/events/src/nsEventStateManager.h index d8a13a6eef85..95a8d7d71a12 100644 --- a/content/events/src/nsEventStateManager.h +++ b/content/events/src/nsEventStateManager.h @@ -8,7 +8,6 @@ #include "mozilla/TypedEnum.h" -#include "nsEvent.h" #include "nsGUIEvent.h" #include "nsIObserver.h" #include "nsWeakReference.h" @@ -28,7 +27,6 @@ class nsIDocShellTreeItem; class imgIContainer; class nsDOMDataTransfer; class MouseEnterLeaveDispatcher; -class nsEventStates; class nsIMarkupDocumentViewer; class nsIScrollableFrame; class nsITimer; diff --git a/content/events/src/nsIMEStateManager.h b/content/events/src/nsIMEStateManager.h index 78a8d6786ad2..0dca8b1c68db 100644 --- a/content/events/src/nsIMEStateManager.h +++ b/content/events/src/nsIMEStateManager.h @@ -6,7 +6,7 @@ #ifndef nsIMEStateManager_h__ #define nsIMEStateManager_h__ -#include "nsEvent.h" +#include "mozilla/EventForwards.h" #include "nsIWidget.h" class nsDispatchingCallback; diff --git a/content/svg/content/src/SVGZoomEvent.h b/content/svg/content/src/SVGZoomEvent.h index 6d99fc3848bc..878cfc17ec68 100644 --- a/content/svg/content/src/SVGZoomEvent.h +++ b/content/svg/content/src/SVGZoomEvent.h @@ -9,9 +9,9 @@ #include "nsAutoPtr.h" #include "nsDOMUIEvent.h" #include "DOMSVGPoint.h" +#include "mozilla/EventForwards.h" #include "mozilla/dom/SVGZoomEventBinding.h" -class nsGUIEvent; class nsISVGPoint; class nsPresContext; diff --git a/docshell/base/nsILinkHandler.h b/docshell/base/nsILinkHandler.h index 4408d49baf9f..0194e20995e3 100644 --- a/docshell/base/nsILinkHandler.h +++ b/docshell/base/nsILinkHandler.h @@ -6,8 +6,8 @@ #define nsILinkHandler_h___ #include "nsISupports.h" +#include "mozilla/EventForwards.h" -class nsGUIEvent; class nsIContent; class nsIDocShell; class nsIInputStream; diff --git a/dom/base/nsDOMWindowUtils.h b/dom/base/nsDOMWindowUtils.h index f1402aa5c19f..2b1f4d8029bb 100644 --- a/dom/base/nsDOMWindowUtils.h +++ b/dom/base/nsDOMWindowUtils.h @@ -9,7 +9,6 @@ #include "nsWeakReference.h" #include "nsIDOMWindowUtils.h" -#include "nsEvent.h" #include "mozilla/Attributes.h" class nsGlobalWindow; diff --git a/dom/base/nsIScriptGlobalObject.h b/dom/base/nsIScriptGlobalObject.h index 9fb55bd2c021..766c8b7cbf34 100644 --- a/dom/base/nsIScriptGlobalObject.h +++ b/dom/base/nsIScriptGlobalObject.h @@ -8,12 +8,11 @@ #define nsIScriptGlobalObject_h__ #include "nsISupports.h" -#include "nsEvent.h" #include "nsIGlobalObject.h" #include "js/TypeDecls.h" +#include "mozilla/EventForwards.h" class nsIScriptContext; -class nsScriptErrorEvent; class nsIScriptGlobalObject; // A helper function for nsIScriptGlobalObject implementations to use diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index 2bb1006cb3f5..580e420848a3 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -52,6 +52,13 @@ enum PopupControlState { openOverridden // disallow window open }; +enum UIStateChangeType +{ + UIStateChangeType_NoChange, + UIStateChangeType_Set, + UIStateChangeType_Clear +}; + #define NS_PIDOMWINDOW_IID \ { 0x4f4eadf9, 0xe795, 0x48e5, \ { 0x89, 0x4b, 0x04, 0x40, 0xb2, 0x5d, 0xa6, 0xfa } } diff --git a/dom/base/nsQueryContentEventResult.h b/dom/base/nsQueryContentEventResult.h index 5bbabbd32bc2..c265a3df29a3 100644 --- a/dom/base/nsQueryContentEventResult.h +++ b/dom/base/nsQueryContentEventResult.h @@ -7,8 +7,8 @@ #include "nsString.h" #include "nsRect.h" #include "mozilla/Attributes.h" +#include "mozilla/EventForwards.h" -class nsQueryContentEvent; class nsIWidget; class nsQueryContentEventResult MOZ_FINAL : public nsIQueryContentEventResult diff --git a/dom/interfaces/events/nsIDOMEvent.idl b/dom/interfaces/events/nsIDOMEvent.idl index 63f2f2ab031b..84574a50162e 100644 --- a/dom/interfaces/events/nsIDOMEvent.idl +++ b/dom/interfaces/events/nsIDOMEvent.idl @@ -17,17 +17,14 @@ interface nsIDOMEventTarget; #undef ERROR #endif -class nsEvent; +#include "mozilla/EventForwards.h" class nsDOMEvent; -class nsCommandEvent; class nsPresContext; class nsInvalidateRequestList; namespace IPC { class Message; } namespace mozilla { -class WheelEvent; - namespace dom { class EventTarget; } // namespace dom diff --git a/dom/interfaces/events/nsIDOMEventTarget.idl b/dom/interfaces/events/nsIDOMEventTarget.idl index bb00563295dd..e25700b1a7d0 100644 --- a/dom/interfaces/events/nsIDOMEventTarget.idl +++ b/dom/interfaces/events/nsIDOMEventTarget.idl @@ -6,7 +6,7 @@ #include "domstubs.idl" %{C++ -#include "nsEvent.h" +#include "mozilla/EventForwards.h" #include "mozilla/dom/Nullable.h" #include "js/TypeDecls.h" diff --git a/dom/plugins/base/nsIPluginInstanceOwner.idl b/dom/plugins/base/nsIPluginInstanceOwner.idl index 58e109cd47fe..49a0f1faabfe 100644 --- a/dom/plugins/base/nsIPluginInstanceOwner.idl +++ b/dom/plugins/base/nsIPluginInstanceOwner.idl @@ -11,8 +11,8 @@ interface nsIDocument; %{C++ #include "npapi.h" +#include "mozilla/EventForwards.h" class nsNPAPIPluginInstance; -class nsPluginEvent; %} [ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance); diff --git a/dom/plugins/ipc/PluginLibrary.h b/dom/plugins/ipc/PluginLibrary.h index f981a92bda79..d012e2366166 100644 --- a/dom/plugins/ipc/PluginLibrary.h +++ b/dom/plugins/ipc/PluginLibrary.h @@ -13,6 +13,7 @@ #include "nscore.h" #include "nsTArray.h" #include "nsError.h" +#include "mozilla/EventForwards.h" class gfxASurface; class gfxContext; @@ -20,7 +21,6 @@ class nsCString; struct nsIntRect; struct nsIntSize; class nsNPAPIPlugin; -class nsGUIEvent; namespace mozilla { namespace layers { diff --git a/editor/libeditor/base/nsEditor.cpp b/editor/libeditor/base/nsEditor.cpp index f39aa176fcb8..ccf7ea28396c 100644 --- a/editor/libeditor/base/nsEditor.cpp +++ b/editor/libeditor/base/nsEditor.cpp @@ -44,7 +44,6 @@ #include "nsEditorEventListener.h" // for nsEditorEventListener #include "nsEditorUtils.h" // for nsAutoRules, etc #include "nsError.h" // for NS_OK, etc -#include "nsEvent.h" // for nsEventStatus, etc #include "nsFocusManager.h" // for nsFocusManager #include "nsFrameSelection.h" // for nsFrameSelection #include "nsGUIEvent.h" // for nsKeyEvent, nsEvent, etc diff --git a/editor/libeditor/base/nsEditor.h b/editor/libeditor/base/nsEditor.h index 30e9efafb32c..b9b9a6ee0a68 100644 --- a/editor/libeditor/base/nsEditor.h +++ b/editor/libeditor/base/nsEditor.h @@ -7,6 +7,7 @@ #define __editor_h__ #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc. +#include "mozilla/EventForwards.h" // for nsKeyEvent #include "mozilla/TypedEnum.h" // for MOZ_BEGIN_ENUM_CLASS, etc. #include "nsAutoPtr.h" // for nsRefPtr #include "nsCOMArray.h" // for nsCOMArray @@ -63,7 +64,6 @@ class nsISelection; class nsISupports; class nsITransaction; class nsIWidget; -class nsKeyEvent; class nsRange; class nsString; class nsTransactionManager; diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 54e5e56d2c41..8311aba4b067 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -21,6 +21,7 @@ #include "gfxRect.h" // for gfxRect #include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2, etc #include "mozilla/DebugOnly.h" // for DebugOnly +#include "mozilla/EventForwards.h" // for nsPaintEvent #include "mozilla/RefPtr.h" // for TemporaryRef #include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration #include "mozilla/gfx/BaseMargin.h" // for BaseMargin @@ -47,7 +48,6 @@ class gfxContext; -class nsPaintEvent; extern uint8_t gLayerManagerLayerBuilder; diff --git a/gfx/layers/composite/APZCTreeManager.h b/gfx/layers/composite/APZCTreeManager.h index f20c2d1bbe14..1bdc4bd07cbc 100644 --- a/gfx/layers/composite/APZCTreeManager.h +++ b/gfx/layers/composite/APZCTreeManager.h @@ -12,15 +12,14 @@ #include "gfxPoint.h" // for gfxPoint #include "gfx3DMatrix.h" // for gfx3DMatrix #include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2 +#include "mozilla/EventForwards.h" // for nsInputEvent, nsEventStatus #include "mozilla/Monitor.h" // for Monitor #include "nsAutoPtr.h" // for nsRefPtr #include "nsCOMPtr.h" // for already_AddRefed -#include "nsEvent.h" // for nsEventStatus #include "nsISupportsImpl.h" #include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc class gfx3DMatrix; -class nsInputEvent; template class nsTArray; namespace mozilla { diff --git a/gfx/layers/ipc/AsyncPanZoomController.cpp b/gfx/layers/ipc/AsyncPanZoomController.cpp index 6027a7ec01c0..e489259a97d0 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.cpp +++ b/gfx/layers/ipc/AsyncPanZoomController.cpp @@ -41,7 +41,6 @@ #include "nsAutoPtr.h" // for nsRefPtr #include "nsCOMPtr.h" // for already_AddRefed #include "nsDebug.h" // for NS_WARNING -#include "nsEvent.h" #include "nsGUIEvent.h" // for nsInputEvent, nsTouchEvent, etc #include "nsISupportsImpl.h" #include "nsMathUtils.h" // for NS_hypot diff --git a/gfx/layers/ipc/AsyncPanZoomController.h b/gfx/layers/ipc/AsyncPanZoomController.h index 96a1a440efbd..2c0326cad3ca 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.h +++ b/gfx/layers/ipc/AsyncPanZoomController.h @@ -9,6 +9,7 @@ #include "GeckoContentController.h" #include "mozilla/Attributes.h" +#include "mozilla/EventForwards.h" #include "mozilla/Monitor.h" #include "mozilla/ReentrantMonitor.h" #include "mozilla/RefPtr.h" @@ -16,7 +17,6 @@ #include "Axis.h" #include "TaskThrottler.h" #include "gfx3DMatrix.h" -#include "nsEvent.h" #include "base/message_loop.h" diff --git a/gfx/layers/ipc/GestureEventListener.h b/gfx/layers/ipc/GestureEventListener.h index e573cea5c4d9..f25c1b6bd2ca 100644 --- a/gfx/layers/ipc/GestureEventListener.h +++ b/gfx/layers/ipc/GestureEventListener.h @@ -11,8 +11,8 @@ #include "InputData.h" // for MultiTouchInput, etc #include "Units.h" // for ScreenIntPoint #include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2 +#include "mozilla/EventForwards.h" // for nsEventStatus #include "nsAutoPtr.h" // for nsRefPtr -#include "nsEvent.h" // for nsEventStatus #include "nsISupportsImpl.h" #include "nsTArray.h" // for nsTArray diff --git a/layout/base/PositionedEventTargeting.h b/layout/base/PositionedEventTargeting.h index fbe92d15845a..125ce807891c 100644 --- a/layout/base/PositionedEventTargeting.h +++ b/layout/base/PositionedEventTargeting.h @@ -6,9 +6,9 @@ #define mozilla_PositionedEventTargeting_h #include +#include "mozilla/EventForwards.h" class nsIFrame; -class nsGUIEvent; struct nsPoint; namespace mozilla { diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index 3e5eacb27210..2e696968cd64 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -20,6 +20,7 @@ #ifndef nsIPresShell_h___ #define nsIPresShell_h___ +#include "mozilla/EventForwards.h" #include "mozilla/MemoryReporting.h" #include "gfxPoint.h" #include "nsTHashtable.h" @@ -28,7 +29,6 @@ #include "nsQueryFrame.h" #include "nsCoord.h" #include "nsColor.h" -#include "nsEvent.h" #include "nsCompatibility.h" #include "nsFrameManagerBase.h" #include "mozFlushType.h" diff --git a/layout/forms/nsRangeFrame.h b/layout/forms/nsRangeFrame.h index 3456f05d1f1d..ec6eb082394a 100644 --- a/layout/forms/nsRangeFrame.h +++ b/layout/forms/nsRangeFrame.h @@ -8,12 +8,12 @@ #include "mozilla/Attributes.h" #include "mozilla/Decimal.h" +#include "mozilla/EventForwards.h" #include "nsContainerFrame.h" #include "nsIAnonymousContentCreator.h" #include "nsCOMPtr.h" class nsBaseContentList; -class nsGUIEvent; class nsRangeFrame : public nsContainerFrame, public nsIAnonymousContentCreator diff --git a/layout/generic/nsCanvasFrame.h b/layout/generic/nsCanvasFrame.h index 57348480b00c..a940e6e1e9a8 100644 --- a/layout/generic/nsCanvasFrame.h +++ b/layout/generic/nsCanvasFrame.h @@ -9,13 +9,13 @@ #define nsCanvasFrame_h___ #include "mozilla/Attributes.h" +#include "mozilla/EventForwards.h" #include "nsContainerFrame.h" #include "nsIScrollPositionListener.h" #include "nsDisplayList.h" class nsPresContext; class nsRenderingContext; -class nsEvent; /** * Root frame class. diff --git a/layout/generic/nsFrameSetFrame.h b/layout/generic/nsFrameSetFrame.h index fd693ba3e5f5..fc51b3959751 100644 --- a/layout/generic/nsFrameSetFrame.h +++ b/layout/generic/nsFrameSetFrame.h @@ -19,7 +19,6 @@ struct nsHTMLReflowState; struct nsSize; class nsIAtom; class nsHTMLFramesetBorderFrame; -class nsGUIEvent; class nsHTMLFramesetFrame; #define NO_COLOR 0xFFFFFFFA diff --git a/parser/html/nsHtml5TreeBuilderCppSupplement.h b/parser/html/nsHtml5TreeBuilderCppSupplement.h index 45fc3e07c910..a2fd70495543 100644 --- a/parser/html/nsHtml5TreeBuilderCppSupplement.h +++ b/parser/html/nsHtml5TreeBuilderCppSupplement.h @@ -6,8 +6,6 @@ #include "nsError.h" #include "nsIPresShell.h" -#include "nsEvent.h" -#include "nsGUIEvent.h" #include "nsEventDispatcher.h" #include "nsNodeUtils.h" #include "nsIFrame.h" diff --git a/view/public/nsView.h b/view/public/nsView.h index afbb64d65c62..85cb5b15ab7a 100644 --- a/view/public/nsView.h +++ b/view/public/nsView.h @@ -11,8 +11,8 @@ #include "nsPoint.h" #include "nsRegion.h" #include "nsCRT.h" -#include "nsEvent.h" #include "nsIWidgetListener.h" +#include "mozilla/EventForwards.h" class nsViewManager; class nsIWidget; diff --git a/view/public/nsViewManager.h b/view/public/nsViewManager.h index 847df011b1f9..db241d28a2c2 100644 --- a/view/public/nsViewManager.h +++ b/view/public/nsViewManager.h @@ -8,11 +8,11 @@ #include "nscore.h" #include "nsView.h" -#include "nsEvent.h" #include "nsCOMPtr.h" #include "nsCRT.h" #include "nsVoidArray.h" #include "nsDeviceContext.h" +#include "mozilla/EventForwards.h" class nsIWidget; struct nsRect; diff --git a/widget/nsEvent.h b/widget/EventForwards.h similarity index 55% rename from widget/nsEvent.h rename to widget/EventForwards.h index 80cea20c3eea..c7c571f71770 100644 --- a/widget/nsEvent.h +++ b/widget/EventForwards.h @@ -3,87 +3,37 @@ * 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/. */ -#ifndef nsEvent_h__ -#define nsEvent_h__ +#ifndef mozilla_EventForwards_h__ +#define mozilla_EventForwards_h__ #include -/* - * This is in a separate header file because it needs to be included - * in many places where including nsGUIEvent.h would bring in many - * header files that are totally unnecessary. +/** + * XXX Following enums should be in BasicEvents.h. However, currently, it's + * impossible to use foward delearation for enum. */ -enum UIStateChangeType { - UIStateChangeType_NoChange, - UIStateChangeType_Set, - UIStateChangeType_Clear -}; - /** * Return status for event processors. */ - -enum nsEventStatus { - /// The event is ignored, do default processing - nsEventStatus_eIgnore, - /// The event is consumed, don't do default processing - nsEventStatus_eConsumeNoDefault, - /// The event is consumed, but do default processing - nsEventStatus_eConsumeDoDefault +enum nsEventStatus +{ + // The event is ignored, do default processing + nsEventStatus_eIgnore, + // The event is consumed, don't do default processing + nsEventStatus_eConsumeNoDefault, + // The event is consumed, but do default processing + nsEventStatus_eConsumeDoDefault }; -/** - * sizemode is an adjunct to widget size - */ -enum nsSizeMode { - nsSizeMode_Normal = 0, - nsSizeMode_Minimized, - nsSizeMode_Maximized, - nsSizeMode_Fullscreen -}; - -struct nsAlternativeCharCode; -struct nsTextRangeStyle; -struct nsTextRange; - -class nsEvent; -class nsGUIEvent; -class nsScriptErrorEvent; -class nsScrollbarEvent; -class nsScrollPortEvent; -class nsScrollAreaEvent; -class nsInputEvent; -class nsMouseEvent_base; -class nsMouseEvent; -class nsDragEvent; -class nsKeyEvent; -class nsTextEvent; -class nsCompositionEvent; -class nsMouseScrollEvent; -class nsGestureNotifyEvent; -class nsQueryContentEvent; -class nsFocusEvent; -class nsSelectionEvent; -class nsContentCommandEvent; -class nsTouchEvent; -class nsFormEvent; -class nsCommandEvent; -class nsUIEvent; -class nsSimpleGestureEvent; -class nsTransitionEvent; -class nsAnimationEvent; -class nsPluginEvent; - namespace mozilla { -struct EventFlags; - -class WheelEvent; - -// All modifier keys should be defined here. This is used for managing -// modifier states for DOM Level 3 or later. -enum Modifier { +/** + * All modifier keys should be defined here. This is used for managing + * modifier states for DOM Level 3 or later. + */ +enum Modifier +{ MODIFIER_ALT = 0x0001, MODIFIER_ALTGRAPH = 0x0002, MODIFIER_CAPSLOCK = 0x0004, @@ -102,7 +52,8 @@ typedef uint16_t Modifiers; #define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \ KEY_NAME_INDEX_##aCPPName, -enum KeyNameIndex { +enum KeyNameIndex +{ #include "nsDOMKeyNameList.h" // There shouldn't be "," at the end of enum definition, this dummy item // avoids bustage on some platforms. @@ -113,16 +64,62 @@ enum KeyNameIndex { } // namespace mozilla -#define NS_DOM_KEYNAME_ALT "Alt" -#define NS_DOM_KEYNAME_ALTGRAPH "AltGraph" -#define NS_DOM_KEYNAME_CAPSLOCK "CapsLock" -#define NS_DOM_KEYNAME_CONTROL "Control" -#define NS_DOM_KEYNAME_FN "Fn" -#define NS_DOM_KEYNAME_META "Meta" -#define NS_DOM_KEYNAME_NUMLOCK "NumLock" -#define NS_DOM_KEYNAME_SCROLLLOCK "ScrollLock" -#define NS_DOM_KEYNAME_SHIFT "Shift" -#define NS_DOM_KEYNAME_SYMBOLLOCK "SymbolLock" -#define NS_DOM_KEYNAME_OS "OS" +/** + * All header files should include this header instead of *Events.h. + */ -#endif // nsEvent_h__ +// BasicEvents.h +namespace mozilla { +struct EventFlags; +} // namespace mozilla + +class nsEvent; +class nsGUIEvent; +class nsInputEvent; +class nsUIEvent; + +// TextEvents.h +struct nsAlternativeCharCode; +struct nsTextRangeStyle; +struct nsTextRange; + +class nsKeyEvent; +class nsTextEvent; +class nsCompositionEvent; +class nsQueryContentEvent; +class nsSelectionEvent; + +// MouseEvents.h +class nsMouseEvent_base; +class nsMouseEvent; +class nsDragEvent; +class nsMouseScrollEvent; + +namespace mozilla { +class WheelEvent; +} // namespace mozilla + +// TouchEvents.h +class nsGestureNotifyEvent; +class nsTouchEvent; +class nsSimpleGestureEvent; + +// ContentEvents.h +class nsScriptErrorEvent; +class nsScrollPortEvent; +class nsScrollAreaEvent; +class nsFormEvent; +class nsClipboardEvent; +class nsFocusEvent; +class nsTransitionEvent; +class nsAnimationEvent; + +// MiscEvents.h +class nsCommandEvent; +class nsContentCommandEvent; +class nsPluginEvent; + +// content/events/public/nsMutationEvent.h +class nsMutationEvent; + +#endif // mozilla_EventForwards_h__ diff --git a/widget/InputData.h b/widget/InputData.h index 6dd7127c665a..c56abc99090c 100644 --- a/widget/InputData.h +++ b/widget/InputData.h @@ -10,9 +10,8 @@ #include "nsPoint.h" #include "nsTArray.h" #include "Units.h" +#include "mozilla/EventForwards.h" -class nsTouchEvent; -class nsMouseEvent; namespace mozilla { diff --git a/widget/cocoa/TextInputHandler.h b/widget/cocoa/TextInputHandler.h index 9c86fde58a51..a2824e58f77e 100644 --- a/widget/cocoa/TextInputHandler.h +++ b/widget/cocoa/TextInputHandler.h @@ -17,10 +17,9 @@ #include "nsITimer.h" #include "npapi.h" #include "nsTArray.h" -#include "nsEvent.h" +#include "mozilla/EventForwards.h" class nsChildView; -struct nsTextRange; namespace mozilla { namespace widget { diff --git a/widget/cocoa/nsCocoaUtils.h b/widget/cocoa/nsCocoaUtils.h index 4927f7e4c776..c16491e15605 100644 --- a/widget/cocoa/nsCocoaUtils.h +++ b/widget/cocoa/nsCocoaUtils.h @@ -10,13 +10,14 @@ #include "nsRect.h" #include "imgIContainer.h" -#include "nsEvent.h" #include "npapi.h" #include "nsTArray.h" // This must be the last include: #include "nsObjCExceptions.h" +#include "mozilla/EventForwards.h" + // Declare the backingScaleFactor method that we want to call // on NSView/Window/Screen objects, if they recognize it. @interface NSObject (BackingScaleFactorCategory) diff --git a/widget/cocoa/nsMenuUtilsX.h b/widget/cocoa/nsMenuUtilsX.h index 2d7b5c2b6e17..a71147b3898c 100644 --- a/widget/cocoa/nsMenuUtilsX.h +++ b/widget/cocoa/nsMenuUtilsX.h @@ -7,7 +7,6 @@ #define nsMenuUtilsX_h_ #include "nscore.h" -#include "nsEvent.h" #include "nsMenuBaseX.h" #import diff --git a/widget/cocoa/nsStandaloneNativeMenu.mm b/widget/cocoa/nsStandaloneNativeMenu.mm index f60329ac63f7..4287c2ecef1e 100644 --- a/widget/cocoa/nsStandaloneNativeMenu.mm +++ b/widget/cocoa/nsStandaloneNativeMenu.mm @@ -9,7 +9,6 @@ #include "nsMenuUtilsX.h" #include "nsIDOMElement.h" #include "nsIMutationObserver.h" -#include "nsEvent.h" #include "nsGUIEvent.h" #include "nsGkAtoms.h" #include "nsObjCExceptions.h" diff --git a/widget/gonk/GonkKeyMapping.h b/widget/gonk/GonkKeyMapping.h index ad70103c624e..360bbc7b3b82 100644 --- a/widget/gonk/GonkKeyMapping.h +++ b/widget/gonk/GonkKeyMapping.h @@ -16,8 +16,8 @@ #ifndef GONKKEYMAPPING_H #define GONKKEYMAPPING_H -#include "nsEvent.h" #include "libui/android_keycodes.h" +#include "mozilla/EventForwards.h" namespace mozilla { namespace widget { diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h index 3b3c1a9d251f..b5947151637c 100644 --- a/widget/gtk/nsGtkKeyUtils.h +++ b/widget/gtk/nsGtkKeyUtils.h @@ -8,8 +8,8 @@ #ifndef __nsGdkKeyUtils_h__ #define __nsGdkKeyUtils_h__ -#include "nsEvent.h" #include "nsTArray.h" +#include "mozilla/EventForwards.h" #include diff --git a/widget/moz.build b/widget/moz.build index 78f65596ed36..93cd3f23d8d9 100644 --- a/widget/moz.build +++ b/widget/moz.build @@ -99,7 +99,6 @@ MODULE = 'widget' EXPORTS += [ 'InputData.h', - 'nsEvent.h', 'nsGUIEvent.h', 'nsIDeviceContextSpec.h', 'nsINativeKeyBindings.h', @@ -112,6 +111,7 @@ EXPORTS += [ ] EXPORTS.mozilla += [ + 'EventForwards.h', 'LookAndFeel.h', 'WidgetUtils.h', ] diff --git a/widget/nsGUIEvent.h b/widget/nsGUIEvent.h index 4b5b2acd755c..6047c1d36067 100644 --- a/widget/nsGUIEvent.h +++ b/widget/nsGUIEvent.h @@ -10,7 +10,6 @@ #include "nsPoint.h" #include "nsRect.h" -#include "nsEvent.h" #include "nsString.h" #include "nsCOMPtr.h" #include "nsIAtom.h" @@ -25,6 +24,7 @@ #include "nsITransferable.h" #include "nsStyleConsts.h" #include "nsAutoPtr.h" +#include "mozilla/EventForwards.h" #include "mozilla/dom/EventTarget.h" #include "mozilla/dom/Touch.h" #include "Units.h" @@ -477,18 +477,19 @@ enum nsEventStructType { #endif /** - * Return status for event processors, nsEventStatus, is defined in - * nsEvent.h. + * Modifier key names. */ - -/** - * different types of (top-level) window z-level positioning - */ -enum nsWindowZ { - nsWindowZTop = 0, // on top - nsWindowZBottom, // on bottom - nsWindowZRelative // just below some specified widget -}; +#define NS_DOM_KEYNAME_ALT "Alt" +#define NS_DOM_KEYNAME_ALTGRAPH "AltGraph" +#define NS_DOM_KEYNAME_CAPSLOCK "CapsLock" +#define NS_DOM_KEYNAME_CONTROL "Control" +#define NS_DOM_KEYNAME_FN "Fn" +#define NS_DOM_KEYNAME_META "Meta" +#define NS_DOM_KEYNAME_NUMLOCK "NumLock" +#define NS_DOM_KEYNAME_SCROLLLOCK "ScrollLock" +#define NS_DOM_KEYNAME_SHIFT "Shift" +#define NS_DOM_KEYNAME_SYMBOLLOCK "SymbolLock" +#define NS_DOM_KEYNAME_OS "OS" namespace mozilla { diff --git a/widget/nsINativeKeyBindings.h b/widget/nsINativeKeyBindings.h index 3d6914bb20ae..d87234e456e1 100644 --- a/widget/nsINativeKeyBindings.h +++ b/widget/nsINativeKeyBindings.h @@ -7,7 +7,7 @@ #define nsINativeKeyBindings_h_ #include "nsISupports.h" -#include "nsEvent.h" +#include "mozilla/EventForwards.h" #define NS_INATIVEKEYBINDINGS_IID \ {0xc2baecc3, 0x1758, 0x4211, {0x96, 0xbe, 0xee, 0x1b, 0x1b, 0x7c, 0xd7, 0x6d}} diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index c93bea22ded0..684208bf4beb 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -11,11 +11,11 @@ #include "nsRect.h" #include "nsString.h" -#include "nsEvent.h" #include "nsCOMPtr.h" #include "nsWidgetInitData.h" #include "nsTArray.h" #include "nsXULAppAPI.h" +#include "mozilla/EventForwards.h" #include "mozilla/layers/LayersTypes.h" #include "mozilla/RefPtr.h" #include "Units.h" @@ -26,7 +26,6 @@ class nsRenderingContext; class nsDeviceContext; struct nsFont; class nsIRollupListener; -class nsGUIEvent; class imgIContainer; class gfxASurface; class nsIContent; diff --git a/widget/nsIWidgetListener.h b/widget/nsIWidgetListener.h index cb41bc8af6e1..59176722e69c 100644 --- a/widget/nsIWidgetListener.h +++ b/widget/nsIWidgetListener.h @@ -13,6 +13,27 @@ class nsView; class nsIPresShell; +/** + * sizemode is an adjunct to widget size + */ +enum nsSizeMode +{ + nsSizeMode_Normal = 0, + nsSizeMode_Minimized, + nsSizeMode_Maximized, + nsSizeMode_Fullscreen +}; + +/** + * different types of (top-level) window z-level positioning + */ +enum nsWindowZ +{ + nsWindowZTop = 0, // on top + nsWindowZBottom, // on bottom + nsWindowZRelative // just below some specified widget +}; + class nsIWidgetListener { public: diff --git a/widget/qt/nsQtKeyUtils.h b/widget/qt/nsQtKeyUtils.h index 13d203768eb8..41338d7327c7 100644 --- a/widget/qt/nsQtKeyUtils.h +++ b/widget/qt/nsQtKeyUtils.h @@ -8,7 +8,7 @@ #ifndef __nsQtKeyUtils_h__ #define __nsQtKeyUtils_h__ -#include "nsEvent.h" +#include "mozilla/EventForwards.h" int QtKeyCodeToDOMKeyCode (int aKeysym); int DOMKeyCodeToQtKeyCode (int aKeysym); diff --git a/widget/shared/WidgetUtils.h b/widget/shared/WidgetUtils.h index 5debf916acd9..65cf04b188f4 100644 --- a/widget/shared/WidgetUtils.h +++ b/widget/shared/WidgetUtils.h @@ -9,9 +9,9 @@ #include "nsCOMPtr.h" #include "nsIWidget.h" -#include "nsEvent.h" #include "nsPIDOMWindow.h" #include "nsIDOMWindow.h" +#include "mozilla/EventForwards.h" namespace mozilla { namespace widget { diff --git a/widget/windows/KeyboardLayout.h b/widget/windows/KeyboardLayout.h index 1e4ade473387..8e02b55ea4a0 100644 --- a/widget/windows/KeyboardLayout.h +++ b/widget/windows/KeyboardLayout.h @@ -8,10 +8,10 @@ #include "nscore.h" #include "nsAutoPtr.h" -#include "nsEvent.h" #include "nsString.h" #include "nsWindowBase.h" #include "nsWindowDefs.h" +#include "mozilla/EventForwards.h" #include #define NS_NUM_OF_KEYS 70 diff --git a/widget/windows/WinIMEHandler.h b/widget/windows/WinIMEHandler.h index f42ab5fe70b7..a418a3bdf3c2 100644 --- a/widget/windows/WinIMEHandler.h +++ b/widget/windows/WinIMEHandler.h @@ -7,7 +7,6 @@ #define WinIMEHandler_h_ #include "nscore.h" -#include "nsEvent.h" #include "nsIWidget.h" #include #include diff --git a/widget/windows/WinMouseScrollHandler.h b/widget/windows/WinMouseScrollHandler.h index 4a1c857e2c94..6e853caf9daf 100644 --- a/widget/windows/WinMouseScrollHandler.h +++ b/widget/windows/WinMouseScrollHandler.h @@ -9,8 +9,8 @@ #include "nscore.h" #include "nsDebug.h" -#include "nsEvent.h" #include "mozilla/Assertions.h" +#include "mozilla/EventForwards.h" #include "mozilla/TimeStamp.h" #include diff --git a/widget/windows/nsTextStore.h b/widget/windows/nsTextStore.h index bd09a3f06373..509f14b5ec19 100644 --- a/widget/windows/nsTextStore.h +++ b/widget/windows/nsTextStore.h @@ -32,7 +32,6 @@ struct ITfDocumentMgr; struct ITfDisplayAttributeMgr; struct ITfCategoryMgr; class nsWindow; -class nsTextEvent; #ifdef MOZ_METRO class MetroWidget; #endif diff --git a/widget/windows/nsWindow.h b/widget/windows/nsWindow.h index 40f9f39b014e..b460c32d157a 100644 --- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -18,12 +18,12 @@ #include "nsToolkit.h" #include "nsString.h" #include "nsTArray.h" -#include "nsEvent.h" #include "gfxWindowsSurface.h" #include "nsWindowDbg.h" #include "cairo.h" #include "nsITimer.h" #include "nsRegion.h" +#include "mozilla/EventForwards.h" #include "mozilla/TimeStamp.h" #include "nsMargin.h" diff --git a/widget/windows/winrt/MetroInput.h b/widget/windows/winrt/MetroInput.h index 4d9eb3d4ae7c..96503ad371c2 100644 --- a/widget/windows/winrt/MetroInput.h +++ b/widget/windows/winrt/MetroInput.h @@ -8,10 +8,10 @@ // Moz headers (alphabetical) #include "keyboardlayout.h" // mModifierKeyState #include "nsBaseHashtable.h" // mTouches -#include "nsGUIEvent.h" // mTouchEvent (nsTouchEvent) #include "nsHashKeys.h" // type of key for mTouches #include "mozwrlbase.h" #include "nsDeque.h" +#include "mozilla/EventForwards.h" // System headers (alphabetical) #include // EventRegistrationToken @@ -21,8 +21,6 @@ // Moz forward declarations class MetroWidget; -enum nsEventStatus; -class nsGUIEvent; struct nsIntPoint; namespace mozilla { diff --git a/widget/xpwidgets/nsBaseWidget.h b/widget/xpwidgets/nsBaseWidget.h index 354874152e0d..4ff5c764b811 100644 --- a/widget/xpwidgets/nsBaseWidget.h +++ b/widget/xpwidgets/nsBaseWidget.h @@ -16,6 +16,8 @@ #include "nsAutoPtr.h" #include "nsIRollupListener.h" #include "nsIObserver.h" +#include "nsIWidgetListener.h" +#include "nsPIDOMWindow.h" #include class nsIContent; class nsAutoRollup; diff --git a/xpfe/appshell/src/nsWebShellWindow.h b/xpfe/appshell/src/nsWebShellWindow.h index a589116021a3..89f0fc9eacb5 100644 --- a/xpfe/appshell/src/nsWebShellWindow.h +++ b/xpfe/appshell/src/nsWebShellWindow.h @@ -7,7 +7,6 @@ #define nsWebShellWindow_h__ #include "mozilla/Mutex.h" -#include "nsEvent.h" #include "nsIWebProgressListener.h" #include "nsITimer.h" #include "nsCOMPtr.h" diff --git a/xpfe/appshell/src/nsXULWindow.h b/xpfe/appshell/src/nsXULWindow.h index 30ba7170937f..cd1f4d978c0f 100644 --- a/xpfe/appshell/src/nsXULWindow.h +++ b/xpfe/appshell/src/nsXULWindow.h @@ -28,9 +28,9 @@ #include "nsIXULWindow.h" #include "nsIPrompt.h" #include "nsIAuthPrompt.h" -#include "nsGUIEvent.h" #include "nsIXULBrowserWindow.h" #include "nsIWeakReference.h" +#include "nsIWidgetListener.h" namespace mozilla { namespace dom {