Commit 3f7ad7aa authored by Francis Beaudet's avatar Francis Beaudet Committed by Alexandre Julliard

Implemented the OLE Drag and Drop target registration mechanism and

the DoDragDrop loop to perform the DnD operation.
parent 197a8e16
......@@ -198,7 +198,7 @@ static char **OBM_Icons_Data[OIC_LAST-OIC_FIRST+1] =
#define OCR_BASE1 (OCR_BASE0 + OCR_LAST0 - OCR_FIRST0 + 1)
#define OCR_FIRST2 OCR_SIZE
#define OCR_LAST2 OCR_SIZENS
#define OCR_LAST2 OCR_SIZEALL
#define OCR_BASE2 (OCR_BASE1 + OCR_LAST1 - OCR_FIRST1 + 1)
#define OCR_FIRST3 OCR_NO
......@@ -229,8 +229,8 @@ static char **OBM_Cursors_Data[NB_CURSORS] =
ocr_sizenesw, /* OCR_SIZENESW */
ocr_sizewe, /* OCR_SIZEWE */
ocr_sizens, /* OCR_SIZENS */
ocr_size, /* OCR_SIZEALL */ /* Re-used the same one as OCR_SIZE for now */
#if 0
ocr_sizeall, /* OCR_SIZEALL */
ocr_icocur /* OCR_ICOCUR */
#endif
ocr_no, /* OCR_NO */
......
......@@ -5,13 +5,9 @@
#ifndef __WINE_OLE2_H
#define __WINE_OLE2_H
#include "oleidl.h"
#include "wintypes.h"
/* to be implemented */
/* FIXME: this should be defined somewhere in oleidl.h instead, should it be repeated here ? */
typedef LPVOID LPDROPTARGET;
/* OLE version */
#define rmm 23
#define rup 639
......@@ -27,11 +23,23 @@ typedef struct tagOleMenuGroupWidths *LPOLEMENUGROUPWIDTHS32;
typedef HGLOBAL32 HOLEMENU32;
HRESULT WINAPI RegisterDragDrop16(HWND16,LPVOID);
HRESULT WINAPI RegisterDragDrop32(HWND32,LPVOID);
/*
* API declarations
*/
HRESULT WINAPI RegisterDragDrop16(HWND16,LPDROPTARGET);
HRESULT WINAPI RegisterDragDrop32(HWND32,LPDROPTARGET);
#define RegisterDragDrop WINELIB_NAME(RegisterDragDrop)
HRESULT WINAPI RevokeDragDrop16(HWND16);
HRESULT WINAPI RevokeDragDrop32(HWND32);
#define RevokeDragDrop WINELIB_NAME(RevokeDragDrop)
HRESULT WINAPI DoDragDrop16(LPDATAOBJECT,
LPDROPSOURCE,
DWORD,
DWORD*);
HRESULT WINAPI DoDragDrop32(LPDATAOBJECT,
LPDROPSOURCE,
DWORD,
DWORD*);
#define DoDragDrop WINELIB_NAME(DoDragDrop)
#endif /* __WINE_OLE2_H */
#ifndef __WINE_OLEIDL_H
#define __WINE_OLEIDL_H
#include "wine/obj_base.h"
/* the following depend only on obj_base.h */
#include "wine/obj_storage.h"
/* the following depend on obj_storage.h */
#include "wine/obj_moniker.h"
/* the following depend on obj_moniker */
#include "wine/obj_dataobject.h"
/* the following depend on obj_dataobject.h */
#include "wine/obj_dragdrop.h"
#endif /* __WINE_OLEIDL_H */
......@@ -50,7 +50,5 @@ DEFINE_GUID (IID_IDockingWindowFrame, 0x47D2657AL, 0x7B27, 0x11D0, 0x8C, 0xA9, 0
DEFINE_GUID (IID_MyComputer, 0x20D04FE0L, 0x3AEA, 0x1069, 0xA2, 0xD8, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_SHLGUID(IID_IEnumOLEVERB, 0x00000104L, 0, 0);
DEFINE_SHLGUID(IID_IViewObject, 0x0000010DL, 0, 0);
DEFINE_SHLGUID(IID_IDropSource, 0x00000121L, 0, 0);
DEFINE_SHLGUID(IID_IDropTarget, 0x00000122L, 0, 0);
#endif /* __WINE_SHLGUID_H */
......@@ -389,13 +389,6 @@ typedef enum tagSHCONTF
SHCONTF_INCLUDEHIDDEN = 128 /* for hidden/system objects */
} SHCONTF;
/* from oleidl.h */
#define DROPEFFECT_NONE 0
#define DROPEFFECT_COPY 1
#define DROPEFFECT_MOVE 2
#define DROPEFFECT_LINK 4
#define DROPEFFECT_SCROLL 0x80000000
/* IShellFolder::GetAttributesOf flags */
#define SFGAO_CANCOPY DROPEFFECT_COPY /* Objects can be copied */
#define SFGAO_CANMOVE DROPEFFECT_MOVE /* Objects can be moved */
......
......@@ -28,4 +28,15 @@
#pragma pack(4)
/*
* POINTL structure. Used in some OLE calls.
*/
typedef struct _POINTL
{
LONG x;
LONG y;
} POINTL;
#endif /* __INCLUDE_WINDEF_H */
/*
* Defines the COM interfaces and APIs related to OLE Drag and Drop.
*
* Depends on 'obj_base.h'.
*/
#ifndef __WINE_WINE_OBJ_DRAGDROP_H
#define __WINE_WINE_OBJ_DRAGDROP_H
#include "winnt.h"
#include "windef.h"
/*****************************************************************************
* Predeclare the interfaces
*/
DEFINE_OLEGUID(IID_IDropSource, 0x00000121L, 0, 0);
typedef struct IDropSource IDropSource,*LPDROPSOURCE;
DEFINE_OLEGUID(IID_IDropTarget, 0x00000122L, 0, 0);
typedef struct IDropTarget IDropTarget,*LPDROPTARGET;
/*****************************************************************************
* DROPEFFECT enumeration
*/
#define DROPEFFECT_NONE 0
#define DROPEFFECT_COPY 1
#define DROPEFFECT_MOVE 2
#define DROPEFFECT_LINK 4
#define DROPEFFECT_SCROLL 0x80000000
/*****************************************************************************
* IDropSource interface
*/
#define ICOM_INTERFACE IDropSource
ICOM_BEGIN(IDropSource,IUnknown)
ICOM_METHOD2(HRESULT, QueryContinueDrag, BOOL32, fEscapePressed, DWORD, grfKeyState);
ICOM_METHOD1(HRESULT, GiveFeedback, DWORD, dwEffect);
ICOM_END(IDropSource)
#undef ICOM_INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDropSource_QueryInterface(p,a,b) ICOM_ICALL2(IUnknown,QueryInterface,p,a,b)
#define IDropSource_AddRef(p) ICOM_ICALL (IUnknown,AddRef,p)
#define IDropSource_Release(p) ICOM_ICALL (IUnknown,Release,p)
/*** IDropTarget methods ***/
#define IDropSource_QueryContinueDrag(p,a,b) ICOM_CALL2(QueryContinueDrag,p,a,b)
#define IDropSource_GiveFeedback(p,a) ICOM_CALL1(GiveFeedback,p,a)
#endif
/*****************************************************************************
* IDropTarget interface
*/
#define ICOM_INTERFACE IDropTarget
ICOM_BEGIN(IDropTarget,IUnknown)
ICOM_METHOD4(HRESULT, DragEnter, IDataObject*, pDataObjhect, DWORD, grfKeyState, POINTL, pt, DWORD*, pdwEffect);
ICOM_METHOD3(HRESULT, DragOver, DWORD, grfKeyState, POINTL, pt, DWORD*, pdwEffect);
ICOM_METHOD(HRESULT, DragLeave);
ICOM_METHOD4(HRESULT, Drop, IDataObject*, pDataObjhect, DWORD, grfKeyState, POINTL, pt, DWORD*, pdwEffect);
ICOM_END(IDropTarget)
#undef ICOM_INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDropTarget_QueryInterface(p,a,b) ICOM_ICALL2(IUnknown,QueryInterface,p,a,b)
#define IDropTarget_AddRef(p) ICOM_ICALL (IUnknown,AddRef,p)
#define IDropTarget_Release(p) ICOM_ICALL (IUnknown,Release,p)
/*** IDropTarget methods ***/
#define IDropTarget_DragEnter(p,a,b,c,d) ICOM_CALL4(DragEnter,p,a,b,c,d)
#define IDropTarget_DragOver(p,a,b,c) ICOM_CALL3(DragOver,p,a,b,c)
#define IDropTarget_DragLeave(p) ICOM_CALL(DragLeave,p)
#define IDropTarget_Drop(p,a,b,c,d) ICOM_CALL4(Drop,p,a,b,c,d)
#endif
#endif /* __WINE_WINE_OBJ_DRAGDROP_H */
......@@ -264,6 +264,9 @@ extern int WIN32_LastError;
/* Drag and Drop */
#define DRAGDROP_S_DROP 0x00040100L
#define DRAGDROP_S_CANCEL 0x00040101L
#define DRAGDROP_E_NOTREGISTERED 0x80040100L
#define DRAGDROP_E_ALREADYREGISTERED 0x80040101L
#define DRAGDROP_S_USEDEFAULTCURSORS 0x00040102L
#define E_UNEXPECTED 0x8000FFFF
......@@ -290,6 +293,7 @@ extern int WIN32_LastError;
#define CO_E_OBJISREG 0x800401FB
#define OLE_E_ENUM_NOMORE 0x80040002
#define OLE_S_USEREG 0x00040000
#define CLASS_E_NOAGGREGATION 0x80040110
#define CLASS_E_CLASSNOTAVAILABLE 0x80040111
#define E_ACCESSDENIED 0x80070005
......
......@@ -485,13 +485,6 @@ DECL_WINELIB_TYPE(POINT)
DECL_WINELIB_TYPE(PPOINT)
DECL_WINELIB_TYPE(LPPOINT)
typedef struct tagPOINTL
{
LONG x;
LONG y;
} POINTL, *PPOINTL, *LPPOINTL;
#define CONV_POINT16TO32(p16,p32) \
((p32)->x = (INT32)(p16)->x, (p32)->y = (INT32)(p16)->y)
#define CONV_POINT32TO16(p32,p16) \
......
......@@ -105,7 +105,7 @@ type win32
102 stub OleDuplicateData
103 stub OleFlushClipboard
104 stub OleGetAutoConvert
105 stub OleGetClipboard
105 stdcall OleGetClipboard(ptr) OleGetClipboard32
106 stub OleGetIconOfClass
107 stub OleGetIconOfFile
108 stdcall OleInitialize(ptr) OleInitialize
......@@ -118,10 +118,10 @@ type win32
115 stub OleMetafilePictFromIconAndLabel
116 stub OleNoteObjectVisible
117 stub OleQueryCreateFromData
118 stub OleQueryLinkFromData
118 stdcall OleQueryLinkFromData(ptr) OleQueryLinkFromData32
119 stub OleRegEnumFormatEtc
120 stub OleRegEnumVerbs
121 stub OleRegGetMiscStatus
121 stdcall OleRegGetMiscStatus(ptr long ptr) OleRegGetMiscStatus32
122 stdcall OleRegGetUserType(long long ptr) OleRegGetUserType32
123 stub OleRun
124 stub OleSave
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment