forked from AuroraMiddleware/gtk
Don't define HAVE_DIMM_H if MSC, as you have to get the Platform SDK to
1999-11-04 Tor Lillqvist <tml@iki.fi> * config.h.win32: Don't define HAVE_DIMM_H if MSC, as you have to get the Platform SDK to get <dimm.h>. * gdk/win32/gdkevents.c: More event handling fixes and simplification. Never generate motion events with is_hint true. We used to do that on bogus grounds earlier. Windows sends WM_MOUSEMOVE messages on button events even if the mouse hasn't moved, ignore these. * gdk/win32/gdkfont.c: Load all fonts as (pretended) fontsets. * gdk/win32/gdkglobals.c * gdk/win32/gdkprivate.h: Define a typedef for the pointer to the TrackMouseEvent function, and use it. * gdk/win32/gdkwindow.c: Terminate widechar string with a zero char before calling WideCharToMultiByte in order to get a string for the window title. * gdk/win32/gdkdnd.c: Some more random hacking, ifdeffed out. * gdk/win32/gdk.def: Remove obsolete functions. * gdk/win32/makefile.{cygwin,msc}: Remove gdkcompat.{o,obj}. Add /nodefaultlib and /defaultlib switches. * gtk/gtkrc.c: s/gwin_getlocale/g_win32_getlocale/.
This commit is contained in:
parent
9d8da16ee9
commit
f527b8909f
30
ChangeLog
30
ChangeLog
@ -1,3 +1,33 @@
|
||||
1999-11-04 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* config.h.win32: Don't define HAVE_DIMM_H if MSC, as you have to
|
||||
get the Platform SDK to get <dimm.h>.
|
||||
|
||||
* gdk/win32/gdkevents.c: More event handling fixes and
|
||||
simplification. Never generate motion events with is_hint true. We
|
||||
used to do that on bogus grounds earlier. Windows sends
|
||||
WM_MOUSEMOVE messages on button events even if the mouse hasn't
|
||||
moved, ignore these.
|
||||
|
||||
* gdk/win32/gdkfont.c: Load all fonts as (pretended) fontsets.
|
||||
|
||||
* gdk/win32/gdkglobals.c
|
||||
* gdk/win32/gdkprivate.h: Define a typedef for the pointer to
|
||||
the TrackMouseEvent function, and use it.
|
||||
|
||||
* gdk/win32/gdkwindow.c: Terminate widechar string with a zero
|
||||
char before calling WideCharToMultiByte in order to get a string
|
||||
for the window title.
|
||||
|
||||
* gdk/win32/gdkdnd.c: Some more random hacking, ifdeffed out.
|
||||
|
||||
* gdk/win32/gdk.def: Remove obsolete functions.
|
||||
|
||||
* gdk/win32/makefile.{cygwin,msc}: Remove gdkcompat.{o,obj}. Add
|
||||
/nodefaultlib and /defaultlib switches.
|
||||
|
||||
* gtk/gtkrc.c: s/gwin_getlocale/g_win32_getlocale/.
|
||||
|
||||
1999-10-31 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/gdkkeysyms.h: Add new keysyms from X11R6.4 (including
|
||||
|
@ -1,3 +1,33 @@
|
||||
1999-11-04 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* config.h.win32: Don't define HAVE_DIMM_H if MSC, as you have to
|
||||
get the Platform SDK to get <dimm.h>.
|
||||
|
||||
* gdk/win32/gdkevents.c: More event handling fixes and
|
||||
simplification. Never generate motion events with is_hint true. We
|
||||
used to do that on bogus grounds earlier. Windows sends
|
||||
WM_MOUSEMOVE messages on button events even if the mouse hasn't
|
||||
moved, ignore these.
|
||||
|
||||
* gdk/win32/gdkfont.c: Load all fonts as (pretended) fontsets.
|
||||
|
||||
* gdk/win32/gdkglobals.c
|
||||
* gdk/win32/gdkprivate.h: Define a typedef for the pointer to
|
||||
the TrackMouseEvent function, and use it.
|
||||
|
||||
* gdk/win32/gdkwindow.c: Terminate widechar string with a zero
|
||||
char before calling WideCharToMultiByte in order to get a string
|
||||
for the window title.
|
||||
|
||||
* gdk/win32/gdkdnd.c: Some more random hacking, ifdeffed out.
|
||||
|
||||
* gdk/win32/gdk.def: Remove obsolete functions.
|
||||
|
||||
* gdk/win32/makefile.{cygwin,msc}: Remove gdkcompat.{o,obj}. Add
|
||||
/nodefaultlib and /defaultlib switches.
|
||||
|
||||
* gtk/gtkrc.c: s/gwin_getlocale/g_win32_getlocale/.
|
||||
|
||||
1999-10-31 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/gdkkeysyms.h: Add new keysyms from X11R6.4 (including
|
||||
|
@ -1,3 +1,33 @@
|
||||
1999-11-04 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* config.h.win32: Don't define HAVE_DIMM_H if MSC, as you have to
|
||||
get the Platform SDK to get <dimm.h>.
|
||||
|
||||
* gdk/win32/gdkevents.c: More event handling fixes and
|
||||
simplification. Never generate motion events with is_hint true. We
|
||||
used to do that on bogus grounds earlier. Windows sends
|
||||
WM_MOUSEMOVE messages on button events even if the mouse hasn't
|
||||
moved, ignore these.
|
||||
|
||||
* gdk/win32/gdkfont.c: Load all fonts as (pretended) fontsets.
|
||||
|
||||
* gdk/win32/gdkglobals.c
|
||||
* gdk/win32/gdkprivate.h: Define a typedef for the pointer to
|
||||
the TrackMouseEvent function, and use it.
|
||||
|
||||
* gdk/win32/gdkwindow.c: Terminate widechar string with a zero
|
||||
char before calling WideCharToMultiByte in order to get a string
|
||||
for the window title.
|
||||
|
||||
* gdk/win32/gdkdnd.c: Some more random hacking, ifdeffed out.
|
||||
|
||||
* gdk/win32/gdk.def: Remove obsolete functions.
|
||||
|
||||
* gdk/win32/makefile.{cygwin,msc}: Remove gdkcompat.{o,obj}. Add
|
||||
/nodefaultlib and /defaultlib switches.
|
||||
|
||||
* gtk/gtkrc.c: s/gwin_getlocale/g_win32_getlocale/.
|
||||
|
||||
1999-10-31 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/gdkkeysyms.h: Add new keysyms from X11R6.4 (including
|
||||
|
@ -1,3 +1,33 @@
|
||||
1999-11-04 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* config.h.win32: Don't define HAVE_DIMM_H if MSC, as you have to
|
||||
get the Platform SDK to get <dimm.h>.
|
||||
|
||||
* gdk/win32/gdkevents.c: More event handling fixes and
|
||||
simplification. Never generate motion events with is_hint true. We
|
||||
used to do that on bogus grounds earlier. Windows sends
|
||||
WM_MOUSEMOVE messages on button events even if the mouse hasn't
|
||||
moved, ignore these.
|
||||
|
||||
* gdk/win32/gdkfont.c: Load all fonts as (pretended) fontsets.
|
||||
|
||||
* gdk/win32/gdkglobals.c
|
||||
* gdk/win32/gdkprivate.h: Define a typedef for the pointer to
|
||||
the TrackMouseEvent function, and use it.
|
||||
|
||||
* gdk/win32/gdkwindow.c: Terminate widechar string with a zero
|
||||
char before calling WideCharToMultiByte in order to get a string
|
||||
for the window title.
|
||||
|
||||
* gdk/win32/gdkdnd.c: Some more random hacking, ifdeffed out.
|
||||
|
||||
* gdk/win32/gdk.def: Remove obsolete functions.
|
||||
|
||||
* gdk/win32/makefile.{cygwin,msc}: Remove gdkcompat.{o,obj}. Add
|
||||
/nodefaultlib and /defaultlib switches.
|
||||
|
||||
* gtk/gtkrc.c: s/gwin_getlocale/g_win32_getlocale/.
|
||||
|
||||
1999-10-31 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/gdkkeysyms.h: Add new keysyms from X11R6.4 (including
|
||||
|
@ -1,3 +1,33 @@
|
||||
1999-11-04 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* config.h.win32: Don't define HAVE_DIMM_H if MSC, as you have to
|
||||
get the Platform SDK to get <dimm.h>.
|
||||
|
||||
* gdk/win32/gdkevents.c: More event handling fixes and
|
||||
simplification. Never generate motion events with is_hint true. We
|
||||
used to do that on bogus grounds earlier. Windows sends
|
||||
WM_MOUSEMOVE messages on button events even if the mouse hasn't
|
||||
moved, ignore these.
|
||||
|
||||
* gdk/win32/gdkfont.c: Load all fonts as (pretended) fontsets.
|
||||
|
||||
* gdk/win32/gdkglobals.c
|
||||
* gdk/win32/gdkprivate.h: Define a typedef for the pointer to
|
||||
the TrackMouseEvent function, and use it.
|
||||
|
||||
* gdk/win32/gdkwindow.c: Terminate widechar string with a zero
|
||||
char before calling WideCharToMultiByte in order to get a string
|
||||
for the window title.
|
||||
|
||||
* gdk/win32/gdkdnd.c: Some more random hacking, ifdeffed out.
|
||||
|
||||
* gdk/win32/gdk.def: Remove obsolete functions.
|
||||
|
||||
* gdk/win32/makefile.{cygwin,msc}: Remove gdkcompat.{o,obj}. Add
|
||||
/nodefaultlib and /defaultlib switches.
|
||||
|
||||
* gtk/gtkrc.c: s/gwin_getlocale/g_win32_getlocale/.
|
||||
|
||||
1999-10-31 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/gdkkeysyms.h: Add new keysyms from X11R6.4 (including
|
||||
|
@ -1,3 +1,33 @@
|
||||
1999-11-04 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* config.h.win32: Don't define HAVE_DIMM_H if MSC, as you have to
|
||||
get the Platform SDK to get <dimm.h>.
|
||||
|
||||
* gdk/win32/gdkevents.c: More event handling fixes and
|
||||
simplification. Never generate motion events with is_hint true. We
|
||||
used to do that on bogus grounds earlier. Windows sends
|
||||
WM_MOUSEMOVE messages on button events even if the mouse hasn't
|
||||
moved, ignore these.
|
||||
|
||||
* gdk/win32/gdkfont.c: Load all fonts as (pretended) fontsets.
|
||||
|
||||
* gdk/win32/gdkglobals.c
|
||||
* gdk/win32/gdkprivate.h: Define a typedef for the pointer to
|
||||
the TrackMouseEvent function, and use it.
|
||||
|
||||
* gdk/win32/gdkwindow.c: Terminate widechar string with a zero
|
||||
char before calling WideCharToMultiByte in order to get a string
|
||||
for the window title.
|
||||
|
||||
* gdk/win32/gdkdnd.c: Some more random hacking, ifdeffed out.
|
||||
|
||||
* gdk/win32/gdk.def: Remove obsolete functions.
|
||||
|
||||
* gdk/win32/makefile.{cygwin,msc}: Remove gdkcompat.{o,obj}. Add
|
||||
/nodefaultlib and /defaultlib switches.
|
||||
|
||||
* gtk/gtkrc.c: s/gwin_getlocale/g_win32_getlocale/.
|
||||
|
||||
1999-10-31 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/gdkkeysyms.h: Add new keysyms from X11R6.4 (including
|
||||
|
@ -1,3 +1,33 @@
|
||||
1999-11-04 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* config.h.win32: Don't define HAVE_DIMM_H if MSC, as you have to
|
||||
get the Platform SDK to get <dimm.h>.
|
||||
|
||||
* gdk/win32/gdkevents.c: More event handling fixes and
|
||||
simplification. Never generate motion events with is_hint true. We
|
||||
used to do that on bogus grounds earlier. Windows sends
|
||||
WM_MOUSEMOVE messages on button events even if the mouse hasn't
|
||||
moved, ignore these.
|
||||
|
||||
* gdk/win32/gdkfont.c: Load all fonts as (pretended) fontsets.
|
||||
|
||||
* gdk/win32/gdkglobals.c
|
||||
* gdk/win32/gdkprivate.h: Define a typedef for the pointer to
|
||||
the TrackMouseEvent function, and use it.
|
||||
|
||||
* gdk/win32/gdkwindow.c: Terminate widechar string with a zero
|
||||
char before calling WideCharToMultiByte in order to get a string
|
||||
for the window title.
|
||||
|
||||
* gdk/win32/gdkdnd.c: Some more random hacking, ifdeffed out.
|
||||
|
||||
* gdk/win32/gdk.def: Remove obsolete functions.
|
||||
|
||||
* gdk/win32/makefile.{cygwin,msc}: Remove gdkcompat.{o,obj}. Add
|
||||
/nodefaultlib and /defaultlib switches.
|
||||
|
||||
* gtk/gtkrc.c: s/gwin_getlocale/g_win32_getlocale/.
|
||||
|
||||
1999-10-31 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* gdk/gdkkeysyms.h: Add new keysyms from X11R6.4 (including
|
||||
|
@ -189,6 +189,4 @@
|
||||
/* Define if you have the <dimm.h> header file
|
||||
* (available in the Platform SDK)
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#define HAVE_DIMM_H 1
|
||||
#endif
|
||||
/* #define HAVE_DIMM_H 1 */
|
||||
|
@ -277,12 +277,10 @@ EXPORTS
|
||||
gdk_window_clear
|
||||
gdk_window_clear_area
|
||||
gdk_window_clear_area_e
|
||||
gdk_window_copy_area
|
||||
gdk_window_destroy
|
||||
gdk_window_foreign_new
|
||||
gdk_window_get_deskrelative_origin
|
||||
gdk_window_get_children
|
||||
gdk_window_get_colormap
|
||||
gdk_window_get_events
|
||||
gdk_window_get_geometry
|
||||
gdk_window_get_origin
|
||||
@ -290,12 +288,9 @@ EXPORTS
|
||||
gdk_window_get_pointer
|
||||
gdk_window_get_position
|
||||
gdk_window_get_root_origin
|
||||
gdk_window_get_size
|
||||
gdk_window_get_toplevel
|
||||
gdk_window_get_toplevels
|
||||
gdk_window_get_type
|
||||
gdk_window_get_user_data
|
||||
gdk_window_get_visual
|
||||
gdk_window_hide
|
||||
gdk_window_is_visible
|
||||
gdk_window_is_viewable
|
||||
@ -313,7 +308,6 @@ EXPORTS
|
||||
gdk_window_set_back_pixmap
|
||||
gdk_window_set_background
|
||||
gdk_window_set_child_shapes
|
||||
gdk_window_set_colormap
|
||||
gdk_window_set_cursor
|
||||
gdk_window_set_decorations
|
||||
gdk_window_set_events
|
||||
|
@ -277,12 +277,10 @@ EXPORTS
|
||||
gdk_window_clear
|
||||
gdk_window_clear_area
|
||||
gdk_window_clear_area_e
|
||||
gdk_window_copy_area
|
||||
gdk_window_destroy
|
||||
gdk_window_foreign_new
|
||||
gdk_window_get_deskrelative_origin
|
||||
gdk_window_get_children
|
||||
gdk_window_get_colormap
|
||||
gdk_window_get_events
|
||||
gdk_window_get_geometry
|
||||
gdk_window_get_origin
|
||||
@ -290,12 +288,9 @@ EXPORTS
|
||||
gdk_window_get_pointer
|
||||
gdk_window_get_position
|
||||
gdk_window_get_root_origin
|
||||
gdk_window_get_size
|
||||
gdk_window_get_toplevel
|
||||
gdk_window_get_toplevels
|
||||
gdk_window_get_type
|
||||
gdk_window_get_user_data
|
||||
gdk_window_get_visual
|
||||
gdk_window_hide
|
||||
gdk_window_is_visible
|
||||
gdk_window_is_viewable
|
||||
@ -313,7 +308,6 @@ EXPORTS
|
||||
gdk_window_set_back_pixmap
|
||||
gdk_window_set_background
|
||||
gdk_window_set_child_shapes
|
||||
gdk_window_set_colormap
|
||||
gdk_window_set_cursor
|
||||
gdk_window_set_decorations
|
||||
gdk_window_set_events
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* #define OLE2_DND */
|
||||
|
||||
#define INITGUID
|
||||
|
||||
#include "gdkdnd.h"
|
||||
@ -47,6 +49,15 @@
|
||||
#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>
|
||||
|
||||
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
|
||||
@ -65,74 +76,21 @@ typedef enum {
|
||||
|
||||
#ifdef OLE2_DND
|
||||
|
||||
#define PRINT_RIID(riid) \
|
||||
g_print ("riid = %.08x-%.04x-%.04x-%.02x%.02x-%.02x%.02x%.02x%.02x%.02x%.02x", \
|
||||
((gulong *) riid)[0], \
|
||||
((gushort *) riid)[2], \
|
||||
((gushort *) riid)[3], \
|
||||
((guchar *) riid)[8], \
|
||||
((guchar *) riid)[9], \
|
||||
((guchar *) riid)[10], \
|
||||
((guchar *) riid)[11], \
|
||||
((guchar *) riid)[12], \
|
||||
((guchar *) riid)[13], \
|
||||
((guchar *) riid)[14], \
|
||||
((guchar *) riid)[15]);
|
||||
#define PRINT_GUID(guid) \
|
||||
g_print ("guid = %.08x-%.04x-%.04x-%.02x%.02x-%.02x%.02x%.02x%.02x%.02x%.02x", \
|
||||
((gulong *) guid)[0], \
|
||||
((gushort *) guid)[2], \
|
||||
((gushort *) guid)[3], \
|
||||
((guchar *) guid)[8], \
|
||||
((guchar *) guid)[9], \
|
||||
((guchar *) guid)[10], \
|
||||
((guchar *) guid)[11], \
|
||||
((guchar *) guid)[12], \
|
||||
((guchar *) guid)[13], \
|
||||
((guchar *) guid)[14], \
|
||||
((guchar *) guid)[15]);
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_target (IDropTarget __RPC_FAR *This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_target (IDropTarget __RPC_FAR *This);
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_release_target (IDropTarget __RPC_FAR *This);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_enter (IDropTarget __RPC_FAR *This,
|
||||
/* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_over (IDropTarget __RPC_FAR *This,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_leave (IDropTarget __RPC_FAR *This);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drop (IDropTarget __RPC_FAR *This,
|
||||
/* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_source (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_source (IDropSource __RPC_FAR *This);
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_release_source (IDropSource __RPC_FAR *This);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_continue_drag (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ BOOL fEscapePressed,
|
||||
/* [in] */ DWORD grfKeyState);
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_give_feedback (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ DWORD dwEffect);
|
||||
|
||||
#endif /* OLE2_DND */
|
||||
|
||||
/* Structure that holds information about a drag in progress.
|
||||
@ -169,245 +127,6 @@ gdk_drag_context_new (void)
|
||||
return (GdkDragContext *)result;
|
||||
}
|
||||
|
||||
#ifdef OLE2_DND
|
||||
|
||||
typedef struct {
|
||||
IDropTarget idt;
|
||||
GdkDragContext *context;
|
||||
} target_drag_context;
|
||||
|
||||
typedef struct {
|
||||
IDropSource ids;
|
||||
GdkDragContext *context;
|
||||
} source_drag_context;
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_target (IDropTarget __RPC_FAR *This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_interface_target\n"));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
PRINT_RIID (riid);
|
||||
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
m_add_ref_target (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDropTarget))
|
||||
{
|
||||
g_print ("...IDropTarget\n");
|
||||
m_add_ref_target (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("...Huh?\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_target (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
target_drag_context *ctx = (target_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_add_ref_target\n"));
|
||||
gdk_drag_context_ref (ctx->context);
|
||||
|
||||
return private->ref_count;
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_release_target (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
target_drag_context *ctx = (target_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_release_target\n"));
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
|
||||
if (private->ref_count == 1)
|
||||
{
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return private->ref_count - 1;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_enter (IDropTarget __RPC_FAR *This,
|
||||
/* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_enter\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_over (IDropTarget __RPC_FAR *This,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_over\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_leave (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_leave\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drop (IDropTarget __RPC_FAR *This,
|
||||
/* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drop\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_source (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_interface_source\n"));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
PRINT_RIID (riid);
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
m_add_ref_source (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDropSource))
|
||||
{
|
||||
g_print ("...IDropSource\n");
|
||||
m_add_ref_source (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("...Huh?\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_source (IDropSource __RPC_FAR *This)
|
||||
{
|
||||
source_drag_context *ctx = (source_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_add_ref_source\n"));
|
||||
gdk_drag_context_ref (ctx->context);
|
||||
|
||||
return private->ref_count;
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_release_source (IDropSource __RPC_FAR *This)
|
||||
{
|
||||
source_drag_context *ctx = (source_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_release_source\n"));
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
|
||||
if (private->ref_count == 1)
|
||||
{
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return private->ref_count - 1;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_continue_drag (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ BOOL fEscapePressed,
|
||||
/* [in] */ DWORD grfKeyState)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_continue_drag\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_give_feedback (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ DWORD dwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_give_feedback\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
static IDropSourceVtbl ids_vtbl = {
|
||||
m_query_interface_source,
|
||||
m_add_ref_source,
|
||||
m_release_source,
|
||||
m_query_continue_drag,
|
||||
m_give_feedback
|
||||
};
|
||||
|
||||
target_drag_context *
|
||||
target_context_new (void)
|
||||
{
|
||||
target_drag_context *result;
|
||||
|
||||
result = g_new0 (target_drag_context, 1);
|
||||
|
||||
result->idt.lpVtbl = &idt_vtbl;
|
||||
|
||||
result->context = gdk_drag_context_new ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
source_drag_context *
|
||||
source_context_new (void)
|
||||
{
|
||||
source_drag_context *result;
|
||||
|
||||
result = g_new0 (source_drag_context, 1);
|
||||
|
||||
result->ids.lpVtbl = &ids_vtbl;
|
||||
|
||||
result->context = gdk_drag_context_new ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* OLE2_DND */
|
||||
|
||||
void
|
||||
gdk_drag_context_ref (GdkDragContext *context)
|
||||
{
|
||||
@ -475,6 +194,360 @@ gdk_drag_context_find (gboolean is_source,
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
#ifdef OLE2_DND
|
||||
IDropTarget idt;
|
||||
#endif
|
||||
GdkDragContext *context;
|
||||
} target_drag_context;
|
||||
|
||||
typedef struct {
|
||||
#ifdef OLE2_DND
|
||||
IDropSource ids;
|
||||
#endif
|
||||
GdkDragContext *context;
|
||||
} source_drag_context;
|
||||
|
||||
#ifdef OLE2_DND
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_target (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
target_drag_context *ctx = (target_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_add_ref_target\n"));
|
||||
gdk_drag_context_ref (ctx->context);
|
||||
|
||||
return private->ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_target (IDropTarget __RPC_FAR *This,
|
||||
REFIID riid,
|
||||
void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_interface_target\n"));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
PRINT_GUID (riid);
|
||||
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
m_add_ref_target (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDropTarget))
|
||||
{
|
||||
g_print ("...IDropTarget\n");
|
||||
m_add_ref_target (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("...Huh?\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_release_target (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
target_drag_context *ctx = (target_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_release_target\n"));
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
|
||||
if (private->ref_count == 1)
|
||||
{
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return private->ref_count - 1;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drag_enter (IDropTarget __RPC_FAR *This,
|
||||
IDataObject __RPC_FAR *pDataObj,
|
||||
DWORD grfKeyState,
|
||||
POINTL pt,
|
||||
DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_enter\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drag_over (IDropTarget __RPC_FAR *This,
|
||||
DWORD grfKeyState,
|
||||
POINTL pt,
|
||||
DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_over\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drag_leave (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_leave\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drop (IDropTarget __RPC_FAR *This,
|
||||
IDataObject __RPC_FAR *pDataObj,
|
||||
DWORD grfKeyState,
|
||||
POINTL pt,
|
||||
DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drop\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_source (IDropSource __RPC_FAR *This)
|
||||
{
|
||||
source_drag_context *ctx = (source_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_add_ref_source\n"));
|
||||
gdk_drag_context_ref (ctx->context);
|
||||
|
||||
return private->ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_source (IDropSource __RPC_FAR *This,
|
||||
REFIID riid,
|
||||
void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_interface_source\n"));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
PRINT_GUID (riid);
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
m_add_ref_source (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDropSource))
|
||||
{
|
||||
g_print ("...IDropSource\n");
|
||||
m_add_ref_source (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("...Huh?\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_release_source (IDropSource __RPC_FAR *This)
|
||||
{
|
||||
source_drag_context *ctx = (source_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_release_source\n"));
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
|
||||
if (private->ref_count == 1)
|
||||
{
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return private->ref_count - 1;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_continue_drag (IDropSource __RPC_FAR *This,
|
||||
BOOL fEscapePressed,
|
||||
DWORD grfKeyState)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_continue_drag\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_give_feedback (IDropSource __RPC_FAR *This,
|
||||
DWORD dwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_give_feedback\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_object (IDataObject __RPC_FAR *This,
|
||||
REFIID riid,
|
||||
void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_object (IDataObject __RPC_FAR *This)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_release_object (IDataObject __RPC_FAR *This)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_get_data (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtc,
|
||||
STGMEDIUM *pMedium)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_get_data_here (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtc,
|
||||
STGMEDIUM *pMedium)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_get_data (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtc)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
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,
|
||||
BOOL fRelease)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_enum_format_etc (IDataObject __RPC_FAR *This,
|
||||
DWORD dwDirection,
|
||||
IEnumFORMATETC **ppEnumFormatEtc)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_d_advise (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatetc,
|
||||
DWORD advf,
|
||||
IAdviseSink *pAdvSink,
|
||||
DWORD *pdwConnection)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_d_unadvise (IDataObject __RPC_FAR *This,
|
||||
DWORD dwConnection)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_enum_d_advise (IDataObject __RPC_FAR *This,
|
||||
IEnumSTATDATA **ppenumAdvise)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
static IDropSourceVtbl ids_vtbl = {
|
||||
m_query_interface_source,
|
||||
m_add_ref_source,
|
||||
m_release_source,
|
||||
m_query_continue_drag,
|
||||
m_give_feedback
|
||||
};
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
#endif /* OLE2_DND */
|
||||
|
||||
static target_drag_context *
|
||||
target_context_new (void)
|
||||
{
|
||||
target_drag_context *result;
|
||||
|
||||
result = g_new0 (target_drag_context, 1);
|
||||
|
||||
#ifdef OLE2_DND
|
||||
result->idt.lpVtbl = &idt_vtbl;
|
||||
#endif
|
||||
|
||||
result->context = gdk_drag_context_new ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static source_drag_context *
|
||||
source_context_new (void)
|
||||
{
|
||||
source_drag_context *result;
|
||||
|
||||
result = g_new0 (source_drag_context, 1);
|
||||
|
||||
#ifdef OLE2_DND
|
||||
result->ids.lpVtbl = &ids_vtbl;
|
||||
#endif
|
||||
|
||||
result->context = gdk_drag_context_new ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
/* From MS Knowledge Base article Q130698 */
|
||||
@ -693,29 +766,32 @@ gdk_drag_begin (GdkWindow *window,
|
||||
GList *targets)
|
||||
{
|
||||
GList *tmp_list;
|
||||
GdkDragContext *new_context;
|
||||
source_drag_context *ctx;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
GDK_NOTE (DND, g_print ("gdk_drag_begin\n"));
|
||||
|
||||
new_context = gdk_drag_context_new ();
|
||||
new_context->is_source = TRUE;
|
||||
new_context->source_window = window;
|
||||
ctx = source_context_new ();
|
||||
ctx->context->is_source = TRUE;
|
||||
ctx->context->source_window = window;
|
||||
gdk_window_ref (window);
|
||||
|
||||
tmp_list = g_list_last (targets);
|
||||
new_context->targets = NULL;
|
||||
ctx->context->targets = NULL;
|
||||
while (tmp_list)
|
||||
{
|
||||
new_context->targets = g_list_prepend (new_context->targets,
|
||||
tmp_list->data);
|
||||
ctx->context->targets = g_list_prepend (ctx->context->targets,
|
||||
tmp_list->data);
|
||||
tmp_list = tmp_list->prev;
|
||||
}
|
||||
|
||||
new_context->actions = 0;
|
||||
ctx->context->actions = 0;
|
||||
|
||||
return new_context;
|
||||
#if 0
|
||||
DoDragDrop (...);
|
||||
#endif
|
||||
return ctx->context;
|
||||
}
|
||||
|
||||
guint32
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* #define OLE2_DND */
|
||||
|
||||
#define INITGUID
|
||||
|
||||
#include "gdkdnd.h"
|
||||
@ -47,6 +49,15 @@
|
||||
#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>
|
||||
|
||||
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
|
||||
@ -65,74 +76,21 @@ typedef enum {
|
||||
|
||||
#ifdef OLE2_DND
|
||||
|
||||
#define PRINT_RIID(riid) \
|
||||
g_print ("riid = %.08x-%.04x-%.04x-%.02x%.02x-%.02x%.02x%.02x%.02x%.02x%.02x", \
|
||||
((gulong *) riid)[0], \
|
||||
((gushort *) riid)[2], \
|
||||
((gushort *) riid)[3], \
|
||||
((guchar *) riid)[8], \
|
||||
((guchar *) riid)[9], \
|
||||
((guchar *) riid)[10], \
|
||||
((guchar *) riid)[11], \
|
||||
((guchar *) riid)[12], \
|
||||
((guchar *) riid)[13], \
|
||||
((guchar *) riid)[14], \
|
||||
((guchar *) riid)[15]);
|
||||
#define PRINT_GUID(guid) \
|
||||
g_print ("guid = %.08x-%.04x-%.04x-%.02x%.02x-%.02x%.02x%.02x%.02x%.02x%.02x", \
|
||||
((gulong *) guid)[0], \
|
||||
((gushort *) guid)[2], \
|
||||
((gushort *) guid)[3], \
|
||||
((guchar *) guid)[8], \
|
||||
((guchar *) guid)[9], \
|
||||
((guchar *) guid)[10], \
|
||||
((guchar *) guid)[11], \
|
||||
((guchar *) guid)[12], \
|
||||
((guchar *) guid)[13], \
|
||||
((guchar *) guid)[14], \
|
||||
((guchar *) guid)[15]);
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_target (IDropTarget __RPC_FAR *This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_target (IDropTarget __RPC_FAR *This);
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_release_target (IDropTarget __RPC_FAR *This);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_enter (IDropTarget __RPC_FAR *This,
|
||||
/* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_over (IDropTarget __RPC_FAR *This,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_leave (IDropTarget __RPC_FAR *This);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drop (IDropTarget __RPC_FAR *This,
|
||||
/* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_source (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_source (IDropSource __RPC_FAR *This);
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_release_source (IDropSource __RPC_FAR *This);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_continue_drag (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ BOOL fEscapePressed,
|
||||
/* [in] */ DWORD grfKeyState);
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_give_feedback (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ DWORD dwEffect);
|
||||
|
||||
#endif /* OLE2_DND */
|
||||
|
||||
/* Structure that holds information about a drag in progress.
|
||||
@ -169,245 +127,6 @@ gdk_drag_context_new (void)
|
||||
return (GdkDragContext *)result;
|
||||
}
|
||||
|
||||
#ifdef OLE2_DND
|
||||
|
||||
typedef struct {
|
||||
IDropTarget idt;
|
||||
GdkDragContext *context;
|
||||
} target_drag_context;
|
||||
|
||||
typedef struct {
|
||||
IDropSource ids;
|
||||
GdkDragContext *context;
|
||||
} source_drag_context;
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_target (IDropTarget __RPC_FAR *This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_interface_target\n"));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
PRINT_RIID (riid);
|
||||
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
m_add_ref_target (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDropTarget))
|
||||
{
|
||||
g_print ("...IDropTarget\n");
|
||||
m_add_ref_target (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("...Huh?\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_target (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
target_drag_context *ctx = (target_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_add_ref_target\n"));
|
||||
gdk_drag_context_ref (ctx->context);
|
||||
|
||||
return private->ref_count;
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_release_target (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
target_drag_context *ctx = (target_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_release_target\n"));
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
|
||||
if (private->ref_count == 1)
|
||||
{
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return private->ref_count - 1;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_enter (IDropTarget __RPC_FAR *This,
|
||||
/* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_enter\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_over (IDropTarget __RPC_FAR *This,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_over\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drag_leave (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_leave\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_drop (IDropTarget __RPC_FAR *This,
|
||||
/* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
|
||||
/* [in] */ DWORD grfKeyState,
|
||||
/* [in] */ POINTL pt,
|
||||
/* [out][in] */ DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drop\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_source (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_interface_source\n"));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
PRINT_RIID (riid);
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
m_add_ref_source (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDropSource))
|
||||
{
|
||||
g_print ("...IDropSource\n");
|
||||
m_add_ref_source (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("...Huh?\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_source (IDropSource __RPC_FAR *This)
|
||||
{
|
||||
source_drag_context *ctx = (source_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_add_ref_source\n"));
|
||||
gdk_drag_context_ref (ctx->context);
|
||||
|
||||
return private->ref_count;
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE
|
||||
m_release_source (IDropSource __RPC_FAR *This)
|
||||
{
|
||||
source_drag_context *ctx = (source_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_release_source\n"));
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
|
||||
if (private->ref_count == 1)
|
||||
{
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return private->ref_count - 1;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_query_continue_drag (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ BOOL fEscapePressed,
|
||||
/* [in] */ DWORD grfKeyState)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_continue_drag\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE
|
||||
m_give_feedback (IDropSource __RPC_FAR *This,
|
||||
/* [in] */ DWORD dwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_give_feedback\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
static IDropSourceVtbl ids_vtbl = {
|
||||
m_query_interface_source,
|
||||
m_add_ref_source,
|
||||
m_release_source,
|
||||
m_query_continue_drag,
|
||||
m_give_feedback
|
||||
};
|
||||
|
||||
target_drag_context *
|
||||
target_context_new (void)
|
||||
{
|
||||
target_drag_context *result;
|
||||
|
||||
result = g_new0 (target_drag_context, 1);
|
||||
|
||||
result->idt.lpVtbl = &idt_vtbl;
|
||||
|
||||
result->context = gdk_drag_context_new ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
source_drag_context *
|
||||
source_context_new (void)
|
||||
{
|
||||
source_drag_context *result;
|
||||
|
||||
result = g_new0 (source_drag_context, 1);
|
||||
|
||||
result->ids.lpVtbl = &ids_vtbl;
|
||||
|
||||
result->context = gdk_drag_context_new ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* OLE2_DND */
|
||||
|
||||
void
|
||||
gdk_drag_context_ref (GdkDragContext *context)
|
||||
{
|
||||
@ -475,6 +194,360 @@ gdk_drag_context_find (gboolean is_source,
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
#ifdef OLE2_DND
|
||||
IDropTarget idt;
|
||||
#endif
|
||||
GdkDragContext *context;
|
||||
} target_drag_context;
|
||||
|
||||
typedef struct {
|
||||
#ifdef OLE2_DND
|
||||
IDropSource ids;
|
||||
#endif
|
||||
GdkDragContext *context;
|
||||
} source_drag_context;
|
||||
|
||||
#ifdef OLE2_DND
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_target (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
target_drag_context *ctx = (target_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_add_ref_target\n"));
|
||||
gdk_drag_context_ref (ctx->context);
|
||||
|
||||
return private->ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_target (IDropTarget __RPC_FAR *This,
|
||||
REFIID riid,
|
||||
void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_interface_target\n"));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
PRINT_GUID (riid);
|
||||
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
m_add_ref_target (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDropTarget))
|
||||
{
|
||||
g_print ("...IDropTarget\n");
|
||||
m_add_ref_target (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("...Huh?\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_release_target (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
target_drag_context *ctx = (target_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_release_target\n"));
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
|
||||
if (private->ref_count == 1)
|
||||
{
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return private->ref_count - 1;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drag_enter (IDropTarget __RPC_FAR *This,
|
||||
IDataObject __RPC_FAR *pDataObj,
|
||||
DWORD grfKeyState,
|
||||
POINTL pt,
|
||||
DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_enter\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drag_over (IDropTarget __RPC_FAR *This,
|
||||
DWORD grfKeyState,
|
||||
POINTL pt,
|
||||
DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_over\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drag_leave (IDropTarget __RPC_FAR *This)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drag_leave\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_drop (IDropTarget __RPC_FAR *This,
|
||||
IDataObject __RPC_FAR *pDataObj,
|
||||
DWORD grfKeyState,
|
||||
POINTL pt,
|
||||
DWORD __RPC_FAR *pdwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_drop\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_source (IDropSource __RPC_FAR *This)
|
||||
{
|
||||
source_drag_context *ctx = (source_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_add_ref_source\n"));
|
||||
gdk_drag_context_ref (ctx->context);
|
||||
|
||||
return private->ref_count;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_source (IDropSource __RPC_FAR *This,
|
||||
REFIID riid,
|
||||
void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_interface_source\n"));
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
PRINT_GUID (riid);
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
{
|
||||
g_print ("...IUnknown\n");
|
||||
m_add_ref_source (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else if (IsEqualGUID (riid, &IID_IDropSource))
|
||||
{
|
||||
g_print ("...IDropSource\n");
|
||||
m_add_ref_source (This);
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("...Huh?\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_release_source (IDropSource __RPC_FAR *This)
|
||||
{
|
||||
source_drag_context *ctx = (source_drag_context *) This;
|
||||
GdkDragContextPrivate *private = (GdkDragContextPrivate *) ctx->context;
|
||||
|
||||
GDK_NOTE (DND, g_print ("m_release_source\n"));
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
|
||||
if (private->ref_count == 1)
|
||||
{
|
||||
gdk_drag_context_unref (ctx->context);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return private->ref_count - 1;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_continue_drag (IDropSource __RPC_FAR *This,
|
||||
BOOL fEscapePressed,
|
||||
DWORD grfKeyState)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_query_continue_drag\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_give_feedback (IDropSource __RPC_FAR *This,
|
||||
DWORD dwEffect)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("m_give_feedback\n"));
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_interface_object (IDataObject __RPC_FAR *This,
|
||||
REFIID riid,
|
||||
void __RPC_FAR *__RPC_FAR *ppvObject)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_add_ref_object (IDataObject __RPC_FAR *This)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE
|
||||
m_release_object (IDataObject __RPC_FAR *This)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_get_data (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtc,
|
||||
STGMEDIUM *pMedium)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_get_data_here (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtc,
|
||||
STGMEDIUM *pMedium)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_query_get_data (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatEtc)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
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,
|
||||
BOOL fRelease)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_enum_format_etc (IDataObject __RPC_FAR *This,
|
||||
DWORD dwDirection,
|
||||
IEnumFORMATETC **ppEnumFormatEtc)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_d_advise (IDataObject __RPC_FAR *This,
|
||||
FORMATETC *pFormatetc,
|
||||
DWORD advf,
|
||||
IAdviseSink *pAdvSink,
|
||||
DWORD *pdwConnection)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_d_unadvise (IDataObject __RPC_FAR *This,
|
||||
DWORD dwConnection)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE
|
||||
m_enum_d_advise (IDataObject __RPC_FAR *This,
|
||||
IEnumSTATDATA **ppenumAdvise)
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
static IDropSourceVtbl ids_vtbl = {
|
||||
m_query_interface_source,
|
||||
m_add_ref_source,
|
||||
m_release_source,
|
||||
m_query_continue_drag,
|
||||
m_give_feedback
|
||||
};
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
#endif /* OLE2_DND */
|
||||
|
||||
static target_drag_context *
|
||||
target_context_new (void)
|
||||
{
|
||||
target_drag_context *result;
|
||||
|
||||
result = g_new0 (target_drag_context, 1);
|
||||
|
||||
#ifdef OLE2_DND
|
||||
result->idt.lpVtbl = &idt_vtbl;
|
||||
#endif
|
||||
|
||||
result->context = gdk_drag_context_new ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static source_drag_context *
|
||||
source_context_new (void)
|
||||
{
|
||||
source_drag_context *result;
|
||||
|
||||
result = g_new0 (source_drag_context, 1);
|
||||
|
||||
#ifdef OLE2_DND
|
||||
result->ids.lpVtbl = &ids_vtbl;
|
||||
#endif
|
||||
|
||||
result->context = gdk_drag_context_new ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
/* From MS Knowledge Base article Q130698 */
|
||||
@ -693,29 +766,32 @@ gdk_drag_begin (GdkWindow *window,
|
||||
GList *targets)
|
||||
{
|
||||
GList *tmp_list;
|
||||
GdkDragContext *new_context;
|
||||
source_drag_context *ctx;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
GDK_NOTE (DND, g_print ("gdk_drag_begin\n"));
|
||||
|
||||
new_context = gdk_drag_context_new ();
|
||||
new_context->is_source = TRUE;
|
||||
new_context->source_window = window;
|
||||
ctx = source_context_new ();
|
||||
ctx->context->is_source = TRUE;
|
||||
ctx->context->source_window = window;
|
||||
gdk_window_ref (window);
|
||||
|
||||
tmp_list = g_list_last (targets);
|
||||
new_context->targets = NULL;
|
||||
ctx->context->targets = NULL;
|
||||
while (tmp_list)
|
||||
{
|
||||
new_context->targets = g_list_prepend (new_context->targets,
|
||||
tmp_list->data);
|
||||
ctx->context->targets = g_list_prepend (ctx->context->targets,
|
||||
tmp_list->data);
|
||||
tmp_list = tmp_list->prev;
|
||||
}
|
||||
|
||||
new_context->actions = 0;
|
||||
ctx->context->actions = 0;
|
||||
|
||||
return new_context;
|
||||
#if 0
|
||||
DoDragDrop (...);
|
||||
#endif
|
||||
return ctx->context;
|
||||
}
|
||||
|
||||
guint32
|
||||
|
@ -44,10 +44,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef HAVE_WINTAB
|
||||
#include <wintab.h>
|
||||
#endif
|
||||
|
||||
#include <objbase.h>
|
||||
#include <imm.h>
|
||||
|
||||
@ -57,6 +53,10 @@
|
||||
#include "surrogate-dimm.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WINTAB
|
||||
#include <wintab.h>
|
||||
#endif
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkx.h"
|
||||
|
||||
@ -506,14 +506,6 @@ gdk_event_get_graphics_expose (GdkWindow *window)
|
||||
#endif
|
||||
}
|
||||
|
||||
/************************
|
||||
* Exposure compression *
|
||||
************************/
|
||||
|
||||
/* I don't bother with exposure compression on Win32. Windows compresses
|
||||
* WM_PAINT events by itself.
|
||||
*/
|
||||
|
||||
/*************************************************************
|
||||
* gdk_event_handler_set:
|
||||
*
|
||||
@ -2819,6 +2811,31 @@ build_key_event_state (GdkEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
build_pointer_event_state (MSG *xevent)
|
||||
{
|
||||
gint state;
|
||||
|
||||
state = 0;
|
||||
if (xevent->wParam & MK_CONTROL)
|
||||
state |= GDK_CONTROL_MASK;
|
||||
if (xevent->wParam & MK_LBUTTON)
|
||||
state |= GDK_BUTTON1_MASK;
|
||||
if (xevent->wParam & MK_MBUTTON)
|
||||
state |= GDK_BUTTON2_MASK;
|
||||
if (xevent->wParam & MK_RBUTTON)
|
||||
state |= GDK_BUTTON3_MASK;
|
||||
if (xevent->wParam & MK_SHIFT)
|
||||
state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_MENU) < 0)
|
||||
state |= GDK_MOD1_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
state |= GDK_LOCK_MASK;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
build_keypress_event (GdkWindowPrivate *window_private,
|
||||
GdkEvent *event,
|
||||
@ -3013,11 +3030,18 @@ print_event (GdkEvent *event)
|
||||
event->expose.count);
|
||||
break;
|
||||
case GDK_MOTION_NOTIFY:
|
||||
g_print ("(%.4g,%.4g) %s",
|
||||
event->motion.x, event->motion.y,
|
||||
event->motion.is_hint ? "HINT " : "");
|
||||
print_event_state (event->motion.state);
|
||||
break;
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_2BUTTON_PRESS:
|
||||
case GDK_3BUTTON_PRESS:
|
||||
case GDK_BUTTON_RELEASE:
|
||||
g_print ("%d ", event->button.button);
|
||||
g_print ("%d (%.4g,%.4g) ",
|
||||
event->button.button,
|
||||
event->button.x, event->button.y);
|
||||
print_event_state (event->button.state);
|
||||
break;
|
||||
case GDK_KEY_PRESS:
|
||||
@ -3050,7 +3074,6 @@ static void
|
||||
synthesize_crossing_events (GdkWindow *window,
|
||||
MSG *xevent)
|
||||
{
|
||||
TRACKMOUSEEVENT tme;
|
||||
GdkEvent *event;
|
||||
|
||||
/* If we are not using TrackMouseEvent, generate a leave notify
|
||||
@ -3128,8 +3151,11 @@ synthesize_crossing_events (GdkWindow *window,
|
||||
gdk_window_unref (curWnd);
|
||||
curWnd = window;
|
||||
gdk_window_ref (curWnd);
|
||||
#ifdef USE_TRACKMOUSEEVENT
|
||||
if (p_TrackMouseEvent != NULL)
|
||||
{
|
||||
TRACKMOUSEEVENT tme;
|
||||
|
||||
tme.cbSize = sizeof (TRACKMOUSEEVENT);
|
||||
tme.dwFlags = TME_LEAVE;
|
||||
tme.hwndTrack = GDK_DRAWABLE_XID (curWnd);
|
||||
@ -3137,8 +3163,11 @@ synthesize_crossing_events (GdkWindow *window,
|
||||
|
||||
(*p_TrackMouseEvent) (&tme);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef NEW_PROPAGATION_CODE
|
||||
|
||||
static GdkWindow *
|
||||
key_propagate (GdkWindow *window,
|
||||
MSG *xevent)
|
||||
@ -3146,15 +3175,13 @@ key_propagate (GdkWindow *window,
|
||||
gdk_window_unref (window);
|
||||
window = WINDOW_PRIVATE(window)->parent;
|
||||
gdk_window_ref (window);
|
||||
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
|
||||
GDK_DRAWABLE_XID (window)));
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
mouse_propagate (GdkWindow *window,
|
||||
MSG *xevent)
|
||||
pointer_propagate (GdkWindow *window,
|
||||
MSG *xevent)
|
||||
{
|
||||
POINT pt;
|
||||
|
||||
@ -3166,11 +3193,27 @@ mouse_propagate (GdkWindow *window,
|
||||
gdk_window_ref (window);
|
||||
ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
|
||||
xevent->lParam = MAKELPARAM (pt.x, pt.y);
|
||||
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
|
||||
GDK_DRAWABLE_XID (window)));
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
#endif /* !NEW_PROPAGATION_CODE */
|
||||
|
||||
static void
|
||||
translate_mouse_coords (GdkWindow *window1,
|
||||
GdkWindow *window2,
|
||||
MSG *xevent)
|
||||
{
|
||||
POINT pt;
|
||||
|
||||
pt.x = LOWORD (xevent->lParam);
|
||||
pt.y = HIWORD (xevent->lParam);
|
||||
ClientToScreen (GDK_DRAWABLE_XID (window1), &pt);
|
||||
ScreenToClient (GDK_DRAWABLE_XID (window2), &pt);
|
||||
xevent->lParam = MAKELPARAM (pt.x, pt.y);
|
||||
GDK_NOTE (EVENTS, g_print ("...new coords are (%d,%d)\n", pt.x, pt.y));
|
||||
}
|
||||
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
|
||||
static gboolean
|
||||
@ -3180,9 +3223,7 @@ propagate (GdkWindow **window,
|
||||
gboolean grab_owner_events,
|
||||
gint grab_mask,
|
||||
gboolean (*doesnt_want_it) (gint mask,
|
||||
MSG *xevent),
|
||||
GdkWindow *(*propagate) (GdkWindow *window,
|
||||
MSG *xevent))
|
||||
MSG *xevent))
|
||||
{
|
||||
if (grab_window != NULL && !grab_owner_events)
|
||||
{
|
||||
@ -3234,13 +3275,15 @@ propagate (GdkWindow **window,
|
||||
}
|
||||
else
|
||||
{
|
||||
GDK_NOTE (EVENTS, "...undelivered\n");
|
||||
GDK_NOTE (EVENTS, g_print ("...undelivered\n"));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*window = (*propagate) (*window, xevent);
|
||||
gdk_window_unref (*window);
|
||||
*window = WINDOW_PRIVATE(*window)->parent;
|
||||
gdk_window_ref (*window);
|
||||
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
|
||||
GDK_DRAWABLE_XID (*window)));
|
||||
/* The only branch where we actually continue the loop */
|
||||
@ -3539,8 +3582,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
if (!propagate (&window, xevent,
|
||||
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
|
||||
doesnt_want_key,
|
||||
key_propagate))
|
||||
doesnt_want_key))
|
||||
break;
|
||||
event->key.window = window;
|
||||
#else
|
||||
@ -3815,8 +3857,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
if (!propagate (&window, xevent,
|
||||
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
|
||||
doesnt_want_char,
|
||||
key_propagate))
|
||||
doesnt_want_char))
|
||||
break;
|
||||
event->key.window = window;
|
||||
#else
|
||||
@ -3912,11 +3953,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
buttondown0:
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("WM_%cBUTTONDOWN: %#x x,y: %d %d button: %d\n",
|
||||
g_print ("WM_%cBUTTONDOWN: %#x (%d,%d)\n",
|
||||
" LMR"[button],
|
||||
xevent->hwnd,
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam),
|
||||
button));
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam)));
|
||||
|
||||
if (WINDOW_PRIVATE(window)->extension_events != 0
|
||||
&& gdk_input_ignore_core)
|
||||
@ -3932,8 +3972,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
if (!propagate (&window, xevent,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_press,
|
||||
mouse_propagate))
|
||||
doesnt_want_button_press))
|
||||
break;
|
||||
event->button.window = window;
|
||||
#else
|
||||
@ -3981,7 +4020,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
else
|
||||
{
|
||||
window = mouse_propagate (window, xevent);
|
||||
window = pointer_propagate (window, xevent);
|
||||
/* Jump back up */
|
||||
goto buttondown; /* What did Dijkstra say? */
|
||||
}
|
||||
@ -4008,43 +4047,16 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
|
||||
event->button.time = xevent->time;
|
||||
if (window == p_grab_window
|
||||
&& p_grab_window != orig_window)
|
||||
{
|
||||
/* Translate coordinates to grabber */
|
||||
pt.x = LOWORD (xevent->lParam);
|
||||
pt.y = HIWORD (xevent->lParam);
|
||||
ClientToScreen (xevent->hwnd, &pt);
|
||||
ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
|
||||
event->button.x = pt.x;
|
||||
event->button.y = pt.y;
|
||||
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
|
||||
}
|
||||
else
|
||||
{
|
||||
event->button.x = LOWORD (xevent->lParam);
|
||||
event->button.y = HIWORD (xevent->lParam);
|
||||
}
|
||||
if (window != orig_window)
|
||||
translate_mouse_coords (orig_window, window, xevent);
|
||||
event->button.x = curX = LOWORD (xevent->lParam);
|
||||
event->button.y = curY = HIWORD (xevent->lParam);
|
||||
event->button.x_root = xevent->pt.x;
|
||||
event->button.y_root = xevent->pt.y;
|
||||
event->button.pressure = 0.5;
|
||||
event->button.xtilt = 0;
|
||||
event->button.ytilt = 0;
|
||||
event->button.state = 0;
|
||||
if (xevent->wParam & MK_CONTROL)
|
||||
event->button.state |= GDK_CONTROL_MASK;
|
||||
if (xevent->wParam & MK_LBUTTON)
|
||||
event->button.state |= GDK_BUTTON1_MASK;
|
||||
if (xevent->wParam & MK_MBUTTON)
|
||||
event->button.state |= GDK_BUTTON2_MASK;
|
||||
if (xevent->wParam & MK_RBUTTON)
|
||||
event->button.state |= GDK_BUTTON3_MASK;
|
||||
if (xevent->wParam & MK_SHIFT)
|
||||
event->button.state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_MENU) < 0)
|
||||
event->button.state |= GDK_MOD1_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
event->button.state |= GDK_LOCK_MASK;
|
||||
event->button.state = build_pointer_event_state (xevent);
|
||||
event->button.button = button;
|
||||
event->button.source = GDK_SOURCE_MOUSE;
|
||||
event->button.deviceid = GDK_CORE_POINTER;
|
||||
@ -4098,11 +4110,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
buttonup0:
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("WM_%cBUTTONUP: %#x x,y: %d %d button: %d\n",
|
||||
g_print ("WM_%cBUTTONUP: %#x (%d,%d)\n",
|
||||
" LMR"[button],
|
||||
xevent->hwnd,
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam),
|
||||
button));
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam)));
|
||||
|
||||
if (WINDOW_PRIVATE(window)->extension_events != 0
|
||||
&& gdk_input_ignore_core)
|
||||
@ -4118,9 +4129,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
if (!propagate (&window, xevent,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_release,
|
||||
mouse_propagate))
|
||||
break;
|
||||
doesnt_want_button_release))
|
||||
goto maybe_ungrab;
|
||||
event->button.window = window;
|
||||
#else
|
||||
buttonup:
|
||||
@ -4168,7 +4178,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
else
|
||||
{
|
||||
window = mouse_propagate (window, xevent);
|
||||
window = pointer_propagate (window, xevent);
|
||||
/* Jump back up */
|
||||
goto buttonup;
|
||||
}
|
||||
@ -4179,43 +4189,16 @@ gdk_event_translate (GdkEvent *event,
|
||||
g_assert (event->button.window == window);
|
||||
#endif
|
||||
event->button.time = xevent->time;
|
||||
if (window == p_grab_window
|
||||
&& p_grab_window != orig_window)
|
||||
{
|
||||
/* Translate coordinates to grabber */
|
||||
pt.x = LOWORD (xevent->lParam);
|
||||
pt.y = HIWORD (xevent->lParam);
|
||||
ClientToScreen (xevent->hwnd, &pt);
|
||||
ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
|
||||
event->button.x = pt.x;
|
||||
event->button.y = pt.y;
|
||||
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
|
||||
}
|
||||
else
|
||||
{
|
||||
event->button.x = LOWORD (xevent->lParam);
|
||||
event->button.y = HIWORD (xevent->lParam);
|
||||
}
|
||||
if (window != orig_window)
|
||||
translate_mouse_coords (orig_window, window, xevent);
|
||||
event->button.x = LOWORD (xevent->lParam);
|
||||
event->button.y = HIWORD (xevent->lParam);
|
||||
event->button.x_root = xevent->pt.x;
|
||||
event->button.y_root = xevent->pt.y;
|
||||
event->button.pressure = 0.5;
|
||||
event->button.xtilt = 0;
|
||||
event->button.ytilt = 0;
|
||||
event->button.state = 0;
|
||||
if (xevent->wParam & MK_CONTROL)
|
||||
event->button.state |= GDK_CONTROL_MASK;
|
||||
if (xevent->wParam & MK_LBUTTON)
|
||||
event->button.state |= GDK_BUTTON1_MASK;
|
||||
if (xevent->wParam & MK_MBUTTON)
|
||||
event->button.state |= GDK_BUTTON2_MASK;
|
||||
if (xevent->wParam & MK_RBUTTON)
|
||||
event->button.state |= GDK_BUTTON3_MASK;
|
||||
if (xevent->wParam & MK_SHIFT)
|
||||
event->button.state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_MENU) < 0)
|
||||
event->button.state |= GDK_MOD1_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
event->button.state |= GDK_LOCK_MASK;
|
||||
event->button.state = build_pointer_event_state (xevent);
|
||||
event->button.button = button;
|
||||
event->button.source = GDK_SOURCE_MOUSE;
|
||||
event->button.deviceid = GDK_CORE_POINTER;
|
||||
@ -4231,12 +4214,20 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("WM_MOUSEMOVE: %#x %#x +%d+%d\n",
|
||||
g_print ("WM_MOUSEMOVE: %#x %#x (%d,%d)\n",
|
||||
xevent->hwnd, xevent->wParam,
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam)));
|
||||
|
||||
/* HB: only process mouse move messages if we own the active window. */
|
||||
/* If we haven't moved, don't create any event.
|
||||
* Windows sends WM_MOUSEMOVE messages after button presses
|
||||
* even if the mouse doesn't move. This disturbs gtk.
|
||||
*/
|
||||
if (window == curWnd
|
||||
&& LOWORD (xevent->lParam) == curX
|
||||
&& HIWORD (xevent->lParam) == curY)
|
||||
break;
|
||||
|
||||
/* HB: only process mouse move messages if we own the active window. */
|
||||
GetWindowThreadProcessId(GetActiveWindow(), &pidActWin);
|
||||
GetWindowThreadProcessId(xevent->hwnd, &pidThis);
|
||||
if (pidActWin != pidThis)
|
||||
@ -4256,8 +4247,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
if (!propagate (&window, xevent,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_motion,
|
||||
mouse_propagate))
|
||||
doesnt_want_button_motion))
|
||||
break;
|
||||
event->motion.window = window;
|
||||
#else
|
||||
@ -4330,7 +4320,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
else
|
||||
{
|
||||
window = mouse_propagate (window, xevent);
|
||||
window = pointer_propagate (window, xevent);
|
||||
/* Jump back up */
|
||||
goto mousemotion;
|
||||
}
|
||||
@ -4339,23 +4329,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
event->motion.window = window;
|
||||
#endif
|
||||
event->motion.time = xevent->time;
|
||||
if (window == p_grab_window
|
||||
&& p_grab_window != orig_window)
|
||||
{
|
||||
/* Translate coordinates to grabber */
|
||||
pt.x = curX = LOWORD (xevent->lParam);
|
||||
pt.y = curY = HIWORD (xevent->lParam);
|
||||
ClientToScreen (xevent->hwnd, &pt);
|
||||
ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
|
||||
event->motion.x = pt.x;
|
||||
event->motion.y = pt.y;
|
||||
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
|
||||
}
|
||||
else
|
||||
{
|
||||
event->motion.x = curX = LOWORD (xevent->lParam);
|
||||
event->motion.y = curY = HIWORD (xevent->lParam);
|
||||
}
|
||||
if (window != orig_window)
|
||||
translate_mouse_coords (orig_window, window, xevent);
|
||||
event->motion.x = curX = LOWORD (xevent->lParam);
|
||||
event->motion.y = curY = HIWORD (xevent->lParam);
|
||||
event->motion.x_root = xevent->pt.x;
|
||||
event->motion.y_root = xevent->pt.y;
|
||||
curXroot = event->motion.x_root;
|
||||
@ -4363,25 +4340,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
event->motion.pressure = 0.5;
|
||||
event->motion.xtilt = 0;
|
||||
event->motion.ytilt = 0;
|
||||
event->button.state = 0;
|
||||
if (xevent->wParam & MK_CONTROL)
|
||||
event->button.state |= GDK_CONTROL_MASK;
|
||||
if (xevent->wParam & MK_LBUTTON)
|
||||
event->button.state |= GDK_BUTTON1_MASK;
|
||||
if (xevent->wParam & MK_MBUTTON)
|
||||
event->button.state |= GDK_BUTTON2_MASK;
|
||||
if (xevent->wParam & MK_RBUTTON)
|
||||
event->button.state |= GDK_BUTTON3_MASK;
|
||||
if (xevent->wParam & MK_SHIFT)
|
||||
event->button.state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_MENU) < 0)
|
||||
event->button.state |= GDK_MOD1_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
event->button.state |= GDK_LOCK_MASK;
|
||||
if (mask & GDK_POINTER_MOTION_HINT_MASK)
|
||||
event->motion.is_hint = NotifyHint;
|
||||
else
|
||||
event->motion.is_hint = NotifyNormal;
|
||||
event->motion.state = build_pointer_event_state (xevent);
|
||||
event->motion.is_hint = FALSE;
|
||||
event->motion.source = GDK_SOURCE_MOUSE;
|
||||
event->motion.deviceid = GDK_CORE_POINTER;
|
||||
|
||||
@ -4788,7 +4748,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
break;
|
||||
|
||||
case WM_MOVE:
|
||||
GDK_NOTE (EVENTS, g_print ("WM_MOVE: %#x +%d+%d\n",
|
||||
GDK_NOTE (EVENTS, g_print ("WM_MOVE: %#x (%d,%d)\n",
|
||||
xevent->hwnd,
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam)));
|
||||
|
||||
|
@ -44,10 +44,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef HAVE_WINTAB
|
||||
#include <wintab.h>
|
||||
#endif
|
||||
|
||||
#include <objbase.h>
|
||||
#include <imm.h>
|
||||
|
||||
@ -57,6 +53,10 @@
|
||||
#include "surrogate-dimm.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WINTAB
|
||||
#include <wintab.h>
|
||||
#endif
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkx.h"
|
||||
|
||||
@ -506,14 +506,6 @@ gdk_event_get_graphics_expose (GdkWindow *window)
|
||||
#endif
|
||||
}
|
||||
|
||||
/************************
|
||||
* Exposure compression *
|
||||
************************/
|
||||
|
||||
/* I don't bother with exposure compression on Win32. Windows compresses
|
||||
* WM_PAINT events by itself.
|
||||
*/
|
||||
|
||||
/*************************************************************
|
||||
* gdk_event_handler_set:
|
||||
*
|
||||
@ -2819,6 +2811,31 @@ build_key_event_state (GdkEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
build_pointer_event_state (MSG *xevent)
|
||||
{
|
||||
gint state;
|
||||
|
||||
state = 0;
|
||||
if (xevent->wParam & MK_CONTROL)
|
||||
state |= GDK_CONTROL_MASK;
|
||||
if (xevent->wParam & MK_LBUTTON)
|
||||
state |= GDK_BUTTON1_MASK;
|
||||
if (xevent->wParam & MK_MBUTTON)
|
||||
state |= GDK_BUTTON2_MASK;
|
||||
if (xevent->wParam & MK_RBUTTON)
|
||||
state |= GDK_BUTTON3_MASK;
|
||||
if (xevent->wParam & MK_SHIFT)
|
||||
state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_MENU) < 0)
|
||||
state |= GDK_MOD1_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
state |= GDK_LOCK_MASK;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
build_keypress_event (GdkWindowPrivate *window_private,
|
||||
GdkEvent *event,
|
||||
@ -3013,11 +3030,18 @@ print_event (GdkEvent *event)
|
||||
event->expose.count);
|
||||
break;
|
||||
case GDK_MOTION_NOTIFY:
|
||||
g_print ("(%.4g,%.4g) %s",
|
||||
event->motion.x, event->motion.y,
|
||||
event->motion.is_hint ? "HINT " : "");
|
||||
print_event_state (event->motion.state);
|
||||
break;
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_2BUTTON_PRESS:
|
||||
case GDK_3BUTTON_PRESS:
|
||||
case GDK_BUTTON_RELEASE:
|
||||
g_print ("%d ", event->button.button);
|
||||
g_print ("%d (%.4g,%.4g) ",
|
||||
event->button.button,
|
||||
event->button.x, event->button.y);
|
||||
print_event_state (event->button.state);
|
||||
break;
|
||||
case GDK_KEY_PRESS:
|
||||
@ -3050,7 +3074,6 @@ static void
|
||||
synthesize_crossing_events (GdkWindow *window,
|
||||
MSG *xevent)
|
||||
{
|
||||
TRACKMOUSEEVENT tme;
|
||||
GdkEvent *event;
|
||||
|
||||
/* If we are not using TrackMouseEvent, generate a leave notify
|
||||
@ -3128,8 +3151,11 @@ synthesize_crossing_events (GdkWindow *window,
|
||||
gdk_window_unref (curWnd);
|
||||
curWnd = window;
|
||||
gdk_window_ref (curWnd);
|
||||
#ifdef USE_TRACKMOUSEEVENT
|
||||
if (p_TrackMouseEvent != NULL)
|
||||
{
|
||||
TRACKMOUSEEVENT tme;
|
||||
|
||||
tme.cbSize = sizeof (TRACKMOUSEEVENT);
|
||||
tme.dwFlags = TME_LEAVE;
|
||||
tme.hwndTrack = GDK_DRAWABLE_XID (curWnd);
|
||||
@ -3137,8 +3163,11 @@ synthesize_crossing_events (GdkWindow *window,
|
||||
|
||||
(*p_TrackMouseEvent) (&tme);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef NEW_PROPAGATION_CODE
|
||||
|
||||
static GdkWindow *
|
||||
key_propagate (GdkWindow *window,
|
||||
MSG *xevent)
|
||||
@ -3146,15 +3175,13 @@ key_propagate (GdkWindow *window,
|
||||
gdk_window_unref (window);
|
||||
window = WINDOW_PRIVATE(window)->parent;
|
||||
gdk_window_ref (window);
|
||||
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
|
||||
GDK_DRAWABLE_XID (window)));
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
mouse_propagate (GdkWindow *window,
|
||||
MSG *xevent)
|
||||
pointer_propagate (GdkWindow *window,
|
||||
MSG *xevent)
|
||||
{
|
||||
POINT pt;
|
||||
|
||||
@ -3166,11 +3193,27 @@ mouse_propagate (GdkWindow *window,
|
||||
gdk_window_ref (window);
|
||||
ScreenToClient (GDK_DRAWABLE_XID (window), &pt);
|
||||
xevent->lParam = MAKELPARAM (pt.x, pt.y);
|
||||
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
|
||||
GDK_DRAWABLE_XID (window)));
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
#endif /* !NEW_PROPAGATION_CODE */
|
||||
|
||||
static void
|
||||
translate_mouse_coords (GdkWindow *window1,
|
||||
GdkWindow *window2,
|
||||
MSG *xevent)
|
||||
{
|
||||
POINT pt;
|
||||
|
||||
pt.x = LOWORD (xevent->lParam);
|
||||
pt.y = HIWORD (xevent->lParam);
|
||||
ClientToScreen (GDK_DRAWABLE_XID (window1), &pt);
|
||||
ScreenToClient (GDK_DRAWABLE_XID (window2), &pt);
|
||||
xevent->lParam = MAKELPARAM (pt.x, pt.y);
|
||||
GDK_NOTE (EVENTS, g_print ("...new coords are (%d,%d)\n", pt.x, pt.y));
|
||||
}
|
||||
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
|
||||
static gboolean
|
||||
@ -3180,9 +3223,7 @@ propagate (GdkWindow **window,
|
||||
gboolean grab_owner_events,
|
||||
gint grab_mask,
|
||||
gboolean (*doesnt_want_it) (gint mask,
|
||||
MSG *xevent),
|
||||
GdkWindow *(*propagate) (GdkWindow *window,
|
||||
MSG *xevent))
|
||||
MSG *xevent))
|
||||
{
|
||||
if (grab_window != NULL && !grab_owner_events)
|
||||
{
|
||||
@ -3234,13 +3275,15 @@ propagate (GdkWindow **window,
|
||||
}
|
||||
else
|
||||
{
|
||||
GDK_NOTE (EVENTS, "...undelivered\n");
|
||||
GDK_NOTE (EVENTS, g_print ("...undelivered\n"));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*window = (*propagate) (*window, xevent);
|
||||
gdk_window_unref (*window);
|
||||
*window = WINDOW_PRIVATE(*window)->parent;
|
||||
gdk_window_ref (*window);
|
||||
GDK_NOTE (EVENTS, g_print ("...propagating to %#x\n",
|
||||
GDK_DRAWABLE_XID (*window)));
|
||||
/* The only branch where we actually continue the loop */
|
||||
@ -3539,8 +3582,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
if (!propagate (&window, xevent,
|
||||
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
|
||||
doesnt_want_key,
|
||||
key_propagate))
|
||||
doesnt_want_key))
|
||||
break;
|
||||
event->key.window = window;
|
||||
#else
|
||||
@ -3815,8 +3857,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
if (!propagate (&window, xevent,
|
||||
k_grab_window, k_grab_owner_events, GDK_ALL_EVENTS_MASK,
|
||||
doesnt_want_char,
|
||||
key_propagate))
|
||||
doesnt_want_char))
|
||||
break;
|
||||
event->key.window = window;
|
||||
#else
|
||||
@ -3912,11 +3953,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
buttondown0:
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("WM_%cBUTTONDOWN: %#x x,y: %d %d button: %d\n",
|
||||
g_print ("WM_%cBUTTONDOWN: %#x (%d,%d)\n",
|
||||
" LMR"[button],
|
||||
xevent->hwnd,
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam),
|
||||
button));
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam)));
|
||||
|
||||
if (WINDOW_PRIVATE(window)->extension_events != 0
|
||||
&& gdk_input_ignore_core)
|
||||
@ -3932,8 +3972,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
if (!propagate (&window, xevent,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_press,
|
||||
mouse_propagate))
|
||||
doesnt_want_button_press))
|
||||
break;
|
||||
event->button.window = window;
|
||||
#else
|
||||
@ -3981,7 +4020,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
else
|
||||
{
|
||||
window = mouse_propagate (window, xevent);
|
||||
window = pointer_propagate (window, xevent);
|
||||
/* Jump back up */
|
||||
goto buttondown; /* What did Dijkstra say? */
|
||||
}
|
||||
@ -4008,43 +4047,16 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
|
||||
event->button.time = xevent->time;
|
||||
if (window == p_grab_window
|
||||
&& p_grab_window != orig_window)
|
||||
{
|
||||
/* Translate coordinates to grabber */
|
||||
pt.x = LOWORD (xevent->lParam);
|
||||
pt.y = HIWORD (xevent->lParam);
|
||||
ClientToScreen (xevent->hwnd, &pt);
|
||||
ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
|
||||
event->button.x = pt.x;
|
||||
event->button.y = pt.y;
|
||||
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
|
||||
}
|
||||
else
|
||||
{
|
||||
event->button.x = LOWORD (xevent->lParam);
|
||||
event->button.y = HIWORD (xevent->lParam);
|
||||
}
|
||||
if (window != orig_window)
|
||||
translate_mouse_coords (orig_window, window, xevent);
|
||||
event->button.x = curX = LOWORD (xevent->lParam);
|
||||
event->button.y = curY = HIWORD (xevent->lParam);
|
||||
event->button.x_root = xevent->pt.x;
|
||||
event->button.y_root = xevent->pt.y;
|
||||
event->button.pressure = 0.5;
|
||||
event->button.xtilt = 0;
|
||||
event->button.ytilt = 0;
|
||||
event->button.state = 0;
|
||||
if (xevent->wParam & MK_CONTROL)
|
||||
event->button.state |= GDK_CONTROL_MASK;
|
||||
if (xevent->wParam & MK_LBUTTON)
|
||||
event->button.state |= GDK_BUTTON1_MASK;
|
||||
if (xevent->wParam & MK_MBUTTON)
|
||||
event->button.state |= GDK_BUTTON2_MASK;
|
||||
if (xevent->wParam & MK_RBUTTON)
|
||||
event->button.state |= GDK_BUTTON3_MASK;
|
||||
if (xevent->wParam & MK_SHIFT)
|
||||
event->button.state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_MENU) < 0)
|
||||
event->button.state |= GDK_MOD1_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
event->button.state |= GDK_LOCK_MASK;
|
||||
event->button.state = build_pointer_event_state (xevent);
|
||||
event->button.button = button;
|
||||
event->button.source = GDK_SOURCE_MOUSE;
|
||||
event->button.deviceid = GDK_CORE_POINTER;
|
||||
@ -4098,11 +4110,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
buttonup0:
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("WM_%cBUTTONUP: %#x x,y: %d %d button: %d\n",
|
||||
g_print ("WM_%cBUTTONUP: %#x (%d,%d)\n",
|
||||
" LMR"[button],
|
||||
xevent->hwnd,
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam),
|
||||
button));
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam)));
|
||||
|
||||
if (WINDOW_PRIVATE(window)->extension_events != 0
|
||||
&& gdk_input_ignore_core)
|
||||
@ -4118,9 +4129,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
if (!propagate (&window, xevent,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_release,
|
||||
mouse_propagate))
|
||||
break;
|
||||
doesnt_want_button_release))
|
||||
goto maybe_ungrab;
|
||||
event->button.window = window;
|
||||
#else
|
||||
buttonup:
|
||||
@ -4168,7 +4178,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
else
|
||||
{
|
||||
window = mouse_propagate (window, xevent);
|
||||
window = pointer_propagate (window, xevent);
|
||||
/* Jump back up */
|
||||
goto buttonup;
|
||||
}
|
||||
@ -4179,43 +4189,16 @@ gdk_event_translate (GdkEvent *event,
|
||||
g_assert (event->button.window == window);
|
||||
#endif
|
||||
event->button.time = xevent->time;
|
||||
if (window == p_grab_window
|
||||
&& p_grab_window != orig_window)
|
||||
{
|
||||
/* Translate coordinates to grabber */
|
||||
pt.x = LOWORD (xevent->lParam);
|
||||
pt.y = HIWORD (xevent->lParam);
|
||||
ClientToScreen (xevent->hwnd, &pt);
|
||||
ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
|
||||
event->button.x = pt.x;
|
||||
event->button.y = pt.y;
|
||||
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
|
||||
}
|
||||
else
|
||||
{
|
||||
event->button.x = LOWORD (xevent->lParam);
|
||||
event->button.y = HIWORD (xevent->lParam);
|
||||
}
|
||||
if (window != orig_window)
|
||||
translate_mouse_coords (orig_window, window, xevent);
|
||||
event->button.x = LOWORD (xevent->lParam);
|
||||
event->button.y = HIWORD (xevent->lParam);
|
||||
event->button.x_root = xevent->pt.x;
|
||||
event->button.y_root = xevent->pt.y;
|
||||
event->button.pressure = 0.5;
|
||||
event->button.xtilt = 0;
|
||||
event->button.ytilt = 0;
|
||||
event->button.state = 0;
|
||||
if (xevent->wParam & MK_CONTROL)
|
||||
event->button.state |= GDK_CONTROL_MASK;
|
||||
if (xevent->wParam & MK_LBUTTON)
|
||||
event->button.state |= GDK_BUTTON1_MASK;
|
||||
if (xevent->wParam & MK_MBUTTON)
|
||||
event->button.state |= GDK_BUTTON2_MASK;
|
||||
if (xevent->wParam & MK_RBUTTON)
|
||||
event->button.state |= GDK_BUTTON3_MASK;
|
||||
if (xevent->wParam & MK_SHIFT)
|
||||
event->button.state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_MENU) < 0)
|
||||
event->button.state |= GDK_MOD1_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
event->button.state |= GDK_LOCK_MASK;
|
||||
event->button.state = build_pointer_event_state (xevent);
|
||||
event->button.button = button;
|
||||
event->button.source = GDK_SOURCE_MOUSE;
|
||||
event->button.deviceid = GDK_CORE_POINTER;
|
||||
@ -4231,12 +4214,20 @@ gdk_event_translate (GdkEvent *event,
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print ("WM_MOUSEMOVE: %#x %#x +%d+%d\n",
|
||||
g_print ("WM_MOUSEMOVE: %#x %#x (%d,%d)\n",
|
||||
xevent->hwnd, xevent->wParam,
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam)));
|
||||
|
||||
/* HB: only process mouse move messages if we own the active window. */
|
||||
/* If we haven't moved, don't create any event.
|
||||
* Windows sends WM_MOUSEMOVE messages after button presses
|
||||
* even if the mouse doesn't move. This disturbs gtk.
|
||||
*/
|
||||
if (window == curWnd
|
||||
&& LOWORD (xevent->lParam) == curX
|
||||
&& HIWORD (xevent->lParam) == curY)
|
||||
break;
|
||||
|
||||
/* HB: only process mouse move messages if we own the active window. */
|
||||
GetWindowThreadProcessId(GetActiveWindow(), &pidActWin);
|
||||
GetWindowThreadProcessId(xevent->hwnd, &pidThis);
|
||||
if (pidActWin != pidThis)
|
||||
@ -4256,8 +4247,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
#ifdef NEW_PROPAGATION_CODE
|
||||
if (!propagate (&window, xevent,
|
||||
p_grab_window, p_grab_owner_events, p_grab_mask,
|
||||
doesnt_want_button_motion,
|
||||
mouse_propagate))
|
||||
doesnt_want_button_motion))
|
||||
break;
|
||||
event->motion.window = window;
|
||||
#else
|
||||
@ -4330,7 +4320,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
else
|
||||
{
|
||||
window = mouse_propagate (window, xevent);
|
||||
window = pointer_propagate (window, xevent);
|
||||
/* Jump back up */
|
||||
goto mousemotion;
|
||||
}
|
||||
@ -4339,23 +4329,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
event->motion.window = window;
|
||||
#endif
|
||||
event->motion.time = xevent->time;
|
||||
if (window == p_grab_window
|
||||
&& p_grab_window != orig_window)
|
||||
{
|
||||
/* Translate coordinates to grabber */
|
||||
pt.x = curX = LOWORD (xevent->lParam);
|
||||
pt.y = curY = HIWORD (xevent->lParam);
|
||||
ClientToScreen (xevent->hwnd, &pt);
|
||||
ScreenToClient (GDK_DRAWABLE_XID (p_grab_window), &pt);
|
||||
event->motion.x = pt.x;
|
||||
event->motion.y = pt.y;
|
||||
GDK_NOTE (EVENTS, g_print ("...new coords are +%d+%d\n", pt.x, pt.y));
|
||||
}
|
||||
else
|
||||
{
|
||||
event->motion.x = curX = LOWORD (xevent->lParam);
|
||||
event->motion.y = curY = HIWORD (xevent->lParam);
|
||||
}
|
||||
if (window != orig_window)
|
||||
translate_mouse_coords (orig_window, window, xevent);
|
||||
event->motion.x = curX = LOWORD (xevent->lParam);
|
||||
event->motion.y = curY = HIWORD (xevent->lParam);
|
||||
event->motion.x_root = xevent->pt.x;
|
||||
event->motion.y_root = xevent->pt.y;
|
||||
curXroot = event->motion.x_root;
|
||||
@ -4363,25 +4340,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
event->motion.pressure = 0.5;
|
||||
event->motion.xtilt = 0;
|
||||
event->motion.ytilt = 0;
|
||||
event->button.state = 0;
|
||||
if (xevent->wParam & MK_CONTROL)
|
||||
event->button.state |= GDK_CONTROL_MASK;
|
||||
if (xevent->wParam & MK_LBUTTON)
|
||||
event->button.state |= GDK_BUTTON1_MASK;
|
||||
if (xevent->wParam & MK_MBUTTON)
|
||||
event->button.state |= GDK_BUTTON2_MASK;
|
||||
if (xevent->wParam & MK_RBUTTON)
|
||||
event->button.state |= GDK_BUTTON3_MASK;
|
||||
if (xevent->wParam & MK_SHIFT)
|
||||
event->button.state |= GDK_SHIFT_MASK;
|
||||
if (GetKeyState (VK_MENU) < 0)
|
||||
event->button.state |= GDK_MOD1_MASK;
|
||||
if (GetKeyState (VK_CAPITAL) & 0x1)
|
||||
event->button.state |= GDK_LOCK_MASK;
|
||||
if (mask & GDK_POINTER_MOTION_HINT_MASK)
|
||||
event->motion.is_hint = NotifyHint;
|
||||
else
|
||||
event->motion.is_hint = NotifyNormal;
|
||||
event->motion.state = build_pointer_event_state (xevent);
|
||||
event->motion.is_hint = FALSE;
|
||||
event->motion.source = GDK_SOURCE_MOUSE;
|
||||
event->motion.deviceid = GDK_CORE_POINTER;
|
||||
|
||||
@ -4788,7 +4748,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
break;
|
||||
|
||||
case WM_MOVE:
|
||||
GDK_NOTE (EVENTS, g_print ("WM_MOVE: %#x +%d+%d\n",
|
||||
GDK_NOTE (EVENTS, g_print ("WM_MOVE: %#x (%d,%d)\n",
|
||||
xevent->hwnd,
|
||||
LOWORD (xevent->lParam), HIWORD (xevent->lParam)));
|
||||
|
||||
|
@ -451,7 +451,11 @@ gdk_font_load_internal (GdkFontType type,
|
||||
GdkFont*
|
||||
gdk_font_load (const gchar *font_name)
|
||||
{
|
||||
return gdk_font_load_internal (GDK_FONT_FONT, font_name);
|
||||
/* Load all fonts as fontsets... Gtktext and gtkentry work better
|
||||
* that way, they use wide chars, which is necessary for non-ASCII
|
||||
* chars to work. (Yes, even Latin-1, as we use Unicode internally.)
|
||||
*/
|
||||
return gdk_font_load_internal (GDK_FONT_FONTSET, font_name);
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
|
@ -451,7 +451,11 @@ gdk_font_load_internal (GdkFontType type,
|
||||
GdkFont*
|
||||
gdk_font_load (const gchar *font_name)
|
||||
{
|
||||
return gdk_font_load_internal (GDK_FONT_FONT, font_name);
|
||||
/* Load all fonts as fontsets... Gtktext and gtkentry work better
|
||||
* that way, they use wide chars, which is necessary for non-ASCII
|
||||
* chars to work. (Yes, even Latin-1, as we use Unicode internally.)
|
||||
*/
|
||||
return gdk_font_load_internal (GDK_FONT_FONTSET, font_name);
|
||||
}
|
||||
|
||||
GdkFont*
|
||||
|
@ -48,5 +48,4 @@ gint gdk_null_window_warnings = TRUE;
|
||||
|
||||
GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
|
||||
|
||||
BOOL (WINAPI *p_TrackMouseEvent) (TRACKMOUSEEVENT *tme) = NULL;
|
||||
|
||||
PFN_TrackMouseEvent p_TrackMouseEvent = NULL;
|
||||
|
@ -48,5 +48,4 @@ gint gdk_null_window_warnings = TRUE;
|
||||
|
||||
GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
|
||||
|
||||
BOOL (WINAPI *p_TrackMouseEvent) (TRACKMOUSEEVENT *tme) = NULL;
|
||||
|
||||
PFN_TrackMouseEvent p_TrackMouseEvent = NULL;
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#define STRICT /* We want strict type checks */
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
/* Make up for some minor mingw32 lossage */
|
||||
|
||||
@ -113,10 +114,6 @@ typedef int Status;
|
||||
#define AllocNone 0
|
||||
#define AllocAll 1
|
||||
|
||||
/* Notify modes */
|
||||
#define NotifyNormal 0
|
||||
#define NotifyHint 1
|
||||
|
||||
/* Some structs are somewhat useful to emulate internally, just to
|
||||
keep the code less #ifdefed. */
|
||||
typedef struct {
|
||||
@ -422,7 +419,9 @@ extern UINT gdk_selection_clear_msg;
|
||||
extern GdkAtom gdk_clipboard_atom;
|
||||
extern GdkAtom gdk_win32_dropfiles_atom;
|
||||
extern GdkAtom gdk_ole2_dnd_atom;
|
||||
extern BOOL (WINAPI *p_TrackMouseEvent) (TRACKMOUSEEVENT *tme);
|
||||
|
||||
typedef BOOL (WINAPI *PFN_TrackMouseEvent) (LPTRACKMOUSEEVENT);
|
||||
extern PFN_TrackMouseEvent p_TrackMouseEvent;
|
||||
|
||||
extern LRESULT CALLBACK gdk_WindowProc (HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#define STRICT /* We want strict type checks */
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
/* Make up for some minor mingw32 lossage */
|
||||
|
||||
@ -113,10 +114,6 @@ typedef int Status;
|
||||
#define AllocNone 0
|
||||
#define AllocAll 1
|
||||
|
||||
/* Notify modes */
|
||||
#define NotifyNormal 0
|
||||
#define NotifyHint 1
|
||||
|
||||
/* Some structs are somewhat useful to emulate internally, just to
|
||||
keep the code less #ifdefed. */
|
||||
typedef struct {
|
||||
@ -422,7 +419,9 @@ extern UINT gdk_selection_clear_msg;
|
||||
extern GdkAtom gdk_clipboard_atom;
|
||||
extern GdkAtom gdk_win32_dropfiles_atom;
|
||||
extern GdkAtom gdk_ole2_dnd_atom;
|
||||
extern BOOL (WINAPI *p_TrackMouseEvent) (TRACKMOUSEEVENT *tme);
|
||||
|
||||
typedef BOOL (WINAPI *PFN_TrackMouseEvent) (LPTRACKMOUSEEVENT);
|
||||
extern PFN_TrackMouseEvent p_TrackMouseEvent;
|
||||
|
||||
extern LRESULT CALLBACK gdk_WindowProc (HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
@ -421,10 +421,11 @@ gdk_window_new (GdkWindow *parent,
|
||||
TCI_SRCCODEPAGE);
|
||||
|
||||
titlelen = strlen (title);
|
||||
wctitle = g_new (wchar_t, titlelen);
|
||||
wctitle = g_new (wchar_t, titlelen + 1);
|
||||
mbtitle = g_new (char, 3*titlelen + 1);
|
||||
wlen = gdk_nmbstowchar_ts (wctitle, title, titlelen, titlelen);
|
||||
WideCharToMultiByte (GetACP (), 0, wctitle, wlen,
|
||||
wctitle[wlen] = 0;
|
||||
WideCharToMultiByte (GetACP (), 0, wctitle, -1,
|
||||
mbtitle, 3*titlelen, NULL, NULL);
|
||||
|
||||
private->drawable.xwindow =
|
||||
@ -439,6 +440,21 @@ gdk_window_new (GdkWindow *parent,
|
||||
gdk_ProgInstance,
|
||||
NULL);
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_print ("gdk_window_create: %s %s %dx%d@+%d+%d %#x = %#x\n"
|
||||
"...locale %#x codepage %d\n",
|
||||
(private->drawable.window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
|
||||
(private->drawable.window_type == GDK_WINDOW_CHILD ? "CHILD" :
|
||||
(private->drawable.window_type == GDK_WINDOW_DIALOG ? "DIALOG" :
|
||||
(private->drawable.window_type == GDK_WINDOW_TEMP ? "TEMP" :
|
||||
"???")))),
|
||||
mbtitle,
|
||||
width, height, (x == CW_USEDEFAULT ? -9999 : x), y,
|
||||
xparent,
|
||||
private->drawable.xwindow,
|
||||
private->input_locale,
|
||||
private->charset_info.ciACP));
|
||||
|
||||
g_free (mbtitle);
|
||||
g_free (wctitle);
|
||||
|
||||
@ -449,21 +465,6 @@ gdk_window_new (GdkWindow *parent,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_print ("gdk_window_create: %s %s %dx%d@+%d+%d %#x = %#x\n"
|
||||
"...locale %#x codepage %d\n",
|
||||
(private->drawable.window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
|
||||
(private->drawable.window_type == GDK_WINDOW_CHILD ? "CHILD" :
|
||||
(private->drawable.window_type == GDK_WINDOW_DIALOG ? "DIALOG" :
|
||||
(private->drawable.window_type == GDK_WINDOW_TEMP ? "TEMP" :
|
||||
"???")))),
|
||||
title,
|
||||
width, height, (x == CW_USEDEFAULT ? -9999 : x), y,
|
||||
xparent,
|
||||
private->drawable.xwindow,
|
||||
private->input_locale,
|
||||
private->charset_info.ciACP));
|
||||
|
||||
gdk_window_ref (window);
|
||||
gdk_xid_table_insert (&private->drawable.xwindow, window);
|
||||
|
||||
@ -1413,10 +1414,11 @@ gdk_window_set_title (GdkWindow *window,
|
||||
* to the system codepage.
|
||||
*/
|
||||
titlelen = strlen (title);
|
||||
wcstr = g_new (wchar_t, titlelen);
|
||||
wcstr = g_new (wchar_t, titlelen + 1);
|
||||
mbstr = g_new (char, 3*titlelen + 1);
|
||||
wlen = gdk_nmbstowchar_ts (wcstr, title, titlelen, titlelen);
|
||||
WideCharToMultiByte (GetACP (), 0, wcstr, wlen,
|
||||
wcstr[wlen] = 0;
|
||||
WideCharToMultiByte (GetACP (), 0, wcstr, -1,
|
||||
mbstr, 3*titlelen, NULL, NULL);
|
||||
|
||||
if (!SetWindowText (GDK_DRAWABLE_XID (window), mbstr))
|
||||
|
@ -421,10 +421,11 @@ gdk_window_new (GdkWindow *parent,
|
||||
TCI_SRCCODEPAGE);
|
||||
|
||||
titlelen = strlen (title);
|
||||
wctitle = g_new (wchar_t, titlelen);
|
||||
wctitle = g_new (wchar_t, titlelen + 1);
|
||||
mbtitle = g_new (char, 3*titlelen + 1);
|
||||
wlen = gdk_nmbstowchar_ts (wctitle, title, titlelen, titlelen);
|
||||
WideCharToMultiByte (GetACP (), 0, wctitle, wlen,
|
||||
wctitle[wlen] = 0;
|
||||
WideCharToMultiByte (GetACP (), 0, wctitle, -1,
|
||||
mbtitle, 3*titlelen, NULL, NULL);
|
||||
|
||||
private->drawable.xwindow =
|
||||
@ -439,6 +440,21 @@ gdk_window_new (GdkWindow *parent,
|
||||
gdk_ProgInstance,
|
||||
NULL);
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_print ("gdk_window_create: %s %s %dx%d@+%d+%d %#x = %#x\n"
|
||||
"...locale %#x codepage %d\n",
|
||||
(private->drawable.window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
|
||||
(private->drawable.window_type == GDK_WINDOW_CHILD ? "CHILD" :
|
||||
(private->drawable.window_type == GDK_WINDOW_DIALOG ? "DIALOG" :
|
||||
(private->drawable.window_type == GDK_WINDOW_TEMP ? "TEMP" :
|
||||
"???")))),
|
||||
mbtitle,
|
||||
width, height, (x == CW_USEDEFAULT ? -9999 : x), y,
|
||||
xparent,
|
||||
private->drawable.xwindow,
|
||||
private->input_locale,
|
||||
private->charset_info.ciACP));
|
||||
|
||||
g_free (mbtitle);
|
||||
g_free (wctitle);
|
||||
|
||||
@ -449,21 +465,6 @@ gdk_window_new (GdkWindow *parent,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_print ("gdk_window_create: %s %s %dx%d@+%d+%d %#x = %#x\n"
|
||||
"...locale %#x codepage %d\n",
|
||||
(private->drawable.window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" :
|
||||
(private->drawable.window_type == GDK_WINDOW_CHILD ? "CHILD" :
|
||||
(private->drawable.window_type == GDK_WINDOW_DIALOG ? "DIALOG" :
|
||||
(private->drawable.window_type == GDK_WINDOW_TEMP ? "TEMP" :
|
||||
"???")))),
|
||||
title,
|
||||
width, height, (x == CW_USEDEFAULT ? -9999 : x), y,
|
||||
xparent,
|
||||
private->drawable.xwindow,
|
||||
private->input_locale,
|
||||
private->charset_info.ciACP));
|
||||
|
||||
gdk_window_ref (window);
|
||||
gdk_xid_table_insert (&private->drawable.xwindow, window);
|
||||
|
||||
@ -1413,10 +1414,11 @@ gdk_window_set_title (GdkWindow *window,
|
||||
* to the system codepage.
|
||||
*/
|
||||
titlelen = strlen (title);
|
||||
wcstr = g_new (wchar_t, titlelen);
|
||||
wcstr = g_new (wchar_t, titlelen + 1);
|
||||
mbstr = g_new (char, 3*titlelen + 1);
|
||||
wlen = gdk_nmbstowchar_ts (wcstr, title, titlelen, titlelen);
|
||||
WideCharToMultiByte (GetACP (), 0, wcstr, wlen,
|
||||
wcstr[wlen] = 0;
|
||||
WideCharToMultiByte (GetACP (), 0, wcstr, -1,
|
||||
mbstr, 3*titlelen, NULL, NULL);
|
||||
|
||||
if (!SetWindowText (GDK_DRAWABLE_XID (window), mbstr))
|
||||
|
@ -40,7 +40,6 @@ gdk_OBJECTS = \
|
||||
gdk.o \
|
||||
gdkcc.o \
|
||||
gdkcolor.o \
|
||||
gdkcompat.o \
|
||||
gdkcursor.o \
|
||||
gdkdnd.o \
|
||||
gdkdraw.o \
|
||||
|
@ -15,11 +15,11 @@ WTKIT = ..\..\..\wtkit126
|
||||
!IFNDEF DEBUG
|
||||
# Full optimization:
|
||||
OPTIMIZE = -Ox -MD
|
||||
LINKDEBUG =
|
||||
LINKDEBUG = /nodefaultlib:libc.lib
|
||||
!ELSE
|
||||
# Debugging:
|
||||
OPTIMIZE = -Zi -MDd
|
||||
LINKDEBUG = /debug
|
||||
LINKDEBUG = /defaultlib:libcd.lib /debug
|
||||
!ENDIF
|
||||
|
||||
# cl -? describes the options
|
||||
@ -47,7 +47,6 @@ gdk_OBJECTS = \
|
||||
gdk.obj \
|
||||
gdkcc.obj \
|
||||
gdkcolor.obj \
|
||||
gdkcompat.obj \
|
||||
gdkcursor.obj \
|
||||
gdkdnd.obj \
|
||||
gdkdraw.obj \
|
||||
|
@ -468,7 +468,7 @@ gtk_rc_init (void)
|
||||
gint n_locale_suffixes = 0;
|
||||
gint i, j;
|
||||
#ifdef G_OS_WIN32
|
||||
char *locale = gwin_getlocale ();
|
||||
char *locale = g_win32_getlocale ();
|
||||
#else
|
||||
#ifdef HAVE_LC_MESSAGES
|
||||
char *locale = setlocale (LC_MESSAGES, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user