2014-01-27 21:16:33 +01:00
|
|
|
|
dword bufpointer;
|
2014-03-12 23:56:28 +01:00
|
|
|
|
dword o_bufpointer;
|
2014-01-27 21:16:33 +01:00
|
|
|
|
dword bufsize;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2015-03-01 22:36:17 +01:00
|
|
|
|
char URL[10000];
|
2013-12-27 13:30:42 +01:00
|
|
|
|
|
2014-03-22 11:29:29 +01:00
|
|
|
|
scroll_bar scroll_wv = { 15,200,398,44,0,2,115,15,0,0xeeeeee,0xBBBbbb,0xeeeeee,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
|
2013-12-27 13:30:42 +01:00
|
|
|
|
|
2013-12-29 13:48:06 +01:00
|
|
|
|
char header[2048];
|
2013-12-27 13:30:42 +01:00
|
|
|
|
|
2013-12-27 00:36:17 +01:00
|
|
|
|
struct TWebBrowser {
|
2014-01-27 21:16:33 +01:00
|
|
|
|
llist list;
|
2015-08-05 00:21:08 +02:00
|
|
|
|
dword draw_line_width;
|
2014-01-18 12:46:58 +01:00
|
|
|
|
DrawBufer DrawBuf;
|
2014-03-12 23:56:28 +01:00
|
|
|
|
void Prepare();
|
2014-01-30 19:28:50 +01:00
|
|
|
|
void Parse();
|
2014-03-15 16:16:08 +01:00
|
|
|
|
void SetTextStyle();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
void DrawPage();
|
|
|
|
|
void DrawScroller();
|
2014-03-15 16:16:08 +01:00
|
|
|
|
void NewLine();
|
2014-03-30 13:57:13 +02:00
|
|
|
|
void Perenos();
|
|
|
|
|
byte end_parsing;
|
2014-03-23 18:12:21 +01:00
|
|
|
|
} WB1;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2014-01-19 23:46:58 +01:00
|
|
|
|
byte b_text, i_text, u_text, s_text, pre_text, blq_text, li_text, li_tab,
|
2014-03-13 00:30:28 +01:00
|
|
|
|
link, ignor_text, cur_encoding, text_align, t_html, t_body;
|
2013-12-29 13:48:06 +01:00
|
|
|
|
byte condition_text_active, condition_text_val, condition_href, condition_max;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
|
|
|
|
enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT};
|
|
|
|
|
|
2013-12-29 13:48:06 +01:00
|
|
|
|
dword text_colors[300];
|
|
|
|
|
dword text_color_index;
|
2014-01-19 23:46:58 +01:00
|
|
|
|
dword link_color_inactive;
|
|
|
|
|
dword link_color_active;
|
2013-12-29 13:48:06 +01:00
|
|
|
|
dword bg_color;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2013-12-29 13:48:06 +01:00
|
|
|
|
int stroka;
|
|
|
|
|
int stolbec;
|
|
|
|
|
int tab_len;
|
|
|
|
|
int anchor_line_num;
|
2014-03-12 23:56:28 +01:00
|
|
|
|
|
2013-12-29 13:48:06 +01:00
|
|
|
|
char line[500];
|
|
|
|
|
char tag[100];
|
|
|
|
|
char tagparam[10000];
|
|
|
|
|
char parametr[1200];
|
|
|
|
|
char options[4096];
|
|
|
|
|
char anchor[256];
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2013-12-27 13:30:42 +01:00
|
|
|
|
#include "..\TWB\history.h"
|
2014-03-23 18:12:21 +01:00
|
|
|
|
#include "..\TWB\links.h"
|
2013-12-27 00:36:17 +01:00
|
|
|
|
#include "..\TWB\colors.h"
|
|
|
|
|
#include "..\TWB\unicode_tags.h"
|
|
|
|
|
#include "..\TWB\img_cache.h"
|
|
|
|
|
#include "..\TWB\parce_tag.h"
|
2014-03-12 23:56:28 +01:00
|
|
|
|
#include "..\TWB\table.h"
|
2014-01-18 12:46:58 +01:00
|
|
|
|
|
|
|
|
|
|
2013-12-27 00:36:17 +01:00
|
|
|
|
//=======================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TWebBrowser::DrawPage()
|
|
|
|
|
{
|
2015-08-05 00:21:08 +02:00
|
|
|
|
int start_x, start_y, line_length, stolbec_len, magrin_left=5;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
|
|
|
|
if (!header)
|
|
|
|
|
{
|
|
|
|
|
strcpy(#header, #line);
|
|
|
|
|
strcat(#header, " -");
|
|
|
|
|
strcat(#header, #version);
|
|
|
|
|
line = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2014-03-13 00:30:28 +01:00
|
|
|
|
if (t_html) && (!t_body) return;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2013-12-27 12:15:17 +01:00
|
|
|
|
if (stroka >= 0) && (stroka - 2 < list.visible) && (line) && (!anchor)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2015-08-10 14:45:00 +02:00
|
|
|
|
start_x = stolbec * list.font_w + magrin_left * DrawBuf.zoom + list.x;
|
2015-08-05 00:21:08 +02:00
|
|
|
|
start_y = stroka * list.line_h + magrin_left + list.y;
|
2014-03-30 13:57:13 +02:00
|
|
|
|
stolbec_len = strlen(#line);
|
2015-08-10 14:45:00 +02:00
|
|
|
|
line_length = stolbec_len * list.font_w * DrawBuf.zoom;
|
2015-08-05 00:21:08 +02:00
|
|
|
|
|
2015-08-10 17:08:16 +02:00
|
|
|
|
WriteBufText(start_x, 0, list.font_type, text_colors[text_color_index], #line, buf_data);
|
|
|
|
|
if (b_text) WriteBufText(start_x+1, 0, list.font_type, text_colors[text_color_index], #line, buf_data);
|
2015-08-05 00:21:08 +02:00
|
|
|
|
if (i_text) { stolbec++; DrawBuf.Skew(start_x, 0, line_length, list.line_h); } // bug with zoom>1
|
|
|
|
|
if (s_text) DrawBuf.DrawBar(start_x, list.line_h / 2 - DrawBuf.zoom, line_length, DrawBuf.zoom, text_colors[text_color_index]);
|
|
|
|
|
if (u_text) DrawBuf.DrawBar(start_x, list.line_h - DrawBuf.zoom - DrawBuf.zoom, line_length, DrawBuf.zoom, text_colors[text_color_index]);
|
2015-03-16 15:20:32 +01:00
|
|
|
|
if (link) {
|
2015-08-05 00:21:08 +02:00
|
|
|
|
DrawBuf.DrawBar(start_x, list.line_h - DrawBuf.zoom - DrawBuf.zoom, line_length, DrawBuf.zoom, text_colors[text_color_index]);
|
2015-08-10 17:08:16 +02:00
|
|
|
|
UnsafeDefineButton(start_x-2, start_y-1, line_length + 3, DrawBuf.zoom * list.font_h, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9);
|
2015-08-05 00:21:08 +02:00
|
|
|
|
PageLinks.AddText(#line, line_length, list.line_h, UNDERLINE);
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
2014-03-30 13:57:13 +02:00
|
|
|
|
stolbec += stolbec_len;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//=======================================================================
|
|
|
|
|
|
|
|
|
|
|
2014-03-12 23:56:28 +01:00
|
|
|
|
void TWebBrowser::Prepare(dword bufpos, in_filesize){
|
|
|
|
|
bufsize = in_filesize;
|
|
|
|
|
bufpointer = bufpos;
|
|
|
|
|
Parse();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-03-12 23:56:28 +01:00
|
|
|
|
void TWebBrowser::Parse(){
|
2013-12-27 00:36:17 +01:00
|
|
|
|
word bukva[2];
|
2014-03-30 13:57:13 +02:00
|
|
|
|
int j;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
byte ignor_param;
|
|
|
|
|
char temp[768];
|
2014-03-12 23:56:28 +01:00
|
|
|
|
dword bufpos = bufpointer;
|
2014-03-31 20:01:40 +02:00
|
|
|
|
int line_len;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2014-03-13 00:30:28 +01:00
|
|
|
|
b_text = i_text = u_text = s_text = blq_text = t_html = t_body =
|
2013-12-29 13:48:06 +01:00
|
|
|
|
li_text = link = ignor_text = text_color_index = text_colors[0] = li_tab =
|
|
|
|
|
condition_text_val = condition_text_active = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
2014-03-30 13:57:13 +02:00
|
|
|
|
end_parsing = false;
|
2014-01-18 12:46:58 +01:00
|
|
|
|
condition_max = 255;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
text_align = ALIGN_LEFT;
|
2014-01-19 23:46:58 +01:00
|
|
|
|
link_color_inactive = 0x0000FF;
|
|
|
|
|
link_color_active = 0xFF0000;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
bg_color = 0xFFFFFF;
|
2014-01-18 12:46:58 +01:00
|
|
|
|
DrawBuf.Fill(bg_color);
|
2014-01-21 20:22:03 +01:00
|
|
|
|
PageLinks.Clear();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
strcpy(#header, #version);
|
2013-12-27 12:15:17 +01:00
|
|
|
|
stroka = -list.first;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
stolbec = 0;
|
|
|
|
|
line = 0;
|
|
|
|
|
|
2015-08-05 00:21:08 +02:00
|
|
|
|
draw_line_width = list.w * DrawBuf.zoom;
|
2015-03-16 15:20:32 +01:00
|
|
|
|
|
2013-12-27 00:36:17 +01:00
|
|
|
|
if (pre_text<>2)
|
|
|
|
|
{
|
|
|
|
|
pre_text=0;
|
|
|
|
|
if (!strcmp(#URL + strlen(#URL) - 4, ".txt")) pre_text = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-30 13:57:13 +02:00
|
|
|
|
for ( ; (bufpointer+bufsize > bufpos) && (ESBYTE[bufpos]!=0); bufpos++;)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-03-30 13:57:13 +02:00
|
|
|
|
if (end_parsing) break;
|
2014-01-22 01:08:47 +01:00
|
|
|
|
bukva = ESBYTE[bufpos];
|
2013-12-29 13:48:06 +01:00
|
|
|
|
if (ignor_text) && (bukva!='<') continue;
|
|
|
|
|
if (condition_text_active) && (condition_text_val != condition_href) && (bukva!='<') continue;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
switch (bukva)
|
|
|
|
|
{
|
|
|
|
|
case 0x0a:
|
|
|
|
|
if (pre_text)
|
|
|
|
|
{
|
2014-03-23 18:12:21 +01:00
|
|
|
|
chrcat(#line, ' ');
|
2013-12-27 00:36:17 +01:00
|
|
|
|
bukva = temp = NULL;
|
2014-03-30 13:57:13 +02:00
|
|
|
|
Perenos();
|
2014-03-31 20:01:40 +02:00
|
|
|
|
break;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
case '\9':
|
|
|
|
|
if (pre_text) //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> 0x0d
|
|
|
|
|
{
|
2014-03-31 19:14:16 +02:00
|
|
|
|
tab_len = strlen(#line) % 4;
|
|
|
|
|
if (!tab_len) tab_len = 4;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
for (j=0; j<tab_len; j++;) chrcat(#line,' ');
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
goto DEFAULT_MARK;
|
|
|
|
|
|
|
|
|
|
case '&': // and so on
|
2014-01-22 01:08:47 +01:00
|
|
|
|
bufpos++;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
tag=0;
|
2014-01-22 01:08:47 +01:00
|
|
|
|
for (j=0; (ESBYTE[bufpos]<>';') && (j<7); j++, bufpos++;)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-22 01:08:47 +01:00
|
|
|
|
bukva = ESBYTE[bufpos];
|
2013-12-27 00:36:17 +01:00
|
|
|
|
chrcat(#tag, bukva);
|
|
|
|
|
}
|
2013-12-29 13:48:06 +01:00
|
|
|
|
if (bukva = GetUnicodeSymbol()) goto DEFAULT_MARK;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
break;
|
|
|
|
|
case '<':
|
2014-01-22 01:08:47 +01:00
|
|
|
|
bufpos++; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <
|
2013-12-27 00:36:17 +01:00
|
|
|
|
tag = parametr = tagparam = ignor_param = NULL;
|
2014-01-22 01:08:47 +01:00
|
|
|
|
if (ESBYTE[bufpos] == '!') //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <!-- -->, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-22 01:08:47 +01:00
|
|
|
|
bufpos++;
|
|
|
|
|
if (ESBYTE[bufpos] == '-')
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
|
|
|
|
HH_:
|
|
|
|
|
do
|
|
|
|
|
{
|
2014-01-22 01:08:47 +01:00
|
|
|
|
bufpos++;
|
2014-01-30 19:28:50 +01:00
|
|
|
|
if (bufpointer + bufsize <= bufpos) break 2;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
2014-01-22 01:08:47 +01:00
|
|
|
|
while (ESBYTE[bufpos] <>'-');
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2014-01-22 01:08:47 +01:00
|
|
|
|
bufpos++;
|
|
|
|
|
if (ESBYTE[bufpos] <>'-') goto HH_;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-01-30 19:28:50 +01:00
|
|
|
|
while (ESBYTE[bufpos] !='>') && (bufpos < bufpointer + bufsize) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-22 01:08:47 +01:00
|
|
|
|
bukva = ESBYTE[bufpos];
|
2013-12-27 00:36:17 +01:00
|
|
|
|
if (bukva == '\9') || (bukva == '\x0a') || (bukva == '\x0d') bukva = ' ';
|
|
|
|
|
if (!ignor_param) && (bukva <>' ')
|
|
|
|
|
{
|
2014-03-31 20:01:40 +02:00
|
|
|
|
if (strlen(#tag)<sizeof(tag)) chrcat(#tag, bukva);
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ignor_param = true;
|
|
|
|
|
if (!ignor_text) && (strlen(#tagparam)+1<sizeof(tagparam)) strcat(#tagparam, #bukva);
|
|
|
|
|
}
|
2014-01-22 01:08:47 +01:00
|
|
|
|
bufpos++;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
strlwr(#tag);
|
|
|
|
|
|
2013-12-29 13:48:06 +01:00
|
|
|
|
if (condition_text_active) && (condition_text_val != condition_href)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(#tag, "/condition")!=0) break;
|
|
|
|
|
}
|
2013-12-27 00:36:17 +01:00
|
|
|
|
if (tag[strlen(#tag)-1]=='/') tag[strlen(#tag)-1]=NULL; //for br/
|
2014-03-31 20:01:40 +02:00
|
|
|
|
if (tagparam) GetNextParam();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2014-03-30 13:57:13 +02:00
|
|
|
|
if (stolbec + strlen(#line) > list.column_max) Perenos();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
DrawPage();
|
2014-03-22 11:29:29 +01:00
|
|
|
|
line = NULL;
|
2015-08-05 00:21:08 +02:00
|
|
|
|
if (tag) SetTextStyle(WB1.DrawBuf.zoom * 5 + list.x, stroka * list.line_h + list.y + 5); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
2013-12-27 00:36:17 +01:00
|
|
|
|
tag = parametr = tagparam = ignor_param = NULL;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
DEFAULT_MARK:
|
|
|
|
|
if (bukva<=15) bukva=' ';
|
2014-03-31 20:01:40 +02:00
|
|
|
|
line_len = strlen(#line);
|
2013-12-27 00:36:17 +01:00
|
|
|
|
if (!pre_text) && (bukva == ' ')
|
|
|
|
|
{
|
2014-03-31 20:01:40 +02:00
|
|
|
|
if (line[line_len-1]==' ') break; //no double spaces
|
|
|
|
|
if (!stolbec) && (!line) break; //no paces at the beginning of the line
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
2014-03-31 20:01:40 +02:00
|
|
|
|
if (line_len < sizeof(line)) chrcat(#line, bukva);
|
|
|
|
|
if (stolbec + line_len > list.column_max) Perenos();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-03-23 23:49:49 +01:00
|
|
|
|
DrawPage();
|
|
|
|
|
NewLine();
|
2015-08-05 00:21:08 +02:00
|
|
|
|
DrawBar(list.x, stroka * list.line_h + list.y + 5, draw_line_width, -stroka * list.line_h + list.h - 5, bg_color);
|
|
|
|
|
DrawBar(list.x, list.visible * list.line_h + list.y + 4, draw_line_width, -list.visible * list.line_h + list.h - 4, bg_color);
|
2013-12-27 12:15:17 +01:00
|
|
|
|
if (list.first == 0) list.count = stroka;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
if (anchor) //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
anchor=NULL;
|
2013-12-27 12:15:17 +01:00
|
|
|
|
list.first=anchor_line_num;
|
2014-03-12 23:56:28 +01:00
|
|
|
|
Parse();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
DrawScroller();
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-30 13:57:13 +02:00
|
|
|
|
void TWebBrowser::Perenos()
|
|
|
|
|
{
|
|
|
|
|
int perenos_num;
|
|
|
|
|
char new_line_text[4096];
|
|
|
|
|
perenos_num = strrchr(#line, ' ');
|
|
|
|
|
if (!perenos_num) && (strlen(#line)>list.column_max) perenos_num=list.column_max;
|
|
|
|
|
strcpy(#new_line_text, #line + perenos_num);
|
|
|
|
|
line[perenos_num] = 0x00;
|
|
|
|
|
if (stroka-1 > list.visible) && (list.first <>0) end_parsing=true;
|
|
|
|
|
DrawPage();
|
|
|
|
|
strcpy(#line, #new_line_text);
|
|
|
|
|
NewLine();
|
|
|
|
|
}
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char oldtag[100];
|
2014-03-15 16:16:08 +01:00
|
|
|
|
void TWebBrowser::SetTextStyle(int left1, top1) {
|
2013-12-27 00:36:17 +01:00
|
|
|
|
dword hr_color;
|
2014-01-19 23:46:58 +01:00
|
|
|
|
byte opened;
|
2014-03-12 23:56:28 +01:00
|
|
|
|
byte meta_encoding;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if (tag[0] == '/')
|
|
|
|
|
{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
opened = 0;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
strcpy(#tag, #tag+1);
|
|
|
|
|
}
|
2014-01-19 23:46:58 +01:00
|
|
|
|
else opened = 1;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("html"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-03-13 00:30:28 +01:00
|
|
|
|
t_html = opened;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-23 18:12:21 +01:00
|
|
|
|
if (isTag("script")) || (isTag("style")) || (isTag("binary")) || (isTag("select")) ignor_text = opened;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if(isTag("title"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
if (opened) header=NULL;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
else if (!stroka) DrawTitle(#header); //<2F><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ignor_text) return;
|
|
|
|
|
|
2014-01-19 23:46:58 +01:00
|
|
|
|
IF(isTag("q"))
|
|
|
|
|
{
|
|
|
|
|
if (opened)
|
|
|
|
|
{
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2014-01-19 23:46:58 +01:00
|
|
|
|
strcat(#line, ' \"');
|
|
|
|
|
}
|
|
|
|
|
if (!opened)
|
|
|
|
|
{
|
|
|
|
|
chrcat(#line, '\"');
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2014-01-19 23:46:58 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
|
|
|
|
if (anchor) && (!strcmp(#parametr, "id=")) //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>!!! <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
2013-12-27 12:15:17 +01:00
|
|
|
|
if (!strcmp(#anchor, #options)) anchor_line_num=list.first+stroka;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("body"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-03-13 00:30:28 +01:00
|
|
|
|
t_body = opened;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
do{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
if (!strcmp(#parametr, "condition_max=")) condition_max = atoi(#options);
|
|
|
|
|
if (!strcmp(#parametr, "link=")) link_color_inactive = GetColor(#options);
|
|
|
|
|
if (!strcmp(#parametr, "alink=")) link_color_active = GetColor(#options);
|
2013-12-27 00:36:17 +01:00
|
|
|
|
if (!strcmp(#parametr, "text=")) text_colors[0]=GetColor(#options);
|
|
|
|
|
if (!strcmp(#parametr, "bgcolor="))
|
|
|
|
|
{
|
|
|
|
|
bg_color=GetColor(#options);
|
2014-01-18 12:46:58 +01:00
|
|
|
|
DrawBuf.Fill(bg_color);
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
} while(GetNextParam());
|
2015-08-10 09:09:10 +02:00
|
|
|
|
if (opened) && (cur_encoding==CH_NULL)
|
2014-03-15 11:23:06 +01:00
|
|
|
|
{
|
2014-03-15 12:43:07 +01:00
|
|
|
|
debugln("Document has no information about encoding, UTF will be used");
|
2015-08-10 09:09:10 +02:00
|
|
|
|
//BufEncode(CH_UTF8);
|
2014-03-15 11:23:06 +01:00
|
|
|
|
}
|
2013-12-27 00:36:17 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("a"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
if (opened)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
|
|
|
|
if (link) IF(text_color_index > 0) text_color_index--; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
do{
|
|
|
|
|
if (!strcmp(#parametr, "href="))
|
|
|
|
|
{
|
2013-12-27 12:15:17 +01:00
|
|
|
|
if (stroka - 1 > list.visible) || (stroka < -2) return;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
|
|
|
|
text_color_index++;
|
|
|
|
|
text_colors[text_color_index] = text_colors[text_color_index-1];
|
|
|
|
|
|
|
|
|
|
link = 1;
|
2014-01-19 23:46:58 +01:00
|
|
|
|
text_colors[text_color_index] = link_color_inactive;
|
2015-08-10 17:08:16 +02:00
|
|
|
|
PageLinks.AddLink(#options, DrawBuf.zoom * stolbec * list.font_w + left1, top1-DrawBuf.zoom);
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
if (anchor) && (!strcmp(#parametr, "name="))
|
|
|
|
|
{
|
|
|
|
|
if (!strcmp(#anchor, #options))
|
|
|
|
|
{
|
2013-12-27 12:15:17 +01:00
|
|
|
|
anchor_line_num=list.first+stroka;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} while(GetNextParam());
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
link = 0;
|
|
|
|
|
IF(text_color_index > 0) text_color_index--;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("font"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
if (opened)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
|
|
|
|
text_color_index++;
|
|
|
|
|
text_colors[text_color_index] = text_colors[text_color_index-1];
|
|
|
|
|
|
|
|
|
|
do{
|
|
|
|
|
if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#')
|
|
|
|
|
{
|
|
|
|
|
text_colors[text_color_index] = GetColor(#options);
|
|
|
|
|
}
|
|
|
|
|
} while(GetNextParam());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (text_color_index > 0) text_color_index--;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2014-03-12 23:56:28 +01:00
|
|
|
|
if (isTag("br")) {
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-03-23 18:12:21 +01:00
|
|
|
|
if (isTag("div")) || (isTag("header")) || (isTag("article")) || (isTag("footer")) {
|
2014-03-23 23:49:49 +01:00
|
|
|
|
IF(oldtag[0] <>'h') NewLine();
|
2015-03-01 22:36:17 +01:00
|
|
|
|
if (!strcmp(#parametr, "bgcolor="))
|
|
|
|
|
{
|
|
|
|
|
bg_color=GetColor(#options);
|
|
|
|
|
DrawBuf.Fill(bg_color);
|
|
|
|
|
}
|
2013-12-27 00:36:17 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("p")) {
|
2013-12-27 00:36:17 +01:00
|
|
|
|
IF(oldtag[0] == 'h') return;
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
|
|
|
|
IF(opened) NewLine();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-03-12 23:56:28 +01:00
|
|
|
|
|
|
|
|
|
if(isTag("table")) {
|
2014-03-15 16:16:08 +01:00
|
|
|
|
table.active = opened;
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2014-03-15 16:16:08 +01:00
|
|
|
|
if (opened) table.NewTable();
|
2014-03-12 23:56:28 +01:00
|
|
|
|
}
|
2014-03-15 16:16:08 +01:00
|
|
|
|
|
2014-03-12 23:56:28 +01:00
|
|
|
|
if(isTag("td")) {
|
|
|
|
|
if (opened)
|
|
|
|
|
{
|
2014-03-15 16:16:08 +01:00
|
|
|
|
table.cur_col++;
|
|
|
|
|
table.row_h = 0;
|
|
|
|
|
do {
|
|
|
|
|
if (!strcmp(#parametr, "width="))
|
|
|
|
|
{
|
|
|
|
|
table.col_w[table.cur_col] = atoi(#options);
|
2014-03-23 23:49:49 +01:00
|
|
|
|
// NewLine();
|
2014-03-15 16:16:08 +01:00
|
|
|
|
// strcpy(#line, #options);
|
2014-03-23 23:49:49 +01:00
|
|
|
|
// NewLine();
|
2014-03-15 16:16:08 +01:00
|
|
|
|
}
|
|
|
|
|
} while(GetNextParam());
|
2014-03-12 23:56:28 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-03-15 16:16:08 +01:00
|
|
|
|
if (table.row_h > table.row_max_h) table.row_max_h = table.row_h;
|
2014-03-12 23:56:28 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-03-15 16:16:08 +01:00
|
|
|
|
|
2014-03-12 23:56:28 +01:00
|
|
|
|
if(isTag("tr")) {
|
|
|
|
|
if (opened)
|
|
|
|
|
{
|
2014-03-15 16:16:08 +01:00
|
|
|
|
table.cur_col = 0;
|
|
|
|
|
table.row_max_h = 0;
|
|
|
|
|
table.row_start = stroka;
|
2014-03-12 23:56:28 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2014-03-12 23:56:28 +01:00
|
|
|
|
if (table.cur_row == 0) table.max_cols = table.cur_col;
|
|
|
|
|
table.cur_row++;
|
2014-03-15 16:16:08 +01:00
|
|
|
|
table.max_cols = table.cur_col;
|
2014-03-12 23:56:28 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-03-15 16:16:08 +01:00
|
|
|
|
|
2014-01-18 12:46:58 +01:00
|
|
|
|
/*
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("center"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
if (opened) text_align = ALIGN_CENTER;
|
|
|
|
|
if (!opened)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
text_align = ALIGN_LEFT;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("right"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
if (opened) text_align = ALIGN_RIGHT;
|
|
|
|
|
if (!opened)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
text_align = ALIGN_LEFT;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
2014-01-18 12:46:58 +01:00
|
|
|
|
*/
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("h1")) || (isTag("h2")) || (isTag("h3")) || (isTag("h4")) {
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
|
|
|
|
if (opened) && (stroka>1) NewLine();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
strcpy(#oldtag, #tag);
|
2014-01-19 23:46:58 +01:00
|
|
|
|
if (opened)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
|
|
|
|
if (!strcmp(#parametr, "align=")) && (!strcmp(#options,"center")) text_align = ALIGN_CENTER;
|
|
|
|
|
if (!strcmp(#parametr, "align=")) && (!strcmp(#options,"right")) text_align = ALIGN_RIGHT;
|
|
|
|
|
b_text = 1;
|
|
|
|
|
}
|
2014-01-19 23:46:58 +01:00
|
|
|
|
if (!opened)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
|
|
|
|
text_align = ALIGN_LEFT;
|
|
|
|
|
b_text = 0;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
oldtag=NULL;
|
|
|
|
|
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("b")) || (isTag("strong")) || (isTag("big")) {
|
2014-01-19 23:46:58 +01:00
|
|
|
|
b_text = opened;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if(isTag("i")) || (isTag("em")) || (isTag("subtitle")) {
|
2014-01-19 23:46:58 +01:00
|
|
|
|
i_text = opened;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("dt"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
li_text = opened;
|
|
|
|
|
IF(opened == 0) return;
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("condition"))
|
2013-12-29 13:48:06 +01:00
|
|
|
|
{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
condition_text_active = opened;
|
|
|
|
|
if (opened) && (!strcmp(#parametr, "show_if=")) condition_text_val = atoi(#options);
|
2013-12-29 13:48:06 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("li")) || (isTag("dt")) //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
li_text = opened;
|
|
|
|
|
if (opened)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2015-08-05 00:21:08 +02:00
|
|
|
|
if (stroka > -1) && (stroka - 2 < list.visible)
|
2015-08-10 17:08:16 +02:00
|
|
|
|
DrawBuf.DrawBar(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);
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
2014-01-19 23:46:58 +01:00
|
|
|
|
if (isTag("u")) || (isTag("ins")) u_text = opened;
|
|
|
|
|
if (isTag("s")) || (isTag("strike")) || (isTag("del")) s_text = opened;
|
|
|
|
|
if (isTag("ul")) || (isTag("ol")) IF(!opened)
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-01-19 23:46:58 +01:00
|
|
|
|
li_text = opened;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
li_tab--;
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
} ELSE li_tab++;
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("dd")) stolbec += 5;
|
2014-01-19 23:46:58 +01:00
|
|
|
|
if (isTag("blockquote")) blq_text = opened;
|
2014-01-21 00:42:18 +01:00
|
|
|
|
if (isTag("pre")) || (isTag("code")) pre_text = opened;
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("hr"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
|
|
|
|
if (anchor) || (stroka < -1)
|
|
|
|
|
{
|
|
|
|
|
stroka+=2;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (strcmp(#parametr, "color=") == 0) hr_color = GetColor(#options); else hr_color = 0x999999;
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2014-01-19 18:12:45 +01:00
|
|
|
|
DrawBuf.DrawBar(5, list.line_h/2, list.w-10, 1, hr_color);
|
2014-03-23 23:49:49 +01:00
|
|
|
|
NewLine();
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("img"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2014-03-21 22:21:11 +01:00
|
|
|
|
ImgCache.Images( left1, top1, WB1.list.w);
|
2013-12-27 00:36:17 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-01-19 21:06:42 +01:00
|
|
|
|
if (isTag("meta")) || (isTag("?xml"))
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
|
|
|
|
do{
|
|
|
|
|
if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content=")) || (!strcmp(#parametr, "encoding="))
|
|
|
|
|
{
|
|
|
|
|
strcpy(#options, #options[strrchr(#options, '=')]); //<2F><><EFBFBD><EFBFBD><EFBFBD> <20> content=
|
2014-03-12 23:56:28 +01:00
|
|
|
|
strlwr(#options);
|
2015-08-10 09:09:10 +02:00
|
|
|
|
meta_encoding = CH_NULL;
|
|
|
|
|
if (!strcmp(#options, "utf-8")) || (!strcmp(#options,"utf8")) meta_encoding = CH_UTF8;
|
|
|
|
|
else if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) meta_encoding = CH_KOI8;
|
|
|
|
|
else if (!strcmp(#options, "windows-1251")) || (!strcmp(#options, "windows1251")) meta_encoding = CH_CP1251;
|
|
|
|
|
else if (!strcmp(#options, "windows-1252")) || (!strcmp(#options, "windows1252")) meta_encoding = CH_CP1252;
|
|
|
|
|
else if (!strcmp(#options, "iso-8859-5")) || (!strcmp(#options, "iso8859-5")) meta_encoding = CH_ISO8859_5;
|
|
|
|
|
else if (!strcmp(#options, "dos")) || (!strcmp(#options, "cp-866")) meta_encoding = CH_CP866;
|
|
|
|
|
if (cur_encoding==CH_NULL) BufEncode(meta_encoding);
|
2014-03-12 23:56:28 +01:00
|
|
|
|
return;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
} while(GetNextParam());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-10 09:09:10 +02:00
|
|
|
|
void BufEncode(int set_new_encoding)
|
|
|
|
|
{
|
|
|
|
|
int bufpointer_realsize;
|
|
|
|
|
cur_encoding = set_new_encoding;
|
|
|
|
|
if (o_bufpointer==0)
|
|
|
|
|
{
|
|
|
|
|
o_bufpointer = malloc(bufsize);
|
|
|
|
|
strcpy(o_bufpointer, bufpointer);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strcpy(bufpointer, o_bufpointer);
|
|
|
|
|
}
|
|
|
|
|
bufpointer = ChangeCharset(charsets[set_new_encoding], "CP866", bufpointer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-03-21 22:21:11 +01:00
|
|
|
|
void TWebBrowser::DrawScroller()
|
2013-12-27 00:36:17 +01:00
|
|
|
|
{
|
2013-12-27 13:30:42 +01:00
|
|
|
|
scroll_wv.max_area = list.count;
|
|
|
|
|
scroll_wv.cur_area = list.visible;
|
|
|
|
|
scroll_wv.position = list.first;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2015-03-16 15:20:32 +01:00
|
|
|
|
scroll_wv.all_redraw = 0;
|
2014-01-19 18:12:45 +01:00
|
|
|
|
scroll_wv.start_x = list.x + list.w;
|
2014-01-22 01:08:47 +01:00
|
|
|
|
scroll_wv.start_y = list.y;
|
2015-03-16 15:20:32 +01:00
|
|
|
|
|
2015-08-05 00:21:08 +02:00
|
|
|
|
scroll_wv.size_y = list.h;
|
|
|
|
|
scroll_wv.start_x = list.w * DrawBuf.zoom + list.x;
|
2013-12-27 00:36:17 +01:00
|
|
|
|
|
2013-12-27 13:30:42 +01:00
|
|
|
|
scrollbar_v_draw(#scroll_wv);
|
2013-12-27 00:36:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
2014-01-18 12:46:58 +01:00
|
|
|
|
|
2014-03-23 23:49:49 +01:00
|
|
|
|
void TWebBrowser::NewLine()
|
2014-01-18 12:46:58 +01:00
|
|
|
|
{
|
2015-08-05 00:21:08 +02:00
|
|
|
|
int onleft, ontop;
|
2014-03-23 23:49:49 +01:00
|
|
|
|
|
|
|
|
|
onleft = list.x + 5;
|
|
|
|
|
ontop = stroka * list.line_h + list.y + 5;
|
2015-03-16 15:20:32 +01:00
|
|
|
|
if (!stroka) DrawBar(list.x, list.y, draw_line_width, 5, bg_color);
|
2014-03-13 00:30:28 +01:00
|
|
|
|
if (t_html) && (!t_body) return;
|
2015-08-05 00:21:08 +02:00
|
|
|
|
if (stroka * list.line_h + 5 >= 0) && ( stroka + 1 * list.line_h + 5 < list.h) && (!anchor)
|
2014-01-18 12:46:58 +01:00
|
|
|
|
{
|
2015-08-10 17:08:16 +02:00
|
|
|
|
if (text_align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.line_h,stolbec * list.font_w);
|
|
|
|
|
if (text_align == ALIGN_RIGHT) && (DrawBuf.zoom==1) DrawBuf.AlignRight(onleft,ontop,list.w,list.line_h,stolbec * list.font_w);
|
2014-03-23 23:49:49 +01:00
|
|
|
|
DrawBuf.bufy = ontop;
|
2014-03-21 01:21:09 +01:00
|
|
|
|
DrawBuf.Show();
|
2014-01-18 12:46:58 +01:00
|
|
|
|
DrawBuf.Fill(bg_color);
|
|
|
|
|
}
|
|
|
|
|
stroka++;
|
2014-01-29 01:14:09 +01:00
|
|
|
|
if (blq_text) stolbec = 6; else stolbec = 0;
|
2014-01-18 12:46:58 +01:00
|
|
|
|
if (li_text) stolbec = li_tab * 5;
|
2014-01-19 21:06:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int isTag(dword text)
|
|
|
|
|
{
|
|
|
|
|
if (!strcmp(#tag,text)) return 1; else return 0;
|
|
|
|
|
}
|
2014-03-12 23:56:28 +01:00
|
|
|
|
|