]> git.lyx.org Git - lyx.git/blob - src/ColorCode.h
Update cursor and scrollbar after resize.
[lyx.git] / src / ColorCode.h
1 // -*- C++ -*-
2 /**
3  * \file ColorCode.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * Full author contact details are available in file CREDITS.
8  */
9
10 #ifndef COLOR_CODE_H
11 #define COLOR_CODE_H
12
13 namespace lyx {
14
15 /// Names of colors, including all logical colors
16 enum ColorCode
17 {
18         /// No particular color---clear or default
19         Color_none,
20         /// The different text colors
21         Color_black,
22         ///
23         Color_white,
24         ///
25         Color_red,
26         ///
27         Color_green,
28         ///
29         Color_blue,
30         ///
31         Color_cyan,
32         ///
33         Color_magenta,
34         ///
35         Color_yellow,
36
37         // Needed interface colors
38
39         /// Cursor color
40         Color_cursor,
41         /// Background color
42         Color_background,
43         /// Foreground color
44         Color_foreground,
45         /// Background color of selected text
46         Color_selection,
47         /// Text color in LaTeX mode
48         Color_latex,
49         /// The color used for previews
50         Color_preview,
51
52         /// Text color for notes
53         Color_note,
54         /// Background color of notes
55         Color_notebg,
56         /// Text color for comments
57         Color_comment,
58         /// Background color of comments
59         Color_commentbg,
60         /// Text color for greyedout inset
61         Color_greyedout,
62         /// Background color of greyedout inset
63         Color_greyedoutbg,
64         /// Shaded box background
65         Color_shadedbg,
66
67         /// Label color for branches
68         Color_branchlabel,
69         /// Label color for footnotes
70         Color_footlabel,
71         /// Label color for index insets
72         Color_indexlabel,
73         /// Label color for margin notes
74         Color_marginlabel,
75         /// Label color for URL insets
76         Color_urllabel,
77         /// Label color for URL text
78         Color_urltext,
79
80         /// Color for the depth bars in the margin
81         Color_depthbar,
82         /// Color for marking foreign language words
83         Color_language,
84
85         /// Text color for command insets
86         Color_command,
87         /// Background color for command insets
88         Color_commandbg,
89         /// Frame color for command insets
90         Color_commandframe,
91
92         /// Special chars text color
93         Color_special,
94
95         /// Graphics inset background color
96         Color_graphicsbg,
97         /// Math inset text color
98         Color_math,
99         /// Math inset background color
100         Color_mathbg,
101         /// Macro math inset background color
102         Color_mathmacrobg,
103         /// Macro math inset background color hovered
104         Color_mathmacrohoverbg,
105         /// Macro math label color
106         Color_mathmacrolabel,
107         /// Macro math frame color
108         Color_mathmacroframe,
109         /// Macro math blended color 
110         Color_mathmacroblend,
111         /// Math inset frame color under focus
112         Color_mathframe,
113         /// Math inset frame color not under focus
114         Color_mathcorners,
115         /// Math line color
116         Color_mathline,
117
118         /// caption frame color
119         Color_captionframe,
120
121         /// collapsable insets text
122         Color_collapsable,
123         /// collapsable insets frame
124         Color_collapsableframe,
125
126         /// Inset marker background color
127         Color_insetbg,
128         /// Inset marker frame color
129         Color_insetframe,
130
131         /// Error box text color
132         Color_error,
133         /// EOL marker color
134         Color_eolmarker,
135         /// Added space colour
136         Color_added_space,
137         /// Appendix marker color
138         Color_appendix,
139         /// changebar color
140         Color_changebar,
141         /// deleted text color
142         Color_deletedtext,
143         /// added text color
144         Color_addedtext,
145         /// Top and bottom line color
146         Color_topline,
147         /// Table line color
148         Color_tabularline,
149         /// Table line color
150         Color_tabularonoffline,
151         /// Bottom area color
152         Color_bottomarea,
153         /// New page color
154         Color_newpage,
155         /// Page break color
156         Color_pagebreak,
157
158         // FIXME: why are the next four separate ??
159         /// Color used for button frame
160         Color_buttonframe,
161         /// Color used for bottom background
162         Color_buttonbg,
163         /// Color used for buttom under focus
164         Color_buttonhoverbg,
165
166         // Logical attributes
167
168         /// Color is inherited
169         Color_inherit,
170         /// For ignoring updates of a color
171         Color_ignore
172 };
173
174
175 struct RGBColor {
176         unsigned int r;
177         unsigned int g;
178         unsigned int b;
179         RGBColor() : r(0), g(0), b(0) {}
180         RGBColor(unsigned int red, unsigned int green, unsigned int blue)
181                 : r(red), g(green), b(blue) {}
182 };
183
184 inline bool operator==(RGBColor const & c1, RGBColor const & c2)
185 {
186         return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
187 }
188
189
190 inline bool operator!=(RGBColor const & c1, RGBColor const & c2)
191 {
192         return !(c1 == c2);
193 }
194
195 } // namespace lyx
196
197 #endif