]> git.lyx.org Git - lyx.git/blob - src/ColorHandler.h
f868fbfb341c247d72a10e2a543d4a8c85ee7690
[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 private:
46         ///
47         Display * display;
48         ///
49         Colormap colormap;
50         ///
51         GC colorGCcache[LColor::ignore + 1];
52         ///
53         typedef std::map<int, GC> LineGCCache;
54         ///
55         LineGCCache lineGCcache;
56         ///
57         Pixmap drawable;
58 };
59
60 extern LyXColorHandler * lyxColorHandler;
61
62 #endif