Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow printers to hard-wire values of options #2

Open
andreas-gruenbacher opened this issue Feb 10, 2020 · 0 comments
Open

Allow printers to hard-wire values of options #2

andreas-gruenbacher opened this issue Feb 10, 2020 · 0 comments

Comments

@andreas-gruenbacher
Copy link

I'm looking for a reasonable way to hard-wire the value of an option for a specific printer. For example, with the following shortened definition, I can define the default value of the option:

<option type="enum" id="opt/Resolution">
  <arg_longname><en>Resolution</en></arg_longname>
  <arg_shortname><en>Resolution</en></arg_shortname>
  <arg_execution> ... </arg_execution>
  <constraints>
    <constraint sense="true">
      <driver>driver</driver>
      <printer>printer</printer>
      <arg_defval>ev/300dpi</arg_defval>
    </constraint>
  </constraints>
  <enum_vals>
    <enum_val id="ev/300dpi">
      <ev_driverval>300</ev_driverval>
      ...
    </enum_val>
    <enum_val id="ev/600dpi">
      <ev_driverval>600</ev_driverval>
      ...
    </enum_val>
  </enum_vals>
</option>

If I add constraints on the enum_vals so that only a single option remains available for a printer, the option will disappear fro user interfaces and it will effectively be hard-wired.

However, for options that always have exactly one value for each supported printers, this still requires adding an enum for each possible choice, and some boilerplate code. It obviously doesn't work at all for options that have free values.

What I'd ideally like to do is to directly define the driverval, so something like <arg_val>300</arg_val> instead of <arg_defval>ev/300dpi</arg_defval>. Is there a way to do that already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant