File: UIElem.pm

package info (click to toggle)
foomatic-db-engine 4.0.13-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,176 kB
  • sloc: perl: 12,170; ansic: 6,958; python: 1,139; makefile: 248; sh: 215; xml: 83
file content (41 lines) | stat: -rw-r--r-- 674 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

# TODO:
# sort by section and process that way
# order dep specific to particular options
# UI constraints
# various common non-UI options
# PJL options?

package Foomatic::UIElem;

# Call with name=>foo, label=>Foo, type=>Boolean or PickOne or PickMany

sub new {
    my ($type, %vals) = @_;
    return bless \%vals;
}

# default=>value
# order_real=>value
# order_section=>value
# order_keyword=>value

sub set {
    my ($this, $var, $val) = @_;
    $this->{$var} = $val;
}


sub add_option {
    my ($this, $option, $label, $ps) = @_;

    $ps =~ s!\r!!g;

    push (@{$this->{'options'}}, 
	  {'option' => $option,
	   'label' => $label,
	   'snippet' => $ps});
}


1;