WebView 1.55: fixed about 4 bugs, twice faster; this is really good version

git-svn-id: svn://kolibrios.org@6738 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2016-11-22 14:04:10 +00:00
parent f26b88fc9a
commit 04cd34689f
6 changed files with 31 additions and 26 deletions

View File

@ -224,8 +224,8 @@ void TWebBrowser::Prepare(){
}
DrawStyle();
NewLine();
DrawPage();
if (list.first == 0) list.count = stroka;
DrawPage();
if (anchor)
{
anchor=NULL;

View File

@ -1,9 +1,12 @@
CustomCursor CursorPointer;
dword CursorFile = FROM "../TWB/pointer.cur";
#include "..\lib\collection.h"
#define NOLINE 0
#define UNDERLINE 1
#define MAXLINKS 400
struct array_link {
dword link, text;
int x,y,w,h;
@ -11,8 +14,8 @@ struct array_link {
};
struct LinksArray {
array_link links[400];
char page_links[64000];
array_link links[MAXLINKS];
collection page_links;
dword buflen;
int count, active;
void Hover();
@ -24,25 +27,24 @@ struct LinksArray {
void LinksArray::AddLink(dword lpath, int link_x, link_y)
{
if (count>= MAXLINKS) return;
links[count].x = link_x;
links[count].y = link_y;
links[count].link = buflen;
strcpy(buflen, lpath);
buflen += strlen(lpath)+1;
page_links.add(lpath);
links[count].link = page_links.get(page_links.count-1);
count++;
}
void LinksArray::AddText(dword new_text, int link_w, link_h, link_underline)
{
if (count<1) return;
if (count>= MAXLINKS) || (!count) 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);
buflen += strlen(new_text)+1;
page_links.add(new_text);
links[count-1].text = page_links.get(page_links.count-1);
}
dword LinksArray::GetURL(int id)
@ -52,9 +54,8 @@ dword LinksArray::GetURL(int id)
void LinksArray::Clear()
{
int i;
for (i=0; i<=count; i++) DeleteButton(i+400);
buflen = #page_links;
page_links.drop();
page_links.realloc_size = 4096 * 32;
count = 0;
active = -1;
CursorPointer.Restore();

View File

@ -8,7 +8,7 @@
#endif
//libraries
#define MEMSIZE 4096 * 256
#define MEMSIZE 4096 * 200
#include "..\lib\gui.h"
#include "..\lib\draw_buf.h"
#include "..\lib\list_box.h"
@ -30,7 +30,7 @@
char homepage[] = FROM "html\\homepage.htm""\0";
#ifdef LANG_RUS
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.53";
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.55";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
@ -43,7 +43,7 @@ char rmb_menu[] =
Žç¨áâ¨âì ªíè ª à⨭®ª
Œ¥­¥¤¦¥à § £à㧮ª";
#else
char version[]="Text-based Browser 1.53";
char version[]="Text-based Browser 1.55";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>";
@ -212,10 +212,11 @@ void main()
$stosb;
} while (AL != 0) && (AL != 13) && (AL != 10);
DSBYTE[EDI-1]='\0';
if (!strcmp(#URL,"https://"))
if (!strncmp(#URL,"https://",8))
{
notify("HTTPS protocol is not supported yet");
StopLoading();
StopLoading();
break;
}
}
}
@ -403,7 +404,8 @@ void SetPageDefaults()
cur_encoding = CH_NULL;
if (o_bufpointer) o_bufpointer = free(o_bufpointer);
anchor_line_num=WB1.list.first;
anchor[0]='|';
//anchor[0]='|';
anchor=NULL;
}
void OpenPage()

View File

@ -38,6 +38,8 @@ void Downloader()
downloader_opened = 1;
SetEventMask(0x27);
filepath[0] = NULL;
downloader.Stop();
if (downloader_edit[0]) StartDownloading(); else strcpy(#downloader_edit, "http://");
ed.size = ed.pos = ed.shift = ed.shift_old = strlen(#downloader_edit);
@ -116,7 +118,7 @@ void Key_Scan(int id)
if (id==301) && (downloader.http_transfer <= 0) StartDownloading();
if (id==302) StopDownloading();
if (id==305) RunProgram("/sys/File managers/Eolite", #save_to);
if (id==306) RunProgram("@open", #filepath);
if (id==306) RunProgram("/sys/@open", #filepath);
}
void DL_Draw_Window()

View File

@ -63,7 +63,7 @@ void collection::drop() {
= =
========================================================*/
struct collection_int
:struct collection_int
{
int count;
dword element[4096*3];
@ -72,19 +72,19 @@ struct collection_int
void drop();
};
int collection_int::add(dword in) {
:int collection_int::add(dword in) {
if (count >= 4096*3) return 0;
element[count] = in;
count++;
return 1;
}
dword collection_int::get(dword pos) {
:dword collection_int::get(dword pos) {
if (pos<0) || (pos>=count) return 0;
return element[pos];
}
void collection_int::drop() {
:void collection_int::drop() {
element[0] =
count = 0;
}

View File

@ -518,10 +518,10 @@ inline fastcall dword GetStartTime()
:struct obj
{
dword x,y,w,h;
void size();
void set_size();
};
:void obj::size(dword _x, _y, _w, _h)
:void obj::set_size(dword _x, _y, _w, _h)
{
x=_x;
y=_y;