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 #include "msctf_internal.h"
23 typedef struct tagDisplayAttributeMgr
{
24 ITfDisplayAttributeMgr ITfDisplayAttributeMgr_iface
;
28 } DisplayAttributeMgr
;
30 static inline DisplayAttributeMgr
*impl_from_ITfDisplayAttributeMgr(ITfDisplayAttributeMgr
*iface
)
32 return CONTAINING_RECORD(iface
, DisplayAttributeMgr
, ITfDisplayAttributeMgr_iface
);
35 static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr
*This
)
37 TRACE("destroying %p\n", This
);
39 HeapFree(GetProcessHeap(),0,This
);
42 static HRESULT WINAPI
DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr
*iface
, REFIID iid
, LPVOID
*ppvOut
)
44 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
47 if (IsEqualIID(iid
, &IID_IUnknown
) || IsEqualIID(iid
, &IID_ITfDisplayAttributeMgr
))
49 *ppvOut
= &This
->ITfDisplayAttributeMgr_iface
;
54 ITfDisplayAttributeMgr_AddRef(iface
);
58 WARN("unsupported interface: %s\n", debugstr_guid(iid
));
62 static ULONG WINAPI
DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr
*iface
)
64 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
65 return InterlockedIncrement(&This
->refCount
);
68 static ULONG WINAPI
DisplayAttributeMgr_Release(ITfDisplayAttributeMgr
*iface
)
70 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
73 ret
= InterlockedDecrement(&This
->refCount
);
75 DisplayAttributeMgr_Destructor(This
);
79 /*****************************************************
80 * ITfDisplayAttributeMgr functions
81 *****************************************************/
83 static HRESULT WINAPI
DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr
*iface
)
85 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
87 FIXME("STUB:(%p)\n",This
);
91 static HRESULT WINAPI
DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr
*iface
, IEnumTfDisplayAttributeInfo
**ppEnum
)
93 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
95 FIXME("STUB:(%p)\n",This
);
99 static HRESULT WINAPI
DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr
*iface
, REFGUID guid
, ITfDisplayAttributeInfo
**ppInfo
, CLSID
*pclsidOwner
)
101 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
103 FIXME("STUB:(%p)\n",This
);
107 static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgrVtbl
=
109 DisplayAttributeMgr_QueryInterface
,
110 DisplayAttributeMgr_AddRef
,
111 DisplayAttributeMgr_Release
,
112 DisplayAttributeMgr_OnUpdateInfo
,
113 DisplayAttributeMgr_EnumDisplayAttributeInfo
,
114 DisplayAttributeMgr_GetDisplayAttributeInfo
117 HRESULT
DisplayAttributeMgr_Constructor(IUnknown
*pUnkOuter
, IUnknown
**ppOut
)
119 DisplayAttributeMgr
*This
;
121 return CLASS_E_NOAGGREGATION
;
123 This
= HeapAlloc(GetProcessHeap(),0,sizeof(DisplayAttributeMgr
));
125 return E_OUTOFMEMORY
;
127 This
->ITfDisplayAttributeMgr_iface
.lpVtbl
= &DisplayAttributeMgrVtbl
;
130 *ppOut
= (IUnknown
*)&This
->ITfDisplayAttributeMgr_iface
;
131 TRACE("returning %p\n", *ppOut
);