Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion WeaselServer/WeaselService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ void WeaselService::Start(DWORD dwArgc = 0, PWSTR* pszArgv = NULL) {

// Perform service-specific initialization.
// if (IsWindowsVistaOrGreater())
{ RegisterApplicationRestart(NULL, 0); }
{ // always
RegisterApplicationRestart(NULL, 0);
}
boost::thread{[this] { app.Run(); }};
// Tell SCM that the service is started.
SetServiceStatus(SERVICE_RUNNING);
Expand Down
6 changes: 4 additions & 2 deletions WeaselSetup/imesetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,10 @@ int register_text_service(const std::wstring& tsf_path,
if (!register_ime) {
params = L" /u " + params; // unregister
}
// if (silent) // always silent
{ params = L" /s " + params; }
// if (silent)
{ // always silent
params = L" /s " + params;
}

if (!SetEnvironmentVariable(L"TEXTSERVICE_PROFILE",
hant ? L"hant" : L"hans")) {
Expand Down
6 changes: 3 additions & 3 deletions WeaselTSF/Compartment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include "CandidateList.h"
#include "LanguageBar.h"

STDAPI CCompartmentEventSink::QueryInterface(REFIID riid,
_Outptr_ void** ppvObj) {
STDMETHODIMP CCompartmentEventSink::QueryInterface(REFIID riid,
_Outptr_ void** ppvObj) {
Comment on lines +10 to +11
if (ppvObj == nullptr)
return E_INVALIDARG;

Expand Down Expand Up @@ -43,7 +43,7 @@ STDAPI_(ULONG) CCompartmentEventSink::Release() {
return cr;
}

STDAPI CCompartmentEventSink::OnChange(_In_ REFGUID guidCompartment) {
STDMETHODIMP CCompartmentEventSink::OnChange(_In_ REFGUID guidCompartment) {
return _callback(guidCompartment);
}

Expand Down
12 changes: 6 additions & 6 deletions WeaselTSF/Composition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CStartCompositionEditSession : public CEditSession {
BOOL _inlinePreeditEnabled;
};

STDAPI CStartCompositionEditSession::DoEditSession(TfEditCookie ec) {
STDMETHODIMP CStartCompositionEditSession::DoEditSession(TfEditCookie ec) {
HRESULT hr = E_FAIL;
com_ptr<ITfInsertAtSelection> pInsertAtSelection;
com_ptr<ITfRange> pRangeComposition;
Expand Down Expand Up @@ -102,7 +102,7 @@ class CEndCompositionEditSession : public CEditSession {
BOOL _clear;
};

STDAPI CEndCompositionEditSession::DoEditSession(TfEditCookie ec) {
STDMETHODIMP CEndCompositionEditSession::DoEditSession(TfEditCookie ec) {
/* Clear the dummy text we set before, if any. */
if (_pComposition == nullptr)
return S_OK;
Expand Down Expand Up @@ -158,7 +158,7 @@ class CGetTextExtentEditSession : public CEditSession {
bool _enhancedPosition;
};

STDAPI CGetTextExtentEditSession::DoEditSession(TfEditCookie ec) {
STDMETHODIMP CGetTextExtentEditSession::DoEditSession(TfEditCookie ec) {
com_ptr<ITfInsertAtSelection> pInsertAtSelection;
com_ptr<ITfRange> pRangeComposition;
ITfRange* pRange;
Expand Down Expand Up @@ -265,7 +265,7 @@ class CInlinePreeditEditSession : public CEditSession {
const std::shared_ptr<weasel::Context> _context;
};

STDAPI CInlinePreeditEditSession::DoEditSession(TfEditCookie ec) {
STDMETHODIMP CInlinePreeditEditSession::DoEditSession(TfEditCookie ec) {
std::wstring preedit = _context->preedit.str;

com_ptr<ITfRange> pRangeComposition;
Expand Down Expand Up @@ -393,8 +393,8 @@ void WeaselTSF::_UpdateComposition(com_ptr<ITfContext> pContext) {
}

/* Composition State */
STDAPI WeaselTSF::OnCompositionTerminated(TfEditCookie ecWrite,
ITfComposition* pComposition) {
STDMETHODIMP WeaselTSF::OnCompositionTerminated(TfEditCookie ecWrite,
ITfComposition* pComposition) {
// NOTE:
// This will be called when an edit session ended up with an empty composition
// string, Even if it is closed normally. Silly M$.
Expand Down
15 changes: 8 additions & 7 deletions WeaselTSF/DisplayAttributeInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ CDisplayAttributeInfoInput::~CDisplayAttributeInfoInput() {
DllRelease();
}

STDAPI CDisplayAttributeInfoInput::QueryInterface(REFIID riid,
_Outptr_ void** ppvObj) {
STDMETHODIMP CDisplayAttributeInfoInput::QueryInterface(
REFIID riid,
_Outptr_ void** ppvObj) {
if (ppvObj == nullptr)
return E_INVALIDARG;

Expand Down Expand Up @@ -66,7 +67,7 @@ ULONG CDisplayAttributeInfoInput::Release(void) {
return cr;
}

STDAPI CDisplayAttributeInfoInput::GetGUID(_Out_ GUID* pguid) {
STDMETHODIMP CDisplayAttributeInfoInput::GetGUID(_Out_ GUID* pguid) {
if (pguid == nullptr)
return E_INVALIDARG;

Expand All @@ -78,7 +79,7 @@ STDAPI CDisplayAttributeInfoInput::GetGUID(_Out_ GUID* pguid) {
return S_OK;
}

STDAPI CDisplayAttributeInfoInput::GetDescription(_Out_ BSTR* pbstrDesc) {
STDMETHODIMP CDisplayAttributeInfoInput::GetDescription(_Out_ BSTR* pbstrDesc) {
BSTR tempDesc;

if (pbstrDesc == nullptr) {
Expand All @@ -96,7 +97,7 @@ STDAPI CDisplayAttributeInfoInput::GetDescription(_Out_ BSTR* pbstrDesc) {
return S_OK;
}

STDAPI CDisplayAttributeInfoInput::GetAttributeInfo(
STDMETHODIMP CDisplayAttributeInfoInput::GetAttributeInfo(
_Out_ TF_DISPLAYATTRIBUTE* ptfDisplayAttr) {
if (ptfDisplayAttr == nullptr) {
return E_INVALIDARG;
Expand All @@ -107,11 +108,11 @@ STDAPI CDisplayAttributeInfoInput::GetAttributeInfo(
return S_OK;
}

STDAPI CDisplayAttributeInfoInput::SetAttributeInfo(
STDMETHODIMP CDisplayAttributeInfoInput::SetAttributeInfo(
_In_ const TF_DISPLAYATTRIBUTE* /*ptfDisplayAttr*/) {
return E_NOTIMPL;
}

STDAPI CDisplayAttributeInfoInput::Reset() {
STDMETHODIMP CDisplayAttributeInfoInput::Reset() {
return SetAttributeInfo(_pDisplayAttribute);
}
4 changes: 2 additions & 2 deletions WeaselTSF/DisplayAttributeProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "EnumDisplayAttributeInfo.h"
#include "DisplayAttributeInfo.h"

STDAPI WeaselTSF::EnumDisplayAttributeInfo(
STDMETHODIMP WeaselTSF::EnumDisplayAttributeInfo(
__RPC__deref_out_opt IEnumTfDisplayAttributeInfo** ppEnum) {
CEnumDisplayAttributeInfo* pAttributeEnum = nullptr;

Expand All @@ -24,7 +24,7 @@ STDAPI WeaselTSF::EnumDisplayAttributeInfo(
return S_OK;
}

STDAPI WeaselTSF::GetDisplayAttributeInfo(
STDMETHODIMP WeaselTSF::GetDisplayAttributeInfo(
__RPC__in REFGUID guidInfo,
__RPC__deref_out_opt ITfDisplayAttributeInfo** ppInfo) {
if (ppInfo == nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion WeaselTSF/EditSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "CandidateList.h"
#include "ResponseParser.h"

STDAPI WeaselTSF::DoEditSession(TfEditCookie ec) {
STDMETHODIMP WeaselTSF::DoEditSession(TfEditCookie ec) {
// get commit string from server
std::wstring commit;
weasel::Config config;
Expand Down
20 changes: 10 additions & 10 deletions WeaselTSF/EnumDisplayAttributeInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ CEnumDisplayAttributeInfo::~CEnumDisplayAttributeInfo() {
DllRelease();
}

STDAPI CEnumDisplayAttributeInfo::QueryInterface(REFIID riid,
_Outptr_ void** ppvObj) {
STDMETHODIMP CEnumDisplayAttributeInfo::QueryInterface(REFIID riid,
_Outptr_ void** ppvObj) {
if (ppvObj == nullptr)
Comment on lines +18 to 20
return E_INVALIDARG;

Expand Down Expand Up @@ -51,7 +51,7 @@ STDAPI_(ULONG) CEnumDisplayAttributeInfo::Release() {
return cr;
}

STDAPI CEnumDisplayAttributeInfo::Clone(
STDMETHODIMP CEnumDisplayAttributeInfo::Clone(
_Out_ IEnumTfDisplayAttributeInfo** ppEnum) {
CEnumDisplayAttributeInfo* pClone = nullptr;

Expand All @@ -74,11 +74,11 @@ STDAPI CEnumDisplayAttributeInfo::Clone(
return S_OK;
}

STDAPI CEnumDisplayAttributeInfo::Next(ULONG ulCount,
__RPC__out_ecount_part(ulCount,
*pcFetched)
ITfDisplayAttributeInfo** rgInfo,
__RPC__out ULONG* pcFetched) {
STDMETHODIMP CEnumDisplayAttributeInfo::Next(
ULONG ulCount,
__RPC__out_ecount_part(ulCount, *pcFetched)
ITfDisplayAttributeInfo** rgInfo,
__RPC__out ULONG* pcFetched) {
ULONG fetched;

fetched = 0;
Expand Down Expand Up @@ -116,12 +116,12 @@ STDAPI CEnumDisplayAttributeInfo::Next(ULONG ulCount,
return (fetched == ulCount) ? S_OK : S_FALSE;
}

STDAPI CEnumDisplayAttributeInfo::Reset() {
STDMETHODIMP CEnumDisplayAttributeInfo::Reset() {
_index = 0;
return S_OK;
}

STDAPI CEnumDisplayAttributeInfo::Skip(ULONG ulCount) {
STDMETHODIMP CEnumDisplayAttributeInfo::Skip(ULONG ulCount) {
if ((ulCount + _index) > 1 || (ulCount + _index) < ulCount) {
_index = 1;
return S_FALSE;
Expand Down
40 changes: 20 additions & 20 deletions WeaselTSF/KeyEventSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void WeaselTSF::_ProcessKeyEvent(WPARAM wParam, LPARAM lParam, BOOL* pfEaten) {
}
}

STDAPI WeaselTSF::OnSetFocus(BOOL fForeground) {
STDMETHODIMP WeaselTSF::OnSetFocus(BOOL fForeground) {
if (fForeground)
m_client.FocusIn();
else {
Expand All @@ -83,10 +83,10 @@ STDAPI WeaselTSF::OnSetFocus(BOOL fForeground) {
* and for OnKeyDown() to check if the key has already been sent to the server.
*/

STDAPI WeaselTSF::OnTestKeyDown(ITfContext* pContext,
WPARAM wParam,
LPARAM lParam,
BOOL* pfEaten) {
STDMETHODIMP WeaselTSF::OnTestKeyDown(ITfContext* pContext,
WPARAM wParam,
LPARAM lParam,
BOOL* pfEaten) {
_fTestKeyUpPending = FALSE;
if (_fTestKeyDownPending) {
*pfEaten = TRUE;
Expand All @@ -99,10 +99,10 @@ STDAPI WeaselTSF::OnTestKeyDown(ITfContext* pContext,
return S_OK;
}

STDAPI WeaselTSF::OnKeyDown(ITfContext* pContext,
WPARAM wParam,
LPARAM lParam,
BOOL* pfEaten) {
STDMETHODIMP WeaselTSF::OnKeyDown(ITfContext* pContext,
WPARAM wParam,
LPARAM lParam,
BOOL* pfEaten) {
_fTestKeyUpPending = FALSE;
if (_fTestKeyDownPending) {
_fTestKeyDownPending = FALSE;
Expand All @@ -114,10 +114,10 @@ STDAPI WeaselTSF::OnKeyDown(ITfContext* pContext,
return S_OK;
}

STDAPI WeaselTSF::OnTestKeyUp(ITfContext* pContext,
WPARAM wParam,
LPARAM lParam,
BOOL* pfEaten) {
STDMETHODIMP WeaselTSF::OnTestKeyUp(ITfContext* pContext,
WPARAM wParam,
LPARAM lParam,
BOOL* pfEaten) {
_fTestKeyDownPending = FALSE;
if (_fTestKeyUpPending) {
*pfEaten = TRUE;
Expand All @@ -130,10 +130,10 @@ STDAPI WeaselTSF::OnTestKeyUp(ITfContext* pContext,
return S_OK;
}

STDAPI WeaselTSF::OnKeyUp(ITfContext* pContext,
WPARAM wParam,
LPARAM lParam,
BOOL* pfEaten) {
STDMETHODIMP WeaselTSF::OnKeyUp(ITfContext* pContext,
WPARAM wParam,
LPARAM lParam,
BOOL* pfEaten) {
_fTestKeyDownPending = FALSE;
if (_fTestKeyUpPending) {
_fTestKeyUpPending = FALSE;
Expand All @@ -146,9 +146,9 @@ STDAPI WeaselTSF::OnKeyUp(ITfContext* pContext,
return S_OK;
}

STDAPI WeaselTSF::OnPreservedKey(ITfContext* pContext,
REFGUID rguid,
BOOL* pfEaten) {
STDMETHODIMP WeaselTSF::OnPreservedKey(ITfContext* pContext,
REFGUID rguid,
BOOL* pfEaten) {
*pfEaten = FALSE;
return S_OK;
}
Expand Down
Loading
Loading