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