small typo
[midnight-commander.git] / src / color.h
blob9103bf0a6c457f25a433d3eed066df0abd0d4c7a
1 #ifndef __COLOR_H
2 #define __COLOR_H
4 void init_colors (void);
6 extern int use_colors;
7 extern int disable_colors;
9 extern int attr_pairs [];
10 #ifdef HAVE_SLANG
11 # define MY_COLOR_PAIR(x) COLOR_PAIR(x)
12 #else
13 # define MY_COLOR_PAIR(x) (COLOR_PAIR(x) | attr_pairs [x])
14 #endif
16 #define BEST_COLOR(co,bw) (use_colors ? MY_COLOR_PAIR(co) : bw)
18 /* Beware! When using Slang with color, not all the indexes are free.
19 See myslang.h (A_*) */
20 #define NORMAL_COLOR BEST_COLOR (1, 0)
21 #define SELECTED_COLOR BEST_COLOR (2, A_REVERSE)
22 #define MARKED_COLOR BEST_COLOR (3, A_BOLD)
24 #ifdef HAVE_SLANG
25 #define MARKED_SELECTED_COLOR BEST_COLOR (4, (SLtt_Use_Ansi_Colors ? A_BOLD_REVERSE : A_REVERSE | A_BOLD))
26 #else
27 #define MARKED_SELECTED_COLOR BEST_COLOR (4, A_REVERSE | A_BOLD)
28 #endif
30 #define ERROR_COLOR BEST_COLOR (5, 0)
31 #define MENU_ENTRY_COLOR BEST_COLOR (6, A_REVERSE)
32 #define REVERSE_COLOR BEST_COLOR (7, A_REVERSE)
33 #define Q_SELECTED_COLOR BEST_COLOR (2, 0)
34 #define Q_UNSELECTED_COLOR REVERSE_COLOR
36 extern int dialog_colors[4];
37 extern int alarm_colors[4];
39 /* Dialog colors */
40 #define COLOR_NORMAL BEST_COLOR (8, A_REVERSE)
41 #define COLOR_FOCUS BEST_COLOR (9, A_BOLD)
42 #define COLOR_HOT_NORMAL BEST_COLOR (10, 0)
43 #define COLOR_HOT_FOCUS BEST_COLOR (11, 0)
45 #define VIEW_UNDERLINED_COLOR BEST_COLOR (12, A_UNDERLINE)
46 #define MENU_SELECTED_COLOR BEST_COLOR (13, A_BOLD)
47 #define MENU_HOT_COLOR BEST_COLOR (14, 0)
48 #define MENU_HOTSEL_COLOR BEST_COLOR (15, 0)
50 #define HELP_NORMAL_COLOR BEST_COLOR (16, A_REVERSE)
51 #define HELP_ITALIC_COLOR BEST_COLOR (17, A_REVERSE)
52 #define HELP_BOLD_COLOR BEST_COLOR (18, A_REVERSE)
53 #define HELP_LINK_COLOR BEST_COLOR (19, 0)
54 #define HELP_SLINK_COLOR BEST_COLOR (20, A_BOLD)
57 * This should be selectable independently. Default has to be black background
58 * foreground does not matter at all.
60 #define GAUGE_COLOR BEST_COLOR (21, 0)
61 #define INPUT_COLOR BEST_COLOR (22, 0)
63 /* Add this to color panel, on BW all pairs are normal */
64 #define DIRECTORY_COLOR BEST_COLOR (23, 0)
65 #define EXECUTABLE_COLOR BEST_COLOR (24, 0)
66 #define LINK_COLOR BEST_COLOR (25, 0)
67 #define STALLED_LINK_COLOR BEST_COLOR (26, A_UNDERLINE)
68 #define DEVICE_COLOR BEST_COLOR (27, 0)
69 #define SPECIAL_COLOR BEST_COLOR (28, 0)
70 #define CORE_COLOR BEST_COLOR (29, 0)
73 /* For the default color any unused index may be chosen. */
74 #define DEFAULT_COLOR_INDEX 30
75 #define DEFAULT_COLOR BEST_COLOR (DEFAULT_COLOR_INDEX, 0)
78 * editor colors - only 3 for normal, search->found, and select, respectively
79 * Last is defined to view color.
81 #define EDITOR_NORMAL_COLOR_INDEX 34
82 #define EDITOR_NORMAL_COLOR BEST_COLOR (EDITOR_NORMAL_COLOR_INDEX, 0)
83 #define EDITOR_BOLD_COLOR BEST_COLOR (35, A_BOLD)
84 #define EDITOR_MARKED_COLOR BEST_COLOR (36, A_REVERSE)
85 #define EDITOR_UNDERLINED_COLOR VIEW_UNDERLINED_COLOR
87 #ifdef HAVE_SLANG
88 # define CTYPE char *
89 #else
90 # define CTYPE int
91 #endif
93 void mc_init_pair (int index, CTYPE foreground, CTYPE background);
94 int try_alloc_color_pair (char *fg, char *bg);
95 void dealloc_color_pairs (void);
97 #endif /* __COLOR_H */