diff options
author | Didier Raboud <odyx@debian.org> | 2011-10-21 15:09:51 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2011-10-21 15:09:51 +0200 |
commit | 59dda2d4b3f873fe5206d5a9ce6bc6947469d4a2 (patch) | |
tree | 2dca410e03611af2386164b8bf9c9a5075fea320 /lib | |
parent | 4dd0c9d6f24185fdbcd25a9a01d332ba3e15a7da (diff) |
Imported Upstream version 1.1.0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.in | 150 | ||||
-rw-r--r-- | lib/escpr_api.c | 2 | ||||
-rw-r--r-- | lib/escpr_cmd.c | 72 | ||||
-rw-r--r-- | lib/escpr_def.h | 2 | ||||
-rw-r--r-- | lib/escpr_sp.c | 140 | ||||
-rw-r--r-- | lib/escpr_sp.h | 2 |
6 files changed, 246 insertions, 122 deletions
diff --git a/lib/Makefile.in b/lib/Makefile.in index 20ea08d..386da7e 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @@ -16,8 +17,9 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@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 @@ -35,20 +37,38 @@ host_triplet = @host@ subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/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 = `echo $$p | sed -e 's|^.*/||'`; +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__installdirs = "$(DESTDIR)$(libdir)" -libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libescpr_la_LIBADD = am_libescpr_la_OBJECTS = escpr_api.lo escpr_cmd.lo escpr_osdep.lo \ @@ -60,6 +80,7 @@ libescpr_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) 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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ @@ -86,48 +107,49 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CUPS_IMAGE_LIBS = @CUPS_IMAGE_LIBS@ -CUPS_LIBS = @CUPS_LIBS@ +CUPS_FILTER_DIR = @CUPS_FILTER_DIR@ CUPS_PPD_DIR = @CUPS_PPD_DIR@ -CUPS_SERVER_DIR = @CUPS_SERVER_DIR@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ LN_S = @LN_S@ +LSB_VER = @LSB_VER@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NM = @NM@ NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_RELEASE = @PACKAGE_RELEASE@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ @@ -135,14 +157,14 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +VENDOR_NAME = @VENDOR_NAME@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -174,6 +196,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -186,6 +209,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libescpr.la @@ -207,14 +231,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( 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 lib/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu lib/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -232,23 +256,28 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + list2="$$list2 $$p"; \ else :; fi; \ - done + done; \ + test -z "$$list2" || { \ + 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)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + @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: @@ -276,21 +305,21 @@ distclean-compile: .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< @@ -306,14 +335,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -321,29 +350,34 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -364,13 +398,17 @@ distdir: $(DISTFILES) 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 -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -402,6 +440,7 @@ clean-generic: 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" @@ -423,6 +462,8 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: @@ -431,18 +472,28 @@ 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 @@ -481,6 +532,7 @@ uninstall-am: uninstall-libLTLIBRARIES mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES + # 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/lib/escpr_api.c b/lib/escpr_api.c index 73432a4..93e227d 100644 --- a/lib/escpr_api.c +++ b/lib/escpr_api.c @@ -83,7 +83,7 @@ ESCPR_ERR_CODE escprInitJob(const ESCPR_OPT *pRGB_opt, spPrintJob = *pPrintJob; /* ChangeSpec : Known issue (2005/10/14 #2) */ - ESCPR_RequestServicePack(SP_REQ_FIX_720DPI, (void*)&spPrintJob, + ESCPR_RequestServicePack(SP_REQ_FIX_600_720DPI, (void*)&spPrintJob, /* reserved */ NULL, NULL, NULL); /* ChangeSpec : Known issue (2005/10/14 #3) */ diff --git a/lib/escpr_cmd.c b/lib/escpr_cmd.c index a314473..9ffd706 100644 --- a/lib/escpr_cmd.c +++ b/lib/escpr_cmd.c @@ -58,7 +58,8 @@ typedef struct tagBASEPOINT { #endif } ESCPR_BASEPT; -void SetGlobalBasePointData(const int PaperWidth); +void SetGlobalBasePointData_300dpi(const int PaperWidth); +void SetGlobalBasePointData_360dpi(const int PaperWidth); #define PAPERWIDTH_A3 4209 @@ -615,13 +616,17 @@ ESCPR_ERR_CODE ESCPR_MakePrintJobCmd(const ESCPR_PRINT_JOB *pPrintJob) ESCPR_PRINT_JOB cpyPrintJob; /* fill out globals */ - if (pPrintJob->InResolution == ESCPR_IR_7272) { + if (pPrintJob->InResolution == ESCPR_IR_7272 || pPrintJob->InResolution == ESCPR_IR_6060) { gESCPR_DPI_Multiplier = 2; } else { gESCPR_DPI_Multiplier = 1; } - SetGlobalBasePointData(pPrintJob->PaperWidth); + if (pPrintJob->InResolution == ESCPR_IR_3030 || pPrintJob->InResolution == ESCPR_IR_6060) { + SetGlobalBasePointData_300dpi(pPrintJob->PaperWidth); + } else { + SetGlobalBasePointData_360dpi(pPrintJob->PaperWidth); + } if (pPrintJob->TopMargin < gESCPR_BasePt.Borderless.Top || pPrintJob->LeftMargin < gESCPR_BasePt.Borderless.Left) { @@ -638,6 +643,22 @@ ESCPR_ERR_CODE ESCPR_MakePrintJobCmd(const ESCPR_PRINT_JOB *pPrintJob) cpyPrintJob.InResolution = pPrintJob->InResolution; cpyPrintJob.PrintDirection = pPrintJob->PrintDirection; + + +{ + FILE *fp; + fp=fopen("/tmp/test.txt", "a+"); + fprintf(fp, "pPrintJob->PaperWidth=%d\n",pPrintJob->PaperWidth); + fprintf(fp, "pPrintJob->PaperLength=%d\n",pPrintJob->PaperLength); + fprintf(fp, "pPrintJob->TopMargin=%d\n",pPrintJob->TopMargin); + fprintf(fp, "pPrintJob->LeftMargin=%d\n",pPrintJob->LeftMargin); + fprintf(fp, "pPrintJob->PrintableAreaWidth=%d\n",pPrintJob->PrintableAreaWidth); + fprintf(fp, "pPrintJob->PrintableAreaLength=%d\n",pPrintJob->PrintableAreaLength); + fprintf(fp, "pPrintJob->InResolution=%d\n",pPrintJob->InResolution); + fclose(fp); +} + + #if defined(_ZERO_MARGIN_REPLICATE) || defined(_ZERO_MARGIN_MIRROR) if (cpyPrintJob.LeftMargin < 0 || cpyPrintJob.TopMargin < 0) return ESCPR_ERR_HAPPEN_PROBLEM; @@ -1776,7 +1797,7 @@ ESCPR_ERR_CODE ESCPR_MakeEndJobCmd(void) return ESCPR_ERR_NOERROR; } -void SetGlobalBasePointData(const int PaperWidth) { +void SetGlobalBasePointData_360dpi(const int PaperWidth) { /* BORDER */ gESCPR_BasePt.Border.Top = @@ -1818,3 +1839,46 @@ void SetGlobalBasePointData(const int PaperWidth) { (-1)*gESCPR_BasePt.Borderless.Right; #endif } + +void SetGlobalBasePointData_300dpi(const int PaperWidth) { + + /* BORDER */ + gESCPR_BasePt.Border.Top = + (35)*gESCPR_DPI_Multiplier; + gESCPR_BasePt.Border.Bottom = + (35)*gESCPR_DPI_Multiplier; + gESCPR_BasePt.Border.Left = + (35)*gESCPR_DPI_Multiplier; + gESCPR_BasePt.Border.Right = + (35)*gESCPR_DPI_Multiplier; + + /* BORDERLESS */ + gESCPR_BasePt.Borderless.Top = + (-35)*gESCPR_DPI_Multiplier; + gESCPR_BasePt.Borderless.Bottom = + (-58)*gESCPR_DPI_Multiplier; + + if (PaperWidth < PAPERWIDTH_A3) { + gESCPR_BasePt.Borderless.Left = + (-30)*gESCPR_DPI_Multiplier; + gESCPR_BasePt.Borderless.Right = + (-30)*gESCPR_DPI_Multiplier; + + } else { + gESCPR_BasePt.Borderless.Left = + (-35)*gESCPR_DPI_Multiplier; + gESCPR_BasePt.Borderless.Right = + (-35)*gESCPR_DPI_Multiplier; + } +#if defined(_ZERO_MARGIN_REPLICATE) || defined(_ZERO_MARGIN_MIRROR) + /* PAD */ + gESCPR_BasePt.Pad.Top = + (-1)*gESCPR_BasePt.Borderless.Top; + gESCPR_BasePt.Pad.Bottom = + (-1)*gESCPR_BasePt.Borderless.Bottom; + gESCPR_BasePt.Pad.Left = + (-1)*gESCPR_BasePt.Borderless.Left; + gESCPR_BasePt.Pad.Right = + (-1)*gESCPR_BasePt.Borderless.Right; +#endif +} diff --git a/lib/escpr_def.h b/lib/escpr_def.h index bdfa9f9..780ea3f 100644 --- a/lib/escpr_def.h +++ b/lib/escpr_def.h @@ -180,6 +180,8 @@ typedef struct { /* InResolution */ #define ESCPR_IR_3636 0 /* 360 x 360 dpi */ #define ESCPR_IR_7272 1 /* 720 x 720 dpi */ +#define ESCPR_IR_3030 2 /* 300 x 300 dpi */ +#define ESCPR_IR_6060 3 /* 600 x 600 dpi */ /* PrintDirection */ #define ESCPR_PD_BIDIREC 0 /* Bi-direction */ diff --git a/lib/escpr_sp.c b/lib/escpr_sp.c index c60a53d..de0a87b 100644 --- a/lib/escpr_sp.c +++ b/lib/escpr_sp.c @@ -144,14 +144,14 @@ typedef ESCPR_BYTE4 (* ESCPR_PFNSP)(void *, void *, void*, void*); /* Each one do to fix 'Known Issue' about ESC/P-R printer */ static ESCPR_BYTE4 _SP_ChangeSpec_UpdatePMReply(void*, void*, void*, void*); -static ESCPR_BYTE4 _SP_ChangeSpec_720DPI(void* , void*, void*,void*); +static ESCPR_BYTE4 _SP_ChangeSpec_600_720DPI(void* , void*, void*,void*); static ESCPR_BYTE4 _SP_ChangeSpec_CompositeBlack(void*, void*, void*, void*); static ESCPR_BYTE4 _SP_ChangeSpec_DraftOnly(void*, void*, void*, void*); /* Functions should be ordered in the same index with SP_REQ_CODE */ ESCPR_PFNSP fpChangeSpec [] = { _SP_ChangeSpec_UpdatePMReply, /* SP_REQ_FIX_UPDATE_PMREPLY */ - _SP_ChangeSpec_720DPI, /* SP_REQ_FIX_720DPI */ + _SP_ChangeSpec_600_720DPI, /* SP_REQ_FIX_600_720DPI */ _SP_ChangeSpec_CompositeBlack, /* SP_REQ_FIX_COMPOSITE_BLACK */ _SP_ChangeSpec_DraftOnly /* SP_REQ_FIX_DRAFTONLY */ }; @@ -266,61 +266,63 @@ ESCPR_PFNSP fpChangeSpec [] = { /* Support media size id table */ static struct _tag_PM_PAPER_SIZE { ESCPR_UBYTE1 id; /* PM_MTID_xx */ - ESCPR_BYTE4 width; /* pixels for 360 DPI */ - ESCPR_BYTE4 length; /* pixels for 360 DPI */ + ESCPR_BYTE4 width360; /* pixels for 360 DPI */ + ESCPR_BYTE4 length360; /* pixels for 360 DPI */ + ESCPR_BYTE4 width300; /* pixels for 300 DPI */ + ESCPR_BYTE4 length300; /* pixels for 300 DPI */ } PM_PAPER_SIZE [] = { - /* ID Width Length */ - {PM_MSID_A4, 2976, 4209}, - {PM_MSID_LETTER, 3060, 3960}, - {PM_MSID_LEGAL, 3060, 5040}, - {PM_MSID_A5, 2098, 2976}, - {PM_MSID_A6, 1488, 2098}, - {PM_MSID_B5, 2580, 3643}, - {PM_MSID_EXECUTIVE, 2610, 3780}, - {PM_MSID_HALFLETTER, 1980, 3060}, - {PM_MSID_PANORAMIC, 2976, 8419}, - {PM_MSID_TRIM_4X6, 1610, 2330}, - {PM_MSID_4X6, 1440, 2160}, - {PM_MSID_5X8, 1800, 2880}, - {PM_MSID_8X10, 2880, 3600}, - {PM_MSID_10X15, 1417, 2125}, - {PM_MSID_200X300, 3061, 4790}, - {PM_MSID_L, 1260, 1800}, - {PM_MSID_POSTCARD, 1417, 2098}, - {PM_MSID_DBLPOSTCARD, 2835, 2098}, - {PM_MSID_ENV_10_L, 3420, 1485}, - {PM_MSID_ENV_C6_L, 2296, 1616}, - {PM_MSID_ENV_DL_L, 3118, 1559}, - {PM_MSID_NEWEVN_L, 3118, 1871}, - {PM_MSID_CHOKEI_3, 1701, 3685}, - {PM_MSID_CHOKEI_4, 1276, 3161}, - {PM_MSID_YOKEI_1, 1701, 2494}, - {PM_MSID_YOKEI_2, 1616, 2296}, - {PM_MSID_YOKEI_3, 1389, 2098}, - {PM_MSID_YOKEI_4, 1488, 3331}, - {PM_MSID_2L, 1800, 2522}, - {PM_MSID_ENV_10_P, 1485, 3420}, - {PM_MSID_ENV_C6_P, 1616, 2296}, - {PM_MSID_ENV_DL_P, 1559, 3118}, - {PM_MSID_NEWENV_P, 1871, 3118}, - {PM_MSID_MEISHI, 1261, 779}, - {PM_MSID_BUZCARD_89X50, 1261, 709}, - {PM_MSID_CARD_54X86, 765, 1219}, - {PM_MSID_BUZCARD_55X91, 780, 1290}, - {PM_MSID_ALBUM_L, 1800, 2607}, - {PM_MSID_ALBUM_A5, 2976, 4294}, - {PM_MSID_PALBUM_L_L, 1800, 1260}, - {PM_MSID_PALBUM_2L, 1800, 2521}, - {PM_MSID_PALBUM_A5_L, 2976, 2101}, - {PM_MSID_PALBUM_A4, 2976, 4203}, - {PM_MSID_A3NOBI, 4663, 6846}, - {PM_MSID_A3, 4209, 5953}, - {PM_MSID_B4, 3643, 5159}, - {PM_MSID_USB, 3960, 6120}, - {PM_MSID_11X14, 3960, 5040}, - {PM_MSID_B3, 5159, 7285}, - {PM_MSID_A2, 5953, 8419}, - {PM_MSID_USC, 6120, 7920}, + /* ID Width Length Width Length*/ + {PM_MSID_A4, 2976, 4209, 2480, 3507}, + {PM_MSID_LETTER, 3060, 3960, 2550, 3300}, + {PM_MSID_LEGAL, 3060, 5040, 2550, 4200}, + {PM_MSID_A5, 2098, 2976, 1748, 2480}, + {PM_MSID_A6, 1488, 2098, 1240, 1748}, + {PM_MSID_B5, 2580, 3643, 2149, 3035}, + {PM_MSID_EXECUTIVE, 2610, 3780, 2175, 3150}, + {PM_MSID_HALFLETTER, 1980, 3060, 1650, 2550}, + {PM_MSID_PANORAMIC, 2976, 8419, 2480, 7016}, + {PM_MSID_TRIM_4X6, 1610, 2330, 1342, 1942}, + {PM_MSID_4X6, 1440, 2160, 1200, 1800}, + {PM_MSID_5X8, 1800, 2880, 1500, 2400}, + {PM_MSID_8X10, 2880, 3600, 2400, 3000}, + {PM_MSID_10X15, 1417, 2125, 1181, 1771}, + {PM_MSID_200X300, 3061, 4790, 2551, 3992}, + {PM_MSID_L, 1260, 1800, 1050, 1500}, + {PM_MSID_POSTCARD, 1417, 2098, 1181, 1748}, + {PM_MSID_DBLPOSTCARD, 2835, 2098, 2363, 1748}, + {PM_MSID_ENV_10_L, 3420, 1485, 2850, 1238}, + {PM_MSID_ENV_C6_L, 2296, 1616, 1913, 1347}, + {PM_MSID_ENV_DL_L, 3118, 1559, 2598, 1299}, + {PM_MSID_NEWEVN_L, 3118, 1871, 2598, 1559}, + {PM_MSID_CHOKEI_3, 1701, 3685, 1418, 3071}, + {PM_MSID_CHOKEI_4, 1276, 3161, 1063, 2634}, + {PM_MSID_YOKEI_1, 1701, 2494, 1418, 2078}, + {PM_MSID_YOKEI_2, 1616, 2296, 1347, 1913}, + {PM_MSID_YOKEI_3, 1389, 2098, 1158, 1748}, + {PM_MSID_YOKEI_4, 1488, 3331, 1240, 2776}, + {PM_MSID_2L, 1800, 2522, 1500, 2100}, + {PM_MSID_ENV_10_P, 1485, 3420, 1238, 2850}, + {PM_MSID_ENV_C6_P, 1616, 2296, 1347, 1913}, + {PM_MSID_ENV_DL_P, 1559, 3118, 1299, 2598}, + {PM_MSID_NEWENV_P, 1871, 3118, 1559, 2598}, + {PM_MSID_MEISHI, 1261, 779, 1051, 649}, + {PM_MSID_BUZCARD_89X50, 1261, 709, 1051, 591}, + {PM_MSID_CARD_54X86, 765, 1219, 638, 1016}, + {PM_MSID_BUZCARD_55X91, 780, 1290, 650, 1075}, + {PM_MSID_ALBUM_L, 1800, 2607, 1200, 2133}, + {PM_MSID_ALBUM_A5, 2976, 4294, 2480, 3578}, + {PM_MSID_PALBUM_L_L, 1800, 1260, 1500, 1050}, + {PM_MSID_PALBUM_2L, 1800, 2521, 1500, 2101}, + {PM_MSID_PALBUM_A5_L, 2976, 2101, 2480, 1751}, + {PM_MSID_PALBUM_A4, 2976, 4203, 2480, 3503}, + {PM_MSID_A3NOBI, 4663, 6846, 3886, 5705}, + {PM_MSID_A3, 4209, 5953, 3507, 4960}, + {PM_MSID_B4, 3643, 5159, 3036, 4299}, + {PM_MSID_USB, 3960, 6120, 3300, 5100}, + {PM_MSID_11X14, 3960, 5040, 3300, 4200}, + {PM_MSID_B3, 5159, 7285, 4299, 6071}, + {PM_MSID_A2, 5953, 8419, 4961, 7016}, + {PM_MSID_USC, 6120, 7920, 5100, 6600}, {PM_MSID_USER, 0, 0}, }; @@ -997,7 +999,7 @@ static ESCPR_BYTE4 _SP_ChangeSpec_UpdatePMReply(void* pData, void* pReserved1, v Last Modification : 2005/10/14 Revision : 1.0 =======================================================================================*/ -static ESCPR_BYTE4 _SP_ChangeSpec_720DPI(void* pData, void* pReserved1, void* pReserved2, void* pReserved3) +static ESCPR_BYTE4 _SP_ChangeSpec_600_720DPI(void* pData, void* pReserved1, void* pReserved2, void* pReserved3) { ESCPR_PRINT_JOB* pPrintJob = (ESCPR_PRINT_JOB*)pData; @@ -1012,13 +1014,17 @@ static ESCPR_BYTE4 _SP_ChangeSpec_720DPI(void* pData, void* pReserved1, void* pR verbose_dbprint(("pPrintJob->InResolution = %d\n", pPrintJob->InResolution)); verbose_dbprint(("pPrintJob->PrintDirection = %d\n", pPrintJob->PrintDirection)); - /* Support Input Resolution 360x360dpi only */ - if(pPrintJob->InResolution == ESCPR_IR_7272){ + /* Support Input Resolution 360x360dpi/300x300dpi only */ + if(pPrintJob->InResolution == ESCPR_IR_7272 || pPrintJob->InResolution == ESCPR_IR_6060){ pPrintJob->TopMargin /= 2; pPrintJob->LeftMargin /= 2; pPrintJob->PrintableAreaWidth /= 2; pPrintJob->PrintableAreaLength /= 2; - pPrintJob->InResolution = ESCPR_IR_3636; + if(pPrintJob->InResolution == ESCPR_IR_7272){ + pPrintJob->InResolution = ESCPR_IR_3636; + }else{ + pPrintJob->InResolution = ESCPR_IR_3030; + } verbose_dbprint((">> ESC/P-R input resolution has been changed to 360x360 from 720x720 dpi\n")); verbose_dbprint(("pPrintJob->PaperWidth = %d\n", pPrintJob->PaperWidth)); @@ -1112,17 +1118,17 @@ static ESCPR_BYTE4 _SP_ChangeSpec_DraftOnly(void* pPrintQuality, void* pPrintJob width = pJob->PaperWidth; length = pJob->PaperLength; - /* use 360 dpi unit */ - if(pJob->InResolution == ESCPR_IR_7272) { + /* use 360/300 dpi unit */ + if(pJob->InResolution == ESCPR_IR_7272 || pJob->InResolution == ESCPR_IR_6060) { width /= 2; length /= 2; } for(i = 0; i < NUM_PAPER_SIZE; i++) { - if(PM_PAPER_SIZE[i].width == width && - PM_PAPER_SIZE[i].length == length) { - s_id = PM_PAPER_SIZE[i].id; - } + if((PM_PAPER_SIZE[i].width360 == width || PM_PAPER_SIZE[i].width300 == width) + && (PM_PAPER_SIZE[i].length360 == length || PM_PAPER_SIZE[i].length300 == length)) { + s_id = PM_PAPER_SIZE[i].id; + } } verbose_dbprint(("ChangeSpec_DrfatOnly : size id(%d), width(%d), length(%d)\n", s_id, width, length)); @@ -1214,7 +1220,7 @@ ESCPR_ERR_CODE ESCPR_RequestServicePack(SP_REQ_CODE request, /* Validation request code */ switch(request) { case SP_REQ_FIX_UPDATE_PMREPLY: - case SP_REQ_FIX_720DPI: + case SP_REQ_FIX_600_720DPI: case SP_REQ_FIX_COMPOSITE_BLACK: case SP_REQ_FIX_DRAFTONLY: break; diff --git a/lib/escpr_sp.h b/lib/escpr_sp.h index e695e7e..a72c309 100644 --- a/lib/escpr_sp.h +++ b/lib/escpr_sp.h @@ -36,7 +36,7 @@ /* Service Pack request code */ typedef enum _SP_REQ { SP_REQ_FIX_UPDATE_PMREPLY= 0, - SP_REQ_FIX_720DPI, + SP_REQ_FIX_600_720DPI, SP_REQ_FIX_COMPOSITE_BLACK, SP_REQ_FIX_DRAFTONLY } SP_REQ_CODE; |