2010-03-18 16:39:00 +01:00
|
|
|
/*
|
|
|
|
* ITfDisplayAttributeMgr implementation
|
|
|
|
*
|
|
|
|
* Copyright 2010 CodeWeavers, Aric Stewart
|
|
|
|
*
|
|
|
|
* 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 tagDisplayAttributeMgr {
|
2010-12-08 22:59:38 +01:00
|
|
|
ITfDisplayAttributeMgr ITfDisplayAttributeMgr_iface;
|
2010-03-18 16:39:00 +01:00
|
|
|
|
|
|
|
LONG refCount;
|
|
|
|
|
|
|
|
} DisplayAttributeMgr;
|
|
|
|
|
2010-12-08 22:59:38 +01:00
|
|
|
static inline DisplayAttributeMgr *impl_from_ITfDisplayAttributeMgr(ITfDisplayAttributeMgr *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, DisplayAttributeMgr, ITfDisplayAttributeMgr_iface);
|
|
|
|
}
|
|
|
|
|
2010-03-18 16:39:00 +01:00
|
|
|
static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This)
|
|
|
|
{
|
|
|
|
TRACE("destroying %p\n", This);
|
|
|
|
|
|
|
|
HeapFree(GetProcessHeap(),0,This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr *iface, REFIID iid, LPVOID *ppvOut)
|
|
|
|
{
|
2010-12-08 22:59:38 +01:00
|
|
|
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
|
2010-03-18 16:39:00 +01:00
|
|
|
*ppvOut = NULL;
|
|
|
|
|
|
|
|
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr))
|
|
|
|
{
|
|
|
|
*ppvOut = This;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*ppvOut)
|
|
|
|
{
|
2012-08-19 20:01:36 +02:00
|
|
|
ITfDisplayAttributeMgr_AddRef(iface);
|
2010-03-18 16:39:00 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
WARN("unsupported interface: %s\n", debugstr_guid(iid));
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr *iface)
|
|
|
|
{
|
2010-12-08 22:59:38 +01:00
|
|
|
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
|
2010-03-18 16:39:00 +01:00
|
|
|
return InterlockedIncrement(&This->refCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI DisplayAttributeMgr_Release(ITfDisplayAttributeMgr *iface)
|
|
|
|
{
|
2010-12-08 22:59:38 +01:00
|
|
|
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
|
2010-03-18 16:39:00 +01:00
|
|
|
ULONG ret;
|
|
|
|
|
|
|
|
ret = InterlockedDecrement(&This->refCount);
|
|
|
|
if (ret == 0)
|
|
|
|
DisplayAttributeMgr_Destructor(This);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************
|
|
|
|
* ITfDisplayAttributeMgr functions
|
|
|
|
*****************************************************/
|
|
|
|
|
|
|
|
static HRESULT WINAPI DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr *iface)
|
|
|
|
{
|
2010-12-08 22:59:38 +01:00
|
|
|
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
|
2010-03-18 16:39:00 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, IEnumTfDisplayAttributeInfo **ppEnum)
|
|
|
|
{
|
2010-12-08 22:59:38 +01:00
|
|
|
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
|
2010-03-18 16:39:00 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, REFGUID guid, ITfDisplayAttributeInfo **ppInfo, CLSID *pclsidOwner)
|
|
|
|
{
|
2010-12-08 22:59:38 +01:00
|
|
|
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
|
2010-03-18 16:39:00 +01:00
|
|
|
|
|
|
|
FIXME("STUB:(%p)\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgr_DisplayAttributeMgrVtbl =
|
|
|
|
{
|
|
|
|
DisplayAttributeMgr_QueryInterface,
|
|
|
|
DisplayAttributeMgr_AddRef,
|
|
|
|
DisplayAttributeMgr_Release,
|
|
|
|
|
|
|
|
DisplayAttributeMgr_OnUpdateInfo,
|
|
|
|
DisplayAttributeMgr_EnumDisplayAttributeInfo,
|
|
|
|
DisplayAttributeMgr_GetDisplayAttributeInfo
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
|
|
|
|
{
|
|
|
|
DisplayAttributeMgr *This;
|
|
|
|
if (pUnkOuter)
|
|
|
|
return CLASS_E_NOAGGREGATION;
|
|
|
|
|
|
|
|
This = HeapAlloc(GetProcessHeap(),0,sizeof(DisplayAttributeMgr));
|
|
|
|
if (This == NULL)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2010-12-08 22:59:38 +01:00
|
|
|
This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgr_DisplayAttributeMgrVtbl;
|
2010-03-18 16:39:00 +01:00
|
|
|
This->refCount = 1;
|
|
|
|
|
|
|
|
TRACE("returning %p\n", This);
|
|
|
|
*ppOut = (IUnknown *)This;
|
|
|
|
return S_OK;
|
|
|
|
}
|