Moved mode setting out of .spec file into Makefile.
[wine/gsoc_dplay.git] / dlls / shell32 / dragdrophelper.c
blobd85619f51b77e658ec6774278d76cf8f04c9a3ab
1 /*
2 * file system folder
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998, 1999, 2002 Juergen Schmied
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "config.h"
23 #include "wine/port.h"
25 #include <stdlib.h>
26 #include <string.h>
27 #include <stdio.h>
29 #include "winerror.h"
30 #include "winbase.h"
31 #include "winreg.h"
33 #include "oleidl.h"
34 #include "shlguid.h"
36 #include "wine/obj_dragdrophelper.h"
37 #include "wine/debug.h"
38 #include "debughlp.h"
40 WINE_DEFAULT_DEBUG_CHANNEL (shell);
42 /***********************************************************************
43 * IDropTargetHelper implementation
46 typedef struct {
47 ICOM_VFIELD (IDropTargetHelper);
48 DWORD ref;
49 } IDropTargetHelperImpl;
51 static struct ICOM_VTABLE (IDropTargetHelper) vt_IDropTargetHelper;
53 #define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
54 #define _IDropTargetHelper_(This) (IDropTargetHelper*)&(This->lpVtbl)
56 /**************************************************************************
57 * IDropTargetHelper_Constructor
59 HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
61 IDropTargetHelperImpl *dth;
63 TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
65 if (!ppv)
66 return E_POINTER;
67 if (pUnkOuter)
68 return CLASS_E_NOAGGREGATION;
70 dth = (IDropTargetHelperImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IDropTargetHelperImpl));
71 if (!dth) return E_OUTOFMEMORY;
73 dth->ref = 0;
74 ICOM_VTBL (dth) = &vt_IDropTargetHelper;
76 if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (dth), riid, ppv))) {
77 IUnknown_Release (_IUnknown_ (dth));
78 return E_NOINTERFACE;
81 TRACE ("--(%p)\n", dth);
82 return S_OK;
85 /**************************************************************************
86 * IDropTargetHelper_fnQueryInterface
88 static HRESULT WINAPI IDropTargetHelper_fnQueryInterface (IDropTargetHelper * iface, REFIID riid, LPVOID * ppvObj)
90 ICOM_THIS (IDropTargetHelperImpl, iface);
92 TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
94 *ppvObj = NULL;
96 if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IDropTargetHelper)) {
97 *ppvObj = This;
100 if (*ppvObj) {
101 IUnknown_AddRef ((IUnknown *) (*ppvObj));
102 TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
103 return S_OK;
105 FIXME ("-- Interface: E_NOINTERFACE\n");
106 return E_NOINTERFACE;
109 static ULONG WINAPI IDropTargetHelper_fnAddRef (IDropTargetHelper * iface)
111 ICOM_THIS (IDropTargetHelperImpl, iface);
113 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
115 return ++(This->ref);
118 static ULONG WINAPI IDropTargetHelper_fnRelease (IDropTargetHelper * iface)
120 ICOM_THIS (IDropTargetHelperImpl, iface);
122 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
124 if (!--(This->ref)) {
125 TRACE ("-- destroying (%p)\n", This);
126 LocalFree ((HLOCAL) This);
128 return This->ref;
131 static HRESULT WINAPI IDropTargetHelper_fnDragEnter (
132 IDropTargetHelper * iface,
133 HWND hwndTarget,
134 IDataObject* pDataObject,
135 POINT* ppt,
136 DWORD dwEffect)
138 ICOM_THIS (IDropTargetHelperImpl, iface);
139 FIXME ("(%p)->(0x%x %p %p 0x%08lx)\n", This,hwndTarget, pDataObject, ppt, dwEffect);
140 return E_NOTIMPL;
143 static HRESULT WINAPI IDropTargetHelper_fnDragLeave (IDropTargetHelper * iface)
145 ICOM_THIS (IDropTargetHelperImpl, iface);
146 FIXME ("(%p)->()\n", This);
147 return E_NOTIMPL;
150 static HRESULT WINAPI IDropTargetHelper_fnDragOver (IDropTargetHelper * iface, POINT* ppt, DWORD dwEffect)
152 ICOM_THIS (IDropTargetHelperImpl, iface);
153 FIXME ("(%p)->(%p 0x%08lx)\n", This, ppt, dwEffect);
154 return E_NOTIMPL;
157 static HRESULT WINAPI IDropTargetHelper_fnDrop (IDropTargetHelper * iface, IDataObject* pDataObject, POINT* ppt, DWORD dwEffect)
159 ICOM_THIS (IDropTargetHelperImpl, iface);
160 FIXME ("(%p)->(%p %p 0x%08lx)\n", This, pDataObject, ppt, dwEffect);
161 return E_NOTIMPL;
164 static HRESULT WINAPI IDropTargetHelper_fnShow (IDropTargetHelper * iface, BOOL fShow)
166 ICOM_THIS (IDropTargetHelperImpl, iface);
167 FIXME ("(%p)->(%u)\n", This, fShow);
168 return E_NOTIMPL;
171 static ICOM_VTABLE (IDropTargetHelper) vt_IDropTargetHelper =
173 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
174 IDropTargetHelper_fnQueryInterface,
175 IDropTargetHelper_fnAddRef,
176 IDropTargetHelper_fnRelease,
177 IDropTargetHelper_fnDragEnter,
178 IDropTargetHelper_fnDragLeave,
179 IDropTargetHelper_fnDragOver,
180 IDropTargetHelper_fnDrop,
181 IDropTargetHelper_fnShow