Bug 558976 part.6 Rename nsIWidget::OnIMETextChange() to nsIWidget::NotifyIMEOfTextChange() r=roc, sr=roc

This commit is contained in:
Masayuki Nakano 2013-03-06 15:14:34 +09:00
parent 06bd46658d
commit e71fc2d290
12 changed files with 37 additions and 27 deletions

View File

@ -874,7 +874,7 @@ public:
NS_IMETHOD Run() { NS_IMETHOD Run() {
if (mDispatcher->mWidget) { if (mDispatcher->mWidget) {
mDispatcher->mWidget->OnIMETextChange(mStart, mOldEnd, mNewEnd); mDispatcher->mWidget->NotifyIMEOfTextChange(mStart, mOldEnd, mNewEnd);
} }
return NS_OK; return NS_OK;
} }

View File

@ -741,7 +741,7 @@ TabParent::RecvNotifyIMETextChange(const uint32_t& aStart,
if (!widget) if (!widget)
return true; return true;
widget->OnIMETextChange(aStart, aEnd, aNewEnd); widget->NotifyIMEOfTextChange(aStart, aEnd, aNewEnd);
return true; return true;
} }

View File

@ -1718,11 +1718,11 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
// on Gecko. Now we can notify Java of the newly focused content // on Gecko. Now we can notify Java of the newly focused content
mIMETextChanges.Clear(); mIMETextChanges.Clear();
mIMESelectionChanged = false; mIMESelectionChanged = false;
// OnIMETextChange also notifies selection // NotifyIMEOfTextChange also notifies selection
// Use 'INT32_MAX / 2' here because subsequent text changes might // Use 'INT32_MAX / 2' here because subsequent text changes might
// combine with this text change, and overflow might occur if // combine with this text change, and overflow might occur if
// we just use INT32_MAX // we just use INT32_MAX
OnIMETextChange(0, INT32_MAX / 2, INT32_MAX / 2); NotifyIMEOfTextChange(0, INT32_MAX / 2, INT32_MAX / 2);
FlushIMEChanges(); FlushIMEChanges();
} }
AndroidBridge::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT, 0); AndroidBridge::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT, 0);
@ -2126,12 +2126,14 @@ nsWindow::FlushIMEChanges()
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWindow::OnIMETextChange(uint32_t aStart, uint32_t aOldEnd, uint32_t aNewEnd) nsWindow::NotifyIMEOfTextChange(uint32_t aStart,
uint32_t aOldEnd,
uint32_t aNewEnd)
{ {
if (mIMEMaskTextUpdate) if (mIMEMaskTextUpdate)
return NS_OK; return NS_OK;
ALOGIME("IME: OnIMETextChange: s=%d, oe=%d, ne=%d", ALOGIME("IME: NotifyIMEOfTextChange: s=%d, oe=%d, ne=%d",
aStart, aOldEnd, aNewEnd); aStart, aOldEnd, aNewEnd);
/* Make sure Java's selection is up-to-date */ /* Make sure Java's selection is up-to-date */

View File

@ -129,7 +129,9 @@ public:
const InputContextAction& aAction); const InputContextAction& aAction);
NS_IMETHOD_(InputContext) GetInputContext(); NS_IMETHOD_(InputContext) GetInputContext();
NS_IMETHOD OnIMETextChange(uint32_t aStart, uint32_t aOldEnd, uint32_t aNewEnd); NS_IMETHOD NotifyIMEOfTextChange(uint32_t aStart,
uint32_t aOldEnd,
uint32_t aNewEnd) MOZ_OVERRIDE;
virtual nsIMEUpdatePreference GetIMEUpdatePreference(); virtual nsIMEUpdatePreference GetIMEUpdatePreference();
LayerManager* GetLayerManager (PLayersChild* aShadowManager = nullptr, LayerManager* GetLayerManager (PLayersChild* aShadowManager = nullptr,

View File

@ -92,8 +92,8 @@ typedef nsEventStatus (* EVENT_CALLBACK)(nsGUIEvent *event);
#endif #endif
#define NS_IWIDGET_IID \ #define NS_IWIDGET_IID \
{ 0xAD5FEF46, 0x7200, 0x417C, \ { 0x48568C1E, 0xAF56, 0x4F73, \
{ 0xA9, 0x1C, 0xAB, 0x30, 0x1C, 0x86, 0xE4, 0x6F } } { 0x94, 0x6D, 0xAA, 0x43, 0xD8, 0x96, 0x78, 0x6B } }
/* /*
* Window shadow styles * Window shadow styles
@ -188,12 +188,12 @@ enum nsTopLevelWidgetZPlacement { // for PlaceBehind()
* Preference for receiving IME updates * Preference for receiving IME updates
* *
* If mWantUpdates is true, nsTextStateManager will observe text change and * If mWantUpdates is true, nsTextStateManager will observe text change and
* selection change and call nsIWidget::OnIMETextChange() and * selection change and call nsIWidget::NotifyIMEOfTextChange() and
* nsIWidget::NotifyIME(NOTIFY_IME_OF_SELECTION_CHANGE). The observing cost is * nsIWidget::NotifyIME(NOTIFY_IME_OF_SELECTION_CHANGE). The observing cost is
* very expensive. * very expensive.
* If the IME implementation on a particular platform doesn't care about * If the IME implementation on a particular platform doesn't care about
* OnIMETextChange and NotifyIME(NOTIFY_IME_OF_SELECTION_CHANGE), they should * NotifyIMEOfTextChange and NotifyIME(NOTIFY_IME_OF_SELECTION_CHANGE), they
* set mWantUpdates to false to avoid the cost. * should set mWantUpdates to false to avoid the cost.
* *
* If mWantHints is true, PuppetWidget will forward the content of text fields * If mWantHints is true, PuppetWidget will forward the content of text fields
* to the chrome process to be cached. This way we return the cached content * to the chrome process to be cached. This way we return the cached content
@ -1526,9 +1526,9 @@ class nsIWidget : public nsISupports {
* aOldEnd is the ending offset of the change * aOldEnd is the ending offset of the change
* aNewEnd is the caret offset after the change * aNewEnd is the caret offset after the change
*/ */
NS_IMETHOD OnIMETextChange(uint32_t aStart, NS_IMETHOD NotifyIMEOfTextChange(uint32_t aStart,
uint32_t aOldEnd, uint32_t aOldEnd,
uint32_t aNewEnd) = 0; uint32_t aNewEnd) = 0;
/* /*
* Retrieves preference for IME updates * Retrieves preference for IME updates

View File

@ -7399,9 +7399,9 @@ nsWindow::GetToggledKeyState(uint32_t aKeyCode, bool* aLEDState)
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWindow::OnIMETextChange(uint32_t aStart, nsWindow::NotifyIMEOfTextChange(uint32_t aStart,
uint32_t aOldEnd, uint32_t aOldEnd,
uint32_t aNewEnd) uint32_t aNewEnd)
{ {
return IMEHandler::NotifyIMEOfTextChange(aStart, aOldEnd, aNewEnd); return IMEHandler::NotifyIMEOfTextChange(aStart, aOldEnd, aNewEnd);
} }

View File

@ -175,7 +175,9 @@ public:
virtual nsTransparencyMode GetTransparencyMode(); virtual nsTransparencyMode GetTransparencyMode();
virtual void UpdateOpaqueRegion(const nsIntRegion& aOpaqueRegion); virtual void UpdateOpaqueRegion(const nsIntRegion& aOpaqueRegion);
#endif // MOZ_XUL #endif // MOZ_XUL
NS_IMETHOD OnIMETextChange(uint32_t aStart, uint32_t aOldEnd, uint32_t aNewEnd); NS_IMETHOD NotifyIMEOfTextChange(uint32_t aStart,
uint32_t aOldEnd,
uint32_t aNewEnd) MOZ_OVERRIDE;
virtual nsIMEUpdatePreference GetIMEUpdatePreference(); virtual nsIMEUpdatePreference GetIMEUpdatePreference();
NS_IMETHOD GetNonClientMargins(nsIntMargin &margins); NS_IMETHOD GetNonClientMargins(nsIntMargin &margins);
NS_IMETHOD SetNonClientMargins(nsIntMargin &margins); NS_IMETHOD SetNonClientMargins(nsIntMargin &margins);

View File

@ -1183,9 +1183,9 @@ MetroWidget::GetToggledKeyState(uint32_t aKeyCode, bool* aLEDState)
} }
NS_IMETHODIMP NS_IMETHODIMP
MetroWidget::OnIMETextChange(uint32_t aStart, MetroWidget::NotifyIMEOfTextChange(uint32_t aStart,
uint32_t aOldEnd, uint32_t aOldEnd,
uint32_t aNewEnd) uint32_t aNewEnd)
{ {
return nsTextStore::OnTextChange(aStart, aOldEnd, aNewEnd); return nsTextStore::OnTextChange(aStart, aOldEnd, aNewEnd);
} }

View File

@ -128,7 +128,9 @@ public:
NS_IMETHOD_(nsIWidget::InputContext) GetInputContext(); NS_IMETHOD_(nsIWidget::InputContext) GetInputContext();
NS_IMETHOD NotifyIME(NotificationToIME aNotification) MOZ_OVERRIDE; NS_IMETHOD NotifyIME(NotificationToIME aNotification) MOZ_OVERRIDE;
NS_IMETHOD GetToggledKeyState(uint32_t aKeyCode, bool* aLEDState); NS_IMETHOD GetToggledKeyState(uint32_t aKeyCode, bool* aLEDState);
NS_IMETHOD OnIMETextChange(uint32_t aStart, uint32_t aOldEnd, uint32_t aNewEnd); NS_IMETHOD NotifyIMEOfTextChange(uint32_t aStart,
uint32_t aOldEnd,
uint32_t aNewEnd) MOZ_OVERRIDE;
// FrameworkView helpers // FrameworkView helpers
void SizeModeChanged(); void SizeModeChanged();

View File

@ -475,7 +475,9 @@ PuppetWidget::GetIMEUpdatePreference()
} }
NS_IMETHODIMP NS_IMETHODIMP
PuppetWidget::OnIMETextChange(uint32_t aStart, uint32_t aEnd, uint32_t aNewEnd) PuppetWidget::NotifyIMEOfTextChange(uint32_t aStart,
uint32_t aEnd,
uint32_t aNewEnd)
{ {
#ifndef MOZ_CROSS_PROCESS_IME #ifndef MOZ_CROSS_PROCESS_IME
return NS_OK; return NS_OK;

View File

@ -153,8 +153,8 @@ public:
NS_IMETHOD_(void) SetInputContext(const InputContext& aContext, NS_IMETHOD_(void) SetInputContext(const InputContext& aContext,
const InputContextAction& aAction); const InputContextAction& aAction);
NS_IMETHOD_(InputContext) GetInputContext(); NS_IMETHOD_(InputContext) GetInputContext();
NS_IMETHOD OnIMETextChange(uint32_t aOffset, uint32_t aEnd, NS_IMETHOD NotifyIMEOfTextChange(uint32_t aOffset, uint32_t aEnd,
uint32_t aNewEnd); uint32_t aNewEnd) MOZ_OVERRIDE;
virtual nsIMEUpdatePreference GetIMEUpdatePreference(); virtual nsIMEUpdatePreference GetIMEUpdatePreference();
NS_IMETHOD SetCursor(nsCursor aCursor); NS_IMETHOD SetCursor(nsCursor aCursor);

View File

@ -145,7 +145,7 @@ public:
virtual bool GetLayersAcceleration() { return mUseLayersAcceleration; } virtual bool GetLayersAcceleration() { return mUseLayersAcceleration; }
virtual bool ComputeShouldAccelerate(bool aDefault); virtual bool ComputeShouldAccelerate(bool aDefault);
NS_IMETHOD GetToggledKeyState(uint32_t aKeyCode, bool* aLEDState) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHOD GetToggledKeyState(uint32_t aKeyCode, bool* aLEDState) { return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHOD OnIMETextChange(uint32_t aStart, uint32_t aOldEnd, uint32_t aNewEnd) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHOD NotifyIMEOfTextChange(uint32_t aStart, uint32_t aOldEnd, uint32_t aNewEnd) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
virtual nsIMEUpdatePreference GetIMEUpdatePreference() { return nsIMEUpdatePreference(false, false); } virtual nsIMEUpdatePreference GetIMEUpdatePreference() { return nsIMEUpdatePreference(false, false); }
NS_IMETHOD OnDefaultButtonLoaded(const nsIntRect &aButtonRect) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHOD OnDefaultButtonLoaded(const nsIntRect &aButtonRect) { return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHOD OverrideSystemMouseScrollSpeed(int32_t aOriginalDelta, bool aIsHorizontal, int32_t &aOverriddenDelta); NS_IMETHOD OverrideSystemMouseScrollSpeed(int32_t aOriginalDelta, bool aIsHorizontal, int32_t &aOverriddenDelta);