Skip to content

Commit 3e45597

Browse files
Bug 920377 part.21 Get rid of nsTextEvent r=roc
1 parent 0746fb9 commit 3e45597

29 files changed

+46
-46
lines changed

content/events/src/TextComposition.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ TextComposition::CompositionEventDispatcher::Run()
133133
break;
134134
}
135135
case NS_TEXT_TEXT: {
136-
nsTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
136+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
137137
textEvent.theText = mData;
138138
nsIMEStateManager::DispatchCompositionEvent(mEventTarget, mPresContext,
139139
&textEvent, &status, nullptr);

content/events/src/nsDOMEvent.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ nsDOMEvent::DuplicatePrivateData()
586586
}
587587
case NS_TEXT_EVENT:
588588
{
589-
nsTextEvent* oldTextEvent = static_cast<nsTextEvent*>(mEvent);
590-
nsTextEvent* textEvent = new nsTextEvent(false, msg, nullptr);
589+
WidgetTextEvent* oldTextEvent = static_cast<WidgetTextEvent*>(mEvent);
590+
WidgetTextEvent* textEvent = new WidgetTextEvent(false, msg, nullptr);
591591
textEvent->AssignTextEventData(*oldTextEvent, true);
592592
newEvent = textEvent;
593593
break;

content/events/src/nsDOMTextEvent.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
#include "prtime.h"
1010
#include "mozilla/TextEvents.h"
1111

12+
using namespace mozilla;
13+
1214
nsDOMTextEvent::nsDOMTextEvent(mozilla::dom::EventTarget* aOwner,
1315
nsPresContext* aPresContext,
14-
nsTextEvent* aEvent)
16+
WidgetTextEvent* aEvent)
1517
: nsDOMUIEvent(aOwner, aPresContext,
16-
aEvent ? aEvent : new nsTextEvent(false, 0, nullptr))
18+
aEvent ? aEvent : new WidgetTextEvent(false, 0, nullptr))
1719
{
1820
NS_ASSERTION(mEvent->eventStructType == NS_TEXT_EVENT, "event type mismatch");
1921

@@ -28,7 +30,7 @@ nsDOMTextEvent::nsDOMTextEvent(mozilla::dom::EventTarget* aOwner,
2830
//
2931
// extract the IME composition string
3032
//
31-
nsTextEvent *te = static_cast<nsTextEvent*>(mEvent);
33+
WidgetTextEvent *te = static_cast<WidgetTextEvent*>(mEvent);
3234
mText = te->theText;
3335

3436
//
@@ -76,7 +78,7 @@ NS_METHOD_(already_AddRefed<nsIPrivateTextRangeList>) nsDOMTextEvent::GetInputRa
7678
nsresult NS_NewDOMTextEvent(nsIDOMEvent** aInstancePtrResult,
7779
mozilla::dom::EventTarget* aOwner,
7880
nsPresContext* aPresContext,
79-
nsTextEvent *aEvent)
81+
WidgetTextEvent* aEvent)
8082
{
8183
nsDOMTextEvent* it = new nsDOMTextEvent(aOwner, aPresContext, aEvent);
8284
return CallQueryInterface(it, aInstancePtrResult);

content/events/src/nsDOMTextEvent.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class nsDOMTextEvent : public nsDOMUIEvent,
1717
{
1818
public:
1919
nsDOMTextEvent(mozilla::dom::EventTarget* aOwner,
20-
nsPresContext* aPresContext, nsTextEvent* aEvent);
20+
nsPresContext* aPresContext,
21+
mozilla::WidgetTextEvent* aEvent);
2122

2223
NS_DECL_ISUPPORTS_INHERITED
2324

content/events/src/nsDOMUIEvent.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ nsDOMUIEvent::IsChar() const
351351
case NS_KEY_EVENT:
352352
return static_cast<WidgetKeyboardEvent*>(mEvent)->isChar;
353353
case NS_TEXT_EVENT:
354-
return static_cast<nsTextEvent*>(mEvent)->isChar;
354+
return static_cast<WidgetTextEvent*>(mEvent)->isChar;
355355
default:
356356
return false;
357357
}

content/events/src/nsEventDispatcher.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner,
725725
static_cast<nsDragEvent*>(aEvent));
726726
case NS_TEXT_EVENT:
727727
return NS_NewDOMTextEvent(aDOMEvent, aOwner, aPresContext,
728-
static_cast<nsTextEvent*>(aEvent));
728+
static_cast<WidgetTextEvent*>(aEvent));
729729
case NS_CLIPBOARD_EVENT:
730730
return NS_NewDOMClipboardEvent(aDOMEvent, aOwner, aPresContext,
731731
static_cast<InternalClipboardEvent*>(aEvent));

content/events/src/nsEventStateManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
10841084
break;
10851085
case NS_TEXT_TEXT:
10861086
{
1087-
nsTextEvent *textEvent = static_cast<nsTextEvent*>(aEvent);
1087+
WidgetTextEvent *textEvent = static_cast<WidgetTextEvent*>(aEvent);
10881088
if (IsTargetCrossProcess(textEvent)) {
10891089
// Will not be handled locally, remote the event
10901090
if (GetCrossProcessTarget()->SendTextEvent(*textEvent)) {

content/events/src/nsIMEStateManager.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ nsIMEStateManager::NotifyIME(NotificationToIME aNotification,
599599

600600
nsEventStatus status = nsEventStatus_eIgnore;
601601
if (!backup.GetLastData().IsEmpty()) {
602-
nsTextEvent textEvent(true, NS_TEXT_TEXT, widget);
602+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, widget);
603603
textEvent.theText = backup.GetLastData();
604604
textEvent.mFlags.mIsSynthesizedForTests = true;
605605
widget->DispatchEvent(&textEvent, status);
@@ -631,7 +631,7 @@ nsIMEStateManager::NotifyIME(NotificationToIME aNotification,
631631
}
632632

633633
status = nsEventStatus_eIgnore;
634-
nsTextEvent textEvent(true, NS_TEXT_TEXT, widget);
634+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, widget);
635635
textEvent.theText = backup.GetLastData();
636636
textEvent.mFlags.mIsSynthesizedForTests = true;
637637
widget->DispatchEvent(&textEvent, status);

dom/base/CompositionStringSynthesizer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ CompositionStringSynthesizer::DispatchEvent(bool* aDefaultPrevented)
134134
mClauses.AppendElement(mCaret);
135135
}
136136

137-
nsTextEvent textEvent(true, NS_TEXT_TEXT, widget);
137+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, widget);
138138
textEvent.time = PR_IntervalNow();
139139
textEvent.theText = mString;
140140
textEvent.rangeCount = mClauses.Length();

dom/interfaces/events/nsIDOMEvent.idl

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ nsresult
293293
NS_NewDOMTextEvent(nsIDOMEvent** aResult,
294294
mozilla::dom::EventTarget* aOwner,
295295
nsPresContext* aPresContext,
296-
nsTextEvent* aEvent);
296+
mozilla::WidgetTextEvent* aEvent);
297297
nsresult
298298
NS_NewDOMBeforeUnloadEvent(nsIDOMEvent** aResult,
299299
mozilla::dom::EventTarget* aOwner,

dom/ipc/PBrowser.ipdl

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ using mozilla::WheelEvent;
4848
using nsQueryContentEvent;
4949
using nsRect;
5050
using nsSelectionEvent;
51-
using nsTextEvent;
51+
using mozilla::WidgetTextEvent;
5252
using mozilla::WidgetTouchEvent;
5353
using RemoteDOMEvent;
5454
using mozilla::dom::ScreenOrientation;
@@ -383,7 +383,7 @@ child:
383383

384384
CompositionEvent(nsCompositionEvent event);
385385

386-
TextEvent(nsTextEvent event);
386+
TextEvent(WidgetTextEvent event);
387387

388388
SelectionEvent(nsSelectionEvent event);
389389

dom/ipc/TabChild.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1890,11 +1890,11 @@ TabChild::RecvCompositionEvent(const nsCompositionEvent& event)
18901890
}
18911891

18921892
bool
1893-
TabChild::RecvTextEvent(const nsTextEvent& event)
1893+
TabChild::RecvTextEvent(const WidgetTextEvent& event)
18941894
{
1895-
nsTextEvent localEvent(event);
1895+
WidgetTextEvent localEvent(event);
18961896
DispatchWidgetEvent(localEvent);
1897-
IPC::ParamTraits<nsTextEvent>::Free(event);
1897+
IPC::ParamTraits<WidgetTextEvent>::Free(event);
18981898
return true;
18991899
}
19001900

dom/ipc/TabChild.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class TabChild : public PBrowserChild,
226226
const int32_t& aModifiers,
227227
const bool& aPreventDefault);
228228
virtual bool RecvCompositionEvent(const nsCompositionEvent& event);
229-
virtual bool RecvTextEvent(const nsTextEvent& event);
229+
virtual bool RecvTextEvent(const mozilla::WidgetTextEvent& event);
230230
virtual bool RecvSelectionEvent(const nsSelectionEvent& event);
231231
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture);
232232
virtual bool RecvLoadRemoteScript(const nsString& aURL);

dom/ipc/TabParent.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ TabParent::SendCompositionEvent(nsCompositionEvent& event)
10071007
* here and pass the text as the EndIMEComposition return value
10081008
*/
10091009
bool
1010-
TabParent::SendTextEvent(nsTextEvent& event)
1010+
TabParent::SendTextEvent(WidgetTextEvent& event)
10111011
{
10121012
if (mIsDestroyed) {
10131013
return false;

dom/ipc/TabParent.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class TabParent : public PBrowserParent
226226
static TabParent *GetIMETabParent() { return mIMETabParent; }
227227
bool HandleQueryContentEvent(nsQueryContentEvent& aEvent);
228228
bool SendCompositionEvent(nsCompositionEvent& event);
229-
bool SendTextEvent(nsTextEvent& event);
229+
bool SendTextEvent(mozilla::WidgetTextEvent& event);
230230
bool SendSelectionEvent(nsSelectionEvent& event);
231231

232232
static TabParent* GetFrom(nsFrameLoader* aFrameLoader);

dom/plugins/ipc/PPluginInstance.ipdl

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ using mozilla::plugins::DXGISharedSurfaceHandle;
3232
using mozilla::CrossProcessMutexHandle;
3333
using SurfaceDescriptorX11;
3434
using nsIntRect;
35-
using nsTextEvent;
3635

3736
namespace mozilla {
3837
namespace plugins {

widget/EventForwards.h

-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ typedef mozilla::WidgetEvent nsEvent;
107107
typedef mozilla::WidgetGUIEvent nsGUIEvent;
108108
typedef mozilla::WidgetInputEvent nsInputEvent;
109109
typedef mozilla::InternalUIEvent nsUIEvent;
110-
typedef mozilla::WidgetTextEvent nsTextEvent;
111110
typedef mozilla::WidgetCompositionEvent nsCompositionEvent;
112111
typedef mozilla::WidgetQueryContentEvent nsQueryContentEvent;
113112
typedef mozilla::WidgetSelectionEvent nsSelectionEvent;

widget/TextEvents.h

-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ class WidgetSelectionEvent : public WidgetGUIEvent
534534
} // namespace mozilla
535535

536536
// TODO: Remove following typedefs
537-
typedef mozilla::WidgetTextEvent nsTextEvent;
538537
typedef mozilla::WidgetCompositionEvent nsCompositionEvent;
539538
typedef mozilla::WidgetQueryContentEvent nsQueryContentEvent;
540539
typedef mozilla::WidgetSelectionEvent nsSelectionEvent;

widget/android/nsWindow.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ nsWindow::DispatchEvent(nsGUIEvent *aEvent)
689689
break;
690690
case NS_TEXT_TEXT:
691691
MOZ_ASSERT(mIMEComposing);
692-
mIMEComposingText = static_cast<nsTextEvent*>(aEvent)->theText;
692+
mIMEComposingText = static_cast<WidgetTextEvent*>(aEvent)->theText;
693693
break;
694694
}
695695
return status;
@@ -1729,7 +1729,7 @@ nsWindow::OnKeyEvent(AndroidGeckoEvent *ae)
17291729
break;
17301730
case AKEY_EVENT_ACTION_MULTIPLE:
17311731
{
1732-
nsTextEvent event(true, NS_TEXT_TEXT, this);
1732+
WidgetTextEvent event(true, NS_TEXT_TEXT, this);
17331733
event.theText.Assign(ae->Characters());
17341734
DispatchEvent(&event);
17351735
}
@@ -1817,7 +1817,7 @@ nsWindow::RemoveIMEComposition()
18171817
AutoIMEMask selMask(mIMEMaskSelectionUpdate);
18181818
AutoIMEMask textMask(mIMEMaskTextUpdate);
18191819

1820-
nsTextEvent textEvent(true, NS_TEXT_TEXT, this);
1820+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, this);
18211821
InitEvent(textEvent, nullptr);
18221822
textEvent.theText = mIMEComposingText;
18231823
DispatchEvent(&textEvent);
@@ -1928,7 +1928,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
19281928
DispatchEvent(&event);
19291929
}
19301930
{
1931-
nsTextEvent event(true, NS_TEXT_TEXT, this);
1931+
WidgetTextEvent event(true, NS_TEXT_TEXT, this);
19321932
InitEvent(event, nullptr);
19331933
event.theText = ae->Characters();
19341934
DispatchEvent(&event);
@@ -2013,7 +2013,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
20132013
AutoIMEMask textMask(mIMEMaskTextUpdate);
20142014
RemoveIMEComposition();
20152015

2016-
nsTextEvent event(true, NS_TEXT_TEXT, this);
2016+
WidgetTextEvent event(true, NS_TEXT_TEXT, this);
20172017
InitEvent(event, nullptr);
20182018

20192019
event.rangeArray = mIMERanges.Elements();
@@ -2127,7 +2127,7 @@ nsWindow::NotifyIME(NotificationToIME aNotification)
21272127
if (mIMEComposing) {
21282128
nsRefPtr<nsWindow> kungFuDeathGrip(this);
21292129

2130-
nsTextEvent textEvent(true, NS_TEXT_TEXT, this);
2130+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, this);
21312131
InitEvent(textEvent, nullptr);
21322132
DispatchEvent(&textEvent);
21332133

widget/cocoa/TextInputHandler.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -2629,7 +2629,7 @@ WidgetContentCommandEvent deleteCommandEvent(true,
26292629

26302630
nsRefPtr<IMEInputHandler> kungFuDeathGrip(this);
26312631

2632-
nsTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
2632+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
26332633
textEvent.time = PR_IntervalNow();
26342634
textEvent.theText = aText;
26352635
nsAutoTArray<TextRange, 4> textRanges;

widget/gtk/nsGtkIMModule.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString,
10851085
}
10861086
}
10871087

1088-
nsTextEvent textEvent(true, NS_TEXT_TEXT, mLastFocusedWindow);
1088+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mLastFocusedWindow);
10891089
InitEvent(textEvent);
10901090

10911091
uint32_t targetOffset = mCompositionStart;

widget/gtk/nsWindow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3039,7 +3039,7 @@ nsWindow::OnKeyPressEvent(GdkEventKey *aEvent)
30393039
DispatchEvent(&event, status);
30403040
}
30413041
else {
3042-
nsTextEvent textEvent(true, NS_TEXT_TEXT, this);
3042+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, this);
30433043
PRUnichar textString[3];
30443044
textString[0] = H_SURROGATE(event.charCode);
30453045
textString[1] = L_SURROGATE(event.charCode);

widget/nsGUIEventIPC.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ struct ParamTraits<mozilla::TextRange>
337337
};
338338

339339
template<>
340-
struct ParamTraits<nsTextEvent>
340+
struct ParamTraits<mozilla::WidgetTextEvent>
341341
{
342-
typedef nsTextEvent paramType;
342+
typedef mozilla::WidgetTextEvent paramType;
343343

344344
static void Write(Message* aMsg, const paramType& aParam)
345345
{

widget/os2/nsWindow.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2496,7 +2496,7 @@ bool nsWindow::ImeResultString(HIMI himi)
24962496
DispatchWindowEvent(&update);
24972497
}
24982498

2499-
nsTextEvent text(true, NS_TEXT_TEXT, this);
2499+
WidgetTextEvent text(true, NS_TEXT_TEXT, this);
25002500
InitEvent(text);
25012501
text.theText = compositionString;
25022502
DispatchWindowEvent(&text);
@@ -2664,7 +2664,7 @@ bool nsWindow::ImeConversionString(HIMI himi)
26642664
textRanges.AppendElement(newRange);
26652665
}
26662666
}
2667-
nsTextEvent text(true, NS_TEXT_TEXT, this);
2667+
WidgetTextEvent text(true, NS_TEXT_TEXT, this);
26682668
InitEvent(text);
26692669
text.theText = compositionString;
26702670
text.rangeArray = textRanges.Elements();

widget/qt/mozqwidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ void MozQWidget::sendPressReleaseKeyEvent(int key,
297297
nsCompositionEvent start(true, NS_COMPOSITION_START, mReceiver);
298298
mReceiver->DispatchEvent(&start);
299299

300-
nsTextEvent text(true, NS_TEXT_TEXT, mReceiver);
300+
mozilla::WidgetTextEvent text(true, NS_TEXT_TEXT, mReceiver);
301301
QString commitString = QString(*letter);
302302
text.theText.Assign(commitString.utf16());
303303
mReceiver->DispatchEvent(&text);

widget/qt/nsWindow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2774,7 +2774,7 @@ nsWindow::imComposeEvent(QInputMethodEvent *event, bool &handled)
27742774
DispatchEvent(&update);
27752775
}
27762776

2777-
nsTextEvent text(true, NS_TEXT_TEXT, this);
2777+
WidgetTextEvent text(true, NS_TEXT_TEXT, this);
27782778
text.theText = compositionStr;
27792779
DispatchEvent(&text);
27802780

widget/windows/nsIMM32Handler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ nsIMM32Handler::DispatchTextEvent(nsWindow* aWindow,
15831583
SetIMERelatedWindowsPos(aWindow, aIMEContext);
15841584
}
15851585

1586-
nsTextEvent event(true, NS_TEXT_TEXT, aWindow);
1586+
WidgetTextEvent event(true, NS_TEXT_TEXT, aWindow);
15871587

15881588
aWindow->InitEvent(event, &point);
15891589

widget/windows/nsTextStore.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ nsTextStore::FlushPendingActions()
941941
PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
942942
("TSF: 0x%p nsTextStore::FlushPendingActions(), "
943943
"dispatching text event...", this));
944-
nsTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
944+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
945945
mWidget->InitEvent(textEvent);
946946
textEvent.theText = mComposition.mLastData;
947947
if (action.mRanges.IsEmpty()) {
@@ -987,7 +987,7 @@ nsTextStore::FlushPendingActions()
987987
PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
988988
("TSF: 0x%p nsTextStore::FlushPendingActions(), "
989989
"dispatching text event...", this));
990-
nsTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
990+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
991991
mWidget->InitEvent(textEvent);
992992
textEvent.theText = mComposition.mLastData;
993993
mWidget->DispatchWindowEvent(&textEvent);

widget/xpwidgets/PuppetWidget.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ PuppetWidget::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStatus)
280280
return NS_OK;
281281
break;
282282
case NS_TEXT_EVENT:
283-
mIMELastReceivedSeqno = static_cast<nsTextEvent*>(event)->seqno;
283+
mIMELastReceivedSeqno = static_cast<WidgetTextEvent*>(event)->seqno;
284284
if (mIMELastReceivedSeqno < mIMELastBlurSeqno)
285285
return NS_OK;
286286
break;
@@ -347,7 +347,7 @@ PuppetWidget::IMEEndComposition(bool aCancel)
347347
#endif
348348

349349
nsEventStatus status;
350-
nsTextEvent textEvent(true, NS_TEXT_TEXT, this);
350+
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, this);
351351
InitEvent(textEvent, nullptr);
352352
textEvent.seqno = mIMELastReceivedSeqno;
353353
// SendEndIMEComposition is always called since ResetInputState

0 commit comments

Comments
 (0)