X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fkbsequence.C;h=0d701cdb28ea982ad740bf828fecd98f9f4d7287;hb=9ee46b846e5e84ad40ceda4f4af94aeb86cd90a2;hp=cdffe37a661114b71ae220b4708e53910607627e;hpb=f1c24d100985c6df2eb5ec390017b69c78fe49c7;p=lyx.git diff --git a/src/kbsequence.C b/src/kbsequence.C index cdffe37a66..0d701cdb28 100644 --- a/src/kbsequence.C +++ b/src/kbsequence.C @@ -1,36 +1,33 @@ /** * \file kbsequence.C - * Copyright 1995-2002 the LyX Team - * Read the file COPYING + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * \author John Levon + * \author Lars Gullik Bjønnes + * \author Jean-Marc Lasgouttes + * \author John Levon + * + * Full author contact details are available in file CREDITS. */ #include -#include "gettext.h" +#include "kbsequence.h" -#ifdef __GNUG__ -#pragma implementation -#endif +#include "gettext.h" +#include "kbmap.h" +#include "lfuns.h" -#include "frontends/mouse_state.h" +#include "frontends/LyXKeySym.h" #include "frontends/LyXKeySymFactory.h" -#include "kbsequence.h" -#include "kbmap.h" -#include "commandtags.h" -#include "debug.h" using std::make_pair; -using std::vector; -using std::endl; -using std::hex; -using std::dec; - +using std::string; -int kb_sequence::addkey(LyXKeySymPtr key, - key_modifier::state mod, key_modifier::state nmod) +FuncRequest const & +kb_sequence::addkey(LyXKeySymPtr key, + key_modifier::state mod, key_modifier::state nmod) { // adding a key to a deleted sequence // starts a new sequence @@ -47,7 +44,8 @@ int kb_sequence::addkey(LyXKeySymPtr key, return curmap->lookup(key, mod, this); } - return LFUN_UNKNOWN_ACTION; + static FuncRequest unknown(LFUN_UNKNOWN_ACTION); + return unknown; } @@ -58,7 +56,7 @@ string::size_type kb_sequence::parse(string const & s) string::size_type i = 0; key_modifier::state mod = key_modifier::none; key_modifier::state nmod = key_modifier::none; - + while (i < s.length()) { if (s[i] == ' ') ++i; @@ -108,7 +106,7 @@ string::size_type kb_sequence::parse(string const & s) LyXKeySymPtr key(LyXKeySymFactory::create()); key->init(tbuf); - + if ( ! key->isOK() ) { return j; } @@ -137,9 +135,9 @@ string const kb_sequence::print() const // return buf; KeySequence::size_type i, length = sequence.size(); - + for (i = 0; i < length; ++i) { - buf += kb_keymap::printKeysym(sequence[i], modifiers[i].first); + buf += sequence[i]->print(modifiers[i].first); // append a blank if (i + 1 < length) { @@ -171,20 +169,6 @@ void kb_sequence::mark_deleted() } -LyXKeySymPtr kb_sequence::getsym() const -{ - if (sequence.size() == 0) - return LyXKeySymPtr(LyXKeySymFactory::create()); - return sequence.back(); -} - - -char kb_sequence::getLastKeyEncoded() const -{ - return getsym()->getISOEncoded(); -} - - void kb_sequence::reset() { mark_deleted();