diff options
author | zvova7890 | 2019-11-14 04:24:45 +0200 |
---|---|---|
committer | zvova7890 | 2019-11-14 04:24:45 +0200 |
commit | 107a5cdd4cf03619b58e5f78ca02276fb91f9730 (patch) | |
tree | 2e21185f4537da62d1b7b94af82e02745c49514e | |
parent | 7e78091ff2cf2d36b1c011737737c23472e1eb0e (diff) | |
download | aur-107a5cdd4cf03619b58e5f78ca02276fb91f9730.tar.gz |
add fixes for latest CUPS. improve print options, add quality and contrast
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 7 | ||||
-rw-r--r-- | cn-ppd-support-mp280.patch | 46 | ||||
-rw-r--r-- | cups-fixes.patch | 113 |
4 files changed, 170 insertions, 0 deletions
@@ -17,8 +17,12 @@ pkgbase = cnijfilter-mp280 conflicts = cnijfilter-common source = http://gdlp01.c-wss.com/gds/0/0100003020/01/cnijfilter-source-3.40-1.tar.gz source = fix.patch + source = cups-fixes.patch + source = cn-ppd-support-mp280.patch md5sums = 609975a05d6050fcca88f312d3f35c6a md5sums = 1f4f7aa58be271e2d60b5f9615b1104d + md5sums = 55a10cc83b072c12ba50ea6864d3b18f + md5sums = 1b76cb2d4a46f6a10e6aced051729bb7 pkgname = cnijfilter-mp280 @@ -28,15 +28,22 @@ install=cnijfilter-mp280.install source=( 'http://gdlp01.c-wss.com/gds/0/0100003020/01/cnijfilter-source-3.40-1.tar.gz' 'fix.patch' + 'cups-fixes.patch' + 'cn-ppd-support-mp280.patch' ) md5sums=( '609975a05d6050fcca88f312d3f35c6a' '1f4f7aa58be271e2d60b5f9615b1104d' + '55a10cc83b072c12ba50ea6864d3b18f' + '1b76cb2d4a46f6a10e6aced051729bb7' ) build() { cd "$srcdir/cnijfilter-source-$_pkgrealver-$_pkgrealrel" patch -p0 < "$startdir/fix.patch" + patch -p1 < "$startdir/cups-fixes.patch" + patch -p1 < "$startdir/cn-ppd-support-mp280.patch" + sed -i -e 's/png_p->jmpbuf/png_jmpbuf(png_p)/' cnijfilter/src/bjfimage.c cp cnijfilter/src/config* lgmon/src/ cp cnijfilter/src/config* cngpijmon/cnijnpr/cnijnpr/ diff --git a/cn-ppd-support-mp280.patch b/cn-ppd-support-mp280.patch new file mode 100644 index 000000000000..e2034492d562 --- /dev/null +++ b/cn-ppd-support-mp280.patch @@ -0,0 +1,46 @@ +diff -Naur a/ppd/canonmp280.ppd b/ppd/canonmp280.ppd +--- a/ppd/canonmp280.ppd 2010-03-10 04:16:28.000000000 +0200 ++++ b/ppd/canonmp280.ppd 2019-11-01 03:54:39.000000000 +0200 +@@ -167,6 +167,42 @@ + *CNExtension 3/3: "<</CNExtension(3)>>setpagedevice" + *CloseUI: *CNExtension + ++*OpenUI *CNQuality/Quality: PickOne ++*DefaultCNQuality: 3 ++*CNQuality 2/Fine: "" ++*CNQuality 3/Normal: "" ++*CloseUI: *CNQuality ++ ++*OpenUI *CNDensity/Density: PickOne ++*DefaultCNDensity: 0 ++*CNDensity -50/-50: "" ++*CNDensity -40/-40: "" ++*CNDensity -30/-30: "" ++*CNDensity -20/-20: "" ++*CNDensity -10/-10: "" ++*CNDensity 0/0: "" ++*CNDensity 10/10: "" ++*CNDensity 20/20: "" ++*CNDensity 30/30: "" ++*CNDensity 40/40: "" ++*CNDensity 50/50: "" ++*CloseUI: *CNDensity ++ ++*OpenUI *CNContrast/Contrast: PickOne ++*DefaultCNContrast: 0 ++*CNContrast -50/-50: "" ++*CNContrast -40/-40: "" ++*CNContrast -30/-30: "" ++*CNContrast -20/-20: "" ++*CNContrast -10/-10: "" ++*CNContrast 0/0: "" ++*CNContrast 10/10: "" ++*CNContrast 20/20: "" ++*CNContrast 30/30: "" ++*CNContrast 40/40: "" ++*CNContrast 50/50: "" ++*CloseUI: *CNContrast ++ + *DefaultImageableArea: A4 + *ImageableArea Letter: "18.14 14.17 594.14 783.50" + *ImageableArea Letter.bl: "0 0 612 792" diff --git a/cups-fixes.patch b/cups-fixes.patch new file mode 100644 index 000000000000..ae8a0d2c45b1 --- /dev/null +++ b/cups-fixes.patch @@ -0,0 +1,113 @@ +diff -Naur a/cngpij/cngpij/bjcups.c b/cngpij/cngpij/bjcups.c +--- a/cngpij/cngpij/bjcups.c 2019-10-31 15:00:19.000000000 +0200 ++++ b/cngpij/cngpij/bjcups.c 2019-10-31 15:14:44.505666529 +0200 +@@ -66,6 +66,48 @@ + extern int GetIPCData(LPIPCU pipc, char *sname); + + ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) ++#define HAVE_CUPS_1_6 1 ++#endif ++ ++#ifndef HAVE_CUPS_1_6 ++#define ippGetCount(attr) attr->num_values ++#define ippGetGroupTag(attr) attr->group_tag ++#define ippGetValueTag(attr) attr->value_tag ++#define ippGetName(attr) attr->name ++#define ippGetBoolean(attr, element) attr->values[element].boolean ++#define ippGetInteger(attr, element) attr->values[element].integer ++#define ippGetStatusCode(ipp) ipp->request.status.status_code ++#define ippGetString(attr, element, language) attr->values[element].string.text ++ ++static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp ) ++{ ++ if (!ipp) ++ return (NULL); ++ return (ipp->current = ipp->attrs); ++} ++ ++static ipp_attribute_t * ippNextAttribute( ipp_t *ipp ) ++{ ++ if (!ipp || !ipp->current) ++ return (NULL); ++ return (ipp->current = ipp->current->next); ++} ++ ++static int ippSetOperation( ipp_t *ipp, ipp_op_t op ) ++{ ++ ipp->request.op.operation_id = op; ++ return (1); ++} ++ ++static int ippSetRequestId( ipp_t *ipp, int request_id ) ++{ ++ ipp->request.any.request_id = request_id; ++ return (1); ++} ++#endif ++ ++ + int get_value_and_param_array(short id, short** value, char*** param) + { + int count; +@@ -689,8 +731,8 @@ + else { + pRequest = ippNew(); + +- pRequest->request.op.operation_id = CUPS_GET_PRINTERS; +- pRequest->request.op.request_id = 1; ++ ippSetOperation(pRequest, CUPS_GET_PRINTERS); ++ ippSetRequestId(pRequest, 1); + + pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19 + +@@ -699,29 +741,29 @@ + ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL); + + if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) { +- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) { ++ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) { + fputs("ERROR: IPP ERROR\n", stderr); + goto onErr; + } + else { +- pAttribute = pResponse->attrs; ++ pAttribute = ippFirstAttribute(pResponse); + + while (pAttribute != NULL) { +- while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) { +- pAttribute = pAttribute->next; ++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_PRINTER) { ++ pAttribute = ippNextAttribute(pAttribute); + } + if (pAttribute == NULL) { + break; + } + +- while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_PRINTER) { +- if (strcmp(pAttribute->name, "printer-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) { +- pPrinter = pAttribute->values[0].string.text; ++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_PRINTER) { ++ if (strcmp(ippGetName(pAttribute), "printer-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) { ++ pPrinter = ippGetString(pAttribute, 0, ""); + } +- if (strcmp(pAttribute->name, "device-uri") == 0 && pAttribute->value_tag == IPP_TAG_URI) { +- pDUri = pAttribute->values[0].string.text; ++ if (strcmp(ippGetName(pAttribute), "device-uri") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) { ++ pDUri = ippGetString(pAttribute, 0, ""); + } +- pAttribute = pAttribute->next; ++ pAttribute = ippNextAttribute(pAttribute); + } + + if (strcasecmp(pDestName, pPrinter) == 0) { +@@ -730,7 +772,7 @@ + } + + if (pAttribute != NULL) +- pAttribute = pAttribute->next; ++ pAttribute = ippNextAttribute(pAttribute); + } + } + + |