Bug 805767 part.2 Implement nsIWidget::GetIMEUpdatePreference() on Windows for TSF r=emk

This commit is contained in:
Masayuki Nakano 2012-11-13 22:04:45 +09:00
parent c2ec08b400
commit 0fa32a3173
4 changed files with 23 additions and 0 deletions

View File

@ -2564,6 +2564,19 @@ nsTextStore::OnFocusChange(bool aFocus,
return NS_OK;
}
// static
nsIMEUpdatePreference
nsTextStore::GetIMEUpdatePreference()
{
bool hasFocus = false;
if (sTsfThreadMgr && sTsfTextStore && sTsfTextStore->mDocumentMgr) {
nsRefPtr<ITfDocumentMgr> docMgr;
sTsfThreadMgr->GetFocus(getter_AddRefs(docMgr));
hasFocus = (docMgr == sTsfTextStore->mDocumentMgr);
}
return nsIMEUpdatePreference(hasFocus, false);
}
nsresult
nsTextStore::OnTextChangeInternal(uint32_t aStart,
uint32_t aOldEnd,

View File

@ -124,6 +124,8 @@ public:
return sTsfTextStore->OnSelectionChangeInternal();
}
static nsIMEUpdatePreference GetIMEUpdatePreference();
static void CompositionTimerCallbackFunc(nsITimer *aTimer, void *aClosure)
{
nsTextStore *ts = static_cast<nsTextStore*>(aClosure);

View File

@ -7421,6 +7421,13 @@ nsWindow::OnIMESelectionChange(void)
{
return nsTextStore::OnSelectionChange();
}
nsIMEUpdatePreference
nsWindow::GetIMEUpdatePreference()
{
return nsTextStore::GetIMEUpdatePreference();
}
#endif //NS_ENABLE_TSF
bool nsWindow::AssociateDefaultIMC(bool aAssociate)

View File

@ -176,6 +176,7 @@ public:
NS_IMETHOD OnIMEFocusChange(bool aFocus);
NS_IMETHOD OnIMETextChange(uint32_t aStart, uint32_t aOldEnd, uint32_t aNewEnd);
NS_IMETHOD OnIMESelectionChange(void);
virtual nsIMEUpdatePreference GetIMEUpdatePreference();
#endif // NS_ENABLE_TSF
NS_IMETHOD GetNonClientMargins(nsIntMargin &margins);
NS_IMETHOD SetNonClientMargins(nsIntMargin &margins);