aboutsummaryrefslogtreecommitdiffstats
path: root/com32/cmenu/libmenu
Commit message (Collapse)AuthorAgeFilesLines
* cmenu: turn off auto wrapPierre-Alexandre Meyer2009-09-041-0/+4
| | | | | | | | Auto wrap made the menu scroll because of the status line (when printing the last character of the bottom right of the screen, the ansicon scrolled the whole menu). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* Merge commit 'origin/libansi' into cmenu-videoPierre-Alexandre Meyer2009-09-042-159/+1
|\
| * cmenu: switch to libansiPierre-Alexandre Meyer2009-09-012-159/+1
| | | | | | | | | | | | Make cmenu use libansi. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* | cmenu: use printf instead of csprint with default attributePierre-Alexandre Meyer2009-09-031-3/+3
| | | | | | | | | | | | | | We don't change the attribute in the help screen. Refactor the code to simply use printf. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* | cmenu: use putchar instead of putch when using default attributePierre-Alexandre Meyer2009-09-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | There is no real need to do putch('x', 0x07), 0x07 being the default VGA attribute. Use putchar instead. Note that showhelp will trigger a drawbox first with 0x07 as attribute. Since we don't update the attribute, it is guaranteed to still be 0x07 when invoking putch. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* | cmenu: use getscreensize to access number of rows/columnsPierre-Alexandre Meyer2009-09-034-669/+667
|/ | | | | | | | | The simple menu system already uses getscreensize. Another step towards unification. Impact: exported getnumcols and getnumrows are now deprecated. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: reset attributes instead of using ANSI sequence 22Pierre-Alexandre Meyer2009-09-011-6/+5
| | | | | | | | | | | | hpa advised not to use ANSI sequence 22, as it may not work everywhere. Instead, let's reset attributes and set last_attr to unknown. The next background/foreground tests are then guaranteed to fire. We take a small hit in terms of performance though. Misc.: change initialization of last_attr to 0x300 (unknown) to trigger properly the tests the first time. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: fix background colorPierre-Alexandre Meyer2009-09-011-1/+5
| | | | | | | | | | The menu highlights some characters to mark them as key shortcuts. To switch the bold attribute off, we were printing the reset code, resetting the background color in the same time. Use ANSI sequence 22 instead. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: use 80x25 as terminal size by defaultPierre-Alexandre Meyer2009-09-011-2/+2
| | | | | | | | | Let's not rely on the geometry returned by the BIOS for the terminal size - we don't know anything about the one used via serial. We now default to 80x25, regardless of what the BIOS returns. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: misc. cleanupsPierre-Alexandre Meyer2009-09-012-4/+11
| | | | | | Fix a compiler warning and a header documentation. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: remove multi pages supportPierre-Alexandre Meyer2009-09-016-179/+158
| | | | | | | | | | The cmenu used to display the help on a separate page. Since we can't have multi pages on the serial line, get rid of them completely. This has a fairly big impact as the external cmenu API has changed. adv_menu.tpl and HDT have been patched accordingly. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: use < for menu exit characterPierre-Alexandre Meyer2009-09-011-1/+1
| | | | | | Use plain '<' as the "back" symbol. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: fix menu separatorsPierre-Alexandre Meyer2009-09-015-59/+40
| | | | | | | | Use the alternate character set to draw horizontal lines (menu separator). Refactor the c*print functions in the same time as they were severely broken. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: use > instead of » for submenusPierre-Alexandre Meyer2009-09-013-9/+11
| | | | | | | | | » doesn't exist in the alternate character set. Use plain > instead. Misc.: fix SO/SI invocation, putchar takes a char, fputs a string. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: remove extra getboxchars callPierre-Alexandre Meyer2009-09-011-2/+0
| | | | | | getboxchars is not used anymore in drawbox. Let's get rid of it. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: build cleanupsPierre-Alexandre Meyer2009-09-011-7/+1
| | | | | | Fix build warnings and remove old cls declaration. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: refactor cswprint functionPierre-Alexandre Meyer2009-09-011-26/+1
| | | | | | Now that cprint is smarter, cswprint can be simplified. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: refactor printmenuitem functionPierre-Alexandre Meyer2009-09-011-38/+17
| | | | Simplify the printmenuitem function, now that putch is smarter.
* cmenu: refactor beep functionPierre-Alexandre Meyer2009-09-012-10/+6
| | | | | | Use \007 to make the system beep. Note "\007" works, but not '\007'. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: refactor cprint functionsPierre-Alexandre Meyer2009-09-011-13/+2
| | | | | | | | | Some refactoring: * Make cprint_vga2ansi static, as it is an internal function. * Simplify the logic in cprint(). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: use VT-100 alternate character set for drawing boxesPierre-Alexandre Meyer2009-09-012-14/+36
| | | | | | | | | | | | Use the Special Characters and Line Drawing Character Set as described in http://www.vt100.net/docs/vt102-ug/table5-13.html to draw boxes around the menus. Note that to work in xterm, G1 needs to be initialized (to point to the alternate character set). This is done in the cls function ("\033)0"). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: remove unused bit_reverse functionPierre-Alexandre Meyer2009-09-011-10/+0
| | | | | | | Not needed anymore: we use a lookup table (ansi_char) in cprint_vga2ansi now to reverse Background and Foreground bits.. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: better implementation of vga->ansiPierre-Alexandre Meyer2009-09-011-20/+39
| | | | | | | hpa suggested a better implementation, that also fixes some color issues and invalid ANSI codes. Thanks hpa! Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: implement cprint using printfPierre-Alexandre Meyer2009-09-011-6/+51
| | | | | | | | | | | First step towards a usable menu. Color is now sent over serial. Testing Done: launched HDT over serial. The background got drawn blue, as expected. Note: vga attributes need to be converted to ansi codes. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: remove unused getchar functionPierre-Alexandre Meyer2009-09-011-7/+0
| | | | | | char getchar(void) doesn't seem to be used. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: implement scrollup using SU escape sequencePierre-Alexandre Meyer2009-09-011-1/+1
| | | | | | Use the ANSI SU - Scroll Up escape sequence to scrollup the window. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: implement gotoxy using escape sequencesPierre-Alexandre Meyer2009-09-013-9/+12
| | | | | | | | | | | Use ansicon and the ANSI CUP - CUrsor Position escape sequence to implement the gotoxy function. Note: page switching is not supported (yet). Testing Done: ran com32/cmenu/test.c32 in qemu. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* Merge commit 'hpa/master' into for-erwanPierre-Alexandre Meyer2009-08-0415-2599/+2740
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: com32/cmenu/libmenu/com32io.h com32/gplinclude/dmi/dmi.h com32/gplinclude/dmi/dmi_base_board.h com32/gplinclude/dmi/dmi_memory.h com32/gplinclude/dmi/dmi_system.h com32/gpllib/dmi/dmi.c com32/gpllib/dmi/dmi_memory.c com32/include/sys/pci.h com32/lib/pci/scan.c com32/modules/Makefile Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
| * Run Nindent on com32/cmenu/libmenu/tui.hH. Peter Anvin2009-05-291-14/+13
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/tui.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/tui.cH. Peter Anvin2009-05-291-258/+292
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/tui.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/syslnx.hH. Peter Anvin2009-05-291-4/+4
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/syslnx.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/syslnx.cH. Peter Anvin2009-05-291-48/+53
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/syslnx.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/scancodes.hH. Peter Anvin2009-05-291-1/+1
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/scancodes.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/passwords.hH. Peter Anvin2009-05-291-8/+8
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/passwords.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/passwords.cH. Peter Anvin2009-05-291-90/+109
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/passwords.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/menu.hH. Peter Anvin2009-05-291-121/+129
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/menu.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/menu.cH. Peter Anvin2009-05-291-982/+1070
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/menu.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/help.hH. Peter Anvin2009-05-291-4/+4
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/help.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/help.cH. Peter Anvin2009-05-291-150/+171
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/help.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/des.hH. Peter Anvin2009-05-291-1/+1
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/des.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/des.cH. Peter Anvin2009-05-291-825/+789
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/des.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/com32io.hH. Peter Anvin2009-05-291-30/+31
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/com32io.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Run Nindent on com32/cmenu/libmenu/com32io.cH. Peter Anvin2009-05-291-64/+66
| | | | | | | | | | | | | | | | | | Automatically reformat com32/cmenu/libmenu/com32io.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | cmenu: fixing getnumrows valuesErwan Velu2009-04-291-1/+1
|/ | | | | | Impact: Allow users to use 25 lines instead of 24 Prior to that commit it was impossible to setup a 25 lines menu
* menu: Increasing the maximum number of menusErwan Velu2009-03-241-1/+1
| | | | | | Impact: some hosts can generate many menus when used with hdt In some cases, we can run out of menus
* Move complex menu to com32/cmenu; clean up the MakefilesH. Peter Anvin2009-03-0215-0/+4057
Move the complex menu system into the com32 directory so it can be sequenced properly with respect to hdt (it needs to be built after com32/lib but before com32/hdt). While we're at it, clean up the Makefiles somewhat.