Skip to content

Commit 255381c

Browse files
Bug 920377 part.24 Get rid of nsSelectionEvent r=roc
1 parent 06d15e6 commit 255381c

18 files changed

+27
-31
lines changed

content/events/src/nsContentEventHandler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ nsContentEventHandler::Init(WidgetQueryContentEvent* aEvent)
114114
}
115115

116116
nsresult
117-
nsContentEventHandler::Init(nsSelectionEvent* aEvent)
117+
nsContentEventHandler::Init(WidgetSelectionEvent* aEvent)
118118
{
119119
NS_ASSERTION(aEvent, "aEvent must not be null");
120120

@@ -1052,7 +1052,7 @@ static void AdjustRangeForSelection(nsIContent* aRoot,
10521052
}
10531053

10541054
nsresult
1055-
nsContentEventHandler::OnSelectionEvent(nsSelectionEvent* aEvent)
1055+
nsContentEventHandler::OnSelectionEvent(WidgetSelectionEvent* aEvent)
10561056
{
10571057
aEvent->mSucceeded = false;
10581058

content/events/src/nsContentEventHandler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class MOZ_STACK_CLASS nsContentEventHandler {
5050
nsresult OnQueryDOMWidgetHittest(mozilla::WidgetQueryContentEvent* aEvent);
5151

5252
// NS_SELECTION_* event
53-
nsresult OnSelectionEvent(nsSelectionEvent* aEvent);
53+
nsresult OnSelectionEvent(mozilla::WidgetSelectionEvent* aEvent);
5454

5555
protected:
5656
nsPresContext* mPresContext;
@@ -60,7 +60,7 @@ class MOZ_STACK_CLASS nsContentEventHandler {
6060
nsCOMPtr<nsIContent> mRootContent;
6161

6262
nsresult Init(mozilla::WidgetQueryContentEvent* aEvent);
63-
nsresult Init(nsSelectionEvent* aEvent);
63+
nsresult Init(mozilla::WidgetSelectionEvent* aEvent);
6464

6565
// InitCommon() is called from each Init().
6666
nsresult InitCommon();

content/events/src/nsEventStateManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,16 +1056,16 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
10561056
break;
10571057
case NS_SELECTION_SET:
10581058
{
1059-
nsSelectionEvent *selectionEvent =
1060-
static_cast<nsSelectionEvent*>(aEvent);
1059+
WidgetSelectionEvent *selectionEvent =
1060+
static_cast<WidgetSelectionEvent*>(aEvent);
10611061
if (IsTargetCrossProcess(selectionEvent)) {
10621062
// Will not be handled locally, remote the event
10631063
if (GetCrossProcessTarget()->SendSelectionEvent(*selectionEvent))
10641064
selectionEvent->mSucceeded = true;
10651065
break;
10661066
}
10671067
nsContentEventHandler handler(mPresContext);
1068-
handler.OnSelectionEvent((nsSelectionEvent*)aEvent);
1068+
handler.OnSelectionEvent(static_cast<WidgetSelectionEvent*>(aEvent));
10691069
}
10701070
break;
10711071
case NS_CONTENT_COMMAND_CUT:

dom/base/nsDOMWindowUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,7 @@ nsDOMWindowUtils::SendSelectionSetEvent(uint32_t aOffset,
19701970
return NS_ERROR_FAILURE;
19711971
}
19721972

1973-
nsSelectionEvent selectionEvent(true, NS_SELECTION_SET, widget);
1973+
WidgetSelectionEvent selectionEvent(true, NS_SELECTION_SET, widget);
19741974
InitEvent(selectionEvent);
19751975

19761976
selectionEvent.mOffset = aOffset;

dom/ipc/PBrowser.ipdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ using nsMouseEvent;
4646
using nsMouseScrollEvent;
4747
using mozilla::WheelEvent;
4848
using nsRect;
49-
using nsSelectionEvent;
49+
using mozilla::WidgetSelectionEvent;
5050
using mozilla::WidgetTextEvent;
5151
using mozilla::WidgetTouchEvent;
5252
using RemoteDOMEvent;
@@ -384,7 +384,7 @@ child:
384384

385385
TextEvent(WidgetTextEvent event);
386386

387-
SelectionEvent(nsSelectionEvent event);
387+
SelectionEvent(WidgetSelectionEvent event);
388388

389389
/**
390390
* Activate event forwarding from client to parent.

dom/ipc/TabChild.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,9 +1899,9 @@ TabChild::RecvTextEvent(const WidgetTextEvent& event)
18991899
}
19001900

19011901
bool
1902-
TabChild::RecvSelectionEvent(const nsSelectionEvent& event)
1902+
TabChild::RecvSelectionEvent(const WidgetSelectionEvent& event)
19031903
{
1904-
nsSelectionEvent localEvent(event);
1904+
WidgetSelectionEvent localEvent(event);
19051905
DispatchWidgetEvent(localEvent);
19061906
return true;
19071907
}

dom/ipc/TabChild.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class TabChild : public PBrowserChild,
227227
const bool& aPreventDefault);
228228
virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event);
229229
virtual bool RecvTextEvent(const mozilla::WidgetTextEvent& event);
230-
virtual bool RecvSelectionEvent(const nsSelectionEvent& event);
230+
virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event);
231231
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture);
232232
virtual bool RecvLoadRemoteScript(const nsString& aURL);
233233
virtual bool RecvAsyncMessage(const nsString& aMessage,

dom/ipc/TabParent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ TabParent::SendTextEvent(WidgetTextEvent& event)
10301030
}
10311031

10321032
bool
1033-
TabParent::SendSelectionEvent(nsSelectionEvent& event)
1033+
TabParent::SendSelectionEvent(WidgetSelectionEvent& event)
10341034
{
10351035
if (mIsDestroyed) {
10361036
return false;

dom/ipc/TabParent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class TabParent : public PBrowserParent
227227
bool HandleQueryContentEvent(mozilla::WidgetQueryContentEvent& aEvent);
228228
bool SendCompositionEvent(mozilla::WidgetCompositionEvent& event);
229229
bool SendTextEvent(mozilla::WidgetTextEvent& event);
230-
bool SendSelectionEvent(nsSelectionEvent& event);
230+
bool SendSelectionEvent(mozilla::WidgetSelectionEvent& event);
231231

232232
static TabParent* GetFrom(nsFrameLoader* aFrameLoader);
233233
static TabParent* GetFrom(nsIContent* aContent);

widget/BasicEvents.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ enum nsEventStructType
335335
#define NS_PLUGIN_INPUT_EVENT (NS_PLUGIN_EVENT_START)
336336
#define NS_PLUGIN_FOCUS_EVENT (NS_PLUGIN_EVENT_START+1)
337337

338-
// Events to manipulate selection (nsSelectionEvent)
338+
// Events to manipulate selection (WidgetSelectionEvent)
339339
#define NS_SELECTION_EVENT_START 3700
340340
// Clear any previous selection and set the given range as the selection
341341
#define NS_SELECTION_SET (NS_SELECTION_EVENT_START)

widget/EventForwards.h

Lines changed: 0 additions & 1 deletion
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::WidgetSelectionEvent nsSelectionEvent;
111110
typedef mozilla::WidgetMouseEventBase nsMouseEvent_base;
112111
typedef mozilla::WidgetMouseEvent nsMouseEvent;
113112
typedef mozilla::WidgetDragEvent nsDragEvent;

widget/TextEvents.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,4 @@ class WidgetSelectionEvent : public WidgetGUIEvent
533533

534534
} // namespace mozilla
535535

536-
// TODO: Remove following typedefs
537-
typedef mozilla::WidgetSelectionEvent nsSelectionEvent;
538-
539536
#endif // mozilla_TextEvents_h__

widget/android/nsWindow.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
19041904
AutoIMEMask selMask(mIMEMaskSelectionUpdate);
19051905
RemoveIMEComposition();
19061906
{
1907-
nsSelectionEvent event(true, NS_SELECTION_SET, this);
1907+
WidgetSelectionEvent event(true, NS_SELECTION_SET, this);
19081908
InitEvent(event, nullptr);
19091909
event.mOffset = uint32_t(ae->Start());
19101910
event.mLength = uint32_t(ae->End() - ae->Start());
@@ -1953,7 +1953,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
19531953
*/
19541954
AutoIMEMask selMask(mIMEMaskSelectionUpdate);
19551955
RemoveIMEComposition();
1956-
nsSelectionEvent selEvent(true, NS_SELECTION_SET, this);
1956+
WidgetSelectionEvent selEvent(true, NS_SELECTION_SET, this);
19571957
InitEvent(selEvent, nullptr);
19581958

19591959
int32_t start = ae->Start(), end = ae->End();
@@ -2021,7 +2021,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
20212021
event.rangeCount = mIMERanges.Length();
20222022

20232023
{
2024-
nsSelectionEvent event(true, NS_SELECTION_SET, this);
2024+
WidgetSelectionEvent event(true, NS_SELECTION_SET, this);
20252025
InitEvent(event, nullptr);
20262026
event.mOffset = uint32_t(ae->Start());
20272027
event.mLength = uint32_t(ae->End() - ae->Start());

widget/cocoa/TextInputHandler.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4378,7 +4378,7 @@ - (void)PluginTextInputHandler_IMKInputSession_finishSession
43784378
MOZ_ASSERT(!Destroyed());
43794379

43804380
nsRefPtr<TextInputHandlerBase> kungFuDeathGrip(this);
4381-
nsSelectionEvent selectionEvent(true, NS_SELECTION_SET, mWidget);
4381+
WidgetSelectionEvent selectionEvent(true, NS_SELECTION_SET, mWidget);
43824382
selectionEvent.mOffset = aRange.location;
43834383
selectionEvent.mLength = aRange.length;
43844384
selectionEvent.mReversed = false;

widget/gtk/nsGtkIMModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,8 +1496,8 @@ nsGtkIMModule::DeleteText(const int32_t aOffset, const uint32_t aNChars)
14961496
g_utf8_offset_to_pointer(utf8Str.get(), endInUTF8Characters);
14971497

14981498
// Set selection to delete
1499-
nsSelectionEvent selectionEvent(true, NS_SELECTION_SET,
1500-
mLastFocusedWindow);
1499+
WidgetSelectionEvent selectionEvent(true, NS_SELECTION_SET,
1500+
mLastFocusedWindow);
15011501

15021502
nsDependentCSubstring utf8StrBeforeOffset(utf8Str, 0,
15031503
charAtOffset - utf8Str.get());

widget/nsGUIEventIPC.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,9 @@ struct ParamTraits<mozilla::WidgetQueryContentEvent>
441441
};
442442

443443
template<>
444-
struct ParamTraits<nsSelectionEvent>
444+
struct ParamTraits<mozilla::WidgetSelectionEvent>
445445
{
446-
typedef nsSelectionEvent paramType;
446+
typedef mozilla::WidgetSelectionEvent paramType;
447447

448448
static void Write(Message* aMsg, const paramType& aParam)
449449
{

widget/windows/nsTextStore.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ nsTextStore::FlushPendingActions()
851851
MOZ_ASSERT(mComposition.mLastData.IsEmpty());
852852

853853
// Select composition range so the new composition replaces the range
854-
nsSelectionEvent selectionSet(true, NS_SELECTION_SET, mWidget);
854+
WidgetSelectionEvent selectionSet(true, NS_SELECTION_SET, mWidget);
855855
mWidget->InitEvent(selectionSet);
856856
selectionSet.mOffset = static_cast<uint32_t>(action.mSelectionStart);
857857
selectionSet.mLength = static_cast<uint32_t>(action.mSelectionLength);
@@ -1017,7 +1017,7 @@ nsTextStore::FlushPendingActions()
10171017
this, action.mSelectionStart, action.mSelectionLength,
10181018
GetBoolName(action.mSelectionReversed)));
10191019

1020-
nsSelectionEvent selectionSet(true, NS_SELECTION_SET, mWidget);
1020+
WidgetSelectionEvent selectionSet(true, NS_SELECTION_SET, mWidget);
10211021
selectionSet.mOffset =
10221022
static_cast<uint32_t>(action.mSelectionStart);
10231023
selectionSet.mLength =

widget/xpwidgets/PuppetWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ PuppetWidget::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStatus)
285285
return NS_OK;
286286
break;
287287
case NS_SELECTION_EVENT:
288-
mIMELastReceivedSeqno = static_cast<nsSelectionEvent*>(event)->seqno;
288+
mIMELastReceivedSeqno = static_cast<WidgetSelectionEvent*>(event)->seqno;
289289
if (mIMELastReceivedSeqno < mIMELastBlurSeqno)
290290
return NS_OK;
291291
break;

0 commit comments

Comments
 (0)