X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTrans.cpp;h=1f2b3a8802de9e8c2e210a4b81068d7a78f40293;hb=952853eb2358472644e45f3fe3a6f3a68fac3556;hp=d6f7ca1d675c3586c225efb72235ee4bb388ef24;hpb=7c392af6eab5e06a4836146859cbd9f2c3764420;p=lyx.git diff --git a/src/Trans.cpp b/src/Trans.cpp index d6f7ca1d67..1f2b3a8802 100644 --- a/src/Trans.cpp +++ b/src/Trans.cpp @@ -3,7 +3,7 @@ * 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. @@ -17,15 +17,15 @@ #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; @@ -55,7 +55,7 @@ namespace lyx { | 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 @@ -64,9 +64,8 @@ namespace lyx { | | 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}, @@ -80,7 +79,6 @@ static tex_accent_struct lyx_accent_table[] = { {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}, @@ -89,7 +87,7 @@ static tex_accent_struct lyx_accent_table[] = { }; -tex_accent_struct get_accent(kb_action action) +TeXAccent get_accent(FuncCode action) { int i = 0; while (i <= TEX_MAX_ACCENT) { @@ -97,8 +95,8 @@ tex_accent_struct get_accent(kb_action action) return lyx_accent_table[i]; ++i; } - struct tex_accent_struct temp = { static_cast(0), 0, - 0, static_cast(0)}; + struct TeXAccent temp = { static_cast(0), 0, + 0, static_cast(0)}; return temp; } @@ -168,20 +166,11 @@ bool Trans::isDefined() const } -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 }; @@ -386,12 +375,19 @@ docstring const Trans::process(char_type c, TransManager & k) 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);