HaikuDepot: notify work status from main window
[haiku.git] / src / apps / terminal / Colors.h
blob1b83f1cbd09a4a542239328cf1d5b660c359baea
1 /*
2 * Copyright 2010-2013, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Stefano Ceccherini, stefano.ceccherini@gmail.com
7 * Siarzhuk Zharski, zharik@gmx.li
8 */
9 #ifndef _COLORS_H
10 #define _COLORS_H
13 #include <InterfaceDefs.h>
16 struct color_scheme {
17 const char* name;
18 rgb_color text_fore_color;
19 rgb_color text_back_color;
20 rgb_color cursor_fore_color;
21 rgb_color cursor_back_color;
22 rgb_color select_fore_color;
23 rgb_color select_back_color;
24 bool operator==(const color_scheme& color);
27 extern color_scheme gCustomColorScheme;
28 extern const color_scheme* gPredefinedColorSchemes[];
30 const uint kANSIColorCount = 16;
31 const uint kTermColorCount = 256;
34 // Helper class handling XColorName/rgb:xxx/xxx/xxx -> rgb_color conversions.
35 // The source of XColorNames is wide available rgb.txt for X11 System.
36 // It is stored in "XColorsTable" application resource as array of
37 // "hash <-> rgb_color" pairs. The table is loaded only on demand.
38 // Name hashes must be sorted to let lookup procedure work properly
39 class XColorsTable {
41 struct _XColorEntry {
42 uint32 hash;
43 rgb_color color;
46 public:
47 XColorsTable();
48 ~XColorsTable();
50 status_t LookUpColor(const char* name, rgb_color* color);
51 private:
52 status_t _LoadXColorsTable();
53 uint32 _HashName(const char* name);
55 const _XColorEntry* fTable;
56 size_t fCount;
59 extern XColorsTable gXColorsTable;
61 #endif // _COLORS_H