Bug 895274 part.187 Rename NS_QUERY_TEXT_RECT to eQueryTextRect r=smaug

This commit is contained in:
Masayuki Nakano 2015-09-11 21:21:26 +09:00
Родитель b3ee47117c
Коммит 1d6a202900
15 изменённых файлов: 26 добавлений и 26 удалений

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

@ -1936,7 +1936,7 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType,
message = eQueryCaretRect;
break;
case QUERY_TEXT_RECT:
message = NS_QUERY_TEXT_RECT;
message = eQueryTextRect;
break;
case QUERY_EDITOR_RECT:
message = eQueryEditorRect;
@ -1991,7 +1991,7 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType,
case eQueryCaretRect:
queryEvent.InitForQueryCaretRect(aOffset, useNativeLineBreak);
break;
case NS_QUERY_TEXT_RECT:
case eQueryTextRect:
queryEvent.InitForQueryTextRect(aOffset, aLength, useNativeLineBreak);
break;
default:

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

@ -58,7 +58,7 @@ nsQueryContentEventResult::GetTentativeCaretOffset(uint32_t* aOffset)
static bool IsRectEnabled(EventMessage aEventMessage)
{
return aEventMessage == eQueryCaretRect ||
aEventMessage == NS_QUERY_TEXT_RECT ||
aEventMessage == eQueryTextRect ||
aEventMessage == eQueryEditorRect ||
aEventMessage == eQueryCharacterAtPoint;
}

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

@ -802,7 +802,7 @@ ContentEventHandler::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent)
return OnQueryTextContent(aEvent);
case eQueryCaretRect:
return OnQueryCaretRect(aEvent);
case NS_QUERY_TEXT_RECT:
case eQueryTextRect:
return OnQueryTextRect(aEvent);
case eQueryEditorRect:
return OnQueryEditorRect(aEvent);
@ -1330,7 +1330,7 @@ ContentEventHandler::OnQueryCharacterAtPoint(WidgetQueryContentEvent* aEvent)
GetLineBreakType(aEvent));
NS_ENSURE_SUCCESS(rv, rv);
WidgetQueryContentEvent textRect(true, NS_QUERY_TEXT_RECT, aEvent->widget);
WidgetQueryContentEvent textRect(true, eQueryTextRect, aEvent->widget);
textRect.InitForQueryTextRect(offset, 1, aEvent->mUseNativeLineBreak);
rv = OnQueryTextRect(&textRect);
NS_ENSURE_SUCCESS(rv, rv);

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

@ -48,7 +48,7 @@ public:
nsresult OnQueryTextContent(WidgetQueryContentEvent* aEvent);
// eQueryCaretRect event handler
nsresult OnQueryCaretRect(WidgetQueryContentEvent* aEvent);
// NS_QUERY_TEXT_RECT event handler
// eQueryTextRect event handler
nsresult OnQueryTextRect(WidgetQueryContentEvent* aEvent);
// eQueryEditorRect event handler
nsresult OnQueryEditorRect(WidgetQueryContentEvent* aEvent);

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

@ -784,7 +784,7 @@ EventStateManager::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent)
case eQuerySelectedText:
case eQueryTextContent:
case eQueryCaretRect:
case NS_QUERY_TEXT_RECT:
case eQueryTextRect:
case eQueryEditorRect:
if (!IsTargetCrossProcess(aEvent)) {
break;

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

@ -57,8 +57,8 @@ ToChar(EventMessage aEventMessage)
return "eQueryTextContent";
case eQueryCaretRect:
return "eQueryCaretRect";
case NS_QUERY_TEXT_RECT:
return "NS_QUERY_TEXT_RECT";
case eQueryTextRect:
return "eQueryTextRect";
case eQueryEditorRect:
return "eQueryEditorRect";
case eQueryContentState:

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

@ -2369,7 +2369,7 @@ TabParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent)
return true;
}
switch (aEvent.mMessage) {
case NS_QUERY_TEXT_RECT:
case eQueryTextRect:
case eQueryCaretRect:
case eQueryEditorRect:
aEvent.mReply.mRect -= GetChildProcessOffset();

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

@ -302,7 +302,7 @@ ContentCacheInChild::QueryCharRect(nsIWidget* aWidget,
aCharRect.SetEmpty();
nsEventStatus status = nsEventStatus_eIgnore;
WidgetQueryContentEvent textRect(true, NS_QUERY_TEXT_RECT, aWidget);
WidgetQueryContentEvent textRect(true, eQueryTextRect, aWidget);
textRect.InitForQueryTextRect(aOffset, 1);
aWidget->DispatchEvent(&textRect, status);
if (NS_WARN_IF(!textRect.mSucceeded)) {
@ -394,7 +394,7 @@ ContentCacheInChild::CacheTextRects(nsIWidget* aWidget,
if (!mSelection.Collapsed()) {
nsEventStatus status = nsEventStatus_eIgnore;
WidgetQueryContentEvent textRect(true, NS_QUERY_TEXT_RECT, aWidget);
WidgetQueryContentEvent textRect(true, eQueryTextRect, aWidget);
textRect.InitForQueryTextRect(mSelection.StartOffset(),
mSelection.Length());
aWidget->DispatchEvent(&textRect, status);
@ -583,10 +583,10 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
this, aEvent.mReply.mOffset, aEvent.mReply.mString.Length()));
break;
}
case NS_QUERY_TEXT_RECT:
case eQueryTextRect:
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
"aEvent={ mMessage=NS_QUERY_TEXT_RECT, mInput={ mOffset=%u, "
"aEvent={ mMessage=eQueryTextRect, mInput={ mOffset=%u, "
"mLength=%u } }, aWidget=0x%p), mText.Length()=%u",
this, aEvent.mInput.mOffset, aEvent.mInput.mLength, aWidget,
mText.Length()));

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

@ -293,7 +293,7 @@ public:
* knowing the exact length of text. It's up to widget to handle cases when
* the returned offset/length are different from the queried offset/length.
*
* For NS_QUERY_TEXT_RECT, fail if cached offset/length aren't equals to input.
* For eQueryTextRect, fail if cached offset/length aren't equals to input.
* Cocoa widget always queries selected offset, so it works on it.
*
* For eQueryCaretRect, fail if cached offset isn't equals to input

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

@ -226,7 +226,7 @@ NS_EVENT_MESSAGE(eQueryCaretRect, eQueryContentEventFirst + 3)
// Query for the bounding rect of a range of characters. This works on any
// valid character range given offset and length. Result is relative to top
// level widget coordinates
NS_EVENT_MESSAGE(NS_QUERY_TEXT_RECT, eQueryContentEventFirst + 4)
NS_EVENT_MESSAGE(eQueryTextRect, eQueryContentEventFirst + 4)
// Query for the bounding rect of the current focused frame. Result is relative
// to top level widget coordinates
NS_EVENT_MESSAGE(eQueryEditorRect, eQueryContentEventFirst + 5)

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

@ -514,7 +514,7 @@ public:
void InitForQueryTextRect(uint32_t aOffset, uint32_t aLength,
bool aUseNativeLineBreak = true)
{
NS_ASSERTION(mMessage == NS_QUERY_TEXT_RECT,
NS_ASSERTION(mMessage == eQueryTextRect,
"wrong initializer is called");
mInput.mOffset = aOffset;
mInput.mLength = aLength;
@ -553,7 +553,7 @@ public:
{
NS_ASSERTION(mMessage == eQuerySelectedText ||
mMessage == eQueryCaretRect ||
mMessage == NS_QUERY_TEXT_RECT,
mMessage == eQueryTextRect,
"not querying selection or text rect");
return mReply.mWritingMode;
}

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

@ -3186,7 +3186,7 @@ IMEInputHandler::FirstRectForCharacterRange(NSRange& aRange,
LayoutDeviceIntRect r;
bool useCaretRect = (aRange.length == 0);
if (!useCaretRect) {
WidgetQueryContentEvent charRect(true, NS_QUERY_TEXT_RECT, mWidget);
WidgetQueryContentEvent charRect(true, eQueryTextRect, mWidget);
charRect.InitForQueryTextRect(aRange.location, 1);
DispatchEvent(charRect);
if (charRect.mSucceeded) {

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

@ -1811,7 +1811,7 @@ IMContextWrapper::SetCursorPosition(GtkIMContext* aContext)
WidgetQueryContentEvent charRect(true,
useCaret ? eQueryCaretRect :
NS_QUERY_TEXT_RECT,
eQueryTextRect,
mLastFocusedWindow);
if (useCaret) {
charRect.InitForQueryCaretRect(mSelection.mOffset);
@ -1833,7 +1833,7 @@ IMContextWrapper::SetCursorPosition(GtkIMContext* aContext)
if (!charRect.mSucceeded) {
MOZ_LOG(gGtkIMLog, LogLevel::Error,
("GTKIM: %p SetCursorPosition(), FAILED, %s was failed",
this, useCaret ? "eQueryCaretRect" : "NS_QUERY_TEXT_RECT"));
this, useCaret ? "eQueryCaretRect" : "eQueryTextRect"));
return;
}

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

@ -2165,7 +2165,7 @@ IMMHandler::GetCharacterRectOfSelectedTextAt(nsWindow* aWindow,
// If there is a caret and retrieving offset is same as the caret offset,
// we should use the caret rect.
if (offset != caretOffset) {
WidgetQueryContentEvent charRect(true, NS_QUERY_TEXT_RECT, aWindow);
WidgetQueryContentEvent charRect(true, eQueryTextRect, aWindow);
charRect.InitForQueryTextRect(offset, 1);
aWindow->InitEvent(charRect, &point);
aWindow->DispatchWindowEvent(&charRect);

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

@ -3424,7 +3424,7 @@ TSFTextStore::GetACPFromPoint(TsViewCookie vcView,
// offset since there is no inexpensive API to check it strictly.
// XXX If we retrieve 2 bounding boxes, one is before the offset and
// the other is after the offset, we could resolve the offset.
// However, dispatching 2 NS_QUERY_TEXT_RECT may be expensive.
// However, dispatching 2 eQueryTextRect may be expensive.
// So, use tentative offset for now.
offset = charAtPt.mReply.mTentativeCaretOffset;
@ -3583,15 +3583,15 @@ TSFTextStore::GetTextExt(TsViewCookie vcView,
return TS_E_NOLAYOUT;
}
// use NS_QUERY_TEXT_RECT to get rect in system, screen coordinates
WidgetQueryContentEvent event(true, NS_QUERY_TEXT_RECT, mWidget);
// use eQueryTextRect to get rect in system, screen coordinates
WidgetQueryContentEvent event(true, eQueryTextRect, mWidget);
mWidget->InitEvent(event);
event.InitForQueryTextRect(acpStart, acpEnd - acpStart);
DispatchEvent(event);
if (!event.mSucceeded) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::GetTextExt() FAILED due to "
"NS_QUERY_TEXT_RECT failure", this));
"eQueryTextRect failure", this));
return TS_E_INVALIDPOS; // but unexpected failure, maybe.
}
// IMEs don't like empty rects, fix here