Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5824 → Rev 5825

/programs/cmm/TWB/TWB.c
30,7 → 30,6
} WB1;
 
 
 
byte
link,
ignor_text,
90,7 → 89,7
if (line) && (!anchor)
{
start_x = stolbec * list.font_w + body_magrin * DrawBuf.zoom + list.x;
start_y = stroka * list.line_h + body_magrin;
start_y = stroka * list.item_h + body_magrin;
stolbec_len = utf8_strlen(#line) * DrawBuf.zoom;
line_length = stolbec_len * list.font_w;
 
97,12 → 96,12
if (style.h) stroka++;
WriteBufText(start_x, start_y, list.font_type, text_colors[text_color_index], #line, buf_data);
if (style.b) WriteBufText(start_x+1, start_y, list.font_type, text_colors[text_color_index], #line, buf_data);
if (style.i) { stolbec++; DrawBuf.Skew(start_x, start_y, line_length, list.line_h); } // bug with zoom>1
if (style.s) DrawBuf.DrawBar(start_x, list.line_h / 2 - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
if (style.u) DrawBuf.DrawBar(start_x, list.line_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
if (style.i) { stolbec++; DrawBuf.Skew(start_x, start_y, line_length, list.item_h); } // bug with zoom>1
if (style.s) DrawBuf.DrawBar(start_x, list.item_h / 2 - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
if (style.u) DrawBuf.DrawBar(start_x, list.item_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
if (link) {
DrawBuf.DrawBar(start_x, list.line_h*style.h + list.line_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
PageLinks.AddText(#line, line_length, list.line_h*style.h + list.line_h, UNDERLINE);
DrawBuf.DrawBar(start_x, list.item_h*style.h + list.item_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
PageLinks.AddText(#line, line_length, list.item_h*style.h + list.item_h, UNDERLINE);
}
stolbec += stolbec_len;
}
251,7 → 250,7
//============================================================================================
void TWebBrowser::SetStyle() {
int left1 = 5 + list.x;
int top1 = stroka * list.line_h + list.y + 5;
int top1 = stroka * list.item_h + list.y + 5;
byte opened;
byte meta_encoding;
//ïðîâåðÿåì òåã îòêðûâàåòñÿ èëè çàêðûâàåòñÿ
394,7 → 393,7
if (opened)
{
NewLine();
DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, stroka +1 * list.line_h - 3
DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, stroka +1 * list.item_h - 3
- DrawBuf.zoom - DrawBuf.zoom, DrawBuf.zoom*2, DrawBuf.zoom*2, 0x454545);
}
return;
413,7 → 412,7
$push edi;
NewLine();
$pop edi;
DrawBuf.DrawBar(5, list.line_h*stroka+4, list.w-10, 1, EDI);
DrawBuf.DrawBar(5, list.item_h*stroka+4, list.w-10, 1, EDI);
NewLine();
return;
}
472,12 → 471,12
int onleft, ontop;
 
onleft = list.x + 5;
ontop = stroka * list.line_h + list.y + 5;
ontop = stroka * list.item_h + list.y + 5;
if (t_html) && (!t_body) return;
if (stroka * list.line_h + 5 >= 0) && ( stroka + 1 * list.line_h + 5 < list.h) && (!anchor)
if (stroka * list.item_h + 5 >= 0) && ( stroka + 1 * list.item_h + 5 < list.h) && (!anchor)
{
if (style.align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.line_h,stolbec * list.font_w);
if (style.align == ALIGN_RIGHT) && (DrawBuf.zoom==1) DrawBuf.AlignRight(onleft,ontop,list.w,list.line_h,stolbec * list.font_w);
if (style.align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.item_h,stolbec * list.font_w);
if (style.align == ALIGN_RIGHT) && (DrawBuf.zoom==1) DrawBuf.AlignRight(onleft,ontop,list.w,list.item_h,stolbec * list.font_w);
}
stroka++;
if (style.blq) stolbec = 6; else stolbec = 0;
490,6 → 489,6
//============================================================================================
void TWebBrowser::DrawPage()
{
PutPaletteImage(list.first * list.line_h * DrawBuf.bufw * 4 + buf_data+8, DrawBuf.bufw, list.h, DrawBuf.bufx, DrawBuf.bufy, 32, 0);
PutPaletteImage(list.first * list.item_h * DrawBuf.bufw * 4 + buf_data+8, DrawBuf.bufw, list.h, DrawBuf.bufx, DrawBuf.bufy, 32, 0);
DrawScroller();
}
/programs/cmm/TWB/history.h
8,7 → 8,7
 
struct UrlsHistory {
int links_count;
int current;
int cur_y;
dword CurrentUrl();
dword GetUrl();
dword GetFirstLine();
18,7 → 18,7
} BrowserHistory;
 
dword UrlsHistory::CurrentUrl() {
return #history_list[current].Item;
return #history_list[cur_y].Item;
}
 
dword UrlsHistory::GetUrl(int id) {
31,35 → 31,35
 
void UrlsHistory::AddUrl() {
int i;
if (links_count>0) && (!strcmp(#URL,#history_list[current].Item)) return;
if (links_count>0) && (!strcmp(#URL,#history_list[cur_y].Item)) return;
 
if (current>=MAX_HISTORY_NUM-1)
if (cur_y>=MAX_HISTORY_NUM-1)
{
current/=2;
for (i=0; i<current; i++;)
cur_y/=2;
for (i=0; i<cur_y; i++;)
{
strlcpy(#history_list[i].Item, #history_list[MAX_HISTORY_NUM-i].Item, sizeof(URL));
}
}
current++;
cur_y++;
// history_list[i].was_first = WB1.list.first;
strlcpy(#history_list[current].Item, #URL, sizeof(URL));
links_count=current;
strlcpy(#history_list[cur_y].Item, #URL, sizeof(URL));
links_count=cur_y;
}
 
 
byte UrlsHistory::GoBack() {
if (current<=1) return 0;
current--;
strlcpy(#URL, #history_list[current].Item, sizeof(URL));
// stroka = history_list[current].was_first;
if (cur_y<=1) return 0;
cur_y--;
strlcpy(#URL, #history_list[cur_y].Item, sizeof(URL));
// stroka = history_list[cur_y].was_first;
return 1;
}
 
 
byte UrlsHistory::GoForward() {
if (current==links_count) return 0;
current++;
strlcpy(#URL, #history_list[current].Item, sizeof(URL));
if (cur_y==links_count) return 0;
cur_y++;
strlcpy(#URL, #history_list[cur_y].Item, sizeof(URL));
return 1;
}
/programs/cmm/TWB/img_cache.h
68,8 → 68,8
if (imgw > width1) imgw = width1;
if (stroka==0) DrawBar(WB1.list.x, WB1.list.y, WB1.list.w-15, 5, bg_color); //fill first line
stroka += imgh / WB1.list.line_h;
if (imgh % WB1.list.line_h) stroka++;
stroka += imgh / WB1.list.item_h;
if (imgh % WB1.list.item_h) stroka++;
if (top1+imgh<WB1.list.y) || (top1>WB1.list.y+WB1.list.h-10) return; //if all image is out of visible area
if (top1<WB1.list.y) //if image partly visible (at the top)
{
86,7 → 86,7
img_draw stdcall (pics[cur_pic].image, left1-5, top1, imgw, imgh,0,img_lines_first);
DrawBar(left1+imgw - 5, top1, WB1.list.w-imgw, imgh, bg_color);
DrawBar(WB1.list.x, top1+imgh, WB1.list.w, -imgh % WB1.list.line_h + WB1.list.line_h, bg_color);
DrawBar(WB1.list.x, top1+imgh, WB1.list.w, -imgh % WB1.list.item_h + WB1.list.item_h, bg_color);
if (link)
{
UnsafeDefineButton(left1 - 5, top1, imgw, imgh-1, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9);
/programs/cmm/TWB/links.h
68,7 → 68,7
void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col)
{
int i;
signed int WBY = -WB1.list.first*WB1.list.line_h - WB1.DrawBuf.zoom;
signed int WBY = -WB1.list.first*WB1.list.item_h - WB1.DrawBuf.zoom;
for (i=0; i<count; i++)
{
if (mx>links[i].x) && (my>links[i].y) && (mx<links[i].x+links[i].w) && (my<links[i].y+links[i].h)
133,7 → 133,7
}
else
{
strcpy(#newurl, #history_list[BrowserHistory.current-1].Item);
strcpy(#newurl, #history_list[BrowserHistory.cur_y-1].Item);
}
 
if (ESBYTE[in_URL] == '/') //remove everything after site domain name