links

lynx-like text mode web browser
git clone anongit@rnpnr.xyz:links.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 177155ed10760d1ce5811629bec51d39fe805cee
Parent: b123765257c3aebe74dc938eae2c2c53a25fbcdf
Author: opask
Date:   Wed,  1 Aug 2018 06:29:27 -0600

remove remaining braille related code

Diffstat:
Mbfu.c | 138++++++++++++++------------------------------------------------------------------
Mblock.c | 4----
Mbookmark.c | 2--
Mdefault.c | 3+--
Mhtml.c | 3---
Mhtml_r.c | 3+--
Mhttp.c | 3---
Mlinks.h | 2--
Mlistedit.c | 13+++++++------
Mmenu.c | 64++++++++++++++++++++++++++--------------------------------------
Msession.c | 7++-----
Msetup.h | 42+++++++++++++++++++++---------------------
Mterminal.c | 8++++----
Mtypes.c | 5-----
14 files changed, 85 insertions(+), 212 deletions(-)

diff --git a/bfu.c b/bfu.c @@ -188,8 +188,7 @@ void do_menu_selected(struct terminal *term, struct menu_item *items, void *data menu->free_function = free_function; menu->free_data = free_data; for (i = 0; i < menu->ni; i++) - menu->hotkeys[i] = select_hotkey(term, - !term->spec->braille ? items[i].text : NULL, + menu->hotkeys[i] = select_hotkey(term, items[i].text, items[i].hotkey, menu->hotkeys, i); #ifdef G if (F) { @@ -291,13 +290,6 @@ static void count_menu_size(struct terminal *term, struct menu *menu) if ((menu->y = menu->yp) < 0) menu->y = 0; if (menu->x + mx > sx) menu->x = sx - mx; if (menu->y + my > sy) menu->y = sy - my; - if (term->spec->braille) { - menu->x = -1; - menu->y = -1; - menu->xw = term->x + 2; - menu->yw = term->y + 2; - menu->nview = term->y; - } #ifdef G if (F) set_window_pos(menu->win, menu->x, menu->y, menu->x + menu->xw, menu->y + menu->yw); #endif @@ -332,7 +324,6 @@ static void display_menu_txt(struct terminal *term, void *menu_) { struct menu *menu = (struct menu *)menu_; int p, s; - int setc = 0; fill_area(term, menu->x+1, menu->y+1, menu->xw-2, menu->yw-2, ' ', COLOR_MENU_TEXT); draw_frame(term, menu->x, menu->y, menu->xw, menu->yw, COLOR_MENU_FRAME, 1); set_window_ptr(menu->win, menu->x, menu->y); @@ -348,41 +339,33 @@ static void display_menu_txt(struct terminal *term, void *menu_) } else co = COLOR_MENU_TEXT; if (h) { - setc = 1; - set_cursor(term, menu->x + 1 + !!term->spec->braille, s, term->x - 1, term->y - 1); + set_cursor(term, menu->x + 1, s, term->x - 1, + term->y - 1); /*set_window_ptr(menu->win, menu->x+3, s+1);*/ set_window_ptr(menu->win, menu->x+menu->xw, s); fill_area(term, menu->x+1, s, menu->xw-2, 1, ' ', co); } - if (term->spec->braille) h = 1; if (menu->items[p].hotkey != M_BAR || (tmptext[0])) { unsigned char *rt = get_text_translation(get_rtext(menu->items[p].rtext), term); int l = ttxtlen(term, rt); for (x = 0;; x++) { c = GET_TERM_CHAR(term, &rt); if (!c) break; - if (!term->spec->braille) { - if (menu->xw - 4 >= l - x) - set_char(term, menu->x + menu->xw - 2 - l + x, s, c, co); - } else { - set_char(term, menu->x + ttxtlen(term, tmptext) + 4 + x + 2, s, c, COLOR_MENU_HOTKEY); - } + if (menu->xw - 4 >= l - x) + set_char(term, + menu->x + menu->xw - 2 - l + x, + s, c, co); } for (x = 0; x < menu->xw - 4; x++) { c = GET_TERM_CHAR(term, &tmptext); if (!c) break; if (!h && charset_upcase(c, term_charset(term)) == menu->hotkeys[p]) { h = 1; - set_char(term, - menu->x + x + 2 + 2 * !!term->spec->braille, - s, c, COLOR_MENU_HOTKEY); + set_char(term, menu->x + x + 2, s, c, + COLOR_MENU_HOTKEY); } else set_char(term, - menu->x + x + 2 + 2 * !!term->spec->braille, - s, c, co); - } - if (term->spec->braille && menu->hotkeys[p]) { - set_char(term, menu->x + 2, s, menu->hotkeys[p], COLOR_MENU_HOTKEY); + menu->x + x + 2, s, c, co); } } else { set_char(term, menu->x, s, 0xc3, COLOR_MENU_FRAME | ATTR_FRAME); @@ -390,9 +373,6 @@ static void display_menu_txt(struct terminal *term, void *menu_) set_char(term, menu->x+menu->xw-1, s, 0xb4, COLOR_MENU_FRAME | ATTR_FRAME); } } - if (!setc && term->spec->braille) { - set_cursor(term, menu->x + 1, menu->y + 1, term->x - 1, term->y - 1); - } } static int menu_oldview = -1; @@ -700,10 +680,6 @@ static void display_mainmenu(struct terminal *term, void *menu_) set_cursor(term, p, 0, term->x - 1, term->y - 1); set_window_ptr(menu->win, p, 1); } - if (term->spec->braille) { - s = 1; - if (menu->hotkeys[i]) set_char(term, p, 0, menu->hotkeys[i], COLOR_MAINMENU_HOTKEY); - } p += 2; for (;; p++) { c = GET_TERM_CHAR(term, &tmptext); @@ -796,7 +772,9 @@ static void mainmenu_func(struct window *win, struct links_event *ev, int fwd) if (ev->x >= o && ev->x < p) { menu->selected = i; draw_to_window(win, display_mainmenu, menu); - if ((ev->b & BM_ACT) == B_UP || (menu->items[s].in_m && !win->term->spec->braille)) select_mainmenu(win->term, menu); + if ((ev->b & BM_ACT) == B_UP + || menu->items[s].in_m) + select_mainmenu(win->term, menu); break; } } @@ -1207,11 +1185,6 @@ static void redraw_dialog_items(struct terminal *term, void *dlg_) for (i = 0; i < dlg->n; i++) display_dlg_item(dlg, &dlg->items[i], i == dlg->selected); } -static int dlg_is_braille_moving(struct dialog_data *dlg) -{ - return dlg->win->term->spec->braille && (dlg->dlg->fn == msg_box_fn || dlg->dlg->fn == download_window_function); -} - static void redraw_dialog(struct terminal *term, void *dlg_) { struct dialog_data *dlg = (struct dialog_data *)dlg_; @@ -1220,10 +1193,6 @@ static void redraw_dialog(struct terminal *term, void *dlg_) #endif dlg->dlg->fn(dlg); redraw_dialog_items(term, dlg); - if (dlg_is_braille_moving(dlg)) { - if (dlg->brl_y < dlg->items[0].y - 3) - set_cursor(term, dlg->x + 6, dlg->y + 3 + dlg->brl_y, dlg->x + 6, dlg->y + 3 + dlg->brl_y); - } #ifdef G if (F) { drv->set_clip_area(term->dev, &dlg->r); @@ -1346,7 +1315,6 @@ void dialog_func(struct window *win, struct links_event *ev, int fwd) draw_to_window(dlg->win, redraw_dialog, dlg); /*-fallthrough*/ case EV_REDRAW: - redraw: draw_to_window(dlg->win, redraw_dialog, dlg); break; case EV_MOUSE: @@ -1364,26 +1332,6 @@ void dialog_func(struct window *win, struct links_event *ev, int fwd) (ev->x >= ' ' && !(ev->y & (KBD_CTRL | KBD_ALT))))) break; } - if (ev->x == KBD_UP && dlg_is_braille_moving(dlg)) { - if (dlg->brl_y) dlg->brl_y--; - goto redraw; - } - if (ev->x == KBD_DOWN && dlg_is_braille_moving(dlg)) { - if (dlg->brl_y < dlg->items[0].y - 3) dlg->brl_y++; - goto redraw; - } - if ((ev->x == KBD_HOME || (upcase(ev->x) == 'A' && ev->y & KBD_CTRL) || ev->x == KBD_PAGE_UP || (upcase(ev->x) == 'B' && ev->y & KBD_CTRL)) && dlg_is_braille_moving(dlg)) { - dlg->brl_y = 0; - goto redraw; - } - if ((ev->x == KBD_END || (upcase(ev->x) == 'E' && ev->y & KBD_CTRL)) && dlg_is_braille_moving(dlg)) { - dlg->brl_y = dlg->items[0].y - 4; - goto redraw; - } - if ((ev->x == KBD_PAGE_DOWN || (upcase(ev->x) == 'F' && ev->y & KBD_CTRL)) && dlg_is_braille_moving(dlg)) { - dlg->brl_y = dlg->items[0].y - 3; - goto redraw; - } if (di->item->type == D_FIELD || di->item->type == D_FIELD_PASS) { if (ev->x == KBD_UP && di->cur_hist->prev != &di->history) { di->cur_hist = di->cur_hist->prev; @@ -1553,15 +1501,15 @@ clipbd_paste: dlg_select_item(dlg, &dlg->items[i]); goto bla; } - if (((ev->x == KBD_TAB && !ev->y) || ev->x == KBD_DOWN || ev->x == KBD_RIGHT) && (dlg->n > 1 || term->spec->braille)) { - if (term->spec->braille) dlg->brl_y = dlg->items[0].y - 3; + if (((ev->x == KBD_TAB && !ev->y) || ev->x == KBD_DOWN + || ev->x == KBD_RIGHT) && dlg->n > 1) { x_display_dlg_item(dlg, &dlg->items[dlg->selected], 0); if ((++dlg->selected) >= dlg->n) dlg->selected = 0; x_display_dlg_item(dlg, &dlg->items[dlg->selected], 1); break; } - if (((ev->x == KBD_TAB && ev->y) || ev->x == KBD_UP || ev->x == KBD_LEFT) && (dlg->n > 1 || term->spec->braille)) { - if (term->spec->braille) dlg->brl_y = dlg->items[0].y - 3; + if (((ev->x == KBD_TAB && ev->y) || ev->x == KBD_UP + || ev->x == KBD_LEFT) && dlg->n > 1) { x_display_dlg_item(dlg, &dlg->items[dlg->selected], 0); if ((--dlg->selected) < 0) dlg->selected = dlg->n - 1; x_display_dlg_item(dlg, &dlg->items[dlg->selected], 1); @@ -1732,15 +1680,8 @@ int ok_dialog(struct dialog_data *dlg, struct dialog_item_data *di) void center_dlg(struct dialog_data *dlg) { - if (!dlg->win->term->spec->braille) { - dlg->x = (dlg->win->term->x - dlg->xw) / 2; - dlg->y = (dlg->win->term->y - dlg->yw) / 2; - } else { - dlg->x = -6; - dlg->y = -1; - dlg->xw = dlg->win->term->x + 12; - dlg->yw = dlg->win->term->y + 3; - } + dlg->x = (dlg->win->term->x - dlg->xw) / 2; + dlg->y = (dlg->win->term->y - dlg->yw) / 2; } void draw_dlg(struct dialog_data *dlg) @@ -1752,7 +1693,6 @@ void draw_dlg(struct dialog_data *dlg) draw_frame(term, dlg->x + DIALOG_LEFT_BORDER, dlg->y + DIALOG_TOP_BORDER, dlg->xw - 2 * DIALOG_LEFT_BORDER, dlg->yw - 2 * DIALOG_TOP_BORDER, COLOR_DIALOG_FRAME, DIALOG_FRAME); i = ttxtlen(term, get_text_translation(dlg->dlg->title, term)); tpos = (dlg->xw - i) / 2; - if (term->spec->braille) tpos = 9; print_text(term, tpos + dlg->x - 1, dlg->y + DIALOG_TOP_BORDER, 1, cast_uchar " ", COLOR_DIALOG_TITLE); print_text(term, tpos + dlg->x, dlg->y + DIALOG_TOP_BORDER, i, get_text_translation(dlg->dlg->title, term), COLOR_DIALOG_TITLE); print_text(term, tpos + dlg->x + i, dlg->y + DIALOG_TOP_BORDER, 1, cast_uchar " ", COLOR_DIALOG_TITLE); @@ -1829,7 +1769,6 @@ void draw_dlg(struct dialog_data *dlg) void max_text_width(struct terminal *term, unsigned char *text, int *width, int align) { - if (term->spec->braille) *width = term->x; text = get_text_translation(text, term); do { int c = 0; @@ -1852,7 +1791,6 @@ void max_text_width(struct terminal *term, unsigned char *text, int *width, int void min_text_width(struct terminal *term, unsigned char *text, int *width, int align) { - if (term->spec->braille) *width = term->x; text = get_text_translation(text, term); do { int c = 0; @@ -1880,7 +1818,6 @@ int dlg_format_text(struct dialog_data *dlg, struct terminal *term, unsigned cha unsigned char *tx2; #endif text = get_text_translation(text, dlg->win->term); - if (dlg->win->term->spec->braille && !(align & AL_NOBRLEXP)) w = dlg->win->term->x; if (!F) while (1) { unsigned char *t1; unsigned ch; @@ -1908,7 +1845,7 @@ int dlg_format_text(struct dialog_data *dlg, struct terminal *term, unsigned cha print_line: if (rw && lbr > *rw) *rw = lbr; xx = x; - if ((align & AL_MASK) == AL_CENTER && !dlg->win->term->spec->braille) { + if ((align & AL_MASK) == AL_CENTER) { xx += (w - lbr) / 2; } for (; lbr--; xx++) { @@ -1977,7 +1914,6 @@ void max_buttons_width(struct terminal *term, struct dialog_item_data *butt, int { int w = gf_val(-2, -G_DIALOG_BUTTON_SPACE); int i; - if (term->spec->braille) *width = term->x; for (i = 0; i < n; i++) w += txtlen(term, get_text_translation((butt++)->item->text, term)) + gf_val(6, G_DIALOG_BUTTON_SPACE + txtlen(term, cast_uchar G_DIALOG_BUTTON_L) + txtlen(term, cast_uchar G_DIALOG_BUTTON_R)); if (w > *width) *width = w; } @@ -1985,7 +1921,6 @@ void max_buttons_width(struct terminal *term, struct dialog_item_data *butt, int void min_buttons_width(struct terminal *term, struct dialog_item_data *butt, int n, int *width) { int i; - if (term->spec->braille) *width = term->x; for (i = 0; i < n; i++) { int w = txtlen(term, get_text_translation((butt++)->item->text, term)) + gf_val(4, txtlen(term, cast_uchar(G_DIALOG_BUTTON_L G_DIALOG_BUTTON_R))); if (w > *width) *width = w; @@ -1995,7 +1930,6 @@ void min_buttons_width(struct terminal *term, struct dialog_item_data *butt, int void dlg_format_buttons(struct dialog_data *dlg, struct terminal *term, struct dialog_item_data *butt, int n, int x, int *y, int w, int *rw, int align) { int i1 = 0; - if (dlg->win->term->spec->braille) w = dlg->win->term->x; while (i1 < n) { int i2 = i1 + 1; int mw; @@ -2036,7 +1970,6 @@ void dlg_format_checkbox(struct dialog_data *dlg, struct terminal *term, struct void dlg_format_checkboxes(struct dialog_data *dlg, struct terminal *term, struct dialog_item_data *chkb, int n, int x, int *y, int w, int *rw, unsigned char * const *texts) { - if (dlg->win->term->spec->braille) w = dlg->win->term->x; while (n) { dlg_format_checkbox(dlg, term, chkb, x, y, w, rw, texts[0]); texts++; chkb++; n--; @@ -2056,7 +1989,6 @@ void checkboxes_width(struct terminal *term, unsigned char * const *texts, int n void dlg_format_field(struct dialog_data *dlg, struct terminal *term, struct dialog_item_data *item, int x, int *y, int w, int *rw, int align) { - if (dlg->win->term->spec->braille) w = dlg->win->term->x; if (term) { item->x = x; item->y = *y; @@ -2068,21 +2000,8 @@ void dlg_format_field(struct dialog_data *dlg, struct terminal *term, struct dia void dlg_format_text_and_field(struct dialog_data *dlg, struct terminal *term, unsigned char *text, struct dialog_item_data *item, int x, int *y, int w, int *rw, unsigned char co, int align) { - if (!dlg->win->term->spec->braille) { - dlg_format_text(dlg, term, text, x, y, w, rw, co, align); - dlg_format_field(dlg, term, item, x, y, w, rw, align); - } else { - int pos = dlg_format_text(dlg, term, text, x, y, w, rw, co, align); - if (pos >= w - 4) { - (*y)++; - pos = 0; - } - if (term) { - item->x = x + pos; - item->y = *y - 1; - item->l = w - pos; - } - } + dlg_format_text(dlg, term, text, x, y, w, rw, co, align); + dlg_format_field(dlg, term, item, x, y, w, rw, align); } @@ -2100,7 +2019,6 @@ void dlg_format_box(struct terminal *term, struct terminal *t2, struct dialog_it void max_group_width(struct terminal *term, unsigned char * const *texts, struct dialog_item_data *item, int n, int *w) { int ww = 0; - if (term->spec->braille) *w = term->x; while (n--) { int wx = item->item->type == D_CHECKBOX ? gf_val(4, txtlen(term, cast_uchar(G_DIALOG_CHECKBOX_L G_DIALOG_CHECKBOX_X G_DIALOG_CHECKBOX_R)) + G_DIALOG_CHECKBOX_SPACE) : item->item->type == D_BUTTON ? txtlen(term, get_text_translation(item->item->text, term)) + (gf_val(4, txtlen(term, cast_uchar(G_DIALOG_BUTTON_L G_DIALOG_BUTTON_R)))) : @@ -2116,7 +2034,6 @@ void max_group_width(struct terminal *term, unsigned char * const *texts, struct void min_group_width(struct terminal *term, unsigned char * const *texts, struct dialog_item_data *item, int n, int *w) { - if (term->spec->braille) *w = term->x; while (n--) { int wx = item->item->type == D_CHECKBOX ? gf_val(4, txtlen(term, cast_uchar(G_DIALOG_CHECKBOX_L G_DIALOG_CHECKBOX_X G_DIALOG_CHECKBOX_R)) + G_DIALOG_CHECKBOX_SPACE) : item->item->type == D_BUTTON ? txtlen(term, get_text_translation(item->item->text, term)) + (gf_val(4, txtlen(term, cast_uchar(G_DIALOG_BUTTON_L G_DIALOG_BUTTON_R)))) : @@ -2130,9 +2047,7 @@ void min_group_width(struct terminal *term, unsigned char * const *texts, struct void dlg_format_group(struct dialog_data *dlg, struct terminal *term, unsigned char * const *texts, struct dialog_item_data *item, int n, int x, int *y, int w, int *rw) { - int f = 1; int nx = 0; - if (dlg->win->term->spec->braille) w = dlg->win->term->x; while (n--) { int wx = item->item->type == D_CHECKBOX ? gf_val(3, txtlen(dlg->win->term, cast_uchar(G_DIALOG_CHECKBOX_L G_DIALOG_CHECKBOX_X G_DIALOG_CHECKBOX_R))) : item->item->type == D_BUTTON ? txtlen(dlg->win->term, get_text_translation(item->item->text, dlg->win->term)) + (gf_val(4, txtlen(dlg->win->term, cast_uchar(G_DIALOG_BUTTON_L G_DIALOG_BUTTON_R)))) : @@ -2141,12 +2056,7 @@ void dlg_format_group(struct dialog_data *dlg, struct terminal *term, unsigned c if (get_text_translation(texts[0], dlg->win->term)[0]) sl = txtlen(dlg->win->term, get_text_translation(texts[0], dlg->win->term)) + gf_val(1, G_DIALOG_GROUP_TEXT_SPACE); else sl = 0; wx += sl; - if (dlg->win->term->spec->braille) { - if (!f) { - nx = 0; - (*y) += gf_val(1, G_BFU_FONT_SIZE * 1); - } else f = 0; - } else if (nx && nx + wx > w) { + if (nx && nx + wx > w) { nx = 0; (*y) += gf_val(2, G_BFU_FONT_SIZE * 2); } @@ -2409,7 +2319,6 @@ static void input_field_fn(struct dialog_data *dlg) int max = 0, min = 0; int w, rw; int y = gf_val(-1, -G_BFU_FONT_SIZE); - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); max_text_width(term, dlg->dlg->udata, &max, AL_LEFT); min_text_width(term, dlg->dlg->udata, &min, AL_LEFT); max_buttons_width(term, dlg->items + 1, dlg->n - 1, &max); @@ -2428,7 +2337,6 @@ static void input_field_fn(struct dialog_data *dlg) center_dlg(dlg); draw_dlg(dlg); y = dlg->y + DIALOG_TB; - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, term, dlg->dlg->udata, dlg->items, dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); y += LL; dlg_format_buttons(dlg, term, dlg->items + 1, dlg->n - 1, dlg->x + DIALOG_LB, &y, w, NULL, AL_CENTER); diff --git a/block.c b/block.c @@ -136,8 +136,6 @@ static void block_edit_item_fn(struct dialog_data *dlg) unsigned char *text = TEXT_(T_ENTER_URL); - if (dlg->win->term->spec->braille) - y += gf_val(1, G_BFU_FONT_SIZE); max_text_width(term, text, &max, AL_LEFT); min_text_width(term, text, &min, AL_LEFT); max_buttons_width(term, dlg->items + 1, 2, &max); @@ -159,8 +157,6 @@ static void block_edit_item_fn(struct dialog_data *dlg) center_dlg(dlg); draw_dlg(dlg); y = dlg->y + DIALOG_TB; - if (dlg->win->term->spec->braille) - y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, term, text, dlg->items, dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); y += LL; dlg_format_buttons(dlg, term, dlg->items + 1, 2, dlg->x + DIALOG_LB, &y, w, NULL, AL_CENTER); diff --git a/bookmark.c b/bookmark.c @@ -170,7 +170,6 @@ static void bookmark_edit_item_fn(struct dialog_data *dlg) int y = gf_val(-1, -1 * G_BFU_FONT_SIZE); struct terminal *term; int a; - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); term = dlg->win->term; @@ -198,7 +197,6 @@ static void bookmark_edit_item_fn(struct dialog_data *dlg) center_dlg(dlg); draw_dlg(dlg); y = dlg->y + DIALOG_TB; - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); for (a = 0; a < dlg->n - 2; a++) { dlg_format_text_and_field(dlg, term, bm_add_msg[a], &dlg->items[a], dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); y += gf_val(1, G_BFU_FONT_SIZE); diff --git a/default.c b/default.c @@ -700,7 +700,6 @@ static unsigned char *term_rd(struct option *o, unsigned char *c) if (!(w = get_token(&c))) goto err; if (strlen(cast_const_char w) != 1 || w[0] < '0' || w[0] > '3') goto err_f; ts->m11_hack = (w[0] - '0') & 1; - ts->braille = !!((w[0] - '0') & 2); free(w); if (!(w = get_token(&c))) goto err; if (strlen(cast_const_char w) != 1 || w[0] < '0' || w[0] > '7') goto err_f; @@ -789,7 +788,7 @@ static void term_wr(struct option *o, unsigned char **s, int *l) add_to_str(s, l, cast_uchar " "); add_num_to_str(s, l, ts->mode); add_to_str(s, l, cast_uchar " "); - add_num_to_str(s, l, !!ts->m11_hack + !!ts->braille * 2); + add_num_to_str(s, l, !!ts->m11_hack); add_to_str(s, l, cast_uchar " "); add_num_to_str(s, l, !!ts->col + !!ts->restrict_852 * 2 + !!ts->block_cursor * 4); add_to_str(s, l, cast_uchar " "); diff --git a/html.c b/html.c @@ -1071,10 +1071,7 @@ static void html_img(unsigned char *a) || (s = get_url_val_nonempty(a, cast_uchar "dynsrc")) || (s = get_url_val_nonempty(a, cast_uchar "data")) || (s = get_url_val_nonempty(a, cast_uchar "content"))) { - if (!format_.link && d_opt->braille) - goto skip_img; format_.image = join_urls(format_.href_base, s); - skip_img: orig_link = s; } if (!F || !d_opt->display_images) { diff --git a/html_r.c b/html_r.c @@ -728,7 +728,7 @@ static void put_chars(void *p_, unsigned char *c, int l) last_form = NULL; last_js_event = NULL; if (!(format_.link || format_.image || format_.form || format_.js_event)) goto no_l; - if (d_opt->num_links || d_opt->braille) { + if (d_opt->num_links) { unsigned char s[64]; unsigned char *fl = format_.link, *ft = format_.target, *fi = format_.image; struct form_control *ff = format_.form; @@ -1306,7 +1306,6 @@ int compare_opt(struct document_options *o1, struct document_options *o2) o1->cp == o2->cp && o1->assume_cp == o2->assume_cp && o1->hard_assume == o2->hard_assume && - o1->braille == o2->braille && o1->tables == o2->tables && o1->frames == o2->frames && o1->break_long_lines == o2->break_long_lines && diff --git a/http.c b/http.c @@ -376,10 +376,7 @@ static void add_user_agent(unsigned char **hdr, int *l) add_to_str(hdr, l, system_name); add_to_str(hdr, l, cast_uchar "; "); if (!F && !list_empty(terminals)) { - struct terminal *term; - struct list_head *lterm; unsigned char *t = cast_uchar "text"; - foreach(struct terminal, term, lterm, terminals) if (term->spec->braille) t = cast_uchar "braille"; add_to_str(hdr, l, t); } #ifdef G diff --git a/links.h b/links.h @@ -1546,7 +1546,6 @@ struct term_spec { int restrict_852; int block_cursor; int col; - int braille; int character_set; int left_margin; int right_margin; @@ -1929,7 +1928,6 @@ struct document_options { int xp, yp; /* pos of window */ int scrolling; int col, cp, assume_cp, hard_assume; - int braille; int tables, frames, break_long_lines, images, image_names, margin; int js_enable; int plain; diff --git a/listedit.c b/listedit.c @@ -1149,7 +1149,7 @@ static void redraw_list_line(struct terminal *term, void *bla) struct list *l; redraw_list_element(term, dlg, y, w, ld, ld->current_pos); - if (!F && (!term->spec->block_cursor || term->spec->braille)) { + if (!F && !term->spec->block_cursor) { set_cursor(term, dlg->x + DIALOG_LB, y, dlg->x + DIALOG_LB, y); } y+=gf_val(direction, direction*G_BFU_FONT_SIZE); @@ -1264,7 +1264,11 @@ static void list_find_next(struct redraw_data *rd, int direction) if (l!=item) l->type|=2; draw_to_window(dlg->win,redraw_list,rd); - if (!F) if (!ses->term->spec->block_cursor || ses->term->spec->braille) set_cursor(ses->term, dlg->x + DIALOG_LB, dlg->y+DIALOG_TB+ld->win_pos, dlg->x + DIALOG_LB, dlg->y+DIALOG_TB+ld->win_pos); + if (!F && !ses->term->spec->block_cursor) + set_cursor(ses->term, dlg->x + DIALOG_LB, + dlg->y + DIALOG_TB + ld->win_pos, + dlg->x + DIALOG_LB, + dlg->y + DIALOG_TB + ld->win_pos); } else msg_box(ses->term, NULL, TEXT_(T_SEARCH), AL_CENTER, TEXT_(T_SEARCH_STRING_NOT_FOUND), MSG_BOX_END, NULL, 1, TEXT_(T_CANCEL), msg_box_null, B_ENTER | B_ESC); @@ -1772,10 +1776,7 @@ static void create_list_window_fn(struct dialog_data *dlg) dlg_format_buttons(dlg, NULL, dlg->items, a, 0, &y, w, &rw, AL_CENTER); n_items = term->y - y; - if (!term->spec->braille) - n_items -= gf_val(2, 3) * DIALOG_TB + gf_val(2, 2*G_BFU_FONT_SIZE); - else - n_items -= 2; + n_items -= gf_val(2, 3) * DIALOG_TB + gf_val(2, 2 * G_BFU_FONT_SIZE); #ifdef G if (F) n_items /= G_BFU_FONT_SIZE; #endif diff --git a/menu.c b/menu.c @@ -158,10 +158,9 @@ static void menu_about(struct terminal *term, void *d, void *ses_) static void menu_keys(struct terminal *term, void *d, void *ses_) { - if (!term->spec->braille) - msg_box(term, NULL, TEXT_(T_KEYS), AL_LEFT | AL_MONO, TEXT_(T_KEYS_DESC), MSG_BOX_END, NULL, 1, TEXT_(T_OK), msg_box_null, B_ENTER | B_ESC); - else - msg_box(term, NULL, TEXT_(T_KEYS), AL_LEFT | AL_MONO, TEXT_(T_KEYS_DESC), cast_uchar "\n", TEXT_(T_KEYS_BRAILLE_DESC), MSG_BOX_END, NULL, 1, TEXT_(T_OK), msg_box_null, B_ENTER | B_ESC); + msg_box(term, NULL, TEXT_(T_KEYS), AL_LEFT | AL_MONO, + TEXT_(T_KEYS_DESC), MSG_BOX_END, NULL, 1, TEXT_(T_OK), + msg_box_null, B_ENTER | B_ESC); } void activate_keys(struct session *ses) @@ -608,7 +607,7 @@ static void terminal_options_ok(void *p) cls_redraw_all_terminals(); } -static unsigned char * const td_labels[] = { TEXT_(T_NO_FRAMES), TEXT_(T_VT_100_FRAMES), TEXT_(T_LINUX_OR_OS2_FRAMES), TEXT_(T_KOI8R_FRAMES), TEXT_(T_FREEBSD_FRAMES), TEXT_(T_USE_11M), TEXT_(T_RESTRICT_FRAMES_IN_CP850_852), TEXT_(T_BLOCK_CURSOR), TEXT_(T_COLOR), TEXT_(T_BRAILLE_TERMINAL), NULL }; +static unsigned char * const td_labels[] = { TEXT_(T_NO_FRAMES), TEXT_(T_VT_100_FRAMES), TEXT_(T_LINUX_OR_OS2_FRAMES), TEXT_(T_KOI8R_FRAMES), TEXT_(T_FREEBSD_FRAMES), TEXT_(T_USE_11M), TEXT_(T_RESTRICT_FRAMES_IN_CP850_852), TEXT_(T_BLOCK_CURSOR), TEXT_(T_COLOR), NULL }; static void terminal_options(struct terminal *term, void *xxx, void *ses_) { @@ -660,19 +659,15 @@ static void terminal_options(struct terminal *term, void *xxx, void *ses_) d->items[8].gid = 0; d->items[8].dlen = sizeof(int); d->items[8].data = (void *)&ts->col; - d->items[9].type = D_CHECKBOX; - d->items[9].gid = 0; - d->items[9].dlen = sizeof(int); - d->items[9].data = (void *)&ts->braille; + d->items[9].type = D_BUTTON; + d->items[9].gid = B_ENTER; + d->items[9].fn = ok_dialog; + d->items[9].text = TEXT_(T_OK); d->items[10].type = D_BUTTON; - d->items[10].gid = B_ENTER; - d->items[10].fn = ok_dialog; - d->items[10].text = TEXT_(T_OK); - d->items[11].type = D_BUTTON; - d->items[11].gid = B_ESC; - d->items[11].fn = cancel_dialog; - d->items[11].text = TEXT_(T_CANCEL); - d->items[12].type = D_END; + d->items[10].gid = B_ESC; + d->items[10].fn = cancel_dialog; + d->items[10].text = TEXT_(T_CANCEL); + d->items[11].type = D_END; do_dialog(term, d, getml(d, NULL)); } @@ -1206,7 +1201,6 @@ static void proxy_fn(struct dialog_data *dlg) int w, rw; int i; int y = gf_val(-1, -G_BFU_FONT_SIZE); - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); for (i = 0; i < N_N; i++) { max_text_width(term, proxy_msg[i], &max, AL_LEFT); min_text_width(term, proxy_msg[i], &min, AL_LEFT); @@ -1223,7 +1217,7 @@ static void proxy_fn(struct dialog_data *dlg) rw = 0; for (i = 0; i < N_N; i++) { dlg_format_text_and_field(dlg, NULL, proxy_msg[i], &dlg->items[i], 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT); - if (!dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE * 1); + y += gf_val(1, G_BFU_FONT_SIZE * 1); } dlg_format_group(dlg, NULL, proxy_msg + N_N, dlg->items + N_N, dlg->n - 2 - N_N, 0, &y, w, &rw); y += gf_val(1, G_BFU_FONT_SIZE); @@ -1234,10 +1228,9 @@ static void proxy_fn(struct dialog_data *dlg) center_dlg(dlg); draw_dlg(dlg); y = dlg->y + DIALOG_TB; - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); for (i = 0; i < N_N; i++) { dlg_format_text_and_field(dlg, term, proxy_msg[i], &dlg->items[i], dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); - if (!dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); + y += gf_val(1, G_BFU_FONT_SIZE); } dlg_format_group(dlg, term, proxy_msg + N_N, &dlg->items[N_N], dlg->n - 2 - N_N, dlg->x + DIALOG_LB, &y, w, NULL); y += gf_val(1, G_BFU_FONT_SIZE); @@ -1591,9 +1584,9 @@ static void ssl_options_fn(struct dialog_data *dlg) dlg_format_checkboxes(dlg, NULL, dlg->items, dlg->n - 5, 0, &y, w, &rw, dlg->dlg->udata); y += gf_val(1, 1 * G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, NULL, ssl_labels[dlg->n - 5], dlg->items + dlg->n - 5, 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT); - if (!dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE * 1); + y += gf_val(1, G_BFU_FONT_SIZE * 1); dlg_format_text_and_field(dlg, NULL, ssl_labels[dlg->n - 4], dlg->items + dlg->n - 4, 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT); - if (!dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE * 1); + y += gf_val(1, G_BFU_FONT_SIZE * 1); dlg_format_text_and_field(dlg, NULL, ssl_labels[dlg->n - 3], dlg->items + dlg->n - 3, 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT); y += gf_val(1, 1 * G_BFU_FONT_SIZE); dlg_format_buttons(dlg, NULL, dlg->items + dlg->n - 2, 2, 0, &y, w, &rw, AL_CENTER); @@ -1606,9 +1599,9 @@ static void ssl_options_fn(struct dialog_data *dlg) dlg_format_checkboxes(dlg, term, dlg->items, dlg->n - 5, dlg->x + DIALOG_LB, &y, w, NULL, dlg->dlg->udata); y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, term, ssl_labels[dlg->n - 5], dlg->items + dlg->n - 5, dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); - if (!dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE * 1); + y += gf_val(1, G_BFU_FONT_SIZE * 1); dlg_format_text_and_field(dlg, term, ssl_labels[dlg->n - 4], dlg->items + dlg->n - 4, dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); - if (!dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE * 1); + y += gf_val(1, G_BFU_FONT_SIZE * 1); dlg_format_text_and_field(dlg, term, ssl_labels[dlg->n - 3], dlg->items + dlg->n - 3, dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_buttons(dlg, term, dlg->items + dlg->n - 2, 2, dlg->x + DIALOG_LB, &y, w, &rw, AL_CENTER); @@ -1702,9 +1695,9 @@ static void httpheadopt_fn(struct dialog_data *dlg) dlg_format_checkboxes(dlg, NULL, dlg->items, dlg->n - 5, 0, &y, w, &rw, dlg->dlg->udata); y += gf_val(1, 1 * G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, NULL, http_header_labels[dlg->n - 5], dlg->items + dlg->n - 5, 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT); - if (!dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE * 1); + y += gf_val(1, G_BFU_FONT_SIZE * 1); dlg_format_text_and_field(dlg, NULL, http_header_labels[dlg->n - 4], dlg->items + dlg->n - 4, 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT); - if (!dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE * 1); + y += gf_val(1, G_BFU_FONT_SIZE * 1); dlg_format_text_and_field(dlg, NULL, http_header_labels[dlg->n - 3], dlg->items + dlg->n - 3, 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT); y += gf_val(1, 1 * G_BFU_FONT_SIZE); dlg_format_buttons(dlg, NULL, dlg->items + dlg->n - 2, 2, 0, &y, w, &rw, AL_CENTER); @@ -1717,9 +1710,9 @@ static void httpheadopt_fn(struct dialog_data *dlg) dlg_format_checkboxes(dlg, term, dlg->items, dlg->n - 5, dlg->x + DIALOG_LB, &y, w, NULL, dlg->dlg->udata); y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, term, http_header_labels[dlg->n - 5], dlg->items + dlg->n - 5, dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); - if (!dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE * 1); + y += gf_val(1, G_BFU_FONT_SIZE * 1); dlg_format_text_and_field(dlg, term, http_header_labels[dlg->n - 4], dlg->items + dlg->n - 4, dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); - if (!dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE * 1); + y += gf_val(1, G_BFU_FONT_SIZE * 1); dlg_format_text_and_field(dlg, term, http_header_labels[dlg->n - 3], dlg->items + dlg->n - 3, dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_buttons(dlg, term, dlg->items + dlg->n - 2, 2, dlg->x + DIALOG_LB, &y, w, &rw, AL_CENTER); @@ -1863,7 +1856,6 @@ static void ftpopt_fn(struct dialog_data *dlg) int max = 0, min = 0; int w, rw; int y = 0; - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); max_text_width(term, ftp_texts[0], &max, AL_LEFT); min_text_width(term, ftp_texts[0], &min, AL_LEFT); checkboxes_width(term, ftp_texts + 1, dlg->n - 3, &max, max_text_width); @@ -1886,7 +1878,6 @@ static void ftpopt_fn(struct dialog_data *dlg) center_dlg(dlg); draw_dlg(dlg); y = dlg->y + DIALOG_TB; - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, term, ftp_texts[0], dlg->items, dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_checkboxes(dlg, term, dlg->items + 1, dlg->n - 3, dlg->x + DIALOG_LB, &y, w, NULL, ftp_texts + 1); @@ -1975,17 +1966,15 @@ static void netprog_fn(struct dialog_data *dlg) if (w < 1) w = 1; rw = 0; a=0; - if (term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, NULL, prg_msg[a], &dlg->items[a], 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT); a++; #ifdef G if (have_extra_exec()) { dlg_format_text_and_field(dlg, NULL, prg_msg[a], &dlg->items[a], 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT); a++; - if (!term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); + y += gf_val(1, G_BFU_FONT_SIZE); } #endif - if (term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_buttons(dlg, NULL, dlg->items + a, 2, 0, &y, w, &rw, AL_CENTER); w = rw; dlg->xw = w + 2 * DIALOG_LB; @@ -1993,7 +1982,6 @@ static void netprog_fn(struct dialog_data *dlg) center_dlg(dlg); draw_dlg(dlg); y = dlg->y + DIALOG_TB; - if (term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); a=0; dlg_format_text_and_field(dlg, term, prg_msg[a], &dlg->items[a], dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); a++; @@ -2001,10 +1989,9 @@ static void netprog_fn(struct dialog_data *dlg) if (have_extra_exec()) { dlg_format_text_and_field(dlg, term, prg_msg[a], &dlg->items[a], dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); a++; - if (!term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); + y += gf_val(1, G_BFU_FONT_SIZE); } #endif - if (term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_buttons(dlg, term, &dlg->items[a], 2, dlg->x + DIALOG_LB, &y, w, NULL, AL_CENTER); } @@ -2014,7 +2001,8 @@ static void net_programs(struct terminal *term, void *xxx, void *yyy) int a; d = mem_calloc(sizeof(struct dialog) + 8 * sizeof(struct dialog_item)); #ifdef G - if (have_extra_exec()) d->title = TEXT_(T_MAIL_TELNET_AND_SHELL_PROGRAMS); + if (have_extra_exec()) + d->title = TEXT_(T_MAIL_TELNET_AND_SHELL_PROGRAMS); else #endif d->title = TEXT_(T_MAIL_AND_TELNET_PROGRAMS); diff --git a/session.c b/session.c @@ -296,7 +296,6 @@ static void x_print_screen_title(struct terminal *term, void *ses_) if ((m = print_current_title(ses))) { int p = term->x - 1 - cp_len(term_charset(ses->term), m); if (p < 0) p = 0; - if (term->spec->braille) p = 0; print_text(term, p, 0, cp_len(term_charset(ses->term), m), m, color); free(m); } @@ -624,7 +623,8 @@ void download_window_function(struct dialog_data *dlg) min_buttons_width(term, dlg->items, dlg->n, &min); w = dlg->win->term->x * 9 / 10 - 2 * DIALOG_LB; if (w < min) w = min; - if (!dlg->win->term->spec->braille && w > dlg->win->term->x - 2 * DIALOG_LB) w = dlg->win->term->x - 2 * DIALOG_LB; + if (w > dlg->win->term->x - 2 * DIALOG_LB) + w = dlg->win->term->x - 2 * DIALOG_LB; if (show_percentage) { if (w < DOWN_DLG_MIN) w = DOWN_DLG_MIN; } else { @@ -649,7 +649,6 @@ void download_window_function(struct dialog_data *dlg) if (!F) { unsigned char *q; int p = w - 6; - if (term->spec->braille && p > 39 - 6) p = 39 - 6; y++; set_only_char(term, x, y, '[', 0); set_only_char(term, x + p + 1, y, ']', 0); @@ -1662,11 +1661,9 @@ static void html_interpret(struct f_data_c *fd, int report_status) } #endif o.cp = term_charset(fd->ses->term); - o.braille = fd->ses->term->spec->braille; } else { o.col = 3; o.cp = 0; - o.braille = 0; } if (!(o.framename = fd->loc->name)) o.framename = NULL; if (!(fd->f_data = cached_format_html(fd, fd->rq, fd->rq->url, &o, &cch, report_status))) { diff --git a/setup.h b/setup.h @@ -47,27 +47,27 @@ #define COL(x) (x) -#define COLOR_MENU_TEXT (term && !term->spec->braille ? COL(070) : COL(007)) -#define COLOR_MENU_FRAME (term && !term->spec->braille ? COL(070) : COL(007)) -#define COLOR_MENU_SELECTED (term && !term->spec->braille ? COL(007) : COL(007)) -#define COLOR_MENU_HOTKEY (term && !term->spec->braille ? COL(007) : COL(0107)) - -#define COLOR_MAINMENU (term && !term->spec->braille ? COL(070) : COL(007)) -#define COLOR_MAINMENU_SELECTED (term && !term->spec->braille ? COL(007) : COL(007)) -#define COLOR_MAINMENU_HOTKEY (term && !term->spec->braille ? COL(070) : COL(0107)) - -#define COLOR_DIALOG (term && !term->spec->braille ? COL(070) : COL(007)) -#define COLOR_DIALOG_FRAME (term && !term->spec->braille ? COL(070) : COL(007)) -#define COLOR_DIALOG_TITLE (term && !term->spec->braille ? COL(007) : COL(007)) -#define COLOR_DIALOG_TEXT (term && !term->spec->braille ? COL(070) : COL(007)) -#define COLOR_DIALOG_CHECKBOX (term && !term->spec->braille ? COL(070) : COL(0107)) -#define COLOR_DIALOG_CHECKBOX_TEXT (term && !term->spec->braille ? COL(070) : COL(007)) -#define COLOR_DIALOG_BUTTON (term && !term->spec->braille ? COL(070) : COL(0107)) -#define COLOR_DIALOG_BUTTON_SELECTED (term && !term->spec->braille ? COL(0107) : COL(0107)) -#define COLOR_DIALOG_FIELD (term && !term->spec->braille ? COL(007) : COL(0107)) -#define COLOR_DIALOG_FIELD_TEXT (term && !term->spec->braille ? COL(007) : COL(0107)) -#define COLOR_DIALOG_METER (term && !term->spec->braille ? COL(007) : COL(0177)) -#define CHAR_DIALOG_METER (term && !term->spec->braille ? 0 : '*') +#define COLOR_MENU_TEXT (term ? COL(070) : COL(007)) +#define COLOR_MENU_FRAME (term ? COL(070) : COL(007)) +#define COLOR_MENU_SELECTED COL(007) +#define COLOR_MENU_HOTKEY (term ? COL(007) : COL(0107)) + +#define COLOR_MAINMENU (term ? COL(070) : COL(007)) +#define COLOR_MAINMENU_SELECTED COL(007) +#define COLOR_MAINMENU_HOTKEY (term ? COL(070) : COL(0107)) + +#define COLOR_DIALOG (term ? COL(070) : COL(007)) +#define COLOR_DIALOG_FRAME (term ? COL(070) : COL(007)) +#define COLOR_DIALOG_TITLE (term ? COL(007) : COL(007)) +#define COLOR_DIALOG_TEXT (term ? COL(070) : COL(007)) +#define COLOR_DIALOG_CHECKBOX (term ? COL(070) : COL(0107)) +#define COLOR_DIALOG_CHECKBOX_TEXT (term ? COL(070) : COL(007)) +#define COLOR_DIALOG_BUTTON (term ? COL(070) : COL(0107)) +#define COLOR_DIALOG_BUTTON_SELECTED COL(0107) +#define COLOR_DIALOG_FIELD (term ? COL(007) : COL(0107)) +#define COLOR_DIALOG_FIELD_TEXT (term ? COL(007) : COL(0107)) +#define COLOR_DIALOG_METER (term ? COL(007) : COL(0177)) +#define CHAR_DIALOG_METER (term ? 0 : '*') #define SCROLL_ITEMS 2 diff --git a/terminal.c b/terminal.c @@ -551,8 +551,8 @@ void free_term_specs(void) free_list(struct term_spec, term_specs); } -static struct term_spec dumb_term = { init_list_1st(NULL) "", 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, init_list_last(NULL) }; -static struct term_spec cygwin_term = { init_list_1st(NULL) "", 2, 1, 1, 0, 1, 0, -1, 0, 0, 0, 0, init_list_last(NULL) }; +static struct term_spec dumb_term = { init_list_1st(NULL) "", 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, init_list_last(NULL) }; +static struct term_spec cygwin_term = { init_list_1st(NULL) "", 2, 1, 1, 0, 1, 0, 0, 0, 0, 0, init_list_last(NULL) }; static struct term_spec *default_term_spec(unsigned char *term) { @@ -659,7 +659,7 @@ direct: #ifdef G -static struct term_spec gfx_term = { init_list_1st(NULL) "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, init_list_last(NULL) }; +static struct term_spec gfx_term = { init_list_1st(NULL) "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, init_list_last(NULL) }; struct terminal *init_gfx_term(void (*root_window)(struct window *, struct links_event *, int), unsigned char *cwd, void *info, int len) { @@ -1277,7 +1277,7 @@ void print_text(struct terminal *t, int x, int y, int l, unsigned char *text, un void set_cursor(struct terminal *term, int x, int y, int altx, int alty) { term->dirty = 1; - if (term->spec->block_cursor && !term->spec->braille) { + if (term->spec->block_cursor) { x = altx; y = alty; } diff --git a/types.c b/types.c @@ -158,7 +158,6 @@ static void assoc_edit_item_fn(struct dialog_data *dlg) int w, rw; int y = gf_val(-1, -G_BFU_FONT_SIZE); int p = 3; - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); p++; p += 2; max_text_width(term, ct_msg[0], &max, AL_LEFT); @@ -192,7 +191,6 @@ static void assoc_edit_item_fn(struct dialog_data *dlg) center_dlg(dlg); draw_dlg(dlg); y = dlg->y + DIALOG_TB; - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, term, ct_msg[0], &dlg->items[0], dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, term, ct_msg[1], &dlg->items[1], dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); @@ -520,7 +518,6 @@ static void ext_edit_item_fn(struct dialog_data *dlg) int max = 0, min = 0; int w, rw; int y = gf_val(-1, -G_BFU_FONT_SIZE); - if (dlg->win->term->spec->braille) y += gf_val(1, G_BFU_FONT_SIZE); max_text_width(term, ext_msg[0], &max, AL_LEFT); min_text_width(term, ext_msg[0], &min, AL_LEFT); max_text_width(term, ext_msg[1], &max, AL_LEFT); @@ -548,8 +545,6 @@ static void ext_edit_item_fn(struct dialog_data *dlg) center_dlg(dlg); draw_dlg(dlg); y = dlg->y + DIALOG_TB; - if (dlg->win->term->spec->braille) - y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, term, ext_msg[0], &dlg->items[0], dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT); y += gf_val(1, G_BFU_FONT_SIZE); dlg_format_text_and_field(dlg, term, ext_msg[1], &dlg->items[1], dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT);