head 1.4; access; symbols pkgsrc-2013Q2:1.4.0.54 pkgsrc-2013Q2-base:1.4 pkgsrc-2012Q4:1.4.0.52 pkgsrc-2012Q4-base:1.4 pkgsrc-2011Q4:1.4.0.50 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q2:1.4.0.48 pkgsrc-2011Q2-base:1.4 pkgsrc-2009Q4:1.4.0.46 pkgsrc-2009Q4-base:1.4 pkgsrc-2008Q4:1.4.0.44 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.42 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.4.0.40 cube-native-xorg-base:1.4 pkgsrc-2008Q2:1.4.0.38 pkgsrc-2008Q2-base:1.4 pkgsrc-2008Q1:1.4.0.36 pkgsrc-2008Q1-base:1.4 pkgsrc-2007Q4:1.4.0.34 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.32 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.4.0.30 pkgsrc-2007Q2-base:1.4 pkgsrc-2007Q1:1.4.0.28 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.4.0.26 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.4.0.24 pkgsrc-2006Q3-base:1.4 pkgsrc-2006Q2:1.4.0.22 pkgsrc-2006Q2-base:1.4 pkgsrc-2006Q1:1.4.0.20 pkgsrc-2006Q1-base:1.4 pkgsrc-2005Q4:1.4.0.18 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.16 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.14 pkgsrc-2005Q2-base:1.4 pkgsrc-2005Q1:1.4.0.12 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.4.0.10 pkgsrc-2004Q4-base:1.4 pkgsrc-2004Q3:1.4.0.8 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.4.0.6 pkgsrc-2004Q2-base:1.4 pkgsrc-2004Q1:1.4.0.4 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.4.0.2 pkgsrc-2003Q4-base:1.4 buildlink2-base:1.4 netbsd-1-4-RELEASE:1.1; locks; strict; comment @# @; 1.4 date 2001.02.21.20.33.54; author veego; state dead; branches; next 1.3; 1.3 date 2000.11.29.21.38.24; author wiz; state Exp; branches; next 1.2; 1.2 date 99.05.03.16.20.01; author rh; state dead; branches; next 1.1; 1.1 date 98.11.28.20.59.58; author frueauf; state Exp; branches; next ; desc @@ 1.4 log @The old sane package is replaced by two new packages: sane-backends and sane-frontends @ text @$NetBSD: patch-ad,v 1.3 2000/11/29 21:38:24 wiz Exp $ --- frontend/xscanimage.c.orig Sat Aug 12 16:53:36 2000 +++ frontend/xscanimage.c @@@@ -57,6 +57,11 @@@@ #ifdef HAVE_LIBGIMP_GIMP_H +/* + * Enable old Gimp API. Eventually, we should rewrite this frontend + * to use the new API. [pere 2000-10-29] + */ +#define GIMP_ENABLE_COMPAT_CRUFT #include static void query (void); @@@@ -119,10 +124,13 @@@@ { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V'}, - {0, } + {0, 0, 0, 0 } }; +static int gtk_quit_flag; /* Call gtk_main_quit() only if at least one device + device is found. */ + /* forward declarations: */ int main (int argc, char ** argv); @@@@ -367,24 +375,24 @@@@ if (sane_get_parameters (gsg_dialog_get_device (dialog), ¶ms) == SANE_STATUS_GOOD) { - u_long size = 10 * params.bytes_per_line * params.lines; + double size = params.bytes_per_line * params.lines; const char *unit = "B"; if (params.format >= SANE_FRAME_RED && params.format <= SANE_FRAME_BLUE) size *= 3; - if (size >= 10 * 1024 * 1024) + if (size >= 1024 * 1024) { size /= 1024 * 1024; unit = "MB"; } - else if (size >= 10 * 1024) + else if (size >= 1024) { size /= 1024; unit = "KB"; } - sprintf (buf, "%dx%d: %lu.%01lu %s", params.pixels_per_line, - params.lines, size / 10, size % 10, unit); + sprintf (buf, "%dx%d: %1.1f %s", params.pixels_per_line, + params.lines, size, unit); } else sprintf (buf, "Invalid parameters."); @@@@ -454,11 +462,13 @@@@ if (dialog && gsg_dialog_get_device (dialog)) sane_close (gsg_dialog_get_device (dialog)); sane_exit (); - gtk_main_quit (); + if (gtk_quit_flag == 1) + gtk_main_quit (); #ifdef HAVE_LIBGIMP_GIMP_H if (scan_win.mode == SANE_GIMP_EXTENSION) gimp_quit (); #endif + fprintf(stderr, "xscanimage exiting.\n"); exit (0); } @@@@ -555,7 +565,7 @@@@ while (1) { - status = sane_read (dev, buf, sizeof (buf), &len); + status = sane_read (dev, (unsigned char *) buf, sizeof (buf), &len); if (status != SANE_STATUS_GOOD) { if (status == SANE_STATUS_EOF) @@@@ -1692,10 +1702,15 @@@@ } else { - fprintf (stderr, "%s: no devices available.\n", prog_name); + fprintf(stderr, "No scanners were identified. If you were expecting something\n" + " different, check that the scanner is plugged in, turned on and\n" + " detected by the find-scanner tool (if appropriate). Please read\n" + " the documentation which came with this software (README, FAQ,\n" + " manpages).\n"); quit_xscan (); } } + gtk_quit_flag = 1; gtk_main (); sane_exit (); } @@@@ -1703,8 +1718,10 @@@@ int main (int argc, char **argv) { + fprintf(stderr, "xscanimage (version: %s, package: %s) starting\n", VERSION, + PACKAGE); scan_win.mode = STANDALONE; - + gtk_quit_flag = 0; prog_name = strrchr (argv[0], '/'); if (prog_name) ++prog_name; @@@@ -1714,6 +1731,7 @@@@ #ifdef HAVE_LIBGIMP_GIMP_H { GPrintFunc old_print_func; + GPrintFunc old_printerr_func; int result; /* Temporarily install a print function that discards all output. @@@@ -1721,9 +1739,11 @@@@ gimp" messages when xscanimage gets invoked in stand-alone mode. */ old_print_func = g_set_print_handler (null_print_func); + old_printerr_func = g_set_printerr_handler(null_print_func); /* gimp_main () returns 1 if xscanimage wasn't invoked by GIMP */ result = gimp_main (argc, argv); g_set_message_handler (old_print_func); + g_set_error_handler(old_printerr_func); if (result) interface (argc, argv); } @ 1.3 log @Fix compilation with latest gimp-current (1.2.29). Patch borrowed from sane CVS. Typo fix in Makefile. @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @Update to sane-1.0.1 @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.1 1998/11/28 20:59:58 frueauf Exp $ d3 132 a134 11 --- backend/abaton.c-orig Sun Nov 22 03:54:14 1998 +++ backend/abaton.c Sat Nov 28 11:20:23 1998 @@@@ -1113,7 +1113,7 @@@@ case OPT_Y_RESOLUTION: if (s->val[OPT_PREVIEW].w || s->val[OPT_RESOLUTION_BIND].w) { - s->val[OPT_X_RESOLUTION] = *(SANE_Word *)val; + s->val[OPT_X_RESOLUTION].w = *(SANE_Word *)val; if (info) *info |= SANE_INFO_RELOAD_OPTIONS; } @ 1.1 log @Update sane to 1.00. @ text @d1 1 a1 1 $NetBSD$ @