amstream: Store parent as struct ddraw_stream in ddraw stream sample.
[wine/zf.git] / dlls / msctf / displayattributemgr.c
blobc8bb71e2ce2ad69ae904c3f01212466b83ced457
1 /*
2 * ITfDisplayAttributeMgr implementation
4 * Copyright 2010 CodeWeavers, Aric Stewart
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define COBJMACROS
23 #include "wine/debug.h"
24 #include "winbase.h"
25 #include "winreg.h"
26 #include "shlwapi.h"
28 #include "msctf.h"
29 #include "msctf_internal.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(msctf);
33 typedef struct tagDisplayAttributeMgr {
34 ITfDisplayAttributeMgr ITfDisplayAttributeMgr_iface;
36 LONG refCount;
38 } DisplayAttributeMgr;
40 static inline DisplayAttributeMgr *impl_from_ITfDisplayAttributeMgr(ITfDisplayAttributeMgr *iface)
42 return CONTAINING_RECORD(iface, DisplayAttributeMgr, ITfDisplayAttributeMgr_iface);
45 static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This)
47 TRACE("destroying %p\n", This);
49 HeapFree(GetProcessHeap(),0,This);
52 static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr *iface, REFIID iid, LPVOID *ppvOut)
54 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
55 *ppvOut = NULL;
57 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr))
59 *ppvOut = &This->ITfDisplayAttributeMgr_iface;
62 if (*ppvOut)
64 ITfDisplayAttributeMgr_AddRef(iface);
65 return S_OK;
68 WARN("unsupported interface: %s\n", debugstr_guid(iid));
69 return E_NOINTERFACE;
72 static ULONG WINAPI DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr *iface)
74 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
75 return InterlockedIncrement(&This->refCount);
78 static ULONG WINAPI DisplayAttributeMgr_Release(ITfDisplayAttributeMgr *iface)
80 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
81 ULONG ret;
83 ret = InterlockedDecrement(&This->refCount);
84 if (ret == 0)
85 DisplayAttributeMgr_Destructor(This);
86 return ret;
89 /*****************************************************
90 * ITfDisplayAttributeMgr functions
91 *****************************************************/
93 static HRESULT WINAPI DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr *iface)
95 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
97 FIXME("STUB:(%p)\n",This);
98 return E_NOTIMPL;
101 static HRESULT WINAPI DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, IEnumTfDisplayAttributeInfo **ppEnum)
103 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
105 FIXME("STUB:(%p)\n",This);
106 return E_NOTIMPL;
109 static HRESULT WINAPI DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, REFGUID guid, ITfDisplayAttributeInfo **ppInfo, CLSID *pclsidOwner)
111 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
113 FIXME("STUB:(%p)\n",This);
114 return E_NOTIMPL;
117 static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgrVtbl =
119 DisplayAttributeMgr_QueryInterface,
120 DisplayAttributeMgr_AddRef,
121 DisplayAttributeMgr_Release,
122 DisplayAttributeMgr_OnUpdateInfo,
123 DisplayAttributeMgr_EnumDisplayAttributeInfo,
124 DisplayAttributeMgr_GetDisplayAttributeInfo
127 HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
129 DisplayAttributeMgr *This;
130 if (pUnkOuter)
131 return CLASS_E_NOAGGREGATION;
133 This = HeapAlloc(GetProcessHeap(),0,sizeof(DisplayAttributeMgr));
134 if (This == NULL)
135 return E_OUTOFMEMORY;
137 This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgrVtbl;
138 This->refCount = 1;
140 *ppOut = (IUnknown *)&This->ITfDisplayAttributeMgr_iface;
141 TRACE("returning %p\n", *ppOut);
142 return S_OK;