X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-utils.c;h=9fc74c659573970102c2b131e23a5823cd3d45f5;hb=b0083a8f9bb4ef2d2fd9bed4106ce61e042f7c5c;hp=587dd73664e914392582d1fc5c479beced82f1f0;hpb=5cc8e92ad9fb04792682b474a670aaa803666f78;p=evince.git diff --git a/shell/ev-utils.c b/shell/ev-utils.c index 587dd736..9fc74c65 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 ("\n"); + return; + } + + g_print ("\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 @@ -184,6 +213,7 @@ ev_pixbuf_add_shadow (GdkPixbuf *src, int size, #include #include #include +#include static gboolean rename_file (const char *old_name, @@ -211,8 +241,6 @@ set_umask_permissions (int fd, * the umask in between the getting and the setting of the umask. * So we have to do the whole thing in a child process. */ - - int save_errno; pid_t pid; pid = fork (); @@ -247,9 +275,7 @@ set_umask_permissions (int fd, if (WIFEXITED (status)) { - save_errno = WEXITSTATUS (status); - - if (save_errno == 0) + if (WEXITSTATUS (status) == 0) { return TRUE; } @@ -280,7 +306,6 @@ write_to_temp_file (const gchar *contents, gchar *retval; FILE *file; gint fd; - int save_errno; retval = NULL;