Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7748 → Rev 7749

/programs/cmm/TWB/TWB.c
96,6 → 96,10
stolbec_len = strlen(#line) * zoom;
line_length = stolbec_len * list.font_w;
 
if (debug_mode) {
DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, 0xDDDddd);
}
 
if (style.bg_color!=page_bg) {
DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, style.bg_color);
}
154,8 → 158,10
dword bufpos;
dword line_len;
SetPageDefaults();
if (strstri(bufpointer, "<body")==-1) {
t_body = true;
if (strstri(bufpointer, "<html")==-1) style.pre = true; //show linebreaks for a plaint text
else if (strstri(bufpointer, "<body")==-1) t_body = true;
}
for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;)
{
bukva = ESBYTE[bufpos];
180,14 → 186,17
}
goto DEFAULT_MARK;
case '&': //&nbsp; and so on
bufpos++;
tag=0;
for (j=0; (ESBYTE[bufpos]<>';') && (j<7); j++, bufpos++;)
for (j=1, tag=0; (ESBYTE[bufpos+j]<>';') && (j<8); j++)
{
bukva = ESBYTE[bufpos];
bukva = ESBYTE[bufpos+j];
chrcat(#tag, bukva);
}
if (bukva = GetUnicodeSymbol()) goto DEFAULT_MARK;
if (bukva = GetUnicodeSymbol(#tag)) {
bufpos += j;
} else {
bukva = '&';
}
goto DEFAULT_MARK;
break;
case '<':
bufpos++;
224,7 → 233,7
sprintf(#tagparam, "</%s>", #tag);
j = strstri(bufpos, #tagparam);
if (j!=-1) {
bufpos = j;
bufpos = j-1;
}
tag = tagparam = NULL;
break;
286,7 → 295,7
}
//============================================================================================
void TWebBrowser::SetStyle() {
char img_path[4096];
char img_path[4096]=0;
int left1 = body_magrin + list.x;
int meta_encoding;
if (istag("html")) {
396,14 → 405,16
if (istag("img")) {
do{
if (isattr("src=")) strncpy(#img_path, #val, sizeof(img_path)-1);
if (isattr("alt=")) && (strlen(#val)<sizeof(line)-3) sprintf(#line, "[%s]", #val);
if (isattr("title=")) && (strlen(#val)<sizeof(line)-3) sprintf(#line, "[%s]", #val);
if (isattr("title=")) && (strlen(#val)<sizeof(line)-3) && (val) sprintf(#line, "[%s]", #val);
if (isattr("alt=")) && (strlen(#val)<sizeof(line)-3) && (val) sprintf(#line, "[%s]", #val);
} while(GetNextParam());
if (!img_path) return;
style.image = true;
text_color_index++;
text_colors[text_color_index] = 0x9A6F29;
if (!line) {
if (!strncmp(#img_path, "data:", 5)) img_path=0;
replace_char(#img_path, '?', NULL, strlen(#img_path));
sprintf(#line, "[%s]", #img_path+strrchr(#img_path, '/'));
line[50]= NULL;
}
532,9 → 543,12
 
if (!stolbec) && (draw_y==body_magrin) return;
if (!stolbec) {
if (style.li) && (stolbec == style.li_tab * 5) {
if (empty_line<1) empty_line++;
else return;
} else if (!stolbec) {
if (empty_line<1) empty_line++;
else return;
} else {
empty_line=0;
}
/programs/cmm/TWB/unicode_tags.h
67,25 → 67,25
 
byte unicode_chars[] = "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯àáâãäåæçèéêëìíîïðñh£\243i\105\244\0";
 
unsigned char GetUnicodeSymbol()
bool GetUnicodeSymbol(dword in_tag)
{
int j;
for (j=0; unicode_tags[j]!=0; j+=2;)
{
if (!strcmp(#tag, unicode_tags[j]))
if (!strcmp(in_tag, unicode_tags[j]))
{
strcat(#line, unicode_tags[j+1]);
return NULL;
return true;
}
}
j = atoi(#tag + 1) - 1040;
if (tag[1] == '1') && (j>=0) && (j<=72) && (strlen(#tag) == 5)
j = atoi(in_tag + 1) - 1040;
if (tag[1] == '1') && (j>=0) && (j<=72) && (strlen(in_tag) == 5)
{
return unicode_chars[j];
chrcat(#line, unicode_chars[j]);
return true;
}
strcat(#line,#tag); //âûâîäèì íà ýêðàí íåîáðàáîòàííûé òåã, òàê áðàóçåðû çà÷åì-òî äåëàþò
return NULL;
return false;
}
/programs/cmm/browser/WebView.c
32,7 → 32,7
 
 
#ifdef LANG_RUS
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.92";
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.93";
#define T_LOADING "‡ £à㧪  áâà ­¨æë..."
#define T_RENDERING "¥­¤¥à¨­£..."
char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0";
48,7 → 48,7
"Š®¯¨à®¢ âì áá뫪ã
‘ª ç âì ᮤ¥à¦¨¬®¥ áá뫪¨";
#else
char version[]="Text-based Browser 1.9";
char version[]="Text-based Browser 1.93";
#define T_LOADING "Loading..."
#define T_RENDERING "Rendering..."
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
/programs/cmm/lib/strings.h
14,6 → 14,7
// strcpy( EDI, ESI) --- 0 if ==
// strlcpy(dword text1,text2,signed length)
// strcat( EDI, ESI)
// chrcat(ESI, BL)
// strncat(dword text1,text2,signed length) --- pasting the text of a certain length
// strchr( ESI,BL) --- find first BL
// strrchr( ESI,BL) --- find last BL