htmlv 0.68c: improvements and fixes in showing images, some optimizations

git-svn-id: svn://kolibrios.org@2155 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2011-09-05 09:18:16 +00:00
parent 1804fc6d05
commit 69abfe5c20
4 changed files with 33 additions and 17 deletions

View File

@ -127,9 +127,9 @@ void Draw_Window()
}
IF (Form.height<120) MoveSize(OLD,OLD,OLD,120);
IF (Form.width<280) MoveSize(OLD,OLD,280,OLD);
//
PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
DrawBar(200,0,onLeft(200,9),43,0xE4DFE1); //çàêðàøèâàåì ôîí ïîä òóëáàðîì
PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
DrawBar(200,0,onLeft(200,9),43,0xE4DFE1); //çàêðàøèâàåì ôîí ïîä òóëáàðîì
DrawBar(0,42,onLeft(5,4),1,0xE2DBDC); //âûïóêëîñòü
DrawBar(0,43,onLeft(5,4),1,0xD2CED0); //âûïóêëîñòü
FOR (j=0; j<5; j++) DefineButton(j*37+11, 7, 29, 29, 300+j+BT_HIDE, 0x00E4DFE1);
@ -143,7 +143,7 @@ void Draw_Window()
WB1.width=Form.width-11;
WB1.height=onTop(43,5);
WB1.Load(#URL);
//
WindowRedrawStatus(2);
}

View File

@ -1,8 +1,10 @@
04.09.11 -- v0.68 -- 11.1 Кб
05.09.11 -- v0.68 -- 11.2 Кб
- устранён вылет программы при неправильном параметре color тега <font> - алсо
иногда действительно полезно читать маны;
- memory.h-- удалён как старый дубликат, все функции работы с памятью отныне
используют mem.h--, написанный Asper'ом.
используют mem.h--, написанный Asper'ом;
- изображения теперь вписываются в окно по ширине;
- устранён частый вылет программы при прокрутке страницы, содержащей изображения.
20.08.11 -- v0.67 -- 11.1 Кб
- более адекватная прокрутка изображений;

View File

@ -7,6 +7,7 @@
//wintodos(buf); -> â ïàðñå õòìë êàê è âñå êîäèðîâêè
//ol - öèôåðêè
int downloader_id;
dword j,
buf,
@ -179,13 +180,14 @@ void ReadHtml(byte DO_LOAD)
buf = mem_Alloc(1048576);
IF (!strcmp(get_URL_part(5),"http:")))
if (!strcmp(get_URL_part(5),"http:")))
{
IF (DO_LOAD) && (!WindowRePaint)
{
DeleteFile(#download_path);
IF (URL[strlen(#URL)-1]=='/') URL[strlen(#URL)-1]='';
RunProgram("/sys/network/downloader", #URL);
downloader_id = RunProgram("/sys/network/downloader", #URL);
IF (downloader_id<0) RunProgram("@notify", "Error running Downloader. Internet unavilable.");
RETURN;
}
ReadFile(0, 1048576, buf, #download_path);
@ -281,8 +283,6 @@ int stroka,
byte ignor_param = 0;
byte rtf_text;
void TWebBrowser::ParseHTML(dword bword, fsize){
word bukva[1];
char temp[768];
@ -657,6 +657,8 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
GOTO IMG_TAG;
}
if (w>width1) w=width1;
if (image)
{
stroka+=h/10;
@ -676,23 +678,32 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
//WriteDebug(IntToStr(WB1.top));
//WriteDebug(IntToStr(h));
h=WB1.top+WB1.height-top1-10;
}
}
//WriteDebug(IntToStr(h));
//Pause(10);
IF (h<=0) return;
img_draw stdcall (image,left1-5,top1+10,w, h,0,0);
//WriteDebug("Good");
DrawBar(left1+w - 5, top1 + 10, width1-w + 5, h, 0xFFFFFF);
}
return;
}
if (!chTag("meta")) {
if (!chTag("meta"))
{
META:
if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content="))
{
copystr(#options[find_symbol(#options, '=')],#options); //ïîèñê â content=
IF (!strcmp(#options,"utf-8")) || (!strcmp(#options,"utf8"))
IF (!strcmp(#options,"utf-8")) || (!strcmp(#options,"utf8"))
{
ReadHtml(DONT_LOAD);
utf8rutodos(buf);
utf8rutodos(buf);
}
IF(!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u"))
{
@ -704,10 +715,12 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
ReadHtml(DONT_LOAD);
}
}
IF(tagparam[0] <>'') {
IF(tagparam[0] <>'')
{
GetNextParam();
goto META;
}
return;
}
}

View File

@ -51,7 +51,7 @@ dword GetFileInfo(dword file_name)
// Çàïóñê ïğîãğàììû //
///////////////////////////
f70 run_file_70;
void RunProgram(dword run_path, run_param)
int RunProgram(dword run_path, run_param)
{
run_file_70.func = 7;
run_file_70.param1 =
@ -62,7 +62,8 @@ void RunProgram(dword run_path, run_param)
run_file_70.name = run_path;
$mov eax,70
$mov ebx,#run_file_70.func
$int 0x40
$int 0x40
RETURN EAX;
}
///////////////////////////