Commit df9768cf authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Print debugging output only if asked for, not always.

2005-03-16  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkdisplay-win32.c (_win32_on_clipboard_change): Print
	debugging output only if asked for, not always.

	* gdk/win32/*.c: Use the %+d%+d format for coordinate pairs in
	debugging printout instead of +%d+%d. Misc other additions and
	cosmetic improvements to debugging printouts. Use API_CALL() and
	GDI_CALL() macros in more places.

	* gdk/win32/gdkwindow-win32.c (gdk_window_move, gdk_window_resize,
	gdk_window_move_resize): To detect child windows, check whether
	the real parent is not the desktop window, instead of relying on
	the GDK window type being GDK_WINDOW_CHILD. Foreign GtkPlug
	windows have a GDK window type GDK_WINDOW_FOREIGN, but are still
	de facto child windows.
parent 1b2584a8
2005-03-16 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdisplay-win32.c (_win32_on_clipboard_change): Print
debugging output only if asked for, not always.
* gdk/win32/*.c: Use the %+d%+d format for coordinate pairs in
debugging printout instead of +%d+%d. Misc other additions and
cosmetic improvements to debugging printouts. Use API_CALL() and
GDI_CALL() macros in more places.
* gdk/win32/gdkwindow-win32.c (gdk_window_move, gdk_window_resize,
gdk_window_move_resize): To detect child windows, check whether
the real parent is not the desktop window, instead of relying on
the GDK window type being GDK_WINDOW_CHILD. Foreign GtkPlug
windows have a GDK window type GDK_WINDOW_FOREIGN, but are still
de facto child windows.
2005-03-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkradioaction.c (gtk_radio_action_get_group): Add an
......
2005-03-16 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdisplay-win32.c (_win32_on_clipboard_change): Print
debugging output only if asked for, not always.
* gdk/win32/*.c: Use the %+d%+d format for coordinate pairs in
debugging printout instead of +%d+%d. Misc other additions and
cosmetic improvements to debugging printouts. Use API_CALL() and
GDI_CALL() macros in more places.
* gdk/win32/gdkwindow-win32.c (gdk_window_move, gdk_window_resize,
gdk_window_move_resize): To detect child windows, check whether
the real parent is not the desktop window, instead of relying on
the GDK window type being GDK_WINDOW_CHILD. Foreign GtkPlug
windows have a GDK window type GDK_WINDOW_FOREIGN, but are still
de facto child windows.
2005-03-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkradioaction.c (gtk_radio_action_get_group): Add an
......
2005-03-16 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkdisplay-win32.c (_win32_on_clipboard_change): Print
debugging output only if asked for, not always.
* gdk/win32/*.c: Use the %+d%+d format for coordinate pairs in
debugging printout instead of +%d+%d. Misc other additions and
cosmetic improvements to debugging printouts. Use API_CALL() and
GDI_CALL() macros in more places.
* gdk/win32/gdkwindow-win32.c (gdk_window_move, gdk_window_resize,
gdk_window_move_resize): To detect child windows, check whether
the real parent is not the desktop window, instead of relying on
the GDK window type being GDK_WINDOW_CHILD. Foreign GtkPlug
windows have a GDK window type GDK_WINDOW_FOREIGN, but are still
de facto child windows.
2005-03-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkradioaction.c (gtk_radio_action_get_group): Add an
......
......@@ -107,8 +107,7 @@ gdk_colormap_finalize (GObject *object)
GdkColormap *colormap = GDK_COLORMAP (object);
GdkColormapPrivateWin32 *private = GDK_WIN32_COLORMAP_DATA (colormap);
if (!DeleteObject (private->hpal))
WIN32_GDI_FAILED ("DeleteObject");
GDI_CALL (DeleteObject, (private->hpal));
if (private->hash)
g_hash_table_destroy (private->hash);
......@@ -156,11 +155,12 @@ alloc_color_cells (GdkColormap *cmap,
if (npixels > nfree)
{
GDK_NOTE (COLORMAP, g_print ("...nope (%d > %d)\n", npixels, nfree));
GDK_NOTE (COLORMAP, g_print ("... nope (%d > %d)\n",
npixels, nfree));
return FALSE;
}
else
GDK_NOTE (COLORMAP, g_print ("...ok\n"));
GDK_NOTE (COLORMAP, g_print ("... ok\n"));
iret = 0;
for (i = start; i < cmap->size && iret < npixels; i++)
......@@ -266,9 +266,8 @@ alloc_color (GdkColormap *cmap,
/* It was a nonused entry anyway, so we can use it, and
* set it to the correct color.
*/
GDK_NOTE (COLORMAP, g_print ("...was free\n"));
if (!SetPaletteEntries (cmapp->hpal, index, 1, &entry))
WIN32_GDI_FAILED ("SetPaletteEntries");
GDK_NOTE (COLORMAP, g_print ("... was free\n"));
GDI_CALL (SetPaletteEntries, (cmapp->hpal, index, 1, &entry));
}
else
{
......@@ -281,7 +280,7 @@ alloc_color (GdkColormap *cmap,
{
/* An available slot, use it. */
GDK_NOTE (COLORMAP,
g_print ("...use free slot %d%s\n",
g_print ("... use free slot %d%s\n",
i, (i >= cmapp->current_size) ?
", will resize palette" : ""));
if (i >= cmapp->current_size)
......@@ -412,8 +411,7 @@ free_colors (GdkColormap *cmap,
{
if (cleared_entries[i])
{
if (!SetPaletteEntries (cmapp->hpal, i, 1, &pe))
WIN32_GDI_FAILED ("SetPaletteEntries");
GDI_CALL (SetPaletteEntries, (cmapp->hpal, i, 1, &pe));
GDK_NOTE (COLORMAP, set_black_count++);
}
}
......@@ -675,8 +673,7 @@ gdk_colormap_change (GdkColormap *colormap,
pe[i].peFlags = 0;
}
if (!SetPaletteEntries (cmapp->hpal, 0, ncolors, pe))
WIN32_GDI_FAILED ("SetPaletteEntries");
GDI_CALL (SetPaletteEntries, (cmapp->hpal, 0, ncolors, pe));
g_free (pe);
break;
......@@ -1258,8 +1255,7 @@ gdk_color_change (GdkColormap *colormap,
pe.peGreen = color->green >> 8;
pe.peBlue = color->blue >> 8;
if (SetPaletteEntries (private->hpal, color->pixel, 1, &pe) == 0)
WIN32_GDI_FAILED ("SetPaletteEntries");
GDI_CALL (SetPaletteEntries, (private->hpal, color->pixel, 1, &pe));
return TRUE;
}
......
......@@ -148,7 +148,7 @@ _gdk_monitor_init (void)
{
_gdk_monitors[i].x += _gdk_offset_x;
_gdk_monitors[i].y += _gdk_offset_y;
GDK_NOTE (MISC, g_print ("Monitor %d: %dx%d@+%d+%d\n",
GDK_NOTE (MISC, g_print ("Monitor %d: %dx%d@%+d%+d\n",
i, _gdk_monitors[i].width,
_gdk_monitors[i].height,
_gdk_monitors[i].x, _gdk_monitors[i].y));
......@@ -271,25 +271,26 @@ _win32_on_clipboard_change (HWND hwnd,
}
case WM_DRAWCLIPBOARD :
{
/* create the appropriate gdk events */
HWND hwndOwner = GetClipboardOwner ();
UINT nFormat = 0;
int n = 0;
if (OpenClipboard (hwnd))
{
for (; 0 != (nFormat = EnumClipboardFormats (nFormat)); )
{
char sFormat[80];
if (GetClipboardFormatName (nFormat, sFormat, 80) > 0)
g_print ("%s ", sFormat);
n++; /* do something useful ? */
}
GDK_NOTE (DND,
g_print ("WM_DRAWCLIPBOARD : formats %d owner %#lx\n", n, hwndOwner));
CloseClipboard ();
/* Create the appropriate gdk events */
#ifdef G_ENABLE_DEBUG
if ((_gdk_debug_flags & GDK_DEBUG_DND) &&
OpenClipboard (hwnd))
{
HWND hwndOwner = GetClipboardOwner ();
UINT nFormat = 0;
g_print ("WM_DRAWCLIPBOARD: owner:%p formats: ", hwndOwner);
for (; 0 != (nFormat = EnumClipboardFormats (nFormat));)
{
char sFormat[80];
if (GetClipboardFormatName (nFormat, sFormat, G_N_ELEMENTS (sFormat)) > 0)
g_print ("%s ", sFormat);
}
g_print ("\n");
CloseClipboard ();
}
#endif
/* XXX: generate the apropriate GdkEventOwnerChange ... */
/* don't break the chain */
......
......@@ -1021,7 +1021,7 @@ gdk_dropfiles_filter (GdkXEvent *xev,
if (uri != NULL)
{
g_string_append (result, uri);
GDK_NOTE (DND, g_print ("...%s link to %s: %s\n",
GDK_NOTE (DND, g_print ("... %s link to %s: %s\n",
fileName, linkedFile, uri));
g_free (uri);
}
......@@ -1032,7 +1032,7 @@ gdk_dropfiles_filter (GdkXEvent *xev,
if (uri != NULL)
{
g_string_append (result, uri);
GDK_NOTE (DND, g_print ("...%s: %s\n", fileName, uri));
GDK_NOTE (DND, g_print ("... %s: %s\n", fileName, uri));
g_free (uri);
}
}
......@@ -1419,7 +1419,7 @@ gdk_drag_find_window_for_screen (GdkDragContext *context,
}
GDK_NOTE (DND,
g_print ("gdk_drag_find_window: %p +%d+%d: %p: %p %d\n",
g_print ("gdk_drag_find_window: %p %+d%+d: %p: %p %d\n",
(drag_window ? GDK_WINDOW_HWND (drag_window) : NULL),
x_root, y_root,
a.result,
......
......@@ -397,7 +397,7 @@ draw_tiles_lowlevel (HDC dest,
{
gint x, y;
GDK_NOTE (MISC, g_print ("draw_tiles_lowlevel: %p +%d+%d tile=%p:%dx%d@+%d+%d %dx%d\n",
GDK_NOTE (MISC, g_print ("draw_tiles_lowlevel: %p %+d%+d tile=%p:%dx%d@%+d%+d %dx%d\n",
dest,
dest_x, dest_y,
tile, tile_width, tile_height,
......@@ -855,7 +855,7 @@ gdk_win32_draw_rectangle (GdkDrawable *drawable,
GdkRectangle bounds;
GdkRegion *region;
GDK_NOTE (MISC, g_print ("gdk_win32_draw_rectangle: %s (%p) %s%dx%d@+%d+%d\n",
GDK_NOTE (MISC, g_print ("gdk_win32_draw_rectangle: %s (%p) %s%dx%d@%+d%+d\n",
_gdk_win32_drawable_description (drawable),
gc,
(filled ? "fill " : ""),
......@@ -922,20 +922,18 @@ draw_arc (GdkGCWin32 *gcwin32,
if (filled)
{
old_pen = SelectObject (hdc, GetStockObject (NULL_PEN));
GDK_NOTE (MISC, g_print ("...Pie(hdc,%d,%d,%d,%d,%d,%d,%d,%d)\n",
x, y, x+width, y+height,
nXStartArc, nYStartArc,
nXEndArc, nYEndArc));
GDK_NOTE (MISC, g_print ("... Pie(%p,%d,%d,%d,%d,%d,%d,%d,%d)\n",
hdc, x, y, x+width, y+height,
nXStartArc, nYStartArc, nXEndArc, nYEndArc));
GDI_CALL (Pie, (hdc, x, y, x+width, y+height,
nXStartArc, nYStartArc, nXEndArc, nYEndArc));
GDI_CALL (SelectObject, (hdc, old_pen));
}
else
{
GDK_NOTE (MISC, g_print ("...Arc(hdc,%d,%d,%d,%d,%d,%d,%d,%d)\n",
x, y, x+width, y+height,
nXStartArc, nYStartArc,
nXEndArc, nYEndArc));
GDK_NOTE (MISC, g_print ("... Arc(%p,%d,%d,%d,%d,%d,%d,%d,%d)\n",
hdc, x, y, x+width, y+height,
nXStartArc, nYStartArc, nXEndArc, nYEndArc));
GDI_CALL (Arc, (hdc, x, y, x+width, y+height,
nXStartArc, nYStartArc, nXEndArc, nYEndArc));
}
......@@ -1823,8 +1821,8 @@ _gdk_win32_blit (gboolean use_fg_bg,
GdkDrawableImplWin32 *src_impl = NULL;
gint src_width, src_height;
GDK_NOTE (MISC, g_print ("_gdk_win32_blit: src:%s %dx%d@+%d+%d\n"
" dst:%s @+%d+%d use_fg_bg=%d\n",
GDK_NOTE (MISC, g_print ("_gdk_win32_blit: src:%s %dx%d@%+d%+d\n"
" dst:%s @%+d%+d use_fg_bg=%d\n",
_gdk_win32_drawable_description (src),
width, height, xsrc, ysrc,
_gdk_win32_drawable_description ((GdkDrawable *) drawable),
......@@ -1873,8 +1871,8 @@ _gdk_win32_blit (gboolean use_fg_bg,
{
OffsetRgn (outside_rgn, xdest, ydest);
GDK_NOTE (MISC, (GetRgnBox (outside_rgn, &r),
g_print ("...calling InvalidateRgn, "
"bbox: %ldx%ld@+%ld+%ld\n",
g_print ("... InvalidateRgn "
"bbox: %ldx%ld@%+ld%+ld\n",
r.right - r.left - 1, r.bottom - r.top - 1,
r.left, r.top)));
InvalidateRgn (draw_impl->handle, outside_rgn, TRUE);
......@@ -1897,8 +1895,8 @@ _gdk_win32_blit (gboolean use_fg_bg,
width = r.right - xsrc - 1;
height = r.bottom - ysrc - 1;
GDK_NOTE (MISC, g_print ("... restricted to src: %dx%d@+%d+%d, "
"dest: @+%d+%d\n",
GDK_NOTE (MISC, g_print ("... restricted to src: %dx%d@%+d%+d, "
"dest: @%+d%+d\n",
width, height, xsrc, ysrc,
xdest, ydest));
}
......
......@@ -1553,8 +1553,7 @@ synthesize_expose_events (GdkWindow *window)
append_event (gdk_drawable_get_display (window), event);
}
if (!ReleaseDC (impl->handle, hdc))
WIN32_GDI_FAILED ("ReleaseDC");
GDI_CALL (ReleaseDC, (impl->handle, hdc));
}
}
......@@ -1601,13 +1600,11 @@ update_colors (GdkWindow *window,
impl->handle, cmapp->hpal, k) :
(void) 0,
g_print (" %p", impl->handle)));
if (!UpdateColors (hdc))
WIN32_GDI_FAILED ("UpdateColors");
GDI_CALL (UpdateColors, (hdc));
SelectPalette (hdc, holdpal, TRUE);
RealizePalette (hdc);
}
if (!ReleaseDC (impl->handle, hdc))
WIN32_GDI_FAILED ("ReleaseDC");
GDI_CALL (ReleaseDC, (impl->handle, hdc));
}
GDK_NOTE (COLORMAP, (top ? g_print ("\n") : (void) 0));
}
......@@ -2148,7 +2145,6 @@ gdk_event_translate (GdkDisplay *display,
MINMAXINFO *mmi;
HWND hwnd;
HCURSOR hcursor;
CHARSETINFO charset_info;
BYTE key_state[256];
HIMC himc;
......@@ -3246,7 +3242,7 @@ gdk_event_translate (GdkDisplay *display,
impl = GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) window)->impl);
mmi = (MINMAXINFO*) msg->lParam;
GDK_NOTE (EVENTS, g_print (" (mintrack:%ldx%ld maxtrack:%ldx%ld "
"maxpos:+%ld+%ld maxsize:%ldx%ld)",
"maxpos:%+ld%+ld maxsize:%ldx%ld)",
mmi->ptMinTrackSize.x, mmi->ptMinTrackSize.y,
mmi->ptMaxTrackSize.x, mmi->ptMaxTrackSize.y,
mmi->ptMaxPosition.x, mmi->ptMaxPosition.y,
......@@ -3285,7 +3281,7 @@ gdk_event_translate (GdkDisplay *display,
{
/* Don't call DefWindowProc() */
GDK_NOTE (EVENTS, g_print (" (handled, mintrack:%ldx%ld maxtrack:%ldx%ld "
"maxpos:+%ld+%ld maxsize:%ldx%ld)",
"maxpos:%+ld%+ld maxsize:%ldx%ld)",
mmi->ptMinTrackSize.x, mmi->ptMinTrackSize.y,
mmi->ptMaxTrackSize.x, mmi->ptMaxTrackSize.y,
mmi->ptMaxPosition.x, mmi->ptMaxPosition.y,
......
......@@ -201,7 +201,7 @@ _gdk_window_move_resize_child (GdkWindow *window,
obj = GDK_WINDOW_OBJECT (window);
impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);
GDK_NOTE (MISC, g_print ("_gdk_window_move_resize_child: %s@+%d+%d %dx%d@+%d+%d\n",
GDK_NOTE (MISC, g_print ("_gdk_window_move_resize_child: %s@%+d%+d %dx%d@%+d%+d\n",
_gdk_win32_drawable_description (window),
obj->x, obj->y,
width, height, x, y));
......@@ -214,11 +214,13 @@ _gdk_window_move_resize_child (GdkWindow *window,
if (!is_move && !is_resize)
{
GDK_NOTE (MISC, g_print ("...neither move or resize\n"));
GDK_NOTE (MISC, g_print ("... neither move or resize\n"));
return;
}
GDK_NOTE (MISC, g_print ("...%s%s\n", is_move ? "is_move " : "", is_resize ? "is_resize" : ""));
GDK_NOTE (MISC, g_print ("... %s%s\n",
is_move ? "is_move " : "",
is_resize ? "is_resize" : ""));
obj->x = x;
obj->y = y;
......@@ -242,7 +244,7 @@ _gdk_window_move_resize_child (GdkWindow *window,
if (d_xoffset != 0 || d_yoffset != 0)
{
GDK_NOTE (MISC, g_print ("...d_xoffset=%d d_yoffset=%d\n", d_xoffset, d_yoffset));
GDK_NOTE (MISC, g_print ("... d_offset=%+d%+d\n", d_xoffset, d_yoffset));
if (!ScrollWindowEx (GDK_WINDOW_HWND (window),
-d_xoffset, -d_yoffset, /* in: scroll offsets */
......@@ -255,17 +257,20 @@ _gdk_window_move_resize_child (GdkWindow *window,
if (dx != d_xoffset || dy != d_yoffset || is_resize)
{
GDK_NOTE (MISC, g_print ("...SetWindowPos(%p,%dx%d@+%d+%d)\n",
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%d,%d,"
"NOACTIVATE|NOZORDER%s%s)\n",
GDK_WINDOW_HWND (window),
new_info.x, new_info.y,
new_info.width, new_info.height,
new_info.x, new_info.y));
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
new_info.x, new_info.y,
new_info.width, new_info.height,
SWP_NOACTIVATE | SWP_NOZORDER |
(is_move ? 0 : SWP_NOMOVE) |
(is_resize ? 0 : SWP_NOSIZE)))
WIN32_API_FAILED ("SetWindowPos");
(is_move ? "" : "|NOMOVE"),
(is_resize ? "" : "|NOSIZE")));
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), NULL,
new_info.x, new_info.y,
new_info.width, new_info.height,
SWP_NOACTIVATE | SWP_NOZORDER |
(is_move ? 0 : SWP_NOMOVE) |
(is_resize ? 0 : SWP_NOSIZE)));
}
if (impl->position_info.no_bg)
......@@ -273,7 +278,7 @@ _gdk_window_move_resize_child (GdkWindow *window,
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
{
GDK_NOTE (MISC, g_print ("...ShowWindow(%p, SW_SHOWNA)\n",
GDK_NOTE (MISC, g_print ("... ShowWindow(%p, SW_SHOWNA)\n",
GDK_WINDOW_HWND (window)));
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
}
......@@ -291,22 +296,25 @@ _gdk_window_move_resize_child (GdkWindow *window,
{
if (impl->position_info.mapped && !new_info.mapped)
{
GDK_NOTE (MISC, g_print ("...ShowWindow(%p, SW_HIDE)\n",
GDK_NOTE (MISC, g_print ("... ShowWindow(%p, SW_HIDE)\n",
GDK_WINDOW_HWND (window)));
ShowWindow (GDK_WINDOW_HWND (window), SW_HIDE);
}
GDK_NOTE (MISC, g_print ("...SetWindowPos(%p,%dx%d@+%d+%d)\n",
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%d,%d,"
"NOACTIVATE|NOZORDER%s%s)\n",
GDK_WINDOW_HWND (window),
new_info.x, new_info.y,
new_info.width, new_info.height,
new_info.x, new_info.y));
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
new_info.x, new_info.y,
new_info.width, new_info.height,
SWP_NOACTIVATE | SWP_NOZORDER |
(is_move ? 0 : SWP_NOMOVE) |
(is_resize ? 0 : SWP_NOSIZE)))
WIN32_API_FAILED ("SetWindowPos");
(is_move ? "" : "|NOMOVE"),
(is_resize ? "" : "|NOSIZE")));
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), NULL,
new_info.x, new_info.y,
new_info.width, new_info.height,
SWP_NOACTIVATE | SWP_NOZORDER |
(is_move ? 0 : SWP_NOMOVE) |
(is_resize ? 0 : SWP_NOSIZE)));
tmp_list = obj->children;
while (tmp_list)
......@@ -320,7 +328,7 @@ _gdk_window_move_resize_child (GdkWindow *window,
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
{
GDK_NOTE (MISC, g_print ("...ShowWindow(%p, SW_SHOWNA)\n",
GDK_NOTE (MISC, g_print ("... ShowWindow(%p, SW_SHOWNA)\n",
GDK_WINDOW_HWND (window)));
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
}
......@@ -524,18 +532,18 @@ gdk_window_postmove (GdkWindow *window,
if (anti_scroll || (anti_scroll = d_xoffset != 0 || d_yoffset != 0))
{
GDK_NOTE (MISC, g_print ("gdk_window_postmove: %s@+%d+%d\n"
"...SetWindowPos(%dx%d@+%d+%d)\n",
GDK_NOTE (MISC, g_print ("gdk_window_postmove: %s@%+d%+d\n"
"... SetWindowPos(%p,NULL,%d,%d,0,0,"
"NOREDRAW|NOZORDER|NOACTIVATE|NOSIZE)\n",
_gdk_win32_drawable_description (window),
obj->x, obj->y,
new_info.width, new_info.height,
GDK_WINDOW_HWND (window),
new_info.x, new_info.y));
if (!SetWindowPos (GDK_WINDOW_HWND (window), NULL,
new_info.x, new_info.y,
0, 0,
SWP_NOREDRAW | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE))
WIN32_API_FAILED ("SetWindowPos");
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), NULL,
new_info.x, new_info.y,
0, 0,
SWP_NOREDRAW | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE));
}
if (!impl->position_info.mapped && new_info.mapped && GDK_WINDOW_IS_MAPPED (obj))
......
......@@ -490,7 +490,7 @@ _gdk_input_wintab_init_check (void)
gdkdev->info.num_axes));
for (i = 0; i < gdkdev->info.num_axes; i++)
GDK_NOTE (INPUT,
g_print ("...axis %d: %d--%d@%d (%d--%d@%d)\n",
g_print ("... axis %d: %d--%d@%d (%d--%d@%d)\n",
i,
gdkdev->axes[i].xmin_value,
gdkdev->axes[i].xmax_value,
......@@ -762,7 +762,7 @@ _gdk_input_other_event (GdkEvent *event,
display = gdk_drawable_get_display (window);
GDK_NOTE (EVENTS_OR_INPUT,
g_print ("gdk_input_win32_other_event: window=%p (%d,%d)\n",
g_print ("gdk_input_win32_other_event: window=%p %+d%+d\n",
GDK_WINDOW_HWND (window), x, y));
#else
......@@ -791,12 +791,12 @@ _gdk_input_other_event (GdkEvent *event,
* moved or resized, see bug #151090. */
if (_sizemove_in_progress)
{
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...ignored when moving/sizing\n"));
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... ignored when moving/sizing\n"));
return FALSE;
}
if (window == _gdk_parent_root && x_grab_window == NULL)
{
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...is root\n"));
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... is root\n"));
return FALSE;
}
......@@ -863,10 +863,10 @@ _gdk_input_other_event (GdkEvent *event,
|| !(x_grab_mask && masktest))
{
GDK_NOTE (EVENTS_OR_INPUT,
g_print ("...grabber doesn't want it\n"));
g_print ("... grabber doesn't want it\n"));
return FALSE;
}
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...to grabber\n"));
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... to grabber\n"));
g_object_ref(x_grab_window);
g_object_unref(window);
......@@ -880,7 +880,7 @@ _gdk_input_other_event (GdkEvent *event,
if (!GDK_WINDOW_IMPL_WIN32 (obj->impl)->extension_events_selected
|| !(obj->extension_events & masktest))
{
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...not selected\n"));
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... not selected\n"));
if (obj->parent == GDK_WINDOW_OBJECT (_gdk_parent_root))
return FALSE;
......@@ -890,7 +890,7 @@ _gdk_input_other_event (GdkEvent *event,
if (obj->event_mask & masktest)
{
GDK_NOTE (EVENTS_OR_INPUT,
g_print ("...wants ordinary event, ignoring this\n"));
g_print ("... wants ordinary event, ignoring this\n"));
return FALSE;
}
......@@ -904,7 +904,7 @@ _gdk_input_other_event (GdkEvent *event,
ScreenToClient (GDK_WINDOW_HWND (window), &pt);
x = pt.x;
y = pt.y;
GDK_NOTE (EVENTS_OR_INPUT, g_print ("...propagating to %p (%d,%d)\n",
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... propagating to %p %+d%+d\n",
GDK_WINDOW_HWND (window), x, y));
goto dijkstra;
}
......
......@@ -892,7 +892,7 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
}
#if 0
GDK_NOTE (EVENTS, g_print ("...group=%d level=%d cmods=%#x keyval=%s\n",
GDK_NOTE (EVENTS, g_print ("... group=%d level=%d cmods=%#x keyval=%s\n",
group, shift_level, tmp_modifiers, gdk_keyval_name (tmp_keyval)));
#endif
......
......@@ -927,7 +927,7 @@ _gdk_win32_key_to_string (LONG lParam)
gchar *
_gdk_win32_rect_to_string (const RECT *rect)
{
return static_printf ("%ldx%ld@+%ld+%ld",
return static_printf ("%ldx%ld@%+ld%+ld",
(rect->right - rect->left), (rect->bottom - rect->top),
rect->left, rect->top);
}
......@@ -935,7 +935,7 @@ _gdk_win32_rect_to_string (const RECT *rect)
gchar *
_gdk_win32_gdkrectangle_to_string (const GdkRectangle *rect)
{
return static_printf ("%dx%d@+%d+%d",
return static_printf ("%dx%d@%+d%+d",
rect->width, rect->height,
rect->x, rect->y);
}
......@@ -943,7 +943,7 @@ _gdk_win32_gdkrectangle_to_string (const GdkRectangle *rect)
gchar *
_gdk_win32_gdkregion_to_string (const GdkRegion *rgn)
{
return static_printf ("%dx%d@+%d+%d",
return static_printf ("%dx%d@%+d%+d",
(rgn->extents.x2 - rgn->extents.x1),
(rgn->extents.y2 - rgn->extents.y1),
rgn->extents.x1, rgn->extents.y1);
......
......@@ -108,8 +108,7 @@ gdk_pixmap_impl_win32_finalize (GObject *object)
GDK_NOTE (PIXMAP, g_print ("gdk_pixmap_impl_win32_finalize: %p\n",
GDK_PIXMAP_HBITMAP (wrapper)));
if (!DeleteObject (GDK_PIXMAP_HBITMAP (wrapper)))
WIN32_GDI_FAILED ("DeleteObject");
GDI_CALL (DeleteObject, (GDK_PIXMAP_HBITMAP (wrapper)));
gdk_win32_handle_table_remove (GDK_PIXMAP_HBITMAP (wrapper));
......@@ -291,10 +290,9 @@ gdk_pixmap_new (GdkDrawable *drawable,
if (holdpal != NULL)
SelectPalette (hdc, holdpal, FALSE);
if (!ReleaseDC (hwnd, hdc))
WIN32_GDI_FAILED ("ReleaseDC");
GDI_CALL (ReleaseDC, (hwnd, hdc));
GDK_NOTE (PIXMAP, g_print ("...=%p bits=%p pixmap=%p\n", hbitmap, bits, pixmap));
GDK_NOTE (PIXMAP, g_print ("... =%p bits=%p pixmap=%p\n", hbitmap, bits, pixmap));
if (hbitmap == NULL)
{
......@@ -311,7 +309,7 @@ gdk_pixmap_new (GdkDrawable *drawable,
return pixmap;
}
static unsigned char mirror[256] = {
static const unsigned char mirror[256] = {
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
......
......@@ -319,7 +319,7 @@ gdk_property_change (GdkWindow *window,
if (data[i] == '\n')
size++;
size++;
GDK_NOTE (DND, g_print ("...as text: %.40s\n", data));
GDK_NOTE (DND, g_print ("... as text: %.40s\n", data));
}
else if (G_WIN32_IS_NT_BASED ())
{
......@@ -332,7 +332,7 @@ gdk_property_change (GdkWindow *window,
wclen++; /* Terminating 0 */
size = wclen * 2;
GDK_NOTE (DND, g_print ("...as Unicode\n"));
GDK_NOTE (DND, g_print ("... as Unicode\n"));
}
else if (find_common_locale (data, nelements, nchars, &lcid, &buf, &size))
{
......@@ -340,7 +340,7 @@ gdk_property_change (GdkWindow *window,
* some installed locale, use CF_TEXT and CF_LOCALE.
*/
method = SINGLE_LOCALE;
GDK_NOTE (DND, g_print ("...as text in locale %#lx %d bytes\n",
GDK_NOTE (DND, g_print ("... as text in locale %#lx %d bytes\n",
(gulong) lcid, size));
}
else
......@@ -384,7 +384,7 @@ gdk_property_change (GdkWindow *window,
}
rtf = g_string_append (rtf, "}");
size = rtf->len + 1;
GDK_NOTE (DND, g_print ("...as RTF: %.40s\n", rtf->str));
GDK_NOTE (DND, g_print ("... as RTF: %.40s\n", rtf->str));
}
if (!(hdata = GlobalAlloc (GMEM_MOVEABLE, size)))
......
......@@ -253,7 +253,7 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
* gdk_property_change will be called to store the clipboard
* data.
*/
GDK_NOTE (DND, g_print ("...sending GDK_SELECTION_REQUEST to ourselves\n"));
GDK_NOTE (DND, g_print ("... sending GDK_SELECTION_REQUEST to ourselves\n"));
tmp_event.selection.type = GDK_SELECTION_REQUEST;
tmp_event.selection.window = owner;
tmp_event.selection.send_event = FALSE;
......@@ -423,7 +423,7 @@ gdk_selection_convert (GdkWindow *requestor,
{
length = GlobalSize (hdata);
GDK_NOTE (DND, g_print ("...CF_UNICODETEXT: %ld bytes\n",
GDK_NOTE (DND, g_print ("... CF_UNICODETEXT: %ld bytes\n",
length));
/* Strip out \r */
......@@ -464,7 +464,7 @@ gdk_selection_convert (GdkWindow *requestor,
{
length = GlobalSize (hdata);
GDK_NOTE (DND, g_print ("...UTF8_STRING: %d bytes: %.10s\n",
GDK_NOTE (DND, g_print ("... UTF8_STRING: %d bytes: %.10s\n",
length, ptr));
_gdk_selection_property_store (requestor, target, 8,
......@@ -488,7 +488,7 @@ gdk_selection_convert (GdkWindow *requestor,
{
length = GlobalSize (hdata);
GDK_NOTE (DND, g_print ("...CF_TEXT: %ld bytes: %.10s\n",
GDK_NOTE (DND, g_print ("... CF_TEXT: %ld bytes: %.10s\n",
length, ptr));
if ((hlcid = GetClipboardData (CF_LOCALE)) != NULL)
......@@ -499,7 +499,7 @@ gdk_selection_convert (GdkWindow *requestor,
buf, sizeof (buf)))
{
cp = atoi (buf);
GDK_NOTE (DND, g_print ("...CF_LOCALE: %#lx cp:%d\n",
GDK_NOTE (DND, g_print ("... CF_LOCALE: %#lx cp:%d\n",
*lcidptr, cp));
}
GlobalUnlock (hlcid);
......@@ -556,7 +556,7 @@ gdk_selection_convert (GdkWindow *requestor,
BITMAPFILEHEADER *hdr; /* need to add a file header so gdk-pixbuf can load it */
gint length = GlobalSize (hdata) + sizeof(BITMAPFILEHEADER);
GDK_NOTE (DND, g_print ("...BITMAP: %d bytes\n", length));
GDK_NOTE (DND, g_print ("... BITMAP: %d bytes\n", length));
data = g_try_malloc (length);
if (data)
......
......@@ -483,6 +483,7 @@ gdk_window_new_internal (GdkWindow *parent,
gint attributes_mask,
gboolean from_set_skip_taskbar_hint)
{
HWND hwndNew;
HANDLE hparent;
ATOM klass = 0;
DWORD dwStyle = 0, dwExStyle;
......@@ -602,7 +603,7 @@ gdk_window_new_internal (GdkWindow *parent,