summaryrefslogtreecommitdiff
path: root/gdk/win32/gdkgeometry-win32.c
diff options
context:
space:
mode:
authorHans Breuer <hans@breuer.org>2005-07-03 15:47:42 +0000
committerHans Breuer <hans@src.gnome.org>2005-07-03 15:47:42 +0000
commit19e9165d64e954a64edd2cd9b29f0073c888c802 (patch)
tree543c0f66cf4b64be65f8b83f7484af745d89066d /gdk/win32/gdkgeometry-win32.c
parent1d1b9c7abec5a5b505f2009e969c018b0906a467 (diff)
downloadgtk+-19e9165d64e954a64edd2cd9b29f0073c888c802.tar.gz
updated <io.h> for open() use G_PI instead of M_PI
2005-07-03 Hans Breuer <hans@breuer.org> * **/makefile.msc[.in] : updated * gtk/gtkiconcache.c : <io.h> for open() * gtk/gtkstyle.c : use G_PI instead of M_PI * gdk/win32/gdkcursor-win32.c : implement gdk_cursor_new_from_name() by mapping the lower case win32 api name to the respective cursor. E.g. pass "wait" to get the IDC_WAIT cursor. Also allows to load cursors from named resources in the executable. (gdk_cursor_get_image) : just return NULL for now. * gdk/win32/gdkgeometry-win32.c : implement gdk_window_move_region() by delegation to ScollWindowEx(), untested. * gdk/win32/gdkwindow-win32.c : stub for gdk_window_set_urgency_hint()
Diffstat (limited to 'gdk/win32/gdkgeometry-win32.c')
-rw-r--r--gdk/win32/gdkgeometry-win32.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/gdk/win32/gdkgeometry-win32.c b/gdk/win32/gdkgeometry-win32.c
index 8308a197d4..5c5b51be81 100644
--- a/gdk/win32/gdkgeometry-win32.c
+++ b/gdk/win32/gdkgeometry-win32.c
@@ -178,6 +178,84 @@ gdk_window_scroll (GdkWindow *window,
}
void
+gdk_window_move_region (GdkWindow *window,
+ GdkRegion *region,
+ gint dx,
+ gint dy)
+{
+ GdkRegion *invalidate_region;
+ GdkWindowImplWin32 *impl;
+ GdkWindowObject *obj;
+ GdkRectangle src_rect, dest_rect;
+ HRGN hrgn;
+ RECT clipRect, destRect;
+
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ if (GDK_WINDOW_DESTROYED (window))
+ return;
+
+ obj = GDK_WINDOW_OBJECT (window);
+ impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);
+
+ if (dx == 0 && dy == 0)
+ return;
+
+ /* Move the current invalid region */
+ if (obj->update_area)
+ gdk_region_offset (obj->update_area, dx, dy);
+
+ /* impl->position_info.clip_rect isn't meaningful for toplevels */
+ if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
+ src_rect = impl->position_info.clip_rect;
+ else
+ {
+ src_rect.x = 0;
+ src_rect.y = 0;
+ src_rect.width = impl->width;
+ src_rect.height = impl->height;
+ }
+
+ invalidate_region = gdk_region_rectangle (&src_rect);
+
+ dest_rect = src_rect;
+ dest_rect.x += dx;
+ dest_rect.y += dy;
+ gdk_rectangle_intersect (&dest_rect, &src_rect, &dest_rect);
+
+ if (dest_rect.width > 0 && dest_rect.height > 0)
+ {
+ GdkRegion *tmp_region;
+
+ tmp_region = gdk_region_rectangle (&dest_rect);
+ gdk_region_subtract (invalidate_region, tmp_region);
+ gdk_region_destroy (tmp_region);
+ }
+
+ /* no guffaw scroll on win32 */
+ hrgn = _gdk_win32_gdkregion_to_hrgn(invalidate_region, 0, 0);
+ gdk_region_destroy (invalidate_region);
+ destRect.left = dest_rect.y;
+ destRect.top = dest_rect.x;
+ destRect.right = dest_rect.x + dest_rect.width;
+ destRect.bottom = dest_rect.y + dest_rect.height;
+ clipRect.left = src_rect.y;
+ clipRect.top = src_rect.x;
+ clipRect.right = src_rect.x + src_rect.width;
+ clipRect.bottom = src_rect.y + src_rect.height;
+
+ g_print ("ScrollWindowEx(%d, %d, ...) - if you see this work, remove trace;)\n", dx, dy);
+ API_CALL(ScrollWindowEx, (GDK_WINDOW_HWND (window),
+ dx, dy, /* in: scroll offsets */
+ NULL, /* in: scroll rect, NULL == entire client area */
+ &clipRect, /* in: restrict to */
+ hrgn, /* in: update region */
+ NULL, /* out: update rect */
+ SW_INVALIDATE));
+ API_CALL(DeleteObject, (hrgn));
+}
+
+void
_gdk_window_move_resize_child (GdkWindow *window,
gint x,
gint y,