Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4649 → Rev 4650

/programs/cmm/TWB/TWB.c
16,10 → 16,10
void GetNewUrl();
void Prepare();
void Parse();
void WhatTextStyle();
void SetTextStyle();
void DrawPage();
void DrawScroller();
void TextGoDown();
void NewLine();
};
 
TWebBrowser WB1;
302,11 → 302,11
if (stroka-1 > list.visible) && (list.first <>0) break 1; //óõîäèì...
DrawPage();
strcpy(#line, #temp);
TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
NewLine(list.x + 5, stroka * 10 + list.y + 5); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
}
DrawPage();
line=NULL;
if (tag) WhatTextStyle(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //îáðàáîòêà òåãîâ
if (tag) SetTextStyle(list.x + 5, stroka * 10 + list.y + 5); //îáðàáîòêà òåãîâ
tag = parametr = tagparam = ignor_param = NULL;
break;
default:
329,13 → 329,13
if (stroka-1 > list.visible) && (list.first <>0) break 1; //óõîäèì...
DrawPage();
strcpy(#line, #temp);
TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
NewLine(list.x + 5, stroka * 10 + list.y + 5); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
}
}
}
 
DrawPage(); //ðèñóåò ïîñëåäíþþ ñòðîêó, ïîòîì ýòî íàäî óáðàòü, îïòèìèçèðîâàâ êîä
TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
NewLine(list.x + 5, stroka * 10 + list.y + 5); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
 
if (list.visible * 10 + 25 <= list.h)
DrawBar(list.x, list.visible * 10 + list.y + 25, list.w, -list.visible * 10 + list.h - 25, bg_color);
354,7 → 354,7
 
 
char oldtag[100];
void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
void TWebBrowser::SetTextStyle(int left1, top1) {
dword hr_color;
byte opened;
byte meta_encoding;
388,13 → 388,13
{
if (opened)
{
TextGoDown(left1, top1, width1);
NewLine(left1, top1);
strcat(#line, ' \"');
}
if (!opened)
{
chrcat(#line, '\"');
TextGoDown(left1, top1, width1);
NewLine(left1, top1);
}
}
 
478,56 → 478,63
return;
}
if (isTag("br")) {
TextGoDown(left1, top1, width1);
NewLine(left1, top1);
return;
}
if (isTag("div")) || (isTag("header")) || (isTag("footer")) {
IF(oldtag[0] <>'h') TextGoDown(left1, top1, width1);
IF(oldtag[0] <>'h') NewLine(left1, top1);
return;
}
if (isTag("p")) {
IF(oldtag[0] == 'h') return;
TextGoDown(left1, top1, width1);
IF(opened) TextGoDown(left1, top1 + 10, width1);
NewLine(left1, top1);
IF(opened) NewLine(left1, top1 + 10);
return;
}
 
if(isTag("table")) {
table.active = opened;
NewLine(left1, top1);
if (opened) table.NewTable();
}
 
if(isTag("table")) {
if(isTag("td")) {
if (opened)
{
table.active = true;
TextGoDown(left1, top1, width1);
table.NewTable();
}
else
table.cur_col++;
table.row_h = 0;
do {
if (!strcmp(#parametr, "width="))
{
table.active = false;
TextGoDown(left1, top1, width1);
table.col_w[table.cur_col] = atoi(#options);
// NewLine(left1, top1);
// strcpy(#line, #options);
// NewLine(left1, top1);
}
} while(GetNextParam());
}
if(isTag("td")) {
if (opened)
{
//
}
else
{
//
if (table.row_h > table.row_max_h) table.row_max_h = table.row_h;
}
}
 
if(isTag("tr")) {
if (opened)
{
//
table.cur_col = 0;
table.row_max_h = 0;
table.row_start = stroka;
}
else
{
TextGoDown(left1, top1, width1);
NewLine(left1, top1);
if (table.cur_row == 0) table.max_cols = table.cur_col;
table.cur_row++;
table.max_cols = table.cur_col;
}
}
 
/*
if (isTag("center"))
{
534,7 → 541,7
if (opened) text_align = ALIGN_CENTER;
if (!opened)
{
TextGoDown(left1, top1, width1);
NewLine(left1, top1);
text_align = ALIGN_LEFT;
}
return;
544,7 → 551,7
if (opened) text_align = ALIGN_RIGHT;
if (!opened)
{
TextGoDown(left1, top1, width1);
NewLine(left1, top1);
text_align = ALIGN_LEFT;
}
return;
551,8 → 558,8
}
*/
if (isTag("h1")) || (isTag("h2")) || (isTag("h3")) || (isTag("h4")) {
TextGoDown(left1, top1, width1);
if (opened) && (stroka>1) TextGoDown(left1, top1 + 10, width1);
NewLine(left1, top1);
if (opened) && (stroka>1) NewLine(left1, top1 + 10);
strcpy(#oldtag, #tag);
if (opened)
{
582,7 → 589,7
{
li_text = opened;
IF(opened == 0) return;
TextGoDown(left1, top1, width1);
NewLine(left1, top1);
return;
}
if (isTag("condition"))
596,7 → 603,7
li_text = opened;
if (opened)
{
TextGoDown(left1, top1, width1);
NewLine(left1, top1);
if (stroka > -1) && (stroka - 2 < list.visible) DrawBuf.DrawBar(li_tab * 5 * 6 + left1 - 5, list.line_h/2-3, 2, 2, 0x555555);
}
return;
607,7 → 614,7
{
li_text = opened;
li_tab--;
TextGoDown(left1, top1, width1);
NewLine(left1, top1);
} ELSE li_tab++;
if (isTag("dd")) stolbec += 5;
if (isTag("blockquote")) blq_text = opened;
620,13 → 627,13
return;
}
if (strcmp(#parametr, "color=") == 0) hr_color = GetColor(#options); else hr_color = 0x999999;
TextGoDown(left1, top1, width1);
NewLine(left1, top1);
DrawBuf.DrawBar(5, list.line_h/2, list.w-10, 1, hr_color);
TextGoDown(left1, top1+list.line_h, width1);
NewLine(left1, top1+list.line_h);
}
if (isTag("img"))
{
ImgCache.Images( left1, top1, width1);
ImgCache.Images( left1, top1);
return;
}
if (isTag("meta")) || (isTag("?xml"))
664,7 → 671,7
}
 
 
void TWebBrowser::TextGoDown(int left1, top1, width1)
void TWebBrowser::NewLine(int left1, top1)
{
if (!stroka) DrawBar(list.x, list.y, list.w, 5, bg_color); //çàêðàøèâàåì ôîí íàä ïåðâîé ñòðîêîé
if (t_html) && (!t_body) return;
/programs/cmm/TWB/table.h
5,8 → 5,8
byte max_rows;
byte cur_col;
byte cur_row;
int col_w[255];
int col_h[255];
int col_w[32];
int row_start, row_h, row_max_h;
void NewTable();
} table;
 
/programs/cmm/browser/HTMLv.c
30,7 → 30,7
#include "img\URLgoto.txt";
 
#ifdef LANG_RUS
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.73";
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.74";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
37,7 → 37,7
unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm";
char accept_language[]= "Accept-Language: ru\n";
#else
char version[]=" Text-based Browser 0.99.73";
char version[]=" Text-based Browser 0.99.74";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>";
469,6 → 469,7
mem_Free(EAX); // free data
http_transfer=0;
bufsize = 0;
bufpointer = mem_Free(bufpointer);
}
PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
}
499,6 → 500,7
{
StopLoading();
bufsize = 0;
bufpointer = mem_Free(bufpointer);
ShowPage();
return;
}
507,11 → 509,13
{
file_size stdcall (#URL);
bufsize = EBX;
if (!bufsize) return;
mem_Free(bufpointer);
if (bufsize)
{
bufpointer = mem_Free(bufpointer);
bufpointer = mem_Alloc(bufsize);
SetPageDefaults();
ReadFile(0, bufsize, bufpointer, #URL);
}
ShowPage();
}
}
/programs/cmm/browser/html/page_not_found_en.htm
3,8 → 3,8
<title>Page not found</title>
</head>
<body>
<h1>Webpage Not Available</h1>
<h2>What could be done:</h2>
<h1>&nbsp;Webpage Not Available</h1>
<h2>&nbsp;What could be done:</h2>
<ul>
<li>
Make sure that evetything fine with Internet connection.<br>
11,7 → 11,7
Open /sys/network/netcfg network diagnostic tool.<br>
</li>
<li>
Check page address, there may have been made ​​a typo<br>
Check page address, there may have been made ​​a typo.<br>
</li>
<li>
Server is temporarily unavailable.<br>
/programs/cmm/browser/html/page_not_found_ru.htm
4,8 → 4,8
<title>‘âà ­¨æ  ­¥ ­ ©¤¥­ </title>
</head>
<body>
<h1>‚¥¡-áâà ­¨æ  ­¥¤®áâ㯭 </h1>
<h2>—â® ¬®¦­® ᤥ« âì:</h2>
<h1>&nbsp;‚¥¡-áâà ­¨æ  ­¥¤®áâ㯭 </h1>
<h2>&nbsp;—â® ¬®¦­® ᤥ« âì:</h2>
<ul>
<li>
“¡¥¤¨â¥áì, çâ® ¥áâì ¯®¤ª«î祭¨¥ ª á¥â¨ ˆ­â¥à­¥â.<br>
12,7 → 12,7
Žâªà®©â¥ /sys/network/netcfg ¤«ï ¤¨ £­®á⨪¨ á¥â¨.<br>
</li>
<li>
à®¢¥àì⥠ ¤à¥áá áâà ­¨æë, ¢®§¬®¦­®, ¡ë«  ᤥ« ­  ®¯¥ç âª <br>
à®¢¥àì⥠ ¤à¥áá áâà ­¨æë, ¢®§¬®¦­®, ¡ë«  ᤥ« ­  ®¯¥ç âª .<br>
</li>
<li>
‘¥à¢¥à ¢à¥¬¥­­® ­¥¤®áâ㯥­. <br>