Bug 895274 part.154 Rename NS_QUERY_CARET_RECT to eQueryCaretRect r=smaug

This commit is contained in:
Masayuki Nakano
2015-09-10 10:40:06 +09:00
parent 921b5a25be
commit 4da85524cd
15 changed files with 23 additions and 23 deletions

View File

@@ -1933,7 +1933,7 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType,
message = eQueryTextContent;
break;
case QUERY_CARET_RECT:
message = NS_QUERY_CARET_RECT;
message = eQueryCaretRect;
break;
case QUERY_TEXT_RECT:
message = NS_QUERY_TEXT_RECT;
@@ -1988,7 +1988,7 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType,
case eQueryTextContent:
queryEvent.InitForQueryTextContent(aOffset, aLength, useNativeLineBreak);
break;
case NS_QUERY_CARET_RECT:
case eQueryCaretRect:
queryEvent.InitForQueryCaretRect(aOffset, useNativeLineBreak);
break;
case NS_QUERY_TEXT_RECT:

View File

@@ -57,7 +57,7 @@ nsQueryContentEventResult::GetTentativeCaretOffset(uint32_t* aOffset)
static bool IsRectEnabled(EventMessage aEventMessage)
{
return aEventMessage == NS_QUERY_CARET_RECT ||
return aEventMessage == eQueryCaretRect ||
aEventMessage == NS_QUERY_TEXT_RECT ||
aEventMessage == NS_QUERY_EDITOR_RECT ||
aEventMessage == NS_QUERY_CHARACTER_AT_POINT;

View File

@@ -800,7 +800,7 @@ ContentEventHandler::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent)
return OnQuerySelectedText(aEvent);
case eQueryTextContent:
return OnQueryTextContent(aEvent);
case NS_QUERY_CARET_RECT:
case eQueryCaretRect:
return OnQueryCaretRect(aEvent);
case NS_QUERY_TEXT_RECT:
return OnQueryTextRect(aEvent);

View File

@@ -46,7 +46,7 @@ public:
nsresult OnQuerySelectedText(WidgetQueryContentEvent* aEvent);
// eQueryTextContent event handler
nsresult OnQueryTextContent(WidgetQueryContentEvent* aEvent);
// NS_QUERY_CARET_RECT event handler
// eQueryCaretRect event handler
nsresult OnQueryCaretRect(WidgetQueryContentEvent* aEvent);
// NS_QUERY_TEXT_RECT event handler
nsresult OnQueryTextRect(WidgetQueryContentEvent* aEvent);

View File

@@ -787,7 +787,7 @@ EventStateManager::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent)
switch (aEvent->mMessage) {
case eQuerySelectedText:
case eQueryTextContent:
case NS_QUERY_CARET_RECT:
case eQueryCaretRect:
case NS_QUERY_TEXT_RECT:
case NS_QUERY_EDITOR_RECT:
if (!IsTargetCrossProcess(aEvent)) {

View File

@@ -55,8 +55,8 @@ ToChar(EventMessage aEventMessage)
return "eQuerySelectedText";
case eQueryTextContent:
return "eQueryTextContent";
case NS_QUERY_CARET_RECT:
return "NS_QUERY_CARET_RECT";
case eQueryCaretRect:
return "eQueryCaretRect";
case NS_QUERY_TEXT_RECT:
return "NS_QUERY_TEXT_RECT";
case NS_QUERY_EDITOR_RECT:

View File

@@ -2370,7 +2370,7 @@ TabParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent)
}
switch (aEvent.mMessage) {
case NS_QUERY_TEXT_RECT:
case NS_QUERY_CARET_RECT:
case eQueryCaretRect:
case NS_QUERY_EDITOR_RECT:
aEvent.mReply.mRect -= GetChildProcessOffset();
break;

View File

@@ -219,7 +219,7 @@ ContentCacheInChild::CacheCaret(nsIWidget* aWidget,
mCaret.mOffset = mSelection.StartOffset();
nsEventStatus status = nsEventStatus_eIgnore;
WidgetQueryContentEvent caretRect(true, NS_QUERY_CARET_RECT, aWidget);
WidgetQueryContentEvent caretRect(true, eQueryCaretRect, aWidget);
caretRect.InitForQueryCaretRect(mCaret.mOffset);
aWidget->DispatchEvent(&caretRect, status);
if (NS_WARN_IF(!caretRect.mSucceeded)) {
@@ -638,10 +638,10 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
GetWritingModeName(aEvent.mReply.mWritingMode).get(),
GetRectText(aEvent.mReply.mRect).get()));
break;
case NS_QUERY_CARET_RECT:
case eQueryCaretRect:
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
"aEvent={ mMessage=NS_QUERY_CARET_RECT, mInput={ mOffset=%u } }, "
"aEvent={ mMessage=eQueryCaretRect, mInput={ mOffset=%u } }, "
"aWidget=0x%p), mText.Length()=%u",
this, aEvent.mInput.mOffset, aWidget, mText.Length()));
if (NS_WARN_IF(!IsSelectionValid())) {

View File

@@ -296,7 +296,7 @@ public:
* For NS_QUERY_TEXT_RECT, fail if cached offset/length aren't equals to input.
* Cocoa widget always queries selected offset, so it works on it.
*
* For NS_QUERY_CARET_RECT, fail if cached offset isn't equals to input
* For eQueryCaretRect, fail if cached offset isn't equals to input
*
* For NS_QUERY_EDITOR_RECT, always success
*/

View File

@@ -222,7 +222,7 @@ NS_EVENT_MESSAGE(eQuerySelectedText, eQueryContentEventFirst)
NS_EVENT_MESSAGE(eQueryTextContent, eQueryContentEventFirst + 1)
// Query for the caret rect of nth insertion point. The offset of the result is
// relative position from the top level widget.
NS_EVENT_MESSAGE(NS_QUERY_CARET_RECT, eQueryContentEventFirst + 3)
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

View File

@@ -505,7 +505,7 @@ public:
void InitForQueryCaretRect(uint32_t aOffset,
bool aUseNativeLineBreak = true)
{
NS_ASSERTION(mMessage == NS_QUERY_CARET_RECT,
NS_ASSERTION(mMessage == eQueryCaretRect,
"wrong initializer is called");
mInput.mOffset = aOffset;
mUseNativeLineBreak = aUseNativeLineBreak;
@@ -552,7 +552,7 @@ public:
mozilla::WritingMode GetWritingMode(void) const
{
NS_ASSERTION(mMessage == eQuerySelectedText ||
mMessage == NS_QUERY_CARET_RECT ||
mMessage == eQueryCaretRect ||
mMessage == NS_QUERY_TEXT_RECT,
"not querying selection or text rect");
return mReply.mWritingMode;

View File

@@ -3202,7 +3202,7 @@ IMEInputHandler::FirstRectForCharacterRange(NSRange& aRange,
}
if (useCaretRect) {
WidgetQueryContentEvent caretRect(true, NS_QUERY_CARET_RECT, mWidget);
WidgetQueryContentEvent caretRect(true, eQueryCaretRect, mWidget);
caretRect.InitForQueryCaretRect(aRange.location);
DispatchEvent(caretRect);
if (!caretRect.mSucceeded) {

View File

@@ -1810,7 +1810,7 @@ IMContextWrapper::SetCursorPosition(GtkIMContext* aContext)
}
WidgetQueryContentEvent charRect(true,
useCaret ? NS_QUERY_CARET_RECT :
useCaret ? eQueryCaretRect :
NS_QUERY_TEXT_RECT,
mLastFocusedWindow);
if (useCaret) {
@@ -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 ? "NS_QUERY_CARET_RECT" : "NS_QUERY_TEXT_RECT"));
this, useCaret ? "eQueryCaretRect" : "NS_QUERY_TEXT_RECT"));
return;
}

View File

@@ -2202,13 +2202,13 @@ IMMHandler::GetCaretRect(nsWindow* aWindow,
return false;
}
WidgetQueryContentEvent caretRect(true, NS_QUERY_CARET_RECT, aWindow);
WidgetQueryContentEvent caretRect(true, eQueryCaretRect, aWindow);
caretRect.InitForQueryCaretRect(selection.mOffset);
aWindow->InitEvent(caretRect, &point);
aWindow->DispatchWindowEvent(&caretRect);
if (!caretRect.mSucceeded) {
MOZ_LOG(gIMMLog, LogLevel::Info,
("IMM: GetCaretRect, FAILED, due to NS_QUERY_CARET_RECT failure"));
("IMM: GetCaretRect, FAILED, due to eQueryCaretRect failure"));
return false;
}
aCaretRect = LayoutDevicePixel::ToUntyped(caretRect.mReply.mRect);

View File

@@ -4828,14 +4828,14 @@ TSFTextStore::CreateNativeCaret()
// collapsed, is it OK?
uint32_t caretOffset = currentSel.MaxOffset();
WidgetQueryContentEvent queryCaretRect(true, NS_QUERY_CARET_RECT, mWidget);
WidgetQueryContentEvent queryCaretRect(true, eQueryCaretRect, mWidget);
queryCaretRect.InitForQueryCaretRect(caretOffset);
mWidget->InitEvent(queryCaretRect);
DispatchEvent(queryCaretRect);
if (!queryCaretRect.mSucceeded) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("TSF: 0x%p TSFTextStore::CreateNativeCaret() FAILED due to "
"NS_QUERY_CARET_RECT failure (offset=%d)", this, caretOffset));
"eQueryCaretRect failure (offset=%d)", this, caretOffset));
return;
}