--- rxvt-unicode/src/keyboard.h 2006/01/02 15:35:43 1.5 +++ rxvt-unicode/src/keyboard.h 2011/11/27 09:19:04 1.18 @@ -1,3 +1,26 @@ +/*----------------------------------------------------------------------* + * File: keyboard.h + *----------------------------------------------------------------------* + * + * All portions of code are copyright by their respective author/s. + * Copyright (c) 2005 WU Fengguang + * Copyright (c) 2005-2006 Marc Lehmann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *----------------------------------------------------------------------*/ + #ifndef KEYBOARD_H_ #define KEYBOARD_H_ @@ -5,12 +28,11 @@ #include -#include "feature.h" #include "rxvtutil.h" #define KEYSYM_HASH_BITS 4 /* lowest #bits of keysym is used as hash key */ -#define KEYSYM_HASH_BUDGETS (1<1: a of range keysyms */ keysym_type type; - const char *str; /* would normally be a keycode translation in UTF-8 */ + char *str; /* would normally be a keycode translation in UTF-8 */ }; class keyboard_manager @@ -55,24 +70,18 @@ void clear (); void register_user_translation (KeySym keysym, unsigned int state, const char *trans); + void register_translation (KeySym keysym, unsigned int state, char *translation); void register_done (); // call this to make newly registered keymaps take effect bool dispatch (rxvt_term *term, KeySym keysym, unsigned int state); private: void register_keymap (keysym_t *key); - void purge_duplicate_keymap (); void setup_hash (); int find_keysym (KeySym keysym, unsigned int state); private: - uint16_t hash[KEYSYM_HASH_BUDGETS]; + uint16_t hash[KEYSYM_HASH_BUCKETS]; vector keymap; - - // stock keymaps are all static data - static keysym_t stock_keymap[]; - // user keymaps and their .string are dynamicaly allocated and freed - vector user_keymap; - vector user_translations; }; #endif /* KEYSYM_RESOURCE */