"Fossies" - the Fresh Open Source Software Archive

Member "foomatic-db-engine-4.0-20221101/lib/Foomatic/UIElem.pm" (1 Nov 2022, 674 Bytes) of package /linux/misc/foomatic-db-engine-4.0-20221101.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "UIElem.pm" see the Fossies "Dox" file reference documentation.

    1 
    2 # TODO:
    3 # sort by section and process that way
    4 # order dep specific to particular options
    5 # UI constraints
    6 # various common non-UI options
    7 # PJL options?
    8 
    9 package Foomatic::UIElem;
   10 
   11 # Call with name=>foo, label=>Foo, type=>Boolean or PickOne or PickMany
   12 
   13 sub new {
   14     my ($type, %vals) = @_;
   15     return bless \%vals;
   16 }
   17 
   18 # default=>value
   19 # order_real=>value
   20 # order_section=>value
   21 # order_keyword=>value
   22 
   23 sub set {
   24     my ($this, $var, $val) = @_;
   25     $this->{$var} = $val;
   26 }
   27 
   28 
   29 sub add_option {
   30     my ($this, $option, $label, $ps) = @_;
   31 
   32     $ps =~ s!\r!!g;
   33 
   34     push (@{$this->{'options'}}, 
   35       {'option' => $option,
   36        'label' => $label,
   37        'snippet' => $ps});
   38 }
   39 
   40 
   41 1;