mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
Refactor keymap code to avoid duplication ("Daniel P. Berrange")
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
This commit is contained in:
parent
1ff7df1a84
commit
0483755a4d
8 changed files with 37 additions and 51 deletions
5
vnc.c
5
vnc.c
|
|
@ -36,7 +36,6 @@
|
|||
|
||||
#include "vnc.h"
|
||||
#include "vnc_keysym.h"
|
||||
#include "keymaps.c"
|
||||
#include "d3des.h"
|
||||
|
||||
#ifdef CONFIG_VNC_TLS
|
||||
|
|
@ -2422,9 +2421,9 @@ void vnc_display_init(DisplayState *ds)
|
|||
vs->ds = ds;
|
||||
|
||||
if (keyboard_layout)
|
||||
vs->kbd_layout = init_keyboard_layout(keyboard_layout);
|
||||
vs->kbd_layout = init_keyboard_layout(name2keysym, keyboard_layout);
|
||||
else
|
||||
vs->kbd_layout = init_keyboard_layout("en-us");
|
||||
vs->kbd_layout = init_keyboard_layout(name2keysym, "en-us");
|
||||
|
||||
if (!vs->kbd_layout)
|
||||
exit(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue