2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
11 #include "ecore_win32_dnd_drop_source.h"
13 #include "ecore_win32_private.h"
17 // reference count must ALWAYS start at 1
18 DropSource::DropSource() : ref_count_(1)
24 HRESULT DropSource::QueryInterface(REFIID iid, void **ppvObject)
26 // check to see what interface has been requested
27 if (iid == IID_IDropSource || iid == IID_IUnknown)
37 ULONG DropSource::AddRef()
39 return InterlockedIncrement(&ref_count_);
42 ULONG DropSource::Release()
44 LONG count = InterlockedDecrement(&ref_count_);
56 HRESULT DropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
58 // if the Escape key has been pressed since the last call, cancel the drop
59 if(fEscapePressed == TRUE)
60 return DRAGDROP_S_CANCEL;
62 // if the LeftMouse button has been released, then do the drop!
63 if((grfKeyState & MK_LBUTTON) == 0)
64 return DRAGDROP_S_DROP;
66 // continue with the drag-drop
70 HRESULT DropSource::GiveFeedback(DWORD dwEffect __UNUSED__)
72 return DRAGDROP_S_USEDEFAULTCURSORS;
76 // ecore_win32 private functions
78 void *_ecore_win32_dnd_drop_source_new()
80 IDropSource *object = new DropSource();
81 assert(object != NULL);
85 void _ecore_win32_dnd_drop_source_free(void *drop_source)
90 IDropSource *object = (IDropSource *)drop_source;