1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

format.(clink|vlink|...) -> format.color.(clink|vlink|...)

It makes more obvious these fields are colors.
This commit is contained in:
Laurent MONIN 2007-10-10 14:37:10 +02:00
parent 6564aec93f
commit ca6424595b
6 changed files with 21 additions and 18 deletions

View File

@ -899,12 +899,12 @@ init_html_parser(struct uri *uri, struct document_options *options,
format.title = NULL;
format.style = options->default_style;
format.clink = options->default_link;
format.vlink = options->default_vlink;
format.color.clink = options->default_link;
format.color.vlink = options->default_vlink;
#ifdef CONFIG_BOOKMARKS
format.bookmark_link = options->default_bookmark_link;
format.color.bookmark_link = options->default_bookmark_link;
#endif
format.image_link = options->default_image_link;
format.color.image_link = options->default_image_link;
par_format.align = ALIGN_LEFT;
par_format.leftmargin = options->margin;

View File

@ -32,12 +32,15 @@ struct text_attrib {
unsigned char *image;
unsigned char *title;
struct form_control *form;
color_T clink;
color_T vlink;
struct {
color_T clink;
color_T vlink;
#ifdef CONFIG_BOOKMARKS
color_T bookmark_link;
color_T bookmark_link;
#endif
color_T image_link;
color_T image_link;
} color;
#ifdef CONFIG_CSS
/* Bug 766: CSS speedup. 56% of CPU time was going to

View File

@ -166,8 +166,8 @@ html_body(struct html_context *html_context, unsigned char *a,
unsigned char *xxx3, unsigned char *xxx4, unsigned char **xxx5)
{
get_color(html_context, a, "text", &format.style.fg);
get_color(html_context, a, "link", &format.clink);
get_color(html_context, a, "vlink", &format.vlink);
get_color(html_context, a, "link", &format.color.clink);
get_color(html_context, a, "vlink", &format.color.vlink);
if (get_bgcolor(html_context, a, &format.style.bg) != -1)
html_context->was_body_background = 1;

View File

@ -66,19 +66,19 @@ html_a(struct html_context *html_context, unsigned char *a,
; /* Shut up compiler */
#ifdef CONFIG_GLOBHIST
} else if (get_global_history_item(format.link)) {
format.style.fg = format.vlink;
format.style.fg = format.color.vlink;
html_top->pseudo_class &= ~ELEMENT_LINK;
html_top->pseudo_class |= ELEMENT_VISITED;
#endif
#ifdef CONFIG_BOOKMARKS
} else if (get_bookmark(format.link)) {
format.style.fg = format.bookmark_link;
format.style.fg = format.color.bookmark_link;
html_top->pseudo_class &= ~ELEMENT_VISITED;
/* XXX: Really set ELEMENT_LINK? --pasky */
html_top->pseudo_class |= ELEMENT_LINK;
#endif
} else {
format.style.fg = format.clink;
format.style.fg = format.color.clink;
html_top->pseudo_class &= ~ELEMENT_VISITED;
html_top->pseudo_class |= ELEMENT_LINK;
}
@ -199,7 +199,7 @@ put_image_label(unsigned char *a, unsigned char *label,
html_focusable(html_context, a);
fg = format.style.fg;
format.style.fg = format.image_link;
format.style.fg = format.color.image_link;
put_chrs(html_context, label, strlen(label));
format.style.fg = fg;
}
@ -367,7 +367,7 @@ put_link_line(unsigned char *prefix, unsigned char *linkname,
put_chrs(html_context, prefix, strlen(prefix));
format.link = join_urls(html_context->base_href, link);
format.target = stracpy(target);
format.style.fg = format.clink;
format.style.fg = format.color.clink;
/* FIXME: linkname typically comes from get_attr_val, which
* has already converted it from the document charset to the
* terminal charset and expanded character entity references.

View File

@ -887,7 +887,7 @@ start_element(struct element_info *ei,
/* XXX: Put something better to format.link. --pasky */
mem_free_set(&format.link, stracpy("javascript:void(0);"));
mem_free_set(&format.target, stracpy(html_context->base_target));
format.style.fg = format.clink;
format.style.fg = format.color.clink;
html_top->pseudo_class = ELEMENT_LINK;
mem_free_set(&format.title, stracpy("onClick placeholder"));
/* Er. I know. Well, double html_focusable()s shouldn't

View File

@ -1306,7 +1306,7 @@ new_link(struct html_context *html_context, unsigned char *name, int namelen)
link->color.background = format.style.bg;
link->color.foreground = link_is_textinput(link)
? format.style.fg : format.clink;
? format.style.fg : format.color.clink;
init_link_event_hooks(html_context, link);
@ -1896,7 +1896,7 @@ color_link_lines(struct html_context *html_context)
/* XXX: Entering hack zone! Change to clink color after
* link text has been recolored. */
if (schar->data == ':' && colors.foreground == 0x0)
colors.foreground = format.clink;
colors.foreground = format.color.clink;
}
colors.foreground = 0x0;