Skip to content
Snippets Groups Projects
Select Git revision
  • 3a736e693e5c567c008796345288f7e3ca416517
  • devel default
  • master
  • fo
  • jirka/typing
  • fo-base
  • mj/submit-images
  • jk/issue-96
  • jk/issue-196
  • honza/add-contestant
  • honza/mr7
  • honza/mrf
  • honza/mrd
  • honza/mra
  • honza/mr6
  • honza/submit-images
  • honza/kolo-vs-soutez
  • jh-stress-test-wip
  • shorten-schools
19 results

user_contest.html

Blame
  • 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,