... and all the implementations.
Input shapes still exist.
}
}
-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,
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;
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,
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,
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;
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,
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;
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)
{
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));
}
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)
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;
}
}
-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;
XShapeCombineRectangles (GDK_SURFACE_XDISPLAY (surface),
GDK_SURFACE_XID (surface),
- shape,
+ ShapeInput,
offset_x * impl->surface_scale,
offset_y * impl->surface_scale,
xrects, n_rects,
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
}
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;