]> git.lyx.org Git - lyx.git/blob - src/ColorHandler.h
Fix small bug in reading \set_color in lyxrc
[lyx.git] / src / ColorHandler.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 1995-2000 The LyX Team
8  *
9  * ======================================================*/
10
11 #ifndef COLOR_HANDLER_H
12 #define COLOR_HANDLER_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 //#include "config.h"
19 //#include "LString.h"
20
21 // This is only included to provide stuff for the non-public sections
22 #include <X11/Xlib.h>
23
24 #include <map>
25 #include "PainterBase.h"
26 #include "LColor.h"
27
28 class LyXFont;
29 class WorkArea;
30
31 ///
32 class LyXColorHandler {
33 public:
34         ///
35         LyXColorHandler();
36         ///
37         ~LyXColorHandler();
38         ///
39         unsigned long colorPixel(LColor::color c);
40         ///
41         GC getGCForeground(LColor::color c);
42         ///
43         GC getGCLinepars(PainterBase::line_style,
44                          PainterBase::line_width, LColor::color c);
45         /// update the cache after a color definition change
46         void updateColor(LColor::color c);
47
48 private:
49         ///
50         Display * display;
51         ///
52         Colormap colormap;
53         ///
54         GC colorGCcache[LColor::ignore + 1];
55         ///
56         typedef std::map<int, GC> LineGCCache;
57         ///
58         LineGCCache lineGCcache;
59         ///
60         Pixmap drawable;
61 };
62
63 extern LyXColorHandler * lyxColorHandler;
64
65 #endif