WebView 1.61: fix of downloading timeout, ultimate speedup; thanks hidnplayr for idea use event EVN_STACK instead of timeout

git-svn-id: svn://kolibrios.org@6978 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2017-09-17 01:32:09 +00:00
parent 1c6bb84e7f
commit ad6c634152
4 changed files with 202 additions and 181 deletions

View File

@ -1,6 +1,6 @@
//HTML Viewer in C-- //HTML Viewer in C--
//Copyright 2007-2013 by Veliant & Leency //Copyright 2007-2017 by Veliant & Leency
//Asper, lev, Lrz, Barsuk, Nable... //Asper, lev, Lrz, Barsuk, Nable, hidnplayr...
#ifndef AUTOBUILD #ifndef AUTOBUILD
#include "lang.h--" #include "lang.h--"
@ -30,7 +30,7 @@
char homepage[] = FROM "html\\homepage.htm""\0"; char homepage[] = FROM "html\\homepage.htm""\0";
#ifdef LANG_RUS #ifdef LANG_RUS
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.6"; char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.61";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­" ?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤" ?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>"; char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
@ -43,7 +43,7 @@ char rmb_menu[] =
Žç¨áâ¨âì ªíè ª à⨭®ª Žç¨áâ¨âì ªíè ª à⨭®ª
Œ¥­¥¤¦¥à § £à㧮ª"; Œ¥­¥¤¦¥à § £à㧮ª";
#else #else
char version[]="Text-based Browser 1.6"; char version[]="Text-based Browser 1.61";
?define IMAGES_CACHE_CLEARED "Images cache cleared" ?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last" ?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>"; char loading[] = "Loading...<br>";
@ -126,12 +126,10 @@ void main()
if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME); if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME);
WB1.list.SetFont(8, 14, 10011000b); WB1.list.SetFont(8, 14, 10011000b);
WB1.list.no_selection = true; WB1.list.no_selection = true;
SetEventMask(0xa7); SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK);
BEGIN_LOOP_APPLICATION: loop() switch(WaitEvent())
WaitEventTimeout(2);
switch(EAX & 0xFF)
{ {
CASE evMouse: case evMouse:
if (!CheckActiveProcess(Form.ID)) break; if (!CheckActiveProcess(Form.ID)) break;
edit_box_mouse stdcall (#address_box); edit_box_mouse stdcall (#address_box);
mouse.get(); mouse.get();
@ -259,7 +257,6 @@ void main()
} }
} }
} }
goto BEGIN_LOOP_APPLICATION;
} }
void SetElementSizes() void SetElementSizes()

View File

@ -39,7 +39,7 @@ void Downloader()
int key, i; int key, i;
char notify_message[4296]; char notify_message[4296];
downloader_opened = 1; downloader_opened = 1;
SetEventMask(0x27); SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK);
system.color.get(); system.color.get();
pb.frame_color = system.color.work_dark; pb.frame_color = system.color.work_dark;
@ -50,12 +50,9 @@ void Downloader()
if (downloader_edit[0]) StartDownloading(); else strcpy(#downloader_edit, "http://"); if (downloader_edit[0]) StartDownloading(); else strcpy(#downloader_edit, "http://");
ed.size = ed.pos = ed.shift = ed.shift_old = strlen(#downloader_edit); ed.size = ed.pos = ed.shift = ed.shift_old = strlen(#downloader_edit);
loop() loop() switch(WaitEvent())
{ {
WaitEventTimeout(30); case evMouse:
switch(EAX & 0xFF)
{
CASE evMouse:
if (!CheckActiveProcess(DL_Form.ID)) break; if (!CheckActiveProcess(DL_Form.ID)) break;
edit_box_mouse stdcall (#ed); edit_box_mouse stdcall (#ed);
break; break;
@ -113,7 +110,6 @@ void Downloader()
break; break;
} }
} }
}
} }
void Key_Scan(int id) void Key_Scan(int id)

View File

@ -36,12 +36,28 @@ char program_path[4096];
#define evReDraw 1 #define evReDraw 1
#define evKey 2 #define evKey 2
#define evButton 3 #define evButton 3
#define evExit 4
#define evDesktop 5 #define evDesktop 5
#define evMouse 6 #define evMouse 6
#define evIPC 7 #define evIPC 7
#define evNetwork 8 #define evNetwork 8
#define evDebug 9 #define evDebug 9
//Event mask bits for function 40
#define EVM_REDRAW 1b
#define EVM_KEY 10b
#define EVM_BUTTON 100b
#define EVM_EXIT 1000b
#define EVM_BACKGROUND 10000b
#define EVM_MOUSE 100000b
#define EVM_IPC 1000000b
#define EVM_STACK 10000000b
#define EVM_DEBUG 100000000b
#define EVM_STACK2 1000000000b
#define EVM_MOUSE_FILTER 0x80000000
#define EVM_CURSOR_FILTER 0x40000000
//Button options //Button options
#define BT_DEL 0x80000000 #define BT_DEL 0x80000000
#define BT_HIDE 0x40000000 #define BT_HIDE 0x40000000
@ -92,7 +108,7 @@ inline fastcall dword WaitEventTimeout(EBX)
$int 0x40 $int 0x40
} }
inline fastcall SetEventMask(EBX) inline fastcall dword SetEventMask(EBX)
{ {
$mov eax,40 $mov eax,40
$int 0x40 $int 0x40

View File

@ -121,4 +121,16 @@ dword load_image(dword filename)
return 0; return 0;
} }
void DrawLibImage(dword image_pointer,x,y,w,h,offx,offy) {
img_draw stdcall (
image_pointer,
x,
y,
w,
h,
offx,
offy
);
}
#endif #endif