Skip to content

Commit

Permalink
Tumble support
Browse files Browse the repository at this point in the history
  • Loading branch information
evanmiller authored and QORTEC committed Mar 14, 2023
1 parent b546a10 commit c69a7a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ 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_);
}
Expand Down
2 changes: 2 additions & 0 deletions src/job.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct page_params {
int num_copies;
int resolution;
bool duplex;
bool tumble;
bool economode;
std::string sourcetray;
std::string mediatype;
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit c69a7a5

Please sign in to comment.