mc/lib/tty/color-internal.h
Egmont Koblinger e593572bb9 Ticket #2169: Add support for 256 colors terminals
Forget the old limit of 8 background and 16 foreground colors.
From now on Midnight Commander can use all the 256 colors,
as your favorite terminal emulator supports them - or not,
in which case it's not going to stay your favorite terminal for long.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-12-29 11:58:10 +02:00

61 lines
1.6 KiB
C

/** \file color-internal.h
* \brief Header: Internal stuff of color setup
*/
#ifndef MC__COLOR_INTERNAL_H
#define MC__COLOR_INTERNAL_H
#include <sys/types.h> /* size_t */
#include "lib/global.h"
#ifdef HAVE_SLANG
#include "tty-slang.h"
#else
#include "tty-ncurses.h"
#endif /* HAVE_SLANG */
/*** typedefs(not structures) and defined constants **********************************************/
/*** enums ***************************************************************************************/
/* *INDENT-OFF* */
typedef enum {
SPEC_A_REVERSE = -100,
SPEC_A_BOLD = -101,
SPEC_A_BOLD_REVERSE = -102,
SPEC_A_UNDERLINE = -103
} tty_special_color_t;
/* *INDENT-ON* */
/*** structures declarations (and typedefs of structures)*****************************************/
typedef struct mc_color_pair_struct
{
int ifg;
int ibg;
int attr;
size_t pair_index;
gboolean is_temp;
} tty_color_pair_t;
/*** global variables defined in .c file *********************************************************/
extern gboolean use_colors;
extern gboolean mc_tty_color_disable;
/*** declarations of public functions ************************************************************/
const char *tty_color_get_name_by_index (int);
int tty_color_get_index_by_name (const char *);
int tty_attr_get_bits (const char *);
void tty_color_init_lib (gboolean, gboolean);
void tty_color_deinit_lib (void);
void tty_color_try_alloc_pair_lib (tty_color_pair_t *);
/*** inline functions ****************************************************************************/
#endif /* MC_COLOR_INTERNAL_H */