aboutsummaryrefslogtreecommitdiffstats
path: root/curses.c
AgeCommit message (Collapse)AuthorFilesLines
2010-03-21Revert 'Fix build'Blue Swirl1-1/+1
Partially revert 80a1ab598c6960e7a941e38c5d8638c532c585c3. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21Revert "Convert atexit users to exit_notifier"Anthony Liguori1-2/+1
This reverts commit d7234f4d7e373a708e1df9ab565a71b71b189025. Conflicts: hw/xen_machine_pv.c This should have never been committed. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-20Fix buildBlue Swirl1-6/+1
CC curses.o cc1: warnings being treated as errors /src/qemu/curses.c: In function 'curses_display_init': /src/qemu/curses.c:341: error: initialization from incompatible pointer type Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-19Convert atexit users to exit_notifierAnthony Liguori1-1/+2
All of these users have global state so we really don't see a benefit from exit_notifier. However, using exit_notifier means that there's one less justification for having global state in the first place. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-06Fix curses interaction with keymapsSamuel Thibault1-45/+44
The combination of keymap support (-k option) and curses is currently very broken. The patch below fixes it by first extending keymap support to interpret the shift, ctrl, altgr and addupper keywords in keymaps, and to fix curses into properly using keymaps. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2009-10-01Revert "Get rid of _t suffix"Anthony Liguori1-2/+2
In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01Get rid of _t suffixmalc1-2/+2
Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
2009-09-15curses: save 250MB of memoryAurelien Jarno1-3/+0
Don't call curses_resize() at the end of curses_display_init() as height and width are not yet defined. It will be called later by code from vl.c. This save 250MB of memory when using -curses. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-07-31Fix Sparse warnings: "Using plain integer as NULL pointer"Blue Swirl1-1/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-03-13DisplayAllocator interface (Stefano Stabellini)aliguori1-1/+1
Hi all, this patch adds a DisplayAllocator interface that allows display frontends (sdl in particular) to provide a preallocated display buffer for the graphical backend to use. Whenever a graphical backend cannot use qemu_create_displaysurface_from because its own internal pixel format cannot be exported directly (text mode or graphical mode with color depth 8 or 24), it creates another display buffer in memory using qemu_create_displaysurface and does the conversion. This new buffer needs to be blitted into the sdl surface buffer every time we need to update portions of the screen. We can avoid this using the DisplayAllocator interace: sdl provides its own implementation of qemu_create_displaysurface, giving back the sdl surface buffer directly (as we used to do before the DisplayState changes). Since the buffer returned by sdl could be in bgr format we need to put back in the handlers of that case. This approach is good if the two following conditions are true: 1) the sdl surface is a software surface that resides in main memory; 2) the host display color depth is either 16 or 32 bpp. If first condition is false we can have bad performances using sdl and vnc together. If the second condition is false performances are certainly not going to improve but they shouldn't get worse either. The first condition is always true, at least on linux/X11 systems; but I believe is true also on other platforms. The second condition is true in the vast majority of the cases. This patch should also have the good side effect of solving the sdl 2D slowness malc was reporting on MacOS, because SDL_BlitSurface is not going to be called anymore when the guest is in text mode or 24bpp. However the root problem is still present so I suspect we may still see some slowness on MacOS when the guest is in 32 or 16 bpp. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6839 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-07Sparse fixes: NULL use, header order, ANSI prototypes, staticblueswir11-5/+4
Fix Sparse warnings: * use NULL instead of plain 0 * rearrange header include order to avoid redefining types accidentally * ANSIfy SLIRP * avoid "restrict" keyword * add static git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-06Refactor keymap code to avoid duplication ("Daniel P. Berrange")aliguori1-2/+1
Each of the graphical frontends #include a .c file, for keymap code resulting in duplicated definitions & duplicated compiled code. A couple of small changes allowed this to be sanitized, so instead of doing a #include "keymaps.c", duplicating all code, we can have a shared keymaps.h file, and only compile code once. This allows the next patch to move the VncState struct out into a header file without causing clashing definitions. Makefile | 9 +++++--- b/keymaps.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ curses.c | 3 -- curses_keys.h | 9 +++----- keymaps.c | 45 ++++++++++++++++--------------------------- sdl.c | 3 -- sdl_keysym.h | 7 ++---- vnc.c | 5 +--- vnc_keysym.h | 7 ++---- 9 files changed, 97 insertions(+), 51 deletions(-) Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6721 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-05toplevel: remove error handling from qemu_malloc() callers (Avi Kivity)aliguori1-2/+0
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-21fix curses interface (Stefano Stabellini)aliguori1-1/+3
Hi all, this patch fixes the curses interface: when we switch from one console to another we need to change the displaystate width and height even though in the curses case the backing buffer remains of the same size. I am also putting back the call to text_console_resize in text_console_invalidate so that resizeable text consoles can be properly handled. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6389 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-15DisplayState interface change (Stefano Stabellini)aliguori1-18/+20
This patch changes the DisplayState interface adding support for multiple frontends at the same time (sdl and vnc) and implements most of the benefit of the shared_buf patch without the added complexity. Currently DisplayState is managed by sdl (or vnc) and sdl (or vnc) is also responsible for allocating the data and setting the depth. Vga.c (or another backend) will do any necessary conversion. The idea is to change it so that is vga.c (or another backend) together with console.c that fully manage the DisplayState interface allocating data and setting the depth (either 16 or 32 bit, if the guest uses a different resolution or is in text mode, vga.c (or another backend) is in charge of doing the conversion seamlessly). The other idea is that DisplayState supports *multiple* frontends like sdl and vnc; each of them can register some callbacks to be called when a display event occurs. The interesting changes are: - the new structures and related functions in console.h and console.c in particular the following functions are very helpful to manage a DisplaySurface: qemu_create_displaysurface qemu_resize_displaysurface qemu_create_displaysurface_from qemu_free_displaysurface - console_select and qemu_console_resize in console.c this two functions manage multiple consoles on a single host display - moving code around in hw/vga.c as for the shared_buf patch this is necessary to be able to handle a dynamic DisplaySurface bpp - changes to vga_draw_graphic in hw/vga.c this is the place where the DisplaySurface buffer is shared with the videoram, when possible; Compared to the last version the only changes are: - do not remove support to dpy_copy in cirrus_vga - change the name of the displaysurface handling functions Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6336 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-24Reintroduce TEXT_CONSOLE_FIXED_SIZE and TEXT_CONSOLE for resizable vc's.balrog1-1/+1
This partially reverts r4812 to fix an issue highlighted by Ryan Harper with all vc's being fixed size which prevented backends with resizable window (curses) from displaying okay. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5309 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-21Handle terminating signals (Gerd Hoffmann)aliguori1-2/+0
This patch makes qemu handle signals better. It sets the request_shutdown flag, making the main_loop exit and qemu taking the usual exit route, with atexit handlers being called and so on, instead of qemu just being killed by the signal. To avoid calling vm_start() from the signal handler main_loop() got an additional check so qemu_system_shutdown_request() works even when the vm is in stopped state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5055 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-15Preliminary OpenBSD host support (based on OpenBSD patches by Todd T. Fries)blueswir11-0/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5012 c046a42c-6fe2-441c-8c8c-71466251a162
2008-02-22The non-ncurses curses doesn't have resize_term, so make resizing conditional.balrog1-2/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3986 c046a42c-6fe2-441c-8c8c-71466251a162
2008-02-10Add an ncurses UI.balrog1-0/+370
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3976 c046a42c-6fe2-441c-8c8c-71466251a162