diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-06 20:27:10 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-06 20:27:10 +0000 |
commit | 0483755a4d1fd61fe9c284166f67ae08af8d858b (patch) | |
tree | 2c1e9ac8af63b982a7e0501408fbb37d0780ab93 /curses_keys.h | |
parent | 1ff7df1a848044f58d0f3540f1447db4bb1d2d20 (diff) |
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 'curses_keys.h')
-rw-r--r-- | curses_keys.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/curses_keys.h b/curses_keys.h index 0105279087..fd2545168b 100644 --- a/curses_keys.h +++ b/curses_keys.h @@ -21,6 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + +#include "keymaps.h" + + #define KEY_RELEASE 0x80 #define KEY_MASK 0x7f #define SHIFT_CODE 0x2a @@ -239,11 +243,6 @@ static const int curses2keysym[CURSES_KEYS] = { }; -typedef struct { - const char* name; - int keysym; -} name2keysym_t; - static const name2keysym_t name2keysym[] = { /* Plain ASCII */ { "space", 0x020 }, |