comparison src/print.c @ 1443:f879e7d94c6d

gint -> gboolean.
author zas_
date Sun, 15 Mar 2009 13:33:56 +0000
parents a3d3208b0c50
children 24a12aa0cb54
comparison
equal deleted inserted replaced
1442:e37cde2857c1 1443:f879e7d94c6d
317 static void print_window_close(PrintWindow *pw); 317 static void print_window_close(PrintWindow *pw);
318 318
319 319
320 /* misc utils */ 320 /* misc utils */
321 321
322 static gint clip_region(gdouble x1, gdouble y1, gdouble w1, gdouble h1, 322 static gboolean clip_region(gdouble x1, gdouble y1, gdouble w1, gdouble h1,
323 gdouble x2, gdouble y2, gdouble w2, gdouble h2, 323 gdouble x2, gdouble y2, gdouble w2, gdouble h2,
324 gdouble *rx, gdouble *ry, gdouble *rw, gdouble *rh) 324 gdouble *rx, gdouble *ry, gdouble *rw, gdouble *rh)
325 { 325 {
326 if (x2 + w2 <= x1 || x2 >= x1 + w1 || 326 if (x2 + w2 <= x1 || x2 >= x1 + w1 ||
327 y2 + h2 <= y1 || y2 >= y1 + h1) 327 y2 + h2 <= y1 || y2 >= y1 + h1)
328 { 328 {
329 return FALSE; 329 return FALSE;
1006 1006
1007 pipe_handler_data = NULL; 1007 pipe_handler_data = NULL;
1008 g_free(pe); 1008 g_free(pe);
1009 } 1009 }
1010 1010
1011 static gint pipe_handler_check(PipeError *pe) 1011 static gboolean pipe_handler_check(PipeError *pe)
1012 { 1012 {
1013 if (!pe) return FALSE; 1013 if (!pe) return FALSE;
1014 return *pe->error; 1014 return !!(*pe->error);
1015 } 1015 }
1016 1016
1017 static FILE *print_job_ps_fd(PrintWindow *pw) 1017 static FILE *print_job_ps_fd(PrintWindow *pw)
1018 { 1018 {
1019 if (pw->job_file) return pw->job_file; 1019 if (pw->job_file) return pw->job_file;
1020 if (pw->job_pipe) return pw->job_pipe; 1020 if (pw->job_pipe) return pw->job_pipe;
1021 return NULL; 1021 return NULL;
1022 } 1022 }
1023 1023
1024 static gint print_job_ps_init(PrintWindow *pw) 1024 static gboolean print_job_ps_init(PrintWindow *pw)
1025 { 1025 {
1026 FILE *f; 1026 FILE *f;
1027 PipeError *pe; 1027 PipeError *pe;
1028 const gchar *cmd = NULL; 1028 const gchar *cmd = NULL;
1029 const gchar *path = NULL; 1029 const gchar *path = NULL;
1030 gchar *lc_pointer; 1030 gchar *lc_pointer;
1031 gint ret; 1031 gboolean ret;
1032 1032
1033 if (pw->job_file != NULL || pw->job_pipe != NULL) return FALSE; 1033 if (pw->job_file != NULL || pw->job_pipe != NULL) return FALSE;
1034 1034
1035 switch (pw->job_output) 1035 switch (pw->job_output)
1036 { 1036 {
1143 if (!ret) print_job_throw_error(pw, _("SIGPIPE error writing to printer.")); 1143 if (!ret) print_job_throw_error(pw, _("SIGPIPE error writing to printer."));
1144 1144
1145 return ret; 1145 return ret;
1146 } 1146 }
1147 1147
1148 static gint print_job_ps_page_new(PrintWindow *pw, gint page) 1148 static gboolean print_job_ps_page_new(PrintWindow *pw, gint page)
1149 { 1149 {
1150 FILE *f; 1150 FILE *f;
1151 PipeError *pe; 1151 PipeError *pe;
1152 gchar *lc_pointer; 1152 gchar *lc_pointer;
1153 gint ret; 1153 gboolean ret;
1154 1154
1155 f= print_job_ps_fd(pw); 1155 f= print_job_ps_fd(pw);
1156 if (!f) return FALSE; 1156 if (!f) return FALSE;
1157 1157
1158 lc_pointer = g_strdup(setlocale(LC_NUMERIC, NULL)); 1158 lc_pointer = g_strdup(setlocale(LC_NUMERIC, NULL));
1180 if (!ret) print_job_throw_error(pw, _("SIGPIPE error writing to printer.")); 1180 if (!ret) print_job_throw_error(pw, _("SIGPIPE error writing to printer."));
1181 1181
1182 return ret; 1182 return ret;
1183 } 1183 }
1184 1184
1185 static gint print_job_ps_page_done(PrintWindow *pw) 1185 static gboolean print_job_ps_page_done(PrintWindow *pw)
1186 { 1186 {
1187 FILE *f; 1187 FILE *f;
1188 PipeError *pe; 1188 PipeError *pe;
1189 gchar *lc_pointer; 1189 gchar *lc_pointer;
1190 gint ret; 1190 gboolean ret;
1191 1191
1192 f = print_job_ps_fd(pw); 1192 f = print_job_ps_fd(pw);
1193 if (!f) return FALSE; 1193 if (!f) return FALSE;
1194 1194
1195 lc_pointer = g_strdup(setlocale(LC_NUMERIC, NULL)); 1195 lc_pointer = g_strdup(setlocale(LC_NUMERIC, NULL));
1231 } 1231 }
1232 text[6] = '\0'; 1232 text[6] = '\0';
1233 1233
1234 g_fprintf(f, "%s", text); 1234 g_fprintf(f, "%s", text);
1235 } 1235 }
1236 static gint print_job_ps_page_image(PrintWindow *pw, GdkPixbuf *pixbuf, 1236 static gboolean print_job_ps_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
1237 gdouble x, gdouble y, gdouble w, gdouble h, 1237 gdouble x, gdouble y, gdouble w, gdouble h,
1238 gdouble offx, gdouble offy) 1238 gdouble offx, gdouble offy)
1239 { 1239 {
1240 FILE *f; 1240 FILE *f;
1241 PipeError *pe; 1241 PipeError *pe;
1242 gchar *lc_pointer; 1242 gchar *lc_pointer;
1243 gint sw, sh; 1243 gint sw, sh;
1246 guchar *pix; 1246 guchar *pix;
1247 gint i, j; 1247 gint i, j;
1248 gint c; 1248 gint c;
1249 guchar *p; 1249 guchar *p;
1250 guchar bps_buf[3]; 1250 guchar bps_buf[3];
1251 gint ret; 1251 gboolean ret;
1252 1252
1253 if (!pixbuf) return TRUE; 1253 if (!pixbuf) return TRUE;
1254 1254
1255 f = print_job_ps_fd(pw); 1255 f = print_job_ps_fd(pw);
1256 if (!f) return FALSE; 1256 if (!f) return FALSE;
1384 } 1384 }
1385 1385
1386 g_fprintf(f, "closepath\n"); 1386 g_fprintf(f, "closepath\n");
1387 } 1387 }
1388 1388
1389 static gint print_job_ps_page_text(PrintWindow *pw, const gchar *text, gdouble point_size, 1389 static gboolean print_job_ps_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
1390 gdouble x, gdouble y, gdouble width, 1390 gdouble x, gdouble y, gdouble width,
1391 guint8 r, guint8 g, guint8 b) 1391 guint8 r, guint8 g, guint8 b)
1392 { 1392 {
1393 FILE *f; 1393 FILE *f;
1394 PipeError *pe; 1394 PipeError *pe;
1395 gchar *lc_pointer; 1395 gchar *lc_pointer;
1396 gint ret; 1396 gboolean ret;
1397 1397
1398 if (!text) return TRUE; 1398 if (!text) return TRUE;
1399 1399
1400 f = print_job_ps_fd(pw); 1400 f = print_job_ps_fd(pw);
1401 if (!f) return FALSE; 1401 if (!f) return FALSE;
1424 if (!ret) print_job_throw_error(pw, _("SIGPIPE error writing to printer.")); 1424 if (!ret) print_job_throw_error(pw, _("SIGPIPE error writing to printer."));
1425 1425
1426 return ret; 1426 return ret;
1427 } 1427 }
1428 1428
1429 static gint print_job_ps_end(PrintWindow *pw) 1429 static gboolean print_job_ps_end(PrintWindow *pw)
1430 { 1430 {
1431 FILE *f; 1431 FILE *f;
1432 PipeError *pe; 1432 PipeError *pe;
1433 gchar *lc_pointer; 1433 gchar *lc_pointer;
1434 gint ret; 1434 gboolean ret;
1435 1435
1436 f = print_job_ps_fd(pw); 1436 f = print_job_ps_fd(pw);
1437 if (!f) return FALSE; 1437 if (!f) return FALSE;
1438 1438
1439 lc_pointer = g_strdup(setlocale(LC_NUMERIC, NULL)); 1439 lc_pointer = g_strdup(setlocale(LC_NUMERIC, NULL));
1461 *----------------------------------------------------------------------------- 1461 *-----------------------------------------------------------------------------
1462 * print rgb 1462 * print rgb
1463 *----------------------------------------------------------------------------- 1463 *-----------------------------------------------------------------------------
1464 */ 1464 */
1465 1465
1466 static gint print_job_rgb_page_new(PrintWindow *pw, gint page) 1466 static gboolean print_job_rgb_page_new(PrintWindow *pw, gint page)
1467 { 1467 {
1468 gint total; 1468 gint total;
1469 1469
1470 if (pw->job_pixbuf) 1470 if (pw->job_pixbuf)
1471 { 1471 {
1520 } 1520 }
1521 1521
1522 return (pw->job_path != NULL); 1522 return (pw->job_path != NULL);
1523 } 1523 }
1524 1524
1525 static gint print_job_rgb_page_done(PrintWindow *pw) 1525 static gboolean print_job_rgb_page_done(PrintWindow *pw)
1526 { 1526 {
1527 gchar *pathl; 1527 gchar *pathl;
1528 gboolean ret = FALSE; 1528 gboolean ret = FALSE;
1529 1529
1530 if (!pw->job_pixbuf) return FALSE; 1530 if (!pw->job_pixbuf) return FALSE;
1572 } 1572 }
1573 1573
1574 return ret; 1574 return ret;
1575 } 1575 }
1576 1576
1577 static gint print_job_rgb_page_image(PrintWindow *pw, GdkPixbuf *pixbuf, 1577 static gboolean print_job_rgb_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
1578 gdouble x, gdouble y, gdouble w, gdouble h, 1578 gdouble x, gdouble y, gdouble w, gdouble h,
1579 gdouble offx, gdouble offy) 1579 gdouble offx, gdouble offy)
1580 { 1580 {
1581 gdouble sw, sh; 1581 gdouble sw, sh;
1582 gdouble dw, dh; 1582 gdouble dw, dh;
1583 gdouble rx, ry, rw, rh; 1583 gdouble rx, ry, rw, rh;
1584 1584
1646 1646
1647 if (dpi == 0) return points; 1647 if (dpi == 0) return points;
1648 return points * 72.0 / dpi; 1648 return points * 72.0 / dpi;
1649 } 1649 }
1650 1650
1651 static gint print_job_rgb_page_text(PrintWindow *pw, const gchar *text, gdouble point_size, 1651 static gboolean print_job_rgb_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
1652 gdouble x, gdouble y, gdouble width, 1652 gdouble x, gdouble y, gdouble width,
1653 guint8 r, guint8 g, guint8 b) 1653 guint8 r, guint8 g, guint8 b)
1654 { 1654 {
1655 PangoLayout *layout; 1655 PangoLayout *layout;
1656 PangoFontDescription *desc; 1656 PangoFontDescription *desc;
1657 gint lw, lh; 1657 gint lw, lh;
1658 1658
1675 g_object_unref(G_OBJECT(layout)); 1675 g_object_unref(G_OBJECT(layout));
1676 1676
1677 return TRUE; 1677 return TRUE;
1678 } 1678 }
1679 1679
1680 static gint print_job_rgb_init(PrintWindow *pw) 1680 static gboolean print_job_rgb_init(PrintWindow *pw)
1681 { 1681 {
1682 if (pw->job_pixbuf) g_object_unref(pw->job_pixbuf); 1682 if (pw->job_pixbuf) g_object_unref(pw->job_pixbuf);
1683 pw->job_pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, 1683 pw->job_pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8,
1684 (gint)pw->layout_width, (gint)pw->layout_height); 1684 (gint)pw->layout_width, (gint)pw->layout_height);
1685 1685
1690 *----------------------------------------------------------------------------- 1690 *-----------------------------------------------------------------------------
1691 * print preview 1691 * print preview
1692 *----------------------------------------------------------------------------- 1692 *-----------------------------------------------------------------------------
1693 */ 1693 */
1694 1694
1695 static gint print_job_preview_page_new(PrintWindow *pw, gint page) 1695 static gboolean print_job_preview_page_new(PrintWindow *pw, gint page)
1696 { 1696 {
1697 GdkPixbuf *pixbuf; 1697 GdkPixbuf *pixbuf;
1698 gint w, h; 1698 gint w, h;
1699 gint l, r, t, b; 1699 gint l, r, t, b;
1700 1700
1778 image_area_changed(pw->layout_image, 0, 0, w, h); 1778 image_area_changed(pw->layout_image, 0, 0, w, h);
1779 1779
1780 return TRUE; 1780 return TRUE;
1781 } 1781 }
1782 1782
1783 static gint print_job_preview_page_done(PrintWindow *pw) 1783 static gboolean print_job_preview_page_done(PrintWindow *pw)
1784 { 1784 {
1785 return TRUE; 1785 return TRUE;
1786 } 1786 }
1787 1787
1788 static gint print_job_preview_page_image(PrintWindow *pw, GdkPixbuf *pixbuf, 1788 static gboolean print_job_preview_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
1789 gdouble x, gdouble y, gdouble w, gdouble h, 1789 gdouble x, gdouble y, gdouble w, gdouble h,
1790 gdouble offx, gdouble offy) 1790 gdouble offx, gdouble offy)
1791 { 1791 {
1792 gdouble sw, sh; 1792 gdouble sw, sh;
1793 gdouble dw, dh; 1793 gdouble dw, dh;
1794 gdouble rx, ry, rw, rh; 1794 gdouble rx, ry, rw, rh;
1795 1795
1822 } 1822 }
1823 1823
1824 return TRUE; 1824 return TRUE;
1825 } 1825 }
1826 1826
1827 static gint print_job_preview_page_text(PrintWindow *pw, const gchar *text, gdouble point_size, 1827 static gboolean print_job_preview_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
1828 gdouble x, gdouble y, gdouble width, 1828 gdouble x, gdouble y, gdouble width,
1829 guint8 r, guint8 g, guint8 b) 1829 guint8 r, guint8 g, guint8 b)
1830 { 1830 {
1831 PangoLayout *layout; 1831 PangoLayout *layout;
1832 PangoFontDescription *desc; 1832 PangoFontDescription *desc;
1833 gint lw, lh; 1833 gint lw, lh;
1834 GdkPixbuf *pixbuf; 1834 GdkPixbuf *pixbuf;
1857 g_object_unref(pixbuf); 1857 g_object_unref(pixbuf);
1858 1858
1859 return TRUE; 1859 return TRUE;
1860 } 1860 }
1861 1861
1862 static gint print_job_preview_init(PrintWindow *pw) 1862 static gboolean print_job_preview_init(PrintWindow *pw)
1863 { 1863 {
1864 if (pw->job_pixbuf) g_object_unref(pw->job_pixbuf); 1864 if (pw->job_pixbuf) g_object_unref(pw->job_pixbuf);
1865 pw->job_pixbuf = image_get_pixbuf(pw->layout_image); 1865 pw->job_pixbuf = image_get_pixbuf(pw->layout_image);
1866 g_object_ref(pw->job_pixbuf); 1866 g_object_ref(pw->job_pixbuf);
1867 1867
1873 *----------------------------------------------------------------------------- 1873 *-----------------------------------------------------------------------------
1874 * wrappers 1874 * wrappers
1875 *----------------------------------------------------------------------------- 1875 *-----------------------------------------------------------------------------
1876 */ 1876 */
1877 1877
1878 static gint print_job_page_new(PrintWindow *pw) 1878 static gboolean print_job_page_new(PrintWindow *pw)
1879 { 1879 {
1880 switch (pw->job_format) 1880 switch (pw->job_format)
1881 { 1881 {
1882 case RENDER_FORMAT_RGB: 1882 case RENDER_FORMAT_RGB:
1883 return print_job_rgb_page_new(pw, pw->job_page); 1883 return print_job_rgb_page_new(pw, pw->job_page);
1888 } 1888 }
1889 1889
1890 return FALSE; 1890 return FALSE;
1891 } 1891 }
1892 1892
1893 static gint print_job_page_done(PrintWindow *pw) 1893 static gboolean print_job_page_done(PrintWindow *pw)
1894 { 1894 {
1895 switch (pw->job_format) 1895 switch (pw->job_format)
1896 { 1896 {
1897 case RENDER_FORMAT_RGB: 1897 case RENDER_FORMAT_RGB:
1898 return print_job_rgb_page_done(pw); 1898 return print_job_rgb_page_done(pw);
1903 } 1903 }
1904 1904
1905 return FALSE; 1905 return FALSE;
1906 } 1906 }
1907 1907
1908 static gint print_job_page_image(PrintWindow *pw, GdkPixbuf *pixbuf, 1908 static gboolean print_job_page_image(PrintWindow *pw, GdkPixbuf *pixbuf,
1909 gdouble x, gdouble y, gdouble w, gdouble h, 1909 gdouble x, gdouble y, gdouble w, gdouble h,
1910 gdouble offx, gdouble offy) 1910 gdouble offx, gdouble offy)
1911 { 1911 {
1912 gboolean success = FALSE; 1912 gboolean success = FALSE;
1913 1913
1914 if (w <= 0.0 || h <= 0.0) return TRUE; 1914 if (w <= 0.0 || h <= 0.0) return TRUE;
1915 1915
1927 } 1927 }
1928 1928
1929 return success; 1929 return success;
1930 } 1930 }
1931 1931
1932 static gint print_job_page_text(PrintWindow *pw, const gchar *text, gdouble point_size, 1932 static gboolean print_job_page_text(PrintWindow *pw, const gchar *text, gdouble point_size,
1933 gdouble x, gdouble y, gdouble width, 1933 gdouble x, gdouble y, gdouble width,
1934 guint8 r, guint8 g, guint8 b) 1934 guint8 r, guint8 g, guint8 b)
1935 { 1935 {
1936 gboolean success = TRUE; 1936 gboolean success = TRUE;
1937 1937
1938 if (!text) return TRUE; 1938 if (!text) return TRUE;
1939 1939
1957 *----------------------------------------------------------------------------- 1957 *-----------------------------------------------------------------------------
1958 * print ? 1958 * print ?
1959 *----------------------------------------------------------------------------- 1959 *-----------------------------------------------------------------------------
1960 */ 1960 */
1961 1961
1962 static gint print_job_render_image(PrintWindow *pw); 1962 static gboolean print_job_render_image(PrintWindow *pw);
1963 static gint print_job_render_proof(PrintWindow *pw); 1963 static gboolean print_job_render_proof(PrintWindow *pw);
1964 1964
1965 1965
1966 static void print_job_status(PrintWindow *pw) 1966 static void print_job_status(PrintWindow *pw)
1967 { 1967 {
1968 gdouble value; 1968 gdouble value;
2027 static void print_job_done(PrintWindow *pw) 2027 static void print_job_done(PrintWindow *pw)
2028 { 2028 {
2029 print_job_close(pw, FALSE); 2029 print_job_close(pw, FALSE);
2030 } 2030 }
2031 2031
2032 static gint print_job_text_image(PrintWindow *pw, const gchar *path, 2032 static gboolean print_job_text_image(PrintWindow *pw, const gchar *path,
2033 gdouble x, gdouble y, gdouble width, 2033 gdouble x, gdouble y, gdouble width,
2034 gint sw, gint sh, gint proof) 2034 gint sw, gint sh, gint proof)
2035 { 2035 {
2036 GString *string; 2036 GString *string;
2037 gboolean space = FALSE; 2037 gboolean space = FALSE;
2038 gboolean newline = FALSE; 2038 gboolean newline = FALSE;
2039 gint ret; 2039 gboolean ret;
2040 2040
2041 if (pw->text_fields == 0) return TRUE; 2041 if (pw->text_fields == 0) return TRUE;
2042 2042
2043 string = g_string_new(""); 2043 string = g_string_new("");
2044 path = image_loader_get_fd(pw->job_loader)->path; 2044 path = image_loader_get_fd(pw->job_loader)->path;
2191 { 2191 {
2192 print_job_done(pw); 2192 print_job_done(pw);
2193 } 2193 }
2194 } 2194 }
2195 2195
2196 static gint print_job_render_image(PrintWindow *pw) 2196 static gboolean print_job_render_image(PrintWindow *pw)
2197 { 2197 {
2198 FileData *fd = NULL; 2198 FileData *fd = NULL;
2199 2199
2200 switch (pw->source) 2200 switch (pw->source)
2201 { 2201 {
2342 } 2342 }
2343 } 2343 }
2344 } 2344 }
2345 } 2345 }
2346 2346
2347 static gint print_job_render_proof(PrintWindow *pw) 2347 static gboolean print_job_render_proof(PrintWindow *pw)
2348 { 2348 {
2349 FileData *fd = NULL; 2349 FileData *fd = NULL;
2350 2350
2351 if (pw->proof_columns < 1 || pw->proof_rows < 1) return FALSE; 2351 if (pw->proof_columns < 1 || pw->proof_rows < 1) return FALSE;
2352 2352
2375 } 2375 }
2376 2376
2377 static void print_job_render(PrintWindow *pw) 2377 static void print_job_render(PrintWindow *pw)
2378 { 2378 {
2379 gdouble proof_w, proof_h; 2379 gdouble proof_w, proof_h;
2380 gint finished; 2380 gboolean finished;
2381 2381
2382 pw->proof_position = 0; 2382 pw->proof_position = 0;
2383 2383
2384 switch (pw->source) 2384 switch (pw->source)
2385 { 2385 {
2432 } 2432 }
2433 2433
2434 if (finished) print_job_done(pw); 2434 if (finished) print_job_done(pw);
2435 } 2435 }
2436 2436
2437 static gint print_job_init(PrintWindow *pw) 2437 static gboolean print_job_init(PrintWindow *pw)
2438 { 2438 {
2439 gboolean success = FALSE; 2439 gboolean success = FALSE;
2440 2440
2441 pw->job_page = 0; 2441 pw->job_page = 0;
2442 2442
2455 } 2455 }
2456 2456
2457 return success; 2457 return success;
2458 } 2458 }
2459 2459
2460 static gint print_job_finish(PrintWindow *pw) 2460 static gboolean print_job_finish(PrintWindow *pw)
2461 { 2461 {
2462 gboolean success = FALSE; 2462 gboolean success = FALSE;
2463 2463
2464 switch (pw->job_format) 2464 switch (pw->job_format)
2465 { 2465 {
2605 pref_list_int_set(PRINT_PREF_GROUP, PRINT_PREF_LAYOUT, pw->layout); 2605 pref_list_int_set(PRINT_PREF_GROUP, PRINT_PREF_LAYOUT, pw->layout);
2606 2606
2607 pref_list_double_set(PRINT_PREF_GROUP, PRINT_PREF_IMAGE_SCALE, pw->image_scale); 2607 pref_list_double_set(PRINT_PREF_GROUP, PRINT_PREF_IMAGE_SCALE, pw->image_scale);
2608 } 2608 }
2609 2609
2610 static gint print_job_start(PrintWindow *pw, RenderFormat format, PrintOutput output) 2610 static gboolean print_job_start(PrintWindow *pw, RenderFormat format, PrintOutput output)
2611 { 2611 {
2612 GtkWidget *hbox; 2612 GtkWidget *hbox;
2613 GtkWidget *spinner; 2613 GtkWidget *spinner;
2614 gchar *msg; 2614 gchar *msg;
2615 2615
2731 * paper selection 2731 * paper selection
2732 *----------------------------------------------------------------------------- 2732 *-----------------------------------------------------------------------------
2733 */ 2733 */
2734 2734
2735 static GtkWidget *print_paper_menu(GtkWidget *table, gint column, gint row, 2735 static GtkWidget *print_paper_menu(GtkWidget *table, gint column, gint row,
2736 gint preferred, GCallback func, gpointer data) 2736 PaperOrientation preferred, GCallback func, gpointer data)
2737 { 2737 {
2738 GtkWidget *combo; 2738 GtkWidget *combo;
2739 gint i; 2739 gint i;
2740 2740
2741 pref_table_label(table, column, row, (_("Format:")), 1.0); 2741 pref_table_label(table, column, row, (_("Format:")), 1.0);
3171 gtk_tree_model_get(store, &iter, 1, &n, -1); 3171 gtk_tree_model_get(store, &iter, 1, &n, -1);
3172 3172
3173 pw->max_dpi = (gdouble)n; 3173 pw->max_dpi = (gdouble)n;
3174 } 3174 }
3175 3175
3176 static void print_text_field_set(PrintWindow *pw, TextInfo field, gint active) 3176 static void print_text_field_set(PrintWindow *pw, TextInfo field, gboolean active)
3177 { 3177 {
3178 if (active) 3178 if (active)
3179 { 3179 {
3180 pw->text_fields |= field; 3180 pw->text_fields |= field;
3181 } 3181 }
3188 } 3188 }
3189 3189
3190 static void print_text_cb_name(GtkWidget *widget, gpointer data) 3190 static void print_text_cb_name(GtkWidget *widget, gpointer data)
3191 { 3191 {
3192 PrintWindow *pw = data; 3192 PrintWindow *pw = data;
3193 gint active; 3193 gboolean active;
3194 3194
3195 active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); 3195 active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3196 print_text_field_set(pw, TEXT_INFO_FILENAME, active); 3196 print_text_field_set(pw, TEXT_INFO_FILENAME, active);
3197 } 3197 }
3198 3198
3199 static void print_text_cb_path(GtkWidget *widget, gpointer data) 3199 static void print_text_cb_path(GtkWidget *widget, gpointer data)
3200 { 3200 {
3201 PrintWindow *pw = data; 3201 PrintWindow *pw = data;
3202 gint active; 3202 gboolean active;
3203 3203
3204 active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); 3204 active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3205 print_text_field_set(pw, TEXT_INFO_FILEPATH, active); 3205 print_text_field_set(pw, TEXT_INFO_FILEPATH, active);
3206 } 3206 }
3207 3207
3208 static void print_text_cb_date(GtkWidget *widget, gpointer data) 3208 static void print_text_cb_date(GtkWidget *widget, gpointer data)
3209 { 3209 {
3210 PrintWindow *pw = data; 3210 PrintWindow *pw = data;
3211 gint active; 3211 gboolean active;
3212 3212
3213 active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); 3213 active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3214 print_text_field_set(pw, TEXT_INFO_FILEDATE, active); 3214 print_text_field_set(pw, TEXT_INFO_FILEDATE, active);
3215 } 3215 }
3216 3216
3217 static void print_text_cb_size(GtkWidget *widget, gpointer data) 3217 static void print_text_cb_size(GtkWidget *widget, gpointer data)
3218 { 3218 {
3219 PrintWindow *pw = data; 3219 PrintWindow *pw = data;
3220 gint active; 3220 gboolean active;
3221 3221
3222 active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); 3222 active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3223 print_text_field_set(pw, TEXT_INFO_FILESIZE, active); 3223 print_text_field_set(pw, TEXT_INFO_FILESIZE, active);
3224 } 3224 }
3225 3225
3226 static void print_text_cb_dims(GtkWidget *widget, gpointer data) 3226 static void print_text_cb_dims(GtkWidget *widget, gpointer data)
3227 { 3227 {
3228 PrintWindow *pw = data; 3228 PrintWindow *pw = data;
3229 gint active; 3229 gboolean active;
3230 3230
3231 active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); 3231 active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3232 print_text_field_set(pw, TEXT_INFO_DIMENSIONS, active); 3232 print_text_field_set(pw, TEXT_INFO_DIMENSIONS, active);
3233 } 3233 }
3234 3234