mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Merge with git+ssh://pasky.or.cz/srv/git/elinks.git
This commit is contained in:
commit
0981664034
@ -21,12 +21,13 @@
|
||||
int_bounds(&(x), 0, (term)->width - 1); \
|
||||
int_bounds(&(y), 0, (term)->height - 1); \
|
||||
} while (0)
|
||||
#if defined(CONFIG_TRUE_COLOR)
|
||||
#define clear_screen_char_color(schar) do { memset((schar)->color, 0, 6); } while (0)
|
||||
#elif defined(CONFIG_88_COLORS) || defined(CONFIG_256_COLORS)
|
||||
#define clear_screen_char_color(schar) do { memset((schar)->color, 0, 2); } while (0)
|
||||
|
||||
#if SCREEN_COLOR_SIZE > 1
|
||||
#define clear_screen_char_color(schar) \
|
||||
do { memset((schar)->color, 0, SCREEN_COLOR_SIZE); } while (0)
|
||||
#else
|
||||
#define clear_screen_char_color(schar) do { (schar)->color[0] = 0; } while (0)
|
||||
#define clear_screen_char_color(schar) \
|
||||
do { (schar)->color[0] = 0; } while (0)
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -7,6 +7,16 @@ struct color_pair;
|
||||
struct box;
|
||||
struct terminal;
|
||||
|
||||
#if defined(CONFIG_TRUE_COLOR)
|
||||
/* 0, 1, 2 - rgb foreground; 3, 4, 5 - rgb background */
|
||||
#define SCREEN_COLOR_SIZE 6
|
||||
#elif defined(CONFIG_88_COLORS) || defined(CONFIG_256_COLORS)
|
||||
/* 0 is foreground; 1 is background */
|
||||
#define SCREEN_COLOR_SIZE 2
|
||||
#else
|
||||
#define SCREEN_COLOR_SIZE 1
|
||||
#endif
|
||||
|
||||
/* All attributes should fit inside an unsigned char. */
|
||||
/* XXX: The bold mask is used as part of the color encoding. */
|
||||
enum screen_char_attr {
|
||||
@ -30,16 +40,8 @@ struct screen_char {
|
||||
/* Attributes are screen_char_attr bits. */
|
||||
unsigned char attr;
|
||||
|
||||
#if defined(CONFIG_TRUE_COLOR)
|
||||
/* 0, 1, 2 - rgb foreground,
|
||||
3, 4, 5 - rgb background */
|
||||
unsigned char color[6];
|
||||
/* The encoded fore- and background color. */
|
||||
#elif defined(CONFIG_88_COLORS) || defined(CONFIG_256_COLORS)
|
||||
unsigned char color[2];
|
||||
#else
|
||||
unsigned char color[1];
|
||||
#endif
|
||||
/* The fore- and background color. */
|
||||
unsigned char color[SCREEN_COLOR_SIZE];
|
||||
};
|
||||
|
||||
#define copy_screen_chars(to, from, amount) \
|
||||
|
@ -422,13 +422,7 @@ struct screen_state {
|
||||
unsigned char bold;
|
||||
unsigned char attr;
|
||||
/* Following should match struct screen_char color field. */
|
||||
#if defined(CONFIG_TRUE_COLOR)
|
||||
unsigned char color[6];
|
||||
#elif defined(CONFIG_88_COLORS) || defined(CONFIG_256_COLORS)
|
||||
unsigned char color[2];
|
||||
#else
|
||||
unsigned char color[1];
|
||||
#endif
|
||||
unsigned char color[SCREEN_COLOR_SIZE];
|
||||
};
|
||||
|
||||
#if defined(CONFIG_TRUE_COLOR)
|
||||
|
Loading…
Reference in New Issue
Block a user