-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compartment): show IME disabled on language bar (#263)
- Loading branch information
1 parent
c578997
commit 4015d18
Showing
13 changed files
with
308 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
#include <ComPtr.h> | ||
#include <functional> | ||
#include <msctf.h> | ||
|
||
class CCompartmentEventSink : public ITfCompartmentEventSink | ||
{ | ||
public: | ||
using Callback = std::function<HRESULT(REFGUID guidCompartment)>; | ||
CCompartmentEventSink(Callback callback) | ||
: _callback(callback), _refCount(1) {}; | ||
~CCompartmentEventSink() = default; | ||
|
||
// IUnknown | ||
STDMETHODIMP QueryInterface(REFIID riid, _Outptr_ void **ppvObj); | ||
STDMETHODIMP_(ULONG) AddRef(void); | ||
STDMETHODIMP_(ULONG) Release(void); | ||
|
||
// ITfCompartmentEventSink | ||
STDMETHODIMP OnChange(_In_ REFGUID guid); | ||
|
||
// function | ||
HRESULT _Advise(_In_ IUnknown *punk, _In_ REFGUID guidCompartment); | ||
HRESULT _Unadvise(); | ||
|
||
private: | ||
ITfCompartment * _compartment; | ||
DWORD _cookie; | ||
Callback _callback; | ||
|
||
LONG _refCount; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.