diff --git a/src/bfu/button.c b/src/bfu/button.c index b522321b..eb1e1aa0 100644 --- a/src/bfu/button.c +++ b/src/bfu/button.c @@ -185,7 +185,7 @@ display_button(struct dialog_data *dlg_data, struct widget_data *widget_data) { struct terminal *term = dlg_data->win->term; struct color_pair *color, *shortcut_color; - struct box *pos = &widget_data->box; + struct el_box *pos = &widget_data->box; int len, x; int sel = is_selected_widget(dlg_data, widget_data); diff --git a/src/bfu/checkbox.c b/src/bfu/checkbox.c index 35224af9..3c6a4122 100644 --- a/src/bfu/checkbox.c +++ b/src/bfu/checkbox.c @@ -64,7 +64,7 @@ display_checkbox(struct dialog_data *dlg_data, struct widget_data *widget_data) struct terminal *term = dlg_data->win->term; struct color_pair *color; unsigned char *text; - struct box *pos = &widget_data->box; + struct el_box *pos = &widget_data->box; int selected = is_selected_widget(dlg_data, widget_data); if (selected) { diff --git a/src/bfu/dialog.c b/src/bfu/dialog.c index f02df257..155c2d49 100644 --- a/src/bfu/dialog.c +++ b/src/bfu/dialog.c @@ -183,8 +183,8 @@ static int check_range(struct dialog_data *dlg_data, struct widget_data *widget_data) { if (!dlg_data->dlg->layout.only_widgets) { - struct box *box = &widget_data->box; - struct box *dlgbox = &dlg_data->real_box; + struct el_box *box = &widget_data->box; + struct el_box *dlgbox = &dlg_data->real_box; int y = box->y - dlgbox->y; if ((y < dlg_data->y) || (y >= dlg_data->y + dlgbox->height)) { diff --git a/src/bfu/dialog.h b/src/bfu/dialog.h index e543d8c8..ceeb67a5 100644 --- a/src/bfu/dialog.h +++ b/src/bfu/dialog.h @@ -153,14 +153,14 @@ struct dialog_data { /** Size and location of the dialog box, excluding the drop shadow. * This includes the outer border and the frame. * The coordinates are relative to the terminal. */ - struct box box; + struct el_box box; /** Size and location of the widget area and the inner border. * This is the area in which widgets can be drawn. * The frame of the dialog box is drawn around this area, * and the outer border is around the frame. * The coordinates are relative to the terminal. */ - struct box real_box; + struct el_box real_box; /** Vertical scrolling of the widget area of the dialog box. * Widget Y screen coordinate = widget_data.box.y - dialog_data.y. diff --git a/src/bfu/inpfield.c b/src/bfu/inpfield.c index d0e61131..19d1c029 100644 --- a/src/bfu/inpfield.c +++ b/src/bfu/inpfield.c @@ -316,7 +316,7 @@ display_field_do(struct dialog_data *dlg_data, struct widget_data *widget_data, draw_dlg_text(dlg_data, widget_data->box.x, widget_data->box.y, text, w, 0, color); } else { - struct box box; + struct el_box box; copy_box(&box, &widget_data->box); box.width = w; diff --git a/src/bfu/leds.c b/src/bfu/leds.c index fc2c92a3..693abbab 100644 --- a/src/bfu/leds.c +++ b/src/bfu/leds.c @@ -287,7 +287,7 @@ draw_leds(struct session *ses) end: #ifdef CONFIG_UTF8 if (term->utf8_cp) { - struct box box; + struct el_box box; set_box(&box, xpos, ypos, LEDS_COUNT + 1, 1); fix_dwchar_around_box(term, &box, 0, 0, 0); } diff --git a/src/bfu/menu.c b/src/bfu/menu.c index 7e76fd91..3b426788 100644 --- a/src/bfu/menu.c +++ b/src/bfu/menu.c @@ -543,7 +543,7 @@ display_menu(struct terminal *term, struct menu *menu) struct color_pair *normal_color = get_bfu_color(term, "menu.normal"); struct color_pair *selected_color = get_bfu_color(term, "menu.selected"); struct color_pair *frame_color = get_bfu_color(term, "menu.frame"); - struct box box; + struct el_box box; int p; int menu_height; @@ -1089,7 +1089,7 @@ display_mainmenu(struct terminal *term, struct menu *menu) struct color_pair *selected_color = get_bfu_color(term, "menu.selected"); int p = 0; int i; - struct box box; + struct el_box box; /* FIXME: menu horizontal scrolling do not work well yet, we need to cache * menu items width and recalculate them only when needed (ie. language change) diff --git a/src/bfu/menu.h b/src/bfu/menu.h index aa076dbe..7be48814 100644 --- a/src/bfu/menu.h +++ b/src/bfu/menu.h @@ -144,7 +144,7 @@ struct menu { int selected; /* The current selected item. -1 means none */ int first, last; /* The first and last visible menu items */ - struct box box; /* The visible area of the menu */ + struct el_box box; /* The visible area of the menu */ int parent_x, parent_y; /* The coordinates of the parent window */ int hotkeys; /* Whether to check and display hotkeys */ diff --git a/src/bfu/text.c b/src/bfu/text.c index 9031549f..52818893 100644 --- a/src/bfu/text.c +++ b/src/bfu/text.c @@ -356,7 +356,7 @@ static widget_handler_status_T display_text(struct dialog_data *dlg_data, struct widget_data *widget_data) { struct window *win = dlg_data->win; - struct box box; + struct el_box box; int scale, current, step; int lines = widget_data->info.text.lines; @@ -487,7 +487,7 @@ mouse_text(struct dialog_data *dlg_data, struct widget_data *widget_data) int scroller_height = widget_data->info.text.scroller_height; int scroller_middle = scroller_y + scroller_height/2 - widget_data->info.text.scroller_last_dir; - struct box scroller_box; + struct el_box scroller_box; struct term_event *ev = dlg_data->term_event; set_box(&scroller_box, diff --git a/src/bfu/widget.h b/src/bfu/widget.h index 2cafbd6b..49c06f01 100644 --- a/src/bfu/widget.h +++ b/src/bfu/widget.h @@ -66,7 +66,7 @@ struct widget_data { * For WIDGET_LISTBOX: @cdata points to struct listbox_data. */ unsigned char *cdata; - struct box box; + struct el_box box; union { struct widget_data_info_field field; diff --git a/src/dialogs/progress.c b/src/dialogs/progress.c index 9f6e2ef2..8c74444a 100644 --- a/src/dialogs/progress.c +++ b/src/dialogs/progress.c @@ -110,7 +110,7 @@ draw_progress_bar(struct progress *progress, struct terminal *term, { /* Note : values > 100% are theorically possible and were seen. */ int percent = 0; - struct box barprogress; + struct el_box barprogress; if (progress->size > 0) percent = (int) ((longlong) 100 * progress->pos / progress->size); diff --git a/src/dialogs/status.c b/src/dialogs/status.c index a9f6aec4..1c90e0bd 100644 --- a/src/dialogs/status.c +++ b/src/dialogs/status.c @@ -175,7 +175,7 @@ display_status_bar(struct session *ses, struct terminal *term, int tabs_count) struct session_status *status = &ses->status; struct color_pair *text_color = NULL; int msglen; - struct box box; + struct el_box box; #ifdef CONFIG_MARKS if (ses->kbdprefix.mark != KP_MARK_NOTHING) { @@ -300,7 +300,7 @@ display_tab_bar(struct session *ses, struct terminal *term, int tabs_count) int tab_remain_width = int_max(0, term->width - tab_total_width); int tab_add = int_max(1, (tab_remain_width / tabs_count)); int tab_num; - struct box box; + struct el_box box; if (status->show_tabs_bar_at_top) set_box(&box, 0, status->show_title_bar, term->width, 1); else set_box(&box, 0, term->height - (status->show_status_bar ? 2 : 1), 0, 1); @@ -404,7 +404,7 @@ display_title_bar(struct session *ses, struct terminal *term) /* Clear the old title */ if (!get_opt_bool("ui.show_menu_bar_always", NULL)) { - struct box box; + struct el_box box; set_box(&box, 0, 0, term->width, 1); draw_box(term, &box, ' ', 0, get_bfu_color(term, "title.title-bar")); diff --git a/src/document/document.h b/src/document/document.h index 6f28372b..fc585291 100644 --- a/src/document/document.h +++ b/src/document/document.h @@ -23,7 +23,7 @@ struct screen_char; struct node { LIST_HEAD(struct node); - struct box box; + struct el_box box; }; diff --git a/src/document/html/README b/src/document/html/README index 1d5fac3d..231b557b 100644 --- a/src/document/html/README +++ b/src/document/html/README @@ -104,8 +104,8 @@ those). If you hit a floating box, you: So, an implementation might have something like this instead of the "duplication": - struct box { - struct box floaters[]; + struct el_box { + struct el_box floaters[]; } where floaters are children of this box; normally you have one diff --git a/src/document/html/frames.h b/src/document/html/frames.h index 876e13b6..f2ce8aa1 100644 --- a/src/document/html/frames.h +++ b/src/document/html/frames.h @@ -23,7 +23,7 @@ struct frameset_desc { int n; /* This is an *EXOTIC* box. It doesn't say anything about the physical * dimensions, rather about the frame_desc contents. */ - struct box box; + struct el_box box; struct frame_desc frame_desc[1]; /* must be last of struct. --Zas */ }; diff --git a/src/document/html/renderer.h b/src/document/html/renderer.h index 54cbecb0..d27a63ce 100644 --- a/src/document/html/renderer.h +++ b/src/document/html/renderer.h @@ -4,7 +4,7 @@ #include "document/document.h" -struct box; +struct el_box; struct cache_entry; struct html_context; struct string; @@ -49,7 +49,7 @@ struct part { #endif - struct box box; + struct el_box box; int max_width; int xa; diff --git a/src/document/options.h b/src/document/options.h index d1fe26dd..60dc67ca 100644 --- a/src/document/options.h +++ b/src/document/options.h @@ -133,7 +133,7 @@ struct document_options { *
Only documents containing textarea or frames uses it and we * only compare it if #needs_height is set. * */ - struct box box; + struct el_box box; unsigned int needs_height:1; unsigned int needs_width:1; diff --git a/src/document/view.h b/src/document/view.h index f800d836..dde0303e 100644 --- a/src/document/view.h +++ b/src/document/view.h @@ -19,7 +19,7 @@ struct document_view { struct document *document; struct view_state *vs; - struct box box; /**< pos and size of window */ + struct el_box box; /**< pos and size of window */ int last_x, last_y; /**< last pos of window */ int depth; int used; diff --git a/src/protocol/bittorrent/dialogs.c b/src/protocol/bittorrent/dialogs.c index 2481581c..4b50a6ae 100644 --- a/src/protocol/bittorrent/dialogs.c +++ b/src/protocol/bittorrent/dialogs.c @@ -479,7 +479,7 @@ draw_bittorrent_piece_progress(struct download *download, struct terminal *term, int remainder = width % bittorrent->meta.pieces; for (piece = 0; piece < bittorrent->meta.pieces; piece++) { - struct box piecebox; + struct el_box piecebox; set_box(&piecebox, x, y, chars_per_piece + !!remainder, 1); diff --git a/src/terminal/draw.c b/src/terminal/draw.c index bce6e6f3..a1d7b639 100644 --- a/src/terminal/draw.c +++ b/src/terminal/draw.c @@ -204,7 +204,7 @@ draw_line(struct terminal *term, int x, int y, int l, struct screen_char *line) } void -draw_border(struct terminal *term, struct box *box, +draw_border(struct terminal *term, struct el_box *box, struct color_pair *color, int width) { static const enum border_char p1[] = { @@ -224,13 +224,13 @@ draw_border(struct terminal *term, struct box *box, BORDER_DHLINE, }; const enum border_char *p = (width > 1) ? p2 : p1; - struct box borderbox; + struct el_box borderbox; set_box(&borderbox, box->x - 1, box->y - 1, box->width + 2, box->height + 2); if (borderbox.width > 2) { - struct box bbox; + struct el_box bbox; /* Horizontal top border */ set_box(&bbox, box->x, borderbox.y, box->width, 1); @@ -242,7 +242,7 @@ draw_border(struct terminal *term, struct box *box, } if (borderbox.height > 2) { - struct box bbox; + struct el_box bbox; /* Vertical left border */ set_box(&bbox, borderbox.x, box->y, 1, box->height); @@ -285,7 +285,7 @@ draw_border(struct terminal *term, struct box *box, * @endverbatim */ void -fix_dwchar_around_box(struct terminal *term, struct box *box, int border, +fix_dwchar_around_box(struct terminal *term, struct el_box *box, int border, int shadow_width, int shadow_height) { struct screen_char *schar; @@ -369,7 +369,7 @@ draw_char(struct terminal *term, int x, int y, } void -draw_box(struct terminal *term, struct box *box, +draw_box(struct terminal *term, struct el_box *box, unsigned char data, enum screen_char_attr attr, struct color_pair *color) { @@ -412,10 +412,10 @@ draw_box(struct terminal *term, struct box *box, } void -draw_shadow(struct terminal *term, struct box *box, +draw_shadow(struct terminal *term, struct el_box *box, struct color_pair *color, int width, int height) { - struct box dbox; + struct el_box dbox; /* (horizontal) */ set_box(&dbox, box->x + width, box->y + box->height, @@ -576,7 +576,7 @@ draw_dlg_text(struct dialog_data *dlg_data, int x, int y, enum screen_char_attr attr, struct color_pair *color) { struct terminal *term = dlg_data->win->term; - struct box *box = &dlg_data->real_box; + struct el_box *box = &dlg_data->real_box; if (box->height) { int y_max = box->y + box->height; @@ -612,7 +612,7 @@ set_cursor(struct terminal *term, int x, int y, int blockable) void set_dlg_cursor(struct terminal *term, struct dialog_data *dlg_data, int x, int y, int blockable) { - struct box *box = &dlg_data->real_box; + struct el_box *box = &dlg_data->real_box; assert(term && term->screen); if_assert_failed return; @@ -630,7 +630,7 @@ set_dlg_cursor(struct terminal *term, struct dialog_data *dlg_data, int x, int y void clear_terminal(struct terminal *term) { - struct box box; + struct el_box box; set_box(&box, 0, 0, term->width, term->height); draw_box(term, &box, ' ', 0, NULL); diff --git a/src/terminal/draw.h b/src/terminal/draw.h index b1f150f6..3995be4a 100644 --- a/src/terminal/draw.h +++ b/src/terminal/draw.h @@ -5,7 +5,7 @@ struct color_pair; struct dialog_data; -struct box; +struct el_box; struct terminal; /** How many bytes we need for the colors of one character cell. */ @@ -264,21 +264,21 @@ void draw_space(struct terminal *term, int x, int y, struct screen_char *color); /** Draws area defined by @a box using the same colors and attributes. */ -void draw_box(struct terminal *term, struct box *box, +void draw_box(struct terminal *term, struct el_box *box, unsigned char data, enum screen_char_attr attr, struct color_pair *color); /** Draws a shadow of @a width and @a height with color @a color * around @a box. */ -void draw_shadow(struct terminal *term, struct box *box, +void draw_shadow(struct terminal *term, struct el_box *box, struct color_pair *color, int width, int height); /** Draw borders. */ -void draw_border(struct terminal *term, struct box *box, +void draw_border(struct terminal *term, struct el_box *box, struct color_pair *color, int width); #ifdef CONFIG_UTF8 -void fix_dwchar_around_box(struct terminal *term, struct box *box, int border, +void fix_dwchar_around_box(struct terminal *term, struct el_box *box, int border, int shadow_width, int shadow_height); #endif /* CONFIG_UTF8 */ diff --git a/src/terminal/window.c b/src/terminal/window.c index f7b1452d..f64c6dde 100644 --- a/src/terminal/window.c +++ b/src/terminal/window.c @@ -209,7 +209,7 @@ assert_window_stacking(struct terminal *term) void set_dlg_window_ptr(struct dialog_data *dlg_data, struct window *window, int x, int y) { - struct box *box = &dlg_data->real_box; + struct el_box *box = &dlg_data->real_box; if (box->height) { int y_max = box->y + box->height; diff --git a/src/util/box.h b/src/util/box.h index b155dd2b..854424f2 100644 --- a/src/util/box.h +++ b/src/util/box.h @@ -2,7 +2,7 @@ #define EL__UTIL_BOX_H /** A rectangular part of a drawing surface, such as the screen. */ -struct box { +struct el_box { int x; int y; int width; @@ -11,7 +11,7 @@ struct box { /** @relates box */ static inline int -is_in_box(struct box *box, int x, int y) +is_in_box(struct el_box *box, int x, int y) { return (x >= box->x && y >= box->y && x < box->x + box->width @@ -20,14 +20,14 @@ is_in_box(struct box *box, int x, int y) /** @relates box */ static inline int -row_is_in_box(struct box *box, int y) +row_is_in_box(struct el_box *box, int y) { return (y >= box->y && y < box->y + box->height); } /** @relates box */ static inline int -col_is_in_box(struct box *box, int x) +col_is_in_box(struct el_box *box, int x) { return (x >= box->x && x < box->x + box->width); } @@ -36,7 +36,7 @@ col_is_in_box(struct box *box, int x) * Mainly intended for use with double-width characters. * @relates box */ static inline int -colspan_is_in_box(struct box *box, int x, int span) +colspan_is_in_box(struct el_box *box, int x, int span) { return (x >= box->x && x + span <= box->x + box->width); } @@ -44,7 +44,7 @@ colspan_is_in_box(struct box *box, int x, int span) /** @relates box */ static inline void -set_box(struct box *box, int x, int y, int width, int height) +set_box(struct el_box *box, int x, int y, int width, int height) { box->x = int_max(0, x); box->y = int_max(0, y); @@ -54,7 +54,7 @@ set_box(struct box *box, int x, int y, int width, int height) /** @relates box */ static inline void -copy_box(struct box *dst, struct box *src) +copy_box(struct el_box *dst, struct el_box *src) { copy_struct(dst, src); } diff --git a/src/viewer/text/draw.c b/src/viewer/text/draw.c index f417b0ef..07b3f49f 100644 --- a/src/viewer/text/draw.c +++ b/src/viewer/text/draw.c @@ -108,7 +108,7 @@ draw_frame_lines(struct terminal *term, struct frameset_desc *frameset_desc, int width = frameset_desc->frame_desc[i].width; if (i) { - struct box box; + struct el_box box; set_box(&box, x, y + 1, 1, height); draw_box(term, &box, BORDER_SVLINE, SCREEN_ATTR_FRAME, colors); @@ -123,7 +123,7 @@ draw_frame_lines(struct terminal *term, struct frameset_desc *frameset_desc, } if (j) { - struct box box; + struct el_box box; set_box(&box, x + 1, y, width, 1); draw_box(term, &box, BORDER_SHLINE, SCREEN_ATTR_FRAME, colors); @@ -184,7 +184,7 @@ check_link_under_cursor(struct session *ses, struct document_view *doc_view) { int x = ses->tab->x; int y = ses->tab->y; - struct box *box = &doc_view->box; + struct el_box *box = &doc_view->box; struct link *link; link = get_link_at_coordinates(doc_view, x - box->x, y - box->y); @@ -202,7 +202,7 @@ draw_doc(struct session *ses, struct document_view *doc_view, int active) struct color_pair color; struct view_state *vs; struct terminal *term; - struct box *box; + struct el_box *box; struct screen_char *last = NULL; int vx, vy; @@ -391,7 +391,7 @@ draw_formatted(struct session *ses, int rerender) if (!ses->doc_view || !ses->doc_view->document) { /*INTERNAL("document not formatted");*/ - struct box box; + struct el_box box; set_box(&box, 0, 1, ses->tab->term->width, diff --git a/src/viewer/text/form.c b/src/viewer/text/form.c index 4cdc38b1..c5880f77 100644 --- a/src/viewer/text/form.c +++ b/src/viewer/text/form.c @@ -400,7 +400,7 @@ draw_form_entry(struct terminal *term, struct document_view *doc_view, struct form_state *fs; struct form_control *fc; struct view_state *vs; - struct box *box; + struct el_box *box; int dx, dy; assert(term && doc_view && doc_view->document && doc_view->vs && link); diff --git a/src/viewer/text/search.c b/src/viewer/text/search.c index e07ae7cd..52d95c1d 100644 --- a/src/viewer/text/search.c +++ b/src/viewer/text/search.c @@ -632,7 +632,7 @@ get_searched_plain(struct document_view *doc_view, struct point **pt, int *pl, { UCHAR *txt; struct point *points = NULL; - struct box *box; + struct el_box *box; int xoffset, yoffset; int len = 0; int case_sensitive = get_opt_bool("document.browse.search.case", NULL); @@ -743,7 +743,7 @@ srch_failed: struct get_searched_regex_context { int xoffset; int yoffset; - struct box *box; + struct el_box *box; struct point *points; int len; }; diff --git a/src/viewer/text/textarea.c b/src/viewer/text/textarea.c index d01687d5..a6cd1df0 100644 --- a/src/viewer/text/textarea.c +++ b/src/viewer/text/textarea.c @@ -325,7 +325,7 @@ draw_textarea_utf8(struct terminal *term, struct form_state *fs, { struct line_info *line, *linex; struct form_control *fc; - struct box *box; + struct el_box *box; int vx, vy; int sl, ye; int x, xbase, y; @@ -407,7 +407,7 @@ draw_textarea(struct terminal *term, struct form_state *fs, { struct line_info *line, *linex; struct form_control *fc; - struct box *box; + struct el_box *box; int vx, vy; int sl, ye; int x, y; diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index 3192285f..b3affe08 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -551,7 +551,7 @@ move_cursor(struct session *ses, struct document_view *doc_view, int x, int y) { enum frame_event_status status = FRAME_EVENT_REFRESH; struct terminal *term = ses->tab->term; - struct box *box = &doc_view->box; + struct el_box *box = &doc_view->box; struct link *link; /* If cursor was moved outside the document view scroll it, but only @@ -653,7 +653,7 @@ move_link_up_line(struct session *ses, struct document_view *doc_view) { struct document *document; struct view_state *vs; - struct box *box; + struct el_box *box; int min_y, y, y1; assert(ses && doc_view && doc_view->vs && doc_view->document); @@ -718,7 +718,7 @@ move_link_down_line(struct session *ses, struct document_view *doc_view) { struct document *document; struct view_state *vs; - struct box *box; + struct el_box *box; int max_y, y, y1; assert(ses && doc_view && doc_view->vs && doc_view->document); @@ -780,7 +780,7 @@ move_link_prev_line(struct session *ses, struct document_view *doc_view) { struct view_state *vs; struct document *document; - struct box *box; + struct el_box *box; struct link *link, *last = NULL; int y1, y, min_y, min_x, max_x, x1; @@ -860,7 +860,7 @@ move_link_next_line(struct session *ses, struct document_view *doc_view) { struct view_state *vs; struct document *document; - struct box *box; + struct el_box *box; struct link *link, *last = NULL; int y1, y, max_y, min_x, max_x, x1; @@ -937,7 +937,7 @@ enum frame_event_status move_cursor_line_start(struct session *ses, struct document_view *doc_view) { struct view_state *vs; - struct box *box; + struct el_box *box; int x; assert(ses && doc_view && doc_view->vs);