forked from AuroraMiddleware/gtk
Fix typo. I had deleted a ! operator by mistake, which caused
2000-05-07 Tor Lillqvist <tml@iki.fi> * gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix typo. I had deleted a ! operator by mistake, which caused GDK_SELECTION_CLEAR events never to be generated, which caused only the first copy to the clipboard from an gtkeditable to actually cause a copy to the Windows clipboard. 2000-05-06 Tor Lillqvist <tml@iki.fi> * gdk/win32/gdkdnd-win32.c: Enable shortcut resolution for gcc compilation, too. Current mingw gcc distributions include the necessary headers. Also the necessary IIDs are now in mingw headers/libraries, and own definitions unnecessary. More hacking on OLE2 DND, still doesn't work though, and thus ifdeffed out. * gdk/win32/gdkwindow-win32.c: Remove gdk_window_clear() from here, too.
This commit is contained in:
parent
8a836c07cf
commit
acc8e78c2d
21
ChangeLog
21
ChangeLog
@ -1,3 +1,24 @@
|
||||
2000-05-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix typo. I
|
||||
had deleted a ! operator by mistake, which caused
|
||||
GDK_SELECTION_CLEAR events never to be generated, which caused
|
||||
only the first copy to the clipboard from an gtkeditable to
|
||||
actually cause a copy to the Windows clipboard.
|
||||
|
||||
2000-05-06 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Enable shortcut resolution for gcc
|
||||
compilation, too. Current mingw gcc distributions include the
|
||||
necessary headers. Also the necessary IIDs are now in mingw
|
||||
headers/libraries, and own definitions unnecessary.
|
||||
|
||||
More hacking on OLE2 DND, still doesn't work though, and thus
|
||||
ifdeffed out.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c: Remove gdk_window_clear() from
|
||||
here, too.
|
||||
|
||||
Sat, 6 May 2000 13:31:34 +0200 Paolo Molaro <lupus@linuxcare.com>
|
||||
|
||||
* gdk/nanox/*: nano-X port work in progress.
|
||||
|
@ -1,3 +1,24 @@
|
||||
2000-05-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix typo. I
|
||||
had deleted a ! operator by mistake, which caused
|
||||
GDK_SELECTION_CLEAR events never to be generated, which caused
|
||||
only the first copy to the clipboard from an gtkeditable to
|
||||
actually cause a copy to the Windows clipboard.
|
||||
|
||||
2000-05-06 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Enable shortcut resolution for gcc
|
||||
compilation, too. Current mingw gcc distributions include the
|
||||
necessary headers. Also the necessary IIDs are now in mingw
|
||||
headers/libraries, and own definitions unnecessary.
|
||||
|
||||
More hacking on OLE2 DND, still doesn't work though, and thus
|
||||
ifdeffed out.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c: Remove gdk_window_clear() from
|
||||
here, too.
|
||||
|
||||
Sat, 6 May 2000 13:31:34 +0200 Paolo Molaro <lupus@linuxcare.com>
|
||||
|
||||
* gdk/nanox/*: nano-X port work in progress.
|
||||
|
@ -1,3 +1,24 @@
|
||||
2000-05-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix typo. I
|
||||
had deleted a ! operator by mistake, which caused
|
||||
GDK_SELECTION_CLEAR events never to be generated, which caused
|
||||
only the first copy to the clipboard from an gtkeditable to
|
||||
actually cause a copy to the Windows clipboard.
|
||||
|
||||
2000-05-06 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Enable shortcut resolution for gcc
|
||||
compilation, too. Current mingw gcc distributions include the
|
||||
necessary headers. Also the necessary IIDs are now in mingw
|
||||
headers/libraries, and own definitions unnecessary.
|
||||
|
||||
More hacking on OLE2 DND, still doesn't work though, and thus
|
||||
ifdeffed out.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c: Remove gdk_window_clear() from
|
||||
here, too.
|
||||
|
||||
Sat, 6 May 2000 13:31:34 +0200 Paolo Molaro <lupus@linuxcare.com>
|
||||
|
||||
* gdk/nanox/*: nano-X port work in progress.
|
||||
|
@ -1,3 +1,24 @@
|
||||
2000-05-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix typo. I
|
||||
had deleted a ! operator by mistake, which caused
|
||||
GDK_SELECTION_CLEAR events never to be generated, which caused
|
||||
only the first copy to the clipboard from an gtkeditable to
|
||||
actually cause a copy to the Windows clipboard.
|
||||
|
||||
2000-05-06 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Enable shortcut resolution for gcc
|
||||
compilation, too. Current mingw gcc distributions include the
|
||||
necessary headers. Also the necessary IIDs are now in mingw
|
||||
headers/libraries, and own definitions unnecessary.
|
||||
|
||||
More hacking on OLE2 DND, still doesn't work though, and thus
|
||||
ifdeffed out.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c: Remove gdk_window_clear() from
|
||||
here, too.
|
||||
|
||||
Sat, 6 May 2000 13:31:34 +0200 Paolo Molaro <lupus@linuxcare.com>
|
||||
|
||||
* gdk/nanox/*: nano-X port work in progress.
|
||||
|
@ -1,3 +1,24 @@
|
||||
2000-05-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix typo. I
|
||||
had deleted a ! operator by mistake, which caused
|
||||
GDK_SELECTION_CLEAR events never to be generated, which caused
|
||||
only the first copy to the clipboard from an gtkeditable to
|
||||
actually cause a copy to the Windows clipboard.
|
||||
|
||||
2000-05-06 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Enable shortcut resolution for gcc
|
||||
compilation, too. Current mingw gcc distributions include the
|
||||
necessary headers. Also the necessary IIDs are now in mingw
|
||||
headers/libraries, and own definitions unnecessary.
|
||||
|
||||
More hacking on OLE2 DND, still doesn't work though, and thus
|
||||
ifdeffed out.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c: Remove gdk_window_clear() from
|
||||
here, too.
|
||||
|
||||
Sat, 6 May 2000 13:31:34 +0200 Paolo Molaro <lupus@linuxcare.com>
|
||||
|
||||
* gdk/nanox/*: nano-X port work in progress.
|
||||
|
@ -1,3 +1,24 @@
|
||||
2000-05-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix typo. I
|
||||
had deleted a ! operator by mistake, which caused
|
||||
GDK_SELECTION_CLEAR events never to be generated, which caused
|
||||
only the first copy to the clipboard from an gtkeditable to
|
||||
actually cause a copy to the Windows clipboard.
|
||||
|
||||
2000-05-06 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Enable shortcut resolution for gcc
|
||||
compilation, too. Current mingw gcc distributions include the
|
||||
necessary headers. Also the necessary IIDs are now in mingw
|
||||
headers/libraries, and own definitions unnecessary.
|
||||
|
||||
More hacking on OLE2 DND, still doesn't work though, and thus
|
||||
ifdeffed out.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c: Remove gdk_window_clear() from
|
||||
here, too.
|
||||
|
||||
Sat, 6 May 2000 13:31:34 +0200 Paolo Molaro <lupus@linuxcare.com>
|
||||
|
||||
* gdk/nanox/*: nano-X port work in progress.
|
||||
|
@ -1,3 +1,24 @@
|
||||
2000-05-07 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkevents-win32.c (gdk_event_translate): Fix typo. I
|
||||
had deleted a ! operator by mistake, which caused
|
||||
GDK_SELECTION_CLEAR events never to be generated, which caused
|
||||
only the first copy to the clipboard from an gtkeditable to
|
||||
actually cause a copy to the Windows clipboard.
|
||||
|
||||
2000-05-06 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/win32/gdkdnd-win32.c: Enable shortcut resolution for gcc
|
||||
compilation, too. Current mingw gcc distributions include the
|
||||
necessary headers. Also the necessary IIDs are now in mingw
|
||||
headers/libraries, and own definitions unnecessary.
|
||||
|
||||
More hacking on OLE2 DND, still doesn't work though, and thus
|
||||
ifdeffed out.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c: Remove gdk_window_clear() from
|
||||
here, too.
|
||||
|
||||
Sat, 6 May 2000 13:31:34 +0200 Paolo Molaro <lupus@linuxcare.com>
|
||||
|
||||
* gdk/nanox/*: nano-X port work in progress.
|
||||
|
@ -44,19 +44,8 @@
|
||||
#include <objbase.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <shlobj.h>
|
||||
#include <shlguid.h>
|
||||
#endif
|
||||
|
||||
#ifndef _MSC_VER
|
||||
static IID IID_IUnknown = {
|
||||
0x00000000, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } };
|
||||
static IID IID_IDropSource = {
|
||||
0x00000121, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } };
|
||||
static IID IID_IDropTarget = {
|
||||
0x00000122, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } };
|
||||
#endif
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
@ -91,6 +80,9 @@ typedef enum {
|
||||
((guchar *) guid)[15]);
|
||||
|
||||
|
||||
static FORMATETC *formats;
|
||||
static int nformats;
|
||||
|
||||
#endif /* OLE2_DND */
|
||||
|
||||
/* Structure that holds information about a drag in progress.
|
||||
@ -142,9 +134,12 @@ gdk_drag_context_unref (GdkDragContext *context)
|
||||
|
||||
g_return_if_fail (context != NULL);
|
||||
|
||||
if (private->ref_count <= 0)
|
||||
abort ();
|
||||
|
||||
private->ref_count--;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_drag_context_unref: %d%s\n",
|
||||
GDK_NOTE (DND, g_print ("gdk_drag_context_unref: %d%s\n",
|
||||
private->ref_count,
|
||||
(private->ref_count == 0 ? " freeing" : "")));
|
||||
|
||||
@ -210,24 +205,38 @@ typedef struct {
|
||||
|
||||
#ifdef OLE2_DND
|
||||
|
||||
typedef struct {
|
||||
IDataObject ido;
|
||||
int ref_count;
|
||||
} data_object;
|
||||
|
||||
typedef struct {
|
||||
IEnumFORMATETC ief;
|
||||
int ref_count;
|
||||
int ix;
|
||||
} enum_formats;
|
||||
|
||||
static enum_formats *enum_formats_new (void);
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_target (IDropTarget __RPC_FAR *This)
|
||||
idroptarget_addref (LPDROPTARGET This)
|
||||
{
|
||||
target_drag_context *ctx = (target_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("m_add_ref_target\n"));
|
||||
gdk_drag_context_ref (ctx->context);
|
||||
GDK_NOTE (DND, g_print ("idroptarget_addref %#x %d\n",
|
||||
This, private->ref_count));
|
||||
|
||||
return private->ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_target (IDropTarget __RPC_FAR *This,
|
||||
idroptarget_queryinterface (LPDROPTARGET This,
|
||||
REFIID riid,
|
||||
void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
LPVOID *ppvObject)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("m_query_interface_target\n"));
|
||||
GDK_NOTE (DND, g_print ("idroptarget_queryinterface %#x\n", This));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
@ -236,14 +245,14 @@ m_query_interface_target (IDropTarget __RPC_FAR *This,
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
m_add_ref_target (This);
|
||||
idroptarget_addref (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDropTarget))
|
||||
{
|
||||
g_print ("...IDropTarget\n");
|
||||
m_add_ref_target (This);
|
||||
idroptarget_addref (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
@ -255,80 +264,84 @@ m_query_interface_target (IDropTarget __RPC_FAR *This,
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_release_target (IDropTarget __RPC_FAR *This)
|
||||
idroptarget_release (LPDROPTARGET This)
|
||||
{
|
||||
target_drag_context *ctx = (target_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
int ref_count = private->ref_count - 1;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("m_release_target\n"));
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
GDK_NOTE (DND, g_print ("idroptarget_release %#x %d\n",
|
||||
This, ref_count));
|
||||
|
||||
if (private->ref_count == 1)
|
||||
{
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return private->ref_count - 1;
|
||||
if (ref_count == 0)
|
||||
g_free (This);
|
||||
|
||||
return ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drag_enter (IDropTarget __RPC_FAR *This,
|
||||
IDataObject __RPC_FAR *pDataObj,
|
||||
idroptarget_dragenter (LPDROPTARGET This,
|
||||
LPDATAOBJECT pDataObj,
|
||||
DWORD grfKeyState,
|
||||
POINTL pt,
|
||||
DWORD __RPC_FAR *pdwEffect)
|
||||
LPDWORD pdwEffect)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("m_drag_enter\n"));
|
||||
GDK_NOTE (DND, g_print ("idroptarget_dragenter %#x\n", This));
|
||||
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drag_over (IDropTarget __RPC_FAR *This,
|
||||
idroptarget_dragover (LPDROPTARGET This,
|
||||
DWORD grfKeyState,
|
||||
POINTL pt,
|
||||
DWORD __RPC_FAR *pdwEffect)
|
||||
LPDWORD pdwEffect)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("m_drag_over\n"));
|
||||
GDK_NOTE (DND, g_print ("idroptarget_dragover %#x\n", This));
|
||||
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drag_leave (IDropTarget __RPC_FAR *This)
|
||||
idroptarget_dragleave (LPDROPTARGET This)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("m_drag_leave\n"));
|
||||
GDK_NOTE (DND, g_print ("idroptarget_dragleave %#x\n", This));
|
||||
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drop (IDropTarget __RPC_FAR *This,
|
||||
IDataObject __RPC_FAR *pDataObj,
|
||||
idroptarget_drop (LPDROPTARGET This,
|
||||
LPDATAOBJECT pDataObj,
|
||||
DWORD grfKeyState,
|
||||
POINTL pt,
|
||||
DWORD __RPC_FAR *pdwEffect)
|
||||
LPDWORD pdwEffect)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("m_drop\n"));
|
||||
GDK_NOTE (DND, g_print ("idroptarget_drop %#x\n", This));
|
||||
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_source (IDropSource __RPC_FAR *This)
|
||||
idropsource_addref (LPDROPSOURCE This)
|
||||
{
|
||||
source_drag_context *ctx = (source_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("m_add_ref_source\n"));
|
||||
gdk_drag_context_ref (ctx->context);
|
||||
GDK_NOTE (DND, g_print ("idropsource_addref %#x %d\n",
|
||||
This, private->ref_count));
|
||||
|
||||
return private->ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_source (IDropSource __RPC_FAR *This,
|
||||
idropsource_queryinterface (LPDROPSOURCE This,
|
||||
REFIID riid,
|
||||
void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
LPVOID *ppvObject)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("m_query_interface_source\n"));
|
||||
GDK_NOTE (DND, g_print ("idropsource_queryinterface %#x\n", This));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
@ -336,14 +349,14 @@ m_query_interface_source (IDropSource __RPC_FAR *This,
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
m_add_ref_source (This);
|
||||
idropsource_addref (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDropSource))
|
||||
{
|
||||
g_print ("...IDropSource\n");
|
||||
m_add_ref_source (This);
|
||||
idropsource_addref (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
@ -355,163 +368,369 @@ m_query_interface_source (IDropSource __RPC_FAR *This,
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_release_source (IDropSource __RPC_FAR *This)
|
||||
idropsource_release (LPDROPSOURCE This)
|
||||
{
|
||||
source_drag_context *ctx = (source_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
int ref_count = private->ref_count - 1;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("m_release_source\n"));
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
GDK_NOTE (DND, g_print ("idropsource_release %#x %d\n",
|
||||
This, ref_count));
|
||||
|
||||
if (private->ref_count == 1)
|
||||
{
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return private->ref_count - 1;
|
||||
if (ref_count == 0)
|
||||
g_free (This);
|
||||
|
||||
return ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_continue_drag (IDropSource __RPC_FAR *This,
|
||||
idropsource_querycontinuedrag (LPDROPSOURCE This,
|
||||
BOOL fEscapePressed,
|
||||
DWORD grfKeyState)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("m_query_continue_drag\n"));
|
||||
GDK_NOTE (DND, g_print ("idropsource_querycontinuedrag %#x\n", This));
|
||||
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_give_feedback (IDropSource __RPC_FAR *This,
|
||||
idropsource_givefeedback (LPDROPSOURCE This,
|
||||
DWORD dwEffect)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("m_give_feedback\n"));
|
||||
GDK_NOTE (DND, g_print ("idropsource_givefeedback %#x\n", This));
|
||||
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
idataobject_addref (LPDATAOBJECT This)
|
||||
{
|
||||
data_object *dobj = (data_object *) This;
|
||||
int ref_count = ++dobj->ref_count;
|
||||
|
||||
GDK_NOTE (DND, g_print ("idataobject_addref %#x %d\n", This, ref_count));
|
||||
|
||||
return ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_object (IDataObject __RPC_FAR *This,
|
||||
idataobject_queryinterface (LPDATAOBJECT This,
|
||||
REFIID riid,
|
||||
void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
LPVOID *ppvObject)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
GDK_NOTE (DND, g_print ("idataobject_queryinterface %#x\n", This));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
PRINT_GUID (riid);
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
idataobject_addref (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDataObject))
|
||||
{
|
||||
g_print ("...IDataObject\n");
|
||||
idataobject_addref (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("...Huh?\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_object (IDataObject __RPC_FAR *This)
|
||||
idataobject_release (LPDATAOBJECT This)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
data_object *dobj = (data_object *) This;
|
||||
int ref_count = --dobj->ref_count;
|
||||
|
||||
GDK_NOTE (DND, g_print ("idataobject_release %#x %d\n", This, ref_count));
|
||||
|
||||
if (ref_count == 0)
|
||||
g_free (This);
|
||||
|
||||
return ref_count;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_release_object (IDataObject __RPC_FAR *This)
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
idataobject_getdata (LPDATAOBJECT This,
|
||||
LPFORMATETC pFormatEtc,
|
||||
LPSTGMEDIUM pMedium)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("idataobject_getdata %#x\n", This));
|
||||
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_get_data (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtc,
|
||||
STGMEDIUM *pMedium)
|
||||
idataobject_getdatahere (LPDATAOBJECT This,
|
||||
LPFORMATETC pFormatEtc,
|
||||
LPSTGMEDIUM pMedium)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("idataobject_getdatahere %#x\n", This));
|
||||
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_get_data_here (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtc,
|
||||
STGMEDIUM *pMedium)
|
||||
idataobject_querygetdata (LPDATAOBJECT This,
|
||||
LPFORMATETC pFormatEtc)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
int i;
|
||||
|
||||
GDK_NOTE (DND, g_print ("idataobject_querygetdata %#x %#x", This, pFormatEtc->cfFormat));
|
||||
|
||||
for (i = 0; i < nformats; i++)
|
||||
if (pFormatEtc->cfFormat == formats[i].cfFormat)
|
||||
{
|
||||
GDK_NOTE (DND, g_print (" S_OK\n"));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
GDK_NOTE (DND, g_print (" DV_E_FORMATETC\n"));
|
||||
return DV_E_FORMATETC;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_get_data (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtc)
|
||||
idataobject_getcanonicalformatetc (LPDATAOBJECT This,
|
||||
LPFORMATETC pFormatEtcIn,
|
||||
LPFORMATETC pFormatEtcOut)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
GDK_NOTE (DND, g_print ("idataobject_getcanonicalformatetc %#x\n", This));
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_get_canonical_format_etc (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtcIn,
|
||||
FORMATETC *pFormatEtcOut)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_set_data (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtc,
|
||||
STGMEDIUM *pMedium,
|
||||
idataobject_setdata (LPDATAOBJECT This,
|
||||
LPFORMATETC pFormatEtc,
|
||||
LPSTGMEDIUM pMedium,
|
||||
BOOL fRelease)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("idataobject_setdata %#x\n", This));
|
||||
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_enum_format_etc (IDataObject __RPC_FAR *This,
|
||||
idataobject_enumformatetc (LPDATAOBJECT This,
|
||||
DWORD dwDirection,
|
||||
IEnumFORMATETC **ppEnumFormatEtc)
|
||||
LPENUMFORMATETC *ppEnumFormatEtc)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
GDK_NOTE (DND, g_print ("idataobject_enumformatetc %#x\n", This));
|
||||
|
||||
if (dwDirection != DATADIR_GET)
|
||||
return E_NOTIMPL;
|
||||
|
||||
*ppEnumFormatEtc = &enum_formats_new ()->ief;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_d_advise (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatetc,
|
||||
idataobject_dadvise (LPDATAOBJECT This,
|
||||
LPFORMATETC pFormatetc,
|
||||
DWORD advf,
|
||||
IAdviseSink *pAdvSink,
|
||||
LPADVISESINK pAdvSink,
|
||||
DWORD *pdwConnection)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
GDK_NOTE (DND, g_print ("idataobject_dadvise %#x\n", This));
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_d_unadvise (IDataObject __RPC_FAR *This,
|
||||
idataobject_dunadvise (LPDATAOBJECT This,
|
||||
DWORD dwConnection)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
GDK_NOTE (DND, g_print ("idataobject_dunadvise %#x\n", This));
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_enum_d_advise (IDataObject __RPC_FAR *This,
|
||||
IEnumSTATDATA **ppenumAdvise)
|
||||
idataobject_enumdadvise (LPDATAOBJECT This,
|
||||
LPENUMSTATDATA *ppenumAdvise)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
GDK_NOTE (DND, g_print ("idataobject_enumdadvise %#x\n", This));
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
ienumformatetc_addref (LPENUMFORMATETC This)
|
||||
{
|
||||
enum_formats *en = (enum_formats *) This;
|
||||
int ref_count = ++en->ref_count;
|
||||
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_addref %#x %d\n", This, ref_count));
|
||||
|
||||
return ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
ienumformatetc_queryinterface (LPENUMFORMATETC This,
|
||||
REFIID riid,
|
||||
LPVOID *ppvObject)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_queryinterface %#x\n", This));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
PRINT_GUID (riid);
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
ienumformatetc_addref (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IEnumFORMATETC))
|
||||
{
|
||||
g_print ("...IEnumFORMATETC\n");
|
||||
ienumformatetc_addref (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("...Huh?\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
ienumformatetc_release (LPENUMFORMATETC This)
|
||||
{
|
||||
enum_formats *en = (enum_formats *) This;
|
||||
int ref_count = --en->ref_count;
|
||||
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_release %#x %d\n", This, ref_count));
|
||||
|
||||
if (ref_count == 0)
|
||||
g_free (This);
|
||||
|
||||
return ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
ienumformatetc_next (LPENUMFORMATETC This,
|
||||
ULONG celt,
|
||||
LPFORMATETC elts,
|
||||
ULONG *nelt)
|
||||
{
|
||||
enum_formats *en = (enum_formats *) This;
|
||||
int i, n;
|
||||
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_next %#x %d %d\n", This, en->ix, celt));
|
||||
|
||||
n = 0;
|
||||
for (i = 0; i < celt; i++)
|
||||
{
|
||||
if (en->ix >= nformats)
|
||||
break;
|
||||
elts[i] = formats[en->ix++];
|
||||
n++;
|
||||
}
|
||||
|
||||
if (nelt != NULL)
|
||||
*nelt = n;
|
||||
|
||||
if (n == celt)
|
||||
return S_OK;
|
||||
else
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
ienumformatetc_skip (LPENUMFORMATETC This,
|
||||
ULONG celt)
|
||||
{
|
||||
enum_formats *en = (enum_formats *) This;
|
||||
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_skip %#x %d %d\n", This, en->ix, celt));
|
||||
en->ix += celt;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
ienumformatetc_reset (LPENUMFORMATETC This)
|
||||
{
|
||||
enum_formats *en = (enum_formats *) This;
|
||||
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_reset %#x\n", This));
|
||||
|
||||
en->ix = 0;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
ienumformatetc_clone (LPENUMFORMATETC This,
|
||||
LPENUMFORMATETC *ppEnumFormatEtc)
|
||||
{
|
||||
enum_formats *en = (enum_formats *) This;
|
||||
enum_formats *new;
|
||||
|
||||
GDK_NOTE (DND, g_print ("ienumformatetc_clone %#x\n", This));
|
||||
|
||||
new = enum_formats_new ();
|
||||
|
||||
new->ix = en->ix;
|
||||
|
||||
*ppEnumFormatEtc = &new->ief;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static IDropTargetVtbl idt_vtbl = {
|
||||
m_query_interface_target,
|
||||
m_add_ref_target,
|
||||
m_release_target,
|
||||
m_drag_enter,
|
||||
m_drag_over,
|
||||
m_drag_leave,
|
||||
m_drop
|
||||
idroptarget_queryinterface,
|
||||
idroptarget_addref,
|
||||
idroptarget_release,
|
||||
idroptarget_dragenter,
|
||||
idroptarget_dragover,
|
||||
idroptarget_dragleave,
|
||||
idroptarget_drop
|
||||
};
|
||||
|
||||
static IDropSourceVtbl ids_vtbl = {
|
||||
m_query_interface_source,
|
||||
m_add_ref_source,
|
||||
m_release_source,
|
||||
m_query_continue_drag,
|
||||
m_give_feedback
|
||||
idropsource_queryinterface,
|
||||
idropsource_addref,
|
||||
idropsource_release,
|
||||
idropsource_querycontinuedrag,
|
||||
idropsource_givefeedback
|
||||
};
|
||||
|
||||
static IDataObjectVtbl ido_vtbl = {
|
||||
m_query_interface_object,
|
||||
m_add_ref_object,
|
||||
m_release_object,
|
||||
m_get_data,
|
||||
m_get_data_here,
|
||||
m_query_get_data,
|
||||
m_get_canonical_format_etc,
|
||||
m_set_data,
|
||||
m_enum_format_etc,
|
||||
m_d_advise,
|
||||
m_d_unadvise,
|
||||
m_enum_d_advise
|
||||
idataobject_queryinterface,
|
||||
idataobject_addref,
|
||||
idataobject_release,
|
||||
idataobject_getdata,
|
||||
idataobject_getdatahere,
|
||||
idataobject_querygetdata,
|
||||
idataobject_getcanonicalformatetc,
|
||||
idataobject_setdata,
|
||||
idataobject_enumformatetc,
|
||||
idataobject_dadvise,
|
||||
idataobject_dunadvise,
|
||||
idataobject_enumdadvise
|
||||
};
|
||||
|
||||
static IEnumFORMATETCVtbl ief_vtbl = {
|
||||
ienumformatetc_queryinterface,
|
||||
ienumformatetc_addref,
|
||||
ienumformatetc_release,
|
||||
ienumformatetc_next,
|
||||
ienumformatetc_skip,
|
||||
ienumformatetc_reset,
|
||||
ienumformatetc_clone
|
||||
};
|
||||
|
||||
#endif /* OLE2_DND */
|
||||
@ -528,6 +747,9 @@ target_context_new (void)
|
||||
#endif
|
||||
|
||||
result->context = gdk_drag_context_new ();
|
||||
result->context->is_source = FALSE;
|
||||
|
||||
GDK_NOTE (DND, g_print ("target_context_new: %#x\n", result));
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -544,11 +766,47 @@ source_context_new (void)
|
||||
#endif
|
||||
|
||||
result->context = gdk_drag_context_new ();
|
||||
result->context->is_source = TRUE;
|
||||
|
||||
GDK_NOTE (DND, g_print ("source_context_new: %#x\n", result));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef OLE2_DND
|
||||
static data_object *
|
||||
data_object_new (void)
|
||||
{
|
||||
data_object *result;
|
||||
|
||||
result = g_new0 (data_object, 1);
|
||||
|
||||
result->ido.lpVtbl = &ido_vtbl;
|
||||
result->ref_count = 1;
|
||||
|
||||
GDK_NOTE (DND, g_print ("data_object_new: %#x\n", result));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static enum_formats *
|
||||
enum_formats_new (void)
|
||||
{
|
||||
enum_formats *result;
|
||||
|
||||
result = g_new0 (enum_formats, 1);
|
||||
|
||||
result->ief.lpVtbl = &ief_vtbl;
|
||||
result->ref_count = 1;
|
||||
result->ix = 0;
|
||||
|
||||
GDK_NOTE (DND, g_print ("enum_formats_new: %#x\n", result));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* From MS Knowledge Base article Q130698 */
|
||||
|
||||
@ -639,12 +897,6 @@ resolve_link(HWND hWnd,
|
||||
return SUCCEEDED (hres);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define resolve_link(hWnd, lpszLinkName, lpszPath, lpszDescription) FALSE
|
||||
|
||||
#endif
|
||||
|
||||
static GdkFilterReturn
|
||||
gdk_dropfiles_filter (GdkXEvent *xev,
|
||||
GdkEvent *event,
|
||||
@ -665,7 +917,7 @@ gdk_dropfiles_filter (GdkXEvent *xev,
|
||||
|
||||
if (msg->message == WM_DROPFILES)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("WM_DROPFILES: %#x\n", msg->hwnd));
|
||||
GDK_NOTE (DND, g_print ("WM_DROPFILES: %#x\n", msg->hwnd));
|
||||
|
||||
context = gdk_drag_context_new ();
|
||||
private = (GdkDragContextPrivate *) context;
|
||||
@ -703,13 +955,13 @@ gdk_dropfiles_filter (GdkXEvent *xev,
|
||||
if (resolve_link (msg->hwnd, fileName, linkedFile, NULL))
|
||||
{
|
||||
g_string_append (result, linkedFile);
|
||||
GDK_NOTE (MISC, g_print ("...%s link to %s\n",
|
||||
GDK_NOTE (DND, g_print ("...%s link to %s\n",
|
||||
fileName, linkedFile));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_append (result, fileName);
|
||||
GDK_NOTE (MISC, g_print ("...%s\n", fileName));
|
||||
GDK_NOTE (DND, g_print ("...%s\n", fileName));
|
||||
}
|
||||
g_string_append (result, "\015\012");
|
||||
}
|
||||
@ -731,12 +983,27 @@ gdk_dropfiles_filter (GdkXEvent *xev,
|
||||
void
|
||||
gdk_dnd_init (void)
|
||||
{
|
||||
HRESULT hres;
|
||||
#ifdef OLE2_DND
|
||||
HRESULT hres;
|
||||
hres = OleInitialize (NULL);
|
||||
|
||||
if (! SUCCEEDED (hres))
|
||||
g_error ("OleInitialize failed");
|
||||
|
||||
nformats = 2;
|
||||
formats = g_new (FORMATETC, nformats);
|
||||
|
||||
formats[0].cfFormat = CF_TEXT;
|
||||
formats[0].ptd = NULL;
|
||||
formats[0].dwAspect = DVASPECT_CONTENT;
|
||||
formats[0].lindex = -1;
|
||||
formats[0].tymed = TYMED_HGLOBAL;
|
||||
|
||||
formats[1].cfFormat = CF_GDIOBJFIRST;
|
||||
formats[1].ptd = NULL;
|
||||
formats[1].dwAspect = DVASPECT_CONTENT;
|
||||
formats[1].lindex = -1;
|
||||
formats[1].tymed = TYMED_HGLOBAL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -751,11 +1018,12 @@ gdk_win32_dnd_exit (void)
|
||||
/* Source side */
|
||||
|
||||
static void
|
||||
gdk_drag_do_leave (GdkDragContext *context, guint32 time)
|
||||
gdk_drag_do_leave (GdkDragContext *context,
|
||||
guint32 time)
|
||||
{
|
||||
if (context->dest_window)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("gdk_drag_do_leave\n"));
|
||||
GDK_NOTE (DND, g_print ("gdk_drag_do_leave\n"));
|
||||
gdk_drawable_unref (context->dest_window);
|
||||
context->dest_window = NULL;
|
||||
}
|
||||
@ -767,16 +1035,25 @@ gdk_drag_begin (GdkWindow *window,
|
||||
{
|
||||
GList *tmp_list;
|
||||
source_drag_context *ctx;
|
||||
#ifdef OLE2_DND
|
||||
data_object *dobj;
|
||||
HRESULT hResult;
|
||||
DWORD dwEffect;
|
||||
HGLOBAL global;
|
||||
FORMATETC format;
|
||||
STGMEDIUM medium;
|
||||
#endif
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_drag_begin\n"));
|
||||
GDK_NOTE (DND, g_print ("gdk_drag_begin\n"));
|
||||
|
||||
ctx = source_context_new ();
|
||||
ctx->context->is_source = TRUE;
|
||||
ctx->context->protocol = GDK_DRAG_PROTO_OLE2;
|
||||
ctx->context->source_window = window;
|
||||
gdk_drawable_ref (window);
|
||||
|
||||
#ifdef OLE2_DND
|
||||
tmp_list = g_list_last (targets);
|
||||
ctx->context->targets = NULL;
|
||||
while (tmp_list)
|
||||
@ -788,8 +1065,28 @@ gdk_drag_begin (GdkWindow *window,
|
||||
|
||||
ctx->context->actions = 0;
|
||||
|
||||
#if 0
|
||||
DoDragDrop (...);
|
||||
dobj = data_object_new ();
|
||||
|
||||
global = GlobalAlloc (GMEM_FIXED, sizeof (ctx));
|
||||
|
||||
memcpy (&global, ctx, sizeof (ctx));
|
||||
|
||||
medium.tymed = TYMED_HGLOBAL;
|
||||
medium.hGlobal = global;
|
||||
medium.pUnkForRelease = NULL;
|
||||
|
||||
dobj->ido.lpVtbl->SetData (&dobj->ido, &formats[1], &medium, TRUE);
|
||||
|
||||
hResult = DoDragDrop (&dobj->ido, &ctx->ids, DROPEFFECT_MOVE|DROPEFFECT_COPY, &dwEffect);
|
||||
|
||||
GDK_NOTE (DND, g_print ("DoDragDrop returned %s\n",
|
||||
(hResult == DRAGDROP_S_DROP ? "DRAGDROP_S_DROP" :
|
||||
(hResult == DRAGDROP_S_CANCEL ? "DRAGDROP_S_CANCEL" :
|
||||
(hResult == E_UNEXPECTED ? "E_UNEXPECTED" :
|
||||
g_strdup_printf ("%#.8x", hResult))))));
|
||||
|
||||
dobj->ido.lpVtbl->Release (&dobj->ido);
|
||||
ctx->ids.lpVtbl->Release (&ctx->ids);
|
||||
#endif
|
||||
return ctx->context;
|
||||
}
|
||||
@ -815,7 +1112,7 @@ gdk_drag_find_window (GdkDragContext *context,
|
||||
HWND recipient;
|
||||
POINT pt;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_drag_find_window: %#x +%d+%d\n",
|
||||
GDK_NOTE (DND, g_print ("gdk_drag_find_window: %#x +%d+%d\n",
|
||||
(drag_window ? GDK_DRAWABLE_XID (drag_window) : 0),
|
||||
x_root, y_root));
|
||||
|
||||
@ -843,6 +1140,8 @@ gdk_drag_motion (GdkDragContext *context,
|
||||
GdkDragAction possible_actions,
|
||||
guint32 time)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("gdk_drag_motion\n"));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -852,7 +1151,7 @@ gdk_drag_drop (GdkDragContext *context,
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
|
||||
g_warning ("gdk_drag_drop: not implemented\n");
|
||||
GDK_NOTE (DND, g_print ("gdk_drag_drop\n"));
|
||||
}
|
||||
|
||||
void
|
||||
@ -861,6 +1160,8 @@ gdk_drag_abort (GdkDragContext *context,
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
|
||||
GDK_NOTE (DND, g_print ("gdk_drag_abort\n"));
|
||||
|
||||
gdk_drag_do_leave (context, time);
|
||||
}
|
||||
|
||||
@ -871,7 +1172,7 @@ gdk_drag_status (GdkDragContext *context,
|
||||
GdkDragAction action,
|
||||
guint32 time)
|
||||
{
|
||||
GDK_NOTE (MISC, g_print ("gdk_drag_status\n"));
|
||||
GDK_NOTE (DND, g_print ("gdk_drag_status\n"));
|
||||
}
|
||||
|
||||
void
|
||||
@ -879,6 +1180,7 @@ gdk_drop_reply (GdkDragContext *context,
|
||||
gboolean ok,
|
||||
guint32 time)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("gdk_drop_reply\n"));
|
||||
}
|
||||
|
||||
void
|
||||
@ -886,6 +1188,7 @@ gdk_drop_finish (GdkDragContext *context,
|
||||
gboolean success,
|
||||
guint32 time)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("gdk_drop_finish\n"));
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
@ -900,7 +1203,10 @@ gdk_destroy_filter (GdkXEvent *xev,
|
||||
{
|
||||
IDropTarget *idtp = (IDropTarget *) data;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_destroy_filter: WM_DESTROY: %#x\n", msg->hwnd));
|
||||
GDK_NOTE (DND, g_print ("gdk_destroy_filter: WM_DESTROY: %#x\n", msg->hwnd));
|
||||
#if 0
|
||||
idtp->lpVtbl->Release (idtp);
|
||||
#endif
|
||||
RevokeDragDrop (msg->hwnd);
|
||||
CoLockObjectExternal (idtp, FALSE, TRUE);
|
||||
}
|
||||
@ -912,13 +1218,13 @@ void
|
||||
gdk_window_register_dnd (GdkWindow *window)
|
||||
{
|
||||
#ifdef OLE2_DND
|
||||
target_drag_context *context;
|
||||
target_drag_context *ctx;
|
||||
HRESULT hres;
|
||||
#endif
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_window_register_dnd: %#x\n",
|
||||
GDK_NOTE (DND, g_print ("gdk_window_register_dnd: %#x\n",
|
||||
GDK_DRAWABLE_XID (window)));
|
||||
|
||||
/* We always claim to accept dropped files, but in fact we might not,
|
||||
@ -931,23 +1237,27 @@ gdk_window_register_dnd (GdkWindow *window)
|
||||
|
||||
#ifdef OLE2_DND
|
||||
/* Register for OLE2 d&d */
|
||||
context = target_context_new ();
|
||||
hres = CoLockObjectExternal ((IUnknown *) &context->idt, TRUE, FALSE);
|
||||
ctx = target_context_new ();
|
||||
ctx->context->protocol = GDK_DRAG_PROTO_OLE2;
|
||||
hres = CoLockObjectExternal ((IUnknown *) &ctx->idt, TRUE, FALSE);
|
||||
if (!SUCCEEDED (hres))
|
||||
OTHER_API_FAILED ("CoLockObjectExternal");
|
||||
else
|
||||
{
|
||||
hres = RegisterDragDrop (GDK_DRAWABLE_XID (window), &context->idt);
|
||||
hres = RegisterDragDrop (GDK_DRAWABLE_XID (window), &ctx->idt);
|
||||
if (hres == DRAGDROP_E_ALREADYREGISTERED)
|
||||
{
|
||||
g_print ("DRAGDROP_E_ALREADYREGISTERED\n");
|
||||
CoLockObjectExternal ((IUnknown *) &context->idt, FALSE, FALSE);
|
||||
#if 0
|
||||
ctx->idt.lpVtbl->Release (&ctx->idt);
|
||||
#endif
|
||||
CoLockObjectExternal ((IUnknown *) &ctx->idt, FALSE, FALSE);
|
||||
}
|
||||
else if (!SUCCEEDED (hres))
|
||||
OTHER_API_FAILED ("RegisterDragDrop");
|
||||
else
|
||||
{
|
||||
gdk_window_add_filter (window, gdk_destroy_filter, &context->idt);
|
||||
gdk_window_add_filter (window, gdk_destroy_filter, &ctx->idt);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -3066,7 +3066,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
event->selection.selection = xevent->wParam;
|
||||
event->selection.time = xevent->time;
|
||||
|
||||
return_val = GDK_DRAWABLE_DESTROYED (window);
|
||||
return_val = !GDK_DRAWABLE_DESTROYED (window);
|
||||
|
||||
/* Once again, we will pass through switch below without match */
|
||||
}
|
||||
|
@ -1003,17 +1003,6 @@ gdk_window_reparent (GdkWindow *window,
|
||||
parent_private->children = g_list_prepend (parent_private->children, window);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_clear (GdkWindow *window)
|
||||
{
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
if (!GDK_DRAWABLE_DESTROYED (window))
|
||||
gdk_window_clear_area (window, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_gdk_windowing_window_clear_area (GdkWindow *window,
|
||||
gint x,
|
||||
|
Loading…
Reference in New Issue
Block a user