HTMLv 0.94b: general code update #2

git-svn-id: svn://kolibrios.org@2811 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2012-06-20 19:58:55 +00:00
parent e50cde95f6
commit 424ffe7057
16 changed files with 181 additions and 124 deletions

View File

@ -3,17 +3,17 @@
//Asper, lev, Lrz, Barsuk, Nable. //Asper, lev, Lrz, Barsuk, Nable.
//home icon - rachel fu, GPL licence //home icon - rachel fu, GPL licence
#include "..\lib\kolibri.h--" #include "..\lib\kolibri.h"
#include "..\lib\encoding.h--" #include "..\lib\encoding.h"
#include "..\lib\file_system.h--" #include "..\lib\file_system.h"
#include "img\toolbar_icons.c" #include "img\toolbar_icons.c"
#include "img\URLgoto.txt"; #include "img\URLgoto.txt";
#include "..\lib\mem.h--" #include "..\lib\mem.h"
#include "..\lib\libio_lib.h--" #include "..\lib\libio_lib.h"
#include "..\lib\libimg_lib.h--" #include "..\lib\libimg_lib.h"
#include "..\lib\edit_box_lib.h--" #include "..\lib\edit_box_lib.h"
#include "..\lib\dll.h--" #include "..\lib\dll.h"
#include "..\lib\scroll_bar\scroll_lib.h--" #include "..\lib\scroll_bar\scroll_lib.h"
//ïåðåìåííûå //ïåðåìåííûå
char URL[4096], char URL[4096],
@ -21,12 +21,11 @@ char URL[4096],
page_links[12000], page_links[12000],
header[512]; header[512];
int lines_visible, struct lines{
lines_all, int visible, all, first, column_max;
lines_first, };
lines_column_max,
mouse_dd;
int mouse_dd;
edit_box edit1= {250,207,16,0xffffff,0x94AECE,0xffffff,0xffffff,0,248,#editURL,#mouse_dd,2,19,19}; edit_box edit1= {250,207,16,0xffffff,0x94AECE,0xffffff,0xffffff,0,248,#editURL,#mouse_dd,2,19,19};
scroll_bar scroll1 = { 18,200,398, 44,18,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; //details in scroll_lib.h-- scroll_bar scroll1 = { 18,200,398, 44,18,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; //details in scroll_lib.h--
@ -54,7 +53,7 @@ void main()
else strcpy(#URL, "/sys/index.htm"); else strcpy(#URL, "/sys/index.htm");
strcpy(#editURL, #URL); strcpy(#editURL, #URL);
OpenPage(); WB1.OpenPage();
SetEventMask(0x27); SetEventMask(0x27);
loop() loop()
@ -64,9 +63,9 @@ void main()
{ {
CASE evMouse: CASE evMouse:
/*scrollbar_v_mouse (#scroll1); //êîí÷åíûé ñêðîëë ïðèòîðìàæèìàåò, èä¸ì "ñâîèì ïóò¸ì" /*scrollbar_v_mouse (#scroll1); //êîí÷åíûé ñêðîëë ïðèòîðìàæèìàåò, èä¸ì "ñâîèì ïóò¸ì"
if (lines_first <> scroll1.position) if (lines.first <> scroll1.position)
{ {
lines_first = scroll1.position; lines.first = scroll1.position;
WB1.ParseHTML(buf, filesize); WB1.ParseHTML(buf, filesize);
//break; //break;
};*/ };*/
@ -85,32 +84,32 @@ void main()
IF (m.vert==65535) //ïðîêðóòêà êîë¸ñèêîì IF (m.vert==65535) //ïðîêðóòêà êîë¸ñèêîì
{ {
IF (lines_first==0) break; IF (lines.first==0) break;
IF (lines_first>3) lines_first-=2; ELSE lines_first=1; IF (lines.first>3) lines.first-=2; ELSE lines.first=1;
WB1.Scan(ID1); WB1.Scan(ID1);
break; break;
} }
IF (m.vert==1) IF (m.vert==1)
{ {
IF(lines_visible+lines_first+3>=lines_all) WB1.Scan(181); IF(lines.visible+lines.first+3>=lines.all) WB1.Scan(181);
ELSE { ELSE {
lines_first+=2; lines.first+=2;
WB1.Scan(ID2); WB1.Scan(ID2);
} }
break; break;
} }
IF (lines_all<lines_visible) break; IF (lines.all<lines.visible) break;
half_scroll_size = WB1.height - 16 * lines_visible / lines_all - 3 /2; half_scroll_size = WB1.height - 16 * lines.visible / lines.all - 3 /2;
if (m.x>=WB1.width-14) && (m.x<=WB1.width+6) if (m.x>=WB1.width-14) && (m.x<=WB1.width+6)
&& (m.y>WB1.top+16) && (m.y<WB1.top+WB1.height-16) && (m.y>WB1.top+16) && (m.y<WB1.top+WB1.height-16)
&& (lines_all>lines_visible) while (m.lkm) && (lines.all>lines.visible) while (m.lkm)
{ {
IF (half_scroll_size/2+WB1.top>m.y) || (m.y<0) || (m.y>4000) m.y=half_scroll_size/2+WB1.top; //åñëè êóðñîð íàä îêíîì IF (half_scroll_size/2+WB1.top>m.y) || (m.y<0) || (m.y>4000) m.y=half_scroll_size/2+WB1.top; //åñëè êóðñîð íàä îêíîì
btn=lines_first; //ñîõðàíÿåì ñòàðîå êîëè÷åñòâî btn=lines.first; //ñîõðàíÿåì ñòàðîå êîëè÷åñòâî
lines_first = m.y -half_scroll_size -WB1.top * lines_all / WB1.height; lines.first = m.y -half_scroll_size -WB1.top * lines.all / WB1.height;
IF (lines_visible+lines_first>lines_all) lines_first=lines_all-lines_visible; IF (lines.visible+lines.first>lines.all) lines.first=lines.all-lines.visible;
IF (btn<>lines_first) WB1.ParseHTML(buf, filesize); //÷òîá ëèøíèé ðàç íå ïåðåðèñîâûâàòü IF (btn<>lines.first) WB1.ParseHTML(buf, filesize); //÷òîá ëèøíèé ðàç íå ïåðåðèñîâûâàòü
m.get(); m.get();
} }
@ -146,9 +145,8 @@ void main()
{ {
if (GetProcessSlot(downloader_id)<>0) break; if (GetProcessSlot(downloader_id)<>0) break;
downloader_id=0; downloader_id=0;
lines_first = lines_all = 0; lines.first = lines.all = 0;
ReadHtml(); WB1.ReadHtml(_WIN);
if (filesize) wintodos(buf);
Draw_Window(); Draw_Window();
} }
} }
@ -187,10 +185,10 @@ void Draw_Window()
WB1.top=44; WB1.top=44;
WB1.width=Form.width-13; WB1.width=Form.width-13;
WB1.height=onTop(43,5); WB1.height=onTop(43,5);
lines_column_max = WB1.width - 30 / 6; lines.column_max = WB1.width - 30 / 6;
lines_visible = WB1.height - 3 / 10 - 2; lines.visible = WB1.height - 3 / 10 - 2;
WB1.ShowPage(#URL); WB1.ShowPage();
} }
int onLeft(dword right,left) {return Form.width-right-left;} int onLeft(dword right,left) {return Form.width-right-left;}

View File

@ -5,20 +5,22 @@ dword
buf, buf,
filesize, filesize,
blink; blink;
int i; int i;
char download_path[]="/rd/1/.download"; char download_path[]="/rd/1/.download";
char search_path[]="http://nigma.ru/index.php?s="; char search_path[]="http://nigma.ru/index.php?s=";
char version[]=" Text-based Browser 0.94"; char version[]=" Text-based Browser 0.94b";
struct TWebBrowser { struct TWebBrowser {
int left, top, width, height; int left, top, width, height;
void DrawScroller(); void Scan(int);
void OpenPage();
void ReadHtml(byte);
void ShowPage(); void ShowPage();
void ParseHTML(dword, dword); void ParseHTML(dword, dword);
void Scan(int);
void WhatTextStyle(int left1, top1, width1); void WhatTextStyle(int left1, top1, width1);
void DrawScroller();
}; };
TWebBrowser WB1; TWebBrowser WB1;
@ -64,8 +66,8 @@ void TWebBrowser::Scan(int id)
strcpy(#URL, BrowserHistory.CurrentUrl()); strcpy(#URL, BrowserHistory.CurrentUrl());
lines_first=lines_all-lines_visible; lines.first=lines.all-lines.visible;
ShowPage(#URL); ShowPage();
return; return;
} }
//liner.ru#1 //liner.ru#1
@ -88,18 +90,16 @@ void TWebBrowser::Scan(int id)
return; return;
} }
IF(lines_all < lines_visible) SWITCH(id) //åñëè ìàëî ñòðîê èãíîðèðóåì íåêîòîðûå êíîïêè IF(lines.all < lines.visible) SWITCH(id) //åñëè ìàëî ñòðîê èãíîðèðóåì íåêîòîðûå êíîïêè
{ CASE 183: CASE 184: CASE 180: CASE 181: return; } { CASE 183: CASE 184: CASE 180: CASE 181: return; }
switch (id) switch (id)
{ {
case 011: //Ctrk+K case 011: //Ctrk+K
ReadHtml(); ReadHtml(_KOI);
koitodos(buf);
break; break;
case 021: //Ctrl+U case 021: //Ctrl+U
ReadHtml(); ReadHtml(_UTF);
utf8rutodos(buf);
break; break;
case BACK: case BACK:
if (!BrowserHistory.GoBack()) return; if (!BrowserHistory.GoBack()) return;
@ -125,7 +125,7 @@ void TWebBrowser::Scan(int id)
Draw_Window(); Draw_Window();
return; return;
} }
anchor_line_num=lines_first; //âåñ¸ëûé êîñòûëü :Ð anchor_line_num=lines.first; //âåñ¸ëûé êîñòûëü :Ð
anchor[0]='|'; anchor[0]='|';
OpenPage(); OpenPage();
return; return;
@ -151,30 +151,30 @@ void TWebBrowser::Scan(int id)
return; return;
case ID1: //ìîòàåì ââåðõ case ID1: //ìîòàåì ââåðõ
IF(lines_first <= 0) return; IF(lines.first <= 0) return;
lines_first--; lines.first--;
break; break;
case ID2: //ìîòàåì âíèç case ID2: //ìîòàåì âíèç
IF(lines_visible + lines_first >= lines_all) return; IF(lines.visible + lines.first >= lines.all) return;
lines_first++; lines.first++;
break; break;
case 183: //PgDown case 183: //PgDown
IF(lines_first == lines_all - lines_visible) return; IF(lines.first == lines.all - lines.visible) return;
lines_first += lines_visible + 2; lines.first += lines.visible + 2;
IF(lines_visible + lines_first > lines_all) lines_first = lines_all - lines_visible; IF(lines.visible + lines.first > lines.all) lines.first = lines.all - lines.visible;
BREAK; BREAK;
case 184: //PgUp case 184: //PgUp
IF(lines_first == 0) RETURN; IF(lines.first == 0) RETURN;
lines_first -= lines_visible - 2; lines.first -= lines.visible - 2;
IF(lines_first < 0) lines_first = 0; IF(lines.first < 0) lines.first = 0;
BREAK; BREAK;
case 180: //home case 180: //home
IF(lines_first == 0) RETURN; IF(lines.first == 0) RETURN;
lines_first = 0; lines.first = 0;
BREAK; BREAK;
case 181: //end case 181: //end
IF (lines_first == lines_all - lines_visible) RETURN; IF (lines.first == lines.all - lines.visible) RETURN;
lines_first = lines_all - lines_visible; lines.first = lines.all - lines.visible;
BREAK; BREAK;
default: default:
RETURN; RETURN;
@ -214,7 +214,7 @@ void GetNewUrl(){
void ReadHtml() void TWebBrowser::ReadHtml(byte dest)
{ {
if (!strcmp(get_URL_part(5),"http:"))) if (!strcmp(get_URL_part(5),"http:")))
file_size stdcall (#download_path); file_size stdcall (#download_path);
@ -230,10 +230,14 @@ void ReadHtml()
ReadFile(0, filesize, buf, #download_path); ReadFile(0, filesize, buf, #download_path);
else else
ReadFile(0, filesize, buf, #URL); ReadFile(0, filesize, buf, #URL);
if (dest==_WIN) wintodos(buf);
if (dest==_UTF) utf8rutodos(buf);
if (dest==_KOI) koitodos(buf);
} }
void OpenPage() void TWebBrowser::OpenPage()
{ {
if (GetProcessSlot(downloader_id)<>0) PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal); if (GetProcessSlot(downloader_id)<>0) PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
KillProcess(downloader_id); KillProcess(downloader_id);
@ -258,14 +262,13 @@ void OpenPage()
Draw_Window(); Draw_Window();
return; return;
} }
lines_first = lines_all = 0; lines.first = lines.all = 0;
ReadHtml(); ReadHtml(_WIN);
if (filesize) wintodos(buf); WB1.ShowPage();
WB1.ShowPage(#URL);
} }
void TWebBrowser::ShowPage(dword adress) void TWebBrowser::ShowPage()
{ {
edit1.size = edit1.pos = strlen(#editURL); edit1.size = edit1.pos = strlen(#editURL);
edit_box_draw stdcall(#edit1); //ðèñóåì ñòðîêó àäðåñà edit_box_draw stdcall(#edit1); //ðèñóåì ñòðîêó àäðåñà
@ -295,7 +298,7 @@ void TWebBrowser::ParseHTML(dword bword, fsize){
byte ignor_param = 0; byte ignor_param = 0;
char temp[768]; char temp[768];
stroka = -lines_first; stroka = -lines.first;
stolbec = 0; stolbec = 0;
for (j = 400; j < blink + 1; j++;) DeleteButton(j); for (j = 400; j < blink + 1; j++;) DeleteButton(j);
@ -420,12 +423,12 @@ void TWebBrowser::ParseHTML(dword bword, fsize){
IF(ignor_text) break; IF(ignor_text) break;
IF(!pre_text) && (bukva == ' ') && (!strcmp(#line + strlen(#line) - 1, " ")) continue; IF(!pre_text) && (bukva == ' ') && (!strcmp(#line + strlen(#line) - 1, " ")) continue;
// //
if (stolbec + strlen(#line) >lines_column_max) if (stolbec + strlen(#line) >lines.column_max)
{ {
strcpy(#temp, #line + find_symbol(#line, ' ')); //ïåðåíîñ ïî ñëîâàì strcpy(#temp, #line + find_symbol(#line, ' ')); //ïåðåíîñ ïî ñëîâàì
line[find_symbol(#line, ' ')] = 0x00; line[find_symbol(#line, ' ')] = 0x00;
NEXT_MARK: NEXT_MARK:
IF(stroka - 1 > lines_visible) && (lines_first <>0) break 1; //óõîäèì... IF(stroka - 1 > lines.visible) && (lines.first <>0) break 1; //óõîäèì...
WhatTextStyle(left + 5, stroka * 10 + top + 5, width - 20); //âûâîä ñòðîêè WhatTextStyle(left + 5, stroka * 10 + top + 5, width - 20); //âûâîä ñòðîêè
TextGoDown(left + 5, stroka * 10 + top + 5, width - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó TextGoDown(left + 5, stroka * 10 + top + 5, width - 20); //çàêðàøèâàåì ñëåäóùóþ ñòðîêó
strcpy(#line, #temp); strcpy(#line, #temp);
@ -437,16 +440,16 @@ void TWebBrowser::ParseHTML(dword bword, fsize){
if (strcmp(#URL + strlen(#URL) - 4, ".txt")<>0) && (!body_present) if (strcmp(#URL + strlen(#URL) - 4, ".txt")<>0) && (!body_present)
DrawBar(left, top, width-15, 15, bg_color); //çàêðàøèâàåì ïåðâóþ ñòðîêó åñëè êàêîé-òî ðàõèò íå ñîçäàë òåã áîäè DrawBar(left, top, width-15, 15, bg_color); //çàêðàøèâàåì ïåðâóþ ñòðîêó åñëè êàêîé-òî ðàõèò íå ñîçäàë òåã áîäè
if (lines_visible * 10 + 25 <= height) if (lines.visible * 10 + 25 <= height)
DrawBar(left, lines_visible * 10 + top + 25, width - 15, -lines_visible * 10 + height - 25, bg_color); DrawBar(left, lines.visible * 10 + top + 25, width - 15, -lines.visible * 10 + height - 25, bg_color);
if (stroka * 10 + 15 <= height) if (stroka * 10 + 15 <= height)
DrawBar(left, stroka * 10 + top + 15, width - 15, -stroka * 10 + height - 15, bg_color); //çàêðàøèâàåì âñ¸ äî êîíöà DrawBar(left, stroka * 10 + top + 15, width - 15, -stroka * 10 + height - 15, bg_color); //çàêðàøèâàåì âñ¸ äî êîíöà
if (lines_first == 0) lines_all = stroka; if (lines.first == 0) lines.all = stroka;
if (anchor) if (anchor)
{ {
anchor=''; anchor='';
lines_first=anchor_line_num; lines.first=anchor_line_num;
ParseHTML(buf, filesize); ParseHTML(buf, filesize);
} }
@ -536,7 +539,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
IF(!chTag("q")) strcat(#line, "\""); IF(!chTag("q")) strcat(#line, "\"");
//âûâîä íà ýêðàí //âûâîä íà ýêðàí
if (stroka >= 0) && (stroka - 2 < lines_visible) && (line) && (!anchor) if (stroka >= 0) && (stroka - 2 < lines.visible) && (line) && (!anchor)
{ {
WriteText(stolbec * 6 + left1, top1, 0x80, text_colors[text_color_index], #line, 0); //ìîæåò òóò ðèñîâàòü áåëóþ ñòðîêó? WriteText(stolbec * 6 + left1, top1, 0x80, text_colors[text_color_index], #line, 0); //ìîæåò òóò ðèñîâàòü áåëóþ ñòðîêó?
IF (b_text) { $add ebx, 1<<16 $int 0x40 } IF (b_text) { $add ebx, 1<<16 $int 0x40 }
@ -556,7 +559,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
{ {
if (!strcmp(#anchor, #options)) if (!strcmp(#anchor, #options))
{ {
anchor_line_num=lines_first+stroka; anchor_line_num=lines.first+stroka;
} }
} }
@ -595,7 +598,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
_A_MARK: _A_MARK:
if (!strcmp(#parametr, "href=")) if (!strcmp(#parametr, "href="))
{ {
if (stroka - 1 > lines_visible) || (stroka < -2) return; if (stroka - 1 > lines.visible) || (stroka < -2) return;
if (link == 1) text_color_index--; //åñëè êàêîé-òî äîëáî¸á íå çàêðûë òýã if (link == 1) text_color_index--; //åñëè êàêîé-òî äîëáî¸á íå çàêðûë òýã
link = 1; link = 1;
blink++; blink++;
@ -608,7 +611,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
{ {
if (!strcmp(#anchor, #options)) if (!strcmp(#anchor, #options))
{ {
anchor_line_num=lines_first+stroka; anchor_line_num=lines.first+stroka;
} }
} }
if (tagparam) if (tagparam)
@ -626,7 +629,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
///////////////////////// /////////////////////////
if (!chTag("font")) if (!chTag("font"))
{ {
IF (stroka - 1 > lines_visible) return; IF (stroka - 1 > lines.visible) return;
COL_MARK: COL_MARK:
if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#') if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#')
{ {
@ -689,7 +692,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
li_text = rez; li_text = rez;
IF(rez == 0) return; IF(rez == 0) return;
TextGoDown(left1, top1, width1); TextGoDown(left1, top1, width1);
IF(stroka > -1) && (stroka - 2 < lines_visible) DrawBar(li_tab * 5 * 6 + left1 - 5, top1 + 12, 2, 2, 0); IF(stroka > -1) && (stroka - 2 < lines.visible) DrawBar(li_tab * 5 * 6 + left1 - 5, top1 + 12, 2, 2, 0);
return; return;
} }
//////////////////////////// ////////////////////////////
@ -746,7 +749,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
top1=WB1.top; top1=WB1.top;
} }
if (top1>WB1.top+WB1.height-h-15) //åñëè ÷àñòü èçîáðàæåíèÿ ñíèçó IF (stroka - 2 < lines_visible) if (top1>WB1.top+WB1.height-h-15) //åñëè ÷àñòü èçîáðàæåíèÿ ñíèçó IF (stroka - 2 < lines.visible)
{ {
h=WB1.top+WB1.height-top1-15; h=WB1.top+WB1.height-top1-15;
} }
@ -775,20 +778,9 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
{ {
strcpy(#options, #options[find_symbol(#options, '=')]); //ïîèñê â content= strcpy(#options, #options[find_symbol(#options, '=')]); //ïîèñê â content=
IF (!strcmp(#options,"utf-8")) || (!strcmp(#options,"utf8")) if (!strcmp(#options,"utf-8")) || (!strcmp(#options,"utf8")) ReadHtml(_UTF);
{ if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) ReadHtml(_KOI);
ReadHtml(); if (!strcmp(#options, "dos")) || (!strcmp(#options, "cp-866")) ReadHtml(_DOS);
utf8rutodos(buf);
}
IF(!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u"))
{
ReadHtml();
koitodos(buf);
}
IF(!strcmp(#options, "dos")) || (!strcmp(#options, "cp-866"))
{
ReadHtml();
}
} }
if (tagparam) if (tagparam)
{ {
@ -806,16 +798,16 @@ void TextGoDown(int left1, top1, width1)
IF(blq_text == 1) stolbec = 8; IF(blq_text == 1) stolbec = 8;
ELSE stolbec = 0; ELSE stolbec = 0;
IF(li_text == 1) stolbec = li_tab * 5; IF(li_text == 1) stolbec = li_tab * 5;
IF(stroka >= 0) && (stroka - 2 < lines_visible) && (!anchor) DrawBar(left1 - 5, top1 + 10, width1 + 5, 10, bg_color); IF(stroka >= 0) && (stroka - 2 < lines.visible) && (!anchor) DrawBar(left1 - 5, top1 + 10, width1 + 5, 10, bg_color);
} }
//ñêðîëë //ñêðîëë
void TWebBrowser::DrawScroller() //íå îïòèìàëüíàÿ îòðèñîâêà, íî çàòî â îäíîì ìåñòå void TWebBrowser::DrawScroller() //íå îïòèìàëüíàÿ îòðèñîâêà, íî çàòî â îäíîì ìåñòå
{ {
scroll1.max_area = lines_all; scroll1.max_area = lines.all;
scroll1.cur_area = lines_visible; scroll1.cur_area = lines.visible;
scroll1.position = lines_first; scroll1.position = lines.first;
scroll1.all_redraw=1; scroll1.all_redraw=1;
scroll1.start_x=Form.width-28; //left + width - 15 scroll1.start_x=Form.width-28; //left + width - 15

View File

@ -1,6 +1,6 @@
..\C--\c-- HTMLv.c-- ..\C--\c-- HTMLv.c
del HTMLv del HTMLv
rename HTMLv.com HTMLv rename HTMLv.com HTMLv
rem ..\C--\kpack HTMLv rem ..\C--\kpack HTMLv
del warning.txt
pause pause
del warning.txt

View File

@ -9,10 +9,10 @@
#define ID1 178 #define ID1 178
#define ID2 177 #define ID2 177
#define WINDOWS 0 #define _WIN 0
#define DOS 1 #define _DOS 1
#define KOI 2 #define _KOI 2
#define UTF 3 #define _UTF 3
dword get_URL_part(byte len) { dword get_URL_part(byte len) {

View File

@ -20,14 +20,15 @@ char program_path[4096];
#define evKey 2 #define evKey 2
#define evReDraw 1 #define evReDraw 1
#define OLD -1
#define true 1
#define false 0
//Button options //Button options
#define BT_DEL 0x80000000 #define BT_DEL 0x80000000
#define BT_HIDE 0x40000000 #define BT_HIDE 0x40000000
#define BT_NOFRAME 0x20000000 #define BT_NOFRAME 0x20000000
#define OLD -1
#define true 1
#define false 0
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
struct mouse struct mouse

View File

@ -0,0 +1,66 @@
#code32 TRUE
inline fastcall dword malloc(dword ECX){
dword size, heap;
#speed
size = ECX;
EAX = 68;
EBX = 11;
$int 0x40;
heap = EAX;
IF (size<=heap)
{
EAX = 68;
EBX = 12;
ECX = size;
$int 0x40;
}
ELSE EAX=-1;
#codesize
}
inline fastcall dword free(dword ECX){
#speed
EAX = 68;
EBX = 13;
$int 0x40;
#codesize
}
inline fastcall dword realloc(dword ECX, EDX){
#speed
EAX = 68;
EBX = 20;
$int 0x40;
#codesize
}
inline fastcall memmov( EDI, ESI, ECX)
{
asm {
MOV EAX, ECX
CMP EDI, ESI
JG L1
JE L2
SAR ECX, 2
JS L2
REP MOVSD
MOV ECX, EAX
AND ECX, 3
REP MOVSB
JMP SHORT L2
L1: LEA ESI, DSDWORD[ ESI+ECX-4]
LEA EDI, DSDWORD[ EDI+ECX-4]
SAR ECX, 2
JS L2
STD
REP MOVSD
MOV ECX, EAX
AND ECX, 3
ADD ESI, 3
ADD EDI, 3
REP MOVSB
CLD
L2:
}
}