4 #include "tex-accent.h"
5 #include "commandtags.h"
7 #include "support/lstrings.h"
9 /* the names used by TeX and XWindows for deadkeys/accents are not the same
10 so here follows a table to clearify the differences. Please correct this
13 |------------------|------------------|------------------|--------------|
14 | TeX | XWindows | \bind/LFUN | used by intl |
15 |------------------|------------------|------------------|--------------|
16 | grave | grave |LFUN_GRAVE | grave
17 | acute | acute |LFUN_ACUTE | acute
18 | circumflex | circumflex |LFUN_CIRCUMFLEX | circumflex
19 | umlaut/dieresis | diaeresis |LFUN_UMLAUT | umlaut
20 | tilde | tilde |LFUN_TILDE | tilde
21 | macron | maron |LFUN_MACRON | macron
22 | dot | abovedot |LFUN_DOT | dot
23 | cedilla | cedilla |LFUN_CEDILLA | cedilla
24 | underdot | |LFUN_UNDERDOT | underdot
25 | underbar | |LFUN_UNDERBAR | underbar
26 | hácek | caron |LFUN_CARON | caron
27 | breve | breve |LFUN_BREVE | breve
28 | tie | |LFUN_TIE | tie
29 | Hungarian umlaut | doubleacute |LFUN_HUNG_UMLAUT | hungarian umlaut
30 | circle | abovering |LFUN_CIRCLE | circle
34 | | semivoiced_sound | |
35 | | |LFUN_SPECIAL_CARON| special caron
37 // I am not sure how some of the XWindows names coresponds to the TeX ones.
40 tex_accent_struct lyx_accent_table[18] ={
41 { (tex_accent)0, "", "", "",(kb_action)0},
42 {TEX_ACUTE, "\\'", " AEIOUYaeiouySZszRLCNrlcn","acute", LFUN_ACUTE},
43 {TEX_GRAVE, "\\`", " aeiouAEIOU", "grave", LFUN_GRAVE},
44 {TEX_MACRON, "\\=", " EeAIOUaiou", "macron", LFUN_MACRON},
45 {TEX_TILDE, "\\~", " ANOanoIiUu", "tilde", LFUN_TILDE},
46 {TEX_UNDERBAR, "\\b", " ", "underbar", LFUN_UNDERBAR},
47 {TEX_CEDILLA, "\\c", " CcSsTtRLGrlgNKnk", "cedilla", LFUN_CEDILLA},
48 {TEX_UNDERDOT, "\\d", " ", "underdot", LFUN_UNDERDOT},
49 {TEX_CIRCUMFLEX, "\\^", " AEIOUaeiouHJhjCGScgs", "circumflex", LFUN_CIRCUMFLEX},
50 {TEX_CIRCLE, "\\r", " AaUu", "circle", LFUN_CIRCLE},
51 {TEX_TIE, "\\t", " ", "tie", LFUN_TIE},
52 {TEX_BREVE, "\\u", " AaGgUu", "breve", LFUN_BREVE},
53 {TEX_CARON, "\\v", " LSTZlstzCEDNRcednr", "caron", LFUN_CARON},
54 // {TEX_SPECIAL_CARON, "\\q", "","ooo", LFUN_SPECIAL_CARON},
55 {TEX_HUNGUML, "\\H", " OUou", "hugarian_umlaut", LFUN_HUNG_UMLAUT},
56 {TEX_UMLAUT, "\\\"", " AEIOUaeiouy", "umlaut", LFUN_UMLAUT},
57 {TEX_DOT, "\\.", " ZzICGicgEe", "dot", LFUN_DOT},
58 {TEX_OGONEK, "\\k", " AaEe", "ogonek", LFUN_OGONEK},
59 { (tex_accent)0, "", "", "",(kb_action)0}};
62 tex_accent_struct get_accent(kb_action action)
65 while (i<=TEX_MAX_ACCENT){
66 if (lyx_accent_table[i].action == action)
67 return lyx_accent_table[i];
70 struct tex_accent_struct temp = { (tex_accent)0, 0, 0,
75 string DoAccent(const string& s,tex_accent accent)
79 res+=lyx_accent_table[accent].cmd;
81 if (s=="i" || s=="j") {
89 string DoAccent(char c,tex_accent accent)
91 return DoAccent(tostr(c),accent);