* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
* \author Matthias Ettrich
*
* Full author contact details are available in file CREDITS.
#include "BufferView.h"
#include "Cursor.h"
#include "CutAndPaste.h"
-#include "support/debug.h"
#include "Lexer.h"
#include "LyXRC.h"
#include "Text.h"
+#include "support/debug.h"
+#include "support/docstream.h"
+#include "support/FileName.h"
#include "support/filetools.h"
#include "support/lstrings.h"
-#include "support/convert.h"
-#include "support/docstream.h"
using namespace std;
using namespace lyx::support;
| cedilla | cedilla |LFUN_ACCENT_CEDILLA | cedilla
| underdot | |LFUN_ACCENT_UNDERDOT | underdot
| underbar | |LFUN_ACCENT_UNDERBAR | underbar
- | hácek | caron |LFUN_ACCENT_CARON | caron
+ | hácek | caron |LFUN_ACCENT_CARON | caron
| breve | breve |LFUN_ACCENT_BREVE | breve
| tie | |LFUN_ACCENT_TIE | tie
| Hungarian umlaut | doubleacute |LFUN_ACCENT_HUNGARIAN_UMLAUT | hungarian umlaut
| | iota | |
| | voiced_sound | |
| | semivoiced_sound | |
- | | |LFUN_ACCENT_SPECIAL_CARON| special caron
*/
-static tex_accent_struct lyx_accent_table[] = {
+static TeXAccent lyx_accent_table[] = {
{TEX_NOACCENT, 0, "", LFUN_NOACTION},
{TEX_ACUTE, 0x0301, "acute", LFUN_ACCENT_ACUTE},
{TEX_GRAVE, 0x0300, "grave", LFUN_ACCENT_GRAVE},
{TEX_MACRON, 0x0304, "macron", LFUN_ACCENT_MACRON},
{TEX_TILDE, 0x0303, "tilde", LFUN_ACCENT_TILDE},
- {TEX_UNDERBAR, 0x0320, "underbar", LFUN_ACCENT_UNDERBAR},
+ {TEX_PERISPOMENI, 0x0342, "perispomeni", LFUN_ACCENT_PERISPOMENI},
+ {TEX_UNDERBAR, 0x0320, "underbar", LFUN_ACCENT_UNDERBAR}, // COMBINING MINUS SIGN BELOW or 0x0331 COMBINING MACRON BELOW ?
+
{TEX_CEDILLA, 0x0327, "cedilla", LFUN_ACCENT_CEDILLA},
{TEX_UNDERDOT, 0x0323, "underdot", LFUN_ACCENT_UNDERDOT},
{TEX_CIRCUMFLEX, 0x0302, "circumflex", LFUN_ACCENT_CIRCUMFLEX},
{TEX_TIE, 0x0361, "tie", LFUN_ACCENT_TIE},
{TEX_BREVE, 0x0306, "breve", LFUN_ACCENT_BREVE},
{TEX_CARON, 0x030c, "caron", LFUN_ACCENT_CARON},
-// {TEX_SPECIAL_CARON, 0x030c, "ooo", LFUN_ACCENT_SPECIAL_CARON},
// Don't fix this typo for compatibility reasons!
{TEX_HUNGUML, 0x030b, "hugarian_umlaut", LFUN_ACCENT_HUNGARIAN_UMLAUT},
{TEX_UMLAUT, 0x0308, "umlaut", LFUN_ACCENT_UMLAUT},
};
-tex_accent_struct get_accent(kb_action action)
+TeXAccent get_accent(FuncCode action)
{
int i = 0;
while (i <= TEX_MAX_ACCENT) {
return lyx_accent_table[i];
++i;
}
- struct tex_accent_struct temp = { static_cast<tex_accent>(0), 0,
- 0, static_cast<kb_action>(0)};
+ struct TeXAccent temp = { static_cast<tex_accent>(0), 0,
+ nullptr, static_cast<FuncCode>(0)};
return temp;
}
}
-enum kmaptags_ {
+enum {
KCOMB = 1,
KMOD,
KMAP,
- KXMOD,
- K_LAST
-};
-
-
-struct keyword_item kmapTags[K_LAST - 1] = {
- {"\\kcomb", KCOMB },
- { "\\kmap", KMAP },
- { "\\kmod", KMOD },
- { "\\kxmod", KXMOD }
+ KXMOD
};
// FIXME This is a hack.
// tmp is no valid UCS4 string, but misused to store the
// accent.
- docstring tmp;
- tmp += char_type(0);
- tmp += char_type(accent);
- keymap_[keys[i]] = tmp;
+ docstring tmpd;
+ tmpd += char_type(0);
+ tmpd += char_type(accent);
+ keymap_[keys[i]] = tmpd;
}
}
&& it->second[1] == accent_2)
break;
}
+
+ // could not find accent2 on a key -- this should not happen.
+ if (it == end)
+ return -1;
+
docstring allowed;
if (!lex.next())
return -1;
-
allowed = lex.getDocString();
LYXERR(Debug::KBMAP, "allowed: " << to_utf8(allowed));
if (!lex.next(true))
return -1;
- key_from = lex.getString()[0];
+ key_from = static_cast<unsigned char>(lex.getString()[0]);
LYXERR(Debug::KBMAP, "\t`" << lex.getString() << '\'');
if (!lex.next(true))
int Trans::load(string const & language)
{
+ LexerKeyword kmapTags[] = {
+ {"\\kcomb", KCOMB },
+ { "\\kmap", KMAP },
+ { "\\kmod", KMOD },
+ { "\\kxmod", KXMOD }
+ };
+
FileName const filename = libFileSearch("kbd", language, "kmap");
if (filename.empty())
return -1;
freeKeymap();
- Lexer lex(kmapTags, K_LAST - 1);
+ Lexer lex(kmapTags);
lex.setFile(filename);
int const res = load(lex);
// TransFSMData
-TransFSMData::TransFSMData()
+TransFSMData::TransFSMData() : deadkey_(0), deadkey2_(0), init_state_(nullptr),
+ deadkey_state_(nullptr), combined_state_(nullptr), currentState(nullptr)
{
- deadkey_ = deadkey2_ = 0;
- deadkey_info_.accent = deadkey2_info_.accent = TEX_NOACCENT;
}
TransManager::TransManager()
- : active_(0)
+ : active_(&default_)
{}