From 4205c5c5d1486afd945310e35612db975892ed25 Mon Sep 17 00:00:00 2001 From: Shiar Date: Fri, 26 Aug 2005 13:33:01 +0200 Subject: [PATCH] release 1.14pre1 --- 03_disp_slang.pm | 21 +++++++++++++++++---- 04_disp_curses.pm | 11 ++++++----- 35_unitconv.pm | 7 ++++--- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/03_disp_slang.pm b/03_disp_slang.pm index 6d8c62d..7bac3cc 100644 --- a/03_disp_slang.pm +++ b/03_disp_slang.pm @@ -1,5 +1,6 @@ # s-lang output for DCT, by Shiar +# 1.14.0 200508261255 - SIGWINCH handler to redraw on screen resize # 1.13.0 200411042100 - menu i/o functions # - refresh hook renamed to showall # 1.12.0 200411032145 - define main loop @@ -14,6 +15,12 @@ use Term::Slang qw(:all); use vars qw(%falias $path); require $path."termcommon.pm"; +sub setsize { + ($set{height}, $set{width}) = @_; + $set{height} -= 3; + $set{menushow} = int($set{width}/(4+$set{width}/20))+1; # menu items to show simultaneously +} # setsize + push @{$hook{init}}, sub { SLtt_get_terminfo and exit; SLang_init_tty(-1, 0, 1); @@ -22,10 +29,16 @@ push @{$hook{init}}, sub { END { SLsmg_reset_smg; SLang_reset_tty; } # shutdown display system + $SIG{WINCH} = sub { + #xxx: no signal until keypress? + setsize(SLtt_get_screen_size); # get new screen size + SLsmg_reinit_smg; # reinitialize to use new size + redraw(all=>1); # queue complete refresh + draw(); # redraw rightnow + }; # window change (resize) + # where are $SLtt_Screen_Rows and $SLtt_Screen_Cols? - ($set{height}, $set{width}) = SLtt_get_screen_size; - $set{height} -= 3; - $set{menushow} = int($set{width}/(4+$set{width}/20))+1; # menu items to show simultaneously + setsize(SLtt_get_screen_size); }; # init push @{$hook{showerror}}, sub { @@ -113,6 +126,6 @@ $hook{main} = sub { return { author => "Shiar", title => "slang output", - version => "1.13", + version => "1.14", }; diff --git a/04_disp_curses.pm b/04_disp_curses.pm index be3da3c..e99744f 100644 --- a/04_disp_curses.pm +++ b/04_disp_curses.pm @@ -1,5 +1,6 @@ # ncurses output for DCT, by Shiar +# 1.14.0 200508261248 - SIGWINCH handler to redraw on screen resize # 1.13.0 200411042100 - hook to display and handle menu # - submenus are named instead of numbered # - refresh hook renamed to showall @@ -33,11 +34,11 @@ push @{$hook{init}}, sub { $SIG{WINCH} = sub { endwin; - refresh; # setup for new screen size - setsize(); # adjust for new sizes + refresh; # setup for new screen size + setsize(); # adjust for new sizes redraw(all=>1); # queue complete refresh - draw(); # redraw rightnow - }; + draw(); # redraw rightnow + }; # window change (resize) setsize(); }; # init @@ -121,6 +122,6 @@ $hook{main} = sub { return { author => "Shiar", title => "curses output", - version => "1.13", + version => "1.14", }; diff --git a/35_unitconv.pm b/35_unitconv.pm index 2cb181f..a460774 100644 --- a/35_unitconv.pm +++ b/35_unitconv.pm @@ -1,5 +1,6 @@ # unit convertor for DCT, by Shiar +# 1.14.1 200701310504 - exact cd/dvd size # 1.14.0 200501261830 - units can have different offsets, so we can convert ^C/^F # 1.13.1 200501071420 - added cd/dvd sizes to data storage # 1.13.0 200411042100 - changed calls addmenu() and redraw() @@ -193,8 +194,8 @@ do { ['bit', 1/8, "bit/octet"], ['Mbit', 1024**2/8, "megabit"], ['LOC', 19e12, 'Library of Congress'], # est. 17-20TB - ['CD', 735e6, 'max CD-ROM data'], - ['DVD', 47e8, 'max DVD-ROM data'], + ['CD', 359_847*2048, 'max CD-ROM (700MB) data'], + ['DVD', 2_295_104*2048, 'max DVD-ROM data'], ], ); # units table @@ -223,6 +224,6 @@ push @{$hook{postentry}}, sub { return { author => "Shiar", title => "unit convertor", - version => "1.14", + version => "1.14.01", }; -- 2.30.0