# HG changeset patch # User zas_ # Date 1237124036 0 # Node ID f879e7d94c6d40113c674f77ef17619e8bf1c6a7 # Parent e37cde2857c1e2518387a5595859207904ca9c0b gint -> gboolean. diff -r e37cde2857c1 -r f879e7d94c6d src/pixbuf_util.c --- a/src/pixbuf_util.c Sun Mar 15 12:41:39 2009 +0000 +++ b/src/pixbuf_util.c Sun Mar 15 13:33:56 2009 +0000 @@ -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 @@ 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 @@ *----------------------------------------------------------------------------- */ -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 @@ 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 @@ * 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 @@ * 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 @@ 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 @@ 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 @@ pp++; *pp = (b * a + *pp * (256-a)) >> 8; pp++; - if (p_alpha) pp++; + if (has_alpha) pp++; } } } @@ -603,7 +604,7 @@ 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 @@ 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_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 @@ 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 @@ 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 @@ 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 @@ pp++; *pp = (b * a + *pp * (256-a)) >> 8; pp++; - if (p_alpha) pp++; + if (has_alpha) pp++; xa++; } @@ -957,9 +958,9 @@ *----------------------------------------------------------------------------- */ -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 @@ 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 @@ 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 @@ *----------------------------------------------------------------------------- */ -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 @@ 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 @@ 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 @@ 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 @@ pp++; *pp = (b * n + *pp * (256-n)) >> 8; pp++; - if (p_alpha) pp++; + if (has_alpha) pp++; } } } @@ -1234,7 +1235,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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_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 @@ 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 @@ pp++; *pp = grey; pp++; - if (p_alpha) pp++; + if (has_alpha) pp++; } } } diff -r e37cde2857c1 -r f879e7d94c6d src/pixbuf_util.h --- a/src/pixbuf_util.h Sun Mar 15 12:41:39 2009 +0000 +++ b/src/pixbuf_util.h Sun Mar 15 13:33:56 2009 +0000 @@ -24,7 +24,7 @@ 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 @@ #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 @@ /* 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); diff -r e37cde2857c1 -r f879e7d94c6d src/preferences.c --- a/src/preferences.c Sun Mar 15 12:41:39 2009 +0000 +++ b/src/preferences.c Sun Mar 15 13:33:56 2009 +0000 @@ -380,7 +380,7 @@ 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_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 @@ 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_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_sidecar_cb(GtkCellRendererToggle *renderer, - gchar *path_str, gpointer data) + gchar *path_str, gpointer data) { GtkWidget *model = data; FilterEntry *fe; @@ -1804,7 +1803,7 @@ 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; diff -r e37cde2857c1 -r f879e7d94c6d src/print.c --- a/src/print.c Sun Mar 15 12:41:39 2009 +0000 +++ b/src/print.c Sun Mar 15 13:33:56 2009 +0000 @@ -319,9 +319,9 @@ /* 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ gint c; guchar *p; guchar bps_buf[3]; - gint ret; + gboolean ret; if (!pixbuf) return TRUE; @@ -1386,14 +1386,14 @@ 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 @@ 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_rgb_page_new(PrintWindow *pw, gint page) +static gboolean print_job_rgb_page_new(PrintWindow *pw, gint page) { gint total; @@ -1522,7 +1522,7 @@ 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 @@ 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 @@ 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 @@ 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_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 @@ 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 @@ 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 @@ 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_page_new(PrintWindow *pw) +static gboolean print_job_page_new(PrintWindow *pw) { switch (pw->job_format) { @@ -1890,7 +1890,7 @@ 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 @@ 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 @@ 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_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 @@ 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 gint print_job_render_image(PrintWindow *pw) +static gboolean print_job_render_image(PrintWindow *pw) { FileData *fd = NULL; @@ -2344,7 +2344,7 @@ } } -static gint print_job_render_proof(PrintWindow *pw) +static gboolean print_job_render_proof(PrintWindow *pw) { FileData *fd = NULL; @@ -2377,7 +2377,7 @@ static void print_job_render(PrintWindow *pw) { gdouble proof_w, proof_h; - gint finished; + gboolean finished; pw->proof_position = 0; @@ -2434,7 +2434,7 @@ 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 @@ return success; } -static gint print_job_finish(PrintWindow *pw) +static gboolean print_job_finish(PrintWindow *pw) { gboolean success = FALSE; @@ -2607,7 +2607,7 @@ 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_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 @@ 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_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_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_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_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_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);