Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4550 → Rev 4549

/programs/cmm/TWB/TWB.c
17,7 → 17,7
DrawBufer DrawBuf;
void GetNewUrl();
void ReadHtml();
void Parse();
void ParseHTML();
void WhatTextStyle();
void DrawPage();
void DrawScroller();
90,7 → 90,7
IF (link) {
UnsafeDefineButton(start_x-2, start_y, line_length + 3, 9, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9);
DrawBuf.DrawBar(start_x, 8, line_length, 1, text_colors[text_color_index]);
PageLinks.AddText(#line, line_length, list.line_h, UNDERLINE);
PageLinks.AddText(#line, line_length, list.line_h);
}
stolbec += strlen(#line);
}
166,13 → 166,12
}
 
 
void TWebBrowser::Parse(dword bufpos, in_filesize){
void TWebBrowser::ParseHTML(dword bufpos){
word bukva[2];
int j, perenos_num;
byte ignor_param;
char temp[768];
bufsize = in_filesize;
bufpointer = bufpos;
dword bufstart = bufpos;
b_text = i_text = u_text = s_text = blq_text =
li_text = link = ignor_text = text_color_index = text_colors[0] = li_tab =
196,7 → 195,7
if (!strcmp(#URL + strlen(#URL) - 4, ".mht")) ignor_text = 1;
}
for ( ; bufpointer+bufsize > bufpos; bufpos++;)
for ( ; bufstart+bufsize > bufpos; bufpos++;)
{
bukva = ESBYTE[bufpos];
if (ignor_text) && (bukva!='<') continue;
254,7 → 253,7
do
{
bufpos++;
if (bufpointer + bufsize <= bufpos) break 2;
if (bufstart + bufsize <= bufpos) break 2;
}
while (ESBYTE[bufpos] <>'-');
262,7 → 261,7
if (ESBYTE[bufpos] <>'-') goto HH_;
}
}
while (ESBYTE[bufpos] !='>') && (bufpos < bufpointer + bufsize) //ïîëó÷àåì òåã è åãî ïàðàìåòðû
while (ESBYTE[bufpos] !='>') && (bufpos < bufstart + bufsize) //ïîëó÷àåì òåã è åãî ïàðàìåòðû
{
bukva = ESBYTE[bufpos];
if (bukva == '\9') || (bukva == '\x0a') || (bukva == '\x0d') bukva = ' ';
300,8 → 299,8
}
DrawPage();
 
if (tag) WhatTextStyle(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //îáðàáîòêà òåãîâ
line=NULL;
if (tag) WhatTextStyle(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //îáðàáîòêà òåãîâ
 
tag = parametr = tagparam = ignor_param = NULL;
break;
342,7 → 341,7
{
anchor=NULL;
list.first=anchor_line_num;
Parse(bufpointer, bufsize);
ParseHTML(bufstart);
}
DrawScroller();
}
/programs/cmm/TWB/img_cache.h
25,7 → 25,7
int ImageCache::GetImageNumber(dword i_path)
{
int i;
for (i=0; i<=pics_count; i++) if (!strcmp(#pics[i].path, i_path)) return i; //image exists
for (i=0; i<pics_count; i++) if (!strcmp(#pics[i].path, i_path)) return i; //image exists
// Load image and add it to Cache
pics_count++;
pics[pics_count].image = load_image(i_path);
95,12 → 95,7
img_draw stdcall (pics[cur_pic].image, left1-5, top1, w, h,0,img_lines_first);
DrawBar(left1+w - 5, top1, WB1.list.w-w, h, bg_color);
IF (link)
{
UnsafeDefineButton(left1 - 5, top1, w, h-1, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9);
PageLinks.AddText(0, w, h-1, NOLINE);
// WB1.DrawPage();
IF (link) UnsafeDefineButton(left1 - 5, top1, w, h-1, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9);
}
}
 
ImageCache ImgCache;
/programs/cmm/TWB/links.h
1,14 → 1,9
CustomCursor CursorPointer;
dword CursorFile = FROM "../TWB/pointer.cur";
 
#define NOLINE 0
#define UNDERLINE 1
 
 
struct array_link {
dword link, text;
int x,y,w,h;
int underline;
};
 
struct LinksArray
36,12 → 31,11
count++;
}
 
void LinksArray::AddText(dword new_text, int link_w, link_h, link_underline)
void LinksArray::AddText(dword new_text, int link_w, link_h)
{
if (count<1) return;
links[count-1].w = link_w;
links[count-1].h = link_h;
links[count-1].underline = link_underline;
 
links[count-1].text = buflen;
strcpy(buflen, new_text);
73,8 → 67,8
{
if (active==i) return;
CursorPointer.Set();
if (links[active].underline) DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
if (links[i].underline) DrawBar(links[i].x,links[i].y+8,links[i].w,1, bg_col);
DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
DrawBar(links[i].x,links[i].y+8,links[i].w,1, bg_col);
active = i;
return;
}
82,7 → 76,7
if (active!=-1)
{
CursorPointer.Restore();
if (links[active].underline) DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
active = -1;
}
}