Commit 1c84483f authored by Tor Lillqvist's avatar Tor Lillqvist

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.
parent eedec945
1999-04-25 Tor Lillqvist <tml@iki.fi>
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.
Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com>
* gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
......
1999-04-25 Tor Lillqvist <tml@iki.fi>
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.
Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com>
* gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
......
1999-04-25 Tor Lillqvist <tml@iki.fi>
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.
Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com>
* gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
......
1999-04-25 Tor Lillqvist <tml@iki.fi>
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.
Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com>
* gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
......
1999-04-25 Tor Lillqvist <tml@iki.fi>
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.
Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com>
* gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
......
1999-04-25 Tor Lillqvist <tml@iki.fi>
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.
Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com>
* gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
......
1999-04-25 Tor Lillqvist <tml@iki.fi>
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.
Wed Apr 21 14:20:22 1999 George Lebl <jirka@5z.com>
* gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
......
......@@ -3,12 +3,15 @@ correct as the Unix/X11 version. For more information about the Win32
port, see http://www.gimp.org/tml/gimp/win32/ or
http://www.iki.fi/tml/gimp/win32/ .
As for now, only Microsoft C (the command-line compiler) is
supported. Before compiling, check the BIN definition in
gdk\win32\makefile.msc and gtk\makefile.msc. Compile in gdk\win32 and
gtk with `nmake -f makefile.msc`. Install with `nmake -f makefile.msc
install`. Cygwin ("mingw32", i.e. gcc -mno-cygwin) support will be
added later.
To build GTk+ on Win32, you need either Microsoft compiler and tools,
or egcs-1.1.2 running under cygwin-b20.1. Before compiling, check the
BIN definition in gdk\win32\makefile.msc (or makefile.cygwin) and
gtk\makefile.msc (or makefile.cygwin). Compile in gdk\win32 and gtk
with `nmake -f makefile.msc` or `make -f makefile.cygwin`.
See the README.win32 file in the GLib distribution for preparations to
build with egcs on cygwin.
The tablet support uses the Wintab API. The Wintab development kit can
be downloaded from http://www.pointing.com.
/* config.h.win32. Handcrafted for Microsoft C */
#ifndef _MSC_VER
#if ! (defined(_MSC_VER) || defined(__GNUC__))
#error Unrecognized Win32 compiler, edit config.h.win32 by hand
#endif
......@@ -16,7 +16,11 @@
/* Define if you have alloca, as a function or macro. */
#define HAVE_ALLOCA 1
#ifdef _MSC_VER
#define alloca _alloca
#elif defined (__GNUC__)
#define alloca __builtin_alloca
#endif
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
......@@ -121,7 +125,7 @@
/* Define if you have the strcasecmp function. */
#define HAVE_STRCASECMP 1
#define strcasecmp stricmp
#define strcasecmp _stricmp
/* Define if you have the strchr function. */
#define HAVE_STRCHR 1
......@@ -166,7 +170,9 @@
#define HAVE_WCHAR_H 1
/* Define if you have the <wctype.h> header file. */
#ifdef _MSC_VER
#define HAVE_WCTYPE_H 1
#endif /* _MSC_VER */
/* Define if you have the i library (-li). */
/* #undef HAVE_LIBI */
......
......@@ -24,7 +24,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdk.h"
#include <gdk/gdk.h>
......
......@@ -33,10 +33,6 @@
#include "gdkx.h"
#ifdef _MSC_VER
#define strcasecmp stricmp
#endif
static gint gdk_colormap_match_color (GdkColormap *cmap,
GdkColor *color,
const gchar *available);
......
......@@ -33,10 +33,6 @@
#include "gdkx.h"
#ifdef _MSC_VER
#define strcasecmp stricmp
#endif
static gint gdk_colormap_match_color (GdkColormap *cmap,
GdkColor *color,
const gchar *available);
......
......@@ -2,4 +2,6 @@
#define GDK_WINDOWING GDK_WINDOWING_WIN32
#define GDK_HAVE_WCHAR_H 1
#ifdef _MSC_VER
#define GDK_HAVE_WCTYPE_H 1
#endif
......@@ -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)
......
......@@ -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)
......
......@@ -1547,7 +1547,7 @@ gdk_event_translate (GdkEvent *event,
is_AltGr_key = FALSE;
event->key.type = ((xevent->message == WM_KEYDOWN
| xevent->message == WM_SYSKEYDOWN) ?
|| xevent->message == WM_SYSKEYDOWN) ?
GDK_KEY_PRESS : GDK_KEY_RELEASE);
event->key.window = window;
event->key.time = xevent->time;
......
......@@ -1547,7 +1547,7 @@ gdk_event_translate (GdkEvent *event,
is_AltGr_key = FALSE;
event->key.type = ((xevent->message == WM_KEYDOWN
| xevent->message == WM_SYSKEYDOWN) ?
|| xevent->message == WM_SYSKEYDOWN) ?
GDK_KEY_PRESS : GDK_KEY_RELEASE);
event->key.window = window;
event->key.time = xevent->time;
......
......@@ -31,7 +31,7 @@
guint gdk_debug_flags = 0;
HWND gdk_root_window;
HWND gdk_leader_window;
GdkWindowPrivate gdk_root_parent = { { NULL, }, NULL, };
GDKVAR GdkWindowPrivate gdk_root_parent = { { NULL, }, NULL, };
HDC gdk_DC;
HINSTANCE gdk_DLLInstance;
HINSTANCE gdk_ProgInstance;
......
......@@ -31,7 +31,7 @@
guint gdk_debug_flags = 0;
HWND gdk_root_window;
HWND gdk_leader_window;
GdkWindowPrivate gdk_root_parent = { { NULL, }, NULL, };
GDKVAR GdkWindowPrivate gdk_root_parent = { { NULL, }, NULL, };
HDC gdk_DC;
HINSTANCE gdk_DLLInstance;
HINSTANCE gdk_ProgInstance;
......
......@@ -26,11 +26,11 @@
#if HAVE_CONFIG_H
# include <config.h>
# if STDC_HEADERS
# include <string.h>
# endif
#endif
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <gdk/gdki18n.h>
#include "gdkx.h"
......@@ -172,10 +172,10 @@ gdk_wcstombs (const GdkWChar *src)
src_alt = g_new (wchar_t, wcsl+1);
for (i = wcsl; i >= 0; i--)
src_alt[i] = src[i];
mbsl = WideCharToMultiByte (CP_ACP, 0, src_alt, wcsl,
mbsl = WideCharToMultiByte (CP_OEMCP, 0, src_alt, wcsl,
NULL, 0, NULL, NULL);
mbstr = g_new (guchar, mbsl + 1);
if (!WideCharToMultiByte (CP_ACP, 0, src_alt, wcsl,
if (!WideCharToMultiByte (CP_OEMCP, 0, src_alt, wcsl,
mbstr, mbsl, NULL, NULL))
{
g_warning ("gdk_wcstombs: WideCharToMultiByte failed");
......@@ -219,9 +219,9 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
gint i, wcsl;
wchar_t *wcstr;
wcsl = MultiByteToWideChar (CP_ACP, 0, src, -1, NULL, 0);
wcstr = g_new (wchar_t, wcsl + 1);
if (!MultiByteToWideChar (CP_ACP, 0, src, -1, wcstr, wcsl))
wcsl = MultiByteToWideChar (CP_OEMCP, 0, src, -1, NULL, 0);
wcstr = g_new (wchar_t, wcsl);
if (!MultiByteToWideChar (CP_OEMCP, 0, src, -1, wcstr, wcsl))
{
g_warning ("gdk_mbstowcs: MultiByteToWideChar failed");
g_free (wcstr);
......@@ -229,11 +229,11 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
}
if (wcsl > dest_max)
wcsl = dest_max;
for (i = 0; i < wcsl; i++)
for (i = 0; i < wcsl && wcstr[i]; i++)
dest[i] = wcstr[i];
g_free (wcstr);
return wcsl;
return i;
}
else
{
......
......@@ -26,11 +26,11 @@
#if HAVE_CONFIG_H
# include <config.h>
# if STDC_HEADERS
# include <string.h>
# endif
#endif
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <gdk/gdki18n.h>
#include "gdkx.h"
......@@ -172,10 +172,10 @@ gdk_wcstombs (const GdkWChar *src)
src_alt = g_new (wchar_t, wcsl+1);
for (i = wcsl; i >= 0; i--)
src_alt[i] = src[i];
mbsl = WideCharToMultiByte (CP_ACP, 0, src_alt, wcsl,
mbsl = WideCharToMultiByte (CP_OEMCP, 0, src_alt, wcsl,