Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendisplayattributemgr.c
Go to the documentation of this file.
00001 /* 00002 * ITfDisplayAttributeMgr implementation 00003 * 00004 * Copyright 2010 CodeWeavers, Aric Stewart 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00019 */ 00020 00021 #define COBJMACROS 00022 00023 #include "wine/debug.h" 00024 #include "winbase.h" 00025 #include "winreg.h" 00026 #include "shlwapi.h" 00027 00028 #include "msctf.h" 00029 #include "msctf_internal.h" 00030 00031 WINE_DEFAULT_DEBUG_CHANNEL(msctf); 00032 00033 typedef struct tagDisplayAttributeMgr { 00034 ITfDisplayAttributeMgr ITfDisplayAttributeMgr_iface; 00035 00036 LONG refCount; 00037 00038 } DisplayAttributeMgr; 00039 00040 static inline DisplayAttributeMgr *impl_from_ITfDisplayAttributeMgr(ITfDisplayAttributeMgr *iface) 00041 { 00042 return CONTAINING_RECORD(iface, DisplayAttributeMgr, ITfDisplayAttributeMgr_iface); 00043 } 00044 00045 static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This) 00046 { 00047 TRACE("destroying %p\n", This); 00048 00049 HeapFree(GetProcessHeap(),0,This); 00050 } 00051 00052 static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr *iface, REFIID iid, LPVOID *ppvOut) 00053 { 00054 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); 00055 *ppvOut = NULL; 00056 00057 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr)) 00058 { 00059 *ppvOut = This; 00060 } 00061 00062 if (*ppvOut) 00063 { 00064 IUnknown_AddRef(iface); 00065 return S_OK; 00066 } 00067 00068 WARN("unsupported interface: %s\n", debugstr_guid(iid)); 00069 return E_NOINTERFACE; 00070 } 00071 00072 static ULONG WINAPI DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr *iface) 00073 { 00074 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); 00075 return InterlockedIncrement(&This->refCount); 00076 } 00077 00078 static ULONG WINAPI DisplayAttributeMgr_Release(ITfDisplayAttributeMgr *iface) 00079 { 00080 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); 00081 ULONG ret; 00082 00083 ret = InterlockedDecrement(&This->refCount); 00084 if (ret == 0) 00085 DisplayAttributeMgr_Destructor(This); 00086 return ret; 00087 } 00088 00089 /***************************************************** 00090 * ITfDisplayAttributeMgr functions 00091 *****************************************************/ 00092 00093 static HRESULT WINAPI DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr *iface) 00094 { 00095 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); 00096 00097 FIXME("STUB:(%p)\n",This); 00098 return E_NOTIMPL; 00099 } 00100 00101 static HRESULT WINAPI DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, IEnumTfDisplayAttributeInfo **ppEnum) 00102 { 00103 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); 00104 00105 FIXME("STUB:(%p)\n",This); 00106 return E_NOTIMPL; 00107 } 00108 00109 static HRESULT WINAPI DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, REFGUID guid, ITfDisplayAttributeInfo **ppInfo, CLSID *pclsidOwner) 00110 { 00111 DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); 00112 00113 FIXME("STUB:(%p)\n",This); 00114 return E_NOTIMPL; 00115 } 00116 00117 static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgr_DisplayAttributeMgrVtbl = 00118 { 00119 DisplayAttributeMgr_QueryInterface, 00120 DisplayAttributeMgr_AddRef, 00121 DisplayAttributeMgr_Release, 00122 00123 DisplayAttributeMgr_OnUpdateInfo, 00124 DisplayAttributeMgr_EnumDisplayAttributeInfo, 00125 DisplayAttributeMgr_GetDisplayAttributeInfo 00126 }; 00127 00128 HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) 00129 { 00130 DisplayAttributeMgr *This; 00131 if (pUnkOuter) 00132 return CLASS_E_NOAGGREGATION; 00133 00134 This = HeapAlloc(GetProcessHeap(),0,sizeof(DisplayAttributeMgr)); 00135 if (This == NULL) 00136 return E_OUTOFMEMORY; 00137 00138 This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgr_DisplayAttributeMgrVtbl; 00139 This->refCount = 1; 00140 00141 TRACE("returning %p\n", This); 00142 *ppOut = (IUnknown *)This; 00143 return S_OK; 00144 } Generated on Fri May 25 2012 04:22:56 for ReactOS by
1.7.6.1
|