summaryrefslogtreecommitdiff
path: root/com32/cmenu
Commit message (Collapse)AuthorAgeFilesLines
* Makefile: Move Makefile fragments into mk/Matt Fleming2011-04-071-2/+3
| | | | | | | | | | | | | | | | | | Move the MCONFIG files into a mk/ directory and give them more descriptive names. This is purely a cosmetic change to make the 'include' directives a bit more coherent by making it obvious exactly which MCONFIG file we're including. For example, in com32/lua/src/Makefile we exchange the line, include ../../MCONFIG for the much more comprehensible, include $(MAKEDIR)/com32.mk Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* com32/cmenu/adv_menu.tpl: Use the proper value for ipappendH. Peter Anvin2011-03-161-1/+1
| | | | | | | | If x is NULL, we're supposed to pass 0 for ipappend; this was incorrect in the template and the gcc 4.6 unused variable warning caught it. Signed-off-by: H. Peter Anvin <hpa@zytor.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>
* cmenu: remove obsolete Makefile rulessyslinux-4.00-pre42H. Peter Anvin2010-05-121-15/+0
| | | | | | | Remove Makefile rules which were both redundant (../MCONFIG contains the rules in a central manner) and just plain wrong. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* adv_menu.tpl: fix type of login_handler()H. Peter Anvin2010-05-121-1/+3
| | | | | | Fix the type of the login_handler() function. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* complex.c: fix warningsH. Peter Anvin2010-05-121-0/+4
| | | | | | Clean up warnings, even though this is sample code. Signed-off-by: H. Peter Anvin <hpa@linux.intel.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: Fixing login_handler prototypeErwan Velu2010-05-121-1/+1
| | | | | login_handler have to follow the (t_menusystem * ms, t_menuitem * mi) prototype defined by t_handler_return
* cmenu: clean up some () that should be (void)H. Peter Anvin2010-01-103-4/+4
| | | | | | | () 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-063-10/+10
| | | | | | | | () 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: do not invoke help if helpid is 0xFFFF (complex.c)Pierre-Alexandre Meyer2009-09-071-1/+1
| | | | | | 0xFFFF is invalid (no help) 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: force refresh after checkbox_handler in complex.cPierre-Alexandre Meyer2009-09-071-1/+6
| | | | | | | | complex.c has a special checkbox_handler that disables mutual exclusive entries. This works today because each key press triggers a redraw of the whole menu. We can't rely on this if we want to optimize the redraw. 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: fix handlers signature in the examplesPierre-Alexandre Meyer2009-09-052-3/+3
| | | | | | | | | The keys handler accepts three arguments: the current menu system, the current menu entry and the key pressed. Misc: fix timeout in complex.c to actually be 10 seconds. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: use get_key library for keyboard functionsPierre-Alexandre Meyer2009-09-0510-211/+99
| | | | | | | 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: fix Login/Password and Kernel Arguments lines (complex.c)Pierre-Alexandre Meyer2009-09-051-7/+9
| | | | | | | | | | | Update the cmenu example complex.c to use clear_line(): cprint behavior has changed w.r.t. cursor positioning (it is automatically advanced now). Note: need to reset the colors before clearing the line since the status bar is printed just before the Kernel Arguments line and it changes the background color. 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-036-680/+702
|/ | | | | | | | | 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-018-212/+191
| | | | | | | | | | 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.