Bug #588388 - shape rendering is back

Just mapping exisiting implementations to new GdkWindow API.

http://bugzilla.gnome.org/show_bug.cgi?id=588388
This commit is contained in:
Hans Breuer 2009-07-12 18:58:59 +02:00
parent 4c2c45740d
commit b72960f12d

View File

@ -1,7 +1,7 @@
/* GDK - The GIMP Drawing Kit /* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 1998-2004 Tor Lillqvist * Copyright (C) 1998-2004 Tor Lillqvist
* Copyright (C) 2001-2004 Hans Breuer * Copyright (C) 2001-2009 Hans Breuer
* Copyright (C) 2007-2009 Cody Russell * Copyright (C) 2007-2009 Cody Russell
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -3556,8 +3556,13 @@ gdk_window_set_opacity (GdkWindow *window,
GdkRegion * GdkRegion *
_gdk_windowing_get_shape_for_mask (GdkBitmap *mask) _gdk_windowing_get_shape_for_mask (GdkBitmap *mask)
{ {
// XXX: TODO GdkRegion *region;
return NULL; HRGN hrgn = _gdk_win32_bitmap_to_hrgn (mask);
region = _gdk_win32_hrgn_to_region (hrgn);
DeleteObject (hrgn);
return region;
} }
void void
@ -3568,13 +3573,25 @@ _gdk_windowing_window_set_composited (GdkWindow *window, gboolean composited)
GdkRegion * GdkRegion *
_gdk_windowing_window_get_shape (GdkWindow *window) _gdk_windowing_window_get_shape (GdkWindow *window)
{ {
return NULL; HRGN hrgn = CreateRectRgn (0, 0, 0, 0);
int type = GetWindowRgn (GDK_WINDOW_HWND (window), hrgn);
if (type == SIMPLEREGION || type == COMPLEXREGION)
{
GdkRegion *region = _gdk_win32_hrgn_to_region (hrgn);
DeleteObject (hrgn);
return region;
}
return NULL;
} }
GdkRegion * GdkRegion *
_gdk_windowing_window_get_input_shape (GdkWindow *window) _gdk_windowing_window_get_input_shape (GdkWindow *window)
{ {
return NULL; /* CHECK: are these really supposed to be the same? */
return _gdk_windowing_window_get_shape (window);
} }
static void static void
@ -3617,6 +3634,10 @@ gdk_win32_input_shape_combine_region (GdkWindow *window,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
if (GDK_WINDOW_DESTROYED (window))
return;
/* CHECK: are these really supposed to be the same? */
return gdk_win32_window_shape_combine_region (window, shape_region, offset_x, offset_y);
} }
void void