pixman: add qemu_pixman_color()
Helper function to map qemu colors (32bit integer + matching PixelFormat)into pixman_color_t.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
pixman: render vgafont glyphs into pixman images
Add helper functions to create pixman mask images for glyphsand to render these glyphs into a pixman image.
console: use pixman for fill+blit
Zap homegrown pixel shuffeling code, use pixman calls instead.
console: use pixman for font rendering
Zap homegrown font rendering code, use pixman calls instead.
console: switch color_table_rgb to pixman_color_t
Now that all text console rendering uses pixman we can easilyswitch the color tables to use pixman_color_t directly.
sysemu: avoid proliferation of include/ subdirectories
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Merge remote-tracking branch 'luiz/queue/qmp' into staging
oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()
The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets.Rename to qemu_set_nonblock() just like qemu_set_cloexec().
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
ui/gtk: Set QEMU window icon
The QEMU icon which is already used for SDLis now also loaded by GTK.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Message-id: 1364653300-26813-1-git-send-email-sw@weilnetz.deSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
gtk: make more messages translatable
Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1364836326-8707-2-git-send-email-aurelien@aurel32.netSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Rename qemu_chr_generic_open to qemu_chr_be_generic_open
To better reflect that it is for handling a backend being opened.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-3-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
gtk: Release modifier when graphic console loses keyboard focus
This solves, e.g., sticky ALT when selecting a GTK menu, switching to adifferent window or selecting a different virtual console.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Message-id: 514F417A.6010908@web.de...
ui/cocoa.m: Fix compile failures introduced by recent console changes
Fix various compilation failures introduced by the recent consolechanges.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1363638501-29603-1-git-send-email-peter.maydell@linaro.org...
sdl: stop using DisplayState
Rework DisplayStateListener callbacks to not use the DisplayStateany more.
spice: stop using DisplayState
cocoa: stop using DisplayState
console: zap displaystate from dcl callbacks
Now that nobody depends on DisplayState in DisplayChangeListenercallbacks any more we can remove the parameter from all callbacks.
console: stop using DisplayState in gfx hardware emulation
Use QemuConsole instead. Updates interfaces in console.[ch] and adaptsgfx hardware emulation code.
console: zap color_table
qemu_create_surface hands out 32bpp surfaces.So we can just use color_table_rgb directly.
console: remove ds_get_* helper functions
Switch the few remaining ds_get_* uses in console.c over to the newsurface_* accessors.
While doing so tripped over a few leftovers from commita93a4a226a2afba147ba5df688b85d844f537c68 (code using depth == 0as indicator for textmode rendering). Fixed them up....
console: fix displaychangelisteners interface
Split callbacks into separate Ops struct. Pass DisplayChangeListenerpointer as first argument to all callbacks. Uninline a bunch ofdisplay functions and move them from console.h to console.c
console: kill DisplayState->opaque
It's broken by design. There can be multiple DisplayChangeListenerinstances, so they simply can't store state in the (single) DisplayStatestruct. Try 'qemu -display gtk -vnc :0', watch it crash & burn.
With DisplayChangeListenerOps having a more sane interface now we can...
spice: zap sdpy global
DisplayChangeListener is passed now to all DisplayChangeListenerOpscallbacks, so we can use that to access the spice display state andkill the sdpy global variable.
sdl: drop dead code
DisplayAllocator removal (commit187cd1d9f30d13f0d0ef682e4d91cfa3e4cbd472) made this a nop.
console: rework DisplaySurface handling [vga emu side]
Decouple DisplaySurface allocation & deallocation from DisplayState.Replace dpy_gfx_resize + dpy_gfx_setdata with a dpy_gfx_replace_surfacefunction.
This handles the graphic hardware emulation.
console: rework DisplaySurface handling [dcl/ui side]
Replace the dpy_gfx_resize and dpy_gfx_setdata DisplayChangeListenercallbacks with a dpy_gfx_switch callback which notifies the ui codewhen the framebuffer backing storage changes.
gtk: stop using DisplayState
Rework DisplayStateListener callbacks to not use the DisplayStateany more. Factor out the window size handling to a separate function,so the zoom callbacks can call that directly instead of abusing thegd_switch DisplayStateListener callback for that....
vnc: stop using DisplayState
chardev: add vc support to qapi
This patch adds 'vc' support to qapi and also switches over thevc chardev initialization to the new qapi code path.
qemu-char: move text console init to console.c
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 17cefde0a8d7807294bab95e93c3328a20d3f2ed.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add compat macro for gtk_widget_get_realized
The gtk_widget_get_realized method only arrived in GTK 2.20,so defined a compat macro for earlier GTK
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Message-id: 1361805646-6425-13-git-send-email-berrange@redhat.com...
Add compat for GDK_KEY_XXX symbols
The GDK_KEY_XXX symbols are new in GTK3 and only the mostrecent GTK2 releases. Most versions of GTK2 have simplyused GDK_XXX
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Message-id: 1361805646-6425-14-git-send-email-berrange@redhat.com...
Replace expose-event handler with draw handler in GTK3
In GTK3 the 'expose-event' signal has been replaced by a new'draw' signal. The only difference is that the latter willpre-create the cairo drawing context & set the clip mask.Since the drawing code is already structured in a nice way,...
Ensure x_keymap.o is built when GTK is enabled
The x_keymap.o file is required by both GTK and SDL builds,so it must be explicitly listed as a GTK dep to ensure thelinker works when SDL is disabled
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>...
Replace gtk_menu_append with gtk_menu_shell_append
The gtk_menu_append method has long been deprecated in favourof the gtk_menu_shell_append method. The former is now entirelygone in GTK3, so switch all code to the latter which works onboth GTK2 and GTK3...
Conditionalize use of gdk_display_warp_pointer
In GTK3 the gdk_display_warp_pointer method is deprecated.Instead we should use gdk_device_warp on the GdkDeviceinstead associated with the event being processed.
Conditionalize use of gtk_widget_size_request
The gtk_widget_size_request method has been replaced bythe gtk_widget_get_preferred_size method in GTK3. Conditionallycall the new method in GTK3
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Message-id: 1361805646-6425-9-git-send-email-berrange@redhat.com...
Add compat for gdk_drawable_get_size on GTK3
GTK3 lacks the gdk_drawable_get_size method, so we create astub impl which gets the get_width/get_height mehtods instead
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Message-id: 1361805646-6425-2-git-send-email-berrange@redhat.com...
Remove use of gdk_drawable_get_{screen, display}
The gdk_drawable_get_screen and gdk_drawable_get_displaymethods don't exist in GDK3. Fortunately, even on GTK2they are not required - we can call the equivalentgtk_widget_get_screen/gtk_widget_get_display methods...
Conditionalize use of gdk_keyboard_grab / gdk_keyboard_ungrab
On GTK3 there is support for multiple keyboard devices, sorather than using gdk_keyboard_grab / gdk_keyboard_ungrabwe should iterate over all devices, grabbing each one inturn
Conditionalize use of gdk_pointer_grab / gdk_pointer_ungrab
On GTK3 there is support for multiple pointer devices, sorather than using gdk_pointer_grab / gdk_pointer_ungrabwe should iterate over all devices, grabbing each one inturn
Remove use of GtkVBox in GTK3
The GtkVBox class is deprecated, in favour of just using theGtkBox class directly. Eventually even GtkBox will bedeprecated in favour of GtkGrid, but that is a bigger fixwhich can wait.
gtk: Rename File to Machine menu and add pause, reset and power down items
This adds basic guest control commands to the "Machine" menu - a niceadded-value for the GTK UI.
We use "pause" as the term for stopping the machine here. So reword alsothe related caption tag....
ui/gtk: Use menu item from stock for full screen
This reduces the required translations and gives a nicer menuwith an icon.
The full screen menu item is no longer a check menu item.A checked item is not visible in full screen mode,so it is not needed for this special menu item....
ui/gtk: Support versions of VTE before 0.26
This is needed for current Debian stable (Squeeze).
VTE versions before 0.26 did not support VtePty.
Lower the version requirement and use alternate code which works for Debian.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
Reenable -Wstrict-prototypes
One part of this patch reverts commit 22bc9a46, which disabled thewarning. The rest of it deals with the warning by adding a #pragma fornewer gcc and by disabling -Werror for compilers that can't deal withthe #pragma.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
ui/gtk: Fix build (missing include for setlocale)
At least for Ubuntu Linux locale.h is needed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Message-id: 1361514481-26164-1-git-send-email-sw@weilnetz.deSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
gtk: suppress accelerators from the File menu when grab is active
If you're full screen, you probably expect Ctrl-Q to go to the guest,not the host. I think restricting certain menus is the right way tohandle this generally speaking.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
console: allow VCs to be overridden by UI
We want to expose VCs using a VteTerminal widget. We need access to provide ourown CharDriverState in order to do this.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1361367806-4599-3-git-send-email-aliguori@us.ibm.com
ui: add basic GTK gui (v5)
This is minimalistic and just contains the basic widget infrastructure. The GUIconsists of a menu and a GtkNotebook. To start with, the notebook has its tabshidden which provides a UI that looks very similar to SDL with the exception of...
gtk: add virtual console support (v2)
This enables VteTerminal to be used to render the text consoles. VteTerminal isthe same widget used by gnome-terminal which means it's VT100 emulation is asgood as they come.
It's also screen reader accessible, supports copy/paste, proper scrolling and...
gtk: add support for input grabbing (v2)
There is a small deviation from SDL's behavior here. Instead of Ctrl+Alttriggering grab, we now use Ctrl-Alt-g to trigger grab.
GTK will not accept Ctrl+Alt as an accelerator since it just consists ofmodifiers. Having grab as a proper accelerator is important as it allows a user...
gtk: add support for screen scaling and full screen (v5)
Basic menu items to enter full screen mode and zoom in/out. Unlike SDL, wedon't allow arbitrary scaling based on window resizing. The current behaviorwith SDL causes a lot of problems for me.
Sometimes I accidentally resize the window a tiny bit while trying to move it...
gtk: add translation support (v5)
This includes a de_DE translation from Kevin Wolf and an it translation fromPaolo Bonzini.
Cc: Paolo Bonzini <pbonzini@redhat.com>Cc: Kevin Wolf <kwolf@redhat.com>Cc: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
vga: fix byteswapping.
In case host and guest endianness differ the vga code first createsa shared surface (using qemu_create_displaysurface_from), then goespatch the surface format to indicate that the bytes must be swapped.
The switch to pixman broke that hack as the format patching isn't...
vnc-tls: Fix compilation with newer versions of GNU-TLS
In my installation of GNU-TLS (v3.0.23) the typegnutls_anon_server_credentials is marked deprecated, so -Werrorbreaks compilation.Simply replacing it with the newer ..._t version fixed the compilation...
error: Strip trailing '\n' from error string arguments (again)
Commit 6daf194d and be62a2eb got rid of a bunch, but they keep comingback. Tracked down with this Coccinelle semantic patch:
r expression err, eno, cls, fmt; position p; @@ (...
r
vnc: recognize Hungarian doubleacutes
As reported in http://bugs.debian.org/697641 , some Hungarian keysdoes not work with qemu when using vnc display.
This is because while the Hungarian keymap mentions these symbols,qemu know nothing about them. So add them....
cocoa: Replace non-portable asprintf() by g_strdup_printf()
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Andreas Färber <andreas.faerber@web.de>
cocoa: Fix VBE function Set Display Start
Register a dpy_gfx_setdata callback so that the Cocoa codeis notified whenever the screen start address changes.
Commit 1d3323d has a similar fix for the VNC UI.
Signed-off-by: Henry Harrington <henry.harrington@gmail.com>...
qemu-pixman.h: Avoid mutual inclusion loop with console.h
Remove an unnecessary mutual inclusion loop between qemu-pixman.h andconsole.h, since the former was only including the latter for'PixelFormat*', which can be provided by typedefs.h. This requires a...
spice: Fix unchecked strdup() by converting to g_strdup()
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
vnc: Clean up vncws_send_handshake_response()
Use appropriate types, drop superfluous casts, use sizeof, don'texploit that this particular call of gnutls_fingerprint() doesn'tchange its last argument.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
vnc: added buffer_advance function
Following Anthony Liguori's Websocket implementation I have added thebuffer_advance function to VNC and replaced all related buffer memmoveoperations with it.
Signed-off-by: Tim Hardeck <thardeck@suse.de>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
vnc: added initial websocket protocol support
This patch adds basic Websocket Protocol version 13 - RFC 6455 - supportto QEMU VNC. Binary encoding support on the client side is mandatory.
Because of the GnuTLS requirement the Websockets implementation is...
vnc: fix possible uninitialized removals
Some VncState values are not initialized before the Websocket handshake.If it fails QEMU segfaults during the cleanup. To prevent this behaviorintialization checks are added.
Signed-off-by: Tim Hardeck <thardeck@suse.de>...
ui: Drop useless null tests in parse_keyboard_layout()
Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
sdl: Fix heap smash in sdl_zoom_rgb{16,32} for int > 32 bits
Careless use of malloc(): allocate Uint32[N], assign to int *, useint[N].
Fix by converting to g_new().
Functions can't fail anymore, so make them return void. Callerignored the value anyway....
qemu-option: move standard option definitions out of qemu-config.c
spice: drop incorrect vm_change_state_handler() opaque
The spice_server pointer is a global variable andvm_change_state_handler() therefore does not use its opaque parameter.
The vm change state handler is added with a pointer to the spice_serverpointer. This is useless and we probably would not want 2 levels of...
build: fix includes for VNC
vnc-tls.h is included by vnc.h, and it includes gnutls/gnutls.h.Hence, GnuTLS header files are needed by all files that includevnc.h, most notably qmp.c. Move these flags to QEMU_CFLAGS forsimplicity.
Reported-by: Peter Maydell <peter.maydell@linaro.org>...
Merge remote-tracking branch 'bonzini/header-dirs' into staging
softmmu: move remaining include files to include/ subdirectories
softmmu: move include files to include/sysemu/
misc: move include files to include/qemu/
monitor: move include files to include/monitor/
migration: move include files to include/migration/
janitor: add guards to headers
qapi: move include files to include/qobject/
ui: move files to ui/ and include/ui/
janitor: do not include qemu-char everywhere
Touching char/char.h basically causes the whole of QEMU tobe rebuilt. Avoid this, it is usually unnecessary.
build: move rules from Makefile to */Makefile.objs
spice-qemu-char: add spiceport chardev
Add a new spice chardev to allow arbitrary communication between thehost and the Spice client via the spice server.
Examples:
This allows the Spice client to have a special port for the qemumonitor:
... -chardev spiceport,name=org.qemu.monitor,id=monitorport...
spice-qemu-char: register spicevmc ports during qemu_spice_init()
Do the delayed registration of spicevmc ports after Spice server isinitialized.
qxl+vnc: register a vm state change handler for dummy spice_server
When qxl + vnc are used, a dummy spice_server is initialized.The spice_server has to be told when the VM runstate changes,which is what this patch does.
Without it, from qxl_send_events(), the following error message is shown:...
pixman: fix vnc tight png/jpeg support
This patch adds an x argument to qemu_pixman_linebuf_fill so it canalso be used to convert a partial scanline. Then fix tight + png/jpegencoding by passing in the x+y offset, so the data is read from thecorrect screen location instead of the upper left corner....
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
curses: Remove OpenBSD workaround
I removed the same sort of workaround for OpenBSD within theconfigure script with commit 4dcc3f5876fa638d5c35bd47be3b717ea74cc2e7but didn't bother to grep further to come across this same chunkof code in the curses code itself. So the following diff removes...
ui/vnc-palette.c: Include headers it needs
Include: - <glib.h> for g_malloc0() - <string.h> for memset()
Some of those headers were probably being included by accident becausesome other headers were including qemu-common.h, but those headersshould eventually stop including qemu-common.h....
Merge remote-tracking branch 'spice/spice.v64' into staging
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc: fix option misspelling ("non-adapative" -> "non-adaptive")
Signed-off-by: Catalin Patulea <catalinp@google.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix the inconsistency in x509-dh-key-file parameter
Commit c448e8552b0f6135dabddf944a7110f929c08320 (spice: tlssupport) added options to the -spice command line. But thereis an inconsistency between the declaration of the option'x509-dh-key-file' to -spice command line and its parameter...
spice: add new spice-server callbacks to ui/spice-display.c
Otherwise qemu crashes with non-qxl graphics cards.
vnc-palette.h: Include <stdbool.h>
<stdbool.h> is needed for the 'bool' type, used in the header.
The header is probably being included by accident because some otherheaders are including qemu-common.h, but those headers should eventuallystop including qemu-common.h....
spice: switch to pixman
Switch over spice-display.c to use the pixman libraryinstead of the home-grown pflib bits.
spice: fix initialization order
Register displaychangelistener last, after spice is fully initialized,otherwise we may hit NULL pointer dereferences when qemu starts callingour callbacks.
Commit e250d949feb1334828f27f0d145c35f29c4b7639 triggers this bug....
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu
ui/cocoa.m: Update to new DisplayChangeListener member names
Commit a93a4a2 changed the names of some fields in DisplayChangeListenerand broke compilation of the cocoa UI. Update to the new names.
Acked-by: Gerd Hoffmann <kraxel@redhat.com>Reviewed-by: Andreas Färber <andreas.faerber@web.de>...
vnc: add missing static
Add missing 'static' qualifiers.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
pixman/vnc: remove dead code.
Switching the vnc server framebuffer to use 32bpp unconditionallyturns the code bits which handle 8 and 16 bpp into dead code.Remove them.