gdk: Remove GdkSurfaceImpl::shape_combine_region vfunc
authorBenjamin Otte <otte@redhat.com>
Wed, 21 Mar 2018 19:15:21 +0000 (20:15 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 21 Mar 2018 22:28:26 +0000 (23:28 +0100)
... and all the implementations.

Input shapes still exist.

gdk/broadway/gdksurface-broadway.c
gdk/gdksurfaceimpl.h
gdk/quartz/gdksurface-quartz.c
gdk/wayland/gdksurface-wayland.c
gdk/win32/gdksurface-win32.c
gdk/x11/gdksurface-x11.c

index 06ba909c5727862d578b0b5d11d54da5e1d9a2ba..29c449d7f1fe385f7d78c0c118871a9cae2e2dd1 100644 (file)
@@ -635,14 +635,6 @@ gdk_surface_broadway_set_events (GdkSurface    *surface,
     }
 }
 
-static void
-gdk_surface_broadway_shape_combine_region (GdkSurface       *surface,
-                                           const cairo_region_t *shape_region,
-                                           gint             offset_x,
-                                           gint             offset_y)
-{
-}
-
 static void
 gdk_surface_broadway_input_shape_combine_region (GdkSurface       *surface,
                                                  const cairo_region_t *shape_region,
@@ -1381,7 +1373,6 @@ gdk_surface_impl_broadway_class_init (GdkSurfaceImplBroadwayClass *klass)
   impl_class->get_geometry = gdk_surface_broadway_get_geometry;
   impl_class->get_root_coords = gdk_surface_broadway_get_root_coords;
   impl_class->get_device_state = gdk_surface_broadway_get_device_state;
-  impl_class->shape_combine_region = gdk_surface_broadway_shape_combine_region;
   impl_class->input_shape_combine_region = gdk_surface_broadway_input_shape_combine_region;
   impl_class->destroy = _gdk_broadway_surface_destroy;
   impl_class->end_paint = gdk_broadway_surface_end_paint;
index a2488db5e37a288ec4801fa5470b4c8e9f9938e7..5e83072f5527c8870fbb0114c6fe27ccdff91fe4 100644 (file)
@@ -103,10 +103,6 @@ struct _GdkSurfaceImplClass
   gboolean    (* begin_paint)           (GdkSurface       *surface);
   void        (* end_paint)             (GdkSurface       *surface);
 
-  void         (* shape_combine_region) (GdkSurface       *surface,
-                                         const cairo_region_t *shape_region,
-                                         gint             offset_x,
-                                         gint             offset_y);
   void         (* input_shape_combine_region) (GdkSurface       *surface,
                                                const cairo_region_t *shape_region,
                                                gint             offset_x,
index 73ef9ca422b62460b6e2a7dc7a930675491cf93a..f25ceb4f75279590e156b7f0d6c15ee5a53b4a81 100644 (file)
@@ -1823,15 +1823,6 @@ gdk_quartz_surface_set_transient_for (GdkSurface *window,
   GDK_QUARTZ_RELEASE_POOL;
 }
 
-static void
-gdk_surface_quartz_shape_combine_region (GdkSurface       *window,
-                                        const cairo_region_t *shape,
-                                        gint             x,
-                                        gint             y)
-{
-  /* FIXME: Implement */
-}
-
 static void
 gdk_surface_quartz_input_shape_combine_region (GdkSurface       *window,
                                               const cairo_region_t *shape_region,
@@ -2764,7 +2755,6 @@ gdk_surface_impl_quartz_class_init (GdkSurfaceImplQuartzClass *klass)
   impl_class->get_geometry = gdk_surface_quartz_get_geometry;
   impl_class->get_root_coords = gdk_surface_quartz_get_root_coords;
   impl_class->get_device_state = gdk_surface_quartz_get_device_state;
-  impl_class->shape_combine_region = gdk_surface_quartz_shape_combine_region;
   impl_class->input_shape_combine_region = gdk_surface_quartz_input_shape_combine_region;
   impl_class->destroy = gdk_quartz_surface_destroy;
   impl_class->begin_paint = gdk_surface_impl_quartz_begin_paint;
index 04811eb08fe3f20e59b265dccbf024f246a92bdb..c756c9a3f8f45d4eea5443feb3da9b749a16100e 100644 (file)
@@ -2761,14 +2761,6 @@ gdk_surface_wayland_get_device_state (GdkSurface       *surface,
   return return_val;
 }
 
-static void
-gdk_surface_wayland_shape_combine_region (GdkSurface            *surface,
-                                         const cairo_region_t *shape_region,
-                                         gint                  offset_x,
-                                         gint                  offset_y)
-{
-}
-
 static void
 gdk_surface_wayland_input_shape_combine_region (GdkSurface            *surface,
                                                const cairo_region_t *shape_region,
@@ -3616,7 +3608,6 @@ _gdk_surface_impl_wayland_class_init (GdkSurfaceImplWaylandClass *klass)
   impl_class->get_geometry = gdk_surface_wayland_get_geometry;
   impl_class->get_root_coords = gdk_surface_wayland_get_root_coords;
   impl_class->get_device_state = gdk_surface_wayland_get_device_state;
-  impl_class->shape_combine_region = gdk_surface_wayland_shape_combine_region;
   impl_class->input_shape_combine_region = gdk_surface_wayland_input_shape_combine_region;
   impl_class->destroy = gdk_wayland_surface_destroy;
   impl_class->begin_paint = gdk_surface_impl_wayland_begin_paint;
index 1156653e9d8f6b945310430b7f6b51fa614bcdc9..49cdb4f589bb1223358ed630b6203f60e02548ff 100644 (file)
@@ -2227,32 +2227,6 @@ gdk_win32_surface_set_events (GdkSurface   *window,
   impl->native_event_mask = GDK_STRUCTURE_MASK | event_mask;
 }
 
-static void
-do_shape_combine_region (GdkSurface *window,
-                        HRGN       hrgn,
-                        gint       x, gint y)
-{
-  RECT rect;
-  GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
-
-  GetClientRect (GDK_SURFACE_HWND (window), &rect);
-
-  _gdk_win32_adjust_client_rect (window, &rect);
-
-  OffsetRgn (hrgn, -rect.left, -rect.top);
-  OffsetRgn (hrgn, x, y);
-
-  /* If this is a top-level window, add the title bar to the region */
-  if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL)
-    {
-      HRGN tmp = CreateRectRgn (0, 0, rect.right - rect.left, -rect.top);
-      CombineRgn (hrgn, hrgn, tmp, RGN_OR);
-      DeleteObject (tmp);
-    }
-
-  SetWindowRgn (GDK_SURFACE_HWND (window), hrgn, TRUE);
-}
-
 static void
 gdk_win32_surface_set_accept_focus (GdkSurface *window,
                             gboolean accept_focus)
@@ -4148,8 +4122,6 @@ point_in_window (GdkSurface *window,
 {
   return x >= 0 && x < window->width &&
          y >= 0 && y < window->height &&
-         (window->shape == NULL ||
-          cairo_region_contains_point (window->shape, x, y)) &&
          (window->input_shape == NULL ||
           cairo_region_contains_point (window->input_shape, x, y));
 }
@@ -5343,38 +5315,6 @@ cairo_region_to_hrgn (const cairo_region_t *region,
   return (hrgn);
 }
 
-static void
-gdk_win32_surface_shape_combine_region (GdkSurface       *window,
-                                      const cairo_region_t *shape_region,
-                                      gint             offset_x,
-                                      gint             offset_y)
-{
-  GdkSurfaceImplWin32 *impl;
-
-  if (GDK_SURFACE_DESTROYED (window))
-    return;
-
-  if (!shape_region)
-    {
-      GDK_NOTE (MISC, g_print ("gdk_win32_surface_shape_combine_region: %p: none\n",
-                              GDK_SURFACE_HWND (window)));
-      SetWindowRgn (GDK_SURFACE_HWND (window), NULL, TRUE);
-    }
-  else
-    {
-      HRGN hrgn;
-      impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
-
-      hrgn = cairo_region_to_hrgn (shape_region, 0, 0, impl->surface_scale);
-
-      GDK_NOTE (MISC, g_print ("gdk_win32_surface_shape_combine_region: %p: %p\n",
-                              GDK_SURFACE_HWND (window),
-                              hrgn));
-
-      do_shape_combine_region (window, hrgn, offset_x, offset_y);
-    }
-}
-
 GdkSurface *
 gdk_win32_surface_lookup_for_display (GdkDisplay *display,
                                      HWND        anid)
@@ -5890,7 +5830,6 @@ gdk_surface_impl_win32_class_init (GdkSurfaceImplWin32Class *klass)
   impl_class->get_device_state = gdk_surface_win32_get_device_state;
   impl_class->get_root_coords = gdk_win32_surface_get_root_coords;
 
-  impl_class->shape_combine_region = gdk_win32_surface_shape_combine_region;
   impl_class->input_shape_combine_region = gdk_win32_input_shape_combine_region;
   impl_class->destroy = gdk_win32_surface_destroy;
   impl_class->begin_paint = gdk_win32_surface_begin_paint;
index d3d3e3f00dde1a1260b6720c4e1a25c4dfabefc4..54a101eb914afef442fc284734d18b981910777c 100644 (file)
@@ -2757,38 +2757,32 @@ gdk_surface_x11_set_events (GdkSurface    *surface,
     }
 }
 
-static inline void
-do_shape_combine_region (GdkSurface       *surface,
-                        const cairo_region_t *shape_region,
-                        gint             offset_x,
-                        gint             offset_y,
-                        gint             shape)
+static void 
+gdk_surface_x11_input_shape_combine_region (GdkSurface           *surface,
+                                           const cairo_region_t *shape_region,
+                                           gint                  offset_x,
+                                           gint                  offset_y)
 {
+#ifdef ShapeInput
   GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl);
 
   if (GDK_SURFACE_DESTROYED (surface))
     return;
 
+  if (!gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (surface)))
+    return;
+
   if (shape_region == NULL)
     {
-      /* Use NULL mask to unset the shape */
-      if (shape == ShapeBounding
-         ? gdk_display_supports_shapes (GDK_SURFACE_DISPLAY (surface))
-         : gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (surface)))
-       {
-         XShapeCombineMask (GDK_SURFACE_XDISPLAY (surface),
-                            GDK_SURFACE_XID (surface),
-                            shape,
-                            0, 0,
-                            None,
-                            ShapeSet);
-       }
+      XShapeCombineMask (GDK_SURFACE_XDISPLAY (surface),
+                         GDK_SURFACE_XID (surface),
+                         ShapeInput,
+                         0, 0,
+                         None,
+                         ShapeSet);
       return;
     }
-  
-  if (shape == ShapeBounding
-      ? gdk_display_supports_shapes (GDK_SURFACE_DISPLAY (surface))
-      : gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (surface)))
+  else
     {
       gint n_rects = 0;
       XRectangle *xrects = NULL;
@@ -2799,7 +2793,7 @@ do_shape_combine_region (GdkSurface       *surface,
       
       XShapeCombineRectangles (GDK_SURFACE_XDISPLAY (surface),
                                GDK_SURFACE_XID (surface),
-                               shape,
+                              ShapeInput,
                                offset_x * impl->surface_scale,
                                offset_y * impl->surface_scale,
                                xrects, n_rects,
@@ -2808,25 +2802,6 @@ do_shape_combine_region (GdkSurface       *surface,
       
       g_free (xrects);
     }
-}
-
-static void
-gdk_surface_x11_shape_combine_region (GdkSurface       *surface,
-                                     const cairo_region_t *shape_region,
-                                     gint             offset_x,
-                                     gint             offset_y)
-{
-  do_shape_combine_region (surface, shape_region, offset_x, offset_y, ShapeBounding);
-}
-
-static void 
-gdk_surface_x11_input_shape_combine_region (GdkSurface       *surface,
-                                          const cairo_region_t *shape_region,
-                                          gint             offset_x,
-                                          gint             offset_y)
-{
-#ifdef ShapeInput
-  do_shape_combine_region (surface, shape_region, offset_x, offset_y, ShapeInput);
 #endif
 }
 
@@ -4892,7 +4867,6 @@ gdk_surface_impl_x11_class_init (GdkSurfaceImplX11Class *klass)
   impl_class->get_geometry = gdk_surface_x11_get_geometry;
   impl_class->get_root_coords = gdk_surface_x11_get_root_coords;
   impl_class->get_device_state = gdk_surface_x11_get_device_state;
-  impl_class->shape_combine_region = gdk_surface_x11_shape_combine_region;
   impl_class->input_shape_combine_region = gdk_surface_x11_input_shape_combine_region;
   impl_class->destroy = gdk_x11_surface_destroy;
   impl_class->beep = gdk_x11_surface_beep;