#include "KeyMap.h"
#include "debug.h"
-#include "kb_sequence.h"
+#include "KeySequence.h"
#include "LyXAction.h"
#include "Lexer.h"
-#include "frontends/LyXKeySym.h"
+#include "frontends/KeySymbol.h"
#include "support/filetools.h"
#include <sstream>
+using std::endl;
+using std::string;
+
namespace lyx {
using support::FileName;
using support::i18nLibFileSearch;
-using std::endl;
-using std::string;
-
-string const KeyMap::printKeySym(LyXKeySym const & key,
+string const KeyMap::printKeySym(KeySymbol const & key,
key_modifier::state mod)
{
string buf;
<< seq << "' Action `"
<< func.action << '\'' << endl;
- kb_sequence k(0, 0);
+ KeySequence k(0, 0);
string::size_type const res = k.parse(seq);
if (res == string::npos) {
FuncRequest const &
-KeyMap::lookup(LyXKeySymPtr key,
- key_modifier::state mod, kb_sequence * seq) const
+KeyMap::lookup(KeySymbolPtr key,
+ key_modifier::state mod, KeySequence * seq) const
{
static FuncRequest const unknown(LFUN_UNKNOWN_ACTION);
}
-void KeyMap::defkey(kb_sequence * seq, FuncRequest const & func, unsigned int r)
+void KeyMap::defkey(KeySequence * seq, FuncRequest const & func, unsigned int r)
{
- LyXKeySymPtr code = seq->sequence[r];
+ KeySymbolPtr code = seq->sequence[r];
if (!code->isOK())
return;
it->func.origin = FuncRequest::KEYBOARD;
return;
} else if (!it->table.get()) {
- lyxerr << "Error: New binding for '"
+ lyxerr << "Error: New binding for '"
<< to_utf8(seq->print(false))
<< "' is overriding old binding..."
<< endl;
KeyMap::Bindings KeyMap::findbindings(FuncRequest const & func) const
{
- return findbindings(func, kb_sequence(0, 0));
+ return findbindings(func, KeySequence(0, 0));
}
KeyMap::Bindings KeyMap::findbindings(FuncRequest const & func,
- kb_sequence const & prefix) const
+ KeySequence const & prefix) const
{
Bindings res;
if (table.empty()) return res;
for (Table::const_iterator cit = table.begin();
cit != end; ++cit) {
if (cit->table.get()) {
- kb_sequence seq = prefix;
+ KeySequence seq = prefix;
seq.addkey(cit->code, cit->mod.first);
Bindings res2 =
cit->table->findbindings(func, seq);
res.insert(res.end(), res2.begin(), res2.end());
} else if (cit->func == func) {
- kb_sequence seq = prefix;
+ KeySequence seq = prefix;
seq.addkey(cit->code, cit->mod.first);
res.push_back(seq);
}
}
-std::pair<LyXKeySym const *, key_modifier::state>
+std::pair<KeySymbol const *, key_modifier::state>
KeyMap::find1keybinding(FuncRequest const & func) const
{
Table::const_iterator end = table.end();
return std::make_pair(cit->code.get(), cit->mod.first);
}
- return std::make_pair<LyXKeySym const *, key_modifier::state>(0, key_modifier::none);
+ return std::make_pair<KeySymbol const *, key_modifier::state>(0, key_modifier::none);
}