GDS2

 view release on metacpan or  search on metacpan

Examples/gds2dump  view on Meta::CPAN

# cellStuff is one or more of:
# boundary:
# b{<layer> [dt<dataType>] xy(<xyList>)}
#
# path:
# p{<layer> [dt<dataType>] [pt<pathType>] [w<real>] [bx<real>] [ex<real>] xy(<xyList>)}
#
# text:
# t{<layer> [tt<textType>] [f<fontType>] [<textJust>] [pt<pathType>] [fx] [w<real>] [m<magification>] [a<angle>] xy(<xyList>) <'text'> }
#
# sref:
# s{<'cellName'> [fx] [a<angle>] xy(<xyList>)}
#
# aref:
# a{<'cellName'> [fx] [a<angle>] cr(<columns> <rows>) xy(<xyList>)}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# <textJust> two letter combination of bmt (bottom,middle,top) and rcl (right,center,left) e.g. bl (default is tl)
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# # as first character on a line is a comment
EOH

}

if (! $gui)
{
    ## take care of things we need from user that were not 
    ## supplied on command line
    if ($fileNameIn eq '')
    {
        my $notDone = 9; #limit for how many times we will ask
        while ($notDone)
        {
            printf("GDS2 file to read: ");
            $fileNameIn = <STDIN>;
            chomp $fileNameIn;
            $notDone = 0 if ($fileNameIn ne '');
        }
        printUsage() if ($fileNameIn eq '');
    }
    dumpGds($fileNameIn,$compact); 
}
else
{
    my @packList1 = (-side => 'left',  -padx => 0, -pady => 3, -fill => 'x');
    my @packList2 = (-side => 'left',  -padx => 3, -pady => 2, -fill => 'x');
    my @packList3 = (-side => 'top',   -padx => 0, -pady => 3, -fill => 'x');
    my @packList4 = (-side => 'right', -padx => 3, -pady => 3, -fill => 'x');
    my @packList5 = (-side => 'top',   -padx => 3, -pady => 3, -fill => 'x');

    #### create the MainWindow (MW)
    $MW = MainWindow -> new(
        -background => $BGCOLOR,
        -foreground => $FGCOLOR, 
    );
    $MW -> title('dumpgds'); 
    $MW -> iconname('dumpgds'); 
    $MW -> minsize(1, 1); 

    ###### start top menu bar #####
    my $wMenu = $MW -> Frame(
        -relief => 'raised', 
        -background => $BGCOLOR,
        -borderwidth => 2,
    );
    $wMenu -> pack(-fill => 'x');

    ##### options menu #####
    my $optionsMenu = $wMenu -> Menubutton(
        -activebackground => $BGCOLOR2,
        -background       => $BGCOLOR,
        -text             => 'Options', 
        -underline        => FALSE,
    );

    $optionsMenu -> separator(
        -background       => $BGCOLOR,
    );

    $optionsMenu -> radiobutton(
        -activebackground => $BGCOLOR, 
        -variable         => \$G_ECHO,
        -label            => 'Echo to terminal',
        -value            => TRUE,
    );

    $optionsMenu -> radiobutton(
        -activebackground => $BGCOLOR, 
        -variable         => \$G_ECHO,
        -label            => 'do not echo to terminal',
        -value            => FALSE,
    );

    ### quit
    $optionsMenu -> command(
        -activebackground => 'Red',
        -background       => $BGCOLOR,
        -label            => 'Exit',
        -command          => sub { $MW -> destroy; exit(1); },
    );
    $optionsMenu -> pack(-side=>'left');

    ##### Help menu #####
    my $textArea;
    my $helpMenu = $wMenu -> Menubutton(
        -text             => 'Help', 
        -activebackground => $BGCOLOR2,
        -background       => $BGCOLOR,
        -underline        => 0
    );
    $helpMenu -> command(
        -activebackground => $BGCOLOR2,
        -background       => $BGCOLOR,
        -label            => 'Program Version',
        -command          => sub {
            $textArea -> delete('0.0', 'end');
            $textArea -> insert('end', "dumpgds $VERSION\n");
            $textArea -> insert('end', "Using Perl $]\n");
        },
    );
    $helpMenu -> separator(
        -background       => $BGCOLOR,
    );
    $helpMenu -> command(
        -activebackground => $BGCOLOR2,
        -background       => $BGCOLOR,
        -label            => 'Print help in text window',
        -command          => sub { \&printUsage($textArea); },
        -activebackground => 'purple',
    );
    $helpMenu -> pack(-side=>'right');
    #### end top menu bar #####################################

    my $progress = $MW -> ProgressBar(
        -anchor => 'w',
        -width  => 20,
        -length => 400,
        -from   => 0,
        -to     => 98,
        -troughcolor => '#000000',
        -blocks => 20,
        -colors => [0 => 'red',14 => 'orange',28 => 'yellow',42 => 'green',56 => 'blue',70 => 'purple',84 => 'violet'],
        -resolution => 5,
        -variable => \$G_percentDone,
    );
    $progress -> pack();
    #$progress -> pack(@packList5);


    ##### Create file selection areas #### 
    ## Create Frame for left side 
    my $mwLeft = $MW -> Frame(
        -relief      => 'raised', 
        -background  => $BGCOLOR,
        -borderwidth => 2,
    );
    $mwLeft -> pack(@packList1); 

    $FileImg     = $mwLeft -> Pixmap(-file => Tk->findINC('file.xpm'));
    $TextFileImg = $mwLeft -> Pixmap(-file => Tk->findINC('textfile.xpm'));
    $FoldImg     = $mwLeft -> Pixmap(-file => Tk->findINC('folder.xpm'));
    $ActFoldImg  = $mwLeft -> Pixmap(-file => Tk->findINC('act_folder.xpm'));

    #### directory entry
    my $directoryLabel = $mwLeft -> Label( 
        -background  => $BGCOLOR,
        -text        => 'PWD:', 
        -font        => "-*-times-bold-r-normal--*-140-*-*-*-*-*-*", 
        -anchor      => 'w', 
    ); 
    $directoryLabel -> pack(@packList3); 

    my $G_DIRECTORY = ''; 
    my $entryDirectory = $mwLeft -> Entry( 
        -background     => '#cccccc', 
        -font           => "-*-courier-medium-r-normal--*-140-*-*-*-*-*-*", 
        -foreground     => $FGCOLOR, 
        -relief         => 'sunken', 
        -state          => 'disabled', 
        -textvariable   => \$G_DIRECTORY, 
        -width          => 20, 
    ); 
    $entryDirectory -> pack(@packList3); 
    my $localDir = cwd(); 
    $G_DIRECTORY=basename($localDir); 

    #### spacer label 
    my $spacerLabel_1 = $mwLeft -> Label( 
        -background => $BGCOLOR,
        -text       => '    ', 
        -font       => "-*-times-bold-r-normal--*-140-*-*-*-*-*-*", 



( run in 1.394 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )