]> git.lyx.org Git - lyx.git/blob - src/tex-accent.h
Fix loop when opening TOC widget in an empty document, basically by Richard Heck.
[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 // FIXME This file has nothing to do with TeX anymore
23
24 /* the names used by TeX and XWindows for deadkeys/accents are not the same
25    so here follows a table to clearify the differences. Please correct this
26    if I got it wrong
27
28    |------------------|------------------|------------------|--------------|
29    |      TeX         |     XWindows     |   \bind/LFUN     | used by intl |
30    |------------------|------------------|------------------|--------------|
31    |    grave         |    grave         |LFUN_ACCENT_GRAVE        | grave
32    |    acute         |    acute         |LFUN_ACCENT_ACUTE        | acute
33    |    circumflex    |    circumflex    |LFUN_ACCENT_CIRCUMFLEX   | circumflex
34    | umlaut/dieresis  |    diaeresis     |LFUN_ACCENT_UMLAUT       | umlaut
35    |    tilde         |    tilde         |LFUN_ACCENT_TILDE        | tilde
36    |    macron        |    maron         |LFUN_ACCENT_MACRON       | macron
37    |    dot           |    abovedot      |LFUN_ACCENT_DOT          | dot
38    |    cedilla       |    cedilla       |LFUN_ACCENT_CEDILLA      | cedilla
39    |    underdot      |                  |LFUN_ACCENT_UNDERDOT     | underdot
40    |    underbar      |                  |LFUN_ACCENT_UNDERBAR     | underbar
41    |    hácek         |    caron         |LFUN_ACCENT_CARON        | caron
42    |    breve         |    breve         |LFUN_ACCENT_BREVE        | breve
43    |    tie           |                  |LFUN_ACCENT_TIE          | tie
44    | Hungarian umlaut |    doubleacute   |LFUN_ACCENT_HUNGARIAN_UMLAUT  | hungarian umlaut
45    |    circle        |    abovering     |LFUN_ACCENT_CIRCLE       | circle
46    |                  |    ogonek        |                  |
47    |                  |    iota          |                  |
48    |                  |    voiced_sound  |                  |
49    |                  | semivoiced_sound |                  |
50    |                  |                  |LFUN_ACCENT_SPECIAL_CARON| special caron
51    */
52 // I am not sure how some of the XWindows names coresponds to the TeX ones.
53
54 ///
55 enum tex_accent {
56         ///
57         TEX_NOACCENT = 0,
58         ///
59         TEX_ACUTE,
60         ///
61         TEX_GRAVE,
62         ///
63         TEX_MACRON,
64         ///
65         TEX_TILDE,
66         ///
67         TEX_UNDERBAR,
68         ///
69         TEX_CEDILLA,
70         ///
71         TEX_UNDERDOT,
72         ///
73         TEX_CIRCUMFLEX,
74         ///
75         TEX_CIRCLE,
76         ///
77         TEX_TIE,
78         ///
79         TEX_BREVE,
80         ///
81         TEX_CARON,
82 //  TEX_SPECIAL_CARON,
83         ///
84         TEX_HUNGUML,
85         ///
86         TEX_UMLAUT,
87         ///
88         TEX_DOT,
89         ///
90         TEX_OGONEK,
91         ///
92         TEX_MAX_ACCENT= TEX_OGONEK
93 };
94
95
96 struct tex_accent_struct {
97         ///
98         tex_accent accent;
99         /// UCS4 code point of this accent
100         char_type ucs4;
101         ///
102         char const * name;
103         ///
104         kb_action action;
105 };
106
107 ///
108 extern tex_accent_struct lyx_accent_table[];
109
110 ///
111 extern docstring const DoAccent(docstring const &, tex_accent);
112 ///
113 extern docstring const DoAccent(char_type, tex_accent);
114 ///
115 extern tex_accent_struct get_accent(kb_action action);
116
117 } // namespace lyx
118
119 #endif