[gtk+/client-side-windows: 282/284] Updates



commit 49a0ec6e95408e3484397602ad46e274cedbf98b
Author: Cody Russell <bratsche gnome org>
Date:   Tue Feb 24 15:52:32 2009 +0000

    Updates
---
 gdk/gdkdraw.c                 |    3 +-
 gdk/win32/gdkdrawable-win32.c |    7 ++-
 gdk/win32/gdkevents-win32.c   |   27 +++-------
 gdk/win32/gdkgeometry-win32.c |  114 +++++++++++++++++++++++++++++++----------
 gdk/win32/gdkinput-win32.c    |    3 +-
 gdk/win32/gdkmain-win32.c     |    2 +
 gdk/win32/gdkpixmap-win32.c   |    2 -
 gdk/win32/gdkprivate-win32.h  |    2 +
 gdk/win32/gdkwindow-win32.c   |   32 ++++++++----
 gdk/win32/gdkwindow-win32.h   |    8 +++
 10 files changed, 137 insertions(+), 63 deletions(-)

diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index 9c9385f..8c5d422 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -150,7 +150,8 @@ gdk_drawable_get_size (GdkDrawable *drawable,
 {
   g_return_if_fail (GDK_IS_DRAWABLE (drawable));
 
-  GDK_DRAWABLE_GET_CLASS (drawable)->get_size (drawable, width, height);  
+  if (GDK_DRAWABLE_GET_CLASS (drawable)->get_size != NULL)
+    GDK_DRAWABLE_GET_CLASS (drawable)->get_size (drawable, width, height);  
 }
 
 /**
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index 34500fc..b9fe1f9 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -1662,7 +1662,9 @@ _gdk_win32_blit (gboolean              use_fg_bg,
   gdk_drawable_get_size (src, &src_width, &src_height);
 
   if ((src_rgn = CreateRectRgn (0, 0, src_width + 1, src_height + 1)) == NULL)
-    WIN32_GDI_FAILED ("CreateRectRgn");
+    {
+      WIN32_GDI_FAILED ("CreateRectRgn");
+    }
   else if ((draw_rgn = CreateRectRgn (xsrc, ysrc,
 				      xsrc + width + 1,
 				      ysrc + height + 1)) == NULL)
@@ -1733,6 +1735,7 @@ _gdk_win32_blit (gboolean              use_fg_bg,
 		      xsrc, ysrc, xdest, ydest, width, height);
   else
     blit_from_window (hdc, GDK_GC_WIN32 (gc), src_impl, xsrc, ysrc, xdest, ydest, width, height);
+
   gdk_win32_hdc_release (&draw_impl->parent_instance, gc, GDK_GC_FOREGROUND);
 }
 
@@ -1947,6 +1950,6 @@ _gdk_win32_drawable_finish (GdkDrawable *drawable)
 				   NULL, NULL);
     }
   
-  g_assert (impl->hdc_count == 0);
+  //g_assert (impl->hdc_count == 0);
 }
 
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 7d2140d..ec0b066 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -1377,15 +1377,13 @@ synthesize_enter_or_leave_event (GdkWindow    	*window,
 				 gint         	 y)
 {
   GdkEvent *event;
-  gint xoffset, yoffset;
   
   event = gdk_event_new (type);
   event->crossing.window = window;
   event->crossing.subwindow = NULL;
   event->crossing.time = _gdk_win32_get_next_tick (msg->time);
-  //_gdk_win32_windowing_window_get_offsets (window, &xoffset, &yoffset);
-  event->crossing.x = x + xoffset;
-  event->crossing.y = y + yoffset;
+  event->crossing.x = x;
+  event->crossing.y = y;
   event->crossing.x_root = msg->pt.x + _gdk_offset_x;
   event->crossing.y_root = msg->pt.y + _gdk_offset_y;
   event->crossing.mode = mode;
@@ -1940,7 +1938,6 @@ handle_wm_paint (MSG        *msg,
   HDC hdc;
   PAINTSTRUCT paintstruct;
   GdkRegion *update_region;
-  gint xoffset, yoffset;
 
   if (GetUpdateRgn (msg->hwnd, hrgn, FALSE) == ERROR)
     {
@@ -2025,10 +2022,13 @@ handle_wm_paint (MSG        *msg,
   update_region = _gdk_win32_hrgn_to_region (hrgn);
 
   //_gdk_win32_windowing_window_get_offsets (window, &xoffset, &yoffset);
-  gdk_region_offset (update_region, xoffset, yoffset);
+  //gdk_region_offset (update_region, xoffset, yoffset);
+
+  //  g_print ("handle_wm_paint: rect [%d %d %d %d]\n",
+  //	   update_region->x, update_region->y,
+  //	   update_region->width, update_region->height);
   
   _gdk_window_process_expose (window, update_region);
-  g_print ("handle_wm_paint\n");
   gdk_region_destroy (update_region);
 
   DeleteObject (hrgn);
@@ -2085,7 +2085,6 @@ generate_button_event (GdkEventType type,
 		       MSG         *msg)
 {
   GdkEvent *event = gdk_event_new (type);
-  gint xoffset, yoffset;
 
   event->button.window = window;
   event->button.time = _gdk_win32_get_next_tick (msg->time);
@@ -2093,9 +2092,6 @@ generate_button_event (GdkEventType type,
     translate_mouse_coords (orig_window, window, msg);
   event->button.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
   event->button.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
-  //_gdk_win32_windowing_window_get_offsets (window, &xoffset, &yoffset);
-  event->button.x += xoffset;
-  event->button.y += yoffset;
   event->button.x_root = msg->pt.x + _gdk_offset_x;
   event->button.y_root = msg->pt.y + _gdk_offset_y;
   event->button.axes = NULL;
@@ -2271,7 +2267,6 @@ gdk_event_translate (MSG  *msg,
   GdkWindowImplWin32 *impl;
 
   GdkWindow *orig_window, *new_window;
-  gint xoffset, yoffset;
 
   static gint update_colors_counter = 0;
   gint button;
@@ -2813,9 +2808,6 @@ gdk_event_translate (MSG  *msg,
       event->motion.time = _gdk_win32_get_next_tick (msg->time);
       event->motion.x = current_x = (gint16) GET_X_LPARAM (msg->lParam);
       event->motion.y = current_y = (gint16) GET_Y_LPARAM (msg->lParam);
-//      gdk_window_get_offsets (window, &xoffset, &yoffset);
-      event->motion.x += xoffset;
-      event->motion.y += yoffset;
       event->motion.x_root = current_root_x;
       event->motion.y_root = current_root_y;
       event->motion.axes = NULL;
@@ -2904,9 +2896,8 @@ gdk_event_translate (MSG  *msg,
       event->scroll.direction = (((short) HIWORD (msg->wParam)) > 0) ?
 	GDK_SCROLL_UP : GDK_SCROLL_DOWN;
       event->scroll.time = _gdk_win32_get_next_tick (msg->time);
-      //_gdk_win32_windowing_window_get_offsets (window, &xoffset, &yoffset);
-      event->scroll.x = (gint16) point.x + xoffset;
-      event->scroll.y = (gint16) point.y + yoffset;
+      event->scroll.x = (gint16) point.x;
+      event->scroll.y = (gint16) point.y;
       event->scroll.x_root = (gint16) GET_X_LPARAM (msg->lParam) + _gdk_offset_x;
       event->scroll.y_root = (gint16) GET_Y_LPARAM (msg->lParam) + _gdk_offset_y;
       event->scroll.state = build_pointer_event_state (msg);
diff --git a/gdk/win32/gdkgeometry-win32.c b/gdk/win32/gdkgeometry-win32.c
index 6a42626..ec89cec 100644
--- a/gdk/win32/gdkgeometry-win32.c
+++ b/gdk/win32/gdkgeometry-win32.c
@@ -67,42 +67,48 @@ _gdk_window_move_resize_child (GdkWindow *window,
   obj = GDK_WINDOW_OBJECT (window);
   impl = GDK_WINDOW_IMPL_WIN32 (obj->impl);
 
-  is_move = (x - obj->x != 0) && (y - obj->y != 0);
-  is_resize = obj->width != width && obj->height != height;
+  is_move = 0; // (x - obj->x != 0) && (y - obj->y != 0);
+  is_resize = 0; // obj->width != width && obj->height != height;
   
   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));
+			   _gdk_win32_drawable_description (window),
+			   obj->x, obj->y, width, height, x, y));
 
   if (width > 65535 || height > 65535)
   {
-	  g_warning ("Native children wider or taller than 65535 pixels are not supported.");
+    g_warning ("Native children wider or taller than 65535 pixels are not supported.");
 
-	  if (width > 65535)
-		  width = 65535;
-	  if (height > 65535)
-		  height = 65535;
+    if (width > 65535)
+      width = 65535;
+    if (height > 65535)
+      height = 65535;
   }
 
   obj->x = x;
   obj->y = y;
   obj->width = width;
   obj->height = height;
+
+  _gdk_win32_window_tmp_unset_parent_bg (window);
+  _gdk_win32_window_tmp_unset_bg (window, TRUE);
   
   GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%d,%d,"
-		       "NOACTIVATE|NOZORDER%s%s)\n",
-		       GDK_WINDOW_HWND (window),
-		       obj->x + obj->parent->abs_x, obj->y + obj->parent->abs_y, 
-		       width, height,
-		       (is_move ? "" : "|NOMOVE"),
-		       (is_resize ? "" : "|NOSIZE")));
+			   "NOACTIVATE|NOZORDER%s%s)\n",
+			   GDK_WINDOW_HWND (window),
+			   obj->x + obj->parent->abs_x, obj->y + obj->parent->abs_y, 
+			   width, height,
+			   (is_move ? "" : "|NOMOVE"),
+			   (is_resize ? "" : "|NOSIZE")));
 
   API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), NULL,
-		       obj->x + obj->parent->abs_x, obj->y + obj->parent->abs_y, 
-		       width, height,
-		       SWP_NOACTIVATE | SWP_NOZORDER | 
-		       (is_move ? 0 : SWP_NOMOVE) |
-		       (is_resize ? 0 : SWP_NOSIZE)));
+			   obj->x + obj->parent->abs_x, obj->y + obj->parent->abs_y, 
+			   width, height,
+			   SWP_NOACTIVATE | SWP_NOZORDER | 
+			   (is_move ? 0 : SWP_NOMOVE) |
+			   (is_resize ? 0 : SWP_NOSIZE)));
+
+  //_gdk_win32_window_tmp_reset_parent_bg (window);
+  //_gdk_win32_window_tmp_reset_bg (window, TRUE);
 }
 
 void
@@ -119,13 +125,44 @@ _gdk_window_process_expose (GdkWindow *window,
 
   if (!gdk_region_empty (invalidate_region))
     _gdk_window_invalidate_for_expose (window, invalidate_region);
+  else
+    g_print ("process_expose(), empty region\n");
   
-  g_print ("_gdk_window_process_expose\n");
-  gdk_region_destroy (invalidate_region);
+  //gdk_region_destroy (invalidate_region);
+}
+
+void
+_gdk_win32_window_tmp_unset_bg (GdkWindow *window,
+				gboolean recurse)
+{
+  GdkWindowObject *private;
+
+  g_return_if_fail (GDK_IS_WINDOW (window));
+
+  private = (GdkWindowObject *)window;
+
+  if (private->input_only || private->destroyed ||
+      (private->window_type != GDK_WINDOW_ROOT &&
+       !GDK_WINDOW_IS_MAPPED (window)))
+    return;
+
+  if (_gdk_window_has_impl (window) &&
+      GDK_WINDOW_IS_WIN32 (window) &&
+      private->window_type != GDK_WINDOW_ROOT &&
+      private->window_type != GDK_WINDOW_FOREIGN)
+    tmp_unset_bg (window);
+
+  if (recurse)
+    {
+      GList *l;
+
+      for (l = private->children; l != NULL; l = l->next)
+	_gdk_win32_window_tmp_unset_bg (l->data, TRUE);
+    }
 }
 
 static void
-gdk_window_tmp_unset_bg (GdkWindow *window)
+tmp_unset_bg (GdkWindow *window)
 {
   GdkWindowImplWin32 *impl;
   GdkWindowObject *obj;
@@ -140,11 +177,28 @@ gdk_window_tmp_unset_bg (GdkWindow *window)
    * Not sure if this could really emulate it.
    */
   if (obj->bg_pixmap != GDK_NO_BG)
-    /* handled in WM_ERASEBKGRND proceesing */;
+    {
+      ///* handled in WM_ERASEBKGRND proceesing */;
+
+      //HDC hdc = GetDC (GDK_WINDOW_HWND (window));
+      //erase_background (window, hdc);
+    }
 }
 
-static void
-gdk_window_tmp_reset_bg (GdkWindow *window)
+void
+_gdk_win32_window_tmp_unset_parent_bg (GdkWindow *window)
+{
+  GdkWindowObject *private = (GdkWindowObject*)window;
+
+  if (GDK_WINDOW_TYPE (private->parent) == GDK_WINDOW_ROOT)
+    return;
+
+  window = _gdk_window_get_impl_window ((GdkWindow*)private->parent);
+  _gdk_win32_window_tmp_unset_bg (window, FALSE);
+}
+
+void
+_gdk_win32_window_tmp_reset_bg (GdkWindow *window)
 {
   GdkWindowImplWin32 *impl;
   GdkWindowObject *obj;
@@ -155,6 +209,7 @@ gdk_window_tmp_reset_bg (GdkWindow *window)
   impl->no_bg = FALSE;
 }
 
+#if 0
 static GdkRegion *
 gdk_window_clip_changed (GdkWindow    *window,
 			 GdkRectangle *old_clip,
@@ -186,16 +241,17 @@ gdk_window_clip_changed (GdkWindow    *window,
     gdk_window_tmp_unset_bg (window);
   else
     {
-      g_print ("gdk_window_clip_changed (new_clip_region)\n");
       gdk_region_destroy (new_clip_region);
       new_clip_region = NULL;
     }
-  g_print ("gdk_window_clip_changed (old_clip_region)\n");
+
   gdk_region_destroy (old_clip_region);
 
   return new_clip_region;
 }
+#endif
 
+#if 0
 static void
 gdk_window_post_scroll (GdkWindow    *window,
 			GdkRegion    *new_clip_region)
@@ -208,3 +264,5 @@ gdk_window_post_scroll (GdkWindow    *window,
   g_print ("gdk_window_post_scroll\n");
   gdk_region_destroy (new_clip_region);
 }
+
+#endif
diff --git a/gdk/win32/gdkinput-win32.c b/gdk/win32/gdkinput-win32.c
index c463794..1510c24 100644
--- a/gdk/win32/gdkinput-win32.c
+++ b/gdk/win32/gdkinput-win32.c
@@ -647,7 +647,7 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
 				 gdouble          *x_out,
 				 gdouble          *y_out)
 {
-  GdkWindowImplWin32 *impl, *root_impl;
+  GdkWindowImplWin32 *root_impl;
   GdkWindowObject *window_object;
 
   int i;
@@ -658,7 +658,6 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
   double x_offset, y_offset, x_scale, y_scale;
 
   window_object = GDK_WINDOW_OBJECT (input_window);
-  impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (input_window->window)->impl);
 
   for (i=0; i<gdkdev->info.num_axes; i++)
     {
diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c
index 59487dd..d31771d 100644
--- a/gdk/win32/gdkmain-win32.c
+++ b/gdk/win32/gdkmain-win32.c
@@ -1165,6 +1165,8 @@ _gdk_win32_drawable_description (GdkDrawable *d)
 {
   gint width, height, depth;
 
+  g_return_val_if_fail (GDK_IS_DRAWABLE (d), NULL);
+
   gdk_drawable_get_size (d, &width, &height);
   depth = gdk_drawable_get_depth (d);
 
diff --git a/gdk/win32/gdkpixmap-win32.c b/gdk/win32/gdkpixmap-win32.c
index 38beaf6..860bff2 100644
--- a/gdk/win32/gdkpixmap-win32.c
+++ b/gdk/win32/gdkpixmap-win32.c
@@ -123,8 +123,6 @@ gdk_pixmap_impl_win32_get_size (GdkDrawable *drawable,
 				gint        *width,
 				gint        *height)
 {
-  g_print ("gdk_pixmap_impl_win32_get_size()\n");
-
   if (width)
     *width = GDK_PIXMAP_IMPL_WIN32 (drawable)->width;
   if (height)
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index 4327307..84284a8 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -115,6 +115,8 @@
 //#define GDK_WINDOW_SCREEN(win)         (_gdk_screen)
 GdkScreen *GDK_WINDOW_SCREEN(GObject *win);
 
+#define GDK_WINDOW_IS_WIN32(win)        (GDK_IS_WINDOW_IMPL_WIN32 (((GdkWindowObject *)win)->impl))
+
 typedef struct _GdkColormapPrivateWin32 GdkColormapPrivateWin32;
 typedef struct _GdkCursorPrivate        GdkCursorPrivate;
 typedef struct _GdkWin32SingleFont      GdkWin32SingleFont;
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 5d231b4..c0f18b0 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -1431,6 +1431,7 @@ static void
 erase_background (GdkWindow *window,
 		  HDC        hdc)
 {
+#if 0
   HDC bgdc = NULL;
   HBRUSH hbr = NULL;
   HPALETTE holdpal = NULL;
@@ -1558,6 +1559,7 @@ erase_background (GdkWindow *window,
 	  DeleteDC (bgdc);
 	}
     }
+#endif
 }
 
 static void
@@ -3548,7 +3550,7 @@ gdk_window_set_modal_hint (GdkWindow *window,
 
 void
 gdk_window_set_skip_taskbar_hint (GdkWindow *window,
-								  gboolean   skips_taskbar)
+				  gboolean   skips_taskbar)
 {
   static GdkWindow *owner = NULL;
   //GdkWindowAttr wa;
@@ -3594,7 +3596,7 @@ gdk_window_set_skip_taskbar_hint (GdkWindow *window,
 
 void
 gdk_window_set_skip_pager_hint (GdkWindow *window,
-								gboolean   skips_pager)
+				gboolean   skips_pager)
 {
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -3605,7 +3607,7 @@ gdk_window_set_skip_pager_hint (GdkWindow *window,
 
 void
 gdk_window_set_type_hint (GdkWindow        *window,
-						  GdkWindowTypeHint hint)
+			  GdkWindowTypeHint hint)
 {
   g_return_if_fail (GDK_IS_WINDOW (window));
   
@@ -3640,9 +3642,9 @@ gdk_window_get_type_hint (GdkWindow *window)
 
 static void
 gdk_win32_window_shape_combine_region (GdkWindow       *window,
-									   const GdkRegion *shape_region,
-									   gint             offset_x,
-									   gint             offset_y)
+				       const GdkRegion *shape_region,
+				       gint             offset_x,
+				       gint             offset_y)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
 
@@ -3764,14 +3766,14 @@ _gdk_windowing_window_get_input_shape (GdkWindow *window)
 
 static void
 _gdk_win32_window_destroy (GdkWindow *window,
-						   gboolean   recursing,
-						   gboolean   foreign_destroy)
+			   gboolean   recursing,
+			   gboolean   foreign_destroy)
 {
 }
 
 static gboolean
 _gdk_win32_window_queue_antiexpose (GdkWindow *window,
-									GdkRegion *area)
+				    GdkRegion *area)
 {
   HRGN hrgn = _gdk_win32_gdkregion_to_hrgn (area, 0, 0);
 
@@ -3787,6 +3789,15 @@ _gdk_win32_window_queue_antiexpose (GdkWindow *window,
 }
 
 static void
+_gdk_win32_window_queue_translation (GdkWindow *window,
+				     GdkRegion *area,
+				     gint       dx,
+				     gint       dy)
+{
+  g_print ("queue_translation\n");
+}
+
+static void
 gdk_win32_input_shape_combine_region (GdkWindow *window,
 				      const GdkRegion *shape_region,
 				      gint offset_x,
@@ -3798,6 +3809,7 @@ void
 _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
 					       GdkRegion *region)
 {
+  _gdk_window_process_updates_recurse (window, region);
 }
 
 void
@@ -3833,6 +3845,6 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
   iface->get_deskrelative_origin = gdk_win32_window_get_deskrelative_origin;
   iface->set_static_gravities = gdk_win32_window_set_static_gravities;
   iface->queue_antiexpose = _gdk_win32_window_queue_antiexpose;
-  iface->queue_translation = NULL; //_gdk_win32_window_queue_translation;
+  iface->queue_translation = _gdk_win32_window_queue_translation;
   iface->destroy = _gdk_win32_window_destroy;
 }
diff --git a/gdk/win32/gdkwindow-win32.h b/gdk/win32/gdkwindow-win32.h
index 3ce4e9d..f488e59 100644
--- a/gdk/win32/gdkwindow-win32.h
+++ b/gdk/win32/gdkwindow-win32.h
@@ -99,6 +99,14 @@ struct _GdkWindowImplWin32Class
 
 GType _gdk_window_impl_win32_get_type (void);
 
+void  _gdk_win32_window_tmp_unset_bg  (GdkWindow *window,
+				       gboolean   recurse);
+void  _gdk_win32_window_tmp_reset_bg  (GdkWindow *window,
+				       gboolean   recurse);
+
+void  _gdk_win32_window_tmp_unset_parent_bg (GdkWindow *window);
+void  _gdk_win32_window_tmp_reset_parent_bg (GdkWindow *window);
+
 G_END_DECLS
 
 #endif /* __GDK_WINDOW_WIN32_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]