mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 00:11:44 +00:00
Bug 1052343 part.3 Create TSFStaticSink for listening to some TSF events for whole life time of our process r=emk
This commit is contained in:
parent
5b3a4cc71f
commit
5032f2eb5b
File diff suppressed because it is too large
Load Diff
@ -41,6 +41,7 @@ class nsWindow;
|
||||
#ifdef MOZ_METRO
|
||||
class MetroWidget;
|
||||
#endif
|
||||
class TSFStaticSink;
|
||||
|
||||
namespace mozilla {
|
||||
namespace widget {
|
||||
@ -54,8 +55,6 @@ struct MSGResult;
|
||||
|
||||
class nsTextStore MOZ_FINAL : public ITextStoreACP
|
||||
, public ITfContextOwnerCompositionSink
|
||||
, public ITfActiveLanguageProfileNotifySink
|
||||
, public ITfInputProcessorProfileActivationSink
|
||||
, public ITfMouseTrackerACP
|
||||
{
|
||||
public: /*IUnknown*/
|
||||
@ -101,14 +100,6 @@ public: /*ITfContextOwnerCompositionSink*/
|
||||
STDMETHODIMP OnUpdateComposition(ITfCompositionView*, ITfRange*);
|
||||
STDMETHODIMP OnEndComposition(ITfCompositionView*);
|
||||
|
||||
public: /*ITfActiveLanguageProfileNotifySink*/
|
||||
STDMETHODIMP OnActivated(REFCLSID clsid, REFGUID guidProfile,
|
||||
BOOL fActivated);
|
||||
|
||||
public: /*ITfInputProcessorProfileActivationSink*/
|
||||
STDMETHODIMP OnActivated(DWORD, LANGID, REFCLSID, REFGUID, REFGUID,
|
||||
HKL, DWORD);
|
||||
|
||||
public: /*ITfMouseTrackerACP*/
|
||||
STDMETHODIMP AdviseMouseSink(ITfRangeACP*, ITfMouseSink*, DWORD*);
|
||||
STDMETHODIMP UnadviseMouseSink(DWORD);
|
||||
@ -224,19 +215,7 @@ public:
|
||||
return (IsComposing() && sEnabledTextStore->mWidget == aWidget);
|
||||
}
|
||||
|
||||
static bool IsIMM_IME()
|
||||
{
|
||||
if (!sEnabledTextStore ||
|
||||
!sEnabledTextStore->EnsureInitActiveTIPKeyboard()) {
|
||||
return IsIMM_IME(::GetKeyboardLayout(0));
|
||||
}
|
||||
return sEnabledTextStore->mIsIMM_IME;
|
||||
}
|
||||
|
||||
static bool IsIMM_IME(HKL aHKL)
|
||||
{
|
||||
return (::ImmGetIMEFileNameW(aHKL, nullptr, 0) > 0);
|
||||
}
|
||||
static bool IsIMM_IME();
|
||||
|
||||
#ifdef DEBUG
|
||||
// Returns true when keyboard layout has IME (TIP).
|
||||
@ -247,17 +226,9 @@ protected:
|
||||
nsTextStore();
|
||||
~nsTextStore();
|
||||
|
||||
bool Init(ITfThreadMgr* aThreadMgr);
|
||||
void Shutdown();
|
||||
|
||||
static void MarkContextAsKeyboardDisabled(ITfContext* aContext);
|
||||
static void MarkContextAsEmpty(ITfContext* aContext);
|
||||
|
||||
static bool IsTIPCategoryKeyboard(REFCLSID aTextService, LANGID aLangID,
|
||||
REFGUID aProfile);
|
||||
static void GetTIPDescription(REFCLSID aTextService, LANGID aLangID,
|
||||
REFGUID aProfile, nsAString& aDescription);
|
||||
|
||||
bool Create(nsWindowBase* aWidget);
|
||||
bool Destroy(void);
|
||||
|
||||
@ -318,18 +289,12 @@ protected:
|
||||
// application. Otherwise, this does nothing.
|
||||
void CreateNativeCaret();
|
||||
|
||||
bool EnsureInitActiveTIPKeyboard();
|
||||
|
||||
// Holds the pointer to our current win32 or metro widget
|
||||
nsRefPtr<nsWindowBase> mWidget;
|
||||
// Document manager for the currently focused editor
|
||||
nsRefPtr<ITfDocumentMgr> mDocumentMgr;
|
||||
// Edit cookie associated with the current editing context
|
||||
DWORD mEditCookie;
|
||||
// Cookie of installing ITfInputProcessorProfileActivationSink
|
||||
DWORD mIPProfileCookie;
|
||||
// Cookie of installing ITfActiveLanguageProfileNotifySink
|
||||
DWORD mLangProfileCookie;
|
||||
// Editing context at the bottom of mDocumentMgr's context stack
|
||||
nsRefPtr<ITfContext> mContext;
|
||||
// Currently installed notification sink
|
||||
@ -340,9 +305,6 @@ protected:
|
||||
DWORD mLock;
|
||||
// 0 if no lock is queued, otherwise TS_LF_* indicating the queue lock
|
||||
DWORD mLockQueued;
|
||||
// Active TIP keyboard's description. If active language profile isn't TIP,
|
||||
// i.e., IMM-IME or just a keyboard layout, this is empty.
|
||||
nsString mActiveTIPKeyboardDescription;
|
||||
|
||||
class Composition MOZ_FINAL
|
||||
{
|
||||
@ -771,11 +733,6 @@ protected:
|
||||
// While there is native caret, this is true. Otherwise, false.
|
||||
bool mNativeCaretIsCreated;
|
||||
|
||||
// True if current IME is implemented with IMM.
|
||||
bool mIsIMM_IME;
|
||||
// True if OnActivated() is already called
|
||||
bool mOnActivatedCalled;
|
||||
|
||||
// TSF thread manager object for the current application
|
||||
static ITfThreadMgr* sTsfThreadMgr;
|
||||
// sMessagePump is QI'ed from sTsfThreadMgr
|
||||
|
Loading…
x
Reference in New Issue
Block a user