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