]> git.lyx.org Git - lyx.git/blob - src/tex-accent.h
d5b8f3058bc5f61ff6eb597d9bb06d4488fc23ad
[lyx.git] / src / tex-accent.h
1 // -*- C++ -*-
2 /**
3  * \file tex-accent.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author Matthias Ettrich
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef TEX_ACCENT
14 #define TEX_ACCENT
15
16 #include "lfuns.h"
17 #include "support/docstring.h"
18
19
20 namespace lyx {
21
22 /* the names used by TeX and XWindows for deadkeys/accents are not the same
23    so here follows a table to clearify the differences. Please correct this
24    if I got it wrong
25
26    |------------------|------------------|------------------|--------------|
27    |      TeX         |     XWindows     |   \bind/LFUN     | used by intl |
28    |------------------|------------------|------------------|--------------|
29    |    grave         |    grave         |LFUN_ACCENT_GRAVE        | grave
30    |    acute         |    acute         |LFUN_ACCENT_ACUTE        | acute
31    |    circumflex    |    circumflex    |LFUN_ACCENT_CIRCUMFLEX   | circumflex
32    | umlaut/dieresis  |    diaeresis     |LFUN_ACCENT_UMLAUT       | umlaut
33    |    tilde         |    tilde         |LFUN_ACCENT_TILDE        | tilde
34    |    macron        |    maron         |LFUN_ACCENT_MACRON       | macron
35    |    dot           |    abovedot      |LFUN_ACCENT_DOT          | dot
36    |    cedilla       |    cedilla       |LFUN_ACCENT_CEDILLA      | cedilla
37    |    underdot      |                  |LFUN_ACCENT_UNDERDOT     | underdot
38    |    underbar      |                  |LFUN_ACCENT_UNDERBAR     | underbar
39    |    hácek         |    caron         |LFUN_ACCENT_CARON        | caron
40    |    breve         |    breve         |LFUN_ACCENT_BREVE        | breve
41    |    tie           |                  |LFUN_ACCENT_TIE          | tie
42    | Hungarian umlaut |    doubleacute   |LFUN_ACCENT_HUNGARIAN_UMLAUT  | hungarian umlaut
43    |    circle        |    abovering     |LFUN_ACCENT_CIRCLE       | circle
44    |                  |    ogonek        |                  |
45    |                  |    iota          |                  |
46    |                  |    voiced_sound  |                  |
47    |                  | semivoiced_sound |                  |
48    |                  |                  |LFUN_ACCENT_SPECIAL_CARON| special caron
49    */
50 // I am not sure how some of the XWindows names coresponds to the TeX ones.
51
52 ///
53 enum tex_accent {
54         ///
55         TEX_NOACCENT = 0,
56         ///
57         TEX_ACUTE,
58         ///
59         TEX_GRAVE,
60         ///
61         TEX_MACRON,
62         ///
63         TEX_TILDE,
64         ///
65         TEX_UNDERBAR,
66         ///
67         TEX_CEDILLA,
68         ///
69         TEX_UNDERDOT,
70         ///
71         TEX_CIRCUMFLEX,
72         ///
73         TEX_CIRCLE,
74         ///
75         TEX_TIE,
76         ///
77         TEX_BREVE,
78         ///
79         TEX_CARON,
80 //  TEX_SPECIAL_CARON,
81         ///
82         TEX_HUNGUML,
83         ///
84         TEX_UMLAUT,
85         ///
86         TEX_DOT,
87         ///
88         TEX_OGONEK,
89         ///
90         TEX_MAX_ACCENT= TEX_OGONEK
91 };
92
93
94 /** the native is so we know what characters TeX can write in a decent way
95  it should be up to the user if _all_ characters should be allowed to
96  be accented. Lgb. */
97 struct tex_accent_struct {
98         ///
99         tex_accent accent;
100         ///
101         char const * cmd;
102 #if 0
103         ///
104         char const * native;
105 #endif
106         ///
107         char const * name;
108         ///
109         kb_action action;
110 };
111
112 ///
113 extern tex_accent_struct lyx_accent_table[];
114
115 ///
116 extern docstring const DoAccent(docstring const &, tex_accent);
117 ///
118 extern docstring const DoAccent(char_type, tex_accent);
119
120
121 } // namespace lyx
122
123 #endif