From fca3a698b1d81fec5f735491b67dfbd3c65aa5b7 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 21 Jan 2022 20:30:47 +0100 Subject: [PATCH] [draw] enum -> int --- src/terminal/draw.c | 12 ++++++------ src/terminal/draw.h | 11 ++++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/terminal/draw.c b/src/terminal/draw.c index 2f66ad087..35f7ec94e 100644 --- a/src/terminal/draw.c +++ b/src/terminal/draw.c @@ -336,12 +336,12 @@ fix_dwchar_around_box(struct terminal *term, struct el_box *box, int border, #ifdef CONFIG_UTF8 void draw_char(struct terminal *term, int x, int y, - unicode_val_T data, enum screen_char_attr attr, + unicode_val_T data, int attr, struct color_pair *color) #else void draw_char(struct terminal *term, int x, int y, - unsigned char data, enum screen_char_attr attr, + unsigned char data, int attr, struct color_pair *color) #endif /* CONFIG_UTF8 */ { @@ -359,7 +359,7 @@ draw_char(struct terminal *term, int x, int y, void draw_box(struct terminal *term, struct el_box *box, - unsigned char data, enum screen_char_attr attr, + unsigned char data, int attr, struct color_pair *color) { struct screen_char *line, *pos, *end; @@ -423,7 +423,7 @@ draw_shadow(struct terminal *term, struct el_box *box, static void draw_text_utf8(struct terminal *term, int x, int y, char *text, int length, - enum screen_char_attr attr, struct color_pair *color) + int attr, struct color_pair *color) { struct screen_char *start, *pos; char *end = text + length; @@ -496,7 +496,7 @@ draw_text_utf8(struct terminal *term, int x, int y, void draw_text(struct terminal *term, int x, int y, char *text, int length, - enum screen_char_attr attr, struct color_pair *color) + int attr, struct color_pair *color) { int end_pos; struct screen_char *pos, *end; @@ -562,7 +562,7 @@ draw_text(struct terminal *term, int x, int y, void draw_dlg_text(struct dialog_data *dlg_data, int x, int y, char *text, int length, - enum screen_char_attr attr, struct color_pair *color) + int attr, struct color_pair *color) { struct terminal *term = dlg_data->win->term; struct el_box *box = &dlg_data->real_box; diff --git a/src/terminal/draw.h b/src/terminal/draw.h index 8078db0ea..6622f25da 100644 --- a/src/terminal/draw.h +++ b/src/terminal/draw.h @@ -28,6 +28,7 @@ struct terminal; * * XXX: The bold mask is used as part of the color encoding. */ enum screen_char_attr { + SCREEN_ATTR_NONE = 0, SCREEN_ATTR_UNSEARCHABLE = 0x01, SCREEN_ATTR_NODE_NUMBER = 0x02, SCREEN_ATTR_BOLD = 0x08, @@ -256,17 +257,17 @@ void draw_border_cross(struct terminal *, int x, int y, /** Draws a char. */ #ifdef CONFIG_UTF8 void draw_char(struct terminal *term, int x, int y, - unicode_val_T data, enum screen_char_attr attr, + unicode_val_T data, int attr, struct color_pair *color); #else void draw_char(struct terminal *term, int x, int y, - unsigned char data, enum screen_char_attr attr, + unsigned char data, int attr, struct color_pair *color); #endif /* CONFIG_UTF8 */ /** Draws area defined by @a box using the same colors and attributes. */ void draw_box(struct terminal *term, struct el_box *box, - unsigned char data, enum screen_char_attr attr, + unsigned char data, int attr, struct color_pair *color); /** Draws a shadow of @a width and @a height with color @a color @@ -286,13 +287,13 @@ void fix_dwchar_around_box(struct terminal *term, struct el_box *box, int border /** Draws @a length chars from @a text. */ void draw_text(struct terminal *term, int x, int y, char *text, int length, - enum screen_char_attr attr, + int attr, struct color_pair *color); /** Draws text for dialogs. */ void draw_dlg_text(struct dialog_data *dlg_data, int x, int y, char *text, int length, - enum screen_char_attr attr, struct color_pair *color); + int attr, struct color_pair *color); /** Draws @a length chars from @a line on the screen. */