1
0
mirror of https://github.com/pdewacht/brlaser synced 2025-04-20 01:56:45 +02:00

Merge 911a518f4e019adacebe4b447467231c0bd08bd6 into 2a49e3287c70c254e7e3ac9dabe9d6a07218c3fa

This commit is contained in:
QORTEC 2023-03-14 15:14:07 +00:00 committed by GitHub
commit 29dfc2e64b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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