]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsTypes.C
add <string> and other small fixes to make
[lyx.git] / src / graphics / GraphicsTypes.C
1 /**
2  * \file GraphicsTypes.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Rob Lahaye
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "graphics/GraphicsTypes.h"
14 #include "support/translator.h"
15
16
17 using std::string;
18
19
20 namespace lyx {
21 namespace graphics {
22
23 /// The translator between the Display enum and corresponding lyx string.
24 Translator<DisplayType, string> displayTranslator(DefaultDisplay, "default");
25
26 void setDisplayTranslator()
27 {
28         /// This variable keeps a tab on whether the translator is set.
29         static bool done = false;
30
31         if (!done) {
32                 done = true;
33
34                 // Fill the display translator
35                 displayTranslator.addPair(DefaultDisplay, "default");
36                 displayTranslator.addPair(MonochromeDisplay, "monochrome");
37                 displayTranslator.addPair(GrayscaleDisplay, "grayscale");
38                 displayTranslator.addPair(ColorDisplay, "color");
39                 displayTranslator.addPair(NoDisplay, "none");
40
41                 // backward compatibility for old lyxrc.display_graphics
42                 displayTranslator.addPair(MonochromeDisplay, "mono");
43                 displayTranslator.addPair(GrayscaleDisplay, "gray");
44                 displayTranslator.addPair(NoDisplay, "no");
45         }
46 }
47
48 } // namespace graphics
49 } // namespace lyx