2009-05-10 19:01:15 +04:00
|
|
|
|
|
|
|
/** \file color-internal.h
|
|
|
|
* \brief Header: Internal stuff of color setup
|
|
|
|
*/
|
|
|
|
|
2010-11-08 13:21:45 +03:00
|
|
|
#ifndef MC__COLOR_INTERNAL_H
|
|
|
|
#define MC__COLOR_INTERNAL_H
|
2009-05-10 19:01:15 +04:00
|
|
|
|
2009-09-17 02:07:04 +04:00
|
|
|
#include <sys/types.h> /* size_t */
|
2009-05-10 19:01:15 +04:00
|
|
|
|
2010-01-20 18:11:52 +03:00
|
|
|
#include "lib/global.h"
|
2009-05-13 17:05:55 +04:00
|
|
|
|
2009-05-10 19:01:15 +04:00
|
|
|
#ifdef HAVE_SLANG
|
2010-11-08 13:21:45 +03:00
|
|
|
#include "tty-slang.h"
|
2009-05-10 19:01:15 +04:00
|
|
|
#else
|
2010-11-08 13:21:45 +03:00
|
|
|
#include "tty-ncurses.h"
|
2009-09-17 02:07:04 +04:00
|
|
|
#endif /* HAVE_SLANG */
|
2009-05-10 19:01:15 +04:00
|
|
|
|
2010-11-08 13:21:45 +03:00
|
|
|
/*** 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)*****************************************/
|
2009-09-09 18:56:52 +04:00
|
|
|
|
2023-09-10 12:22:26 +03:00
|
|
|
/* Screen library specific color pair */
|
|
|
|
typedef struct
|
2010-02-26 12:25:53 +03:00
|
|
|
{
|
2023-09-10 12:22:26 +03:00
|
|
|
int fg;
|
|
|
|
int bg;
|
2010-12-29 12:58:10 +03:00
|
|
|
int attr;
|
|
|
|
size_t pair_index;
|
2009-09-10 16:14:18 +04:00
|
|
|
gboolean is_temp;
|
2023-09-10 12:22:26 +03:00
|
|
|
} tty_color_lib_pair_t;
|
2009-05-10 19:01:15 +04:00
|
|
|
|
2010-11-08 13:21:45 +03:00
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
|
|
|
|
extern gboolean use_colors;
|
|
|
|
extern gboolean mc_tty_color_disable;
|
|
|
|
|
|
|
|
/*** declarations of public functions ************************************************************/
|
2009-09-14 17:43:03 +04:00
|
|
|
|
2021-05-16 13:56:44 +03:00
|
|
|
const char *tty_color_get_name_by_index (int idx);
|
|
|
|
int tty_color_get_index_by_name (const char *color_name);
|
|
|
|
int tty_attr_get_bits (const char *attrs);
|
2009-09-14 17:43:03 +04:00
|
|
|
|
2021-05-16 13:56:44 +03:00
|
|
|
void tty_color_init_lib (gboolean disable, gboolean force);
|
2009-09-14 17:43:03 +04:00
|
|
|
void tty_color_deinit_lib (void);
|
|
|
|
|
2023-09-10 12:22:26 +03:00
|
|
|
void tty_color_try_alloc_lib_pair (tty_color_lib_pair_t * mc_color_pair);
|
2009-05-10 19:01:15 +04:00
|
|
|
|
2010-11-08 13:21:45 +03:00
|
|
|
/*** inline functions ****************************************************************************/
|
2021-05-16 13:56:44 +03:00
|
|
|
|
|
|
|
#endif /* MC__COLOR_INTERNAL_H */
|