Fix for Liza

git-svn-id: svn://kolibrios.org@5747 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2015-08-19 12:54:01 +00:00
parent 0b5a2b2056
commit 68d35a5327
4 changed files with 22 additions and 31 deletions

View File

@ -25,6 +25,7 @@ struct TWebBrowser {
void SetTextStyle();
void DrawPage();
void DrawScroller();
void LoadInternalPage();
void NewLine();
void Perenos();
byte end_parsing;
@ -80,9 +81,7 @@ char anchor[256];
#include "..\TWB\table.h"
//=======================================================================
//============================================================================================
void TWebBrowser::DrawPage()
{
int start_x, start_y, line_length, stolbec_len, magrin_left=5;
@ -106,7 +105,7 @@ void TWebBrowser::DrawPage()
line_length = stolbec_len * list.font_w * DrawBuf.zoom;
WriteBufText(start_x, 0, list.font_type, text_colors[text_color_index], #line, buf_data);
if (style.b) WriteBufText(start_x+1, 0, list.font_type, text_colors[text_color_index], #line, buf_data);
if (style.b) WriteBufText(start_x+1, 0, list.font_type, text_colors[text_color_index], #line, buf_data);
if (style.i) { stolbec++; DrawBuf.Skew(start_x, 0, line_length, list.line_h); } // bug with zoom>1
if (style.s) DrawBuf.DrawBar(start_x, list.line_h / 2 - DrawBuf.zoom, line_length, DrawBuf.zoom, text_colors[text_color_index]);
if (style.u) DrawBuf.DrawBar(start_x, list.line_h - DrawBuf.zoom - DrawBuf.zoom, line_length, DrawBuf.zoom, text_colors[text_color_index]);
@ -118,9 +117,13 @@ void TWebBrowser::DrawPage()
stolbec += stolbec_len;
}
}
//=======================================================================
//============================================================================================
void TWebBrowser::LoadInternalPage(dword bufpos, in_filesize){
bufsize = in_filesize;
bufpointer = bufpos;
Parse();
}
//============================================================================================
void TWebBrowser::Parse(){
word bukva[2];
int j;
@ -262,7 +265,7 @@ void TWebBrowser::Parse(){
}
DrawScroller();
}
//============================================================================================
void TWebBrowser::Perenos()
{
int perenos_num;
@ -276,8 +279,7 @@ void TWebBrowser::Perenos()
strcpy(#line, #new_line_text);
NewLine();
}
//============================================================================================
char oldtag[100];
void TWebBrowser::SetTextStyle(int left1, top1) {
dword hr_color;
@ -527,7 +529,8 @@ void TWebBrowser::SetTextStyle(int left1, top1) {
{
NewLine();
if (stroka > -1) && (stroka - 2 < list.visible)
DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, list.line_h / 2 - DrawBuf.zoom - DrawBuf.zoom, DrawBuf.zoom*2, DrawBuf.zoom*2, 0x555555);
DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, list.line_h
/ 2 - DrawBuf.zoom - DrawBuf.zoom, DrawBuf.zoom*2, DrawBuf.zoom*2, 0x555555);
}
return;
}
@ -599,8 +602,7 @@ void BufEncode(int set_new_encoding)
bufpointer = ChangeCharset("CP1251", "UTF-8", bufpointer);
}
}
//============================================================================================
void TWebBrowser::DrawScroller()
{
scroll_wv.max_area = list.count;
@ -616,8 +618,7 @@ void TWebBrowser::DrawScroller()
scrollbar_v_draw(#scroll_wv);
}
//============================================================================================
void TWebBrowser::NewLine()
{
int onleft, ontop;
@ -638,9 +639,7 @@ void TWebBrowser::NewLine()
if (style.blq) stolbec = 6; else stolbec = 0;
if (style.li) stolbec = style.li_tab * 5;
}
//============================================================================================
int istag(dword text) { if (!strcmp(#tag,text)) return 1; else return 0; }
int isattr(dword text) { if (!strcmp(#attr,text)) return 1; else return 0; }
int isval(dword text) { if (!strcmp(#val,text)) return 1; else return 0; }

View File

@ -588,7 +588,7 @@ void OpenPage()
if (!strncmp(#URL,"WebView:",8))
{
SetPageDefaults();
if (!strcmp(#URL, URL_SERVICE_HOME)) LoadInternalPage(#homepage, sizeof(homepage));
if (!strcmp(#URL, URL_SERVICE_HOME)) WB1.LoadInternalPage(#homepage, sizeof(homepage));
else if (!strcmp(#URL, URL_SERVICE_HISTORY)) ShowHistory();
return;
}
@ -638,10 +638,10 @@ void ShowPage()
PageLinks.Clear();
if (http_transfer)
{
LoadInternalPage(#loading, sizeof(loading));
WB1.LoadInternalPage(#loading, sizeof(loading));
}
else
LoadInternalPage(#page_not_found, sizeof(page_not_found));
WB1.LoadInternalPage(#page_not_found, sizeof(page_not_found));
}
else
WB1.Parse();
@ -656,12 +656,6 @@ byte UrlExtIs(dword ext)
return false;
}
void LoadInternalPage(dword bufpos, in_filesize){
bufsize = in_filesize;
bufpointer = bufpos;
WB1.Parse();
}
char downloader_stak[4096];

View File

@ -27,5 +27,5 @@ ShowHistory()
strcat(history_pointer, #pics[i].path);
}
strcat(history_pointer, "</body></html>");
LoadInternalPage(history_pointer, strlen(history_pointer));
WB1.LoadInternalPage(history_pointer, strlen(history_pointer));
}

View File

@ -355,14 +355,12 @@ void InitTWB() {
WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.h);
strcpy(#header, #version);
pre_text = 0;
WB1.list.first = WB1.list.count = 0;
}
void DrawLetter() {
pre_text = 2;
bufsize = strlen(mdata);
WB1.Prepare(bufsize, mdata);
WB1.LoadInternalPage(bufsize, mdata);
if (bufsize) WB1.Parse();
DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, 0xFFFfff);
}