Skip to content

Commit b809719

Browse files
Bug 920377 part.22 Get rid of nsCompositionEvent r=roc
1 parent 3e45597 commit b809719

27 files changed

+84
-80
lines changed

content/events/src/TextComposition.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ TextComposition::DispatchEvent(nsGUIEvent* aEvent,
5151
nsDispatchingCallback* aCallBack)
5252
{
5353
if (aEvent->message == NS_COMPOSITION_UPDATE) {
54-
mLastData = static_cast<nsCompositionEvent*>(aEvent)->data;
54+
mLastData = static_cast<WidgetCompositionEvent*>(aEvent)->data;
5555
}
5656

5757
nsEventDispatcher::Dispatch(mNode, mPresContext,
@@ -114,7 +114,7 @@ TextComposition::CompositionEventDispatcher::Run()
114114
nsEventStatus status = nsEventStatus_eIgnore;
115115
switch (mEventMessage) {
116116
case NS_COMPOSITION_START: {
117-
nsCompositionEvent compStart(true, NS_COMPOSITION_START, mWidget);
117+
WidgetCompositionEvent compStart(true, NS_COMPOSITION_START, mWidget);
118118
nsQueryContentEvent selectedText(true, NS_QUERY_SELECTED_TEXT, mWidget);
119119
nsContentEventHandler handler(mPresContext);
120120
handler.OnQuerySelectedText(&selectedText);
@@ -126,7 +126,7 @@ TextComposition::CompositionEventDispatcher::Run()
126126
}
127127
case NS_COMPOSITION_UPDATE:
128128
case NS_COMPOSITION_END: {
129-
nsCompositionEvent compEvent(true, mEventMessage, mWidget);
129+
WidgetCompositionEvent compEvent(true, mEventMessage, mWidget);
130130
compEvent.data = mData;
131131
nsIMEStateManager::DispatchCompositionEvent(mEventTarget, mPresContext,
132132
&compEvent, &status, nullptr);

content/events/src/nsDOMCompositionEvent.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
#include "prtime.h"
99
#include "mozilla/TextEvents.h"
1010

11+
using namespace mozilla;
12+
1113
nsDOMCompositionEvent::nsDOMCompositionEvent(mozilla::dom::EventTarget* aOwner,
1214
nsPresContext* aPresContext,
13-
nsCompositionEvent* aEvent)
15+
WidgetCompositionEvent* aEvent)
1416
: nsDOMUIEvent(aOwner, aPresContext, aEvent ? aEvent :
15-
new nsCompositionEvent(false, 0, nullptr))
17+
new WidgetCompositionEvent(false, 0, nullptr))
1618
{
1719
NS_ASSERTION(mEvent->eventStructType == NS_COMPOSITION_EVENT,
1820
"event type mismatch");
@@ -29,14 +31,14 @@ nsDOMCompositionEvent::nsDOMCompositionEvent(mozilla::dom::EventTarget* aOwner,
2931
mEvent->mFlags.mCancelable = false;
3032
}
3133

32-
mData = static_cast<nsCompositionEvent*>(mEvent)->data;
34+
mData = static_cast<WidgetCompositionEvent*>(mEvent)->data;
3335
// TODO: Native event should have locale information.
3436
}
3537

3638
nsDOMCompositionEvent::~nsDOMCompositionEvent()
3739
{
3840
if (mEventIsInternal) {
39-
delete static_cast<nsCompositionEvent*>(mEvent);
41+
delete static_cast<WidgetCompositionEvent*>(mEvent);
4042
mEvent = nullptr;
4143
}
4244
}
@@ -83,7 +85,7 @@ nsresult
8385
NS_NewDOMCompositionEvent(nsIDOMEvent** aInstancePtrResult,
8486
mozilla::dom::EventTarget* aOwner,
8587
nsPresContext* aPresContext,
86-
nsCompositionEvent *aEvent)
88+
WidgetCompositionEvent* aEvent)
8789
{
8890
nsDOMCompositionEvent* event =
8991
new nsDOMCompositionEvent(aOwner, aPresContext, aEvent);

content/events/src/nsDOMCompositionEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class nsDOMCompositionEvent : public nsDOMUIEvent,
1818
public:
1919
nsDOMCompositionEvent(mozilla::dom::EventTarget* aOwner,
2020
nsPresContext* aPresContext,
21-
nsCompositionEvent* aEvent);
21+
mozilla::WidgetCompositionEvent* aEvent);
2222
virtual ~nsDOMCompositionEvent();
2323

2424
NS_DECL_ISUPPORTS_INHERITED

content/events/src/nsDOMEvent.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,10 +594,10 @@ nsDOMEvent::DuplicatePrivateData()
594594
}
595595
case NS_COMPOSITION_EVENT:
596596
{
597-
nsCompositionEvent* compositionEvent =
598-
new nsCompositionEvent(false, msg, nullptr);
599-
nsCompositionEvent* oldCompositionEvent =
600-
static_cast<nsCompositionEvent*>(mEvent);
597+
WidgetCompositionEvent* compositionEvent =
598+
new WidgetCompositionEvent(false, msg, nullptr);
599+
WidgetCompositionEvent* oldCompositionEvent =
600+
static_cast<WidgetCompositionEvent*>(mEvent);
601601
compositionEvent->AssignCompositionEventData(*oldCompositionEvent, true);
602602
newEvent = compositionEvent;
603603
break;

content/events/src/nsEventDispatcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner,
707707
case NS_COMPOSITION_EVENT:
708708
return NS_NewDOMCompositionEvent(
709709
aDOMEvent, aOwner,
710-
aPresContext, static_cast<nsCompositionEvent*>(aEvent));
710+
aPresContext, static_cast<WidgetCompositionEvent*>(aEvent));
711711
case NS_MOUSE_EVENT:
712712
return NS_NewDOMMouseEvent(aDOMEvent, aOwner, aPresContext,
713713
static_cast<nsInputEvent*>(aEvent));

content/events/src/nsEventStateManager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,8 +1098,8 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
10981098
if (aEvent->mFlags.mIsTrusted) {
10991099
// If the event is trusted event, set the selected text to data of
11001100
// composition event.
1101-
nsCompositionEvent *compositionEvent =
1102-
static_cast<nsCompositionEvent*>(aEvent);
1101+
WidgetCompositionEvent *compositionEvent =
1102+
static_cast<WidgetCompositionEvent*>(aEvent);
11031103
nsQueryContentEvent selectedText(true, NS_QUERY_SELECTED_TEXT,
11041104
compositionEvent->widget);
11051105
DoQuerySelectedText(&selectedText);
@@ -1110,8 +1110,8 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
11101110
case NS_COMPOSITION_UPDATE:
11111111
case NS_COMPOSITION_END:
11121112
{
1113-
nsCompositionEvent *compositionEvent =
1114-
static_cast<nsCompositionEvent*>(aEvent);
1113+
WidgetCompositionEvent *compositionEvent =
1114+
static_cast<WidgetCompositionEvent*>(aEvent);
11151115
if (IsTargetCrossProcess(compositionEvent)) {
11161116
// Will not be handled locally, remote the event
11171117
if (GetCrossProcessTarget()->SendCompositionEvent(*compositionEvent)) {

content/events/src/nsIMEStateManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ nsIMEStateManager::NotifyIME(NotificationToIME aNotification,
609609
}
610610

611611
status = nsEventStatus_eIgnore;
612-
nsCompositionEvent endEvent(true, NS_COMPOSITION_END, widget);
612+
WidgetCompositionEvent endEvent(true, NS_COMPOSITION_END, widget);
613613
endEvent.data = backup.GetLastData();
614614
endEvent.mFlags.mIsSynthesizedForTests = true;
615615
widget->DispatchEvent(&endEvent, status);
@@ -622,7 +622,7 @@ nsIMEStateManager::NotifyIME(NotificationToIME aNotification,
622622

623623
nsEventStatus status = nsEventStatus_eIgnore;
624624
if (!backup.GetLastData().IsEmpty()) {
625-
nsCompositionEvent updateEvent(true, NS_COMPOSITION_UPDATE, widget);
625+
WidgetCompositionEvent updateEvent(true, NS_COMPOSITION_UPDATE, widget);
626626
updateEvent.data = backup.GetLastData();
627627
updateEvent.mFlags.mIsSynthesizedForTests = true;
628628
widget->DispatchEvent(&updateEvent, status);
@@ -641,7 +641,7 @@ nsIMEStateManager::NotifyIME(NotificationToIME aNotification,
641641
}
642642

643643
status = nsEventStatus_eIgnore;
644-
nsCompositionEvent endEvent(true, NS_COMPOSITION_END, widget);
644+
WidgetCompositionEvent endEvent(true, NS_COMPOSITION_END, widget);
645645
endEvent.data = backup.GetLastData();
646646
endEvent.mFlags.mIsSynthesizedForTests = true;
647647
widget->DispatchEvent(&endEvent, status);

dom/base/nsDOMWindowUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1824,7 +1824,7 @@ nsDOMWindowUtils::SendCompositionEvent(const nsAString& aType,
18241824
return NS_ERROR_FAILURE;
18251825
}
18261826

1827-
nsCompositionEvent compositionEvent(true, msg, widget);
1827+
WidgetCompositionEvent compositionEvent(true, msg, widget);
18281828
InitEvent(compositionEvent);
18291829
if (msg != NS_COMPOSITION_START) {
18301830
compositionEvent.data = aData;

dom/interfaces/events/nsIDOMEvent.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ nsresult
278278
NS_NewDOMCompositionEvent(nsIDOMEvent** aInstancePtrResult,
279279
mozilla::dom::EventTarget* aOwner,
280280
nsPresContext* aPresContext,
281-
nsCompositionEvent* aEvent);
281+
mozilla::WidgetCompositionEvent* aEvent);
282282
nsresult
283283
NS_NewDOMMutationEvent(nsIDOMEvent** aResult,
284284
mozilla::dom::EventTarget* aOwner,

dom/ipc/PBrowser.ipdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ using mozilla::layout::ScrollingBehavior;
3636
using mozilla::void_t;
3737
using mozilla::WindowsHandle;
3838
using nscolor;
39-
using nsCompositionEvent;
39+
using mozilla::WidgetCompositionEvent;
4040
using nsIMEUpdatePreference;
4141
using nsIntPoint;
4242
using nsIntRect;
@@ -381,7 +381,7 @@ child:
381381
int32_t aModifiers,
382382
bool aPreventDefault);
383383

384-
CompositionEvent(nsCompositionEvent event);
384+
CompositionEvent(WidgetCompositionEvent event);
385385

386386
TextEvent(WidgetTextEvent event);
387387

0 commit comments

Comments
 (0)