Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ev-utils.c')
-rw-r--r--shell/ev-utils.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/shell/ev-utils.c b/shell/ev-utils.c
index 587dd73..21563eb 100644
--- a/shell/ev-utils.c
+++ b/shell/ev-utils.c
@@ -177,6 +177,35 @@ ev_pixbuf_add_shadow (GdkPixbuf *src, int size,
}
+/* Simple function to output the contents of a region. Used solely for testing
+ * the region code.
+ */
+void
+ev_print_region_contents (GdkRegion *region)
+{
+ GdkRectangle *rectangles = NULL;
+ gint n_rectangles, i;
+
+ if (region == NULL) {
+ g_print ("<empty region>\n");
+ return;
+ }
+
+ g_print ("<region %p>\n", region);
+ gdk_region_get_rectangles (region, &rectangles, &n_rectangles);
+ for (i = 0; i < n_rectangles; i++) {
+ g_print ("\t(%d %d, %d %d) [%dx%d]\n",
+ rectangles[i].x,
+ rectangles[i].y,
+ rectangles[i].x + rectangles[i].width,
+ rectangles[i].y + rectangles[i].height,
+ rectangles[i].width,
+ rectangles[i].height);
+ }
+ g_free (rectangles);
+}
+
+
#ifndef HAVE_G_FILE_SET_CONTENTS
#include <errno.h>