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 SetTextStyle();
void DrawPage(); void DrawPage();
void DrawScroller(); void DrawScroller();
void LoadInternalPage();
void NewLine(); void NewLine();
void Perenos(); void Perenos();
byte end_parsing; byte end_parsing;
@ -80,9 +81,7 @@ char anchor[256];
#include "..\TWB\table.h" #include "..\TWB\table.h"
//======================================================================= //============================================================================================
void TWebBrowser::DrawPage() void TWebBrowser::DrawPage()
{ {
int start_x, start_y, line_length, stolbec_len, magrin_left=5; 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; line_length = stolbec_len * list.font_w * DrawBuf.zoom;
WriteBufText(start_x, 0, list.font_type, text_colors[text_color_index], #line, buf_data); 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.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.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]); 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; stolbec += stolbec_len;
} }
} }
//======================================================================= //============================================================================================
void TWebBrowser::LoadInternalPage(dword bufpos, in_filesize){
bufsize = in_filesize;
bufpointer = bufpos;
Parse();
}
//============================================================================================
void TWebBrowser::Parse(){ void TWebBrowser::Parse(){
word bukva[2]; word bukva[2];
int j; int j;
@ -262,7 +265,7 @@ void TWebBrowser::Parse(){
} }
DrawScroller(); DrawScroller();
} }
//============================================================================================
void TWebBrowser::Perenos() void TWebBrowser::Perenos()
{ {
int perenos_num; int perenos_num;
@ -276,8 +279,7 @@ void TWebBrowser::Perenos()
strcpy(#line, #new_line_text); strcpy(#line, #new_line_text);
NewLine(); NewLine();
} }
//============================================================================================
char oldtag[100]; char oldtag[100];
void TWebBrowser::SetTextStyle(int left1, top1) { void TWebBrowser::SetTextStyle(int left1, top1) {
dword hr_color; dword hr_color;
@ -527,7 +529,8 @@ void TWebBrowser::SetTextStyle(int left1, top1) {
{ {
NewLine(); NewLine();
if (stroka > -1) && (stroka - 2 < list.visible) 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; return;
} }
@ -599,8 +602,7 @@ void BufEncode(int set_new_encoding)
bufpointer = ChangeCharset("CP1251", "UTF-8", bufpointer); bufpointer = ChangeCharset("CP1251", "UTF-8", bufpointer);
} }
} }
//============================================================================================
void TWebBrowser::DrawScroller() void TWebBrowser::DrawScroller()
{ {
scroll_wv.max_area = list.count; scroll_wv.max_area = list.count;
@ -616,8 +618,7 @@ void TWebBrowser::DrawScroller()
scrollbar_v_draw(#scroll_wv); scrollbar_v_draw(#scroll_wv);
} }
//============================================================================================
void TWebBrowser::NewLine() void TWebBrowser::NewLine()
{ {
int onleft, ontop; int onleft, ontop;
@ -638,9 +639,7 @@ void TWebBrowser::NewLine()
if (style.blq) stolbec = 6; else stolbec = 0; if (style.blq) stolbec = 6; else stolbec = 0;
if (style.li) stolbec = style.li_tab * 5; if (style.li) stolbec = style.li_tab * 5;
} }
//============================================================================================
int istag(dword text) { if (!strcmp(#tag,text)) return 1; else return 0; } 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 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; } 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)) if (!strncmp(#URL,"WebView:",8))
{ {
SetPageDefaults(); 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(); else if (!strcmp(#URL, URL_SERVICE_HISTORY)) ShowHistory();
return; return;
} }
@ -638,10 +638,10 @@ void ShowPage()
PageLinks.Clear(); PageLinks.Clear();
if (http_transfer) if (http_transfer)
{ {
LoadInternalPage(#loading, sizeof(loading)); WB1.LoadInternalPage(#loading, sizeof(loading));
} }
else else
LoadInternalPage(#page_not_found, sizeof(page_not_found)); WB1.LoadInternalPage(#page_not_found, sizeof(page_not_found));
} }
else else
WB1.Parse(); WB1.Parse();
@ -656,12 +656,6 @@ byte UrlExtIs(dword ext)
return false; return false;
} }
void LoadInternalPage(dword bufpos, in_filesize){
bufsize = in_filesize;
bufpointer = bufpos;
WB1.Parse();
}
char downloader_stak[4096]; char downloader_stak[4096];

View File

@ -27,5 +27,5 @@ ShowHistory()
strcat(history_pointer, #pics[i].path); strcat(history_pointer, #pics[i].path);
} }
strcat(history_pointer, "</body></html>"); 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); WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.h);
strcpy(#header, #version); strcpy(#header, #version);
pre_text = 0;
WB1.list.first = WB1.list.count = 0; WB1.list.first = WB1.list.count = 0;
} }
void DrawLetter() { void DrawLetter() {
pre_text = 2;
bufsize = strlen(mdata); bufsize = strlen(mdata);
WB1.Prepare(bufsize, mdata); WB1.LoadInternalPage(bufsize, mdata);
if (bufsize) WB1.Parse(); if (bufsize) WB1.Parse();
DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, 0xFFFfff); DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, 0xFFFfff);
} }