diff options
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdk.def | 3 | ||||
-rw-r--r-- | gdk/win32/gdkcolor-win32.c | 2 | ||||
-rw-r--r-- | gdk/win32/gdkdnd-win32.c | 7 | ||||
-rw-r--r-- | gdk/win32/gdkdrawable-win32.c | 28 | ||||
-rw-r--r-- | gdk/win32/gdkevents-win32.c | 110 | ||||
-rw-r--r-- | gdk/win32/gdkgc-win32.c | 100 | ||||
-rw-r--r-- | gdk/win32/gdkimage-win32.c | 2 | ||||
-rw-r--r-- | gdk/win32/gdkinput-win32.h | 6 | ||||
-rw-r--r-- | gdk/win32/gdkpixmap-win32.c | 2 | ||||
-rw-r--r-- | gdk/win32/gdkprivate-win32.h | 9 | ||||
-rw-r--r-- | gdk/win32/gdkwindow-win32.c | 232 |
11 files changed, 338 insertions, 163 deletions
diff --git a/gdk/gdk.def b/gdk/gdk.def index 9d63ae546..22acb4322 100644 --- a/gdk/gdk.def +++ b/gdk/gdk.def @@ -92,6 +92,7 @@ EXPORTS gdk_draw_text gdk_draw_text_wc gdk_drawable_get_colormap + gdk_drawable_get_image gdk_drawable_get_size gdk_drawable_get_type gdk_drawable_get_visual @@ -157,6 +158,8 @@ EXPORTS gdk_gc_set_foreground gdk_gc_set_function gdk_gc_set_line_attributes + gdk_gc_set_rgb_bg_color + gdk_gc_set_rgb_fg_color gdk_gc_set_stipple gdk_gc_set_subwindow gdk_gc_set_tile diff --git a/gdk/win32/gdkcolor-win32.c b/gdk/win32/gdkcolor-win32.c index 311ad4a02..a96b23ebc 100644 --- a/gdk/win32/gdkcolor-win32.c +++ b/gdk/win32/gdkcolor-win32.c @@ -75,7 +75,7 @@ gdk_colormap_get_type (void) object_type = g_type_register_static (G_TYPE_OBJECT, "GdkColormap", - &object_info); + &object_info, 0); } return object_type; diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c index 42e2cd307..fa2c9fabf 100644 --- a/gdk/win32/gdkdnd-win32.c +++ b/gdk/win32/gdkdnd-win32.c @@ -130,7 +130,7 @@ gdk_drag_context_get_type (void) object_type = g_type_register_static (G_TYPE_OBJECT, "GdkDragContext", - &object_info); + &object_info, 0); } return object_type; @@ -1231,12 +1231,13 @@ gdk_drop_finish (GdkDragContext *context, GDK_NOTE (DND, g_print ("gdk_drop_finish\n")); } +#ifdef OLE2_DND + static GdkFilterReturn gdk_destroy_filter (GdkXEvent *xev, GdkEvent *event, gpointer data) { -#ifdef OLE2_DND MSG *msg = (MSG *) xev; if (msg->message == WM_DESTROY) @@ -1250,9 +1251,9 @@ gdk_destroy_filter (GdkXEvent *xev, RevokeDragDrop (msg->hwnd); CoLockObjectExternal (idtp, FALSE, TRUE); } -#endif return GDK_FILTER_CONTINUE; } +#endif void gdk_window_register_dnd (GdkWindow *window) diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c index 4f9a04099..75b23583c 100644 --- a/gdk/win32/gdkdrawable-win32.c +++ b/gdk/win32/gdkdrawable-win32.c @@ -139,7 +139,7 @@ gdk_drawable_impl_win32_get_type (void) object_type = g_type_register_static (GDK_TYPE_DRAWABLE, "GdkDrawableImplWin32", - &object_info); + &object_info, 0); } return object_type; @@ -223,8 +223,7 @@ gdk_win32_draw_rectangle (GdkDrawable *drawable, GdkGCWin32 *gc_private = GDK_GC_WIN32 (gc); const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_BACKGROUND; HDC hdc; - HGDIOBJ oldpen, oldbrush; - HBRUSH hbr = NULL; + HGDIOBJ old_pen_or_brush; POINT pts[4]; gboolean ok = TRUE; @@ -291,25 +290,18 @@ gdk_win32_draw_rectangle (GdkDrawable *drawable, if (ok && !FillPath (hdc)) WIN32_GDI_FAILED ("FillPath"), ok = FALSE; - - if (hbr != NULL) - if (!DeleteObject (hbr)) - WIN32_GDI_FAILED ("DeleteObject"); } else { if (filled) - oldpen = SelectObject (hdc, GetStockObject (NULL_PEN)); + old_pen_or_brush = SelectObject (hdc, GetStockObject (NULL_PEN)); else - oldbrush = SelectObject (hdc, GetStockObject (HOLLOW_BRUSH)); + old_pen_or_brush = SelectObject (hdc, GetStockObject (HOLLOW_BRUSH)); if (!Rectangle (hdc, x, y, x+width+1, y+height+1)) WIN32_GDI_FAILED ("Rectangle"); - if (filled) - SelectObject (hdc, oldpen); - else - SelectObject (hdc, oldbrush); + SelectObject (hdc, old_pen_or_brush); } gdk_win32_hdc_release (drawable, gc, mask); @@ -397,7 +389,6 @@ gdk_win32_draw_polygon (GdkDrawable *drawable, GdkGCWin32 *gc_private = GDK_GC_WIN32 (gc); const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_BACKGROUND; HDC hdc; - HBRUSH hbr = NULL; POINT *pts; gboolean ok = TRUE; int i; @@ -445,10 +436,6 @@ gdk_win32_draw_polygon (GdkDrawable *drawable, if (ok && !FillPath (hdc)) WIN32_GDI_FAILED ("FillPath"), ok = FALSE; - - if (hbr != NULL) - if (!DeleteObject (hbr)) - WIN32_GDI_FAILED ("DeleteObject"); } else { @@ -778,7 +765,6 @@ gdk_win32_draw_segments (GdkDrawable *drawable, GdkGCWin32 *gc_private = GDK_GC_WIN32 (gc); const GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_BACKGROUND; HDC hdc; - HBRUSH hbr = NULL; gboolean ok = TRUE; int i; @@ -813,10 +799,6 @@ gdk_win32_draw_segments (GdkDrawable *drawable, if (ok && !FillPath (hdc)) WIN32_GDI_FAILED ("FillPath"), ok = FALSE; - - if (hbr != NULL) - if (!DeleteObject (hbr)) - WIN32_GDI_FAILED ("DeleteObject"); } else { diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index d63ce1af8..85d97b5a0 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -136,6 +136,7 @@ static GdkWindow *current_window = NULL; static gint current_x, current_y; static gdouble current_x_root, current_y_root; static UINT gdk_ping_msg; +static UINT msh_mousewheel_msg; static gboolean ignore_wm_char = FALSE; static gboolean is_altgr_key = FALSE; @@ -296,8 +297,15 @@ gdk_events_init (void) #endif gdk_ping_msg = RegisterWindowMessage ("gdk-ping"); - GDK_NOTE (EVENTS, g_print ("gdk-ping = %#.03x\n", - gdk_ping_msg)); + GDK_NOTE (EVENTS, g_print ("gdk-ping = %#x\n", gdk_ping_msg)); + + /* This is the string MSH_MOUSEWHEEL from zmouse.h, + * http://www.microsoft.com/mouse/intellimouse/sdk/zmouse.h + * This message is used by mouse drivers than cannot generate WM_MOUSEWHEEL + * or on Win95. + */ + msh_mousewheel_msg = RegisterWindowMessage ("MSWHEEL_ROLLMSG"); + GDK_NOTE (EVENTS, g_print ("MSH_MOUSEWHEEL = %#x\n", msh_mousewheel_msg)); g_source_add (GDK_PRIORITY_EVENTS, TRUE, &event_funcs, NULL, NULL, NULL); @@ -1454,7 +1462,7 @@ gdk_event_translate (GdkEvent *event, return_val = !GDK_WINDOW_DESTROYED (window); - /* Will pass through switch below without match */ + goto done; } else if (msg->message == gdk_selection_request_msg) { @@ -1471,7 +1479,7 @@ gdk_event_translate (GdkEvent *event, return_val = !GDK_WINDOW_DESTROYED (window); - /* Again, will pass through switch below without match */ + goto done; } else if (msg->message == gdk_selection_clear_msg) { @@ -1485,7 +1493,64 @@ gdk_event_translate (GdkEvent *event, return_val = !GDK_WINDOW_DESTROYED (window); - /* Once again, we will pass through switch below without match */ + goto done; + } + else if (msg->message == msh_mousewheel_msg) + { + GDK_NOTE (EVENTS, g_print ("MSH_MOUSEWHEEL: %#lx %d\n", + (gulong) msg->hwnd, msg->wParam)); + + event->scroll.type = GDK_SCROLL; + + /* MSG_MOUSEWHEEL is delivered to the foreground window. Work + * around that. Also, the position is in screen coordinates, not + * client coordinates as with the button messages. + */ + pt.x = LOWORD (msg->lParam); + pt.y = HIWORD (msg->lParam); + if ((hwnd = WindowFromPoint (pt)) == NULL) + goto done; + + msg->hwnd = hwnd; + if ((new_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd)) == NULL) + goto done; + + if (new_window != window) + { + gdk_drawable_unref (window); + ASSIGN_WINDOW (new_window); + gdk_drawable_ref (window); + } + + if (GDK_WINDOW_OBJECT (window)->extension_events != 0 + && gdk_input_ignore_core) + { + GDK_NOTE (EVENTS, g_print ("...ignored\n")); + goto done; + } + + if (!propagate (&window, msg, + p_grab_window, p_grab_owner_events, p_grab_mask, + doesnt_want_scroll)) + goto done; + + ASSIGN_WINDOW (window); + + ScreenToClient (msg->hwnd, &pt); + event->button.window = window; + event->scroll.direction = ((int) msg->wParam > 0) ? + GDK_SCROLL_UP : GDK_SCROLL_DOWN; + event->scroll.window = window; + event->scroll.time = msg->time; + event->scroll.x = (gint16) pt.x; + event->scroll.y = (gint16) pt.y; + event->scroll.x_root = (gint16) LOWORD (msg->lParam); + event->scroll.y_root = (gint16) HIWORD (msg->lParam); + event->scroll.state = 0; /* No state information with MSH_MOUSEWHEEL */ + event->scroll.device = gdk_core_pointer; + return_val = !GDK_WINDOW_DESTROYED (window); + + goto done; } else { @@ -2139,42 +2204,47 @@ gdk_event_translate (GdkEvent *event, break; case WM_MOUSEWHEEL: - GDK_NOTE (EVENTS, g_print ("WM_MOUSEWHEEL: %#lx\n", (gulong) msg->hwnd)); - - if (GDK_WINDOW_OBJECT (window)->extension_events != 0 - && gdk_input_ignore_core) - { - GDK_NOTE (EVENTS, g_print ("...ignored\n")); - break; - } + GDK_NOTE (EVENTS, g_print ("WM_MOUSEWHEEL: %#lx %d\n", + (gulong) msg->hwnd, HIWORD (msg->wParam))); event->scroll.type = GDK_SCROLL; - /* WM_MOUSEWHEEL seems to be delivered to top-level windows - * only, for some reason. Work around that. Also, the position - * is in screen coordinates, not client coordinates as with the - * button messages. I love the consistency of Windows. + /* WM_MOUSEWHEEL is delivered to the focus window Work around + * that. Also, the position is in screen coordinates, not client + * coordinates as with the button messages. I love the + * consistency of Windows. */ pt.x = LOWORD (msg->lParam); pt.y = HIWORD (msg->lParam); if ((hwnd = WindowFromPoint (pt)) == NULL) break; + msg->hwnd = hwnd; if ((new_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd)) == NULL) break; + if (new_window != window) { gdk_drawable_unref (window); ASSIGN_WINDOW (new_window); gdk_drawable_ref (window); } - ScreenToClient (msg->hwnd, &pt); + + if (GDK_WINDOW_OBJECT (window)->extension_events != 0 + && gdk_input_ignore_core) + { + GDK_NOTE (EVENTS, g_print ("...ignored\n")); + break; + } + if (!propagate (&window, msg, p_grab_window, p_grab_owner_events, p_grab_mask, doesnt_want_scroll)) break; + ASSIGN_WINDOW (window); + ScreenToClient (msg->hwnd, &pt); event->button.window = window; event->scroll.direction = (((short) HIWORD (msg->wParam)) > 0) ? GDK_SCROLL_UP : GDK_SCROLL_DOWN; @@ -2183,7 +2253,7 @@ gdk_event_translate (GdkEvent *event, event->scroll.x = (gint16) pt.x; event->scroll.y = (gint16) pt.y; event->scroll.x_root = (gint16) LOWORD (msg->lParam); - event->scroll.y_root = (gint16) LOWORD (msg->lParam); + event->scroll.y_root = (gint16) HIWORD (msg->lParam); event->scroll.state = build_pointer_event_state (msg); event->scroll.device = gdk_core_pointer; return_val = !GDK_WINDOW_DESTROYED (window); @@ -2204,7 +2274,7 @@ gdk_event_translate (GdkEvent *event, event->crossing.x = current_x; event->crossing.y = current_y; event->crossing.x_root = current_xroot; - event->crossing.y_root = curYroot; + event->crossing.y_root = current_yroot; event->crossing.mode = GDK_CROSSING_NORMAL; if (current_window && IsChild (GDK_WINDOW_HWND (current_window), GDK_WINDOW_HWND (window))) diff --git a/gdk/win32/gdkgc-win32.c b/gdk/win32/gdkgc-win32.c index 8ec265cc9..9482fa091 100644 --- a/gdk/win32/gdkgc-win32.c +++ b/gdk/win32/gdkgc-win32.c @@ -72,7 +72,7 @@ gdk_gc_win32_get_type (void) object_type = g_type_register_static (GDK_TYPE_GC, "GdkGCWin32", - &object_info); + &object_info, 0); } return object_type; @@ -1454,3 +1454,101 @@ BitmapToRegion (HBITMAP hBmp) return hRgn; } + +#ifdef G_ENABLE_DEBUG + +gchar * +gdk_win32_cap_style_to_string (GdkCapStyle cap_style) +{ + switch (cap_style) + { +#define CASE(x) case x: return #x + strlen ("GDK_CAP_") + CASE (GDK_CAP_NOT_LAST); + CASE (GDK_CAP_BUTT); + CASE (GDK_CAP_ROUND); + CASE (GDK_CAP_PROJECTING); +#undef CASE + default: return ("illegal GdkCapStyle value"); + } + /* NOTREACHED */ + return NULL; +} + +gchar * +gdk_win32_fill_style_to_string (GdkFill fill) +{ + switch (fill) + { +#define CASE(x) case x: return #x + strlen ("GDK_") + CASE (GDK_SOLID); + CASE (GDK_TILED); + CASE (GDK_STIPPLED); + CASE (GDK_OPAQUE_STIPPLED); +#undef CASE + default: return ("illegal GdkFill value"); + } + /* NOTREACHED */ + return NULL; +} + +gchar * +gdk_win32_function_to_string (GdkFunction function) +{ + switch (function) + { +#define CASE(x) case x: return #x + strlen ("GDK_") + CASE (GDK_COPY); + CASE (GDK_INVERT); + CASE (GDK_XOR); + CASE (GDK_CLEAR); + CASE (GDK_AND); + CASE (GDK_AND_REVERSE); + CASE (GDK_AND_INVERT); + CASE (GDK_NOOP); + CASE (GDK_OR); + CASE (GDK_EQUIV); + CASE (GDK_OR_REVERSE); + CASE (GDK_COPY_INVERT); + CASE (GDK_OR_INVERT); + CASE (GDK_NAND); + CASE (GDK_SET); +#undef CASE + default: return ("illegal GdkFunction value"); + } + /* NOTREACHED */ + return NULL; +} + +gchar * +gdk_win32_join_style_to_string (GdkJoinStyle join_style) +{ + switch (join_style) + { +#define CASE(x) case x: return #x + strlen ("GDK_JOIN_") + CASE (GDK_JOIN_MITER); + CASE (GDK_JOIN_ROUND); + CASE (GDK_JOIN_BEVEL); +#undef CASE + default: return ("illegal GdkJoinStyle value"); + } + /* NOTREACHED */ + return NULL; +} + +gchar * +gdk_win32_line_style_to_string (GdkLineStyle line_style) +{ + switch (line_style) + { +#define CASE(x) case x: return #x + strlen ("GDK_LINE_") + CASE(GDK_LINE_SOLID); + CASE(GDK_LINE_ON_OFF_DASH); + CASE(GDK_LINE_DOUBLE_DASH); +#undef CASE + default: return ("illegal GdkLineStyle value"); + } + /* NOTREACHED */ + return NULL; +} + +#endif diff --git a/gdk/win32/gdkimage-win32.c b/gdk/win32/gdkimage-win32.c index 6507aff75..284dd79f0 100644 --- a/gdk/win32/gdkimage-win32.c +++ b/gdk/win32/gdkimage-win32.c @@ -64,7 +64,7 @@ gdk_image_get_type (void) object_type = g_type_register_static (G_TYPE_OBJECT, "GdkImage", - &object_info); + &object_info, 0); } return object_type; diff --git a/gdk/win32/gdkinput-win32.h b/gdk/win32/gdkinput-win32.h index 8216f49e5..b8de5ad1b 100644 --- a/gdk/win32/gdkinput-win32.h +++ b/gdk/win32/gdkinput-win32.h @@ -148,9 +148,11 @@ gint _gdk_input_other_event (GdkEvent *event, GdkInputWindow *gdk_input_window_find (GdkWindow *window); -gint _gdk_input_enable_window (GdkWindow *window, +void gdk_input_window_destroy (GdkWindow *window); + +gint _gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev); -gint _gdk_input_disable_window (GdkWindow *window, +gint _gdk_input_disable_window (GdkWindow *window, GdkDevicePrivate *gdkdev); gint _gdk_input_grab_pointer (GdkWindow *window, gint owner_events, diff --git a/gdk/win32/gdkpixmap-win32.c b/gdk/win32/gdkpixmap-win32.c index df90c12c4..e7064601f 100644 --- a/gdk/win32/gdkpixmap-win32.c +++ b/gdk/win32/gdkpixmap-win32.c @@ -67,7 +67,7 @@ gdk_pixmap_impl_win32_get_type (void) object_type = g_type_register_static (GDK_TYPE_DRAWABLE_IMPL_WIN32, "GdkPixmapImplWin32", - &object_info); + &object_info, 0); } return object_type; diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index 3111303cf..7f865b111 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -89,8 +89,13 @@ void gdk_wchar_text_handle (GdkFont *font, void *arg); #ifdef G_ENABLE_DEBUG -gchar *gdk_win32_color_to_string (const GdkColor *); -gchar *gdk_win32_message_name (UINT msg); +gchar *gdk_win32_color_to_string (const GdkColor *color); +gchar *gdk_win32_cap_style_to_string (GdkCapStyle cap_style); +gchar *gdk_win32_fill_style_to_string (GdkFill fill); +gchar *gdk_win32_function_to_string (GdkFunction function); +gchar *gdk_win32_join_style_to_string (GdkJoinStyle join_style); +gchar *gdk_win32_line_style_to_string (GdkLineStyle line_style); +gchar *gdk_win32_message_name (UINT msg); #endif gchar *gdk_win32_last_error_string (void); diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 6ca5b2c52..28fd50994 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -32,6 +32,7 @@ #include "gdkwindow.h" #include "gdkinternals.h" #include "gdkprivate-win32.h" +#include "gdkinput-win32.h" static gboolean gdk_window_gravity_works (void); static void gdk_window_set_static_win_gravity (GdkWindow *window, @@ -71,7 +72,7 @@ gdk_window_impl_win32_get_type (void) object_type = g_type_register_static (GDK_TYPE_DRAWABLE_IMPL_WIN32, "GdkWindowImplWin32", - &object_info); + &object_info, 0); } return object_type; @@ -597,7 +598,8 @@ gdk_window_new (GdkWindow *parent, if (GDK_WINDOW_HWND (window) != hwndNew) { g_warning("gdk_window_new: gdk_event_translate::WM_CREATE (%#x, %#x) HWND mismatch.", - GDK_WINDOW_HWND (window), hwndNew); + (guint) GDK_WINDOW_HWND (window), + (guint) hwndNew); /* HB: IHMO due to a race condition the handle was increased by * one, which causes much trouble. Because I can't find the @@ -629,10 +631,10 @@ gdk_window_new (GdkWindow *parent, "???")))), mbtitle, width, height, (x == CW_USEDEFAULT ? -9999 : x), y, - hparent, - GDK_WINDOW_HWND (window), - impl->input_locale, - impl->charset_info.ciACP)); + (guint) hparent, + (guint) GDK_WINDOW_HWND (window), + (guint) impl->input_locale, + (guint) impl->charset_info.ciACP)); g_free (mbtitle); g_free (wctitle); @@ -714,7 +716,7 @@ _gdk_windowing_window_destroy (GdkWindow *window, g_return_if_fail (GDK_IS_WINDOW (window)); GDK_NOTE (MISC, g_print ("_gdk_windowing_window_destroy %#x\n", - GDK_WINDOW_HWND (window))); + (guint) GDK_WINDOW_HWND (window))); if (private->extension_events != 0) gdk_input_window_destroy (window); @@ -751,14 +753,14 @@ gdk_window_destroy_notify (GdkWindow *window) GDK_NOTE (EVENTS, g_print ("gdk_window_destroy_notify: %#x %s\n", - GDK_WINDOW_HWND (window), + (guint) GDK_WINDOW_HWND (window), (GDK_WINDOW_DESTROYED (window) ? "(destroyed)" : ""))); if (!GDK_WINDOW_DESTROYED (window)) { if (GDK_WINDOW_TYPE(window) != GDK_WINDOW_FOREIGN) g_warning ("window %#x unexpectedly destroyed", - GDK_WINDOW_HWND (window)); + (guint) GDK_WINDOW_HWND (window)); _gdk_window_destroy (window, TRUE); } @@ -778,7 +780,7 @@ gdk_window_show (GdkWindow *window) if (!private->destroyed) { GDK_NOTE (MISC, g_print ("gdk_window_show: %#x\n", - GDK_WINDOW_HWND (window))); + (guint) GDK_WINDOW_HWND (window))); private->mapped = TRUE; if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP) @@ -815,7 +817,7 @@ gdk_window_hide (GdkWindow *window) if (!private->destroyed) { GDK_NOTE (MISC, g_print ("gdk_window_hide: %#x\n", - GDK_WINDOW_HWND (window))); + (guint) GDK_WINDOW_HWND (window))); private->mapped = FALSE; if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL) @@ -836,7 +838,7 @@ gdk_window_withdraw (GdkWindow *window) if (!private->destroyed) { GDK_NOTE (MISC, g_print ("gdk_window_withdraw: %#x\n", - GDK_WINDOW_HWND (window))); + (guint) GDK_WINDOW_HWND (window))); gdk_window_hide (window); /* ??? */ } @@ -880,7 +882,8 @@ gdk_window_resize (GdkWindow *window, if (!private->destroyed) { GDK_NOTE (MISC, g_print ("gdk_window_resize: %#x %dx%d\n", - GDK_WINDOW_HWND (window), width, height)); + (guint) GDK_WINDOW_HWND (window), + width, height)); if (GDK_WINDOW_TYPE (private) != GDK_WINDOW_CHILD) { @@ -917,9 +920,9 @@ gdk_window_resize (GdkWindow *window, private->resize_count += 1; - GDK_NOTE (MISC, - g_print ("...MoveWindow(%#x,%dx%d@+%d+%d)\n", - GDK_WINDOW_HWND (window), width, height, x, y)); + GDK_NOTE (MISC, g_print ("...MoveWindow(%#x,%dx%d@+%d+%d)\n", + (guint) GDK_WINDOW_HWND (window), + width, height, x, y)); if (!MoveWindow (GDK_WINDOW_HWND (window), x, y, width, height, TRUE)) WIN32_API_FAILED ("MoveWindow"); } @@ -952,7 +955,8 @@ gdk_window_move_resize (GdkWindow *window, DWORD dwExStyle; GDK_NOTE (MISC, g_print ("gdk_window_move_resize: %#x %dx%d@+%d+%d\n", - GDK_WINDOW_HWND (window), width, height, x, y)); + (guint) GDK_WINDOW_HWND (window), + width, height, x, y)); if (GDK_WINDOW_TYPE (private) == GDK_WINDOW_CHILD) _gdk_window_move_resize_child (window, x, y, width, height); @@ -968,8 +972,8 @@ gdk_window_move_resize (GdkWindow *window, if (!AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle)) WIN32_API_FAILED ("AdjustWindowRectEx"); - GDK_NOTE (MISC, g_print ("...MoveWindow(%#x,%dx%d@+%d+%d)\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("...MoveWindow(%#x,%ldx%ld@+%ld+%ld)\n", + (guint) GDK_WINDOW_HWND (window), rect.right - rect.left, rect.bottom - rect.top, rect.left, rect.top)); if (!MoveWindow (GDK_WINDOW_HWND (window), @@ -1005,8 +1009,8 @@ gdk_window_reparent (GdkWindow *window, if (!GDK_WINDOW_DESTROYED (window) && !GDK_WINDOW_DESTROYED (new_parent)) { GDK_NOTE (MISC, g_print ("gdk_window_reparent: %#x %#x\n", - GDK_WINDOW_HWND (window), - GDK_WINDOW_HWND (new_parent))); + (guint) GDK_WINDOW_HWND (window), + (guint) GDK_WINDOW_HWND (new_parent))); if (!SetParent (GDK_WINDOW_HWND (window), GDK_WINDOW_HWND (new_parent))) WIN32_API_FAILED ("SetParent"); @@ -1054,7 +1058,8 @@ _gdk_windowing_window_clear_area (GdkWindow *window, height = impl->height - y; GDK_NOTE (MISC, g_print ("_gdk_windowing_window_clear_area: " "%#x %dx%d@+%d+%d\n", - GDK_WINDOW_HWND (window), width, height, x, y)); + (guint) GDK_WINDOW_HWND (window), + width, height, x, y)); hdc = GetDC (GDK_WINDOW_HWND (window)); IntersectClipRect (hdc, x, y, x + width + 1, y + height + 1); SendMessage (GDK_WINDOW_HWND (window), WM_ERASEBKGND, (WPARAM) hdc, 0); @@ -1078,7 +1083,8 @@ _gdk_windowing_window_clear_area_e (GdkWindow *window, GDK_NOTE (MISC, g_print ("_gdk_windowing_window_clear_area_e: " "%#x %dx%d@+%d+%d\n", - GDK_WINDOW_HWND (window), width, height, x, y)); + (guint) GDK_WINDOW_HWND (window), + width, height, x, y)); rect.left = x; rect.right = x + width + 1; @@ -1099,7 +1105,7 @@ gdk_window_raise (GdkWindow *window) if (!GDK_WINDOW_DESTROYED (window)) { GDK_NOTE (MISC, g_print ("gdk_window_raise: %#x\n", - GDK_WINDOW_HWND (window))); + (guint) GDK_WINDOW_HWND (window))); if (!BringWindowToTop (GDK_WINDOW_HWND (window))) WIN32_API_FAILED ("BringWindowToTop"); @@ -1115,7 +1121,7 @@ gdk_window_lower (GdkWindow *window) if (!GDK_WINDOW_DESTROYED (window)) { GDK_NOTE (MISC, g_print ("gdk_window_lower: %#x\n", - GDK_WINDOW_HWND (window))); + (guint) GDK_WINDOW_HWND (window))); if (!SetWindowPos (GDK_WINDOW_HWND (window), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE)) @@ -1149,7 +1155,7 @@ gdk_window_set_hints (GdkWindow *window, impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl); GDK_NOTE (MISC, g_print ("gdk_window_set_hints: %#x %dx%d..%dx%d @+%d+%d\n", - GDK_WINDOW_HWND (window), + (guint) GDK_WINDOW_HWND (window), min_width, min_height, max_width, max_height, x, y)); @@ -1159,48 +1165,50 @@ gdk_window_set_hints (GdkWindow *window, if (flags) { if (flags & GDK_HINT_POS) - if (!GetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints)) - WIN32_API_FAILED ("GetWindowPlacement"); - else - { - GDK_NOTE (MISC, g_print ("...rcNormalPosition:" - " (%d,%d)--(%d,%d)\n", - size_hints.rcNormalPosition.left, - size_hints.rcNormalPosition.top, - size_hints.rcNormalPosition.right, - size_hints.rcNormalPosition.bottom)); - /* What are the corresponding window coordinates for client - * area coordinates x, y - */ - rect.left = x; - rect.top = y; - rect.right = rect.left + 200; /* dummy */ - rect.bottom = rect.top + 200; - dwStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE); - dwExStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE); - AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle); - size_hints.flags = 0; - size_hints.showCmd = SW_SHOWNA; - - /* Set the normal position hint to that location, with unchanged - * width and height. - */ - diff = size_hints.rcNormalPosition.left - rect.left; - size_hints.rcNormalPosition.left = rect.left; - size_hints.rcNormalPosition.right -= diff; - diff = size_hints.rcNormalPosition.top - rect.top; - size_hints.rcNormalPosition.top = rect.top; - size_hints.rcNormalPosition.bottom -= diff; - GDK_NOTE (MISC, g_print ("...setting: (%d,%d)--(%d,%d)\n", - size_hints.rcNormalPosition.left, - size_hints.rcNormalPosition.top, - size_hints.rcNormalPosition.right, - size_hints.rcNormalPosition.bottom)); - if (!SetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints)) - WIN32_API_FAILED ("SetWindowPlacement"); - impl->hint_x = rect.left; - impl->hint_y = rect.top; - } + { + if (!GetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints)) + WIN32_API_FAILED ("GetWindowPlacement"); + else + { + GDK_NOTE (MISC, g_print ("...rcNormalPosition:" + " (%ld,%ld)--(%ld,%ld)\n", + size_hints.rcNormalPosition.left, + size_hints.rcNormalPosition.top, + size_hints.rcNormalPosition.right, + size_hints.rcNormalPosition.bottom)); + /* What are the corresponding window coordinates for client + * area coordinates x, y + */ + rect.left = x; + rect.top = y; + rect.right = rect.left + 200; /* dummy */ + rect.bottom = rect.top + 200; + dwStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE); + dwExStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE); + AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle); + size_hints.flags = 0; + size_hints.showCmd = SW_SHOWNA; + + /* Set the normal position hint to that location, with unchanged + * width and height. + */ + diff = size_hints.rcNormalPosition.left - rect.left; + size_hints.rcNormalPosition.left = rect.left; + size_hints.rcNormalPosition.right -= diff; + diff = size_hints.rcNormalPosition.top - rect.top; + size_hints.rcNormalPosition.top = rect.top; + size_hints.rcNormalPosition.bottom -= diff; + GDK_NOTE (MISC, g_print ("...setting: (%ld,%ld)--(%ld,%ld)\n", + size_hints.rcNormalPosition.left, + size_hints.rcNormalPosition.top, + size_hints.rcNormalPosition.right, + size_hints.rcNormalPosition.bottom)); + if (!SetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints)) + WIN32_API_FAILED ("SetWindowPlacement"); + impl->hint_x = rect.left; + impl->hint_y = rect.top; + } + } if (flags & GDK_HINT_MIN_SIZE) { @@ -1257,7 +1265,6 @@ gdk_window_set_geometry_hints (GdkWindow *window, RECT rect; DWORD dwStyle; DWORD dwExStyle; - int diff; g_return_if_fail (window != NULL); g_return_if_fail (GDK_IS_WINDOW (window)); @@ -1323,28 +1330,30 @@ gdk_window_set_geometry_hints (GdkWindow *window, if (geom_mask & GDK_HINT_BASE_SIZE && geometry->base_width > 0 && geometry->base_height > 0) - if (!GetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints)) - WIN32_API_FAILED ("GetWindowPlacement"); - else - { - GDK_NOTE (MISC, g_print ("gdk_window_set_geometry_hints:" - " rcNormalPosition: (%d,%d)--(%d,%d)\n", - size_hints.rcNormalPosition.left, - size_hints.rcNormalPosition.top, - size_hints.rcNormalPosition.right, - size_hints.rcNormalPosition.bottom)); - size_hints.rcNormalPosition.right = - size_hints.rcNormalPosition.left + geometry->base_width; - size_hints.rcNormalPosition.bottom = - size_hints.rcNormalPosition.top + geometry->base_height; - GDK_NOTE (MISC, g_print ("...setting: rcNormal: (%d,%d)--(%d,%d)\n", - size_hints.rcNormalPosition.left, - size_hints.rcNormalPosition.top, - size_hints.rcNormalPosition.right, - size_hints.rcNormalPosition.bottom)); - if (!SetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints)) - WIN32_API_FAILED ("SetWindowPlacement"); - } + { + if (!GetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints)) + WIN32_API_FAILED ("GetWindowPlacement"); + else + { + GDK_NOTE (MISC, g_print ("gdk_window_set_geometry_hints:" + " rcNormalPosition: (%ld,%ld)--(%ld,%ld)\n", + size_hints.rcNormalPosition.left, + size_hints.rcNormalPosition.top, + size_hints.rcNormalPosition.right, + size_hints.rcNormalPosition.bottom)); + size_hints.rcNormalPosition.right = + size_hints.rcNormalPosition.left + geometry->base_width; + size_hints.rcNormalPosition.bottom = + size_hints.rcNormalPosition.top + geometry->base_height; + GDK_NOTE (MISC, g_print ("...setting: rcNormal: (%ld,%ld)--(%ld,%ld)\n", + size_hints.rcNormalPosition.left, + size_hints.rcNormalPosition.top, + size_hints.rcNormalPosition.right, + size_hints.rcNormalPosition.bottom)); + if (!SetWindowPlacement (GDK_WINDOW_HWND (window), &size_hints)) + WIN32_API_FAILED ("SetWindowPlacement"); + } + } if (geom_mask & GDK_HINT_RESIZE_INC) { @@ -1375,7 +1384,7 @@ gdk_window_set_title (GdkWindow *window, title = "."; GDK_NOTE (MISC, g_print ("gdk_window_set_title: %#x %s\n", - GDK_WINDOW_HWND (window), title)); + (guint) GDK_WINDOW_HWND (window), title)); if (!GDK_WINDOW_DESTROYED (window)) { @@ -1406,7 +1415,8 @@ gdk_window_set_role (GdkWindow *window, g_return_if_fail (GDK_IS_WINDOW (window)); GDK_NOTE (MISC, g_print ("gdk_window_set_role: %#x %s\n", - GDK_WINDOW_HWND (window), (role ? role : "NULL"))); + (guint) GDK_WINDOW_HWND (window), + (role ? role : "NULL"))); /* XXX */ } @@ -1418,8 +1428,8 @@ gdk_window_set_transient_for (GdkWindow *window, g_return_if_fail (GDK_IS_WINDOW (window)); GDK_NOTE (MISC, g_print ("gdk_window_set_transient_for: %#x %#x\n", - GDK_WINDOW_HWND (window), - GDK_WINDOW_HWND (parent))); + (guint) GDK_WINDOW_HWND (window), + (guint) GDK_WINDOW_HWND (parent))); /* XXX */ } @@ -1433,7 +1443,7 @@ gdk_window_set_background (GdkWindow *window, g_return_if_fail (GDK_IS_WINDOW (window)); GDK_NOTE (MISC, g_print ("gdk_window_set_background: %#x %s\n", - GDK_WINDOW_HWND (window), + (guint) GDK_WINDOW_HWND (window), gdk_win32_color_to_string (color))); private->bg_color = *color; @@ -1504,10 +1514,12 @@ gdk_window_set_cursor (GdkWindow *window, hcursor = cursor_private->hcursor; GDK_NOTE (MISC, g_print ("gdk_window_set_cursor: %#x %#x\n", - GDK_WINDOW_HWND (window), hcursor)); + (guint) GDK_WINDOW_HWND (window), + (guint) hcursor)); if (impl->hcursor != NULL) { - GDK_NOTE (MISC, g_print ("...DestroyCursor (%#x)\n", impl->hcursor)); + GDK_NOTE (MISC, g_print ("...DestroyCursor (%#x)\n", + (guint) impl->hcursor)); DestroyCursor (impl->hcursor); impl->hcursor = NULL; @@ -1522,7 +1534,7 @@ gdk_window_set_cursor (GdkWindow *window, */ impl->hcursor = CopyCursor (hcursor); GDK_NOTE (MISC, g_print ("...CopyCursor (%#x) = %#x\n", - hcursor, impl->hcursor)); + (guint) hcursor, (guint) impl->hcursor)); GetCursorPos (&pt); if (ChildWindowFromPoint (GDK_WINDOW_HWND (window), pt) == GDK_WINDOW_HWND (window)) @@ -1595,7 +1607,8 @@ gdk_window_get_origin (GdkWindow *window, *y = ty; GDK_NOTE (MISC, g_print ("gdk_window_get_origin: %#x: +%d+%d\n", - GDK_WINDOW_HWND (window), tx, ty)); + (guint) GDK_WINDOW_HWND (window), + tx, ty)); return return_val; } @@ -1640,9 +1653,10 @@ gdk_window_get_root_origin (GdkWindow *window, if (y) *y = pt.y; - GDK_NOTE (MISC, g_print ("gdk_window_get_root_origin: %#x: (%#x) +%d+%d\n", - GDK_WINDOW_HWND (window), - GDK_WINDOW_HWND (rover), pt.x, pt.y)); + GDK_NOTE (MISC, g_print ("gdk_window_get_root_origin: %#x: (%#x) +%ld+%ld\n", + (guint) GDK_WINDOW_HWND (window), + (guint) GDK_WINDOW_HWND (rover), + pt.x, pt.y)); } GdkWindow* @@ -1749,8 +1763,9 @@ gdk_window_at_pointer (gint *win_x, *win_y = point.y - rect.top; } - GDK_NOTE (MISC, g_print ("gdk_window_at_pointer: +%d+%d %#x%s\n", - point.x, point.y, hwnd, + GDK_NOTE (MISC, g_print ("gdk_window_at_pointer: +%ld+%ld %#x%s\n", + point.x, point.y, + (guint) hwnd, (window == NULL ? " NULL" : ""))); return window; @@ -1792,7 +1807,7 @@ gdk_window_shape_combine_mask (GdkWindow *window, if (!mask) { GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_mask: %#x none\n", - GDK_WINDOW_HWND (window))); + (guint) GDK_WINDOW_HWND (window))); SetWindowRgn (GDK_WINDOW_HWND (window), NULL, TRUE); } else @@ -1806,8 +1821,8 @@ gdk_window_shape_combine_mask (GdkWindow *window, hrgn = BitmapToRegion (GDK_WINDOW_HWND (mask)); GDK_NOTE (MISC, g_print ("gdk_window_shape_combine_mask: %#x %#x\n", - GDK_WINDOW_HWND (window), - GDK_WINDOW_HWND (mask))); + (guint) GDK_WINDOW_HWND (window), + (guint) GDK_WINDOW_HWND (mask))); /* SetWindowRgn wants window (not client) coordinates */ dwStyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE); @@ -1999,7 +2014,6 @@ gdk_propagate_shapes (HANDLE win, { RECT emptyRect; HRGN region, childRegion; - RECT rect; HWND *list = NULL; gint i, num; |