]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/lcolorcache.h
fix math fonts with LyX/Mac
[lyx.git] / src / frontends / qt2 / lcolorcache.h
1 // -*- C++ -*-
2 /**
3  * \file lcolorcache.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef LCOLORCACHE_H
13 #define LCOLORCACHE_H
14
15 #include <map>
16
17 #include <qcolor.h>
18
19
20 class LColor_color;
21
22
23 // FIXME: use a fixed-size array not a map ?
24
25 /**
26  * Cache from LColor to QColor.
27  */
28 class LColorCache {
29 public:
30         LColorCache();
31
32         /// get the given color
33         QColor const & get(LColor_color color) const;
34
35         /// clear all colors
36         void clear();
37
38 private:
39         typedef std::map<LColor_color, QColor> lcolor_map;
40
41         mutable lcolor_map colormap;
42 };
43
44 /// singleton instance
45 extern LColorCache lcolorcache;
46
47 #endif // LCOLORCACHE_H