| 1 | /* |
| 2 | * |
| 3 | * Print plug-in EPSON ESC/P2 driver for the GIMP. |
| 4 | * |
| 5 | * Copyright 1997-2000 Michael Sweet ([email protected]) and |
| 6 | * Robert Krawitz ([email protected]) |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License as published by the Free |
| 10 | * Software Foundation; either version 2 of the License, or (at your option) |
| 11 | * any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, but |
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 16 | * for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 20 | */ |
| 21 | |
| 22 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:411:9`! |
| 23 | #include <config.h>cxx . . $ `<file>/config.h`/ |
| 24 | #endif |
| 25 | #include <gutenprint/gutenprint.h>cxx . . $ `<file>/include/gutenprint/gutenprint.h`/ |
| 26 | #include "gutenprint-internal.h"cxx . . $ `<file>/src/main/gutenprint-internal.h`/ |
| 27 | #include <gutenprint/gutenprint-intl-internal.h>cxx . . $ `<file>/include/gutenprint/gutenprint-intl-internal.h`/ |
| 28 | #include "print-escp2.h"cxx . . $ `<file>/src/main/print-escp2.h`/ |
| 29 | #include <limits.h> |
| 30 | #include <sys/param.h> |
| 31 | |
| 32 | typedef structcxx . . $ $anonymous_type_de6362fe991af22e_0# |
| 33 | { |
| 34 | const char *attr_namecxx . . $ $anonymous_type_de6362fe991af22e_0#attr_name.; |
| 35 | short bit_shiftcxx . . $ $anonymous_type_de6362fe991af22e_0#bit_shift.; |
| 36 | short bit_widthcxx . . $ $anonymous_type_de6362fe991af22e_0#bit_width.; |
| 37 | } escp2_printer_attr_tcxx . . $ escp2_printer_attr_t#; |
| 38 | |
| 39 | static const escp2_printer_attr_tcxx . . $ escp2_printer_attr_t# escp2_printer_attrscxx . . $ escp2_printer_attrs.[] = |
| 40 | { |
| 41 | { "command_mode", 0, 4 }, |
| 42 | { "zero_margin", 4, 3 }, |
| 43 | { "variable_mode", 7, 1 }, |
| 44 | { "graymode", 8, 1 }, |
| 45 | { "fast_360", 9, 1 }, |
| 46 | { "send_zero_advance", 10, 1 }, |
| 47 | { "supports_ink_change", 11, 1 }, |
| 48 | { "packet_mode", 12, 1 }, |
| 49 | { "interchangeable_ink", 13, 1 }, |
| 50 | { "envelope_landscape", 14, 1 }, |
| 51 | { "roll_only", 15, 1 }, |
| 52 | }; |
| 53 | |
| 54 | static stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t# *escp2_model_capabilitiescxx . . $ escp2_model_capabilities.; |
| 55 | |
| 56 | static int escp2_model_countcxx . . $ escp2_model_count. = 0; |
| 57 | |
| 58 | static int |
| 59 | load_model_from_filecxx . . $ load_model_from_file(6689a92679cc455f).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *filename, int depth) |
| 60 | { |
| 61 | int model = -1; |
| 62 | stp_mxml_node_tcxx . . $ stp_mxml_node_t# *xmod = |
| 63 | stp_xml_parse_file_from_path_uncached_safecxx . . $ stp_xml_parse_file_from_path_uncached_safe(5a8029715312b5a0).(filename, "escp2Model", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 64 | const char *id = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(xmod, "id"); |
| 65 | stp_mxml_node_tcxx . . $ stp_mxml_node_t# *tmp = xmod->childcxx . . $ stp_mxml_node_s#child.; |
| 66 | stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t# *p = stpi_escp2_get_printercxx . . $ stpi_escp2_get_printer(d94ed1084d556691).(v); |
| 67 | const char *stmp = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(xmod, "base"); |
| 68 | if (id) |
| 69 | model = stp_xmlstrtolcxx . . $ stp_xmlstrtol(3c95bd14d5d5d286).(id); |
| 70 | if (depth == 0) |
| 71 | { |
| 72 | p->max_black_resolutioncxx . . $ escp2_printer#max_black_resolution. = -1; |
| 73 | p->cd_x_offsetcxx . . $ escp2_printer#cd_x_offset. = -1; |
| 74 | p->cd_y_offsetcxx . . $ escp2_printer#cd_y_offset. = -1; |
| 75 | p->duplex_left_margincxx . . $ escp2_printer#duplex_left_margin. = SHRT_MINcxx . . $ `<external>/67164224788392828/limits.h:104:9`!; |
| 76 | p->duplex_right_margincxx . . $ escp2_printer#duplex_right_margin. = SHRT_MINcxx . . $ `<external>/67164224788392828/limits.h:104:9`!; |
| 77 | p->duplex_top_margincxx . . $ escp2_printer#duplex_top_margin. = SHRT_MINcxx . . $ `<external>/67164224788392828/limits.h:104:9`!; |
| 78 | p->duplex_bottom_margincxx . . $ escp2_printer#duplex_bottom_margin. = SHRT_MINcxx . . $ `<external>/67164224788392828/limits.h:104:9`!; |
| 79 | } |
| 80 | /* Allow recursive definitions */ |
| 81 | if (stmp) |
| 82 | { |
| 83 | load_model_from_filecxx . . $ load_model_from_file(6689a92679cc455f).(v, stmp, depth + 1); |
| 84 | } |
| 85 | while (tmp) |
| 86 | { |
| 87 | if (tmp->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT.) |
| 88 | { |
| 89 | const char *name = tmp->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name.; |
| 90 | const char *target = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(tmp, "src"); |
| 91 | if (target) |
| 92 | { |
| 93 | /* FIXME need to allow override of these! */ |
| 94 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "media")) |
| 95 | stpi_escp2_load_mediacxx . . $ stpi_escp2_load_media(b1e629819c29df09).(v, target); |
| 96 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "inputSlots")) |
| 97 | stpi_escp2_load_input_slotscxx . . $ stpi_escp2_load_input_slots(b1e629819c29df09).(v, target); |
| 98 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "mediaSizes")) |
| 99 | stpi_escp2_load_media_sizescxx . . $ stpi_escp2_load_media_sizes(b1e629819c29df09).(v, target); |
| 100 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "printerWeaves")) |
| 101 | stpi_escp2_load_printer_weavescxx . . $ stpi_escp2_load_printer_weaves(b1e629819c29df09).(v, target); |
| 102 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "qualityPresets")) |
| 103 | stpi_escp2_load_quality_presetscxx . . $ stpi_escp2_load_quality_presets(b1e629819c29df09).(v, target); |
| 104 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "resolutions")) |
| 105 | stpi_escp2_load_resolutionscxx . . $ stpi_escp2_load_resolutions(5eab70e4dd30e869).(v, target, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 106 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "inkGroup")) |
| 107 | stpi_escp2_load_inkgroupcxx . . $ stpi_escp2_load_inkgroup(b1e629819c29df09).(v, target); |
| 108 | } |
| 109 | else if (tmp->childcxx . . $ stp_mxml_node_s#child. && tmp->childcxx . . $ stp_mxml_node_s#child.->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_TEXTcxx . . $ STP_MXML_TEXT.) |
| 110 | { |
| 111 | stp_mxml_node_tcxx . . $ stp_mxml_node_t# *child = tmp->childcxx . . $ stp_mxml_node_s#child.; |
| 112 | const char *val = child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.; |
| 113 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "verticalBorderlessSequence")) |
| 114 | { |
| 115 | STPI_ASSERTcxx . . $ `src/main/gutenprint-internal.h:58:9`!(!p->vertical_borderless_sequence, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 116 | p->vertical_borderless_sequencecxx . . $ escp2_printer#vertical_borderless_sequence. = stp_xmlstrtorawcxx . . $ stp_xmlstrtoraw(62ebf526a09225cc).(val); |
| 117 | } |
| 118 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "preinitSequence")) |
| 119 | { |
| 120 | STPI_ASSERTcxx . . $ `src/main/gutenprint-internal.h:58:9`!(!p->preinit_sequence, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 121 | p->preinit_sequencecxx . . $ escp2_printer#preinit_sequence. = stp_xmlstrtorawcxx . . $ stp_xmlstrtoraw(62ebf526a09225cc).(val); |
| 122 | } |
| 123 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "preinitRemoteSequence")) |
| 124 | { |
| 125 | STPI_ASSERTcxx . . $ `src/main/gutenprint-internal.h:58:9`!(!p->preinit_remote_sequence, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 126 | p->preinit_remote_sequencecxx . . $ escp2_printer#preinit_remote_sequence. = stp_xmlstrtorawcxx . . $ stp_xmlstrtoraw(62ebf526a09225cc).(val); |
| 127 | } |
| 128 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "postinitRemoteSequence")) |
| 129 | { |
| 130 | STPI_ASSERTcxx . . $ `src/main/gutenprint-internal.h:58:9`!(!p->postinit_remote_sequence, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 131 | p->postinit_remote_sequencecxx . . $ escp2_printer#postinit_remote_sequence. = stp_xmlstrtorawcxx . . $ stp_xmlstrtoraw(62ebf526a09225cc).(val); |
| 132 | } |
| 133 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "commandSet")) |
| 134 | { |
| 135 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "1998")) |
| 136 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_COMMAND_1998cxx . . $ `src/main/print-escp2.h:263:9`!; |
| 137 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "1999")) |
| 138 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_COMMAND_1999cxx . . $ `src/main/print-escp2.h:264:9`!; |
| 139 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "2000")) |
| 140 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_COMMAND_2000cxx . . $ `src/main/print-escp2.h:265:9`!; |
| 141 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "Pro")) |
| 142 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_COMMAND_PROcxx . . $ `src/main/print-escp2.h:266:9`!; |
| 143 | } |
| 144 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "borderless")) |
| 145 | { |
| 146 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "No")) |
| 147 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_ZEROMARGIN_NOcxx . . $ `src/main/print-escp2.h:269:9`!; |
| 148 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "Yes")) |
| 149 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_ZEROMARGIN_YEScxx . . $ `src/main/print-escp2.h:270:9`!; |
| 150 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "Full")) |
| 151 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_ZEROMARGIN_FULLcxx . . $ `src/main/print-escp2.h:271:9`!; |
| 152 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "VerticalRestricted")) |
| 153 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_ZEROMARGIN_RESTRcxx . . $ `src/main/print-escp2.h:272:9`!; |
| 154 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "HorizontalOnly")) |
| 155 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_ZEROMARGIN_H_ONLYcxx . . $ `src/main/print-escp2.h:273:9`!; |
| 156 | } |
| 157 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "preferredEnvelopeOrientation") && |
| 158 | !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "Landscape")) |
| 159 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_ENVELOPE_LANDSCAPE_YEScxx . . $ `src/main/print-escp2.h:305:9`!; |
| 160 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "headConfiguration")) |
| 161 | { |
| 162 | const char *htype = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(tmp, "type"); |
| 163 | unsigned long data[4] = { 0, 0, 0, 0 }; |
| 164 | while (child) |
| 165 | { |
| 166 | if (child->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. && child->childcxx . . $ stp_mxml_node_s#child. && |
| 167 | child->childcxx . . $ stp_mxml_node_s#child.->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_TEXTcxx . . $ STP_MXML_TEXT.) |
| 168 | { |
| 169 | const char *cname = child->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name.; |
| 170 | const char *cval = child->childcxx . . $ stp_mxml_node_s#child.->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.; |
| 171 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(cname, "Nozzles")) |
| 172 | data[0] = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(cval); |
| 173 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(cname, "MinNozzles")) |
| 174 | data[1] = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(cval); |
| 175 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(cname, "FirstNozzle")) |
| 176 | data[2] = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(cval); |
| 177 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(cname, "NozzleSeparation")) |
| 178 | data[3] = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(cval); |
| 179 | } |
| 180 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 181 | } |
| 182 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(htype, "default")) |
| 183 | { |
| 184 | p->nozzlescxx . . $ escp2_printer#nozzles. = data[0]; |
| 185 | p->min_nozzlescxx . . $ escp2_printer#min_nozzles. = data[1]; |
| 186 | p->nozzle_startcxx . . $ escp2_printer#nozzle_start. = data[2]; |
| 187 | p->nozzle_separationcxx . . $ escp2_printer#nozzle_separation. = data[3]; |
| 188 | if (p->black_nozzlescxx . . $ escp2_printer#black_nozzles. == 0) |
| 189 | { |
| 190 | p->black_nozzlescxx . . $ escp2_printer#black_nozzles. = data[0]; |
| 191 | p->min_black_nozzlescxx . . $ escp2_printer#min_black_nozzles. = data[1]; |
| 192 | p->black_nozzle_startcxx . . $ escp2_printer#black_nozzle_start. = data[2]; |
| 193 | p->black_nozzle_separationcxx . . $ escp2_printer#black_nozzle_separation. = data[3]; |
| 194 | } |
| 195 | if (p->fast_nozzlescxx . . $ escp2_printer#fast_nozzles. == 0) |
| 196 | { |
| 197 | p->fast_nozzlescxx . . $ escp2_printer#fast_nozzles. = data[0]; |
| 198 | p->min_fast_nozzlescxx . . $ escp2_printer#min_fast_nozzles. = data[1]; |
| 199 | p->fast_nozzle_startcxx . . $ escp2_printer#fast_nozzle_start. = data[2]; |
| 200 | p->fast_nozzle_separationcxx . . $ escp2_printer#fast_nozzle_separation. = data[3]; |
| 201 | } |
| 202 | } |
| 203 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(htype, "black")) |
| 204 | { |
| 205 | p->black_nozzlescxx . . $ escp2_printer#black_nozzles. = data[0]; |
| 206 | p->min_black_nozzlescxx . . $ escp2_printer#min_black_nozzles. = data[1]; |
| 207 | p->black_nozzle_startcxx . . $ escp2_printer#black_nozzle_start. = data[2]; |
| 208 | p->black_nozzle_separationcxx . . $ escp2_printer#black_nozzle_separation. = data[3]; |
| 209 | } |
| 210 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(htype, "fast")) |
| 211 | { |
| 212 | p->fast_nozzlescxx . . $ escp2_printer#fast_nozzles. = data[0]; |
| 213 | p->min_fast_nozzlescxx . . $ escp2_printer#min_fast_nozzles. = data[1]; |
| 214 | p->fast_nozzle_startcxx . . $ escp2_printer#fast_nozzle_start. = data[2]; |
| 215 | p->fast_nozzle_separationcxx . . $ escp2_printer#fast_nozzle_separation. = data[3]; |
| 216 | } |
| 217 | } |
| 218 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "margins")) |
| 219 | { |
| 220 | const char *itype = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(tmp, "interleave"); |
| 221 | const char *mtype = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(tmp, "media"); |
| 222 | const char *dtype = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(tmp, "duplex"); |
| 223 | unsigned long data[4]; |
| 224 | int i = 0; |
| 225 | while (child && i < 4) |
| 226 | { |
| 227 | if (child->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_TEXTcxx . . $ STP_MXML_TEXT.) |
| 228 | data[i++] = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 229 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 230 | } |
| 231 | if (dtype && !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(dtype, "duplex")) |
| 232 | { |
| 233 | p->duplex_left_margincxx . . $ escp2_printer#duplex_left_margin. = data[0]; |
| 234 | p->duplex_right_margincxx . . $ escp2_printer#duplex_right_margin. = data[1]; |
| 235 | p->duplex_top_margincxx . . $ escp2_printer#duplex_top_margin. = data[2]; |
| 236 | p->duplex_bottom_margincxx . . $ escp2_printer#duplex_bottom_margin. = data[3]; |
| 237 | } |
| 238 | else if (itype && !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(itype, "soft") && |
| 239 | mtype && !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mtype, "sheet")) |
| 240 | { |
| 241 | p->left_margincxx . . $ escp2_printer#left_margin. = data[0]; |
| 242 | p->right_margincxx . . $ escp2_printer#right_margin. = data[1]; |
| 243 | p->top_margincxx . . $ escp2_printer#top_margin. = data[2]; |
| 244 | p->bottom_margincxx . . $ escp2_printer#bottom_margin. = data[3]; |
| 245 | } |
| 246 | else if (itype && !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(itype, "printer") && |
| 247 | mtype && !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mtype, "sheet")) |
| 248 | { |
| 249 | p->m_left_margincxx . . $ escp2_printer#m_left_margin. = data[0]; |
| 250 | p->m_right_margincxx . . $ escp2_printer#m_right_margin. = data[1]; |
| 251 | p->m_top_margincxx . . $ escp2_printer#m_top_margin. = data[2]; |
| 252 | p->m_bottom_margincxx . . $ escp2_printer#m_bottom_margin. = data[3]; |
| 253 | } |
| 254 | else if (itype && !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(itype, "soft") && |
| 255 | mtype && !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mtype, "roll")) |
| 256 | { |
| 257 | p->roll_left_margincxx . . $ escp2_printer#roll_left_margin. = data[0]; |
| 258 | p->roll_right_margincxx . . $ escp2_printer#roll_right_margin. = data[1]; |
| 259 | p->roll_top_margincxx . . $ escp2_printer#roll_top_margin. = data[2]; |
| 260 | p->roll_bottom_margincxx . . $ escp2_printer#roll_bottom_margin. = data[3]; |
| 261 | } |
| 262 | else if (itype && !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(itype, "printer") && |
| 263 | mtype && !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mtype, "roll")) |
| 264 | { |
| 265 | p->m_roll_left_margincxx . . $ escp2_printer#m_roll_left_margin. = data[0]; |
| 266 | p->m_roll_right_margincxx . . $ escp2_printer#m_roll_right_margin. = data[1]; |
| 267 | p->m_roll_top_margincxx . . $ escp2_printer#m_roll_top_margin. = data[2]; |
| 268 | p->m_roll_bottom_margincxx . . $ escp2_printer#m_roll_bottom_margin. = data[3]; |
| 269 | } |
| 270 | } |
| 271 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "physicalChannels")) |
| 272 | p->physical_channelscxx . . $ escp2_printer#physical_channels. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 273 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "baseSeparation")) |
| 274 | p->base_separationcxx . . $ escp2_printer#base_separation. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 275 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "resolutionScale")) |
| 276 | p->resolution_scalecxx . . $ escp2_printer#resolution_scale. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 277 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "maxBlackResolution")) |
| 278 | p->max_black_resolutioncxx . . $ escp2_printer#max_black_resolution. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 279 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "minimumResolution")) |
| 280 | { |
| 281 | p->min_hrescxx . . $ escp2_printer#min_hres. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 282 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 283 | p->min_vrescxx . . $ escp2_printer#min_vres. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 284 | } |
| 285 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "maximumResolution")) |
| 286 | { |
| 287 | p->max_hrescxx . . $ escp2_printer#max_hres. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 288 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 289 | p->max_vrescxx . . $ escp2_printer#max_vres. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 290 | } |
| 291 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "extraVerticalFeed")) |
| 292 | p->extra_feedcxx . . $ escp2_printer#extra_feed. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 293 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "separationRows")) |
| 294 | p->separation_rowscxx . . $ escp2_printer#separation_rows. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 295 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "pseudoSeparationRows")) |
| 296 | p->pseudo_separation_rowscxx . . $ escp2_printer#pseudo_separation_rows. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 297 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "zeroMarginOffset")) |
| 298 | p->zero_margin_offsetcxx . . $ escp2_printer#zero_margin_offset. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 299 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "microLeftMargin")) |
| 300 | p->micro_left_margincxx . . $ escp2_printer#micro_left_margin. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 301 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "initialVerticalOffset")) |
| 302 | p->initial_vertical_offsetcxx . . $ escp2_printer#initial_vertical_offset. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 303 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "blackInitialVerticalOffset")) |
| 304 | p->black_initial_vertical_offsetcxx . . $ escp2_printer#black_initial_vertical_offset. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 305 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "printingInitialVerticalOffset")) |
| 306 | p->printing_initial_vertical_offsetcxx . . $ escp2_printer#printing_initial_vertical_offset. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 307 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "extra720DPISeparation")) |
| 308 | p->extra_720dpi_separationcxx . . $ escp2_printer#extra_720dpi_separation. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 309 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "minHorizontalAlignment")) |
| 310 | p->min_horizontal_position_alignmentcxx . . $ escp2_printer#min_horizontal_position_alignment. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 311 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "baseHorizontalAlignment")) |
| 312 | p->base_horizontal_position_alignmentcxx . . $ escp2_printer#base_horizontal_position_alignment. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 313 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "bidirectionalAutoUpperLimit")) |
| 314 | p->bidirectional_upper_limitcxx . . $ escp2_printer#bidirectional_upper_limit. = stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(val); |
| 315 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "minimumMediaSize")) |
| 316 | { |
| 317 | p->min_paper_widthcxx . . $ escp2_printer#min_paper_width. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 318 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 319 | p->min_paper_heightcxx . . $ escp2_printer#min_paper_height. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 320 | } |
| 321 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "maximumMediaSize")) |
| 322 | { |
| 323 | p->max_paper_widthcxx . . $ escp2_printer#max_paper_width. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 324 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 325 | p->max_paper_heightcxx . . $ escp2_printer#max_paper_height. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 326 | } |
| 327 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "maximumImageableArea")) |
| 328 | { |
| 329 | p->max_imageable_widthcxx . . $ escp2_printer#max_imageable_width. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 330 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 331 | p->max_imageable_heightcxx . . $ escp2_printer#max_imageable_height. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 332 | } |
| 333 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "CDOffset")) |
| 334 | { |
| 335 | p->cd_x_offsetcxx . . $ escp2_printer#cd_x_offset. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 336 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 337 | p->cd_y_offsetcxx . . $ escp2_printer#cd_y_offset. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 338 | } |
| 339 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "CDMediaSize")) |
| 340 | { |
| 341 | p->cd_page_widthcxx . . $ escp2_printer#cd_page_width. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 342 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 343 | p->cd_page_heightcxx . . $ escp2_printer#cd_page_height. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 344 | } |
| 345 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "extraBottom")) |
| 346 | p->paper_extra_bottomcxx . . $ escp2_printer#paper_extra_bottom. = stp_xmlstrtodimcxx . . $ stp_xmlstrtodim(9a18bdb0e56c1bc2).(val); |
| 347 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "AlignmentChoices")) |
| 348 | { |
| 349 | p->alignment_passescxx . . $ escp2_printer#alignment_passes. = |
| 350 | stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 351 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 352 | p->alignment_choicescxx . . $ escp2_printer#alignment_choices. = |
| 353 | stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 354 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 355 | p->alternate_alignment_passescxx . . $ escp2_printer#alternate_alignment_passes. = |
| 356 | stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 357 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 358 | p->alternate_alignment_choicescxx . . $ escp2_printer#alternate_alignment_choices. = |
| 359 | stp_xmlstrtoulcxx . . $ stp_xmlstrtoul(751346f8406fd082).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.); |
| 360 | } |
| 361 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "ChannelNames")) |
| 362 | { |
| 363 | p->channel_namescxx . . $ escp2_printer#channel_names. = stp_string_list_createcxx . . $ stp_string_list_create(f262b3b5e10fad14).(); |
| 364 | while (child) |
| 365 | { |
| 366 | if (child->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. && |
| 367 | !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(child->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "ChannelName")) |
| 368 | { |
| 369 | const char *cname = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(child, "name"); |
| 370 | const char *ctext = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(child, "text"); |
| 371 | stp_string_list_add_stringcxx . . $ stp_string_list_add_string(61ec312b340c2952).(p->channel_namescxx . . $ escp2_printer#channel_names., cname, ctext); |
| 372 | } |
| 373 | child = child->nextcxx . . $ stp_mxml_node_s#next.; |
| 374 | } |
| 375 | } |
| 376 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "resolutions")) |
| 377 | { |
| 378 | stpi_escp2_load_resolutionscxx . . $ stpi_escp2_load_resolutions(5eab70e4dd30e869).(v, filename, tmp); |
| 379 | } |
| 380 | } |
| 381 | else |
| 382 | { |
| 383 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "supportsVariableDropsizes")) |
| 384 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_VARIABLE_YEScxx . . $ `src/main/print-escp2.h:277:9`!; |
| 385 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "hasFastGraymode")) |
| 386 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_GRAYMODE_YEScxx . . $ `src/main/print-escp2.h:281:9`!; |
| 387 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "hasFast360DPI")) |
| 388 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_FAST_360_YEScxx . . $ `src/main/print-escp2.h:285:9`!; |
| 389 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "sendZeroAdvance")) |
| 390 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_SEND_ZERO_ADVANCE_YEScxx . . $ `src/main/print-escp2.h:289:9`!; |
| 391 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "supportsInkChange")) |
| 392 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_SUPPORTS_INK_CHANGE_YEScxx . . $ `src/main/print-escp2.h:293:9`!; |
| 393 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "supportsD4Mode")) |
| 394 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_PACKET_MODE_YEScxx . . $ `src/main/print-escp2.h:297:9`!; |
| 395 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "hasInterchangeableInkCartridges")) |
| 396 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_INTERCHANGEABLE_INK_YEScxx . . $ `src/main/print-escp2.h:301:9`!; |
| 397 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "rollOnly")) |
| 398 | p->flagscxx . . $ escp2_printer#flags. |= MODEL_ROLL_ONLY_YEScxx . . $ `src/main/print-escp2.h:309:9`!; |
| 399 | else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(name, "resolutions")) |
| 400 | stpi_escp2_load_resolutionscxx . . $ stpi_escp2_load_resolutions(5eab70e4dd30e869).(v, filename, tmp); |
| 401 | } |
| 402 | } |
| 403 | tmp = tmp->nextcxx . . $ stp_mxml_node_s#next.; |
| 404 | } |
| 405 | stp_xml_free_parsed_filecxx . . $ stp_xml_free_parsed_file(6927777f14b5e2a1).(xmod); |
| 406 | return model; |
| 407 | } |
| 408 | |
| 409 | void |
| 410 | stpi_escp2_load_modelcxx . . $ stpi_escp2_load_model(199fed8b291d7d10).(const stp_vars_tcxx . . $ stp_vars_t# *v, int model) |
| 411 | { |
| 412 | char buf[MAXPATHLENcxx . . $ `<external>/1231830743887005719/param.h:48:10`!+1]; |
| 413 | stp_xml_initcxx . . $ stp_xml_init(49f6e7a06ebc5aa8).(); |
| 414 | snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, MAXPATHLENcxx . . $ `<external>/1231830743887005719/param.h:48:10`!, "escp2/model/model_%d.xml", model); |
| 415 | int model_id_from_file = load_model_from_filecxx . . $ load_model_from_file(6689a92679cc455f).(v, buf, 0); |
| 416 | stp_xml_exitcxx . . $ stp_xml_exit(49f6e7a06ebc5aa8).(); |
| 417 | STPI_ASSERTcxx . . $ `src/main/gutenprint-internal.h:58:9`!(model_id_from_file == model, v); |
| 418 | } |
| 419 | |
| 420 | stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t# * |
| 421 | stpi_escp2_get_printercxx . . $ stpi_escp2_get_printer(d94ed1084d556691).(const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 422 | { |
| 423 | int model = stp_get_model_idcxx . . $ stp_get_model_id(b1be75487ade2f93).(v); |
| 424 | STPI_ASSERTcxx . . $ `src/main/gutenprint-internal.h:58:9`!(model >= 0, v); |
| 425 | if (!escp2_model_capabilitiescxx . . $ escp2_model_capabilities.) |
| 426 | { |
| 427 | escp2_model_capabilitiescxx . . $ escp2_model_capabilities. = |
| 428 | stp_zalloccxx . . $ stp_zalloc(bfcfa4d6b7f7ef64).(sizeof(stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t#) * (model + 1)); |
| 429 | escp2_model_countcxx . . $ escp2_model_count. = model + 1; |
| 430 | } |
| 431 | else if (model >= escp2_model_countcxx . . $ escp2_model_count.) |
| 432 | { |
| 433 | escp2_model_capabilitiescxx . . $ escp2_model_capabilities. = |
| 434 | stp_realloccxx . . $ stp_realloc(417ab160f6baadc6).(escp2_model_capabilitiescxx . . $ escp2_model_capabilities., |
| 435 | sizeof(stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t#) * (model + 1)); |
| 436 | (void) memsetcxx . . $ memset(d1de1e4fb215f1c6).(escp2_model_capabilitiescxx . . $ escp2_model_capabilities. + escp2_model_countcxx . . $ escp2_model_count., 0, |
| 437 | sizeof(stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t#) * (model + 1 - escp2_model_countcxx . . $ escp2_model_count.)); |
| 438 | escp2_model_countcxx . . $ escp2_model_count. = model + 1; |
| 439 | } |
| 440 | if (!(escp2_model_capabilitiescxx . . $ escp2_model_capabilities.[model].activecxx . . $ escp2_printer#active.)) |
| 441 | { |
| 442 | stp_xml_initcxx . . $ stp_xml_init(49f6e7a06ebc5aa8).(); |
| 443 | escp2_model_capabilitiescxx . . $ escp2_model_capabilities.[model].activecxx . . $ escp2_printer#active. = 1; |
| 444 | stpi_escp2_load_modelcxx . . $ stpi_escp2_load_model(199fed8b291d7d10).(v, model); |
| 445 | stp_xml_exitcxx . . $ stp_xml_exit(49f6e7a06ebc5aa8).(); |
| 446 | } |
| 447 | return &(escp2_model_capabilitiescxx . . $ escp2_model_capabilities.[model]); |
| 448 | } |
| 449 | |
| 450 | model_featureset_tcxx . . $ model_featureset_t# |
| 451 | stpi_escp2_get_capcxx . . $ stpi_escp2_get_cap(4122c609e1af6136).(const stp_vars_tcxx . . $ stp_vars_t# *v, escp2_model_option_tcxx . . $ escp2_model_option_t# feature) |
| 452 | { |
| 453 | const stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t# *printdef = stpi_escp2_get_printercxx . . $ stpi_escp2_get_printer(d94ed1084d556691).(v); |
| 454 | model_featureset_tcxx . . $ model_featureset_t# featureset = |
| 455 | (((1ul << escp2_printer_attrscxx . . $ escp2_printer_attrs.[feature].bit_widthcxx . . $ $anonymous_type_de6362fe991af22e_0#bit_width.) - 1ul) << |
| 456 | escp2_printer_attrscxx . . $ escp2_printer_attrs.[feature].bit_shiftcxx . . $ $anonymous_type_de6362fe991af22e_0#bit_shift.); |
| 457 | return printdef->flagscxx . . $ escp2_printer#flags. & featureset; |
| 458 | } |
| 459 | |
| 460 | int |
| 461 | stpi_escp2_has_capcxx . . $ stpi_escp2_has_cap(c66a7aab328d5c81).(const stp_vars_tcxx . . $ stp_vars_t# *v, escp2_model_option_tcxx . . $ escp2_model_option_t# feature, |
| 462 | model_featureset_tcxx . . $ model_featureset_t# class) |
| 463 | { |
| 464 | const stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t# *printdef = stpi_escp2_get_printercxx . . $ stpi_escp2_get_printer(d94ed1084d556691).(v); |
| 465 | model_featureset_tcxx . . $ model_featureset_t# featureset = |
| 466 | (((1ul << escp2_printer_attrscxx . . $ escp2_printer_attrs.[feature].bit_widthcxx . . $ $anonymous_type_de6362fe991af22e_0#bit_width.) - 1ul) << |
| 467 | escp2_printer_attrscxx . . $ escp2_printer_attrs.[feature].bit_shiftcxx . . $ $anonymous_type_de6362fe991af22e_0#bit_shift.); |
| 468 | return ((printdef->flagscxx . . $ escp2_printer#flags. & featureset) == class); |
| 469 | } |