OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [perl_gui/] [lib/] [perl/] [widget2.pl] - Diff between revs 48 and 54

Show entire file | Details | Blame | View Log

Rev 48 Rev 54
Line 18... Line 18...
 
 
 
 
use Gtk2::Pango;
use Gtk2::Pango;
#use Tk::Animation;
#use Tk::Animation;
 
 
our $FONT_SIZE;
our %glob_setting;
our $ICON_SIZE;
 
 
 
##############
##############
# combo box
# combo box
#############
#############
sub gen_combo{
sub gen_combo{
Line 376... Line 376...
 
 
 
 
sub get_icon_pixbuff{
sub get_icon_pixbuff{
    my $icon_file=shift;
    my $icon_file=shift;
        my $size;
        my $size;
    if ($ICON_SIZE eq 'default'){
    if ($glob_setting{'ICON_SIZE'} eq 'default'){
                my $font_size=get_defualt_font_size();
                my $font_size=get_defualt_font_size();
                $size=($font_size *2.5);
                $size=($font_size *2.5);
    }else{
    }else{
        $size = int ($ICON_SIZE);
        $size = int ($glob_setting{'ICON_SIZE'});
    }
    }
        my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file_at_scale($icon_file,$size,$size,FALSE);
        my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file_at_scale($icon_file,$size,$size,FALSE);
        return $pixbuf;
        return $pixbuf;
}
}
 
 
Line 817... Line 817...
        return ($box,$window);
        return ($box,$window);
 
 
}
}
 
 
 
 
 
sub get_default_screen {
 
  return Gtk2::Gdk::Screen->get_default();
 
 
 
 
sub max_win_size{
 
        my $screen =Gtk2::Gdk::Screen->get_default();
 
        my $hight = $screen->get_height();
 
        my $width = $screen->get_width();
 
        return ($width,$hight);
 
}
}
 
 
 
 
 
 
sub get_defualt_font_size{
sub get_defualt_font_size{
        return int($FONT_SIZE) if ($FONT_SIZE ne 'default');
        return int($glob_setting{'FONT_SIZE'}) if ($glob_setting{'FONT_SIZE'} ne 'default');
 
 
        my($width,$hight)=max_win_size();
        my($width,$hight)=max_win_size();
        #print "($width,$hight)\n";
        #print "($width,$hight)\n";
        my $font_size=($width>=1600)? 10:
        my $font_size=($width>=1600)? 10:
                              ($width>=1400)? 9:
                              ($width>=1400)? 9:
                                  ($width>=1200)? 9:
                                  ($width>=1200)? 9:
                                  ($width>=1000)? 7:6;
                                  ($width>=1000)? 8:7;
        #print "$font_size\n";  
        #print "$font_size\n";  
        return $font_size;
        return $font_size;
}
}
 
 
 
 
Line 2045... Line 2039...
sub run_cmd_in_back_ground_get_stdout
sub run_cmd_in_back_ground_get_stdout
{
{
        my $cmd=shift;
        my $cmd=shift;
        my $exit;
        my $exit;
        my ($stdout, $stderr);
        my ($stdout, $stderr);
 
        STDOUT->flush();
 
        STDERR->flush();
        capture { $exit=run_cmd_in_back_ground($cmd) } \$stdout, \$stderr;
        capture { $exit=run_cmd_in_back_ground($cmd) } \$stdout, \$stderr;
        return ($stdout,$exit,$stderr);
        return ($stdout,$exit,$stderr);
 
 
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.