~ubuntu-branches/ubuntu/quantal/gutenprint/quantal

« back to all changes in this revision

Viewing changes to src/main/print-olympus.c

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2012-02-14 22:41:51 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20120214224151-81lkvr2cow0u55f5
Tags: 5.2.8~pre1-0ubuntu1
* New upstream release
  - Added support for Canon BJC 4550, S330, S520, S530D, S630, S750, S820,
    S830D, S900, S9000, PIXMA mini220, mini320, mini360, i50, i70, i450,
    i455, i470D. i550, i900D, i950, i960, i6100, i6500, i9100, i9900,
    iP3300, iP3500, iP3600, iP4900, iP6210D, iP6220D, iP6310D, iP7100,
    iP7500, iP8100, iP8600, iP9910, MP140, MP190, MP210, MP240, MP375R,
    MP470, MP490, MP530, MP900, MG2100, MG3100, MG4100, MG5300, MG6200,
    MG8200, EPSON ME Office 940FW, PX 204, PX 504A, Stylus CX3900, NX530,
    NX635, SX535WD, Stylus Office BX535WD, BX630FW, BX635FWD, TX620FWD,
    Stylus Photo RX650, WorkForce 545, 630, 645, Stylus Pro 7900/9900
    (Partial -- no orange/green inks).
  - Printers redefined: Canon BJC 3000, S300, S500, S600, S800, PIXMA i80,
    i560, i850, i860, i865, iP2000, iP4100, iP5000, MP600, MP750, MP760,
    MP770, MP780, MP790, MP970
  - Support for the following printers was greatly improved, or tested:
    Canon PIXMA MP700, MP710, MP730, MP740, MP950, MP960, MX340, MX350,
    iP4000, MG5100
  - Canon BJC series printers using photo cartridge have printing modes
    added that will select this cartridge.
  - A crash with the EPSON Stylus Photo R3000 has been fixed.
  - Chinese (Mandarin), Galician, and Ukrainian translations have
    been added.
* debian/patches/0001-patch-stdio.h-is-required-by-commandtoepson-and-comm.patch:
  Removed, applied upstream.
* 0002-genppd-don-t-write-color-profile-information-with-br.patch: Refreshed
  with quilt.
* debian/printer-driver-gutenprint.ppd-updater,
  debian/foomatic-db-gutenprint.ppd-updater: Support also pre-releases with
  "-preX" version number extension.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * "$Id: print-olympus.c,v 1.97 2010/12/05 21:38:15 rlk Exp $"
 
2
 * "$Id: print-olympus.c,v 1.99 2011/07/06 23:16:23 gernot2270 Exp $"
3
3
 *
4
4
 *   Print plug-in DyeSub driver (formerly Olympus driver) for the GIMP.
5
5
 *
771
771
                (strcmp(privdata.pagesize, "w155h244") == 0 ? 
772
772
                        (strcmp(stp_get_driver(v),"canon-cp10") == 0 ?
773
773
                                '\0' : '\3' ) :
774
 
                (strcmp(privdata.pagesize, "w283h566") == 0 ? '\4' : 
 
774
                (strcmp(privdata.pagesize, "w283h566") == 0 ? '\4' :
775
775
                 '\1' ))));
776
776
 
777
777
  stp_put16_be(0x4000, v);
783
783
static void cpx00_plane_init_func(stp_vars_t *v)
784
784
{
785
785
  stp_put16_be(0x4001, v);
786
 
  stp_put16_le(3 - privdata.plane, v);
 
786
  stp_putc(3 - privdata.plane, v);
 
787
  stp_putc('\0', v);
787
788
  stp_put32_le(privdata.w_size * privdata.h_size, v);
788
789
  dyesub_nputc(v, '\0', 4);
789
790
}
851
852
 
852
853
LIST(dyesub_printsize_list_t, cp220_printsize_list, dyesub_printsize_t, cp220_printsize);
853
854
 
854
 
 
855
855
/* Canon SELPHY CP-520 */
856
856
static void cp520_printer_init_func(stp_vars_t *v)
857
857
{
858
 
  char pg = (strcmp(privdata.pagesize, "Postcard") == 0 ? '\1' :
859
 
                (strcmp(privdata.pagesize, "w253h337") == 0 ? '\2' :
860
 
                (strcmp(privdata.pagesize, "w155h244") == 0 ? '\3' :
861
 
                (strcmp(privdata.pagesize, "w283h566") == 0 ? '\4' : 
862
 
                 '\1' ))));
863
 
 
864
 
  stp_put16_be(0x4000, v);
865
 
  stp_putc('\0', v);
866
 
  stp_putc(pg, v);
867
 
  dyesub_nputc(v, '\0', 8); 
 
858
  cpx00_printer_init_func(v);
868
859
  /* The CP520 does not want the printer_init and plane_init command to be sent
869
860
     in the same USB-packet so we fill up first USB-Packet  with '\0'. */
870
861
  dyesub_nputc(v, '\0', 1012); 
871
862
}
872
863
 
873
 
static void cp520_plane_init_func(stp_vars_t *v)
 
864
/* Canon SELPHY CP-790 */
 
865
static void cp790_printer_init_func(stp_vars_t *v)
874
866
{
875
 
  stp_put16_be(0x4001, v);
876
 
  stp_putc(3 - privdata.plane, v);  /* The CP520 differs from the cp-printer
877
 
                                       in that it reqires the plane in the 3rd
878
 
                                       byte not in the 4th */
 
867
  char pg = (strcmp(privdata.pagesize, "Postcard") == 0 ? '\0' :
 
868
                (strcmp(privdata.pagesize, "w253h337") == 0 ? '\1' :
 
869
                (strcmp(privdata.pagesize, "w155h244") == 0 ? '\2' :
 
870
                (strcmp(privdata.pagesize, "w283h566") == 0 ? '\3' : 
 
871
                 '\0' ))));
 
872
 
 
873
  stp_put16_be(0x4000, v);
 
874
  stp_putc(pg, v);
879
875
  stp_putc('\0', v);
 
876
  dyesub_nputc(v, '\0', 8);
880
877
  stp_put32_le(privdata.w_size * privdata.h_size, v);
881
 
  dyesub_nputc(v, '\0', 4);
882
878
}
883
879
 
884
 
 
885
880
/* Canon SELPHY ES series */
886
881
static void es1_printer_init_func(stp_vars_t *v)
887
882
{
888
883
  char pg = (strcmp(privdata.pagesize, "Postcard") == 0 ? 0x11 :
889
 
             (strcmp(privdata.pagesize, "w253h337") == 0 ? '\2' :
890
 
              (strcmp(privdata.pagesize, "w155h244") == 0 ? '\3' : 0x11 )));
891
 
 
892
 
  /*
893
 
   differs from cp-220 in that after the 0x4000, the next character
894
 
   seems to be 0x01 instead of 0x00, and the P card size code is 
895
 
   '0x11' instead of '0x1'
896
 
   codes for other paper types are unknown.
897
 
  */
 
884
             (strcmp(privdata.pagesize, "w253h337") == 0 ? 0x12 :
 
885
              (strcmp(privdata.pagesize, "w155h244") == 0 ? 0x13 : 0x11)));
898
886
 
899
887
  stp_put16_be(0x4000, v);
900
 
  stp_putc(0x10, v);
 
888
  stp_putc(0x10, v);  /* 0x20 for P-BW */
901
889
  stp_putc(pg, v);
902
890
  dyesub_nputc(v, '\0', 8);
903
891
}
919
907
  }
920
908
 
921
909
  stp_put16_be(0x4001, v);
922
 
  stp_putc(0x1, v);
 
910
  stp_putc(0x1, v); /* 0x02 for P-BW */
923
911
  stp_putc(plane, v);
924
912
  stp_put32_le(privdata.w_size * privdata.h_size, v);
925
913
  dyesub_nputc(v, '\0', 4);
926
914
}
927
915
 
 
916
static void es2_printer_init_func(stp_vars_t *v)
 
917
{
 
918
  char pg2 = 0x0;
 
919
  char pg = (strcmp(privdata.pagesize, "Postcard") == 0 ? 0x1:
 
920
             (strcmp(privdata.pagesize, "w253h337") == 0 ? 0x2 :
 
921
              (strcmp(privdata.pagesize, "w155h244") == 0 ? 0x3 : 0x1)));
 
922
 
 
923
  if (pg == 0x03)
 
924
    pg2 = 0x01;
 
925
 
 
926
  stp_put16_be(0x4000, v);
 
927
  stp_putc(pg, v);
 
928
  stp_putc(0x0, v);
 
929
 
 
930
  stp_putc(0x2, v);
 
931
  dyesub_nputc(v, 0x0, 2);
 
932
  stp_putc(0x0, v);  /*  0x1 for P-BW */
 
933
 
 
934
  dyesub_nputc(v, 0x0, 3);
 
935
  stp_putc(pg2, v);
 
936
  stp_put32_le(privdata.w_size * privdata.h_size, v);
 
937
}
 
938
 
 
939
static void es2_plane_init_func(stp_vars_t *v)
 
940
{
 
941
  stp_put16_be(0x4001, v);
 
942
  stp_putc(4 - privdata.plane, v);  
 
943
  stp_putc(0x0, v);
 
944
  dyesub_nputc(v, '\0', 8);
 
945
}
 
946
 
 
947
static void es3_printer_init_func(stp_vars_t *v)
 
948
{
 
949
  char pg = (strcmp(privdata.pagesize, "Postcard") == 0 ? 0x1:
 
950
             (strcmp(privdata.pagesize, "w253h337") == 0 ? 0x2 :
 
951
              (strcmp(privdata.pagesize, "w155h244") == 0 ? 0x3 : 0x1)));
 
952
 
 
953
    /* We also have Pg and Ps  (Gold/Silver) papers on the ES3/30/40 */
 
954
 
 
955
  stp_put16_be(0x4000, v);
 
956
  stp_putc(pg, v);
 
957
  stp_putc(0x0, v);  /* 0x1 for P-BW */
 
958
  dyesub_nputc(v, 0x0, 8);
 
959
  stp_put32_le(privdata.w_size * privdata.h_size, v);
 
960
}
 
961
 
 
962
static void es3_printer_end_func(stp_vars_t *v)
 
963
{
 
964
  stp_put16_be(0x4020, v);
 
965
  dyesub_nputc(v, 0x0, 10);
 
966
}
 
967
 
 
968
static void es40_printer_init_func(stp_vars_t *v)
 
969
{
 
970
  char pg = (strcmp(privdata.pagesize, "Postcard") == 0 ? 0x0:
 
971
             (strcmp(privdata.pagesize, "w253h337") == 0 ? 0x1 :
 
972
              (strcmp(privdata.pagesize, "w155h244") == 0 ? 0x2 : 0x0)));
 
973
 
 
974
    /* We also have Pg and Ps  (Gold/Silver) papers on the ES3/30/40 */
 
975
 
 
976
  stp_put16_be(0x4000, v);
 
977
  stp_putc(pg, v);
 
978
  stp_putc(0x0, v);  /*  0x1 for P-BW */
 
979
  dyesub_nputc(v, 0x0, 8);
 
980
 
 
981
  stp_put32_le(privdata.w_size * privdata.h_size, v);
 
982
}
 
983
 
928
984
/* Sony DPP-EX5, DPP-EX7 */
929
985
static const dyesub_resolution_t res_403dpi[] =
930
986
{
1646
1702
  },
1647
1703
  { /* Canon CP-220, CP-330, SELPHY CP-400, SELPHY CP-500, SELPHY CP-510,
1648
1704
       SELPHY CP-600, SELPHY CP-710, SELPHY CP-720, SELPHY CP-730,
1649
 
       SELPHY CP-740, SELPHY CP-750 */
 
1705
       SELPHY CP-760, SELPHY CP-770, SELPHY CP-780 */
1650
1706
    1001,
1651
1707
    &ymc_ink_list,
1652
1708
    &res_300dpi_list,
1662
1718
    cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow,
1663
1719
    NULL,
1664
1720
  },
1665
 
  { /* Canon CP-520, SELPHY CP-530 */
 
1721
  { /* Canon CP-520, SELPHY CP-530, SELPHY CP-740, SELPHY CP-750 */
1666
1722
    1004,
1667
1723
    &ymc_ink_list,
1668
1724
    &res_300dpi_list,
1673
1729
      | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER
1674
1730
      | DYESUB_FEATURE_PLANE_INTERLACE,
1675
1731
    &cp520_printer_init_func, NULL,
1676
 
    &cp520_plane_init_func, NULL,
 
1732
    &cpx00_plane_init_func, NULL,
1677
1733
    NULL, NULL,
1678
1734
    cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow,
1679
1735
    NULL,
1680
1736
  },
1681
 
  { /* Canon SELPHY ES1, ES2, ES20 (!experimental) */
 
1737
  { /* Canon SELPHY ES1 (!experimental) */
1682
1738
    1003,
1683
1739
    &ymc_ink_list,
1684
1740
    &res_300dpi_list,
1694
1750
    cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow,
1695
1751
    NULL,
1696
1752
  },
 
1753
  { /* Canon SELPHY ES2, ES20 (!experimental) */
 
1754
    1005,
 
1755
    &ymc_ink_list,
 
1756
    &res_300dpi_list,
 
1757
    &cpx00_page_list,
 
1758
    &cpx00_printsize_list,
 
1759
    SHRT_MAX,
 
1760
    DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
 
1761
      | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER
 
1762
      | DYESUB_FEATURE_PLANE_INTERLACE,
 
1763
    &es2_printer_init_func, NULL,
 
1764
    &es2_plane_init_func, NULL,
 
1765
    NULL, NULL,
 
1766
    cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow,
 
1767
    NULL,
 
1768
  },
 
1769
  { /* Canon SELPHY ES3, ES30 (!experimental) */
 
1770
    1006,
 
1771
    &ymc_ink_list,
 
1772
    &res_300dpi_list,
 
1773
    &cpx00_page_list,
 
1774
    &cpx00_printsize_list,
 
1775
    SHRT_MAX,
 
1776
    DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
 
1777
      | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER
 
1778
      | DYESUB_FEATURE_PLANE_INTERLACE,
 
1779
    &es3_printer_init_func, &es3_printer_end_func,
 
1780
    &es2_plane_init_func, NULL,
 
1781
    NULL, NULL,
 
1782
    cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow,
 
1783
    NULL,
 
1784
  },
 
1785
  { /* Canon SELPHY ES40 (!experimental) */
 
1786
    1007,
 
1787
    &ymc_ink_list,
 
1788
    &res_300dpi_list,
 
1789
    &cpx00_page_list,
 
1790
    &cpx00_printsize_list,
 
1791
    SHRT_MAX,
 
1792
    DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
 
1793
      | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER
 
1794
      | DYESUB_FEATURE_PLANE_INTERLACE,
 
1795
    &es40_printer_init_func, &es3_printer_end_func,
 
1796
    &es2_plane_init_func, NULL,
 
1797
    NULL, NULL,
 
1798
    cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow,
 
1799
    NULL,
 
1800
  },
 
1801
  { /* Canon SELPHY CP790 (!experimental) */
 
1802
    1008,
 
1803
    &ymc_ink_list,
 
1804
    &res_300dpi_list,
 
1805
    &cp220_page_list,
 
1806
    &cp220_printsize_list,
 
1807
    SHRT_MAX,
 
1808
    DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
 
1809
      | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER
 
1810
      | DYESUB_FEATURE_PLANE_INTERLACE,
 
1811
    &cp790_printer_init_func, &es3_printer_end_func,
 
1812
    &es2_plane_init_func, NULL,
 
1813
    NULL, NULL,
 
1814
    cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow,
 
1815
    NULL,
 
1816
  },
 
1817
  { /* Canon SELPHY CP-800 */
 
1818
    1009,
 
1819
    &ymc_ink_list,
 
1820
    &res_300dpi_list,
 
1821
    &cpx00_page_list,
 
1822
    &cpx00_printsize_list,
 
1823
    SHRT_MAX,
 
1824
    DYESUB_FEATURE_FULL_WIDTH | DYESUB_FEATURE_FULL_HEIGHT
 
1825
      | DYESUB_FEATURE_BORDERLESS | DYESUB_FEATURE_WHITE_BORDER
 
1826
      | DYESUB_FEATURE_PLANE_INTERLACE,
 
1827
    &cp520_printer_init_func, NULL,
 
1828
    &cpx00_plane_init_func, NULL,
 
1829
    NULL, NULL,
 
1830
    cpx00_adj_cyan, cpx00_adj_magenta, cpx00_adj_yellow,
 
1831
    NULL,
 
1832
  },
 
1833
 
1697
1834
  { /* Sony DPP-EX5, DPP-EX7 */
1698
1835
    2002,
1699
1836
    &rgb_ink_list,