aboutsummaryrefslogtreecommitdiffstats
path: root/com32/cmenu/libmenu
Commit message (Collapse)AuthorAgeFilesLines
* Fix all warnings, and better separate code that should not be mixedsyslinux-6.04-pre3H. Peter Anvin (Intel)2019-02-071-2/+2
| | | | | | | | | Clean up a number of warnings in the tree. Refactor especially the core code so we don't end up building a bunch of BIOS-specific code for EFI, and general build cleanups. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* com32sys_t inreg shall be zeroified prior intcallErwan Velu2014-01-221-0/+6
| | | | | | | | | | | As per commit f775e740a3a817a4ff5ba26bea99dbfd735456b3, inreg parameters of intcall() shall be zeroified. Having unclean inreg could trigger bad behaviors on some hosts. This patch is about adding memset() calls prior any intcall() : - some intcall didn't had any memset at all - some successive intcall() calls didn't memset inreg in between calls
* video.h: we need one syslinux_force_text_mode() prototypeMatt Fleming2013-07-261-0/+1
| | | | | | | | | Use the one from syslinux/video.h. This makes it easier to write unit tests for syslinux/load_linux.c without pulling in loads of core definitions from core/include/graphics.h. It can also be argued that syslinux_* symbols should have prototypes in syslinux/*.h files. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* cmenu: Delete __intcall()sMatt Fleming2012-11-271-45/+7
| | | | | | | | We can dynamically resolve our symbols and so we don't need to jump through __intcall(), which is deprecated anyway in favour of dynamic resolution. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* elflink: Replace __intcall() with direct function callsMatt Fleming2012-07-201-13/+9
| | | | | | | | There's no reason to use the COMBOOT API at all now that we can have any undefined symbols resolved at runtime - we can just access functions directly. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Delete all references to __com32.cs_bounceMatt Fleming2012-06-081-7/+18
| | | | | | | | | The COM32 cs_bounce buffer is not usable with ELF modules, as we're trying to move to an environment where memory is dynamically allocated. All users of __com32.cs_bounce have been converted to using lmalloc() to allocate low memory. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* cmenu: Rename menu.h to cmenu.hMatt Fleming2011-04-263-2/+2
| | | | | | | | | In preparation for moving com32/menu/menu.h to com32/include/ let's rename com32/cmenu/menu.h. This stops us having two header files named menu.h which would mean that we'd have to be super careful with our include paths to ensure we included the correct header. Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* com32/cmenu/libmenu/help.c: remove variables set but not usedH. Peter Anvin2011-03-161-4/+3
| | | | | | gcc 4.6 warns on variables set but not used, so remove them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* libmenu: Fix cursor on exit from showmenus()Gene Cumm2010-07-261-1/+1
| | | | | | | | | | This fixes the issue in hdt.c32 that Kent Robotti noticed where exiting directly from Menu Mode caused the cursor to not be displayed. This same issue also affects com32/cmenu/simple.c32 and probably others using showmenus(). Signed-off-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* com32: add proper sleep()/msleep() functions and make Lua use themH. Peter Anvin2010-07-052-13/+0
| | | | | | | Add proper sleep() and msleep() functions, which among other things call syslinux_idle(), and make Lua use them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* libmenu/des.c: fix signedness errorH. Peter Anvin2010-05-121-4/+3
| | | | | | | Fix a signedness error, which in turn was caused by needlessly complicated code. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* libmenu/passwords.h: function declaration isn't a prototypeH. Peter Anvin2010-05-121-1/+1
| | | | | | Make it a prototype Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* libmenu/syslnx.c: mark ipappend usedH. Peter Anvin2010-05-121-0/+2
| | | | | | Is this really correct?! Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* cmenu: clean up some () that should be (void)H. Peter Anvin2010-01-101-1/+1
| | | | | | | () is not a prototype, and means (...) not (void) in C. Replace with (void). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Change () prototypes to (void)H. Peter Anvin2010-01-062-9/+9
| | | | | | | | () means the same as (...) in C, not the same as (void) as it does in C++. It is generally misused to mean (void), though. Actually write what we mean... this is C, after all. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* cmenu: Increasing limitsErwan Velu2009-11-081-2/+2
| | | | | | | Impact: avoid memory corruption with hdt Some users reported systems with 89 pci devices. This case requires to increase theses values
* cmenu: reset the cursor position on shutdownPierre-Alexandre Meyer2009-11-011-0/+1
| | | | | | | | | | Reset the cursor at the top left corner of the screen when exiting the menu. This fixes odd behaviors when switching back and forth between CLI and menu in HDT. Closes: #14 Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: use ASCII characters for scrollbarsPierre-Alexandre Meyer2009-09-072-4/+3
| | | | | | | | | | Use ^ and v as hints for scrolling. Use \141 from the Special Characters and Line Drawing Character Set as the scrollbox. Note: printf "\016\141\017" doesn't seem to work well on xterm, although it does work on the vga console. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: redraw the current menu after exiting the keys_handlerPierre-Alexandre Meyer2009-09-071-0/+6
| | | | | | | | | | | | | | | After exiting the keys_handler, reset_ui() is not enough since it only resets the status line and title. The current menu needs to be redrawn. Note: only a submenu will be redrawn, not its parents. This means that not all the UI will be displayed after exiting the handler if invoked from whithin a submenu. We have already this problem nowadays when exiting a submenu of a submenu. The root parent is not redrawn, leading to some ugly states (the background color overrides part of the root menu). This will be fixed when we implement a real hierarchy (each submenu having access to its parents). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: optimize redraw to be fasterPierre-Alexandre Meyer2009-09-071-63/+118
| | | | | | | | | | cmenu currently redraws everything after each key press. This doesn't scale well, especially over serial. Instead, redraw only the previous/current selected entries. A full redraw is still needed when scrolling though. Misc.: add CTRL-L combo to force a redraw of the current menu. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: redraw menu when exiting keys_handlerPierre-Alexandre Meyer2009-09-071-12/+22
| | | | | | | The keys_handler can change the UI (e.g. the help system draws a black background by default). We need to redraw the background and title on exit. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: pad help filename with 0 instead of spacesPierre-Alexandre Meyer2009-09-071-1/+1
| | | | | | | | | | The manual states that the help filename format is hlp<NNNNN>.txt where <NNNNN> is the helpid. If the helpid contains less than 5 digits, pad with zero, not spaces, i.e. look for hlp00023.txt, not hlp 23.txt. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: remove obsolete com32io codePierre-Alexandre Meyer2009-09-062-14/+0
| | | | | | Remove legacy scrollupwindow definition and checkkbdbuf declaration. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: make the help menu actually workPierre-Alexandre Meyer2009-09-062-22/+39
| | | | | | | With the recent changes in cmenu, the help feature was completely broken. Fix it. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: use get_key library for keyboard functionsPierre-Alexandre Meyer2009-09-058-185/+92
| | | | | | | Syslinux already uses a get_key library to handle stdin. Let's leverage it. cmenu now works over serial completely. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: fill backgorund with printable characterPierre-Alexandre Meyer2009-09-052-5/+5
| | | | | | | To have a blue background on the console (serial), we need to fill the screen with a printable character (e.g. space). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: remove legacy CHABSATTR/CHRELATTR codePierre-Alexandre Meyer2009-09-051-3/+0
| | | | | | CHABSATTR and CHRELATTR have been replaced by SO/SI. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: remove legacy box drawing codePierre-Alexandre Meyer2009-09-054-81/+0
| | | | | | Lines are now printed via the Line Drawing Character Set. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: unify normal menu/radio menu handlingPierre-Alexandre Meyer2009-09-052-208/+42
| | | | | | | | | A lot of code was duplicated between regular and normal menus (menu printing and selection handling). This patch unifies this logic by adding an extra bool in printmenu() and getmenuoption() to distinguish between the two types of menus. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* 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>