Bug 975688 part.23 Rename nsDOMXULCommandEvent to mozilla::dom::XULCommandEvent r=smaug

--HG--
rename : dom/events/nsDOMXULCommandEvent.cpp => dom/events/XULCommandEvent.cpp
rename : dom/events/nsDOMXULCommandEvent.h => dom/events/XULCommandEvent.h
This commit is contained in:
Masayuki Nakano 2014-02-28 23:58:42 +09:00
Родитель e98eef89a4
Коммит 1546c00e9d
4 изменённых файлов: 59 добавлений и 47 удалений

Просмотреть файл

@ -1538,10 +1538,6 @@ DOMInterfaces = {
'headerFile': 'XULDocument.h'
},
'XULCommandEvent': {
'nativeType': 'nsDOMXULCommandEvent',
},
'XULElement': {
'nativeType': 'nsXULElement',
'resultNotAddRefed': [ 'controllers', 'style' ]

Просмотреть файл

@ -4,14 +4,15 @@
* 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 "nsDOMXULCommandEvent.h"
#include "mozilla/dom/XULCommandEvent.h"
#include "prtime.h"
using namespace mozilla;
namespace mozilla {
namespace dom {
nsDOMXULCommandEvent::nsDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetInputEvent* aEvent)
XULCommandEvent::XULCommandEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetInputEvent* aEvent)
: nsDOMUIEvent(aOwner, aPresContext,
aEvent ? aEvent : new WidgetInputEvent(false, 0, nullptr))
{
@ -24,24 +25,24 @@ nsDOMXULCommandEvent::nsDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
}
}
NS_IMPL_ADDREF_INHERITED(nsDOMXULCommandEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMXULCommandEvent, nsDOMUIEvent)
NS_IMPL_ADDREF_INHERITED(XULCommandEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(XULCommandEvent, nsDOMUIEvent)
NS_IMPL_CYCLE_COLLECTION_INHERITED_1(nsDOMXULCommandEvent, nsDOMUIEvent,
NS_IMPL_CYCLE_COLLECTION_INHERITED_1(XULCommandEvent, nsDOMUIEvent,
mSourceEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMXULCommandEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULCommandEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMXULCommandEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
bool
nsDOMXULCommandEvent::AltKey()
XULCommandEvent::AltKey()
{
return mEvent->AsInputEvent()->IsAlt();
}
NS_IMETHODIMP
nsDOMXULCommandEvent::GetAltKey(bool* aIsDown)
XULCommandEvent::GetAltKey(bool* aIsDown)
{
NS_ENSURE_ARG_POINTER(aIsDown);
*aIsDown = AltKey();
@ -49,13 +50,13 @@ nsDOMXULCommandEvent::GetAltKey(bool* aIsDown)
}
bool
nsDOMXULCommandEvent::CtrlKey()
XULCommandEvent::CtrlKey()
{
return mEvent->AsInputEvent()->IsControl();
}
NS_IMETHODIMP
nsDOMXULCommandEvent::GetCtrlKey(bool* aIsDown)
XULCommandEvent::GetCtrlKey(bool* aIsDown)
{
NS_ENSURE_ARG_POINTER(aIsDown);
*aIsDown = CtrlKey();
@ -63,13 +64,13 @@ nsDOMXULCommandEvent::GetCtrlKey(bool* aIsDown)
}
bool
nsDOMXULCommandEvent::ShiftKey()
XULCommandEvent::ShiftKey()
{
return mEvent->AsInputEvent()->IsShift();
}
NS_IMETHODIMP
nsDOMXULCommandEvent::GetShiftKey(bool* aIsDown)
XULCommandEvent::GetShiftKey(bool* aIsDown)
{
NS_ENSURE_ARG_POINTER(aIsDown);
*aIsDown = ShiftKey();
@ -77,13 +78,13 @@ nsDOMXULCommandEvent::GetShiftKey(bool* aIsDown)
}
bool
nsDOMXULCommandEvent::MetaKey()
XULCommandEvent::MetaKey()
{
return mEvent->AsInputEvent()->IsMeta();
}
NS_IMETHODIMP
nsDOMXULCommandEvent::GetMetaKey(bool* aIsDown)
XULCommandEvent::GetMetaKey(bool* aIsDown)
{
NS_ENSURE_ARG_POINTER(aIsDown);
*aIsDown = MetaKey();
@ -91,7 +92,7 @@ nsDOMXULCommandEvent::GetMetaKey(bool* aIsDown)
}
NS_IMETHODIMP
nsDOMXULCommandEvent::GetSourceEvent(nsIDOMEvent** aSourceEvent)
XULCommandEvent::GetSourceEvent(nsIDOMEvent** aSourceEvent)
{
NS_ENSURE_ARG_POINTER(aSourceEvent);
*aSourceEvent = GetSourceEvent().get();
@ -99,13 +100,16 @@ nsDOMXULCommandEvent::GetSourceEvent(nsIDOMEvent** aSourceEvent)
}
NS_IMETHODIMP
nsDOMXULCommandEvent::InitCommandEvent(const nsAString& aType,
bool aCanBubble, bool aCancelable,
nsIDOMWindow* aView,
int32_t aDetail,
bool aCtrlKey, bool aAltKey,
bool aShiftKey, bool aMetaKey,
nsIDOMEvent* aSourceEvent)
XULCommandEvent::InitCommandEvent(const nsAString& aType,
bool aCanBubble,
bool aCancelable,
nsIDOMWindow* aView,
int32_t aDetail,
bool aCtrlKey,
bool aAltKey,
bool aShiftKey,
bool aMetaKey,
nsIDOMEvent* aSourceEvent)
{
nsresult rv = nsDOMUIEvent::InitUIEvent(aType, aCanBubble, aCancelable,
aView, aDetail);
@ -118,13 +122,18 @@ nsDOMXULCommandEvent::InitCommandEvent(const nsAString& aType,
return NS_OK;
}
} // namespace dom
} // namespace mozilla
nsresult NS_NewDOMXULCommandEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetInputEvent* aEvent)
using namespace mozilla;
using namespace mozilla::dom;
nsresult
NS_NewDOMXULCommandEvent(nsIDOMEvent** aInstancePtrResult,
EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetInputEvent* aEvent)
{
nsDOMXULCommandEvent* it =
new nsDOMXULCommandEvent(aOwner, aPresContext, aEvent);
XULCommandEvent* it = new XULCommandEvent(aOwner, aPresContext, aEvent);
return CallQueryInterface(it, aInstancePtrResult);
}

Просмотреть файл

@ -6,23 +6,26 @@
// This class implements a XUL "command" event. See nsIDOMXULCommandEvent.idl
#ifndef nsDOMXULCommandEvent_h_
#define nsDOMXULCommandEvent_h_
#ifndef mozilla_dom_XULCommandEvent_h_
#define mozilla_dom_XULCommandEvent_h_
#include "nsDOMUIEvent.h"
#include "nsIDOMXULCommandEvent.h"
#include "mozilla/dom/XULCommandEventBinding.h"
class nsDOMXULCommandEvent : public nsDOMUIEvent,
public nsIDOMXULCommandEvent
namespace mozilla {
namespace dom {
class XULCommandEvent : public nsDOMUIEvent,
public nsIDOMXULCommandEvent
{
public:
nsDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
mozilla::WidgetInputEvent* aEvent);
XULCommandEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetInputEvent* aEvent);
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMXULCommandEvent, nsDOMUIEvent)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULCommandEvent, nsDOMUIEvent)
NS_DECL_NSIDOMXULCOMMANDEVENT
// Forward our inherited virtual methods to the base class
@ -31,7 +34,7 @@ public:
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
{
return mozilla::dom::XULCommandEventBinding::Wrap(aCx, aScope, this);
return XULCommandEventBinding::Wrap(aCx, aScope, this);
}
bool AltKey();
@ -53,7 +56,7 @@ public:
bool aCtrlKey, bool aAltKey,
bool aShiftKey, bool aMetaKey,
nsDOMEvent* aSourceEvent,
mozilla::ErrorResult& aRv)
ErrorResult& aRv)
{
aRv = InitCommandEvent(aType, aCanBubble, aCancelable, aView, aDetail,
aCtrlKey, aAltKey, aShiftKey, aMetaKey,
@ -64,4 +67,7 @@ protected:
nsCOMPtr<nsIDOMEvent> mSourceEvent;
};
#endif // nsDOMXULCommandEvent_h_
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_XULCommandEvent_h_

Просмотреть файл

@ -58,6 +58,7 @@ EXPORTS.mozilla.dom += [
'TouchEvent.h',
'TransitionEvent.h',
'WheelEvent.h',
'XULCommandEvent.h',
]
if CONFIG['MOZ_WEBSPEECH']:
@ -85,7 +86,6 @@ UNIFIED_SOURCES += [
'nsContentEventHandler.cpp',
'nsDOMEventTargetHelper.cpp',
'nsDOMTextEvent.cpp',
'nsDOMXULCommandEvent.cpp',
'nsEventDispatcher.cpp',
'nsEventListenerService.cpp',
'nsIMEStateManager.cpp',
@ -99,6 +99,7 @@ UNIFIED_SOURCES += [
'TouchEvent.cpp',
'TransitionEvent.cpp',
'WheelEvent.cpp',
'XULCommandEvent.cpp',
]
SOURCES += [