summaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-06 20:27:10 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-06 20:27:10 +0000
commit03bbffb0d73c96e628442e107f2a42617171a820 (patch)
tree2c1e9ac8af63b982a7e0501408fbb37d0780ab93 /sdl.c
parent49412c63289f3f7c263a895a3e7d46443cea4e63 (diff)
downloadqemu-03bbffb0d73c96e628442e107f2a42617171a820.tar.gz
qemu-03bbffb0d73c96e628442e107f2a42617171a820.tar.bz2
qemu-03bbffb0d73c96e628442e107f2a42617171a820.zip
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
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sdl.c b/sdl.c
index c685b81f6f..8384a16363 100644
--- a/sdl.c
+++ b/sdl.c
@@ -109,7 +109,6 @@ static void sdl_resize(DisplayState *ds)
/* generic keyboard conversion */
#include "sdl_keysym.h"
-#include "keymaps.c"
static kbd_layout_t *kbd_layout = NULL;
@@ -677,7 +676,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
keyboard_layout = "en-us";
#endif
if(keyboard_layout) {
- kbd_layout = init_keyboard_layout(keyboard_layout);
+ kbd_layout = init_keyboard_layout(name2keysym, keyboard_layout);
if (!kbd_layout)
exit(1);
}