[gtk+/rendering-cleanup: 56/65] gdk: Make get_shape and get_input_shape vfuncs
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup: 56/65] gdk: Make get_shape and get_input_shape vfuncs
- Date: Thu, 2 Dec 2010 11:56:09 +0000 (UTC)
commit a79d41ef4a9b3e2ffe17894a4334650f3402191e
Author: Benjamin Otte <otte redhat com>
Date: Thu Nov 25 12:17:11 2010 +0100
gdk: Make get_shape and get_input_shape vfuncs
Trying to get rid of all the _gdk_windowing_something() functions that
we expect backends to magically know about and instead put them in a
proper interface (mostly GdkWindowImplClass).
gdk/gdkinternals.h | 2 --
gdk/gdkwindow.c | 4 ++--
gdk/gdkwindowimpl.h | 2 ++
gdk/quartz/gdkwindow-quartz.c | 10 ++++++----
gdk/win32/gdkwindow-win32.c | 10 ++++++----
gdk/x11/gdkwindow-x11.c | 10 ++++++----
6 files changed, 22 insertions(+), 16 deletions(-)
---
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 7da2d83..830e5d7 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -356,8 +356,6 @@ gulong _gdk_windowing_window_get_next_serial (GdkDisplay *display);
void _gdk_windowing_window_get_offsets (GdkWindow *window,
gint *x_offset,
gint *y_offset);
-cairo_region_t *_gdk_windowing_window_get_shape (GdkWindow *window);
-cairo_region_t *_gdk_windowing_window_get_input_shape(GdkWindow *window);
void _gdk_windowing_window_beep (GdkWindow *window);
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index ac46daa..9e84e2a 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -718,7 +718,7 @@ remove_child_area (GdkWindow *private,
}
else if (private->window_type == GDK_WINDOW_FOREIGN)
{
- shape = _gdk_windowing_window_get_shape ((GdkWindow *)child);
+ shape = GDK_WINDOW_IMPL_GET_CLASS (child)->get_shape (child);
if (shape)
{
cairo_region_intersect (child_region, shape);
@@ -732,7 +732,7 @@ remove_child_area (GdkWindow *private,
cairo_region_intersect (child_region, child->input_shape);
else if (private->window_type == GDK_WINDOW_FOREIGN)
{
- shape = _gdk_windowing_window_get_input_shape ((GdkWindow *)child);
+ shape = GDK_WINDOW_IMPL_GET_CLASS (child)->get_input_shape (child);
if (shape)
{
cairo_region_intersect (child_region, shape);
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
index 6f246ff..dfcf3b4 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -104,6 +104,8 @@ struct _GdkWindowImplClass
gint *y,
GdkModifierType *mask);
+ cairo_region_t * (* get_shape) (GdkWindow *window);
+ cairo_region_t * (* get_input_shape) (GdkWindow *window);
void (* shape_combine_region) (GdkWindow *window,
const cairo_region_t *shape_region,
gint offset_x,
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 4efe872..42117ac 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2954,15 +2954,15 @@ _gdk_windowing_window_set_composited (GdkWindow *window, gboolean composited)
{
}
-cairo_region_t *
-_gdk_windowing_window_get_shape (GdkWindow *window)
+static cairo_region_t *
+gdk_quartz_window_get_shape (GdkWindow *window)
{
/* FIXME: implement */
return NULL;
}
-cairo_region_t *
-_gdk_windowing_window_get_input_shape (GdkWindow *window)
+static cairo_region_t *
+gdk_quartz_window_get_input_shape (GdkWindow *window)
{
/* FIXME: implement */
return NULL;
@@ -2993,6 +2993,8 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
iface->translate = _gdk_quartz_window_translate;
iface->destroy = _gdk_quartz_window_destroy;
iface->resize_cairo_surface = gdk_window_quartz_resize_cairo_surface;
+ iface->get_shape = gdk_quartz_window_get_shape;
+ iface->get_input_shape = gdk_quartz_window_get_input_shape;
}
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 8b73ac2..ad291b2 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -3170,8 +3170,8 @@ _gdk_windowing_window_set_composited (GdkWindow *window, gboolean composited)
{
}
-cairo_region_t *
-_gdk_windowing_window_get_shape (GdkWindow *window)
+static cairo_region_t *
+gdk_win32_window_get_shape (GdkWindow *window)
{
HRGN hrgn = CreateRectRgn (0, 0, 0, 0);
int type = GetWindowRgn (GDK_WINDOW_HWND (window), hrgn);
@@ -3187,8 +3187,8 @@ _gdk_windowing_window_get_shape (GdkWindow *window)
return NULL;
}
-cairo_region_t *
-_gdk_windowing_window_get_input_shape (GdkWindow *window)
+static cairo_region_t *
+_gdk_win32_window_get_input_shape (GdkWindow *window)
{
/* CHECK: are these really supposed to be the same? */
return _gdk_windowing_window_get_shape (window);
@@ -3306,6 +3306,8 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
iface->translate = _gdk_win32_window_translate;
iface->destroy = _gdk_win32_window_destroy;
iface->resize_cairo_surface = gdk_win32_window_resize_cairo_surface;
+ iface->get_shape = gdk_win32_window_get_shape;
+ iface->get_input_shape = gdk_win32_window_get_input_shape;
}
gboolean
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 052b012..d3c4a8e 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -4570,8 +4570,8 @@ _xwindow_get_shape (Display *xdisplay,
}
-cairo_region_t *
-_gdk_windowing_window_get_shape (GdkWindow *window)
+static cairo_region_t *
+gdk_x11_window_get_shape (GdkWindow *window)
{
if (!GDK_WINDOW_DESTROYED (window) &&
gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window)))
@@ -4581,8 +4581,8 @@ _gdk_windowing_window_get_shape (GdkWindow *window)
return NULL;
}
-cairo_region_t *
-_gdk_windowing_window_get_input_shape (GdkWindow *window)
+static cairo_region_t *
+gdk_x11_window_get_input_shape (GdkWindow *window)
{
#if defined(ShapeInput)
if (!GDK_WINDOW_DESTROYED (window) &&
@@ -5589,5 +5589,7 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
impl_class->translate = _gdk_x11_window_translate;
impl_class->destroy = _gdk_x11_window_destroy;
impl_class->resize_cairo_surface = gdk_window_x11_resize_cairo_surface;
+ impl_class->get_shape = gdk_x11_window_get_shape;
+ impl_class->get_input_shape = gdk_x11_window_get_input_shape;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]