1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-21 00:25:37 +00:00

Rename struct box to struct el_box.

In the future I want to copy some code from netsurf, so I'm preparing.
This commit is contained in:
Witold Filipczyk 2018-09-09 19:14:56 +02:00
parent 58a2ff2fb6
commit d8be2c505e
28 changed files with 67 additions and 67 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -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)) {

View File

@ -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.

View File

@ -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;

View File

@ -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);
}

View File

@ -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)

View File

@ -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 */

View File

@ -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,

View File

@ -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;

View File

@ -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);

View File

@ -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"));

View File

@ -23,7 +23,7 @@ struct screen_char;
struct node {
LIST_HEAD(struct node);
struct box box;
struct el_box box;
};

View File

@ -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

View File

@ -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 */
};

View File

@ -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;

View File

@ -133,7 +133,7 @@ struct document_options {
* <dd>Only documents containing textarea or frames uses it and we
* only compare it if #needs_height is set.
* </dl> */
struct box box;
struct el_box box;
unsigned int needs_height:1;
unsigned int needs_width:1;

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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 */

View File

@ -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;

View File

@ -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);
}

View File

@ -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,

View File

@ -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);

View File

@ -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;
};

View File

@ -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;

View File

@ -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);