Select Git revision
user_contest.html
-
Jan Prachař authoredJan Prachař authored
PPD.pm 11.52 KiB
package PPD;
use strict;
use warnings;
use Exporter 'import';
our @EXPORT = qw(define_group define_ui_group switch_group declare get set maybe_set option constrain gen_values fonts generate);
### PPD data model ###
### Keywords ###
# Key => {
# Key => key,
# Name => name, # descriptive name (default: same as Key)
# Mandatory => bool,
# Group => name,
#
# # For main keywords:
# Type => type, # q=quoted, i=invocation, s=string (unquoted), b=boolean
# Value => string,
# Values => list, # (if there are multiple values)
#
# # For option keywords:
# Type => 'o',
# Choice => choice, # for UI options: PickOne / PickMany / Boolean
# JCL => 1, # if this is a JCL option
# Section => sec, # OrderDependency section: ExitServer / Prolog / DocumentSetup /
# # PageSetup / JCLSetup (default if JCL=1) / AnySetup (default if JCL=0)
# Priority => pri, # OrderDependency priority, default = 100
# Values => [ # possible values (mandatory)
# { Key => key, # key (mandatory)
# Name => name, # descriptive name (default: same as Key)
# PS => string, # PS code invocation to emit
# String => string, # Unquoted string to emit instead of PS code
# Default => 1, # if this is the default value
# },
# ],
# Default => key, # default value if not marked inside Values
# Custom => [ # further values with custom parameters (mostly a CUPS extension)
# PS => string, # PS code invocation to emit (with parameters on the stack)
# Params => [ # list of parameters (mandatory)
# { Key => key, # key (mandatory)
# Name => name, # descriptive name (default: same as Key)
# Unit => unit, # unit: int / points / real / string / ...
# Min => min,
# Max => max,
# },
# ]
# ],
# }
my %keywords = ();
### Groups ###
# Key => {
# Key => key,
# UI => 1, # if a UI group
# Name => name, # descriptive name
# Keywords => [...] # list of keywords inside the group
# }
my %groups = ();
my @head_groups = ();
my @ui_groups = ();
my @nonui_groups = ();
my $current_group_key;
### Constraints ###
# {
# Name => name,
# Pairs => [{
# K1 => key,