2010-02-17 03:31:05 +01:00
|
|
|
/*
|
|
|
|
* ITfLangBarMgr implementation
|
|
|
|
*
|
|
|
|
* Copyright 2010 Justin Chevrier
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winreg.h"
|
|
|
|
#include "shlwapi.h"
|
|
|
|
|
|
|
|
#include "msctf.h"
|
|
|
|
#include "msctf_internal.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
|
|
|
|
|
|
|
|
typedef struct tagLangBarMgr {
|
2010-12-08 22:59:39 +01:00
|
|
|
ITfLangBarMgr ITfLangBarMgr_iface;
|
2010-02-17 03:31:05 +01:00
|
|
|
|
|
|
|
LONG refCount;
|
|
|
|
|
|
|
|
} LangBarMgr;
|
|
|
|
|
2010-12-08 22:59:39 +01:00
|
|
|
static inline LangBarMgr *impl_from_ITfLangBarMgr(ITfLangBarMgr *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, LangBarMgr, ITfLangBarMgr_iface);
|
|
|
|
}
|
|
|
|
|
2010-02-17 03:31:05 +01:00
|
|
|
static void LangBarMgr_Destructor(LangBarMgr *This)
|
|
|
|
{
|
|
|
|
TRACE("destroying %p\n", This);
|
|
|
|
|
|
|
|
HeapFree(GetProcessHeap(),0,This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LangBarMgr_QueryInterface(ITfLangBarMgr *iface, REFIID iid, LPVOID *ppvOut)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
*ppvOut = NULL;
|
|
|
|
|
|
|
|
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr))
|
|
|
|
{
|
2013-11-17 09:21:51 +01:00
|
|
|
*ppvOut = &This->ITfLangBarMgr_iface;
|
2010-02-17 03:31:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (*ppvOut)
|
|
|
|
{
|
2012-08-19 20:01:36 +02:00
|
|
|
ITfLangBarMgr_AddRef(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
WARN("unsupported interface: %s\n", debugstr_guid(iid));
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI LangBarMgr_AddRef(ITfLangBarMgr *iface)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
return InterlockedIncrement(&This->refCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI LangBarMgr_Release(ITfLangBarMgr *iface)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
ULONG ret;
|
|
|
|
|
|
|
|
ret = InterlockedDecrement(&This->refCount);
|
|
|
|
if (ret == 0)
|
|
|
|
LangBarMgr_Destructor(This);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************
|
|
|
|
* ITfLangBarMgr functions
|
|
|
|
*****************************************************/
|
|
|
|
|
|
|
|
static HRESULT WINAPI LangBarMgr_AdviseEventSink( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, HWND hwnd, DWORD dwflags, DWORD *pdwCookie)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LangBarMgr_UnAdviseEventSink( ITfLangBarMgr* iface, DWORD dwCookie)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LangBarMgr_GetThreadMarshalInterface( ITfLangBarMgr* iface, DWORD dwThreadId, DWORD dwType, REFIID riid, IUnknown **ppunk)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LangBarMgr_GetThreadLangBarItemMgr( ITfLangBarMgr* iface, DWORD dwThreadId, ITfLangBarItemMgr **pplbi, DWORD *pdwThreadid)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LangBarMgr_GetInputProcessorProfiles( ITfLangBarMgr* iface, DWORD dwThreadId, ITfInputProcessorProfiles **ppaip, DWORD *pdwThreadid)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LangBarMgr_RestoreLastFocus( ITfLangBarMgr* iface, DWORD *dwThreadId, BOOL fPrev)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LangBarMgr_SetModalInput( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, DWORD dwThreadId, DWORD dwFlags)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LangBarMgr_ShowFloating( ITfLangBarMgr* iface, DWORD dwFlags)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI LangBarMgr_GetShowFloatingStatus( ITfLangBarMgr* iface, DWORD *pdwFlags)
|
|
|
|
{
|
2010-12-08 22:59:39 +01:00
|
|
|
LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
|
2010-02-17 03:31:05 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const ITfLangBarMgrVtbl LangBarMgr_LangBarMgrVtbl =
|
|
|
|
{
|
|
|
|
LangBarMgr_QueryInterface,
|
|
|
|
LangBarMgr_AddRef,
|
|
|
|
LangBarMgr_Release,
|
|
|
|
|
|
|
|
LangBarMgr_AdviseEventSink,
|
|
|
|
LangBarMgr_UnAdviseEventSink,
|
|
|
|
LangBarMgr_GetThreadMarshalInterface,
|
|
|
|
LangBarMgr_GetThreadLangBarItemMgr,
|
|
|
|
LangBarMgr_GetInputProcessorProfiles,
|
|
|
|
LangBarMgr_RestoreLastFocus,
|
|
|
|
LangBarMgr_SetModalInput,
|
|
|
|
LangBarMgr_ShowFloating,
|
|
|
|
LangBarMgr_GetShowFloatingStatus
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
|
|
|
|
{
|
|
|
|
LangBarMgr *This;
|
|
|
|
if (pUnkOuter)
|
|
|
|
return CLASS_E_NOAGGREGATION;
|
|
|
|
|
|
|
|
This = HeapAlloc(GetProcessHeap(),0,sizeof(LangBarMgr));
|
|
|
|
if (This == NULL)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2010-12-08 22:59:39 +01:00
|
|
|
This->ITfLangBarMgr_iface.lpVtbl = &LangBarMgr_LangBarMgrVtbl;
|
2010-02-17 03:31:05 +01:00
|
|
|
This->refCount = 1;
|
|
|
|
|
2013-11-19 13:14:45 +01:00
|
|
|
*ppOut = (IUnknown *)&This->ITfLangBarMgr_iface;
|
|
|
|
TRACE("returning %p\n", *ppOut);
|
2010-02-17 03:31:05 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|