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 WIN32_NO_STATUS
23 #define COM_NO_WINDOWS_H
27 #include <wine/debug.h>
33 //#include "msctf_internal.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(msctf
);
37 typedef struct tagDisplayAttributeMgr
{
38 ITfDisplayAttributeMgr ITfDisplayAttributeMgr_iface
;
42 } DisplayAttributeMgr
;
44 static inline DisplayAttributeMgr
*impl_from_ITfDisplayAttributeMgr(ITfDisplayAttributeMgr
*iface
)
46 return CONTAINING_RECORD(iface
, DisplayAttributeMgr
, ITfDisplayAttributeMgr_iface
);
49 static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr
*This
)
51 TRACE("destroying %p\n", This
);
53 HeapFree(GetProcessHeap(),0,This
);
56 static HRESULT WINAPI
DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr
*iface
, REFIID iid
, LPVOID
*ppvOut
)
58 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
61 if (IsEqualIID(iid
, &IID_IUnknown
) || IsEqualIID(iid
, &IID_ITfDisplayAttributeMgr
))
68 IUnknown_AddRef(iface
);
72 WARN("unsupported interface: %s\n", debugstr_guid(iid
));
76 static ULONG WINAPI
DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr
*iface
)
78 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
79 return InterlockedIncrement(&This
->refCount
);
82 static ULONG WINAPI
DisplayAttributeMgr_Release(ITfDisplayAttributeMgr
*iface
)
84 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
87 ret
= InterlockedDecrement(&This
->refCount
);
89 DisplayAttributeMgr_Destructor(This
);
93 /*****************************************************
94 * ITfDisplayAttributeMgr functions
95 *****************************************************/
97 static HRESULT WINAPI
DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr
*iface
)
99 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
101 FIXME("STUB:(%p)\n",This
);
105 static HRESULT WINAPI
DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr
*iface
, IEnumTfDisplayAttributeInfo
**ppEnum
)
107 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
109 FIXME("STUB:(%p)\n",This
);
113 static HRESULT WINAPI
DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr
*iface
, REFGUID guid
, ITfDisplayAttributeInfo
**ppInfo
, CLSID
*pclsidOwner
)
115 DisplayAttributeMgr
*This
= impl_from_ITfDisplayAttributeMgr(iface
);
117 FIXME("STUB:(%p)\n",This
);
121 static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgr_DisplayAttributeMgrVtbl
=
123 DisplayAttributeMgr_QueryInterface
,
124 DisplayAttributeMgr_AddRef
,
125 DisplayAttributeMgr_Release
,
127 DisplayAttributeMgr_OnUpdateInfo
,
128 DisplayAttributeMgr_EnumDisplayAttributeInfo
,
129 DisplayAttributeMgr_GetDisplayAttributeInfo
132 HRESULT
DisplayAttributeMgr_Constructor(IUnknown
*pUnkOuter
, IUnknown
**ppOut
)
134 DisplayAttributeMgr
*This
;
136 return CLASS_E_NOAGGREGATION
;
138 This
= HeapAlloc(GetProcessHeap(),0,sizeof(DisplayAttributeMgr
));
140 return E_OUTOFMEMORY
;
142 This
->ITfDisplayAttributeMgr_iface
.lpVtbl
= &DisplayAttributeMgr_DisplayAttributeMgrVtbl
;
145 TRACE("returning %p\n", This
);
146 *ppOut
= (IUnknown
*)This
;