kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'escl-normalize-spec' into 'master'
Escl: normalize spec See merge request sane-project/backends!731251-scanner-canon-mf110-910-series-is-not-supported
commit
6acddfe7f0
|
@ -92,6 +92,7 @@ typedef struct {
|
||||||
typedef struct ESCL_Device {
|
typedef struct ESCL_Device {
|
||||||
struct ESCL_Device *next;
|
struct ESCL_Device *next;
|
||||||
|
|
||||||
|
double version;
|
||||||
char *model_name;
|
char *model_name;
|
||||||
int port_nb;
|
int port_nb;
|
||||||
char *ip_address;
|
char *ip_address;
|
||||||
|
|
|
@ -428,6 +428,9 @@ print_xml_c(xmlNode *node, ESCL_Device *device, capabilities_t *scanner, int typ
|
||||||
if (find_nodes_c(node) && type != -1)
|
if (find_nodes_c(node) && type != -1)
|
||||||
find_true_variables(node, scanner, type);
|
find_true_variables(node, scanner, type);
|
||||||
}
|
}
|
||||||
|
if (!strcmp((const char *)node->name, "Version")){
|
||||||
|
device->version = atof ((const char *)xmlNodeGetContent(node));
|
||||||
|
}
|
||||||
if (!strcmp((const char *)node->name, "MakeAndModel")){
|
if (!strcmp((const char *)node->name, "MakeAndModel")){
|
||||||
device->model_name = strdup((const char *)xmlNodeGetContent(node));
|
device->model_name = strdup((const char *)xmlNodeGetContent(node));
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,6 @@ static const char settings[] =
|
||||||
" <pwg:YOffset>%d</pwg:YOffset>" \
|
" <pwg:YOffset>%d</pwg:YOffset>" \
|
||||||
" </pwg:ScanRegion>" \
|
" </pwg:ScanRegion>" \
|
||||||
" </pwg:ScanRegions>" \
|
" </pwg:ScanRegions>" \
|
||||||
" <pwg:DocumentFormat>%s</pwg:DocumentFormat>" \
|
|
||||||
"%s" \
|
"%s" \
|
||||||
" <scan:ColorMode>%s</scan:ColorMode>" \
|
" <scan:ColorMode>%s</scan:ColorMode>" \
|
||||||
" <scan:XResolution>%d</scan:XResolution>" \
|
" <scan:XResolution>%d</scan:XResolution>" \
|
||||||
|
@ -137,8 +136,8 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
|
||||||
char *location = NULL;
|
char *location = NULL;
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
char *temporary = NULL;
|
char *temporary = NULL;
|
||||||
char *f_ext = "";
|
|
||||||
char *format_ext = NULL;
|
char *format_ext = NULL;
|
||||||
|
char f_ext_tmp[1024];
|
||||||
char duplex_mode[1024] = { 0 };
|
char duplex_mode[1024] = { 0 };
|
||||||
int wakup_count = 0;
|
int wakup_count = 0;
|
||||||
|
|
||||||
|
@ -188,16 +187,22 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
|
||||||
scanner->caps[scanner->source].default_format =
|
scanner->caps[scanner->source].default_format =
|
||||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
|
strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
|
||||||
}
|
}
|
||||||
if (scanner->caps[scanner->source].format_ext == 1)
|
if (device->version <= 2.0)
|
||||||
{
|
{
|
||||||
char f_ext_tmp[1024];
|
// For eSCL 2.0 and older clients
|
||||||
|
snprintf(f_ext_tmp, sizeof(f_ext_tmp),
|
||||||
|
" <pwg:DocumentFormat>%s</pwg:DocumentFormat>",
|
||||||
|
scanner->caps[scanner->source].default_format);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// For eSCL 2.1 and newer clients
|
||||||
snprintf(f_ext_tmp, sizeof(f_ext_tmp),
|
snprintf(f_ext_tmp, sizeof(f_ext_tmp),
|
||||||
" <scan:DocumentFormatExt>%s</scan:DocumentFormatExt>",
|
" <scan:DocumentFormatExt>%s</scan:DocumentFormatExt>",
|
||||||
scanner->caps[scanner->source].default_format);
|
scanner->caps[scanner->source].default_format);
|
||||||
format_ext = f_ext_tmp;
|
|
||||||
}
|
}
|
||||||
else
|
format_ext = f_ext_tmp;
|
||||||
format_ext = f_ext;
|
|
||||||
if(scanner->source > PLATEN && scanner->Sources[ADFDUPLEX]) {
|
if(scanner->source > PLATEN && scanner->Sources[ADFDUPLEX]) {
|
||||||
snprintf(duplex_mode, sizeof(duplex_mode),
|
snprintf(duplex_mode, sizeof(duplex_mode),
|
||||||
" <scan:Duplex>%s</scan:Duplex>",
|
" <scan:Duplex>%s</scan:Duplex>",
|
||||||
|
@ -253,7 +258,6 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
|
||||||
scanner->caps[scanner->source].width,
|
scanner->caps[scanner->source].width,
|
||||||
off_x,
|
off_x,
|
||||||
off_y,
|
off_y,
|
||||||
scanner->caps[scanner->source].default_format,
|
|
||||||
format_ext,
|
format_ext,
|
||||||
scanner->caps[scanner->source].default_color,
|
scanner->caps[scanner->source].default_color,
|
||||||
scanner->caps[scanner->source].default_resolution,
|
scanner->caps[scanner->source].default_resolution,
|
||||||
|
|
Ładowanie…
Reference in New Issue