gint -> gboolean.
authorLaurent Monin <geeqie@norz.org>
Sun, 15 Mar 2009 13:33:56 +0000 (13:33 +0000)
committerLaurent Monin <geeqie@norz.org>
Sun, 15 Mar 2009 13:33:56 +0000 (13:33 +0000)
src/pixbuf_util.c
src/pixbuf_util.h
src/preferences.c
src/print.c

index ab99cbd..bdf5a98 100644 (file)
@@ -29,7 +29,7 @@
 gboolean pixbuf_to_file_as_png(GdkPixbuf *pixbuf, const gchar *filename)
 {
        GError *error = NULL;
-       gint ret;
+       gboolean ret;
 
        if (!pixbuf || !filename) return FALSE;
 
@@ -188,8 +188,9 @@ gboolean register_theme_icon_as_stock(const gchar *key, const gchar *icon)
        return TRUE;
 }
 
-gint pixbuf_scale_aspect(gint req_w, gint req_h, gint old_w, gint old_h,
-                                         gint *new_w, gint *new_h)
+gboolean pixbuf_scale_aspect(gint req_w, gint req_h,
+                            gint old_w, gint old_h,
+                            gint *new_w, gint *new_h)
 {
        if (((gdouble)req_w / old_w) < ((gdouble)req_h / old_h))
                {
@@ -241,9 +242,9 @@ GdkPixbuf *pixbuf_fallback(FileData *fd, gint requested_width, gint requested_he
  *-----------------------------------------------------------------------------
  */
 
-gint util_clip_region(gint x, gint y, gint w, gint h,
-                     gint clip_x, gint clip_y, gint clip_w, gint clip_h,
-                     gint *rx, gint *ry, gint *rw, gint *rh)
+gboolean util_clip_region(gint x, gint y, gint w, gint h,
+                         gint clip_x, gint clip_y, gint clip_w, gint clip_h,
+                         gint *rx, gint *ry, gint *rw, gint *rh)
 {
        if (clip_x + clip_w <= x ||
            clip_x >= x + w ||
@@ -270,7 +271,7 @@ gint util_clip_region(gint x, gint y, gint w, gint h,
 
 static void pixbuf_copy_block_rotate(guchar *src, gint src_row_stride, gint x, gint y,
                                     guchar *dest, gint dest_row_stride, gint w, gint h,
-                                    gint bytes_per_pixel, gint counter_clockwise)
+                                    gint bytes_per_pixel, gboolean counter_clockwise)
 {
        gint i, j;
        guchar *sp;
@@ -320,10 +321,10 @@ static void pixbuf_copy_block(guchar *src, gint src_row_stride, gint w, gint h,
  * Returns a copy of pixbuf src rotated 90 degrees clockwise or 90 counterclockwise
  *
  */
-GdkPixbuf *pixbuf_copy_rotate_90(GdkPixbuf *src, gint counter_clockwise)
+GdkPixbuf *pixbuf_copy_rotate_90(GdkPixbuf *src, gboolean counter_clockwise)
 {
        GdkPixbuf *dest;
-       gint has_alpha;
+       gboolean has_alpha;
        gint sw, sh, srs;
        gint dw, dh, drs;
        guchar *s_pix;
@@ -422,10 +423,10 @@ GdkPixbuf *pixbuf_copy_rotate_90(GdkPixbuf *src, gint counter_clockwise)
  * TO do a 180 degree rotations set both mirror and flipped TRUE
  * if mirror and flip are FALSE, result is a simple copy.
  */
-GdkPixbuf *pixbuf_copy_mirror(GdkPixbuf *src, gint mirror, gint flip)
+GdkPixbuf *pixbuf_copy_mirror(GdkPixbuf *src, gboolean mirror, gboolean flip)
 {
        GdkPixbuf *dest;
-       gint has_alpha;
+       gboolean has_alpha;
        gint w, h, srs;
        gint drs;
        guchar *s_pix;
@@ -550,7 +551,7 @@ void pixbuf_draw_rect_fill(GdkPixbuf *pb,
                           gint x, gint y, gint w, gint h,
                           gint r, gint g, gint b, gint a)
 {
-       gint p_alpha;
+       gboolean has_alpha;
        gint pw, ph, prs;
        guchar *p_pix;
        guchar *pp;
@@ -564,13 +565,13 @@ void pixbuf_draw_rect_fill(GdkPixbuf *pb,
        if (x < 0 || x + w > pw) return;
        if (y < 0 || y + h > ph) return;
 
-       p_alpha = gdk_pixbuf_get_has_alpha(pb);
+       has_alpha = gdk_pixbuf_get_has_alpha(pb);
        prs = gdk_pixbuf_get_rowstride(pb);
        p_pix = gdk_pixbuf_get_pixels(pb);
 
        for (i = 0; i < h; i++)
                {
-               pp = p_pix + (y + i) * prs + (x * (p_alpha ? 4 : 3));
+               pp = p_pix + (y + i) * prs + (x * (has_alpha ? 4 : 3));
                for (j = 0; j < w; j++)
                        {
                        *pp = (r * a + *pp * (256-a)) >> 8;
@@ -579,7 +580,7 @@ void pixbuf_draw_rect_fill(GdkPixbuf *pb,
                        pp++;
                        *pp = (b * a + *pp * (256-a)) >> 8;
                        pp++;
-                       if (p_alpha) pp++;
+                       if (has_alpha) pp++;
                        }
                }
 }
@@ -603,7 +604,7 @@ void pixbuf_set_rect_fill(GdkPixbuf *pb,
                          gint x, gint y, gint w, gint h,
                          gint r, gint g, gint b, gint a)
 {
-       gint p_alpha;
+       gboolean has_alpha;
        gint pw, ph, prs;
        guchar *p_pix;
        guchar *pp;
@@ -617,19 +618,19 @@ void pixbuf_set_rect_fill(GdkPixbuf *pb,
        if (x < 0 || x + w > pw) return;
        if (y < 0 || y + h > ph) return;
 
-       p_alpha = gdk_pixbuf_get_has_alpha(pb);
+       has_alpha = gdk_pixbuf_get_has_alpha(pb);
        prs = gdk_pixbuf_get_rowstride(pb);
        p_pix = gdk_pixbuf_get_pixels(pb);
 
        for (i = 0; i < h; i++)
                {
-               pp = p_pix + (y + i) * prs + (x * (p_alpha ? 4 : 3));
+               pp = p_pix + (y + i) * prs + (x * (has_alpha ? 4 : 3));
                for (j = 0; j < w; j++)
                        {
                        *pp = r; pp++;
                        *pp = g; pp++;
                        *pp = b; pp++;
-                       if (p_alpha) { *pp = a; pp++; }
+                       if (has_alpha) { *pp = a; pp++; }
                        }
                }
 }
@@ -652,7 +653,7 @@ void pixbuf_set_rect(GdkPixbuf *pb,
 void pixbuf_pixel_set(GdkPixbuf *pb, gint x, gint y, gint r, gint g, gint b, gint a)
 {
        guchar *buf;
-       gint has_alpha;
+       gboolean has_alpha;
        gint rowstride;
        guchar *p;
 
@@ -683,11 +684,11 @@ static void pixbuf_copy_font(GdkPixbuf *src, gint sx, gint sy,
                             guint8 r, guint8 g, guint8 b, guint8 a)
 {
        gint sw, sh, srs;
-       gint s_alpha;
+       gboolean s_alpha;
        gint s_step;
        guchar *s_pix;
        gint dw, dh, drs;
-       gint d_alpha;
+       gboolean d_alpha;
        gint d_step;
        guchar *d_pix;
 
@@ -846,7 +847,7 @@ void pixbuf_draw_triangle(GdkPixbuf *pb,
                          gint x1, gint y1, gint x2, gint y2, gint x3, gint y3,
                          guint8 r, guint8 g, guint8 b, guint8 a)
 {
-       gint p_alpha;
+       gboolean has_alpha;
        gint pw, ph, prs;
        gint rx, ry, rw, rh;
        gint tx, ty, tw, th;
@@ -880,11 +881,11 @@ void pixbuf_draw_triangle(GdkPixbuf *pb,
        fx2 = fx1 + fw;
        fy2 = fy1 + fh;
 
-       p_alpha = gdk_pixbuf_get_has_alpha(pb);
+       has_alpha = gdk_pixbuf_get_has_alpha(pb);
        prs = gdk_pixbuf_get_rowstride(pb);
        p_pix = gdk_pixbuf_get_pixels(pb);
 
-       p_step = (p_alpha) ? 4 : 3;
+       p_step = (has_alpha) ? 4 : 3;
 
        if (y1 > y2)
                {
@@ -944,7 +945,7 @@ void pixbuf_draw_triangle(GdkPixbuf *pb,
                        pp++;
                        *pp = (b * a + *pp * (256-a)) >> 8;
                        pp++;
-                       if (p_alpha) pp++;
+                       if (has_alpha) pp++;
 
                        xa++;
                        }
@@ -957,9 +958,9 @@ void pixbuf_draw_triangle(GdkPixbuf *pb,
  *-----------------------------------------------------------------------------
  */
 
-static gint util_clip_line(gdouble clip_x, gdouble clip_y, gdouble clip_w, gdouble clip_h,
-                          gdouble x1, gdouble y1, gdouble x2, gdouble y2,
-                          gdouble *rx1, gdouble *ry1, gdouble *rx2, gdouble *ry2)
+static gboolean util_clip_line(gdouble clip_x, gdouble clip_y, gdouble clip_w, gdouble clip_h,
+                              gdouble x1, gdouble y1, gdouble x2, gdouble y2,
+                              gdouble *rx1, gdouble *ry1, gdouble *rx2, gdouble *ry2)
 {
        gboolean flip = FALSE;
        gdouble d;
@@ -1072,7 +1073,7 @@ void pixbuf_draw_line(GdkPixbuf *pb,
                      gint x1, gint y1, gint x2, gint y2,
                      guint8 r, guint8 g, guint8 b, guint8 a)
 {
-       gint p_alpha;
+       gboolean has_alpha;
        gint pw, ph, prs;
        gint rx, ry, rw, rh;
        gdouble rx1, ry1, rx2, ry2;
@@ -1101,11 +1102,11 @@ void pixbuf_draw_line(GdkPixbuf *pb,
        cx2 = rx + rw;
        cy2 = ry + rh;
 
-       p_alpha = gdk_pixbuf_get_has_alpha(pb);
+       has_alpha = gdk_pixbuf_get_has_alpha(pb);
        prs = gdk_pixbuf_get_rowstride(pb);
        p_pix = gdk_pixbuf_get_pixels(pb);
 
-       p_step = (p_alpha) ? 4 : 3;
+       p_step = (has_alpha) ? 4 : 3;
 
        if (fabs(rx2 - rx1) > fabs(ry2 - ry1))
                {
@@ -1169,8 +1170,8 @@ void pixbuf_draw_line(GdkPixbuf *pb,
  *-----------------------------------------------------------------------------
  */
 
-static void pixbuf_draw_fade_linear(guchar *p_pix, gint prs, gint p_alpha,
-                                   gint s, gint vertical, gint border,
+static void pixbuf_draw_fade_linear(guchar *p_pix, gint prs, gboolean has_alpha,
+                                   gint s, gboolean vertical, gint border,
                                    gint x1, gint y1, gint x2, gint y2,
                                    guint8 r, guint8 g, guint8 b, guint8 a)
 {
@@ -1179,7 +1180,7 @@ static void pixbuf_draw_fade_linear(guchar *p_pix, gint prs, gint p_alpha,
        guint8 n = a;
        gint i, j;
 
-       p_step = (p_alpha) ? 4 : 3;
+       p_step = (has_alpha) ? 4 : 3;
        for (j = y1; j < y2; j++)
                {
                pp = p_pix + j * prs + x1 * p_step;
@@ -1193,12 +1194,12 @@ static void pixbuf_draw_fade_linear(guchar *p_pix, gint prs, gint p_alpha,
                        pp++;
                        *pp = (b * n + *pp * (256-n)) >> 8;
                        pp++;
-                       if (p_alpha) pp++;
+                       if (has_alpha) pp++;
                        }
                }
 }
 
-static void pixbuf_draw_fade_radius(guchar *p_pix, gint prs, gint p_alpha,
+static void pixbuf_draw_fade_radius(guchar *p_pix, gint prs, gboolean has_alpha,
                                    gint sx, gint sy, gint border,
                                    gint x1, gint y1, gint x2, gint y2,
                                    guint8 r, guint8 g, guint8 b, guint8 a)
@@ -1207,7 +1208,7 @@ static void pixbuf_draw_fade_radius(guchar *p_pix, gint prs, gint p_alpha,
        gint p_step;
        gint i, j;
 
-       p_step = (p_alpha) ? 4 : 3;
+       p_step = (has_alpha) ? 4 : 3;
        for (j = y1; j < y2; j++)
                {
                pp = p_pix + j * prs + x1 * p_step;
@@ -1224,7 +1225,7 @@ static void pixbuf_draw_fade_radius(guchar *p_pix, gint prs, gint p_alpha,
                        pp++;
                        *pp = (b * n + *pp * (256-n)) >> 8;
                        pp++;
-                       if (p_alpha) pp++;
+                       if (has_alpha) pp++;
                        }
                }
 }
@@ -1234,7 +1235,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
                        gint x, gint y, gint w, gint h, gint border,
                        guint8 r, guint8 g, guint8 b, guint8 a)
 {
-       gint p_alpha;
+       gint has_alpha;
        gint pw, ph, prs;
        gint rx, ry, rw, rh;
        gint fx, fy, fw, fh;
@@ -1249,7 +1250,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
                              clip_x, clip_y, clip_w, clip_h,
                              &rx, &ry, &rw, &rh)) return;
 
-       p_alpha = gdk_pixbuf_get_has_alpha(pb);
+       has_alpha = gdk_pixbuf_get_has_alpha(pb);
        prs = gdk_pixbuf_get_rowstride(pb);
        p_pix = gdk_pixbuf_get_pixels(pb);
 
@@ -1266,7 +1267,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
                             rx, ry, rw, rh,
                             &fx, &fy, &fw, &fh))
                {
-               pixbuf_draw_fade_linear(p_pix, prs, p_alpha,
+               pixbuf_draw_fade_linear(p_pix, prs, has_alpha,
                                        x + border, TRUE, border,
                                        fx, fy, fx + fw, fy + fh,
                                        r, g, b, a);
@@ -1275,7 +1276,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
                             rx, ry, rw, rh,
                             &fx, &fy, &fw, &fh))
                {
-               pixbuf_draw_fade_linear(p_pix, prs, p_alpha,
+               pixbuf_draw_fade_linear(p_pix, prs, has_alpha,
                                        x + w - border, TRUE, border,
                                        fx, fy, fx + fw, fy + fh,
                                        r, g, b, a);
@@ -1284,7 +1285,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
                             rx, ry, rw, rh,
                             &fx, &fy, &fw, &fh))
                {
-               pixbuf_draw_fade_linear(p_pix, prs, p_alpha,
+               pixbuf_draw_fade_linear(p_pix, prs, has_alpha,
                                        y + border, FALSE, border,
                                        fx, fy, fx + fw, fy + fh,
                                        r, g, b, a);
@@ -1293,7 +1294,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
                             rx, ry, rw, rh,
                             &fx, &fy, &fw, &fh))
                {
-               pixbuf_draw_fade_linear(p_pix, prs, p_alpha,
+               pixbuf_draw_fade_linear(p_pix, prs, has_alpha,
                                        y + h - border, FALSE, border,
                                        fx, fy, fx + fw, fy + fh,
                                        r, g, b, a);
@@ -1302,7 +1303,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
                             rx, ry, rw, rh,
                             &fx, &fy, &fw, &fh))
                {
-               pixbuf_draw_fade_radius(p_pix, prs, p_alpha,
+               pixbuf_draw_fade_radius(p_pix, prs, has_alpha,
                                        x + border, y + border, border,
                                        fx, fy, fx + fw, fy + fh,
                                        r, g, b, a);
@@ -1311,7 +1312,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
                             rx, ry, rw, rh,
                             &fx, &fy, &fw, &fh))
                {
-               pixbuf_draw_fade_radius(p_pix, prs, p_alpha,
+               pixbuf_draw_fade_radius(p_pix, prs, has_alpha,
                                        x + w - border, y + border, border,
                                        fx, fy, fx + fw, fy + fh,
                                        r, g, b, a);
@@ -1320,7 +1321,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
                             rx, ry, rw, rh,
                             &fx, &fy, &fw, &fh))
                {
-               pixbuf_draw_fade_radius(p_pix, prs, p_alpha,
+               pixbuf_draw_fade_radius(p_pix, prs, has_alpha,
                                        x + border, y + h - border, border,
                                        fx, fy, fx + fw, fy + fh,
                                        r, g, b, a);
@@ -1329,7 +1330,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
                             rx, ry, rw, rh,
                             &fx, &fy, &fw, &fh))
                {
-               pixbuf_draw_fade_radius(p_pix, prs, p_alpha,
+               pixbuf_draw_fade_radius(p_pix, prs, has_alpha,
                                        x + w - border, y + h - border, border,
                                        fx, fy, fx + fw, fy + fh,
                                        r, g, b, a);
@@ -1346,7 +1347,7 @@ void pixbuf_draw_shadow(GdkPixbuf *pb,
 void pixbuf_desaturate_rect(GdkPixbuf *pb,
                            gint x, gint y, gint w, gint h)
 {
-       gint p_alpha;
+       gboolean has_alpha;
        gint pw, ph, prs;
        guchar *p_pix;
        guchar *pp;
@@ -1360,13 +1361,13 @@ void pixbuf_desaturate_rect(GdkPixbuf *pb,
        if (x < 0 || x + w > pw) return;
        if (y < 0 || y + h > ph) return;
 
-       p_alpha = gdk_pixbuf_get_has_alpha(pb);
+       has_alpha = gdk_pixbuf_get_has_alpha(pb);
        prs = gdk_pixbuf_get_rowstride(pb);
        p_pix = gdk_pixbuf_get_pixels(pb);
 
        for (i = 0; i < h; i++)
                {
-               pp = p_pix + (y + i) * prs + (x * (p_alpha ? 4 : 3));
+               pp = p_pix + (y + i) * prs + (x * (has_alpha ? 4 : 3));
                for (j = 0; j < w; j++)
                        {
                        guint8 grey;
@@ -1378,7 +1379,7 @@ void pixbuf_desaturate_rect(GdkPixbuf *pb,
                        pp++;
                        *pp = grey;
                        pp++;
-                       if (p_alpha) pp++;
+                       if (has_alpha) pp++;
                        }
                }
 }
index af6a918..df0bdb7 100644 (file)
@@ -24,7 +24,7 @@ gboolean register_theme_icon_as_stock(const gchar *key, const gchar *icon);
 GdkPixbuf *pixbuf_inline(const gchar *key);
 GdkPixbuf *pixbuf_fallback(FileData *fd, gint requested_width, gint requested_height);
 
-gint pixbuf_scale_aspect(gint req_w, gint req_h, gint old_w, gint old_h, gint *new_w, gint *new_h);
+gboolean pixbuf_scale_aspect(gint req_w, gint req_h, gint old_w, gint old_h, gint *new_w, gint *new_h);
 
 #define PIXBUF_INLINE_FOLDER_CLOSED    "folder_closed"
 #define PIXBUF_INLINE_FOLDER_LOCKED    "folder_locked"
@@ -44,8 +44,8 @@ gint pixbuf_scale_aspect(gint req_w, gint req_h, gint old_w, gint old_h, gint *n
 #define PIXBUF_INLINE_ICON_VIEW                "icon_view"
 
 
-GdkPixbuf *pixbuf_copy_rotate_90(GdkPixbuf *src, gint counter_clockwise);
-GdkPixbuf *pixbuf_copy_mirror(GdkPixbuf *src, gint mirror, gint flip);
+GdkPixbuf *pixbuf_copy_rotate_90(GdkPixbuf *src, gboolean counter_clockwise);
+GdkPixbuf *pixbuf_copy_mirror(GdkPixbuf *src, gboolean mirror, gboolean flip);
 GdkPixbuf* pixbuf_apply_orientation(GdkPixbuf *pixbuf, gint orientation);
 
 void pixbuf_draw_rect_fill(GdkPixbuf *pb,
@@ -95,9 +95,9 @@ void pixbuf_desaturate_rect(GdkPixbuf *pb,
 
 /* clipping utils */
 
-gint util_clip_region(gint x, gint y, gint w, gint h,
-                     gint clip_x, gint clip_y, gint clip_w, gint clip_h,
-                     gint *rx, gint *ry, gint *rw, gint *rh);
+gboolean util_clip_region(gint x, gint y, gint w, gint h,
+                         gint clip_x, gint clip_y, gint clip_w, gint clip_h,
+                         gint *rx, gint *ry, gint *rw, gint *rh);
 void util_clip_triangle(gint x1, gint y1, gint x2, gint y2, gint x3, gint y3,
                        gint *rx, gint *ry, gint *rw, gint *rh);
 
index 3949deb..d736b72 100644 (file)
@@ -380,7 +380,7 @@ static void config_window_close_cb(GtkWidget *widget, gpointer data)
        filter_store = NULL;
 }
 
-static gint config_window_delete(GtkWidget *w, GdkEventAny *event, gpointer data)
+static gboolean config_window_delete(GtkWidget *widget, GdkEventAny *event, gpointer data)
 {
        config_window_close_cb(NULL, NULL);
        return TRUE;
@@ -601,16 +601,15 @@ static void filter_store_ext_edit_cb(GtkCellRendererText *cell, gchar *path_str,
 }
 
 static void filter_store_class_edit_cb(GtkCellRendererText *cell, gchar *path_str,
-                                    gchar *new_text, gpointer data)
+                                      gchar *new_text, gpointer data)
 {
-
        GtkWidget *model = data;
        FilterEntry *fe = data;
        GtkTreePath *tpath;
        GtkTreeIter iter;
        gint i;
 
-       if (!new_text || strlen(new_text) < 1) return;
+       if (!new_text || !new_text[0]) return;
 
        tpath = gtk_tree_path_new_from_string(path_str);
        gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath);
@@ -637,7 +636,7 @@ static void filter_store_desc_edit_cb(GtkCellRendererText *cell, gchar *path_str
        GtkTreePath *tpath;
        GtkTreeIter iter;
 
-       if (!new_text || strlen(new_text) < 1) return;
+       if (!new_text || !new_text[0]) return;
 
        tpath = gtk_tree_path_new_from_string(path_str);
        gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, tpath);
@@ -668,7 +667,7 @@ static void filter_store_enable_cb(GtkCellRendererToggle *renderer,
 }
 
 static void filter_store_writable_cb(GtkCellRendererToggle *renderer,
-                                  gchar *path_str, gpointer data)
+                                    gchar *path_str, gpointer data)
 {
        GtkWidget *model = data;
        FilterEntry *fe;
@@ -687,7 +686,7 @@ static void filter_store_writable_cb(GtkCellRendererToggle *renderer,
 }
 
 static void filter_store_sidecar_cb(GtkCellRendererToggle *renderer,
-                                  gchar *path_str, gpointer data)
+                                   gchar *path_str, gpointer data)
 {
        GtkWidget *model = data;
        FilterEntry *fe;
@@ -1804,7 +1803,7 @@ void show_config_window(void)
 
 static GtkWidget *about = NULL;
 
-static gint about_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
+static gboolean about_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
 {
        gtk_widget_destroy(about);
        about = NULL;
index 36adea3..3f09cce 100644 (file)
@@ -319,9 +319,9 @@ static void print_window_close(PrintWindow *pw);
 
 /* misc utils */
 
-static gint clip_region(gdouble x1, gdouble y1, gdouble w1, gdouble h1,
-                       gdouble x2, gdouble y2, gdouble w2, gdouble h2,
-                       gdouble *rx, gdouble *ry, gdouble *rw, gdouble *rh)
+static gboolean clip_region(gdouble x1, gdouble y1, gdouble w1, gdouble h1,
+                           gdouble x2, gdouble y2, gdouble w2, gdouble h2,
+                           gdouble *rx, gdouble *ry, gdouble *rw, gdouble *rh)
 {
        if (x2 + w2 <= x1 || x2 >= x1 + w1 ||
            y2 + h2 <= y1 || y2 >= y1 + h1)
@@ -1008,10 +1008,10 @@ static void pipe_handler_free(PipeError *pe)
        g_free(pe);
 }
 
-static gint pipe_handler_check(PipeError *pe)
+static gboolean pipe_handler_check(PipeError *pe)
 {
        if (!pe) return FALSE;
-       return *pe->error;
+       return !!(*pe->error);
 }
 
 static FILE *print_job_ps_fd(PrintWindow *pw)
@@ -1021,14 +1021,14 @@ static FILE *print_job_ps_fd(PrintWindow *pw)
        return NULL;
 }
 
-static gint print_job_ps_init(PrintWindow *pw)
+static gboolean print_job_ps_init(PrintWindow *pw)
 {
        FILE *f;
        PipeError *pe;
        const gchar *cmd = NULL;
        const gchar *path = NULL;
        gchar *lc_pointer;
-       gint ret;
+       gboolean ret;
 
        if (pw->job_file != NULL || pw->job_pipe != NULL) return FALSE;
 
@@ -1145,12 +1145,12 @@ static gint print_job_ps_init(PrintWindow *pw)
        return ret;
 }
 
-static gint print_job_ps_page_new(PrintWindow *pw, gint page)
+static gboolean print_job_ps_page_new(PrintWindow *pw, gint page)
 {
        FILE *f;
        PipeError *pe;
        gchar *lc_pointer;
-       gint ret;
+       gboolean ret;
 
        f= print_job_ps_fd(pw);
        if (!f) return FALSE;
@@ -1182,12 +1182,12 @@ static gint print_job_ps_page_new(PrintWindow *pw, gint page)
        return ret;
 }
 
-static gint print_job_ps_page_done(PrintWindow *pw)
+static gboolean print_job_ps_page_done(PrintWindow *pw)
 {
        FILE *f;
        PipeError *pe;
        gchar *lc_pointer;
-       gint ret;
+       gboolean ret;
 
        f = print_job_ps_fd(pw);
        if (!f) return FALSE;
@@ -1233,9 +1233,9 @@ static void print_job_ps_page_image_pixel(FILE *f, guchar *pix)
 
        g_fprintf(f, "%s", text);
 }
-static gint print_job_ps_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
-                                   gdouble x, gdouble y, gdouble w, gdouble h,
-                                   gdouble offx, gdouble offy)
+static gboolean print_job_ps_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
+                                       gdouble x, gdouble y, gdouble w, gdouble h,
+                                       gdouble offx, gdouble offy)
 {
        FILE *f;
        PipeError *pe;
@@ -1248,7 +1248,7 @@ static gint print_job_ps_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
        gint c;
        guchar *p;
        guchar bps_buf[3];
-       gint ret;
+       gboolean ret;
 
        if (!pixbuf) return TRUE;
 
@@ -1386,14 +1386,14 @@ static void ps_text_parse(FILE *f, const gchar *text, gdouble x, gdouble y, gdou
        g_fprintf(f, "closepath\n");
 }
 
-static gint print_job_ps_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
-                                  gdouble x, gdouble y, gdouble width,
-                                  guint8 r, guint8 g, guint8 b)
+static gboolean print_job_ps_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
+                                      gdouble x, gdouble y, gdouble width,
+                                      guint8 r, guint8 g, guint8 b)
 {
        FILE *f;
        PipeError *pe;
        gchar *lc_pointer;
-       gint ret;
+       gboolean ret;
 
        if (!text) return TRUE;
 
@@ -1426,12 +1426,12 @@ static gint print_job_ps_page_text(PrintWindow *pw, const gchar *text, gdouble p
        return ret;
 }
 
-static gint print_job_ps_end(PrintWindow *pw)
+static gboolean print_job_ps_end(PrintWindow *pw)
 {
        FILE *f;
        PipeError *pe;
        gchar *lc_pointer;
-       gint ret;
+       gboolean ret;
 
        f = print_job_ps_fd(pw);
        if (!f) return FALSE;
@@ -1463,7 +1463,7 @@ static gint print_job_ps_end(PrintWindow *pw)
  *-----------------------------------------------------------------------------
  */
 
-static gint print_job_rgb_page_new(PrintWindow *pw, gint page)
+static gboolean print_job_rgb_page_new(PrintWindow *pw, gint page)
 {
        gint total;
 
@@ -1522,7 +1522,7 @@ static gint print_job_rgb_page_new(PrintWindow *pw, gint page)
        return (pw->job_path != NULL);
 }
 
-static gint print_job_rgb_page_done(PrintWindow *pw)
+static gboolean print_job_rgb_page_done(PrintWindow *pw)
 {
        gchar *pathl;
        gboolean ret = FALSE;
@@ -1574,9 +1574,9 @@ static gint print_job_rgb_page_done(PrintWindow *pw)
        return ret;
 }
 
-static gint print_job_rgb_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
-                                    gdouble x, gdouble y, gdouble w, gdouble h,
-                                    gdouble offx, gdouble offy)
+static gboolean print_job_rgb_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
+                                        gdouble x, gdouble y, gdouble w, gdouble h,
+                                        gdouble offx, gdouble offy)
 {
        gdouble sw, sh;
        gdouble dw, dh;
@@ -1648,9 +1648,9 @@ static gdouble convert_pango_dpi(gdouble points)
        return points * 72.0 / dpi;
 }
 
-static gint print_job_rgb_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
-                                   gdouble x, gdouble y, gdouble width,
-                                   guint8 r, guint8 g, guint8 b)
+static gboolean print_job_rgb_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
+                                       gdouble x, gdouble y, gdouble width,
+                                       guint8 r, guint8 g, guint8 b)
 {
        PangoLayout *layout;
        PangoFontDescription *desc;
@@ -1677,7 +1677,7 @@ static gint print_job_rgb_page_text(PrintWindow *pw, const gchar *text, gdouble
        return TRUE;
 }
 
-static gint print_job_rgb_init(PrintWindow *pw)
+static gboolean print_job_rgb_init(PrintWindow *pw)
 {
        if (pw->job_pixbuf) g_object_unref(pw->job_pixbuf);
        pw->job_pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8,
@@ -1692,7 +1692,7 @@ static gint print_job_rgb_init(PrintWindow *pw)
  *-----------------------------------------------------------------------------
  */
 
-static gint print_job_preview_page_new(PrintWindow *pw, gint page)
+static gboolean print_job_preview_page_new(PrintWindow *pw, gint page)
 {
        GdkPixbuf *pixbuf;
        gint w, h;
@@ -1780,14 +1780,14 @@ static gint print_job_preview_page_new(PrintWindow *pw, gint page)
        return TRUE;
 }
 
-static gint print_job_preview_page_done(PrintWindow *pw)
+static gboolean print_job_preview_page_done(PrintWindow *pw)
 {
        return TRUE;
 }
 
-static gint print_job_preview_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
-                                        gdouble x, gdouble y, gdouble w, gdouble h,
-                                        gdouble offx, gdouble offy)
+static gboolean print_job_preview_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
+                                            gdouble x, gdouble y, gdouble w, gdouble h,
+                                            gdouble offx, gdouble offy)
 {
        gdouble sw, sh;
        gdouble dw, dh;
@@ -1824,9 +1824,9 @@ static gint print_job_preview_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
        return TRUE;
 }
 
-static gint print_job_preview_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
-                                       gdouble x, gdouble y, gdouble width,
-                                       guint8 r, guint8 g, guint8 b)
+static gboolean print_job_preview_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
+                                           gdouble x, gdouble y, gdouble width,
+                                           guint8 r, guint8 g, guint8 b)
 {
        PangoLayout *layout;
        PangoFontDescription *desc;
@@ -1859,7 +1859,7 @@ static gint print_job_preview_page_text(PrintWindow *pw, const gchar *text, gdou
        return TRUE;
 }
 
-static gint print_job_preview_init(PrintWindow *pw)
+static gboolean print_job_preview_init(PrintWindow *pw)
 {
        if (pw->job_pixbuf) g_object_unref(pw->job_pixbuf);
        pw->job_pixbuf = image_get_pixbuf(pw->layout_image);
@@ -1875,7 +1875,7 @@ static gint print_job_preview_init(PrintWindow *pw)
  *-----------------------------------------------------------------------------
  */
 
-static gint print_job_page_new(PrintWindow *pw)
+static gboolean print_job_page_new(PrintWindow *pw)
 {
        switch (pw->job_format)
                {
@@ -1890,7 +1890,7 @@ static gint print_job_page_new(PrintWindow *pw)
        return FALSE;
 }
 
-static gint print_job_page_done(PrintWindow *pw)
+static gboolean print_job_page_done(PrintWindow *pw)
 {
        switch (pw->job_format)
                {
@@ -1905,9 +1905,9 @@ static gint print_job_page_done(PrintWindow *pw)
        return FALSE;
 }
 
-static gint print_job_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
-                                gdouble x, gdouble y, gdouble w, gdouble h,
-                                gdouble offx, gdouble offy)
+static gboolean print_job_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
+                                    gdouble x, gdouble y, gdouble w, gdouble h,
+                                    gdouble offx, gdouble offy)
 {
        gboolean success = FALSE;
 
@@ -1929,9 +1929,9 @@ static gint print_job_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
        return success;
 }
 
-static gint print_job_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
-                               gdouble x, gdouble y, gdouble width,
-                               guint8 r, guint8 g, guint8 b)
+static gboolean print_job_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
+                                   gdouble x, gdouble y, gdouble width,
+                                   guint8 r, guint8 g, guint8 b)
 {
        gboolean success = TRUE;
 
@@ -1959,8 +1959,8 @@ static gint print_job_page_text(PrintWindow *pw, const gchar *text, gdouble poin
  *-----------------------------------------------------------------------------
  */
 
-static gint print_job_render_image(PrintWindow *pw);
-static gint print_job_render_proof(PrintWindow *pw);
+static gboolean print_job_render_image(PrintWindow *pw);
+static gboolean print_job_render_proof(PrintWindow *pw);
 
 
 static void print_job_status(PrintWindow *pw)
@@ -2029,14 +2029,14 @@ static void print_job_done(PrintWindow *pw)
        print_job_close(pw, FALSE);
 }
 
-static gint print_job_text_image(PrintWindow *pw, const gchar *path,
-                                gdouble x, gdouble y, gdouble width,
-                                gint sw, gint sh, gint proof)
+static gboolean print_job_text_image(PrintWindow *pw, const gchar *path,
+                                    gdouble x, gdouble y, gdouble width,
+                                    gint sw, gint sh, gint proof)
 {
        GString *string;
        gboolean space = FALSE;
        gboolean newline = FALSE;
-       gint ret;
+       gboolean ret;
 
        if (pw->text_fields == 0) return TRUE;
 
@@ -2193,7 +2193,7 @@ static void print_job_render_image_loader_done(ImageLoader *il, gpointer data)
                }
 }
 
-static gint print_job_render_image(PrintWindow *pw)
+static gboolean print_job_render_image(PrintWindow *pw)
 {
        FileData *fd = NULL;
 
@@ -2344,7 +2344,7 @@ static void print_job_render_proof_loader_done(ImageLoader *il, gpointer data)
                }
 }
 
-static gint print_job_render_proof(PrintWindow *pw)
+static gboolean print_job_render_proof(PrintWindow *pw)
 {
        FileData *fd = NULL;
 
@@ -2377,7 +2377,7 @@ static gint print_job_render_proof(PrintWindow *pw)
 static void print_job_render(PrintWindow *pw)
 {
        gdouble proof_w, proof_h;
-       gint finished;
+       gboolean finished;
 
        pw->proof_position = 0;
 
@@ -2434,7 +2434,7 @@ static void print_job_render(PrintWindow *pw)
        if (finished) print_job_done(pw);
 }
 
-static gint print_job_init(PrintWindow *pw)
+static gboolean print_job_init(PrintWindow *pw)
 {
        gboolean success = FALSE;
 
@@ -2457,7 +2457,7 @@ static gint print_job_init(PrintWindow *pw)
        return success;
 }
 
-static gint print_job_finish(PrintWindow *pw)
+static gboolean print_job_finish(PrintWindow *pw)
 {
        gboolean success = FALSE;
 
@@ -2607,7 +2607,7 @@ static void print_pref_store(PrintWindow *pw)
        pref_list_double_set(PRINT_PREF_GROUP, PRINT_PREF_IMAGE_SCALE, pw->image_scale);
 }
 
-static gint print_job_start(PrintWindow *pw, RenderFormat format, PrintOutput output)
+static gboolean print_job_start(PrintWindow *pw, RenderFormat format, PrintOutput output)
 {
        GtkWidget *hbox;
        GtkWidget *spinner;
@@ -2733,7 +2733,7 @@ static GtkWidget *print_combo_menu(const gchar *text[], gint count, gint preferr
  */
 
 static GtkWidget *print_paper_menu(GtkWidget *table, gint column, gint row,
-                                  gint preferred, GCallback func, gpointer data)
+                                  PaperOrientation preferred, GCallback func, gpointer data)
 {
        GtkWidget *combo;
        gint i;
@@ -3173,7 +3173,7 @@ static void print_output_dpi_cb(GtkWidget *combo, gpointer data)
        pw->max_dpi = (gdouble)n;
 }
 
-static void print_text_field_set(PrintWindow *pw, TextInfo field, gint active)
+static void print_text_field_set(PrintWindow *pw, TextInfo field, gboolean active)
 {
        if (active)
                {
@@ -3190,7 +3190,7 @@ static void print_text_field_set(PrintWindow *pw, TextInfo field, gint active)
 static void print_text_cb_name(GtkWidget *widget, gpointer data)
 {
        PrintWindow *pw = data;
-       gint active;
+       gboolean active;
 
        active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
        print_text_field_set(pw, TEXT_INFO_FILENAME, active);
@@ -3199,7 +3199,7 @@ static void print_text_cb_name(GtkWidget *widget, gpointer data)
 static void print_text_cb_path(GtkWidget *widget, gpointer data)
 {
        PrintWindow *pw = data;
-       gint active;
+       gboolean active;
 
        active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
        print_text_field_set(pw, TEXT_INFO_FILEPATH, active);
@@ -3208,7 +3208,7 @@ static void print_text_cb_path(GtkWidget *widget, gpointer data)
 static void print_text_cb_date(GtkWidget *widget, gpointer data)
 {
        PrintWindow *pw = data;
-       gint active;
+       gboolean active;
 
        active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
        print_text_field_set(pw, TEXT_INFO_FILEDATE, active);
@@ -3217,7 +3217,7 @@ static void print_text_cb_date(GtkWidget *widget, gpointer data)
 static void print_text_cb_size(GtkWidget *widget, gpointer data)
 {
        PrintWindow *pw = data;
-       gint active;
+       gboolean active;
 
        active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
        print_text_field_set(pw, TEXT_INFO_FILESIZE, active);
@@ -3226,7 +3226,7 @@ static void print_text_cb_size(GtkWidget *widget, gpointer data)
 static void print_text_cb_dims(GtkWidget *widget, gpointer data)
 {
        PrintWindow *pw = data;
-       gint active;
+       gboolean active;
 
        active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
        print_text_field_set(pw, TEXT_INFO_DIMENSIONS, active);