]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsTypes.C
Various trivial bits 'n' bats about config.h, header blurb etc.
[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 #include "support/std_string.h"
17
18 namespace lyx {
19 namespace graphics {
20
21 /// The translator between the Display enum and corresponding lyx string.
22 Translator<DisplayType, string> displayTranslator(DefaultDisplay, "default");
23
24 void setDisplayTranslator()
25 {
26         /// This variable keeps a tab on whether the translator is set.
27         static bool done = false;
28
29         if (!done) {
30                 done = true;
31
32                 // Fill the display translator
33                 displayTranslator.addPair(DefaultDisplay, "default");
34                 displayTranslator.addPair(MonochromeDisplay, "monochrome");
35                 displayTranslator.addPair(GrayscaleDisplay, "grayscale");
36                 displayTranslator.addPair(ColorDisplay, "color");
37                 displayTranslator.addPair(NoDisplay, "none");
38
39                 // backward compatibility for old lyxrc.display_graphics
40                 displayTranslator.addPair(MonochromeDisplay, "mono");
41                 displayTranslator.addPair(GrayscaleDisplay, "gray");
42                 displayTranslator.addPair(NoDisplay, "no");
43         }
44 }
45
46 } // namespace graphics
47 } // namespace lyx