Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3061 → Rev 3060

/programs/network/htmlv/browser/TWB.h
281,7 → 281,7
{
KillProcess(downloader_id); //óáèâàåì ñòàðûé ïðîöåññ
DeleteFile(#download_path);
IF (URL[strlen(#URL)-1]=='/') URL[strlen(#URL)-1]=NULL;
IF (URL[strlen(#URL)-1]=='/') URL[strlen(#URL)-1]='';
downloader_id = RunProgram("/sys/network/downloader", #URL);
//Browser Hack v2.0
Pause(60);
344,7 → 344,7
li_text = link = ignor_text = text_color_index = text_colors[0] = li_tab = 0; //îáíóëÿåì òåãè
link_color = 0x0000FF;
bg_color = 0xFFFFFF;
line = NULL;
line = '';
strcpy(#page_links,"|");
strcpy(#header, #version);
 
364,7 → 364,7
case 0x0a:
if (pre_text)
{
bukva = temp = NULL;
bukva = temp = '';
goto NEXT_MARK;
}
case '\9':
402,9 → 402,26
strcat(#tag, #bukva);
}
bukva = GetUnicodeSymbol();
if (bukva) goto DEFAULT_MARK;
for (j=0; unicode_tags[j]!=0; j+=2;)
{
if (!strcmp(#tag, unicode_tags[j]))
{
strcat(#line, unicode_tags[j+1]);
break 1;
}
}
rez = atoi(#tag + 1) - 1040;
if (tag[1] == '1') && (rez>=0) && (rez<=72) && (strlen(#tag) == 5)
{
bukva = unicode_chars[rez];
//GOTO DEFAULT_MARK; //îáðàáàòûâàåì áóêâó ëó÷øå íàâåðíî strcat(#line, unicode_tags[j+1]); è break 1;
strcat(#line, #bukva);
break;
}
strcat(#line,#tag); //âûâîäèì íà ýêðàí íåîáðàáîòàííûé òåã, òàê áðàóçåðû çà÷åì-òî äåëàþò
break;
case '<':
bword++; //ïðîìîòàåì ñèìâîë <
tag = parametr = tagparam = ignor_param = NULL;
499,7 → 516,7
if (anchor)
{
//åñëè ïîñðåäè òåêñòà ïîÿâèòñÿ íîâûé ÿêîðü - áóäåò áåñêîíå÷íûé öèêë
anchor=NULL;
anchor='';
lines.first=anchor_line_num;
ParseHTML(buf);
}
580,10 → 597,10
rez = 0;
strcpy(#tag, #tag+1);
}
else rez = 1;
else
rez = 1;
if (!chTag("html"))
{
if (!chTag("html")) {
IF(!strcmp(#URL + strlen(#URL) - 4, ".mht")) IF (rez==0) ignor_text = 1; ELSE ignor_text = 0;
return;
}
592,8 → 609,14
 
if(!chTag("title"))
{
if (rez) header=NULL;
else if (!stroka) DrawTitle(#header); //òåã çàêðûëñÿ - âûâåëè ñòðîêó
if (rez)
{
header=0;
}
else //òåã çàêðûëñÿ - âûâåëè ñòðîêó
{
if (stroka==0) DrawTitle(#header);
}
return;
}
 
607,17 → 630,31
 
if (anchor) && (!strcmp(#parametr, "id=")) //î÷åíü ïëîõî!!! ïîòîìó ÷òî åñëè íå ïîñëåäíèé òåã, ðàáîòàòü íå áóäåò
{
if (!strcmp(#anchor, #options)) anchor_line_num=lines.first+stroka;
if (!strcmp(#anchor, #options))
{
anchor_line_num=lines.first+stroka;
}
}
if (!chTag("body"))
{
do{
if (!strcmp(#parametr, "link=")) link_color = GetColor(#options);
if (!strcmp(#parametr, "text=")) text_colors[0]=GetColor(#options);
if (!strcmp(#parametr, "bgcolor=")) bg_color=GetColor(#options);
} while(GetNextParam());
BODY_MARK:
if (!strcmp(#parametr, "link="))
link_color = GetColor(#options);
if (!strcmp(#parametr, "text="))
text_colors[0]=GetColor(#options);
if (!strcmp(#parametr, "bgcolor="))
bg_color=GetColor(#options);
IF(tagparam)
{
GetNextParam();
GOTO BODY_MARK;
}
return;
}
 
625,9 → 662,10
{
if (rez)
{
if (link) IF(text_color_index > 0) text_color_index--; //åñëè ïðåäûäóùèé òåã à íå áûë çàêðûò
 
do{
_A_MARK:
if (!strcmp(#parametr, "href="))
{
if (stroka - 1 > lines.visible) || (stroka < -2) return;
648,8 → 686,12
anchor_line_num=lines.first+stroka;
}
}
} while(GetNextParam());
if (tagparam)
{
GetNextParam();
GOTO _A_MARK;
}
}
else {
link = 0;
IF(text_color_index > 0) text_color_index--;
665,13 → 707,16
text_color_index++;
text_colors[text_color_index] = text_colors[text_color_index-1];
do{
COL_MARK:
if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#')
{
text_colors[text_color_index] = GetColor(#options);
}
} while(GetNextParam());
IF(tagparam) {
GetNextParam();
GOTO COL_MARK;
}
}
else
if (text_color_index > 0) text_color_index--;
return;
700,7 → 745,7
return;
}
else
oldtag=NULL;
oldtag='';
if (!chTag("b")) || (!chTag("strong")) || (!chTag("big")) {
b_text = rez;
750,7 → 795,7
if (!chTag("img"))
{
if (GetFileInfo(libimg)<>0) return; //åñëè áèáëèîòåêè íåò
do{
IMG_TAG:
if (!strcmp(#parametr,"src=")) //íàäî îáúåäèíèòü ñ GetNewUrl()
{
if (downloader_id) strcpy(#temp, #history_list[history_current-1].Item);
771,7 → 816,11
strcat(#alt, "]");
}
 
} while(GetNextParam());
IF(tagparam)
{
GetNextParam();
GOTO IMG_TAG;
}
if (!image)
{
806,7 → 855,7
 
if (!chTag("meta")) || (!chTag("?xml"))
{
do{
META:
if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content=")) || (!strcmp(#parametr, "encoding="))
{
strcpy(#options, #options[strrchr(#options, '=')]); //ïîèñê â content=
815,7 → 864,11
if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) ReadHtml(_KOI);
if (!strcmp(#options, "dos")) || (!strcmp(#options, "cp-866")) ReadHtml(_DOS);
}
} while(GetNextParam());
if (tagparam)
{
GetNextParam();
goto META;
}
return;
}
}
/programs/network/htmlv/browser/include/history.h
24,7 → 24,7
void UrlsHistory::AddUrl() //òóò íóæåí ââîäèìûé ýëåìåíò - äëÿ óíèâåðñàëüíîñòè
{
int i;
if (history_num>0) && (!strcmp(#URL,#history_list[history_current].Item)) return;
if (history_num>0) && (strcmp(#URL,#history_list[history_current].Item)==0) return;
 
if (history_current>=MAX_HISTORY_NUM-1)
{
/programs/network/htmlv/browser/include/some_code.h
30,15 → 30,11
int i, j = 0;
for (i = 0; i <= id - 401; i++)
{
do
{
j++;
if (j>=strlen(#page_links)) return; //íå ñàìîå óäà÷íîå ðåøåíèå
}
do j++;
while (page_links[j] <>'|');
}
page_links[j] = 0x00;
strcpy(#URL, #page_links+strrchr(#page_links, '|'));
strcpy(#URL, #page_links[strrchr(#page_links, '|')]);
}
 
 
/programs/network/htmlv/browser/include/parce_tag.h
1,10 → 1,8
unsigned int GetNextParam()
void GetNextParam()
{
byte kavichki = false;
int i = strlen(#tagparam) - 1;
if (!tagparam) return 0;
WHILE((i > 0) && ((tagparam[i] == '"') || (tagparam[i] == ' ') || (tagparam[i] == '\'') || (tagparam[i] == '/')))
{
IF (tagparam[i] == '"') || (tagparam[i] == '\'') kavichki=tagparam[i];
45,6 → 43,4
strcpy(#parametr, #tagparam + i + 1);
 
tagparam[i] = 0x00;
return 1;
}
/programs/network/htmlv/browser/include/unicode_tags.h
1,3 → 1,8
 
 
byte unicode_chars[] = "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯àáâãäåæçèéêëìíîïðñh£\243i\105\244\0";
 
 
char *unicode_tags[]={
"nbsp", " ",
"#38", " ",
61,29 → 66,3
"percnt","%",
 
0};
 
 
byte unicode_chars[] = "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯àáâãäåæçèéêëìíîïðñh£\243i\105\244\0";
 
unsigned char GetUnicodeSymbol()
{
int j;
for (j=0; unicode_tags[j]!=0; j+=2;)
{
if (!strcmp(#tag, unicode_tags[j]))
{
strcat(#line, unicode_tags[j+1]);
return NULL;
}
}
rez = atoi(#tag + 1) - 1040;
if (tag[1] == '1') && (rez>=0) && (rez<=72) && (strlen(#tag) == 5)
{
return unicode_chars[rez];
}
strcat(#line,#tag); //âûâîäèì íà ýêðàí íåîáðàáîòàííûé òåã, òàê áðàóçåðû çà÷åì-òî äåëàþò
return NULL;
}