diff options
Diffstat (limited to 'japi')
-rw-r--r-- | japi/Jscanimage.java | 28 | ||||
-rw-r--r-- | japi/Makefile.am | 3 | ||||
-rw-r--r-- | japi/Makefile.in | 767 | ||||
-rw-r--r-- | japi/Sane.c | 22 | ||||
-rw-r--r-- | japi/Sane.java | 4 | ||||
-rw-r--r-- | japi/SaneDevice.java | 10 | ||||
-rw-r--r-- | japi/SaneOption.java | 25 | ||||
-rw-r--r-- | japi/SaneParameters.java | 12 | ||||
-rw-r--r-- | japi/SaneRange.java | 1 | ||||
-rw-r--r-- | japi/ScanIt.java | 16 | ||||
-rw-r--r-- | japi/Test.java | 12 |
11 files changed, 64 insertions, 836 deletions
diff --git a/japi/Jscanimage.java b/japi/Jscanimage.java index d3ab32d..129d055 100644 --- a/japi/Jscanimage.java +++ b/japi/Jscanimage.java @@ -238,7 +238,7 @@ public class Jscanimage extends Frame implements WindowListener, int status = sane.getControlOption(saneHandle, 0, numDevOptions, null); if (status != Sane.STATUS_GOOD) { - System.out.println("controlOption() failed. Status= " + System.out.println("controlOption() failed. Status= " + status); return (false); } @@ -262,7 +262,7 @@ public class Jscanimage extends Frame implements WindowListener, if (opt.unit == SaneOption.UNIT_NONE) title = opt.title; else // Show units. - title = opt.title + " [" + + title = opt.title + " [" + opt.unitString(unitLength) + ']'; switch (opt.type) { @@ -295,7 +295,7 @@ public class Jscanimage extends Frame implements WindowListener, case SaneOption.CONSTRAINT_RANGE: // A scale. SaneSlider slider = new FixedSaneSlider( - opt.rangeConstraint.min, + opt.rangeConstraint.min, opt.rangeConstraint.max, opt.unit == SaneOption.UNIT_MM, this, i, opt.desc); @@ -320,7 +320,7 @@ public class Jscanimage extends Frame implements WindowListener, case SaneOption.CONSTRAINT_RANGE: // A scale. SaneSlider slider = new SaneSlider( - opt.rangeConstraint.min, + opt.rangeConstraint.min, opt.rangeConstraint.max, this, i, opt.desc); addLabeledOption(group, title, slider, c); @@ -347,7 +347,7 @@ public class Jscanimage extends Frame implements WindowListener, addControl(list); break; case SaneOption.CONSTRAINT_NONE: - SaneTextField tfield = new SaneTextField(16, + SaneTextField tfield = new SaneTextField(16, this, i, opt.desc); addLabeledOption(group, title, tfield, c); addControl(tfield); @@ -511,8 +511,8 @@ public class Jscanimage extends Frame implements WindowListener, public void setControlOption(int optNum, int val) { int [] info = new int[1]; - if (sane.setControlOption(saneHandle, optNum, - SaneOption.ACTION_SET_VALUE, val, info) + if (sane.setControlOption(saneHandle, optNum, + SaneOption.ACTION_SET_VALUE, val, info) != Sane.STATUS_GOOD) System.out.println("setControlOption() failed."); checkOptionInfo(info[0]); @@ -524,8 +524,8 @@ public class Jscanimage extends Frame implements WindowListener, public void setControlOption(int optNum, String val) { int [] info = new int[1]; - if (sane.setControlOption(saneHandle, optNum, - SaneOption.ACTION_SET_VALUE, val, info) + if (sane.setControlOption(saneHandle, optNum, + SaneOption.ACTION_SET_VALUE, val, info) != Sane.STATUS_GOOD) System.out.println("setControlOption() failed."); checkOptionInfo(info[0]); @@ -783,7 +783,7 @@ class SaneSlider extends JPanel implements SaneComponent, ChangeListener add(label, c); c.weightx = .8; // Give most weight to slider. c.fill = GridBagConstraints.HORIZONTAL; - slider = new JSlider(JSlider.HORIZONTAL, min, max, + slider = new JSlider(JSlider.HORIZONTAL, min, max, min + (max - min)/2); add(slider, c); // Set tool tip. @@ -855,7 +855,7 @@ class FixedSaneSlider extends SaneSlider double val = (double) slider.getValue(); // Convert to actual control scale. val = min + ((val - SCALE_MIN)/(SCALE_MAX - SCALE_MIN)) * (max - min); - label.setText(format.format(optMM ? + label.setText(format.format(optMM ? val/dialog.getUnitLength() : val)); dialog.setControlOption(optNum, dialog.getSane().fix(val)); } @@ -872,9 +872,9 @@ class FixedSaneSlider extends SaneSlider { double val = dialog.getSane().unfix(ival[0]); // Show value with user's pref. - label.setText(format.format(optMM ? + label.setText(format.format(optMM ? val/dialog.getUnitLength() : val)); - val = SCALE_MIN + ((val - min)/(max - min)) * + val = SCALE_MIN + ((val - min)/(max - min)) * (SCALE_MAX - SCALE_MIN); slider.setValue((int) val); } @@ -916,7 +916,7 @@ class SaneButton extends JButton implements ActionListener /* * A combo-box for showing a list of items. */ -abstract class SaneComboBox extends JComboBox +abstract class SaneComboBox extends JComboBox implements SaneComponent, ItemListener { protected Jscanimage dialog; // That which created us. diff --git a/japi/Makefile.am b/japi/Makefile.am index cc7ac4a..d48a8a6 100644 --- a/japi/Makefile.am +++ b/japi/Makefile.am @@ -21,7 +21,7 @@ AM_LDFLAGS += $(STRICT_LDFLAGS) -version-number $(V_MAJOR):$(V_MINOR):$(V_REV) JAVA_SRC = SaneDevice.java SaneOption.java SaneRange.java\ Sane.java SaneParameters.java ScanIt.java \ ImageCanvas.java ImageCanvasClient.java \ - Test.java Jscanimage.java + Test.java Jscanimage.java dist_noinst_JAVA = $(JAVA_SRC) @@ -40,4 +40,3 @@ libsanej_la_LIBADD = $(LIBSANE) # Make sure that java classes get created before create Sane.h Sane.h: classdist_noinst.stamp $(JAVAH) Sane - diff --git a/japi/Makefile.in b/japi/Makefile.in deleted file mode 100644 index 4a42758..0000000 --- a/japi/Makefile.in +++ /dev/null @@ -1,767 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# -# Makefile for a Java project with native methods. -# - -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = japi -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ - $(dist_noinst_JAVA) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/byteorder.m4 $(top_srcdir)/m4/stdint.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/include/sane/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -libsanej_la_DEPENDENCIES = $(LIBSANE) -am_libsanej_la_OBJECTS = Sane.lo -nodist_libsanej_la_OBJECTS = -libsanej_la_OBJECTS = $(am_libsanej_la_OBJECTS) \ - $(nodist_libsanej_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/sane -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libsanej_la_SOURCES) $(nodist_libsanej_la_SOURCES) -DIST_SOURCES = $(libsanej_la_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -JAVAC = javac -CLASSPATH_ENV = CLASSPATH=$(JAVAROOT):$(srcdir)/$(JAVAROOT)$${CLASSPATH:+":$$CLASSPATH"} -am__java_sources = $(dist_noinst_JAVA) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ - -# We'll need something in 'configure' for the Java includes. -AM_CPPFLAGS = @AM_CPPFLAGS@ -I. -I$(srcdir) -I$(top_builddir)/include \ - -I$(top_srcdir)/include -I${JDK_HOME}/include \ - -I${JDK_HOME}/include/genunix -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AM_LDFLAGS = @AM_LDFLAGS@ $(STRICT_LDFLAGS) -version-number \ - $(V_MAJOR):$(V_MINOR):$(V_REV) -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AVAHI_CFLAGS = @AVAHI_CFLAGS@ -AVAHI_LIBS = @AVAHI_LIBS@ -AWK = @AWK@ -BACKENDS = @BACKENDS@ -BACKEND_CONFS_ENABLED = @BACKEND_CONFS_ENABLED@ -BACKEND_LIBS_ENABLED = @BACKEND_LIBS_ENABLED@ -BACKEND_MANS_ENABLED = @BACKEND_MANS_ENABLED@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLH = @DLH@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -DVIPS = @DVIPS@ -DYNAMIC_FLAG = @DYNAMIC_FLAG@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FIG2DEV = @FIG2DEV@ -GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GPHOTO2_CPPFLAGS = @GPHOTO2_CPPFLAGS@ -GPHOTO2_LDFLAGS = @GPHOTO2_LDFLAGS@ -GPHOTO2_LIBS = @GPHOTO2_LIBS@ -GREP = @GREP@ -GS = @GS@ -HAVE_GPHOTO2 = @HAVE_GPHOTO2@ -IEEE1284_LIBS = @IEEE1284_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_LOCKPATH = @INSTALL_LOCKPATH@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -JPEG_LIBS = @JPEG_LIBS@ -LATEX = @LATEX@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBV4L_CFLAGS = @LIBV4L_CFLAGS@ -LIBV4L_LIBS = @LIBV4L_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LOCKPATH_GROUP = @LOCKPATH_GROUP@ -LTALLOCA = @LTALLOCA@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINDEX = @MAKEINDEX@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MATH_LIB = @MATH_LIB@ -MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PDFLATEX = @PDFLATEX@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PNG_LIBS = @PNG_LIBS@ -POSUB = @POSUB@ -PPMTOGIF = @PPMTOGIF@ -PRELOADABLE_BACKENDS = @PRELOADABLE_BACKENDS@ -PRELOADABLE_BACKENDS_ENABLED = @PRELOADABLE_BACKENDS_ENABLED@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -RANLIB = @RANLIB@ -RESMGR_LIBS = @RESMGR_LIBS@ -SANEI_SANEI_JPEG_LO = @SANEI_SANEI_JPEG_LO@ -SANE_CONFIG_PATH = @SANE_CONFIG_PATH@ -SCSI_LIBS = @SCSI_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_CONFIG_PATH = @SNMP_CONFIG_PATH@ -SNMP_LIBS = @SNMP_LIBS@ -SOCKET_LIBS = @SOCKET_LIBS@ -STRICT_LDFLAGS = @STRICT_LDFLAGS@ -STRIP = @STRIP@ -SYSLOG_LIBS = @SYSLOG_LIBS@ -SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@ -SYSTEMD_LIBS = @SYSTEMD_LIBS@ -TIFF_LIBS = @TIFF_LIBS@ -USB_CFLAGS = @USB_CFLAGS@ -USB_LIBS = @USB_LIBS@ -USE_NLS = @USE_NLS@ -VERSION = @VERSION@ -V_MAJOR = @V_MAJOR@ -V_MINOR = @V_MINOR@ -V_REV = @V_REV@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -configdir = @configdir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -effective_target = @effective_target@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -locksanedir = @locksanedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -JAVAROOT = . -MY_CLASSPATH = . -JAVAH = javah -jni -cp $(MY_CLASSPATH) -JAVA_SRC = SaneDevice.java SaneOption.java SaneRange.java\ - Sane.java SaneParameters.java ScanIt.java \ - ImageCanvas.java ImageCanvasClient.java \ - Test.java Jscanimage.java - -dist_noinst_JAVA = $(JAVA_SRC) -LIBSANE = ../backend/libsane.la -EXTRA_DIST = README.JAVA -lib_LTLIBRARIES = libsanej.la -BUILT_SOURCES = Sane.h -CLEANFILES = Sane.h -nodist_libsanej_la_SOURCES = Sane.h -libsanej_la_SOURCES = Sane.c -libsanej_la_LIBADD = $(LIBSANE) -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu japi/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu japi/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libsanej.la: $(libsanej_la_OBJECTS) $(libsanej_la_DEPENDENCIES) $(EXTRA_libsanej_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libsanej_la_OBJECTS) $(libsanej_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Sane.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -classnoinst.stamp: $(am__java_sources) - @list1='$?'; list2=; if test -n "$$list1"; then \ - for p in $$list1; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - list2="$$list2 $$d$$p"; \ - done; \ - echo '$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS) $(JAVACFLAGS) '"$$list2"; \ - $(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS) $(JAVACFLAGS) $$list2; \ - else :; fi - echo timestamp > $@ - -clean-noinstJAVA: - -rm -f *.class classnoinst.stamp - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LTLIBRARIES) classnoinst.stamp -installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - clean-noinstJAVA mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-libLTLIBRARIES - -.MAKE: all check install install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-noinstJAVA \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-libLTLIBRARIES - - -# Make sure that java classes get created before create Sane.h -Sane.h: classdist_noinst.stamp - $(JAVAH) Sane - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/japi/Sane.c b/japi/Sane.c index 1ddb4fc..3fd9996 100644 --- a/japi/Sane.c +++ b/japi/Sane.c @@ -104,7 +104,7 @@ JNIEXPORT jint JNICALL Java_Sane_getDevicesNative int i; /* Get the list. */ - status = sane_get_devices(&device_list, localOnly); + status = sane_get_devices(&device_list, localOnly); if (status != SANE_STATUS_GOOD) return (status); /* Get length of Java array. */ @@ -232,13 +232,13 @@ JNIEXPORT void JNICALL Java_Sane_getOptionNative jobject range = (*env)->AllocObject(env, rangeClass); /* Fill in fields. */ fid = (*env)->GetFieldID(env, rangeClass, "min", "I"); - (*env)->SetIntField(env, range, fid, + (*env)->SetIntField(env, range, fid, sopt->constraint.range->min); fid = (*env)->GetFieldID(env, rangeClass, "max", "I"); - (*env)->SetIntField(env, range, fid, + (*env)->SetIntField(env, range, fid, sopt->constraint.range->max); fid = (*env)->GetFieldID(env, rangeClass, "quant", "I"); - (*env)->SetIntField(env, range, fid, + (*env)->SetIntField(env, range, fid, sopt->constraint.range->quant); fid = (*env)->GetFieldID(env, optClass, "rangeConstraint", "LSaneRange;"); @@ -251,7 +251,7 @@ JNIEXPORT void JNICALL Java_Sane_getOptionNative jint *elements; int i; /* First word. is the length. */ - wordList = (*env)->NewIntArray(env, + wordList = (*env)->NewIntArray(env, sopt->constraint.word_list[0]); /* Copy in the integers. */ elements = (*env)->GetIntArrayElements(env, wordList, 0); @@ -272,7 +272,7 @@ JNIEXPORT void JNICALL Java_Sane_getOptionNative for (len = 0; sopt->constraint.string_list[len]; len++) ; - stringList = (*env)->NewObjectArray(env, len + 1, + stringList = (*env)->NewObjectArray(env, len + 1, stringClass, 0); /* Add each string. */ for (i = 0; i < len; i++) @@ -284,7 +284,7 @@ JNIEXPORT void JNICALL Java_Sane_getOptionNative /* 0 at end. */ (*env)->SetObjectArrayElement(env, stringList, len, 0); /* Set the field. */ - fid = (*env)->GetFieldID(env, optClass, + fid = (*env)->GetFieldID(env, optClass, "stringListConstraint", "[Ljava/lang/String;"); (*env)->SetObjectField(env, optObj, fid, stringList); } @@ -296,7 +296,7 @@ JNIEXPORT void JNICALL Java_Sane_getOptionNative * Signature: (II[I[I)I */ JNIEXPORT jint JNICALL Java_Sane_getControlOption__II_3I_3I - (JNIEnv *env, jobject jobj, jint handle, jint option, jintArray value, + (JNIEnv *env, jobject jobj, jint handle, jint option, jintArray value, jintArray info) { SANE_Status status; /* Gets status. */ @@ -318,7 +318,7 @@ JNIEXPORT jint JNICALL Java_Sane_getControlOption__II_3I_3I * Signature: (II[B[I)I */ JNIEXPORT jint JNICALL Java_Sane_getControlOption__II_3B_3I - (JNIEnv *env, jobject jobj, jint handle, jint option, jbyteArray value, + (JNIEnv *env, jobject jobj, jint handle, jint option, jbyteArray value, jintArray info) { SANE_Status status; /* Gets status. */ @@ -340,7 +340,7 @@ JNIEXPORT jint JNICALL Java_Sane_getControlOption__II_3B_3I * Signature: (IIII[I)I */ JNIEXPORT jint JNICALL Java_Sane_setControlOption__IIII_3I - (JNIEnv *env, jobject jobj, jint handle, jint option, jint action, + (JNIEnv *env, jobject jobj, jint handle, jint option, jint action, jint value, jintArray info) { SANE_Status status; /* Gets status. */ @@ -457,7 +457,7 @@ JNIEXPORT jint JNICALL Java_Sane_read /* Get actual data ptr. */ dataElements = (*env)->GetByteArrayElements(env, data, 0); /* Do the read. */ - status = sane_read((SANE_Handle) handle, dataElements, + status = sane_read((SANE_Handle) handle, dataElements, maxLength, &read_len); (*env)->ReleaseByteArrayElements(env, data, dataElements, 0); /* Return # bytes read. */ diff --git a/japi/Sane.java b/japi/Sane.java index 85600e7..88b9495 100644 --- a/japi/Sane.java +++ b/japi/Sane.java @@ -57,7 +57,7 @@ public static int STATUS_GOOD = 0; // everything A-OK public static int STATUS_UNSUPPORTED = 1;// operation is not supported public static int STATUS_CANCELLED = 2; // operation was cancelled public static int STATUS_DEVICE_BUSY = 3;// device is busy; try again later -public static int STATUS_INVAL = 4; // data is invalid (includes no +public static int STATUS_INVAL = 4; // data is invalid (includes no // dev at open) public static int STATUS_EOF = 5; // no more data available (end-of-file) public static int STATUS_JAMMED = 6; // document feeder jammed @@ -137,7 +137,7 @@ public native int setControlOption(int handle, int option, int action, String value, int [] info); public native int getParameters(int handle, SaneParameters params); public native int start(int handle); -public native int read(int handle, byte [] data, +public native int read(int handle, byte [] data, int maxLength, int [] length); public native void cancel(int handle); public native String strstatus(int status); diff --git a/japi/SaneDevice.java b/japi/SaneDevice.java index dc73365..d40367a 100644 --- a/japi/SaneDevice.java +++ b/japi/SaneDevice.java @@ -46,10 +46,8 @@ public class SaneDevice { -public String name; // unique device name -public String vendor; // device vendor string -public String model; // device model name -public String type; // device type (e.g., "flatbed scanner") +public String name; // unique device name +public String vendor; // device vendor string +public String model; // device model name +public String type; // device type (e.g., "flatbed scanner") } - - diff --git a/japi/SaneOption.java b/japi/SaneOption.java index ed460c7..0c8c736 100644 --- a/japi/SaneOption.java +++ b/japi/SaneOption.java @@ -58,13 +58,13 @@ public class SaneOption // // Sane value units: // - public static final int UNIT_NONE = 0; // the value is unit-less - // (e.g., # of scans) - public static final int UNIT_PIXEL = 1; // value is number of pixels - public static final int UNIT_BIT = 2; // value is number of bits - public static final int UNIT_MM = 3; // value is millimeters - public static final int UNIT_DPI = 4; // value is res. in dots/inch - public static final int UNIT_PERCENT = 5;// value is a percentage + public static final int UNIT_NONE = 0; // the value is unit-less + // (e.g., # of scans) + public static final int UNIT_PIXEL = 1; // value is number of pixels + public static final int UNIT_BIT = 2; // value is number of bits + public static final int UNIT_MM = 3; // value is millimeters + public static final int UNIT_DPI = 4; // value is res. in dots/inch + public static final int UNIT_PERCENT = 5;// value is a percentage // // Option capabilities: // @@ -100,13 +100,13 @@ public class SaneOption // // Class members: // - public String name; // name of this option (command-line name) - public String title; // title of this option (single-line) - public String desc; // description of this option (multi-line) + public String name; // name of this option (command-line name) + public String title; // title of this option (single-line) + public String desc; // description of this option (multi-line) public int type; // how are values interpreted? (TYPE_) public int unit; // what is the (physical) unit? (UNIT_) public int size; - public int cap; // capabilities + public int cap; // capabilities public int constraintType; // These are a union in the "C" API: // Null-terminated list: @@ -123,7 +123,7 @@ public class SaneOption { return ((cap) & CAP_SOFT_SELECT) == 0; } // Return string describing units. // "unitLength" is # mm. preferred. - public String unitString(double unitLength) + public String unitString(double unitLength) { switch (unit) { @@ -142,4 +142,3 @@ public class SaneOption return ""; } } - diff --git a/japi/SaneParameters.java b/japi/SaneParameters.java index 4e629c4..e78981a 100644 --- a/japi/SaneParameters.java +++ b/japi/SaneParameters.java @@ -49,12 +49,12 @@ public class SaneParameters // // Frame values: // -public static final int FRAME_GRAY = 0; // band covering human visual range -public static final int FRAME_RGB = 1; // pixel-interleaved - // red/green/blue bands -public static final int FRAME_RED = 2; // red band only -public static final int FRAME_GREEN = 3;// green band only -public static final int FRAME_BLUE = 4; // blue band only +public static final int FRAME_GRAY = 0; // band covering human visual range +public static final int FRAME_RGB = 1; // pixel-interleaved + // red/green/blue bands +public static final int FRAME_RED = 2; // red band only +public static final int FRAME_GREEN = 3;// green band only +public static final int FRAME_BLUE = 4; // blue band only // // Class members: diff --git a/japi/SaneRange.java b/japi/SaneRange.java index 4790e32..9eb7da7 100644 --- a/japi/SaneRange.java +++ b/japi/SaneRange.java @@ -50,4 +50,3 @@ public int min; // minimum (element) value public int max; // maximum (element) value public int quant; // Quantization value (0 if none) } - diff --git a/japi/ScanIt.java b/japi/ScanIt.java index 21afba0..a357626 100644 --- a/japi/ScanIt.java +++ b/japi/ScanIt.java @@ -156,7 +156,7 @@ public class ScanIt implements ImageProducer */ public synchronized void removeConsumer(ImageConsumer ic) { consumers.removeElement(ic); } - + /* * Add a consumer and start scanning. */ @@ -224,7 +224,7 @@ public class ScanIt implements ImageProducer // Single frame. for (i = 0; i < readLen; ++i) { // Doing a single color frame. - image[offset + i] |= + image[offset + i] |= (((int) data[i]) & 0xff) << (8*cindex); ++x; if (x >= width) @@ -235,7 +235,7 @@ public class ScanIt implements ImageProducer for (i = 0; i < readLen; ++i) { int b = 2 - (offset + i)%3; - image[(offset + i)/3] |= + image[(offset + i)/3] |= (((int) data[i]) & 0xff) << (8*b); if (b == 0) { @@ -261,7 +261,7 @@ public class ScanIt implements ImageProducer offset += readLen; // Update where we are. // Show it. System.out.println("PrevY = " + prevY + ", y = " + y); -// tellPixels(0, prevY, width, y - prevY); +// tellPixels(0, prevY, width, y - prevY); tellPixels(0, 0, width, height); return true; } @@ -289,7 +289,7 @@ public class ScanIt implements ImageProducer status = sane.start(handle); if (status != Sane.STATUS_GOOD) { - System.out.println("start() failed. Status= " + System.out.println("start() failed. Status= " + status); tellStatus(ImageConsumer.IMAGEERROR); return; @@ -297,7 +297,7 @@ public class ScanIt implements ImageProducer status = sane.getParameters(handle, parms); if (status != Sane.STATUS_GOOD) { - System.out.println("getParameters() failed. Status= " + System.out.println("getParameters() failed. Status= " + status); tellStatus(ImageConsumer.IMAGEERROR); return; //++++cleanup. @@ -342,7 +342,7 @@ public class ScanIt implements ImageProducer catch (IOException e) { //+++++++++++++++ System.out.println("I/O error writing file."); - } + } outputFile = null; // Clear for next time. } tellStatus(ImageConsumer.STATICIMAGEDONE); @@ -364,7 +364,7 @@ public class ScanIt implements ImageProducer case SaneParameters.FRAME_GREEN: case SaneParameters.FRAME_BLUE: case SaneParameters.FRAME_RGB: - pout.print("P6\n# SANE data follows\n" + + pout.print("P6\n# SANE data follows\n" + width + ' ' + height + "\n255\n"); for (i = 0; i < len; i++) { diff --git a/japi/Test.java b/japi/Test.java index 52a7112..4a0f507 100644 --- a/japi/Test.java +++ b/japi/Test.java @@ -81,7 +81,7 @@ public static void main(String[] args) status = sane.getControlOption(handle[0], 0, numDevOptions, null); if (status != Sane.STATUS_GOOD) { - System.out.println("controlOption() failed. Status= " + System.out.println("controlOption() failed. Status= " + status); return; } @@ -101,7 +101,7 @@ public static void main(String[] args) switch (opt.constraintType) { case SaneOption.CONSTRAINT_RANGE: - System.out.println("Range: " + + System.out.println("Range: " + opt.rangeConstraint.min + ", " + opt.rangeConstraint.max + ", " + opt.rangeConstraint.quant); @@ -123,11 +123,11 @@ public static void main(String[] args) break; } } - status = sane.setControlOption(handle[0], 2, + status = sane.setControlOption(handle[0], 2, SaneOption.ACTION_SET_VALUE, "../test1.pnm", null); if (status != Sane.STATUS_GOOD) { - System.out.println("setControlOption() failed. Status= " + System.out.println("setControlOption() failed. Status= " + status); } // @@ -145,14 +145,14 @@ public static void main(String[] args) status = sane.start(handle[0]); if (status != Sane.STATUS_GOOD) { - System.out.println("start() failed. Status= " + System.out.println("start() failed. Status= " + status); return; } status = sane.getParameters(handle[0], parm); if (status != Sane.STATUS_GOOD) { - System.out.println("getParameters() failed. Status= " + System.out.println("getParameters() failed. Status= " + status); return; //++++cleanup. } |