d3dx9: Start effect state parsing.
[wine/multimedia.git] / dlls / shdocvw / taskbarlist.c
blobd85350677413b61d472294e6acdac93bb4bbb92c
1 /*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "config.h"
21 #include "wine/port.h"
22 #include "wine/debug.h"
24 #include "shdocvw.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
28 struct taskbar_list
30 ITaskbarList ITaskbarList_iface;
31 LONG refcount;
34 static inline struct taskbar_list *impl_from_ITaskbarList(ITaskbarList *iface)
36 return CONTAINING_RECORD(iface, struct taskbar_list, ITaskbarList_iface);
39 /* IUnknown methods */
41 static HRESULT STDMETHODCALLTYPE taskbar_list_QueryInterface(ITaskbarList *iface, REFIID riid, void **object)
43 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
45 if (IsEqualGUID(riid, &IID_ITaskbarList)
46 || IsEqualGUID(riid, &IID_IUnknown))
48 IUnknown_AddRef(iface);
49 *object = iface;
50 return S_OK;
53 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
55 *object = NULL;
56 return E_NOINTERFACE;
59 static ULONG STDMETHODCALLTYPE taskbar_list_AddRef(ITaskbarList *iface)
61 struct taskbar_list *This = impl_from_ITaskbarList(iface);
62 ULONG refcount = InterlockedIncrement(&This->refcount);
64 TRACE("%p increasing refcount to %u\n", This, refcount);
66 return refcount;
69 static ULONG STDMETHODCALLTYPE taskbar_list_Release(ITaskbarList *iface)
71 struct taskbar_list *This = impl_from_ITaskbarList(iface);
72 ULONG refcount = InterlockedDecrement(&This->refcount);
74 TRACE("%p decreasing refcount to %u\n", This, refcount);
76 if (!refcount)
78 HeapFree(GetProcessHeap(), 0, This);
79 SHDOCVW_UnlockModule();
82 return refcount;
85 /* ITaskbarList methods */
87 static HRESULT STDMETHODCALLTYPE taskbar_list_HrInit(ITaskbarList *iface)
89 TRACE("iface %p\n", iface);
91 return S_OK;
94 static HRESULT STDMETHODCALLTYPE taskbar_list_AddTab(ITaskbarList *iface, HWND hwnd)
96 FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
98 return E_NOTIMPL;
101 static HRESULT STDMETHODCALLTYPE taskbar_list_DeleteTab(ITaskbarList *iface, HWND hwnd)
103 FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
105 return E_NOTIMPL;
108 static HRESULT STDMETHODCALLTYPE taskbar_list_ActivateTab(ITaskbarList *iface, HWND hwnd)
110 FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
112 return E_NOTIMPL;
115 static HRESULT STDMETHODCALLTYPE taskbar_list_SetActiveAlt(ITaskbarList *iface, HWND hwnd)
117 FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
119 return E_NOTIMPL;
122 static const struct ITaskbarListVtbl taskbar_list_vtbl =
124 /* IUnknown methods */
125 taskbar_list_QueryInterface,
126 taskbar_list_AddRef,
127 taskbar_list_Release,
128 /* ITaskbarList methods */
129 taskbar_list_HrInit,
130 taskbar_list_AddTab,
131 taskbar_list_DeleteTab,
132 taskbar_list_ActivateTab,
133 taskbar_list_SetActiveAlt,
136 HRESULT TaskbarList_Create(IUnknown *outer, REFIID riid, void **taskbar_list)
138 struct taskbar_list *object;
139 HRESULT hr;
141 TRACE("outer %p, riid %s, taskbar_list %p\n", outer, debugstr_guid(riid), taskbar_list);
143 if (outer)
145 WARN("Aggregation not supported\n");
146 *taskbar_list = NULL;
147 return CLASS_E_NOAGGREGATION;
150 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
151 if (!object)
153 ERR("Failed to allocate taskbar list object memory\n");
154 *taskbar_list = NULL;
155 return E_OUTOFMEMORY;
158 object->ITaskbarList_iface.lpVtbl = &taskbar_list_vtbl;
159 object->refcount = 0;
161 TRACE("Created ITaskbarList %p\n", object);
163 hr = ITaskbarList_QueryInterface(&object->ITaskbarList_iface, riid, taskbar_list);
164 if (FAILED(hr))
166 HeapFree(GetProcessHeap(), 0, object);
167 return hr;
170 SHDOCVW_LockModule();
172 return S_OK;