menu.4th (257650) | menu.4th (280924) |
---|---|
1\ Copyright (c) 2003 Scott Long <scottl@freebsd.org> | 1\ Copyright (c) 2003 Scott Long <scottl@FreeBSD.org> |
2\ Copyright (c) 2003 Aleksander Fafula <alex@fafula.com> | 2\ Copyright (c) 2003 Aleksander Fafula <alex@fafula.com> |
3\ Copyright (c) 2006-2013 Devin Teske <dteske@FreeBSD.org> | 3\ Copyright (c) 2006-2015 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: 9\ 1. Redistributions of source code must retain the above copyright 10\ notice, this list of conditions and the following disclaimer. 11\ 2. Redistributions in binary form must reproduce the above copyright --- 7 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\ | 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: 9\ 1. Redistributions of source code must retain the above copyright 10\ notice, this list of conditions and the following disclaimer. 11\ 2. Redistributions in binary form must reproduce the above copyright --- 7 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 257650 2013-11-04 20:28:10Z dteske $ | 27\ $FreeBSD: head/sys/boot/forth/menu.4th 280924 2015-03-31 22:32:35Z 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. --- 16 unchanged lines hidden (view full) --- 52variable menuidx \ Menu item stack for number prefixes 53variable menurow \ Menu item stack for positioning 54variable menubllt \ Menu item bullet 55 56\ Menu Positioning 57variable menuX \ Menu X offset (columns) 58variable menuY \ Menu Y offset (rows) 59 | 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. --- 16 unchanged lines hidden (view full) --- 52variable menuidx \ Menu item stack for number prefixes 53variable menurow \ Menu item stack for positioning 54variable menubllt \ Menu item bullet 55 56\ Menu Positioning 57variable menuX \ Menu X offset (columns) 58variable menuY \ Menu Y offset (rows) 59 |
60\ Menu-item key association/detection | 60\ Menu-item elements |
61variable menukey1 62variable menukey2 63variable menukey3 64variable menukey4 65variable menukey5 66variable menukey6 67variable menukey7 68variable menukey8 --- 70 unchanged lines hidden (view full) --- 139 dup 32 = ( c -- c bool ) \ [sp] space 140 over 9 = or ( c bool -- c bool ) \ [ht] horizontal tab 141 over 10 = or ( c bool -- c bool ) \ [nl] newline 142 over 13 = or ( c bool -- c bool ) \ [cr] carriage return 143 over [char] , = or ( c bool -- c bool ) \ comma 144 swap drop ( c bool -- bool ) \ return boolean 145; 146 | 61variable menukey1 62variable menukey2 63variable menukey3 64variable menukey4 65variable menukey5 66variable menukey6 67variable menukey7 68variable menukey8 --- 70 unchanged lines hidden (view full) --- 139 dup 32 = ( c -- c bool ) \ [sp] space 140 over 9 = or ( c bool -- c bool ) \ [ht] horizontal tab 141 over 10 = or ( c bool -- c bool ) \ [nl] newline 142 over 13 = or ( c bool -- c bool ) \ [cr] carriage return 143 over [char] , = or ( c bool -- c bool ) \ comma 144 swap drop ( c bool -- bool ) \ return boolean 145; 146 |
147\ Forth variables |
|
147: menukeyN ( N -- ADDR ) s" menukeyN" 7 +c! evaluate ; 148: init_stateN ( N -- ADDR ) s" init_stateN" 10 +c! evaluate ; 149: toggle_stateN ( N -- ADDR ) s" toggle_stateN" 12 +c! evaluate ; 150: cycle_stateN ( N -- ADDR ) s" cycle_stateN" 11 +c! evaluate ; 151: init_textN ( N -- C-ADDR ) s" init_textN" 9 +c! evaluate ; 152 | 148: menukeyN ( N -- ADDR ) s" menukeyN" 7 +c! evaluate ; 149: init_stateN ( N -- ADDR ) s" init_stateN" 10 +c! evaluate ; 150: toggle_stateN ( N -- ADDR ) s" toggle_stateN" 12 +c! evaluate ; 151: cycle_stateN ( N -- ADDR ) s" cycle_stateN" 11 +c! evaluate ; 152: init_textN ( N -- C-ADDR ) s" init_textN" 9 +c! evaluate ; 153 |
154\ Environment variables |
|
153: kernel[x] ( N -- C-ADDR/U ) s" kernel[x]" 7 +c! ; 154: menu_init[x] ( N -- C-ADDR/U ) s" menu_init[x]" 10 +c! ; 155: menu_command[x] ( N -- C-ADDR/U ) s" menu_command[x]" 13 +c! ; 156: menu_caption[x] ( N -- C-ADDR/U ) s" menu_caption[x]" 13 +c! ; 157: ansi_caption[x] ( N -- C-ADDR/U ) s" ansi_caption[x]" 13 +c! ; 158: menu_keycode[x] ( N -- C-ADDR/U ) s" menu_keycode[x]" 13 +c! ; 159: toggled_text[x] ( N -- C-ADDR/U ) s" toggled_text[x]" 13 +c! ; 160: toggled_ansi[x] ( N -- C-ADDR/U ) s" toggled_ansi[x]" 13 +c! ; --- 448 unchanged lines hidden (view full) --- 609 else 610 -rot FALSE 611 then 612 until 613 2drop ( x y -- ) 614; 615 616\ This function creates the list of menu items. This function is called by the | 155: kernel[x] ( N -- C-ADDR/U ) s" kernel[x]" 7 +c! ; 156: menu_init[x] ( N -- C-ADDR/U ) s" menu_init[x]" 10 +c! ; 157: menu_command[x] ( N -- C-ADDR/U ) s" menu_command[x]" 13 +c! ; 158: menu_caption[x] ( N -- C-ADDR/U ) s" menu_caption[x]" 13 +c! ; 159: ansi_caption[x] ( N -- C-ADDR/U ) s" ansi_caption[x]" 13 +c! ; 160: menu_keycode[x] ( N -- C-ADDR/U ) s" menu_keycode[x]" 13 +c! ; 161: toggled_text[x] ( N -- C-ADDR/U ) s" toggled_text[x]" 13 +c! ; 162: toggled_ansi[x] ( N -- C-ADDR/U ) s" toggled_ansi[x]" 13 +c! ; --- 448 unchanged lines hidden (view full) --- 611 else 612 -rot FALSE 613 then 614 until 615 2drop ( x y -- ) 616; 617 618\ This function creates the list of menu items. This function is called by the |
617\ menu-display function. You need not be call it directly. | 619\ menu-display function. You need not call it directly. |
618\ 619: menu-create ( -- ) 620 621 \ Print the frame caption at (x,y) 622 s" loader_menu_title" getenv dup -1 = if 623 drop s" Welcome to FreeBSD" 624 then 625 TRUE ( use default alignment ) --- 660 unchanged lines hidden --- | 620\ 621: menu-create ( -- ) 622 623 \ Print the frame caption at (x,y) 624 s" loader_menu_title" getenv dup -1 = if 625 drop s" Welcome to FreeBSD" 626 then 627 TRUE ( use default alignment ) --- 660 unchanged lines hidden --- |