menu.4th (241523) | menu.4th (242667) |
---|---|
1\ Copyright (c) 2003 Scott Long <scottl@freebsd.org> 2\ Copyright (c) 2003 Aleksander Fafula <alex@fafula.com> 3\ Copyright (c) 2006-2012 Devin Teske <dteske@FreeBSD.org> 4\ All rights reserved. 5\ 6\ Redistribution and use in source and binary forms, with or without 7\ modification, are permitted provided that the following conditions 8\ are met: --- 10 unchanged lines hidden (view full) --- 19\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25\ SUCH DAMAGE. 26\ | 1\ Copyright (c) 2003 Scott Long <scottl@freebsd.org> 2\ Copyright (c) 2003 Aleksander Fafula <alex@fafula.com> 3\ Copyright (c) 2006-2012 Devin Teske <dteske@FreeBSD.org> 4\ All rights reserved. 5\ 6\ Redistribution and use in source and binary forms, with or without 7\ modification, are permitted provided that the following conditions 8\ are met: --- 10 unchanged lines hidden (view full) --- 19\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25\ SUCH DAMAGE. 26\ |
27\ $FreeBSD: head/sys/boot/forth/menu.4th 241523 2012-10-14 06:52:49Z dteske $ | 27\ $FreeBSD: head/sys/boot/forth/menu.4th 242667 2012-11-06 19:26:36Z dteske $ |
28 29marker task-menu.4th 30 31\ Frame drawing 32include /boot/frames.4th 33 34f_double \ Set frames to double (see frames.4th). Replace with 35 \ f_single if you want single frames. --- 452 unchanged lines hidden (view full) --- 488 else 489 drop 490 then 491 then 492 493 \ Initialize "Reboot" menu state variable (prevents double-entry) 494 false menurebootadded ! 495 | 28 29marker task-menu.4th 30 31\ Frame drawing 32include /boot/frames.4th 33 34f_double \ Set frames to double (see frames.4th). Replace with 35 \ f_single if you want single frames. --- 452 unchanged lines hidden (view full) --- 488 else 489 drop 490 then 491 then 492 493 \ Initialize "Reboot" menu state variable (prevents double-entry) 494 false menurebootadded ! 495 |
496 menu_start 497 1- menuidx ! \ Initialize the starting index for the menu 498 0 menurow ! \ Initialize the starting position for the menu 499 |
|
496 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8') 497 begin 498 \ If the "Options:" separator, print it. 499 dup menuoptions @ = if 500 \ Optionally add a reboot option to the menu 501 s" menu_reboot" getenv -1 <> if 502 drop 503 s" Reboot" printmenuitem menureboot ! --- 332 unchanged lines hidden (view full) --- 836 \ Boot if the user pressed Enter/Ctrl-M (13) or 837 \ Ctrl-Enter/Ctrl-J (10) 838 dup over 13 = swap 10 = or if 839 drop ( no longer needed ) 840 s" boot" evaluate 841 exit ( pedantic; never reached ) 842 then 843 | 500 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8') 501 begin 502 \ If the "Options:" separator, print it. 503 dup menuoptions @ = if 504 \ Optionally add a reboot option to the menu 505 s" menu_reboot" getenv -1 <> if 506 drop 507 s" Reboot" printmenuitem menureboot ! --- 332 unchanged lines hidden (view full) --- 840 \ Boot if the user pressed Enter/Ctrl-M (13) or 841 \ Ctrl-Enter/Ctrl-J (10) 842 dup over 13 = swap 10 = or if 843 drop ( no longer needed ) 844 s" boot" evaluate 845 exit ( pedantic; never reached ) 846 then 847 |
848 dup menureboot @ = if 0 reboot then 849 |
|
844 \ Evaluate the decimal ASCII value against known menu item 845 \ key associations and act accordingly 846 847 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8') 848 begin 849 s" menukeyN @" 850 851 \ replace 'N' with current iteration --- 75 unchanged lines hidden (view full) --- 927 then 928 then 929 then 930 931 1+ dup 56 > \ increment iterator 932 \ continue if less than 57 933 until 934 drop \ loop iterator | 850 \ Evaluate the decimal ASCII value against known menu item 851 \ key associations and act accordingly 852 853 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8') 854 begin 855 s" menukeyN @" 856 857 \ replace 'N' with current iteration --- 75 unchanged lines hidden (view full) --- 933 then 934 then 935 then 936 937 1+ dup 56 > \ increment iterator 938 \ continue if less than 57 939 until 940 drop \ loop iterator |
941 drop \ key pressed |
|
935 | 942 |
936 menureboot @ = if 0 reboot then 937 | |
938 again \ Non-operational key was pressed; repeat 939; 940 941\ This function unsets all the possible environment variables associated with 942\ creating the interactive menu. 943\ 944: menu-unset ( -- ) 945 --- 54 unchanged lines hidden (view full) --- 1000 s" 0 menukeyN !" \ basename for key association var 1001 -rot 2dup 9 + c! rot \ replace 'N' with current iteration 1002 evaluate \ assign zero (0) to key assoc. var 1003 1004 s" 0 init_stateN !" \ used by menu-create 1005 -rot 2dup 12 + c! rot \ replace 'N' 1006 evaluate 1007 | 943 again \ Non-operational key was pressed; repeat 944; 945 946\ This function unsets all the possible environment variables associated with 947\ creating the interactive menu. 948\ 949: menu-unset ( -- ) 950 --- 54 unchanged lines hidden (view full) --- 1005 s" 0 menukeyN !" \ basename for key association var 1006 -rot 2dup 9 + c! rot \ replace 'N' with current iteration 1007 evaluate \ assign zero (0) to key assoc. var 1008 1009 s" 0 init_stateN !" \ used by menu-create 1010 -rot 2dup 12 + c! rot \ replace 'N' 1011 evaluate 1012 |
1013 s" 0 toggle_stateN !" \ used by toggle_menuitem 1014 -rot 2dup 14 + c! rot \ replace 'N' 1015 evaluate 1016 1017 s" 0 cycle_stateN !" \ used by cycle_menuitem 1018 -rot 2dup 13 + c! rot \ replace 'N' 1019 evaluate 1020 1021 s" 0 init_textN c!" \ used by toggle_menuitem 1022 -rot 2dup 11 + c! rot \ replace 'N' 1023 evaluate 1024 |
|
1008 1+ dup 56 > \ increment, continue if less than 57 1009 until 1010 drop \ iterator 1011 1012 \ unset the timeout command 1013 s" menu_timeout_command" unsetenv 1014 1015 \ clear the "Reboot" menu option flag --- 68 unchanged lines hidden --- | 1025 1+ dup 56 > \ increment, continue if less than 57 1026 until 1027 drop \ iterator 1028 1029 \ unset the timeout command 1030 s" menu_timeout_command" unsetenv 1031 1032 \ clear the "Reboot" menu option flag --- 68 unchanged lines hidden --- |