release 1.14pre1 master
authorShiar <shiar@shiar.org>
Fri, 26 Aug 2005 11:33:01 +0000 (13:33 +0200)
committerShiar <shiar@shiar.org>
Thu, 10 Jul 2008 19:25:31 +0000 (21:25 +0200)
03_disp_slang.pm
04_disp_curses.pm
35_unitconv.pm

index 6d8c62d8fe2acafbaaa10a2a7e7639b6e019749f..7bac3ccc180e6b544ed2ef6d34f54b671e5e748f 100644 (file)
@@ -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",
 };
 
index be3da3c0396e06598b5e12944b39c112c913c7cb..e99744f4e3839871007d48126be76e1eeff5ebd6 100644 (file)
@@ -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",
 };
 
index 2cb181f6067623bcdc1a572ba06438198502c712..a460774023b86fbfde52887c4f1c601805f7f1e2 100644 (file)
@@ -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",
 };