2012-03-07 23:51:05 +01:00
|
|
|
|
|
2011-09-05 11:18:16 +02:00
|
|
|
|
int downloader_id;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
2012-06-20 19:22:56 +02:00
|
|
|
|
dword
|
2011-06-25 03:52:11 +02:00
|
|
|
|
buf,
|
|
|
|
|
filesize,
|
2012-06-20 19:22:56 +02:00
|
|
|
|
blink;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
2012-06-05 10:25:06 +02:00
|
|
|
|
char download_path[]="/rd/1/.download";
|
|
|
|
|
char search_path[]="http://nigma.ru/index.php?s=";
|
2012-11-10 02:49:08 +01:00
|
|
|
|
char version[]=" Text-based Browser 0.97.6";
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct TWebBrowser {
|
2012-06-05 10:25:06 +02:00
|
|
|
|
int left, top, width, height;
|
2012-06-20 21:58:55 +02:00
|
|
|
|
void Scan(int);
|
2012-06-24 00:30:59 +02:00
|
|
|
|
void GetNewUrl();
|
2012-06-20 21:58:55 +02:00
|
|
|
|
void OpenPage();
|
|
|
|
|
void ReadHtml(byte);
|
2012-02-24 22:27:05 +01:00
|
|
|
|
void ShowPage();
|
2012-06-24 00:30:59 +02:00
|
|
|
|
void ParseHTML(dword);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
void WhatTextStyle(int left1, top1, width1);
|
2012-07-03 19:24:00 +02:00
|
|
|
|
void DrawPage();
|
2012-06-20 21:58:55 +02:00
|
|
|
|
void DrawScroller();
|
2011-06-25 03:52:11 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TWebBrowser WB1;
|
|
|
|
|
|
2012-06-22 13:38:38 +02:00
|
|
|
|
byte rez, b_text, i_text, u_text, s_text, pre_text, blq_text, li_text,
|
|
|
|
|
link, ignor_text, li_tab, first_line_drawed;
|
2011-09-26 13:41:07 +02:00
|
|
|
|
|
|
|
|
|
|
2012-07-02 20:24:48 +02:00
|
|
|
|
dword text_colors[300],
|
2012-04-12 23:28:24 +02:00
|
|
|
|
text_color_index,
|
2012-02-29 13:29:47 +01:00
|
|
|
|
link_color,
|
2012-05-13 01:11:58 +02:00
|
|
|
|
bg_color;
|
2011-09-26 13:41:07 +02:00
|
|
|
|
|
|
|
|
|
int stroka,
|
|
|
|
|
stolbec,
|
|
|
|
|
tab_len;
|
2012-07-02 20:24:48 +02:00
|
|
|
|
|
|
|
|
|
char anchor[256];
|
|
|
|
|
int anchor_line_num;
|
2011-09-26 13:41:07 +02:00
|
|
|
|
|
2012-06-25 16:14:43 +02:00
|
|
|
|
char line[500],
|
2011-09-26 13:41:07 +02:00
|
|
|
|
tag[100],
|
|
|
|
|
tagparam[10000],
|
|
|
|
|
parametr[1200],
|
2012-07-16 13:52:03 +02:00
|
|
|
|
options[4096];
|
2011-09-26 13:41:07 +02:00
|
|
|
|
|
2012-02-27 14:48:04 +01:00
|
|
|
|
#include "include\history.h"
|
|
|
|
|
#include "include\colors.h"
|
|
|
|
|
#include "include\unicode_tags.h"
|
|
|
|
|
#include "include\some_code.h"
|
2012-06-24 00:30:59 +02:00
|
|
|
|
#include "include\parce_tag.h"
|
2012-02-27 14:48:04 +01:00
|
|
|
|
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
2012-06-17 14:03:52 +02:00
|
|
|
|
void TWebBrowser::Scan(int id)
|
|
|
|
|
{
|
2012-07-03 19:24:00 +02:00
|
|
|
|
if (id >= 400)
|
2011-09-30 11:19:41 +02:00
|
|
|
|
{
|
2012-03-04 00:29:02 +01:00
|
|
|
|
GetURLfromPageLinks(id);
|
2012-06-16 15:39:38 +02:00
|
|
|
|
|
|
|
|
|
//#1
|
|
|
|
|
if (URL[0] == '#')
|
|
|
|
|
{
|
2012-07-02 20:24:48 +02:00
|
|
|
|
strcpy(#anchor, #URL+strrchr(#URL, '#'));
|
2012-06-16 15:39:38 +02:00
|
|
|
|
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#URL, BrowserHistory.CurrentUrl());
|
2012-06-16 15:39:38 +02:00
|
|
|
|
|
2012-06-20 21:58:55 +02:00
|
|
|
|
lines.first=lines.all-lines.visible;
|
|
|
|
|
ShowPage();
|
2012-02-21 23:22:44 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2012-06-16 15:39:38 +02:00
|
|
|
|
//liner.ru#1
|
2012-07-02 20:24:48 +02:00
|
|
|
|
if (strrchr(#URL, '#')<>-1)
|
2012-06-16 15:39:38 +02:00
|
|
|
|
{
|
2012-07-02 20:24:48 +02:00
|
|
|
|
strcpy(#anchor, #URL+strrchr(#URL, '#'));
|
|
|
|
|
URL[strrchr(#URL, '#')-1] = 0x00; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-06-16 15:39:38 +02:00
|
|
|
|
}
|
2012-07-16 13:52:03 +02:00
|
|
|
|
|
2012-02-21 23:22:44 +01:00
|
|
|
|
GetNewUrl();
|
2012-06-13 16:11:10 +02:00
|
|
|
|
|
2012-03-04 00:29:02 +01:00
|
|
|
|
if (!strcmp(#URL + strlen(#URL) - 4, ".gif")) || (!strcmp(#URL + strlen(#URL) - 4, ".png")) || (!strcmp(#URL + strlen(#URL) - 4, ".jpg"))
|
|
|
|
|
{
|
2012-07-16 13:52:03 +02:00
|
|
|
|
//if (strstr(#URL,"http:"))
|
2012-03-04 00:29:02 +01:00
|
|
|
|
RunProgram("/sys/media/kiv", #URL);
|
2012-07-02 21:02:06 +02:00
|
|
|
|
strcpy(#editURL, BrowserHistory.CurrentUrl());
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#URL, BrowserHistory.CurrentUrl());
|
2012-03-04 00:29:02 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2012-07-16 13:52:03 +02:00
|
|
|
|
if (!strcmpn(#URL,"mailto:", 7))
|
|
|
|
|
{
|
|
|
|
|
RunProgram("@notify", #URL);
|
|
|
|
|
strcpy(#editURL, BrowserHistory.CurrentUrl());
|
|
|
|
|
strcpy(#URL, BrowserHistory.CurrentUrl());
|
|
|
|
|
return;
|
|
|
|
|
}
|
2012-03-04 00:29:02 +01:00
|
|
|
|
|
2012-06-13 00:13:05 +02:00
|
|
|
|
OpenPage();
|
2011-06-25 03:52:11 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
2011-09-30 11:19:41 +02:00
|
|
|
|
|
2012-06-20 21:58:55 +02:00
|
|
|
|
IF(lines.all < lines.visible) SWITCH(id) //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-09-30 11:19:41 +02:00
|
|
|
|
{ CASE 183: CASE 184: CASE 180: CASE 181: return; }
|
|
|
|
|
|
2011-09-26 16:09:58 +02:00
|
|
|
|
switch (id)
|
|
|
|
|
{
|
|
|
|
|
case 011: //Ctrk+K
|
2012-06-20 21:58:55 +02:00
|
|
|
|
ReadHtml(_KOI);
|
2011-09-26 16:09:58 +02:00
|
|
|
|
break;
|
2012-05-13 01:11:58 +02:00
|
|
|
|
case 021: //Ctrl+U
|
2012-06-20 21:58:55 +02:00
|
|
|
|
ReadHtml(_UTF);
|
2012-05-13 01:11:58 +02:00
|
|
|
|
break;
|
2012-07-16 13:52:03 +02:00
|
|
|
|
case 004: //Ctrl+D
|
|
|
|
|
ReadHtml(_DOS);
|
|
|
|
|
break;
|
|
|
|
|
case 001:
|
|
|
|
|
if (!pre_text) pre_text=2;
|
|
|
|
|
else pre_text=0;
|
|
|
|
|
break;
|
2012-11-05 17:10:14 +01:00
|
|
|
|
case 005: //truetype
|
2012-11-05 19:07:09 +01:00
|
|
|
|
if (use_truetype == 2)
|
|
|
|
|
{
|
2012-11-10 02:49:08 +01:00
|
|
|
|
RunProgram("@notify", "Library does not exists /rd/1/lib/truetype.obj"w);
|
2012-11-05 19:07:09 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2012-11-05 17:10:14 +01:00
|
|
|
|
if (use_truetype == 1) use_truetype=0; else use_truetype=1;
|
|
|
|
|
break;
|
2011-09-26 16:09:58 +02:00
|
|
|
|
case BACK:
|
2012-06-05 10:25:06 +02:00
|
|
|
|
if (!BrowserHistory.GoBack()) return;
|
|
|
|
|
OpenPage();
|
2011-09-26 16:09:58 +02:00
|
|
|
|
return;
|
|
|
|
|
case FORWARD:
|
2012-06-05 10:25:06 +02:00
|
|
|
|
if (!BrowserHistory.GoForward()) return;
|
|
|
|
|
OpenPage();
|
2011-09-26 16:09:58 +02:00
|
|
|
|
return;
|
2012-06-17 14:03:52 +02:00
|
|
|
|
case 052: //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> F3
|
|
|
|
|
if (strcmp(get_URL_part(5),"http:")<>0) RunProgram("/rd/1/tinypad", #URL); else RunProgram("/rd/1/tinypad", #download_path);
|
|
|
|
|
return;
|
2011-09-26 16:09:58 +02:00
|
|
|
|
case 054: //F5
|
|
|
|
|
IF(edit1.flags == 66) break;
|
|
|
|
|
case REFRESH:
|
2012-02-27 14:48:04 +01:00
|
|
|
|
if (GetProcessSlot(downloader_id)<>0)
|
|
|
|
|
{
|
|
|
|
|
KillProcess(downloader_id);
|
|
|
|
|
Pause(20);
|
|
|
|
|
Draw_Window();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2012-06-20 21:58:55 +02:00
|
|
|
|
anchor_line_num=lines.first; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :<3A>
|
2012-06-17 14:03:52 +02:00
|
|
|
|
anchor[0]='|';
|
|
|
|
|
OpenPage();
|
2011-09-26 16:09:58 +02:00
|
|
|
|
return;
|
|
|
|
|
case 014: //Ctrl+N <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
case 020: //Ctrl+T <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
case NEWTAB:
|
|
|
|
|
MoveSize(190,80,OLD,OLD);
|
|
|
|
|
RunProgram(#program_path, #URL);
|
|
|
|
|
return;
|
2012-06-16 15:39:38 +02:00
|
|
|
|
|
2012-02-24 22:27:05 +01:00
|
|
|
|
case HOME:
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#editURL, "http://kolibri-os.narod.ru");
|
2011-09-26 16:09:58 +02:00
|
|
|
|
case GOTOURL:
|
|
|
|
|
case 0x0D: //enter
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#URL, #editURL);
|
2012-06-05 10:25:06 +02:00
|
|
|
|
OpenPage();
|
2011-09-26 16:09:58 +02:00
|
|
|
|
return;
|
|
|
|
|
case 173: //ctrl+enter
|
|
|
|
|
case SEARCHWEB:
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#URL, #search_path);
|
|
|
|
|
strcat(#URL, #editURL);
|
2012-06-05 10:25:06 +02:00
|
|
|
|
OpenPage();
|
2011-09-26 16:09:58 +02:00
|
|
|
|
return;
|
2011-09-30 11:19:41 +02:00
|
|
|
|
|
2011-09-26 16:09:58 +02:00
|
|
|
|
case ID1: //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
2012-06-20 21:58:55 +02:00
|
|
|
|
IF(lines.first <= 0) return;
|
|
|
|
|
lines.first--;
|
2011-09-26 16:09:58 +02:00
|
|
|
|
break;
|
|
|
|
|
case ID2: //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
2012-06-20 21:58:55 +02:00
|
|
|
|
IF(lines.visible + lines.first >= lines.all) return;
|
|
|
|
|
lines.first++;
|
2011-09-26 16:09:58 +02:00
|
|
|
|
break;
|
|
|
|
|
case 183: //PgDown
|
2012-06-20 21:58:55 +02:00
|
|
|
|
IF(lines.first == lines.all - lines.visible) return;
|
|
|
|
|
lines.first += lines.visible + 2;
|
|
|
|
|
IF(lines.visible + lines.first > lines.all) lines.first = lines.all - lines.visible;
|
2012-11-05 17:10:14 +01:00
|
|
|
|
break;
|
2011-09-26 16:09:58 +02:00
|
|
|
|
case 184: //PgUp
|
2012-11-05 17:10:14 +01:00
|
|
|
|
IF(lines.first == 0) return;
|
2012-06-20 21:58:55 +02:00
|
|
|
|
lines.first -= lines.visible - 2;
|
|
|
|
|
IF(lines.first < 0) lines.first = 0;
|
2012-11-05 17:10:14 +01:00
|
|
|
|
break;
|
2011-09-26 16:09:58 +02:00
|
|
|
|
case 180: //home
|
2012-11-05 17:10:14 +01:00
|
|
|
|
IF(lines.first == 0) return;
|
2012-06-20 21:58:55 +02:00
|
|
|
|
lines.first = 0;
|
2012-11-05 17:10:14 +01:00
|
|
|
|
break;
|
2011-09-26 16:09:58 +02:00
|
|
|
|
case 181: //end
|
2012-11-05 17:10:14 +01:00
|
|
|
|
IF (lines.first == lines.all - lines.visible) return;
|
2012-06-20 21:58:55 +02:00
|
|
|
|
lines.first = lines.all - lines.visible;
|
2012-11-05 17:10:14 +01:00
|
|
|
|
break;
|
2011-09-26 16:09:58 +02:00
|
|
|
|
default:
|
2012-11-05 17:10:14 +01:00
|
|
|
|
return;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2012-06-24 00:30:59 +02:00
|
|
|
|
ParseHTML(buf);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-13 16:11:10 +02:00
|
|
|
|
|
2012-07-16 13:52:03 +02:00
|
|
|
|
char *ABSOLUTE_LINKS[]={ "http:", "mailto:", "ftp:", "/sys/", "/rd/", "/fd/", "/bd/", "/hd/", "/cd/", "/tmp/", 0};
|
2012-06-05 10:25:06 +02:00
|
|
|
|
|
2012-07-16 13:52:03 +02:00
|
|
|
|
//dword TWebBrowser::GetNewUrl(dword CUR_URL, NEW_URL){
|
2012-06-24 00:30:59 +02:00
|
|
|
|
void TWebBrowser::GetNewUrl(){
|
2012-07-31 16:44:11 +02:00
|
|
|
|
int i, len;
|
2012-03-04 00:29:02 +01:00
|
|
|
|
|
2012-07-16 13:52:03 +02:00
|
|
|
|
for (i=0; ABSOLUTE_LINKS[i]; i++)
|
2012-07-31 16:44:11 +02:00
|
|
|
|
{
|
|
|
|
|
len=strlen(ABSOLUTE_LINKS[i]);
|
|
|
|
|
if (!strcmpn(#URL, ABSOLUTE_LINKS[i], len)) return;
|
|
|
|
|
}
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
2012-07-16 13:52:03 +02:00
|
|
|
|
IF (!strcmpn(#URL,"./", 2)) strcpy(#URL, #URL+2); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :)
|
|
|
|
|
if (URL[0] == '/') strcpy(#URL, #URL+1);
|
|
|
|
|
|
|
|
|
|
strcpy(#editURL, BrowserHistory.CurrentUrl()); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
_CUT_ST_LEVEL_MARK:
|
2012-03-04 00:29:02 +01:00
|
|
|
|
|
2012-07-16 13:52:03 +02:00
|
|
|
|
if (editURL[strrchr(#editURL, '/')-2]<>'/') // <20><><EFBFBD><EFBFBD> <20><> http://
|
2011-06-25 03:52:11 +02:00
|
|
|
|
{
|
2012-07-02 20:24:48 +02:00
|
|
|
|
editURL[strrchr(#editURL, '/')] = 0x00; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> /
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2012-03-04 00:29:02 +01:00
|
|
|
|
|
|
|
|
|
IF (!strcmp(get_URL_part(3),"../")) //<2F><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#URL,#URL+3);
|
2012-07-02 20:24:48 +02:00
|
|
|
|
editURL[strrchr(#editURL, '/')-1] = 0x00; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> /
|
2012-03-04 00:29:02 +01:00
|
|
|
|
goto _CUT_ST_LEVEL_MARK;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (editURL[strlen(#editURL)-1]<>'/') strcat(#editURL, "/");
|
2012-07-16 13:52:03 +02:00
|
|
|
|
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcat(#editURL, #URL); //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
strcpy(#URL, #editURL);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
2012-02-27 14:48:04 +01:00
|
|
|
|
|
2011-09-26 16:09:58 +02:00
|
|
|
|
|
2012-06-24 00:30:59 +02:00
|
|
|
|
void TWebBrowser::ReadHtml(byte encoding)
|
2011-09-26 16:09:58 +02:00
|
|
|
|
{
|
|
|
|
|
if (!strcmp(get_URL_part(5),"http:")))
|
|
|
|
|
file_size stdcall (#download_path);
|
|
|
|
|
else
|
|
|
|
|
file_size stdcall (#URL);
|
2011-09-04 18:37:00 +02:00
|
|
|
|
|
2011-09-13 21:40:37 +02:00
|
|
|
|
filesize = EBX;
|
2012-06-13 16:11:10 +02:00
|
|
|
|
if (!filesize) return;
|
|
|
|
|
|
2011-09-04 18:37:00 +02:00
|
|
|
|
mem_Free(buf);
|
2011-09-13 21:40:37 +02:00
|
|
|
|
buf = mem_Alloc(filesize);
|
2012-02-21 23:22:44 +01:00
|
|
|
|
if (!strcmp(get_URL_part(5),"http:")))
|
|
|
|
|
ReadFile(0, filesize, buf, #download_path);
|
|
|
|
|
else
|
|
|
|
|
ReadFile(0, filesize, buf, #URL);
|
2012-06-20 21:58:55 +02:00
|
|
|
|
|
2012-06-24 00:30:59 +02:00
|
|
|
|
if (encoding==_WIN) wintodos(buf);
|
|
|
|
|
if (encoding==_UTF) utf8rutodos(buf);
|
|
|
|
|
if (encoding==_KOI) koitodos(buf);
|
2011-09-13 21:40:37 +02:00
|
|
|
|
}
|
2011-09-04 18:37:00 +02:00
|
|
|
|
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
2012-06-20 21:58:55 +02:00
|
|
|
|
void TWebBrowser::OpenPage()
|
2012-06-13 16:11:10 +02:00
|
|
|
|
{
|
|
|
|
|
if (GetProcessSlot(downloader_id)<>0) PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
|
|
|
|
|
KillProcess(downloader_id);
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#editURL, #URL);
|
2012-06-13 16:11:10 +02:00
|
|
|
|
BrowserHistory.AddUrl();
|
2012-07-03 19:24:00 +02:00
|
|
|
|
strcpy(#header, #version);
|
2012-07-16 13:52:03 +02:00
|
|
|
|
pre_text =0;
|
2012-06-13 16:11:10 +02:00
|
|
|
|
if (!strcmp(get_URL_part(5),"http:")))
|
|
|
|
|
{
|
|
|
|
|
KillProcess(downloader_id); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
DeleteFile(#download_path);
|
|
|
|
|
IF (URL[strlen(#URL)-1]=='/') URL[strlen(#URL)-1]='';
|
|
|
|
|
downloader_id = RunProgram("/sys/network/downloader", #URL);
|
|
|
|
|
//<2F><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!!
|
|
|
|
|
Pause(60);
|
|
|
|
|
if (GetProcessSlot(downloader_id)<>0)
|
|
|
|
|
{
|
2012-06-17 14:03:52 +02:00
|
|
|
|
debug("Browser Hack v2.0: Killing downloader and trying to run it one more!");
|
2012-06-13 16:11:10 +02:00
|
|
|
|
KillProcess(downloader_id); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
downloader_id = RunProgram("/sys/network/downloader", #URL);
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
IF (downloader_id<0) RunProgram("@notify", "Error running Downloader. Internet unavilable.");
|
|
|
|
|
Draw_Window();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2012-07-16 13:52:03 +02:00
|
|
|
|
lines.first = lines.all =0;
|
2012-06-20 21:58:55 +02:00
|
|
|
|
ReadHtml(_WIN);
|
|
|
|
|
WB1.ShowPage();
|
2012-06-13 16:11:10 +02:00
|
|
|
|
}
|
|
|
|
|
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
2012-06-20 21:58:55 +02:00
|
|
|
|
void TWebBrowser::ShowPage()
|
2012-06-13 16:11:10 +02:00
|
|
|
|
{
|
2011-06-25 03:52:11 +02:00
|
|
|
|
edit1.size = edit1.pos = strlen(#editURL);
|
2012-07-16 13:52:03 +02:00
|
|
|
|
edit1.offset=0;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
edit_box_draw stdcall(#edit1); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-02-27 14:48:04 +01:00
|
|
|
|
|
|
|
|
|
if (!filesize)
|
|
|
|
|
{
|
2012-06-05 10:25:06 +02:00
|
|
|
|
DrawBar(left, top, width+4, height, 0xFFFFFF); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-02-27 14:48:04 +01:00
|
|
|
|
if (GetProcessSlot(downloader_id)<>0) WriteText(left + 10, top + 18, 0x80, 0, "Loading...", 0);
|
|
|
|
|
else
|
2011-06-25 03:52:11 +02:00
|
|
|
|
{
|
|
|
|
|
WriteText(left + 10, top + 18, 0x80, 0, "Page not found. May be, URL contains some errors.", 0);
|
2012-02-27 14:48:04 +01:00
|
|
|
|
if (!strcmp(get_URL_part(5),"http:"))) WriteText(left + 10, top + 32, 0x80, 0, "Or Internet unavilable for your configuration.", 0);
|
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
//return;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
else
|
|
|
|
|
ParseHTML(buf);
|
|
|
|
|
|
|
|
|
|
if (!header) strcpy(#header, #version);
|
|
|
|
|
if (!strcmp(#version, #header)) DrawTitle(#header);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-24 00:30:59 +02:00
|
|
|
|
void TWebBrowser::ParseHTML(dword bword){
|
2012-07-03 19:24:00 +02:00
|
|
|
|
word bukva[2];
|
2012-06-22 13:38:38 +02:00
|
|
|
|
int j, perenos_num;
|
2012-07-03 19:24:00 +02:00
|
|
|
|
byte ignor_param;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
char temp[768];
|
2012-06-20 19:22:56 +02:00
|
|
|
|
|
2012-06-20 21:58:55 +02:00
|
|
|
|
stroka = -lines.first;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
stolbec = 0;
|
2012-06-20 19:22:56 +02:00
|
|
|
|
|
|
|
|
|
for (j = 400; j < blink + 1; j++;) DeleteButton(j);
|
|
|
|
|
blink = 400;
|
|
|
|
|
|
2012-07-16 13:52:03 +02:00
|
|
|
|
b_text = i_text = u_text = s_text = blq_text = first_line_drawed =
|
2011-06-25 03:52:11 +02:00
|
|
|
|
li_text = link = ignor_text = text_color_index = text_colors[0] = li_tab = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
link_color = 0x0000FF;
|
2012-02-29 13:29:47 +01:00
|
|
|
|
bg_color = 0xFFFFFF;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
line = '';
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#page_links,"|");
|
2012-07-03 19:24:00 +02:00
|
|
|
|
strcpy(#header, #version);
|
2012-06-22 13:38:38 +02:00
|
|
|
|
|
2012-07-16 13:52:03 +02:00
|
|
|
|
if (pre_text<>2)
|
|
|
|
|
{
|
|
|
|
|
pre_text=0;
|
|
|
|
|
if (!strcmp(#URL + strlen(#URL) - 4, ".txt")) pre_text = 1;
|
|
|
|
|
if (!strcmp(#URL + strlen(#URL) - 4, ".mht")) ignor_text = 1;
|
|
|
|
|
}
|
2012-06-22 13:38:38 +02:00
|
|
|
|
|
2012-07-02 21:02:06 +02:00
|
|
|
|
for ( ; buf+filesize > bword; bword++;)
|
|
|
|
|
{
|
|
|
|
|
bukva = ESBYTE[bword];
|
|
|
|
|
if (ignor_text) && (bukva<>'<') continue;
|
|
|
|
|
switch (bukva)
|
|
|
|
|
{
|
2011-06-25 03:52:11 +02:00
|
|
|
|
case 0x0a:
|
2012-06-22 13:38:38 +02:00
|
|
|
|
if (pre_text)
|
|
|
|
|
{
|
2012-07-02 21:02:06 +02:00
|
|
|
|
bukva = temp = '';
|
2011-06-25 03:52:11 +02:00
|
|
|
|
goto NEXT_MARK;
|
|
|
|
|
}
|
2012-04-12 23:28:24 +02:00
|
|
|
|
case '\9':
|
2012-06-22 13:38:38 +02:00
|
|
|
|
if (pre_text) //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> 0x0d
|
2011-08-20 17:36:15 +02:00
|
|
|
|
{
|
|
|
|
|
tab_len=strlen(#line)/8;
|
|
|
|
|
tab_len=tab_len*8;
|
|
|
|
|
tab_len=8+tab_len-strlen(#line);
|
2012-07-03 19:24:00 +02:00
|
|
|
|
for (j=0; j<tab_len; j++;) strcat(#line," ");
|
2011-08-20 17:36:15 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 0x0d:
|
2011-06-25 03:52:11 +02:00
|
|
|
|
bukva = ' ';
|
|
|
|
|
goto DEFAULT_MARK;
|
2011-08-20 17:36:15 +02:00
|
|
|
|
case '<':
|
2011-06-25 03:52:11 +02:00
|
|
|
|
bword++; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <
|
2012-07-03 19:24:00 +02:00
|
|
|
|
tag = parametr = tagparam = ignor_param = 0;
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (ESBYTE[bword] == '!') //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <!-- -->, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-06-25 03:52:11 +02:00
|
|
|
|
{
|
|
|
|
|
bword++;
|
2012-07-03 19:24:00 +02:00
|
|
|
|
if (ESBYTE[bword] == '-')
|
|
|
|
|
{
|
|
|
|
|
HH_:
|
2012-06-22 13:38:38 +02:00
|
|
|
|
do
|
|
|
|
|
{
|
2011-06-25 03:52:11 +02:00
|
|
|
|
bword++;
|
2012-07-03 19:24:00 +02:00
|
|
|
|
if (buf + filesize <= bword) break 2;
|
2012-06-22 13:38:38 +02:00
|
|
|
|
}
|
|
|
|
|
while (ESBYTE[bword] <>'-');
|
|
|
|
|
|
2011-06-25 03:52:11 +02:00
|
|
|
|
bword++;
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (ESBYTE[bword] <>'-') goto HH_;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-24 00:30:59 +02:00
|
|
|
|
while (ESBYTE[bword] <>'>') && (bword < buf + filesize) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-06-25 03:52:11 +02:00
|
|
|
|
{
|
|
|
|
|
bukva = ESBYTE[bword];
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (bukva == '\9') || (bukva == '\x0a') || (bukva == '\x0d') bukva = ' ';
|
2012-07-02 21:02:06 +02:00
|
|
|
|
if (!ignor_param) && (bukva <>' ')
|
|
|
|
|
{
|
|
|
|
|
if (strlen(#tag)<sizeof(tag)) strcat(#tag, #bukva);
|
|
|
|
|
}
|
2012-06-20 19:22:56 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
2011-06-25 03:52:11 +02:00
|
|
|
|
ignor_param = true;
|
2012-07-02 21:02:06 +02:00
|
|
|
|
if (!ignor_text) && (strlen(#tagparam)+1<sizeof(tagparam)) strcat(#tagparam, #bukva);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
|
|
|
|
bword++;
|
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
strlwr(#tag);
|
|
|
|
|
strlwr(#tagparam);
|
|
|
|
|
|
|
|
|
|
if (tag[strlen(#tag)-1]=='/') tag[strlen(#tag)-1]=''; //for br/
|
|
|
|
|
if (tagparam) && (strlen(#tagparam) < 4000) GetNextParam();
|
|
|
|
|
|
|
|
|
|
DrawPage();
|
|
|
|
|
line=0;
|
|
|
|
|
|
|
|
|
|
if (tag) WhatTextStyle(left + 5, stroka * 10 + top + 5, width - 20); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
tag = parametr = tagparam = ignor_param = '\0';
|
2011-06-25 03:52:11 +02:00
|
|
|
|
break;
|
|
|
|
|
case '=': //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>7
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (strcmp(#URL + strlen(#URL) - 4, ".mht")<>0) goto DEFAULT_MARK;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
|
|
|
|
bword++;
|
|
|
|
|
bukva=ESBYTE[bword];
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#temp,#bukva);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
bword++;
|
|
|
|
|
bukva=ESBYTE[bword];
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcat(#temp,#bukva);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
|
|
|
|
bukva=Hex2Symb(#temp);
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (bukva) goto DEFAULT_MARK;
|
2011-09-22 13:18:01 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2012-07-03 19:24:00 +02:00
|
|
|
|
case '&': // and so on
|
2011-06-25 03:52:11 +02:00
|
|
|
|
bword++;
|
2012-07-03 19:24:00 +02:00
|
|
|
|
tag=0;
|
|
|
|
|
for (j=0; (ESBYTE[bword]<>';') && (j<7); j++, bword++;)
|
2011-09-22 13:18:01 +02:00
|
|
|
|
{
|
2011-06-25 03:52:11 +02:00
|
|
|
|
bukva = ESBYTE[bword];
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcat(#tag, #bukva);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2011-09-22 13:18:01 +02:00
|
|
|
|
|
2012-06-20 19:22:56 +02:00
|
|
|
|
for (j=0; unicode_tags[j]!=0; j+=2;)
|
2011-09-22 13:18:01 +02:00
|
|
|
|
{
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (!strcmp(#tag, unicode_tags[j]))
|
2011-09-22 13:18:01 +02:00
|
|
|
|
{
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcat(#line, unicode_tags[j+1]);
|
2011-09-22 13:18:01 +02:00
|
|
|
|
break 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-03 19:24:00 +02:00
|
|
|
|
rez = atoi(#tag + 1) - 1040;
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (tag[1] == '1') && (rez>=0) && (rez<=72) && (strlen(#tag) == 5)
|
2012-07-03 19:24:00 +02:00
|
|
|
|
{
|
|
|
|
|
bukva = unicode_chars[rez];
|
|
|
|
|
//GOTO DEFAULT_MARK; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> strcat(#line, unicode_tags[j+1]); <20> break 1;
|
|
|
|
|
strcat(#line, #bukva);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2011-09-22 13:18:01 +02:00
|
|
|
|
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcat(#line,#tag); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-09-22 13:18:01 +02:00
|
|
|
|
break;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
default:
|
|
|
|
|
DEFAULT_MARK:
|
2012-06-22 13:38:38 +02:00
|
|
|
|
if (!pre_text) && (bukva == ' ') && (line[strlen(#line)-1]==' ') break;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
//
|
2012-06-22 13:38:38 +02:00
|
|
|
|
if (stolbec + strlen(#line) > lines.column_max)
|
2011-09-22 13:18:01 +02:00
|
|
|
|
{
|
2012-07-02 20:24:48 +02:00
|
|
|
|
perenos_num = strrchr(#line, ' ');
|
2012-06-22 13:38:38 +02:00
|
|
|
|
strcpy(#temp, #line + perenos_num); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
line[perenos_num] = 0x00;
|
2012-06-20 19:22:56 +02:00
|
|
|
|
NEXT_MARK:
|
2012-06-22 13:38:38 +02:00
|
|
|
|
if (stroka >= lines.visible) && (lines.first <>0) break 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...
|
2012-07-03 19:24:00 +02:00
|
|
|
|
DrawPage();
|
2011-09-22 13:18:01 +02:00
|
|
|
|
TextGoDown(left + 5, stroka * 10 + top + 5, width - 20); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#line, #temp);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2012-06-22 13:38:38 +02:00
|
|
|
|
if (!pre_text) && (bukva == ' ') && (!stolbec) && (!line) break;
|
2012-07-03 19:24:00 +02:00
|
|
|
|
if (strlen(#line)<sizeof(line)) strcat(#line, #bukva);
|
|
|
|
|
}
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2012-02-29 13:29:47 +01:00
|
|
|
|
|
2012-06-20 21:58:55 +02:00
|
|
|
|
if (lines.visible * 10 + 25 <= height)
|
|
|
|
|
DrawBar(left, lines.visible * 10 + top + 25, width - 15, -lines.visible * 10 + height - 25, bg_color);
|
2012-02-29 13:29:47 +01:00
|
|
|
|
if (stroka * 10 + 15 <= height)
|
|
|
|
|
DrawBar(left, stroka * 10 + top + 15, width - 15, -stroka * 10 + height - 15, bg_color); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
2012-06-20 21:58:55 +02:00
|
|
|
|
if (lines.first == 0) lines.all = stroka;
|
2012-06-16 15:39:38 +02:00
|
|
|
|
if (anchor)
|
|
|
|
|
{
|
2012-07-03 19:24:00 +02:00
|
|
|
|
//<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>
|
2012-06-20 19:22:56 +02:00
|
|
|
|
anchor='';
|
2012-06-20 21:58:55 +02:00
|
|
|
|
lines.first=anchor_line_num;
|
2012-06-24 00:30:59 +02:00
|
|
|
|
ParseHTML(buf);
|
2012-06-16 15:39:38 +02:00
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
|
|
|
|
|
DrawScroller();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TWebBrowser::DrawPage() //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>!!1!
|
|
|
|
|
{
|
|
|
|
|
int start_x, start_y, line_length;
|
|
|
|
|
char temp[sizeof(line)];
|
|
|
|
|
|
|
|
|
|
if (!header) //&& (tag)
|
|
|
|
|
{
|
|
|
|
|
if (strlen(#version)+strlen(#line)+2>sizeof(header))
|
|
|
|
|
{
|
|
|
|
|
//line = 123456789
|
|
|
|
|
//header = 1234
|
|
|
|
|
//line = 56789
|
|
|
|
|
strcpy(#temp, #line);
|
|
|
|
|
temp[sizeof(header)-strlen(#version)-2]=0;
|
|
|
|
|
strcpy(#header, #temp);
|
|
|
|
|
strcpy(#line, #line+strlen(#temp));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strcpy(#header, #line);
|
|
|
|
|
line=0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strcat(#header, " -");
|
|
|
|
|
strcat(#header, #version);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stroka >= 0) && (stroka - 2 < lines.visible) && (line) && (!anchor)
|
|
|
|
|
{
|
|
|
|
|
if (!stroka) && (!stolbec)
|
|
|
|
|
{
|
|
|
|
|
DrawBar(left, top, width-15, 15, bg_color); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
first_line_drawed=1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
start_x=stolbec * 6 + left+5;
|
|
|
|
|
start_y=stroka * 10 + top + 5;
|
|
|
|
|
line_length=strlen(#line)*6;
|
2012-11-05 17:10:14 +01:00
|
|
|
|
|
|
|
|
|
if (use_truetype == 1)
|
|
|
|
|
{
|
|
|
|
|
//line_length = get_length stdcall (#line,-1,16,line_length);
|
2012-11-11 12:53:38 +01:00
|
|
|
|
text_out stdcall (#line, #fontlol, 17, text_colors[text_color_index], start_x, start_y-3);
|
2012-11-05 17:10:14 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
WriteText(start_x, start_y, 0x80, text_colors[text_color_index], #line, 0);
|
|
|
|
|
IF (b_text) { $add ebx, 1<<16 $int 0x40 }
|
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
IF (i_text) Skew(start_x, start_y, line_length+6, 10);
|
|
|
|
|
IF (s_text) DrawBar(start_x, start_y + 4, line_length, 1, text_colors[text_color_index]);
|
|
|
|
|
IF (u_text) DrawBar(start_x, start_y + 8, line_length, 1, text_colors[text_color_index]);
|
|
|
|
|
IF (link) {
|
|
|
|
|
DefineButton(start_x-2, start_y, line_length + 3, 9, blink + BT_HIDE, 0xB5BFC9);
|
|
|
|
|
DrawBar(start_x, start_y + 8, line_length, 1, text_colors[text_color_index]);
|
|
|
|
|
}
|
|
|
|
|
stolbec += strlen(#line);
|
|
|
|
|
}
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char oldtag[100];
|
2011-08-20 17:36:15 +02:00
|
|
|
|
void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
|
2011-06-25 03:52:11 +02:00
|
|
|
|
dword hr_color;
|
|
|
|
|
|
2012-06-25 16:14:43 +02:00
|
|
|
|
dword image;
|
2011-09-13 20:45:17 +02:00
|
|
|
|
char temp[4096];
|
2012-07-03 19:24:00 +02:00
|
|
|
|
int w=0, h=0, img_lines_first=0;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
2011-09-26 13:41:07 +02: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>
|
2012-07-03 19:24:00 +02:00
|
|
|
|
if (tag[0] == '/')
|
2011-09-26 13:41:07 +02:00
|
|
|
|
{
|
2011-06-25 03:52:11 +02:00
|
|
|
|
rez = 0;
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#tag, #tag+1);
|
2011-09-26 13:41:07 +02:00
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
else
|
2011-09-26 13:41:07 +02:00
|
|
|
|
rez = 1;
|
2012-07-03 19:24:00 +02:00
|
|
|
|
|
|
|
|
|
if (!chTag("html")) {
|
2011-06-25 03:52:11 +02:00
|
|
|
|
IF(!strcmp(#URL + strlen(#URL) - 4, ".mht")) IF (rez==0) ignor_text = 1; ELSE ignor_text = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-03 19:24:00 +02:00
|
|
|
|
if (!chTag("script")) || (!chTag("style")) || (!chTag("binary")) ignor_text = rez;
|
2012-06-16 15:39:38 +02:00
|
|
|
|
|
2012-07-03 19:24:00 +02:00
|
|
|
|
if(!chTag("title"))
|
2011-09-26 13:41:07 +02:00
|
|
|
|
{
|
2012-07-03 19:24:00 +02:00
|
|
|
|
if (rez)
|
2012-06-22 13:38:38 +02:00
|
|
|
|
{
|
2012-07-03 19:24:00 +02:00
|
|
|
|
header=0;
|
2012-06-22 13:38:38 +02:00
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
else //<2F><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if (stroka==0) DrawTitle(#header);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
return;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2012-06-24 00:30:59 +02:00
|
|
|
|
|
2012-07-03 19:24:00 +02:00
|
|
|
|
if (ignor_text) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF(!chTag("q")) strcat(#line, "\"");
|
|
|
|
|
|
2012-02-29 13:29:47 +01:00
|
|
|
|
|
2012-06-16 15:39:38 +02: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>
|
|
|
|
|
{
|
|
|
|
|
if (!strcmp(#anchor, #options))
|
|
|
|
|
{
|
2012-06-20 21:58:55 +02:00
|
|
|
|
anchor_line_num=lines.first+stroka;
|
2012-06-16 15:39:38 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
|
2011-09-26 13:41:07 +02:00
|
|
|
|
if (!chTag("body"))
|
|
|
|
|
{
|
|
|
|
|
BODY_MARK:
|
|
|
|
|
|
2012-06-24 00:30:59 +02:00
|
|
|
|
if (!strcmp(#parametr, "link="))
|
2011-09-26 13:41:07 +02:00
|
|
|
|
link_color = GetColor(#options);
|
|
|
|
|
|
2012-06-24 00:30:59 +02:00
|
|
|
|
if (!strcmp(#parametr, "text="))
|
2011-09-26 13:41:07 +02:00
|
|
|
|
text_colors[0]=GetColor(#options);
|
|
|
|
|
|
2012-06-24 00:30:59 +02:00
|
|
|
|
if (!strcmp(#parametr, "bgcolor="))
|
2012-02-29 13:29:47 +01:00
|
|
|
|
bg_color=GetColor(#options);
|
2011-09-26 13:41:07 +02:00
|
|
|
|
|
2012-06-24 00:30:59 +02:00
|
|
|
|
IF(tagparam)
|
|
|
|
|
{
|
2011-09-26 13:41:07 +02:00
|
|
|
|
GetNextParam();
|
|
|
|
|
GOTO BODY_MARK;
|
2012-02-29 13:29:47 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
2011-09-26 13:41:07 +02:00
|
|
|
|
}
|
2012-07-02 21:02:06 +02:00
|
|
|
|
|
2012-06-16 15:39:38 +02:00
|
|
|
|
if (!chTag("a"))
|
|
|
|
|
{
|
|
|
|
|
if (rez)
|
|
|
|
|
{
|
2012-07-16 13:52:03 +02: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>
|
2012-07-02 20:24:48 +02:00
|
|
|
|
|
2012-06-16 15:39:38 +02:00
|
|
|
|
_A_MARK:
|
|
|
|
|
if (!strcmp(#parametr, "href="))
|
|
|
|
|
{
|
2012-06-20 21:58:55 +02:00
|
|
|
|
if (stroka - 1 > lines.visible) || (stroka < -2) return;
|
2012-07-16 13:52:03 +02:00
|
|
|
|
|
|
|
|
|
text_color_index++;
|
|
|
|
|
text_colors[text_color_index] = text_colors[text_color_index-1];
|
|
|
|
|
|
2011-06-25 03:52:11 +02:00
|
|
|
|
link = 1;
|
|
|
|
|
blink++;
|
|
|
|
|
text_colors[text_color_index] = link_color;
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcat(#page_links, #options);
|
|
|
|
|
strcat(#page_links, "|");
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2012-06-16 15:39:38 +02:00
|
|
|
|
if (anchor) && (!strcmp(#parametr, "name="))
|
|
|
|
|
{
|
|
|
|
|
if (!strcmp(#anchor, #options))
|
|
|
|
|
{
|
2012-06-20 21:58:55 +02:00
|
|
|
|
anchor_line_num=lines.first+stroka;
|
2012-06-16 15:39:38 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (tagparam)
|
|
|
|
|
{
|
2011-06-25 03:52:11 +02:00
|
|
|
|
GetNextParam();
|
2012-06-16 15:39:38 +02:00
|
|
|
|
GOTO _A_MARK;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
else {
|
2011-06-25 03:52:11 +02:00
|
|
|
|
link = 0;
|
|
|
|
|
IF(text_color_index > 0) text_color_index--;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
2012-07-02 21:02:06 +02:00
|
|
|
|
|
2012-07-03 19:24:00 +02:00
|
|
|
|
|
2011-09-04 18:13:26 +02:00
|
|
|
|
if (!chTag("font"))
|
|
|
|
|
{
|
2012-07-02 20:24:48 +02:00
|
|
|
|
if (rez)
|
2011-06-25 03:52:11 +02:00
|
|
|
|
{
|
2011-09-04 18:13:26 +02:00
|
|
|
|
text_color_index++;
|
2012-07-02 20:24:48 +02:00
|
|
|
|
text_colors[text_color_index] = text_colors[text_color_index-1];
|
|
|
|
|
|
|
|
|
|
COL_MARK:
|
|
|
|
|
if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#')
|
|
|
|
|
{
|
|
|
|
|
text_colors[text_color_index] = GetColor(#options);
|
|
|
|
|
}
|
|
|
|
|
IF(tagparam) {
|
|
|
|
|
GetNextParam();
|
|
|
|
|
GOTO COL_MARK;
|
|
|
|
|
}
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2012-07-02 20:24:48 +02:00
|
|
|
|
else
|
|
|
|
|
if (text_color_index > 0) text_color_index--;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
2012-07-02 21:02:06 +02:00
|
|
|
|
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if(!chTag("tr")) || (!chTag("br")) {
|
2011-06-25 03:52:11 +02:00
|
|
|
|
TextGoDown(left1, top1, width1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (!chTag("div")) {
|
2011-06-25 03:52:11 +02:00
|
|
|
|
IF(oldtag[0] <>'h') TextGoDown(left1, top1, width1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (!chTag("p")) {
|
2011-06-25 03:52:11 +02:00
|
|
|
|
IF(oldtag[0] == 'h') return;
|
|
|
|
|
TextGoDown(left1, top1, width1);
|
|
|
|
|
IF(rez) TextGoDown(left1, top1 + 10, width1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2012-07-02 21:02:06 +02:00
|
|
|
|
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (!chTag("h1")) || (!chTag("h2")) || (!chTag("h3")) || (!chTag("h4")) {
|
2011-06-25 03:52:11 +02:00
|
|
|
|
TextGoDown(left1, top1, width1);
|
|
|
|
|
IF(rez) TextGoDown(left1, top1 + 10, width1);
|
|
|
|
|
b_text = rez;
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcpy(#oldtag, #tag);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
return;
|
2012-06-20 19:22:56 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
oldtag='';
|
|
|
|
|
|
|
|
|
|
if (!chTag("b")) || (!chTag("strong")) || (!chTag("big")) {
|
2011-06-25 03:52:11 +02:00
|
|
|
|
b_text = rez;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
////////////////////////////
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if(!chTag("i")) || (!chTag("em")) || (!chTag("subtitle")) {
|
2011-06-25 03:52:11 +02:00
|
|
|
|
i_text = rez;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
////////////////////////////
|
2012-05-27 21:17:33 +02:00
|
|
|
|
if (!chTag("dt"))
|
2011-06-25 03:52:11 +02:00
|
|
|
|
{
|
|
|
|
|
li_text = rez;
|
|
|
|
|
IF(rez == 0) return;
|
|
|
|
|
TextGoDown(left1, top1, width1);
|
2012-05-27 21:17:33 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
/////////////////////////////
|
2012-06-24 00:30:59 +02:00
|
|
|
|
if(!chTag("li")) || (!chTag("dt")) //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-05-27 21:17:33 +02:00
|
|
|
|
{
|
|
|
|
|
li_text = rez;
|
|
|
|
|
IF(rez == 0) return;
|
|
|
|
|
TextGoDown(left1, top1, width1);
|
2012-06-20 21:58:55 +02:00
|
|
|
|
IF(stroka > -1) && (stroka - 2 < lines.visible) DrawBar(li_tab * 5 * 6 + left1 - 5, top1 + 12, 2, 2, 0);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
////////////////////////////
|
|
|
|
|
IF(!chTag("u")) || (!chTag("ins")) u_text = rez;
|
|
|
|
|
IF(!chTag("s")) || (!chTag("strike")) || (!chTag("del")) s_text = rez;
|
|
|
|
|
IF(!chTag("ul")) || (!chTag("ol")) IF(!rez) {
|
|
|
|
|
li_text = rez;
|
|
|
|
|
li_tab--;
|
|
|
|
|
TextGoDown(left1, top1, width1);
|
|
|
|
|
} ELSE li_tab++;
|
|
|
|
|
IF(!chTag("dd")) stolbec += 5;
|
|
|
|
|
IF(!chTag("blockquote")) blq_text = rez;
|
|
|
|
|
IF(!chTag("pre")) pre_text = rez;
|
|
|
|
|
IF(!chTag("hr")) {
|
|
|
|
|
TextGoDown(left1, top1, width1);
|
|
|
|
|
TextGoDown(left1, top1 + 10, width1);
|
2011-09-26 13:41:07 +02:00
|
|
|
|
IF(strcmp(#parametr, "color=") == 0) hr_color = GetColor(#options);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
ELSE hr_color = 0x999999;
|
|
|
|
|
IF(stroka > 0) DrawBar(left1, top1 + 14, width1 - 8, 1, hr_color);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!chTag("img"))
|
|
|
|
|
{
|
2012-11-10 02:49:08 +01:00
|
|
|
|
if (GetFileInfo(libimg)<>0) return; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
2011-06-25 03:52:11 +02:00
|
|
|
|
IMG_TAG:
|
2012-06-24 00:30:59 +02:00
|
|
|
|
if (!strcmp(#parametr,"src=")) //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> GetNewUrl()
|
|
|
|
|
{
|
2012-07-31 16:44:11 +02:00
|
|
|
|
if (downloader_id!=0) strcpy(#temp, #history_list[history_current-1].Item);
|
|
|
|
|
else strcpy(#temp, BrowserHistory.CurrentUrl()); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if (!strcmpn(#temp, "http:", 5)) || (!strcmpn(#options, "http:", 5)) return;
|
2012-07-02 20:24:48 +02:00
|
|
|
|
temp[strrchr(#temp, '/')] = 0x00; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> /
|
2012-06-20 19:22:56 +02:00
|
|
|
|
strcat(#temp, #options);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
image=load_image(#temp);
|
2012-06-24 00:30:59 +02:00
|
|
|
|
w=DSWORD[image+4];
|
|
|
|
|
h=DSWORD[image+8];
|
|
|
|
|
}
|
2012-07-02 20:24:48 +02:00
|
|
|
|
/*if (!strcmp(#parametr,"alt="))
|
2012-06-24 00:30:59 +02:00
|
|
|
|
{
|
|
|
|
|
strcpy(#tag, "[Image: ");
|
|
|
|
|
strcat(#tag, #options);
|
|
|
|
|
strcat(#tag, "]");
|
2012-07-02 20:24:48 +02:00
|
|
|
|
}*/
|
2012-06-24 00:30:59 +02:00
|
|
|
|
|
|
|
|
|
IF(tagparam)
|
|
|
|
|
{
|
2011-06-25 03:52:11 +02:00
|
|
|
|
GetNextParam();
|
|
|
|
|
GOTO IMG_TAG;
|
|
|
|
|
}
|
2012-06-24 00:30:59 +02:00
|
|
|
|
|
2012-11-10 02:49:08 +01:00
|
|
|
|
if (!image) return;
|
|
|
|
|
|
2011-09-05 11:18:16 +02:00
|
|
|
|
if (w>width1) w=width1;
|
|
|
|
|
|
2012-11-10 02:49:08 +01:00
|
|
|
|
if (stroka==0) DrawBar(left, top, width-15, 15, bg_color); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-06-24 00:30:59 +02:00
|
|
|
|
stroka+=h/10;
|
2012-11-10 02:49:08 +01:00
|
|
|
|
if (top1+h<WB1.top) || (top1>WB1.top+WB1.height-10) return; //<2F><><EFBFBD><EFBFBD> <20>Ѩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>
|
2012-06-24 00:30:59 +02:00
|
|
|
|
if (top1<WB1.top) //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
DrawBar(left, top, width-15, 10, bg_color); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
img_lines_first=WB1.top-top1;
|
|
|
|
|
h=h-img_lines_first;
|
|
|
|
|
top1=WB1.top;
|
|
|
|
|
}
|
2012-11-10 02:49:08 +01:00
|
|
|
|
if (top1>WB1.top+WB1.height-h-15) //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
2012-06-24 00:30:59 +02:00
|
|
|
|
{
|
|
|
|
|
h=WB1.top+WB1.height-top1-15;
|
|
|
|
|
}
|
2012-07-03 19:24:00 +02:00
|
|
|
|
if (h<=0) return;
|
|
|
|
|
if (anchor) return;
|
2012-06-24 00:30:59 +02:00
|
|
|
|
|
|
|
|
|
img_draw stdcall (image,left1-5,top1+10,w, h,0,img_lines_first);
|
|
|
|
|
DrawBar(left1+w - 5, top1 + 10, width1-w + 5, h, bg_color);
|
2012-11-10 02:49:08 +01:00
|
|
|
|
IF (link) DefineButton(left1 - 5, top1+10, w, h, blink + BT_HIDE, 0xB5BFC9);
|
2011-09-05 11:18:16 +02:00
|
|
|
|
return;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
2012-04-12 23:28:24 +02:00
|
|
|
|
if (!chTag("meta")) || (!chTag("?xml"))
|
2011-09-05 11:18:16 +02:00
|
|
|
|
{
|
2011-06-25 03:52:11 +02:00
|
|
|
|
META:
|
2012-04-12 23:28:24 +02:00
|
|
|
|
if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content=")) || (!strcmp(#parametr, "encoding="))
|
2011-06-25 03:52:11 +02:00
|
|
|
|
{
|
2012-07-02 20:24:48 +02:00
|
|
|
|
strcpy(#options, #options[strrchr(#options, '=')]); //<2F><><EFBFBD><EFBFBD><EFBFBD> <20> content=
|
2011-06-25 03:52:11 +02:00
|
|
|
|
|
2012-06-20 21:58:55 +02:00
|
|
|
|
if (!strcmp(#options,"utf-8")) || (!strcmp(#options,"utf8")) ReadHtml(_UTF);
|
|
|
|
|
if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) ReadHtml(_KOI);
|
|
|
|
|
if (!strcmp(#options, "dos")) || (!strcmp(#options, "cp-866")) ReadHtml(_DOS);
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
2012-06-20 19:22:56 +02:00
|
|
|
|
if (tagparam)
|
2011-09-05 11:18:16 +02:00
|
|
|
|
{
|
2011-06-25 03:52:11 +02:00
|
|
|
|
GetNextParam();
|
|
|
|
|
goto META;
|
|
|
|
|
}
|
2011-09-05 11:18:16 +02:00
|
|
|
|
return;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-05 10:25:06 +02:00
|
|
|
|
void TextGoDown(int left1, top1, width1)
|
|
|
|
|
{
|
2012-06-22 13:38:38 +02:00
|
|
|
|
if (!stroka) && (!stolbec) && (!first_line_drawed)
|
|
|
|
|
{
|
|
|
|
|
DrawBar(WB1.left, WB1.top, WB1.width-15, 15, bg_color); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
first_line_drawed=1;
|
|
|
|
|
}
|
2011-06-25 03:52:11 +02:00
|
|
|
|
stroka++;
|
2012-06-22 13:38:38 +02:00
|
|
|
|
if (blq_text) stolbec = 8;
|
2011-06-25 03:52:11 +02:00
|
|
|
|
ELSE stolbec = 0;
|
2012-06-22 13:38:38 +02:00
|
|
|
|
if (li_text) stolbec = li_tab * 5;
|
2012-06-20 21:58:55 +02:00
|
|
|
|
IF(stroka >= 0) && (stroka - 2 < lines.visible) && (!anchor) DrawBar(left1 - 5, top1 + 10, width1 + 5, 10, bg_color);
|
2012-02-21 23:22:44 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-06-05 10:25:06 +02:00
|
|
|
|
void TWebBrowser::DrawScroller() //<2F><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
2012-06-20 21:58:55 +02:00
|
|
|
|
scroll1.max_area = lines.all;
|
|
|
|
|
scroll1.cur_area = lines.visible;
|
|
|
|
|
scroll1.position = lines.first;
|
2012-06-05 10:25:06 +02:00
|
|
|
|
|
|
|
|
|
scroll1.all_redraw=1;
|
|
|
|
|
scroll1.start_x=Form.width-28; //left + width - 15
|
|
|
|
|
scroll1.size_y=WB1.height;
|
|
|
|
|
|
|
|
|
|
scrollbar_v_draw(#scroll1);
|
2012-11-11 12:53:38 +01:00
|
|
|
|
}
|