Bug 975688 part.13 Rename nsDOMMouseScrollEvent to mozilla::dom::MouseScrollEvent r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 27 Feb 2014 19:51:14 +0900
changeset 171275 47dd7fd956290ff01881f3539b0755617ee904d7
parent 171274 c2cd59ab0a41a29188c6e009e8e02f996ca23f8a
child 171276 a9bc5bd8dc5a058d140dc81a67531237b7956ea0
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssmaug
bugs975688
milestone30.0a1
Bug 975688 part.13 Rename nsDOMMouseScrollEvent to mozilla::dom::MouseScrollEvent r=smaug
dom/bindings/Bindings.conf
dom/events/MouseScrollEvent.cpp
dom/events/MouseScrollEvent.h
dom/events/moz.build
dom/events/nsDOMMouseScrollEvent.cpp
dom/events/nsDOMMouseScrollEvent.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -760,20 +760,16 @@ DOMInterfaces = {
     'nativeType': 'nsMimeTypeArray',
     'resultNotAddRefed': [ 'item', 'namedItem' ]
 },
 
 'MouseEvent': {
     'nativeType': 'nsDOMMouseEvent',
 },
 
-'MouseScrollEvent': {
-    'nativeType': 'nsDOMMouseScrollEvent',
-},
-
 'MozCanvasPrintState': {
     'headerFile': 'mozilla/dom/HTMLCanvasElement.h',
     'nativeType': 'mozilla::dom::HTMLCanvasPrintState',
 },
 
 'MozChannel': [
 {
     'nativeType': 'nsIChannel',
rename from dom/events/nsDOMMouseScrollEvent.cpp
rename to dom/events/MouseScrollEvent.cpp
--- a/dom/events/nsDOMMouseScrollEvent.cpp
+++ b/dom/events/MouseScrollEvent.cpp
@@ -1,22 +1,23 @@
 /* -*- 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 "nsDOMMouseScrollEvent.h"
+#include "mozilla/dom/MouseScrollEvent.h"
+#include "mozilla/MouseEvents.h"
 #include "prtime.h"
-#include "mozilla/MouseEvents.h"
 
-using namespace mozilla;
+namespace mozilla {
+namespace dom {
 
-nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
-                                             nsPresContext* aPresContext,
-                                             WidgetMouseScrollEvent* aEvent)
+MouseScrollEvent::MouseScrollEvent(EventTarget* aOwner,
+                                   nsPresContext* aPresContext,
+                                   WidgetMouseScrollEvent* aEvent)
   : nsDOMMouseEvent(aOwner, aPresContext,
                     aEvent ? aEvent :
                              new WidgetMouseScrollEvent(false, 0, nullptr))
 {
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
@@ -24,57 +25,73 @@ nsDOMMouseScrollEvent::nsDOMMouseScrollE
     mEvent->refPoint.x = mEvent->refPoint.y = 0;
     static_cast<WidgetMouseEventBase*>(mEvent)->inputSource =
       nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
   }
 
   mDetail = mEvent->AsMouseScrollEvent()->delta;
 }
 
-NS_IMPL_ADDREF_INHERITED(nsDOMMouseScrollEvent, nsDOMMouseEvent)
-NS_IMPL_RELEASE_INHERITED(nsDOMMouseScrollEvent, nsDOMMouseEvent)
+NS_IMPL_ADDREF_INHERITED(MouseScrollEvent, nsDOMMouseEvent)
+NS_IMPL_RELEASE_INHERITED(MouseScrollEvent, nsDOMMouseEvent)
 
-NS_INTERFACE_MAP_BEGIN(nsDOMMouseScrollEvent)
+NS_INTERFACE_MAP_BEGIN(MouseScrollEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMouseScrollEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
 
 NS_IMETHODIMP
-nsDOMMouseScrollEvent::InitMouseScrollEvent(const nsAString & aType, bool aCanBubble, bool aCancelable,
-                                nsIDOMWindow *aView, int32_t aDetail, int32_t aScreenX, 
-                                int32_t aScreenY, int32_t aClientX, int32_t aClientY, 
-                                bool aCtrlKey, bool aAltKey, bool aShiftKey, 
-                                bool aMetaKey, uint16_t aButton, nsIDOMEventTarget *aRelatedTarget,
-                                int32_t aAxis)
+MouseScrollEvent::InitMouseScrollEvent(const nsAString& aType,
+                                       bool aCanBubble,
+                                       bool aCancelable,
+                                       nsIDOMWindow* aView,
+                                       int32_t aDetail,
+                                       int32_t aScreenX,
+                                       int32_t aScreenY,
+                                       int32_t aClientX,
+                                       int32_t aClientY,
+                                       bool aCtrlKey,
+                                       bool aAltKey,
+                                       bool aShiftKey,
+                                       bool aMetaKey,
+                                       uint16_t aButton,
+                                       nsIDOMEventTarget* aRelatedTarget,
+                                       int32_t aAxis)
 {
   nsresult rv = nsDOMMouseEvent::InitMouseEvent(aType, aCanBubble, aCancelable, aView, aDetail,
                                                 aScreenX, aScreenY, aClientX, aClientY, aCtrlKey,
                                                 aAltKey, aShiftKey, aMetaKey, aButton, aRelatedTarget);
   NS_ENSURE_SUCCESS(rv, rv);
   mEvent->AsMouseScrollEvent()->isHorizontal = (aAxis == HORIZONTAL_AXIS);
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-nsDOMMouseScrollEvent::GetAxis(int32_t* aResult)
+MouseScrollEvent::GetAxis(int32_t* aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
   *aResult = Axis();
   return NS_OK;
 }
 
 int32_t
-nsDOMMouseScrollEvent::Axis()
+MouseScrollEvent::Axis()
 {
   return mEvent->AsMouseScrollEvent()->isHorizontal ?
            static_cast<int32_t>(HORIZONTAL_AXIS) :
            static_cast<int32_t>(VERTICAL_AXIS);
 }
 
-nsresult NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
-                                   mozilla::dom::EventTarget* aOwner,
-                                   nsPresContext* aPresContext,
-                                   WidgetMouseScrollEvent* aEvent) 
+} // namespace dom
+} // namespace mozilla
+
+using namespace mozilla;
+using namespace dom;
+
+nsresult
+NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
+                          EventTarget* aOwner,
+                          nsPresContext* aPresContext,
+                          WidgetMouseScrollEvent* aEvent)
 {
-  nsDOMMouseScrollEvent* it =
-    new nsDOMMouseScrollEvent(aOwner, aPresContext, aEvent);
+  MouseScrollEvent* it = new MouseScrollEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
rename from dom/events/nsDOMMouseScrollEvent.h
rename to dom/events/MouseScrollEvent.h
--- a/dom/events/nsDOMMouseScrollEvent.h
+++ b/dom/events/MouseScrollEvent.h
@@ -1,53 +1,59 @@
 /* -*- 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/. */
 
-#ifndef nsDOMMouseScrollEvent_h__
-#define nsDOMMouseScrollEvent_h__
+#ifndef mozilla_dom_MouseScrollEvent_h_
+#define mozilla_dom_MouseScrollEvent_h_
 
 #include "nsIDOMMouseScrollEvent.h"
 #include "nsDOMMouseEvent.h"
 #include "mozilla/dom/MouseScrollEventBinding.h"
 
-class nsDOMMouseScrollEvent : public nsDOMMouseEvent,
-                              public nsIDOMMouseScrollEvent
+namespace mozilla {
+namespace dom {
+
+class MouseScrollEvent : public nsDOMMouseEvent,
+                         public nsIDOMMouseScrollEvent
 {
 public:
-  nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
-                        nsPresContext* aPresContext,
-                        mozilla::WidgetMouseScrollEvent* aEvent);
+  MouseScrollEvent(EventTarget* aOwner,
+                   nsPresContext* aPresContext,
+                   WidgetMouseScrollEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMMouseScrollEvent Interface
   NS_DECL_NSIDOMMOUSESCROLLEVENT
-  
+
   // Forward to base class
   NS_FORWARD_TO_NSDOMMOUSEEVENT
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::MouseScrollEventBinding::Wrap(aCx, aScope, this);
+    return MouseScrollEventBinding::Wrap(aCx, aScope, this);
   }
 
   int32_t Axis();
 
   void InitMouseScrollEvent(const nsAString& aType, bool aCanBubble,
                             bool aCancelable, nsIDOMWindow* aView,
                             int32_t aDetail, int32_t aScreenX, int32_t aScreenY,
                             int32_t aClientX, int32_t aClientY,
                             bool aCtrlKey, bool aAltKey, bool aShiftKey,
                             bool aMetaKey, uint16_t aButton,
                             nsIDOMEventTarget* aRelatedTarget, int32_t aAxis,
-                            mozilla::ErrorResult& aRv)
+                            ErrorResult& aRv)
   {
     aRv = InitMouseScrollEvent(aType, aCanBubble, aCancelable, aView,
                                aDetail, aScreenX, aScreenY, aClientX, aClientY,
                                aCtrlKey, aAltKey, aShiftKey, aMetaKey, aButton,
                                aRelatedTarget, aAxis);
   }
 };
 
-#endif // nsDOMMouseScrollEvent_h__
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_MouseScrollEvent_h_
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -44,16 +44,17 @@ EXPORTS.mozilla.dom += [
     'DataContainerEvent.h',
     'DataTransfer.h',
     'DeviceMotionEvent.h',
     'DragEvent.h',
     'EventTarget.h',
     'FocusEvent.h',
     'KeyboardEvent.h',
     'MessageEvent.h',
+    'MouseScrollEvent.h',
     'PointerEvent.h',
     'Touch.h',
     'WheelEvent.h',
 ]
 
 if CONFIG['MOZ_WEBSPEECH']:
     EXPORTS.mozilla.dom += ['SpeechRecognitionError.h']
 
@@ -66,21 +67,21 @@ UNIFIED_SOURCES += [
     'DataContainerEvent.cpp',
     'DataTransfer.cpp',
     'DeviceMotionEvent.cpp',
     'DragEvent.cpp',
     'EventTarget.cpp',
     'FocusEvent.cpp',
     'KeyboardEvent.cpp',
     'MessageEvent.cpp',
+    'MouseScrollEvent.cpp',
     'nsAsyncDOMEvent.cpp',
     'nsContentEventHandler.cpp',
     'nsDOMEventTargetHelper.cpp',
     'nsDOMMouseEvent.cpp',
-    'nsDOMMouseScrollEvent.cpp',
     'nsDOMMutationEvent.cpp',
     'nsDOMNotifyAudioAvailableEvent.cpp',
     'nsDOMSimpleGestureEvent.cpp',
     'nsDOMTextEvent.cpp',
     'nsDOMTouchEvent.cpp',
     'nsDOMTransitionEvent.cpp',
     'nsDOMXULCommandEvent.cpp',
     'nsEventDispatcher.cpp',