forked from EasyIME/PIME
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement compartment handling and handle keyboard status correctly.
* Change coding style. Replace "using namespace Ime" with "namespace Ime {}".
- Loading branch information
Showing
23 changed files
with
429 additions
and
47 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "CompartmentEventSink.h" | ||
#include <assert.h> | ||
|
||
namespace Ime { | ||
|
||
CompartmentEventSink::CompartmentEventSink(void): | ||
refCount_(1) { | ||
} | ||
|
||
CompartmentEventSink::~CompartmentEventSink(void) { | ||
} | ||
|
||
// COM stuff | ||
// IUnknown | ||
STDMETHODIMP CompartmentEventSink::QueryInterface(REFIID riid, void **ppvObj) { | ||
if (ppvObj == NULL) | ||
return E_INVALIDARG; | ||
|
||
if(IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfCompartmentEventSink)) | ||
*ppvObj = (ITfCompartmentEventSink*)this; | ||
else | ||
*ppvObj = NULL; | ||
|
||
if(*ppvObj) { | ||
AddRef(); | ||
return S_OK; | ||
} | ||
return E_NOINTERFACE; | ||
} | ||
|
||
STDMETHODIMP_(ULONG) CompartmentEventSink::AddRef(void) { | ||
return ++refCount_; | ||
} | ||
|
||
STDMETHODIMP_(ULONG) CompartmentEventSink::Release(void) { | ||
assert(refCount_ > 0); | ||
--refCount_; | ||
if(0 == refCount_) | ||
delete this; | ||
return refCount_; | ||
} | ||
|
||
// ITfCompartmentEventSink | ||
STDMETHODIMP CompartmentEventSink::OnChange(REFGUID rguid) { | ||
return S_OK; | ||
} | ||
|
||
} // namespace Ime |
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,31 @@ | ||
#ifndef IME_COMPARTMENT_EVENT_SINK_H | ||
#define IME_COMPARTMENT_EVENT_SINK_H | ||
|
||
#include <msctf.h> | ||
|
||
namespace Ime { | ||
|
||
// base class used to implement specific compartment sink | ||
// currently the class is not used in libIME | ||
|
||
class CompartmentEventSink : public ITfCompartmentEventSink { | ||
public: | ||
CompartmentEventSink(void); | ||
virtual ~CompartmentEventSink(void); | ||
|
||
// COM stuff | ||
// IUnknown | ||
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj); | ||
STDMETHODIMP_(ULONG) AddRef(void); | ||
STDMETHODIMP_(ULONG) Release(void); | ||
|
||
// ITfCompartmentEventSink | ||
STDMETHODIMP OnChange(REFGUID rguid); | ||
|
||
private: | ||
int refCount_; | ||
}; | ||
|
||
} | ||
|
||
#endif |
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
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
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.