Bug 975688 part.25 Rename nsDOMScrollAreaEvent to mozilla::dom::ScrollAreaEvent r=smaug

--HG--
rename : dom/events/nsDOMScrollAreaEvent.cpp => dom/events/ScrollAreaEvent.cpp
rename : dom/events/nsDOMScrollAreaEvent.h => dom/events/ScrollAreaEvent.h
This commit is contained in:
Masayuki Nakano 2014-02-28 23:58:43 +09:00
parent beb0ea2022
commit 3e1e0f7de6
4 changed files with 58 additions and 50 deletions

View File

@ -926,10 +926,6 @@ DOMInterfaces = {
'nativeType': 'nsScreen',
},
'ScrollAreaEvent': {
'nativeType': 'nsDOMScrollAreaEvent',
},
'Selection': {
'nativeType': 'mozilla::Selection',
'resultNotAddRefed': [ 'anchorNode', 'focusNode', 'getRangeAt' ],

View File

@ -5,36 +5,36 @@
#include "base/basictypes.h"
#include "ipc/IPCMessageUtils.h"
#include "mozilla/dom/DOMRect.h"
#include "mozilla/dom/ScrollAreaEvent.h"
#include "mozilla/ContentEvents.h"
#include "nsDOMScrollAreaEvent.h"
#include "mozilla/dom/DOMRect.h"
namespace mozilla {
namespace dom {
using namespace mozilla;
nsDOMScrollAreaEvent::nsDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext,
InternalScrollAreaEvent* aEvent)
ScrollAreaEvent::ScrollAreaEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
InternalScrollAreaEvent* aEvent)
: nsDOMUIEvent(aOwner, aPresContext, aEvent)
, mClientArea(nullptr)
{
mClientArea.SetLayoutRect(aEvent ? aEvent->mArea : nsRect());
}
NS_IMPL_ADDREF_INHERITED(nsDOMScrollAreaEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMScrollAreaEvent, nsDOMUIEvent)
NS_IMPL_ADDREF_INHERITED(ScrollAreaEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(ScrollAreaEvent, nsDOMUIEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMScrollAreaEvent)
NS_INTERFACE_MAP_BEGIN(ScrollAreaEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMScrollAreaEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
#define FORWARD_GETTER(_name) \
NS_IMETHODIMP \
nsDOMScrollAreaEvent::Get ## _name(float* aResult) \
{ \
*aResult = _name(); \
return NS_OK; \
#define FORWARD_GETTER(_name) \
NS_IMETHODIMP \
ScrollAreaEvent::Get ## _name(float* aResult) \
{ \
*aResult = _name(); \
return NS_OK; \
}
FORWARD_GETTER(X)
@ -43,13 +43,15 @@ FORWARD_GETTER(Width)
FORWARD_GETTER(Height)
NS_IMETHODIMP
nsDOMScrollAreaEvent::InitScrollAreaEvent(const nsAString &aEventType,
bool aCanBubble,
bool aCancelable,
nsIDOMWindow *aView,
int32_t aDetail,
float aX, float aY,
float aWidth, float aHeight)
ScrollAreaEvent::InitScrollAreaEvent(const nsAString& aEventType,
bool aCanBubble,
bool aCancelable,
nsIDOMWindow* aView,
int32_t aDetail,
float aX,
float aY,
float aWidth,
float aHeight)
{
nsresult rv = nsDOMUIEvent::InitUIEvent(aEventType, aCanBubble, aCancelable, aView, aDetail);
NS_ENSURE_SUCCESS(rv, rv);
@ -60,8 +62,8 @@ nsDOMScrollAreaEvent::InitScrollAreaEvent(const nsAString &aEventType,
}
NS_IMETHODIMP_(void)
nsDOMScrollAreaEvent::Serialize(IPC::Message* aMsg,
bool aSerializeInterfaceType)
ScrollAreaEvent::Serialize(IPC::Message* aMsg,
bool aSerializeInterfaceType)
{
if (aSerializeInterfaceType) {
IPC::WriteParam(aMsg, NS_LITERAL_STRING("scrollareaevent"));
@ -76,7 +78,7 @@ nsDOMScrollAreaEvent::Serialize(IPC::Message* aMsg,
}
NS_IMETHODIMP_(bool)
nsDOMScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
ScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
{
NS_ENSURE_TRUE(nsDOMEvent::Deserialize(aMsg, aIter), false);
@ -90,13 +92,18 @@ nsDOMScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
return true;
}
} // namespace dom
} // namespace mozilla
using namespace mozilla;
using namespace mozilla::dom;
nsresult
NS_NewDOMScrollAreaEvent(nsIDOMEvent **aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext,
NS_NewDOMScrollAreaEvent(nsIDOMEvent** aInstancePtrResult,
EventTarget* aOwner,
nsPresContext* aPresContext,
InternalScrollAreaEvent* aEvent)
{
nsDOMScrollAreaEvent* ev =
new nsDOMScrollAreaEvent(aOwner, aPresContext, aEvent);
ScrollAreaEvent* ev = new ScrollAreaEvent(aOwner, aPresContext, aEvent);
return CallQueryInterface(ev, aInstancePtrResult);
}

View File

@ -3,8 +3,8 @@
* 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 nsDOMScrollAreaEvent_h__
#define nsDOMScrollAreaEvent_h__
#ifndef mozilla_dom_ScrollAreaEvent_h_
#define mozilla_dom_ScrollAreaEvent_h_
#include "mozilla/Attributes.h"
#include "mozilla/EventForwards.h"
@ -14,15 +14,16 @@
#include "mozilla/dom/DOMRect.h"
#include "mozilla/dom/ScrollAreaEventBinding.h"
class nsDOMScrollAreaEvent : public nsDOMUIEvent,
public nsIDOMScrollAreaEvent
{
typedef mozilla::dom::DOMRect DOMRect;
namespace mozilla {
namespace dom {
class ScrollAreaEvent : public nsDOMUIEvent,
public nsIDOMScrollAreaEvent
{
public:
nsDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext,
mozilla::InternalScrollAreaEvent* aEvent);
ScrollAreaEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
InternalScrollAreaEvent* aEvent);
NS_DECL_ISUPPORTS_INHERITED
@ -41,7 +42,7 @@ public:
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
{
return mozilla::dom::ScrollAreaEventBinding::Wrap(aCx, aScope, this);
return ScrollAreaEventBinding::Wrap(aCx, aScope, this);
}
float X() const
@ -71,7 +72,7 @@ public:
int32_t aDetail,
float aX, float aY,
float aWidth, float aHeight,
mozilla::ErrorResult& aRv)
ErrorResult& aRv)
{
aRv = InitScrollAreaEvent(aType, aCanBubble, aCancelable, aView,
aDetail, aX, aY, aWidth, aHeight);
@ -81,4 +82,7 @@ protected:
DOMRect mClientArea;
};
#endif // nsDOMScrollAreaEvent_h__
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_ScrollAreaEvent_h_

View File

@ -54,6 +54,7 @@ EXPORTS.mozilla.dom += [
'NotifyAudioAvailableEvent.h',
'NotifyPaintEvent.h',
'PointerEvent.h',
'ScrollAreaEvent.h',
'SimpleGestureEvent.h',
'Touch.h',
'TouchEvent.h',
@ -112,9 +113,6 @@ SOURCES += [
'nsDOMEvent.cpp',
# nsDOMEvent.cpp should be built separately because it includes
# ipc/IPCMessageUtils.h, which on Windows includes windows.h.
'nsDOMScrollAreaEvent.cpp',
# nsDOMEvent.cpp should be built separately because it includes
# ipc/IPCMessageUtils.h, which on Windows includes windows.h.
'nsDOMUIEvent.cpp',
# nsDOMEvent.cpp should be built separately because it includes
# mozilla/HalSensor.h, which includes ipc/IPCMessageUtils.h, which
@ -122,6 +120,9 @@ SOURCES += [
'nsEventListenerManager.cpp',
# nsEventStateManager.cpp should be built separately because of Mac OS X headers.
'nsEventStateManager.cpp',
# nsDOMEvent.cpp should be built separately because it includes
# ipc/IPCMessageUtils.h, which on Windows includes windows.h.
'ScrollAreaEvent.cpp',
]
if CONFIG['MOZ_WEBSPEECH']: