]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsTypes.C
If I ever see another licence blurb again, it'll be too soon...
[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 available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "graphics/GraphicsTypes.h"
14 #include "support/translator.h"
15
16 namespace lyx {
17 namespace graphics {
18
19 /// The translator between the Display enum and corresponding lyx string.
20 Translator<DisplayType, string> displayTranslator(DefaultDisplay, "default");
21
22 void setDisplayTranslator()
23 {
24         /// This variable keeps a tab on whether the translator is set.
25         static bool done = false;
26
27         if (!done) {
28                 done = true;
29
30                 // Fill the display translator
31                 displayTranslator.addPair(DefaultDisplay, "default");
32                 displayTranslator.addPair(MonochromeDisplay, "monochrome");
33                 displayTranslator.addPair(GrayscaleDisplay, "grayscale");
34                 displayTranslator.addPair(ColorDisplay, "color");
35                 displayTranslator.addPair(NoDisplay, "none");
36
37                 // backward compatibility for old lyxrc.display_graphics
38                 displayTranslator.addPair(MonochromeDisplay, "mono");
39                 displayTranslator.addPair(GrayscaleDisplay, "gray");
40                 displayTranslator.addPair(NoDisplay, "no");
41         }
42 }
43
44 } // namespace graphics
45 } // namespace lyx