[gtk+] API: gdk_drawable_get_visible_region => gdk_window_get_visible_region
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] API: gdk_drawable_get_visible_region => gdk_window_get_visible_region
- Date: Thu, 2 Dec 2010 19:54:26 +0000 (UTC)
commit becaf660fc84238fc3ecf1a8df9932bc8da93d40
Author: Benjamin Otte <otte redhat com>
Date: Wed Oct 6 23:42:45 2010 +0200
API: gdk_drawable_get_visible_region => gdk_window_get_visible_region
Also get rid of the GdkDrawable vfunc.
gdk/gdkdraw.c | 20 --------------------
gdk/gdkdrawable.h | 4 ----
gdk/gdkwindow.c | 27 ++++++++++++++++++++-------
gdk/gdkwindow.h | 2 ++
4 files changed, 22 insertions(+), 31 deletions(-)
---
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index df9762b..77b2936 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -51,26 +51,6 @@ gdk_drawable_init (GdkDrawable *drawable)
}
/**
- * gdk_drawable_get_visible_region:
- * @drawable: a #GdkDrawable
- *
- * Computes the region of a drawable that is potentially visible.
- * This does not necessarily take into account if the window is
- * obscured by other windows, but no area outside of this region
- * is visible.
- *
- * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
- * when you are done.
- **/
-cairo_region_t *
-gdk_drawable_get_visible_region (GdkDrawable *drawable)
-{
- g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
-
- return GDK_DRAWABLE_GET_CLASS (drawable)->get_visible_region (drawable);
-}
-
-/**
* _gdk_drawable_ref_cairo_surface:
* @drawable: a #GdkDrawable
*
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
index 1c619a8..b8799e3 100644
--- a/gdk/gdkdrawable.h
+++ b/gdk/gdkdrawable.h
@@ -62,8 +62,6 @@ struct _GdkDrawableClass
{
GObjectClass parent_class;
- cairo_region_t* (*get_visible_region) (GdkDrawable *drawable);
-
cairo_surface_t *(*ref_cairo_surface) (GdkDrawable *drawable);
cairo_surface_t * (*create_cairo_surface) (GdkDrawable *drawable,
@@ -83,8 +81,6 @@ struct _GdkDrawableClass
GType gdk_drawable_get_type (void) G_GNUC_CONST;
-cairo_region_t *gdk_drawable_get_visible_region (GdkDrawable *drawable);
-
G_END_DECLS
#endif /* __GDK_DRAWABLE_H__ */
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 5523d07..e3d4013 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -225,8 +225,6 @@ static cairo_surface_t *gdk_window_create_cairo_surface (GdkDrawable *drawable,
int height);
static void gdk_window_drop_cairo_surface (GdkWindowObject *private);
-static cairo_region_t* gdk_window_get_visible_region (GdkDrawable *drawable);
-
static void gdk_window_free_paint_stack (GdkWindow *window);
static void gdk_window_init (GdkWindowObject *window);
@@ -382,7 +380,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
drawable_class->ref_cairo_surface = gdk_window_ref_cairo_surface;
drawable_class->create_cairo_surface = gdk_window_create_cairo_surface;
- drawable_class->get_visible_region = gdk_window_get_visible_region;
klass->create_surface = _gdk_offscreen_window_create_surface;
@@ -3560,10 +3557,26 @@ gdk_window_get_clip_region (GdkWindow *window)
return result;
}
-static cairo_region_t*
-gdk_window_get_visible_region (GdkDrawable *drawable)
+/**
+ * gdk_window_get_visible_region:
+ * @window: a #GdkWindow
+ *
+ * Computes the region of the @window that is potentially visible.
+ * This does not necessarily take into account if the window is
+ * obscured by other windows, but no area outside of this region
+ * is visible.
+ *
+ * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
+ * when you are done.
+ **/
+cairo_region_t *
+gdk_window_get_visible_region (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject*) drawable;
+ GdkWindowObject *private;
+
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+
+ private = (GdkWindowObject*) window;
return cairo_region_copy (private->clip_region);
}
@@ -4511,7 +4524,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
private->window_type == GDK_WINDOW_ROOT)
return;
- visible_region = gdk_drawable_get_visible_region (window);
+ visible_region = gdk_window_get_visible_region (window);
cairo_region_intersect (visible_region, region);
tmp_list = private->children;
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index f600c76..4e408ca 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -681,6 +681,8 @@ void gdk_window_set_geometry_hints (GdkWindow *window,
void gdk_set_sm_client_id (const gchar *sm_client_id);
cairo_region_t *gdk_window_get_clip_region (GdkWindow *window);
+cairo_region_t *gdk_window_get_visible_region(GdkWindow *window);
+
void gdk_window_begin_paint_rect (GdkWindow *window,
const GdkRectangle *rectangle);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]