summaryrefslogtreecommitdiff
path: root/gdk/win32/gdkdnd-win32.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@src.gnome.org>1999-04-25 21:55:05 +0000
committerTor Lillqvist <tml@src.gnome.org>1999-04-25 21:55:05 +0000
commit1c84483f3ee8559179b49a200d3cc6854e81b873 (patch)
tree5cf6ca83caba4ca5939841987f95262cac4b5fa7 /gdk/win32/gdkdnd-win32.c
parenteedec945df8925c97e924692b08487a292c01580 (diff)
downloadgtk+-1c84483f3ee8559179b49a200d3cc6854e81b873.tar.gz
Support added for building using a GNU toolchain on Win32,
gcc -mno-cygwin (egcs-1.1.2) on cygwin-b20.1. * gdk/win32/makefile.cygwin gtk/makefile.cygwin: New files. * config.h.win32: Changes for gcc. * gdk/gdkrectangle.c: Include gdk.h as <gdk/gdk.h>. * gdk/gdkcolor.c: config.h.win32 already defines strcasecmp. * gdk/win32/gdkconfig.h: Only the MS compiler has wctype.h. * gdk/win32/gdkdnd.c: Protect (unused) OLE2 stuff better. Protect shl stuff unavaiilable with mingw32 headers. * gdk/win32/gdkevents.c: Fix typo. * gdk/win32/gdkglobals.c: Use GDKVAR here also for gcc. * gdk/win32/gdkim.c: Use OEM code page for multibyte chars. (?) * gdk/win32/gdkinput.c: Use __try __except only with the MS compiler. * gdk/win32/gdkprivate.h: Make up for some stuff missing from the mingw32 headers. * gdk/win32/makefile.msc: Use latest Wintab kit and glib. * gtk/gtkfilesel.c: Include <glib.h> early, to get stat->_stat definition on Win32. Test for NATIVE_WIN32, not _MSC_VER. * gtk/gtkfontsel.c: Protect CHARSET redefinition on Win32. Test for NATIVE_WIN32, not _MSC_VER. * gtk/gtkmain.c: No use warning about developer version on Win32, there aren't any non-developer versions anyhow. * gtk/gtkrc.c: Test for NATIVE_WIN32, not _MSC_VER. * gtk/makefile.msc: Use pthread from another directory. Minor other changes.
Diffstat (limited to 'gdk/win32/gdkdnd-win32.c')
-rw-r--r--gdk/win32/gdkdnd-win32.c46
1 files changed, 30 insertions, 16 deletions
diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c
index 316d411b98..4ea435441e 100644
--- a/gdk/win32/gdkdnd-win32.c
+++ b/gdk/win32/gdkdnd-win32.c
@@ -31,9 +31,14 @@
#include <string.h>
+#ifdef OLE2_DND
#include <ole2.h>
+#endif
+
+#ifdef _MSC_VER
#include <shlobj.h>
#include <shlguid.h>
+#endif
#include <gdk/gdk.h>
#include "gdkx.h"
@@ -143,7 +148,7 @@ gdk_drag_context_new (void)
return (GdkDragContext *)result;
}
-#if OLE2_DND
+#ifdef OLE2_DND
typedef struct {
IDropTarget idt;
@@ -265,7 +270,7 @@ m_drop (IDropTarget __RPC_FAR *This,
GDK_NOTE (DND, g_print ("m_drop\n"));
return E_UNEXPECTED;
}
-
+
HRESULT STDMETHODCALLTYPE
m_query_interface_source (IDropSource __RPC_FAR *This,
/* [in] */ REFIID riid,
@@ -408,7 +413,7 @@ source_context_new (void)
#endif /* OLE2_DND */
-void
+void
gdk_drag_context_ref (GdkDragContext *context)
{
g_return_if_fail (context != NULL);
@@ -416,7 +421,7 @@ gdk_drag_context_ref (GdkDragContext *context)
((GdkDragContextPrivate *)context)->ref_count++;
}
-void
+void
gdk_drag_context_unref (GdkDragContext *context)
{
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
@@ -475,6 +480,8 @@ gdk_drag_context_find (gboolean is_source,
#endif
+#ifdef _MSC_VER
+
/* From MS Knowledge Base article Q130698 */
/* resolve_link() fills the filename and path buffer
@@ -564,6 +571,12 @@ resolve_link(HWND hWnd,
return SUCCEEDED (hres);
}
+#else
+
+#define resolve_link(hWnd, lpszLinkName, lpszPath, lpszDescription) FALSE
+
+#endif
+
static GdkFilterReturn
gdk_dropfiles_filter (GdkXEvent *xev,
GdkEvent *event,
@@ -642,7 +655,6 @@ gdk_dropfiles_filter (GdkXEvent *xev,
else
return GDK_FILTER_CONTINUE;
}
-
/*************************************************************
************************** Public API ***********************
@@ -652,17 +664,20 @@ void
gdk_dnd_init (void)
{
HRESULT hres;
-
+#ifdef OLE2_DND
hres = OleInitialize (NULL);
if (! SUCCEEDED (hres))
g_error ("OleInitialize failed");
-}
+#endif
+}
void
gdk_dnd_exit (void)
{
+#ifdef OLE2_DND
OleUninitialize ();
+#endif
}
/* Source side */
@@ -747,7 +762,7 @@ gdk_drag_find_window (GdkDragContext *context,
}
}
-gboolean
+gboolean
gdk_drag_motion (GdkDragContext *context,
GdkWindow *dest_window,
GdkDragProtocol protocol,
@@ -780,7 +795,7 @@ gdk_drag_abort (GdkDragContext *context,
/* Destination side */
-void
+void
gdk_drag_status (GdkDragContext *context,
GdkDragAction action,
guint32 time)
@@ -795,19 +810,18 @@ gdk_drop_reply (GdkDragContext *context,
{
}
-void
+void
gdk_drop_finish (GdkDragContext *context,
gboolean success,
guint32 time)
{
}
-
-void
+void
gdk_window_register_dnd (GdkWindow *window)
{
GdkWindowPrivate *private = (GdkWindowPrivate *) window;
-#if OLE2_DND
+#ifdef OLE2_DND
target_drag_context *context;
HRESULT hres;
#endif
@@ -824,7 +838,7 @@ gdk_window_register_dnd (GdkWindow *window)
gdk_window_add_filter (window, gdk_dropfiles_filter, NULL);
DragAcceptFiles (private->xwindow, TRUE);
-#if OLE2_DND
+#ifdef OLE2_DND
/* Register for OLE2 d&d */
context = target_context_new ();
hres = CoLockObjectExternal ((IUnknown *) &context->idt, TRUE, FALSE);
@@ -848,11 +862,11 @@ gdk_window_register_dnd (GdkWindow *window)
* gdk_drag_get_selection:
* Returns the selection atom for the current source window
* arguments:
- *
+ *
* results:
*************************************************************/
-GdkAtom
+GdkAtom
gdk_drag_get_selection (GdkDragContext *context)
{
if (context->protocol == GDK_DRAG_PROTO_WIN32_DROPFILES)