Bug 975688 part.14 Rename nsDOMSimpleGestureEvent to mozilla::dom::SimpleGestureEvent r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 27 Feb 2014 19:51:14 +0900
changeset 171276 a9bc5bd8dc5a058d140dc81a67531237b7956ea0
parent 171275 47dd7fd956290ff01881f3539b0755617ee904d7
child 171277 b3ee0a6cbd75b5f821645847534bff3e227c4d17
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssmaug
bugs975688
milestone30.0a1
Bug 975688 part.14 Rename nsDOMSimpleGestureEvent to mozilla::dom::SimpleGestureEvent r=smaug
dom/bindings/Bindings.conf
dom/events/SimpleGestureEvent.cpp
dom/events/SimpleGestureEvent.h
dom/events/moz.build
dom/events/nsDOMSimpleGestureEvent.cpp
dom/events/nsDOMSimpleGestureEvent.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -989,20 +989,16 @@ DOMInterfaces = {
     'implicitJSContext': [ 'constructor' ],
 },
 
 'SharedWorkerGlobalScope': {
     'headerFile': 'mozilla/dom/WorkerScope.h',
     'workers': True,
 },
 
-'SimpleGestureEvent': {
-    'nativeType': 'nsDOMSimpleGestureEvent',
-},
-
 'SourceBufferList': {
     'resultNotAddRefed': [ '__indexedGetter' ],
 },
 
 'StyleSheet': {
     'nativeType': 'nsCSSStyleSheet',
 },
 
rename from dom/events/nsDOMSimpleGestureEvent.cpp
rename to dom/events/SimpleGestureEvent.cpp
--- a/dom/events/nsDOMSimpleGestureEvent.cpp
+++ b/dom/events/SimpleGestureEvent.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 "nsDOMSimpleGestureEvent.h"
+#include "mozilla/dom/SimpleGestureEvent.h"
+#include "mozilla/TouchEvents.h"
 #include "prtime.h"
-#include "mozilla/TouchEvents.h"
 
-using namespace mozilla;
+namespace mozilla {
+namespace dom {
 
-nsDOMSimpleGestureEvent::nsDOMSimpleGestureEvent(mozilla::dom::EventTarget* aOwner,
-                                                 nsPresContext* aPresContext,
-                                                 WidgetSimpleGestureEvent* aEvent)
+SimpleGestureEvent::SimpleGestureEvent(EventTarget* aOwner,
+                                       nsPresContext* aPresContext,
+                                       WidgetSimpleGestureEvent* aEvent)
   : nsDOMMouseEvent(aOwner, aPresContext,
                     aEvent ? aEvent :
                              new WidgetSimpleGestureEvent(false, 0, nullptr))
 {
   NS_ASSERTION(mEvent->eventStructType == NS_SIMPLE_GESTURE_EVENT, "event type mismatch");
 
   if (aEvent) {
     mEventIsInternal = false;
@@ -24,110 +25,110 @@ nsDOMSimpleGestureEvent::nsDOMSimpleGest
     mEventIsInternal = true;
     mEvent->time = PR_Now();
     mEvent->refPoint.x = mEvent->refPoint.y = 0;
     static_cast<WidgetMouseEventBase*>(mEvent)->inputSource =
       nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
   }
 }
 
-NS_IMPL_ADDREF_INHERITED(nsDOMSimpleGestureEvent, nsDOMUIEvent)
-NS_IMPL_RELEASE_INHERITED(nsDOMSimpleGestureEvent, nsDOMUIEvent)
+NS_IMPL_ADDREF_INHERITED(SimpleGestureEvent, nsDOMUIEvent)
+NS_IMPL_RELEASE_INHERITED(SimpleGestureEvent, nsDOMUIEvent)
 
-NS_INTERFACE_MAP_BEGIN(nsDOMSimpleGestureEvent)
+NS_INTERFACE_MAP_BEGIN(SimpleGestureEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMSimpleGestureEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
 
 /* attribute unsigned long allowedDirections; */
 uint32_t
-nsDOMSimpleGestureEvent::AllowedDirections()
+SimpleGestureEvent::AllowedDirections()
 {
   return mEvent->AsSimpleGestureEvent()->allowedDirections;
 }
 
 NS_IMETHODIMP
-nsDOMSimpleGestureEvent::GetAllowedDirections(uint32_t *aAllowedDirections)
+SimpleGestureEvent::GetAllowedDirections(uint32_t* aAllowedDirections)
 {
   NS_ENSURE_ARG_POINTER(aAllowedDirections);
   *aAllowedDirections = AllowedDirections();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMSimpleGestureEvent::SetAllowedDirections(uint32_t aAllowedDirections)
+SimpleGestureEvent::SetAllowedDirections(uint32_t aAllowedDirections)
 {
   mEvent->AsSimpleGestureEvent()->allowedDirections = aAllowedDirections;
   return NS_OK;
 }
 
 /* readonly attribute unsigned long direction; */
 uint32_t
-nsDOMSimpleGestureEvent::Direction()
+SimpleGestureEvent::Direction()
 {
   return mEvent->AsSimpleGestureEvent()->direction;
 }
 
 NS_IMETHODIMP
-nsDOMSimpleGestureEvent::GetDirection(uint32_t *aDirection)
+SimpleGestureEvent::GetDirection(uint32_t* aDirection)
 {
   NS_ENSURE_ARG_POINTER(aDirection);
   *aDirection = Direction();
   return NS_OK;
 }
 
 /* readonly attribute float delta; */
 double
-nsDOMSimpleGestureEvent::Delta()
+SimpleGestureEvent::Delta()
 {
   return mEvent->AsSimpleGestureEvent()->delta;
 }
 
 NS_IMETHODIMP
-nsDOMSimpleGestureEvent::GetDelta(double *aDelta)
+SimpleGestureEvent::GetDelta(double* aDelta)
 {
   NS_ENSURE_ARG_POINTER(aDelta);
   *aDelta = Delta();
   return NS_OK;
 }
 
 /* readonly attribute unsigned long clickCount; */
 uint32_t
-nsDOMSimpleGestureEvent::ClickCount()
+SimpleGestureEvent::ClickCount()
 {
   return mEvent->AsSimpleGestureEvent()->clickCount;
 }
 
 NS_IMETHODIMP
-nsDOMSimpleGestureEvent::GetClickCount(uint32_t *aClickCount)
+SimpleGestureEvent::GetClickCount(uint32_t* aClickCount)
 {
   NS_ENSURE_ARG_POINTER(aClickCount);
   *aClickCount = ClickCount();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMSimpleGestureEvent::InitSimpleGestureEvent(const nsAString& aTypeArg,
-                                                bool aCanBubbleArg,
-                                                bool aCancelableArg,
-                                                nsIDOMWindow* aViewArg,
-                                                int32_t aDetailArg,
-                                                int32_t aScreenX, 
-                                                int32_t aScreenY,
-                                                int32_t aClientX,
-                                                int32_t aClientY,
-                                                bool aCtrlKeyArg,
-                                                bool aAltKeyArg,
-                                                bool aShiftKeyArg,
-                                                bool aMetaKeyArg,
-                                                uint16_t aButton,
-                                                nsIDOMEventTarget* aRelatedTarget,
-                                                uint32_t aAllowedDirectionsArg,
-                                                uint32_t aDirectionArg,
-                                                double aDeltaArg,
-                                                uint32_t aClickCountArg)
+SimpleGestureEvent::InitSimpleGestureEvent(const nsAString& aTypeArg,
+                                           bool aCanBubbleArg,
+                                           bool aCancelableArg,
+                                           nsIDOMWindow* aViewArg,
+                                           int32_t aDetailArg,
+                                           int32_t aScreenX, 
+                                           int32_t aScreenY,
+                                           int32_t aClientX,
+                                           int32_t aClientY,
+                                           bool aCtrlKeyArg,
+                                           bool aAltKeyArg,
+                                           bool aShiftKeyArg,
+                                           bool aMetaKeyArg,
+                                           uint16_t aButton,
+                                           nsIDOMEventTarget* aRelatedTarget,
+                                           uint32_t aAllowedDirectionsArg,
+                                           uint32_t aDirectionArg,
+                                           double aDeltaArg,
+                                           uint32_t aClickCountArg)
 {
   nsresult rv = nsDOMMouseEvent::InitMouseEvent(aTypeArg,
                                                 aCanBubbleArg,
                                                 aCancelableArg,
                                                 aViewArg,
                                                 aDetailArg,
                                                 aScreenX, 
                                                 aScreenY,
@@ -145,17 +146,23 @@ nsDOMSimpleGestureEvent::InitSimpleGestu
   simpleGestureEvent->allowedDirections = aAllowedDirectionsArg;
   simpleGestureEvent->direction = aDirectionArg;
   simpleGestureEvent->delta = aDeltaArg;
   simpleGestureEvent->clickCount = aClickCountArg;
 
   return NS_OK;
 }
 
-nsresult NS_NewDOMSimpleGestureEvent(nsIDOMEvent** aInstancePtrResult,
-                                     mozilla::dom::EventTarget* aOwner,
-                                     nsPresContext* aPresContext,
-                                     WidgetSimpleGestureEvent* aEvent)
+} // namespace dom
+} // namespace mozilla
+
+using namespace mozilla;
+using namespace mozilla::dom;
+
+nsresult
+NS_NewDOMSimpleGestureEvent(nsIDOMEvent** aInstancePtrResult,
+                            EventTarget* aOwner,
+                            nsPresContext* aPresContext,
+                            WidgetSimpleGestureEvent* aEvent)
 {
-  nsDOMSimpleGestureEvent* it =
-    new nsDOMSimpleGestureEvent(aOwner, aPresContext, aEvent);
+  SimpleGestureEvent* it = new SimpleGestureEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
rename from dom/events/nsDOMSimpleGestureEvent.h
rename to dom/events/SimpleGestureEvent.h
--- a/dom/events/nsDOMSimpleGestureEvent.h
+++ b/dom/events/SimpleGestureEvent.h
@@ -1,40 +1,44 @@
 /* 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 nsDOMSimpleGestureEvent_h__
-#define nsDOMSimpleGestureEvent_h__
+#ifndef mozilla_dom_SimpleGestureEvent_h_
+#define mozilla_dom_SimpleGestureEvent_h_
 
 #include "nsIDOMSimpleGestureEvent.h"
 #include "nsDOMMouseEvent.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/dom/SimpleGestureEventBinding.h"
 
 class nsPresContext;
 
-class nsDOMSimpleGestureEvent : public nsDOMMouseEvent,
-                                public nsIDOMSimpleGestureEvent
+namespace mozilla {
+namespace dom {
+
+class SimpleGestureEvent : public nsDOMMouseEvent,
+                           public nsIDOMSimpleGestureEvent
 {
 public:
-  nsDOMSimpleGestureEvent(mozilla::dom::EventTarget* aOwner,
-                          nsPresContext*, mozilla::WidgetSimpleGestureEvent*);
+  SimpleGestureEvent(EventTarget* aOwner,
+                     nsPresContext* aPresContext,
+                     WidgetSimpleGestureEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMSIMPLEGESTUREEVENT
 
   // Forward to base class
   NS_FORWARD_TO_NSDOMMOUSEEVENT
 
   virtual JSObject* WrapObject(JSContext* aCx,
-			       JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
+                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::SimpleGestureEventBinding::Wrap(aCx, aScope, this);
+    return SimpleGestureEventBinding::Wrap(aCx, aScope, this);
   }
 
   uint32_t AllowedDirections();
   uint32_t Direction();
   double Delta();
   uint32_t ClickCount();
 
   void InitSimpleGestureEvent(const nsAString& aType,
@@ -46,25 +50,28 @@ public:
                               int32_t aScreenY,
                               int32_t aClientX,
                               int32_t aClientY,
                               bool aCtrlKey,
                               bool aAltKey,
                               bool aShiftKey,
                               bool aMetaKey,
                               uint16_t aButton,
-                              mozilla::dom::EventTarget* aRelatedTarget,
+                              EventTarget* aRelatedTarget,
                               uint32_t aAllowedDirections,
                               uint32_t aDirection,
                               double aDelta,
                               uint32_t aClickCount,
-                              mozilla::ErrorResult& aRv)
+                              ErrorResult& aRv)
   {
     aRv = InitSimpleGestureEvent(aType, aCanBubble, aCancelable,
                                  aView, aDetail, aScreenX, aScreenY,
                                  aClientX, aClientY, aCtrlKey, aAltKey,
                                  aShiftKey, aMetaKey, aButton,
                                  aRelatedTarget, aAllowedDirections,
                                  aDirection, aDelta, aClickCount);
   }
 };
 
-#endif
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_SimpleGestureEvent_h_
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -46,16 +46,17 @@ EXPORTS.mozilla.dom += [
     'DeviceMotionEvent.h',
     'DragEvent.h',
     'EventTarget.h',
     'FocusEvent.h',
     'KeyboardEvent.h',
     'MessageEvent.h',
     'MouseScrollEvent.h',
     'PointerEvent.h',
+    'SimpleGestureEvent.h',
     'Touch.h',
     'WheelEvent.h',
 ]
 
 if CONFIG['MOZ_WEBSPEECH']:
     EXPORTS.mozilla.dom += ['SpeechRecognitionError.h']
 
 UNIFIED_SOURCES += [
@@ -74,28 +75,28 @@ UNIFIED_SOURCES += [
     'MessageEvent.cpp',
     'MouseScrollEvent.cpp',
     'nsAsyncDOMEvent.cpp',
     'nsContentEventHandler.cpp',
     'nsDOMEventTargetHelper.cpp',
     'nsDOMMouseEvent.cpp',
     'nsDOMMutationEvent.cpp',
     'nsDOMNotifyAudioAvailableEvent.cpp',
-    'nsDOMSimpleGestureEvent.cpp',
     'nsDOMTextEvent.cpp',
     'nsDOMTouchEvent.cpp',
     'nsDOMTransitionEvent.cpp',
     'nsDOMXULCommandEvent.cpp',
     'nsEventDispatcher.cpp',
     'nsEventListenerService.cpp',
     'nsIMEStateManager.cpp',
     'nsJSEventListener.cpp',
     'nsPaintRequest.cpp',
     'nsPrivateTextRange.cpp',
     'PointerEvent.cpp',
+    'SimpleGestureEvent.cpp',
     'TextComposition.cpp',
     'Touch.cpp',
     'WheelEvent.cpp',
 ]
 
 SOURCES += [
     # nsDOMEvent.cpp should be built separately because it includes
     # ipc/IPCMessageUtils.h, which on Windows includes windows.h.