101,8 → 101,8 |
if (style.s) DrawBuf.DrawBar(start_x, list.line_h / 2 - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]); |
if (style.u) DrawBuf.DrawBar(start_x, list.line_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]); |
if (link) { |
DrawBuf.DrawBar(start_x, list.line_h*style.h + list.line_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]); |
PageLinks.AddText(#line, line_length, list.line_h*style.h + list.line_h, UNDERLINE); |
DrawBuf.DrawBar(start_x, list.line_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]); |
PageLinks.AddText(#line, line_length, list.line_h, UNDERLINE); |
} |
stolbec += stolbec_len; |
} |
118,8 → 118,10 |
word bukva[2]; |
int j; |
byte ignor_param; |
dword bufpos; |
char temp[768]; |
dword bufpos = bufpointer; |
int line_len; |
|
style.b = style.i = style.u = style.s = style.h = style.blq = t_html = t_body = |
style.li = link = ignor_text = text_color_index = text_colors[0] = style.li_tab = 0; |
style.align = ALIGN_LEFT; |
132,21 → 134,23 |
stroka = -list.first; |
stolbec = 0; |
line = 0; |
|
//for plaint text use CP866 for other UTF |
if (strstri(bufpointer, "html")) |
{ |
style.pre = 0; |
cur_encoding = CH_UTF8; |
cur_encoding = CH_CP866; |
} |
else |
{ |
style.pre = 1; |
cur_encoding = CH_CP866; |
cur_encoding = CH_UTF8; |
} |
for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;) |
|
for ( ; (bufpointer+bufsize > bufpos) && (ESBYTE[bufpos]!=0); bufpos++;) |
{ |
if (ignor_text) && (ESBYTE[bufpos]!='<') continue; |
bukva = ESBYTE[bufpos]; |
if (ignor_text) && (bukva!='<') continue; |
switch (bukva) |
{ |
case 0x0a: |
153,6 → 157,7 |
if (style.pre) |
{ |
chrcat(#line, ' '); |
bukva = temp = NULL; |
Perenos(); |
break; |
} |
165,6 → 170,7 |
break; |
} |
goto DEFAULT_MARK; |
|
case '&': // and so on |
bufpos++; |
tag=0; |
206,7 → 212,7 |
Perenos(); |
DrawStyle(); |
line = NULL; |
if (tag) SetStyle(); //îáðàáîòêà òåãîâ |
if (tag) SetStyle(WB1.DrawBuf.zoom * 5 + list.x, stroka * list.line_h + list.y + 5); //îáðàáîòêà òåãîâ |
strcpy(#oldtag, #tag); |
tag = attr = tagparam = ignor_param = NULL; |
break; |
239,9 → 245,9 |
{ |
int perenos_num; |
char new_line_text[4096]; |
if (utf8_strlen(#line)*DrawBuf.zoom + stolbec < list.column_max) return; |
if (stolbec + utf8_strlen(#line) < list.column_max) return; |
perenos_num = strrchr(#line, ' '); |
if (!perenos_num) && (utf8_strlen(#line)*DrawBuf.zoom>list.column_max) perenos_num=list.column_max/DrawBuf.zoom; |
if (!perenos_num) && (utf8_strlen(#line)>list.column_max) perenos_num=list.column_max; |
strcpy(#new_line_text, #line + perenos_num); |
line[perenos_num] = 0x00; |
DrawStyle(); |
249,9 → 255,8 |
NewLine(); |
} |
//============================================================================================ |
void TWebBrowser::SetStyle() { |
int left1 = 5 + list.x; |
int top1 = stroka * list.line_h + list.y + 5; |
void TWebBrowser::SetStyle(int left1, top1) { |
dword hr_color; |
byte opened; |
byte meta_encoding; |
//ïðîâåðÿåì òåã îòêðûâàåòñÿ èëè çàêðûâàåòñÿ |
261,6 → 266,7 |
strcpy(#tag, #tag+1); |
} |
else opened = 1; |
|
if (istag("html")) { |
t_html = opened; |
return; |
388,14 → 394,15 |
if (opened) NewLine(); |
return; |
} |
if (istag("li")) || (istag("dt")) |
if (istag("li")) || (istag("dt")) //íàäî ñäåëàòü âëîæåííûå ñïèñêè |
{ |
style.li = opened; |
if (opened) |
{ |
NewLine(); |
DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, stroka +1 * list.line_h - 3 |
- DrawBuf.zoom - DrawBuf.zoom, DrawBuf.zoom*2, DrawBuf.zoom*2, 0x454545); |
if (stroka > -1) && (stroka - 2 < list.visible) |
DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, list.line_h |
/ 2 - DrawBuf.zoom - DrawBuf.zoom, DrawBuf.zoom*2, DrawBuf.zoom*2, 0x555555); |
} |
return; |
} |
409,13 → 416,15 |
else style.li_tab++; |
} |
if (istag("hr")) { |
if (isattr("color=")) EDI = GetColor(#val); else EDI = 0x999999; |
$push edi; |
if (anchor) || (stroka < -1) |
{ |
stroka+=2; |
return; |
} |
if (strcmp(#attr, "color=") == 0) hr_color = GetColor(#val); else hr_color = 0x999999; |
NewLine(); |
$pop edi; |
DrawBuf.DrawBar(5, list.line_h*stroka+4, list.w-10, 1, EDI); |
DrawBuf.DrawBar(5, list.line_h/2, list.w-10, 1, hr_color); |
NewLine(); |
return; |
} |
if (istag("meta")) || (istag("?xml")) { |
do{ |