Browse Source

Merge 911a518f4e into 2a49e3287c

pull/180/merge
QORTEC 3 years ago committed by GitHub
parent
commit
29dfc2e64b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/job.cc
  2. 2
      src/job.h
  3. 1
      src/main.cc
  4. 1
      test/tempfile.h

6
src/job.cc

@ -78,8 +78,12 @@ void job::write_page_header() {
fputs("\033E", out_);
fprintf(out_, "\033&l%dX", std::max(1, page_params_.num_copies));
if (page_params_.duplex) {
if (page_params_.duplex && page_params_.tumble) {
fputs("\033&l2S", out_);
} else if (page_params_.duplex) {
fputs("\033&l1S", out_);
} else {
fputs("\033&l0S", out_);
}
}

2
src/job.h

@ -27,6 +27,7 @@ struct page_params {
int num_copies;
int resolution;
bool duplex;
bool tumble;
bool economode;
std::string sourcetray;
std::string mediatype;
@ -36,6 +37,7 @@ struct page_params {
return num_copies == o.num_copies
&& resolution == o.resolution
&& duplex == o.duplex
&& tumble == o.tumble
&& economode == o.economode
&& sourcetray == o.sourcetray
&& mediatype == o.mediatype

1
src/main.cc

@ -111,6 +111,7 @@ page_params build_page_params(const cups_page_header2_t &header) {
p.economode = header.cupsInteger[10];
p.mediatype = header.MediaType;
p.duplex = header.Duplex;
p.tumble = header.Tumble;
if (header.MediaPosition < sources.size())
p.sourcetray = sources[header.MediaPosition];

1
test/tempfile.h

@ -21,6 +21,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstdint>
#include <vector>
class tempfile {

Loading…
Cancel
Save