gtk+ r20994 - in trunk: . gdk/win32
- From: tml svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r20994 - in trunk: . gdk/win32
- Date: Mon, 4 Aug 2008 23:21:36 +0000 (UTC)
Author: tml
Date: Mon Aug 4 23:21:36 2008
New Revision: 20994
URL: http://svn.gnome.org/viewvc/gtk+?rev=20994&view=rev
Log:
2008-08-05 Tor Lillqvist <tml novell com>
Bug 544684 - Win64 issue, window handles are assumed to be 32-bit
* gdk/win32/gdkcursor-win32.c
* gdk/win32/xcursors.h: Change some gchar* to guchar* and vice
versa to avoid gcc 4.4 signedness warnings.
* gdk/win32/gdkevents-win32.c: Add some guchar and char pointer
casts to get rid of gcc 4.4 signedness warnings. Print GdkAtom
values in debugging output using the %p format.
* gdk/win32/gdkkeys-win32.c
* gdk/win32/gdkfont-win32.c
* gdk/win32/gdkmain-win32.c: Add some casts to avoid gcc warnings.
* gdk/win32/gdkwindow-win32.c: Use SetWindowLongPtr() instead of
SetWindowLong().
* gdk/win32/gdkwin32id.c (gdk_handle_hash): Use all 64 bits of a
HANDLE on Win64.
Modified:
trunk/ChangeLog
trunk/gdk/win32/gdkcursor-win32.c
trunk/gdk/win32/gdkevents-win32.c
trunk/gdk/win32/gdkfont-win32.c
trunk/gdk/win32/gdkkeys-win32.c
trunk/gdk/win32/gdkmain-win32.c
trunk/gdk/win32/gdkwin32id.c
trunk/gdk/win32/gdkwindow-win32.c
trunk/gdk/win32/xcursors.h
Modified: trunk/gdk/win32/gdkcursor-win32.c
==============================================================================
--- trunk/gdk/win32/gdkcursor-win32.c (original)
+++ trunk/gdk/win32/gdkcursor-win32.c Mon Aug 4 23:21:36 2008
@@ -429,7 +429,8 @@
RGBQUAD colors[2];
} bmi;
HDC hdc;
- gchar *pixels, *bits, buf[32];
+ guchar *pixels, *bits;
+ gchar buf[32];
gint rowstride, x, y, w, h;
if (!GDI_CALL (GetIconInfo, (hicon, &ii)))
Modified: trunk/gdk/win32/gdkevents-win32.c
==============================================================================
--- trunk/gdk/win32/gdkevents-win32.c (original)
+++ trunk/gdk/win32/gdkevents-win32.c Mon Aug 4 23:21:36 2008
@@ -292,8 +292,11 @@
retval = inner_window_procedure (hwnd, message, wparam, lparam);
debug_indent -= 2;
- GDK_NOTE (EVENTS, g_print (" => %ld%s",
- retval, (debug_indent == 0 ? "\n" : "")));
+#ifdef _WIN64
+ GDK_NOTE (EVENTS, g_print (" => %I64d%s", retval, (debug_indent == 0 ? "\n" : "")));
+#else
+ GDK_NOTE (EVENTS, g_print (" => %ld%s", retval, (debug_indent == 0 ? "\n" : "")));
+#endif
return retval;
}
@@ -2151,7 +2154,7 @@
/* XXX Handle WM_QUIT here ? */
if (msg->message == WM_QUIT)
{
- GDK_NOTE (EVENTS, g_print (" %d", msg->wParam));
+ GDK_NOTE (EVENTS, g_print (" %d", (int) msg->wParam));
exit (msg->wParam);
}
else if (msg->message == WM_MOVE ||
@@ -2265,9 +2268,9 @@
_gdk_input_codepage = atoi (buf);
_gdk_keymap_serial++;
GDK_NOTE (EVENTS,
- g_print (" cs:%lu hkl:%lx%s cp:%d",
+ g_print (" cs:%lu hkl:%p%s cp:%d",
(gulong) msg->wParam,
- msg->lParam, _gdk_input_locale_is_ime ? " (IME)" : "",
+ (gpointer) msg->lParam, _gdk_input_locale_is_ime ? " (IME)" : "",
_gdk_input_codepage));
break;
@@ -2276,7 +2279,7 @@
GDK_NOTE (EVENTS,
g_print (" %s ch:%.02x %s",
_gdk_win32_key_to_string (msg->lParam),
- msg->wParam,
+ (int) msg->wParam,
decode_key_lparam (msg->lParam)));
/* If posted without us having keyboard focus, ignore */
@@ -2301,7 +2304,7 @@
GDK_NOTE (EVENTS,
g_print (" %s ch:%.02x %s",
_gdk_win32_key_to_string (msg->lParam),
- msg->wParam,
+ (int) msg->wParam,
decode_key_lparam (msg->lParam)));
keyup_or_down:
@@ -2408,7 +2411,7 @@
* WM_IME_CHAR might work on NT4 or Win9x with ActiveIMM, but
* use WM_IME_COMPOSITION there, too, to simplify the code.
*/
- GDK_NOTE (EVENTS, g_print (" %#lx", msg->lParam));
+ GDK_NOTE (EVENTS, g_print (" %#lx", (long) msg->lParam));
if (!(msg->lParam & GCS_RESULTSTR))
break;
@@ -2590,8 +2593,8 @@
case WM_MOUSEMOVE:
GDK_NOTE (EVENTS,
- g_print (" %#x (%d,%d)",
- msg->wParam,
+ g_print (" %p (%d,%d)",
+ (gpointer) msg->wParam,
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
/* If we haven't moved, don't create any GDK event. Windows
@@ -2877,7 +2880,7 @@
break;
case WM_SHOWWINDOW:
- GDK_NOTE (EVENTS, g_print (" %d", msg->wParam));
+ GDK_NOTE (EVENTS, g_print (" %d", (int) msg->wParam));
if (!(((GdkWindowObject *) window)->event_mask & GDK_STRUCTURE_MASK))
break;
@@ -3410,7 +3413,7 @@
event->selection.selection = GDK_SELECTION_CLIPBOARD;
event->selection.target = target;
event->selection.property = _gdk_selection_property;
- event->selection.requestor = (guint32) msg->hwnd;
+ event->selection.requestor = msg->hwnd;
event->selection.time = msg->time;
fixup_event (event);
@@ -3476,18 +3479,18 @@
* constants as case labels.
*/
case WT_PACKET:
- GDK_NOTE (EVENTS, g_print (" %d %#lx",
- msg->wParam, msg->lParam));
+ GDK_NOTE (EVENTS, g_print (" %d %p",
+ (int) msg->wParam, (gpointer) msg->lParam));
goto wintab;
case WT_CSRCHANGE:
- GDK_NOTE (EVENTS, g_print (" %d %#lx",
- msg->wParam, msg->lParam));
+ GDK_NOTE (EVENTS, g_print (" %d %p",
+ (int) msg->wParam, (gpointer) msg->lParam));
goto wintab;
case WT_PROXIMITY:
- GDK_NOTE (EVENTS, g_print (" %#x %d %d",
- msg->wParam,
+ GDK_NOTE (EVENTS, g_print (" %p %d %d",
+ (gpointer) msg->wParam,
LOWORD (msg->lParam),
HIWORD (msg->lParam)));
/* Fall through */
Modified: trunk/gdk/win32/gdkfont-win32.c
==============================================================================
--- trunk/gdk/win32/gdkfont-win32.c (original)
+++ trunk/gdk/win32/gdkfont-win32.c Mon Aug 4 23:21:36 2008
@@ -897,7 +897,7 @@
singlefont->charset = GetTextCharsetInfo (_gdk_display_hdc, &singlefont->fs, 0);
GetTextFace (_gdk_display_hdc, sizeof (face), face);
SelectObject (_gdk_display_hdc, oldfont);
- if (TranslateCharsetInfo ((DWORD *) singlefont->charset, &csi,
+ if (TranslateCharsetInfo ((DWORD *) (gintptr) singlefont->charset, &csi,
TCI_SRCCHARSET)
&& singlefont->charset != MAC_CHARSET)
singlefont->codepage = csi.ciACP;
@@ -1400,8 +1400,9 @@
private = (const GdkFontPrivateWin32 *) font;
+ /* FIXME: What to do on Win64? */
if (font->type == GDK_FONT_FONT)
- return (gint) ((GdkWin32SingleFont *) private->fonts->data)->hfont;
+ return (gint) (gintptr) ((GdkWin32SingleFont *) private->fonts->data)->hfont;
else
return 0;
}
@@ -1519,7 +1520,7 @@
if (!list)
singlefont = NULL;
- GDK_NOTE (MISC, g_print ("%d:%d:%d:%p ",
+ GDK_NOTE (MISC, g_print ("%" G_GSIZE_FORMAT ":%" G_GSIZE_FORMAT ":%d:%p ",
start-wcstr, wcp-wcstr, block,
(singlefont ? singlefont->hfont : 0)));
Modified: trunk/gdk/win32/gdkkeys-win32.c
==============================================================================
--- trunk/gdk/win32/gdkkeys-win32.c (original)
+++ trunk/gdk/win32/gdkkeys-win32.c Mon Aug 4 23:21:36 2008
@@ -504,7 +504,7 @@
{
update_keymap ();
- switch (PRIMARYLANGID (LOWORD ((DWORD) _gdk_input_locale)))
+ switch (PRIMARYLANGID (LOWORD ((DWORD) (gintptr) _gdk_input_locale)))
{
case LANG_HEBREW:
case LANG_ARABIC:
Modified: trunk/gdk/win32/gdkmain-win32.c
==============================================================================
--- trunk/gdk/win32/gdkmain-win32.c (original)
+++ trunk/gdk/win32/gdkmain-win32.c Mon Aug 4 23:21:36 2008
@@ -368,7 +368,7 @@
_gdk_win32_psstyle_to_string (extlogpen.elpPenStyle),
_gdk_win32_psendcap_to_string (extlogpen.elpPenStyle),
_gdk_win32_psjoin_to_string (extlogpen.elpPenStyle),
- extlogpen.elpWidth,
+ (int) extlogpen.elpWidth,
_gdk_win32_lbstyle_to_string (extlogpen.elpBrushStyle));
g_print ("rop2: %s textcolor=%06lx\n",
_gdk_win32_rop2_to_string (GetROP2 (hdc)),
Modified: trunk/gdk/win32/gdkwin32id.c
==============================================================================
--- trunk/gdk/win32/gdkwin32id.c (original)
+++ trunk/gdk/win32/gdkwin32id.c Mon Aug 4 23:21:36 2008
@@ -34,12 +34,16 @@
static guint
gdk_handle_hash (HANDLE *handle)
{
+#ifdef _WIN64
+ return ((guint *) handle)[0] ^ ((guint *) handle)[1];
+#else
return (guint) *handle;
+#endif
}
static gint
gdk_handle_equal (HANDLE *a,
- HANDLE *b)
+ HANDLE *b)
{
return (*a == *b);
}
Modified: trunk/gdk/win32/gdkwindow-win32.c
==============================================================================
--- trunk/gdk/win32/gdkwindow-win32.c (original)
+++ trunk/gdk/win32/gdkwindow-win32.c Mon Aug 4 23:21:36 2008
@@ -2027,9 +2027,9 @@
* USENET. Search on Google.
*/
SetLastError (0);
- if (SetWindowLong (window_id, GWL_HWNDPARENT, (long) parent_id) == 0 &&
+ if (SetWindowLongPtr (window_id, GWLP_HWNDPARENT, (LONG_PTR) parent_id) == 0 &&
GetLastError () != 0)
- WIN32_API_FAILED ("SetWindowLong");
+ WIN32_API_FAILED ("SetWindowLongPtr");
}
void
@@ -3602,8 +3602,7 @@
owner = gdk_window_new_internal (NULL, &wa, 0, TRUE);
}
- SetWindowLong (GDK_WINDOW_HWND (window), GWL_HWNDPARENT,
- (long) GDK_WINDOW_HWND (owner));
+ SetWindowLongPtr (GDK_WINDOW_HWND (window), GWLP_HWNDPARENT, (LONG_PTR) GDK_WINDOW_HWND (owner));
#if 0 /* Should we also turn off the minimize and maximize buttons? */
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE,
@@ -3616,7 +3615,7 @@
}
else
{
- SetWindowLong (GDK_WINDOW_HWND (window), GWL_HWNDPARENT, 0);
+ SetWindowLongPtr (GDK_WINDOW_HWND (window), GWLP_HWNDPARENT, 0);
}
}
Modified: trunk/gdk/win32/xcursors.h
==============================================================================
--- trunk/gdk/win32/xcursors.h (original)
+++ trunk/gdk/win32/xcursors.h Mon Aug 4 23:21:36 2008
@@ -1,4 +1,4 @@
-static const struct { const gchar *name; const gchar *builtin; gint type; guchar width; guchar height; guchar hotx; guchar hoty; guchar *data; } cursors[] = {
+static const struct { const gchar *name; const gchar *builtin; gint type; guchar width; guchar height; guchar hotx; guchar hoty; gchar *data; } cursors[] = {
{ "X_cursor", NULL, 0, 16, 16, 7, 7,
"\125\000\000\125\152\100\001\251\152\220\006\251\152\244\032\251"
"\032\251\152\244\006\252\252\220\001\252\252\100\000\152\251\000"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]