HTMLv 0.94u: fixed bug with colors and crash with <i> tag, improvements in menu and strings.h

git-svn-id: svn://kolibrios.org@2839 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2012-07-02 18:24:48 +00:00
parent d51745da57
commit c96f15b38e
12 changed files with 209 additions and 98 deletions

View File

@ -9,7 +9,7 @@ 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.94e"; char version[]=" Text-based Browser 0.94u";
struct TWebBrowser { struct TWebBrowser {
@ -30,7 +30,7 @@ byte rez, b_text, i_text, u_text, s_text, pre_text, blq_text, li_text,
link, ignor_text, li_tab, first_line_drawed; link, ignor_text, li_tab, first_line_drawed;
dword text_colors[30], dword text_colors[300],
text_color_index, text_color_index,
link_color, link_color,
bg_color; bg_color;
@ -39,15 +39,15 @@ int stroka,
stolbec, stolbec,
tab_len; tab_len;
char anchor[256];
int anchor_line_num;
char line[500], char line[500],
tag[100], tag[100],
tagparam[10000], tagparam[10000],
parametr[1200], parametr[1200],
options[1000]; options[1000];
char anchor[256];
int anchor_line_num;
#include "include\history.h" #include "include\history.h"
#include "include\colors.h" #include "include\colors.h"
@ -65,7 +65,7 @@ void TWebBrowser::Scan(int id)
//#1 //#1
if (URL[0] == '#') if (URL[0] == '#')
{ {
strcpy(#anchor, #URL+find_symbol(#URL, '#')); strcpy(#anchor, #URL+strrchr(#URL, '#'));
strcpy(#URL, BrowserHistory.CurrentUrl()); strcpy(#URL, BrowserHistory.CurrentUrl());
@ -74,10 +74,10 @@ void TWebBrowser::Scan(int id)
return; return;
} }
//liner.ru#1 //liner.ru#1
if (find_symbol(#URL, '#')<>-1) if (strrchr(#URL, '#')<>-1)
{ {
strcpy(#anchor, #URL+find_symbol(#URL, '#')); strcpy(#anchor, #URL+strrchr(#URL, '#'));
URL[find_symbol(#URL, '#')-1] = 0x00; //çàãëóøêà URL[strrchr(#URL, '#')-1] = 0x00; //çàãëóøêà
} }
GetNewUrl(); GetNewUrl();
@ -197,15 +197,15 @@ void TWebBrowser::GetNewUrl(){
_CUT_ST_LEVEL_MARK: _CUT_ST_LEVEL_MARK:
if (editURL[find_symbol(#editURL, '/')-2]<>'/') // åñëè íå http://pagename.ua <-- íàõðåíà ýòà ñòðîêà??? if (editURL[strrchr(#editURL, '/')-2]<>'/') // åñëè íå http://pagename.ua <-- íàõðåíà ýòà ñòðîêà???
{ {
editURL[find_symbol(#editURL, '/')] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî / editURL[strrchr(#editURL, '/')] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî /
} }
IF (!strcmp(get_URL_part(3),"../")) //íà óðîâåíü ââåðõ IF (!strcmp(get_URL_part(3),"../")) //íà óðîâåíü ââåðõ
{ {
strcpy(#URL,#URL+3); strcpy(#URL,#URL+3);
editURL[find_symbol(#editURL, '/')-1] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî / editURL[strrchr(#editURL, '/')-1] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî /
goto _CUT_ST_LEVEL_MARK; goto _CUT_ST_LEVEL_MARK;
} }
@ -318,9 +318,7 @@ void TWebBrowser::ParseHTML(dword bword){
if (!strcmp(#URL + strlen(#URL) - 4, ".txt")) pre_text = 1; if (!strcmp(#URL + strlen(#URL) - 4, ".txt")) pre_text = 1;
if (!strcmp(#URL + strlen(#URL) - 4, ".mht")) ignor_text = 1; if (!strcmp(#URL + strlen(#URL) - 4, ".mht")) ignor_text = 1;
#ifdef DEBUG_ON debug("Start parsing");
debug("Start parsing");
#endif
for ( ; buf+filesize > bword; bword++;) {//ESBYTE[bword] for ( ; buf+filesize > bword; bword++;) {//ESBYTE[bword]
bukva = ESBYTE[bword]; bukva = ESBYTE[bword];
@ -438,7 +436,7 @@ void TWebBrowser::ParseHTML(dword bword){
// //
if (stolbec + strlen(#line) > lines.column_max) if (stolbec + strlen(#line) > lines.column_max)
{ {
perenos_num = find_symbol(#line, ' '); perenos_num = strrchr(#line, ' ');
strcpy(#temp, #line + perenos_num); //ïåðåíîñ ïî ñëîâàì strcpy(#temp, #line + perenos_num); //ïåðåíîñ ïî ñëîâàì
line[perenos_num] = 0x00; line[perenos_num] = 0x00;
NEXT_MARK: NEXT_MARK:
@ -465,9 +463,7 @@ void TWebBrowser::ParseHTML(dword bword){
ParseHTML(buf); ParseHTML(buf);
} }
#ifdef DEBUG_ON debug("End parsing");
debug("End parsing");
#endif
DrawScroller(); //ðèñóåì ñêðîëë DrawScroller(); //ðèñóåì ñêðîëë
} }
@ -568,14 +564,16 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
{ {
if (rez) if (rez)
{ {
text_color_index++;
text_colors[text_color_index] = text_colors[text_color_index-1];
_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) && (text_color_index > 0) text_color_index--; //åñëè íå çàêðûò òýã
link = 1; link = 1;
blink++; blink++;
text_color_index++;
text_colors[text_color_index] = link_color; text_colors[text_color_index] = link_color;
strcat(#page_links, #options); strcat(#page_links, #options);
strcat(#page_links, "|"); strcat(#page_links, "|");
@ -602,18 +600,23 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
///////////////////////// /////////////////////////
if (!chTag("font")) if (!chTag("font"))
{ {
IF (stroka - 1 > lines.visible) return; if (rez)
COL_MARK:
if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#')
{ {
text_color_index++; text_color_index++;
text_colors[text_color_index] = GetColor(#options); text_colors[text_color_index] = text_colors[text_color_index-1];
COL_MARK:
if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#')
{
text_colors[text_color_index] = GetColor(#options);
}
IF(tagparam) {
GetNextParam();
GOTO COL_MARK;
}
} }
IF(tagparam) { else
GetNextParam(); if (text_color_index > 0) text_color_index--;
GOTO COL_MARK;
}
IF(!rez) && (text_color_index > 0) text_color_index--;
return; return;
} }
////////////////////////// //////////////////////////
@ -694,18 +697,18 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
if (!strcmp(#parametr,"src=")) //íàäî îáúåäèíèòü ñ GetNewUrl() if (!strcmp(#parametr,"src=")) //íàäî îáúåäèíèòü ñ GetNewUrl()
{ {
strcpy(#temp, BrowserHistory.CurrentUrl()); //äîñòà¸ì àäðåñ òåêóùåé ñòðàíèöû strcpy(#temp, BrowserHistory.CurrentUrl()); //äîñòà¸ì àäðåñ òåêóùåé ñòðàíèöû
temp[find_symbol(#temp, '/')] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî / temp[strrchr(#temp, '/')] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî /
strcat(#temp, #options); strcat(#temp, #options);
image=load_image(#temp); image=load_image(#temp);
w=DSWORD[image+4]; w=DSWORD[image+4];
h=DSWORD[image+8]; h=DSWORD[image+8];
} }
if (!strcmp(#parametr,"alt=")) /*if (!strcmp(#parametr,"alt="))
{ {
strcpy(#tag, "[Image: "); strcpy(#tag, "[Image: ");
strcat(#tag, #options); strcat(#tag, #options);
strcat(#tag, "]"); strcat(#tag, "]");
} }*/
IF(tagparam) IF(tagparam)
{ {
@ -758,7 +761,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
META: META:
if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content=")) || (!strcmp(#parametr, "encoding=")) if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content=")) || (!strcmp(#parametr, "encoding="))
{ {
strcpy(#options, #options[find_symbol(#options, '=')]); //ïîèñê â content= strcpy(#options, #options[strrchr(#options, '=')]); //ïîèñê â content=
if (!strcmp(#options,"utf-8")) || (!strcmp(#options,"utf8")) ReadHtml(_UTF); if (!strcmp(#options,"utf-8")) || (!strcmp(#options,"utf8")) ReadHtml(_UTF);
if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) ReadHtml(_KOI); if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) ReadHtml(_KOI);

View File

@ -317,10 +317,7 @@ dword GetColor(char* color_str)
ELSE ELSE
FOR (ii=0; color_names[ii]!=0; ii++) FOR (ii=0; color_names[ii]!=0; ii++)
{ {
IF(!strcmp(color_str, color_names[ii])) IF(!strcmp(color_str, color_names[ii])) return colors[ii];
{
return colors[ii];
}
} }
return text_colors[0]; return text_colors[0];
} }

View File

@ -23,6 +23,7 @@ dword UrlsHistory::CurrentUrl()
void UrlsHistory::AddUrl() //òóò íóæåí ââîäèìûé ýëåìåíò - äëÿ óíèâåðñàëüíîñòè void UrlsHistory::AddUrl() //òóò íóæåí ââîäèìûé ýëåìåíò - äëÿ óíèâåðñàëüíîñòè
{ {
int i;
if (history_num>0) && (strcmp(#URL,#history_list[history_current].Item)==0) return; if (history_num>0) && (strcmp(#URL,#history_list[history_current].Item)==0) return;
if (history_current>=MAX_HISTORY_NUM-1) if (history_current>=MAX_HISTORY_NUM-1)

View File

@ -4,13 +4,14 @@
#define ITEM_WIDTH 138 #define ITEM_WIDTH 138
char *ITEMS_LIST[]={ char *ITEMS_LIST[]={
"View in Tinypad F3", "View in Tinypad F3",52,
"View in TextEdit F4", "View in TextEdit F4",53,
"-", "-",0,
"KOI-8 Ctrl+K", "KOI-8 Ctrl+K",11,
"UTF Ctrl+U", "UTF Ctrl+U",21,
0}; 0};
proc_info MenuForm; proc_info MenuForm;
@ -19,7 +20,7 @@ void menu_rmb()
mouse mm; mouse mm;
int items_num, items_cur; int items_num, items_cur;
int id1, key; int id1, key, i;
SetEventMask(100111b); SetEventMask(100111b);
@ -43,7 +44,9 @@ void menu_rmb()
break; break;
case evButton: case evButton:
ItemProcess(GetButtonID()); id1=GetButtonID()-10;
WB1.Scan(ITEMS_LIST[id1*2+1]);
ExitProcess();
break; break;
case evKey: case evKey:
@ -61,19 +64,20 @@ void menu_rmb()
} }
if (key==13) if (key==13)
{ {
ItemProcess(items_cur+10); WB1.Scan(ITEMS_LIST[items_cur*2+1]);
ExitProcess();
} }
break; break;
case evReDraw: case evReDraw:
for (items_num=0; ITEMS_LIST[items_num]<>0; items_num++;) {}; while (ITEMS_LIST[items_num*2]) items_num++;
DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinWidth()+3,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x01,0x10FFFFFF,0,0,0); DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinWidth()+3,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x01,0x10FFFFFF,0,0,0);
DrawRegion(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x777777); //îáîäîę DrawRegion(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x777777); //îáîäîę
_ITEMS_DRAW: _ITEMS_DRAW:
for (i=0; i<items_num; i++;) for (i=0; i<items_num; i++;)
{ {
if (!strcmp(ITEMS_LIST[i],"-")) if (!strcmp(ITEMS_LIST[i*2],"-"))
{ {
DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, 0xFFFFFF); DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, 0xFFFFFF);
DrawBar(1, i*ITEM_HEIGHT+1+9, ITEM_WIDTH-1, 1, 0x999999); DrawBar(1, i*ITEM_HEIGHT+1+9, ITEM_WIDTH-1, 1, 0x999999);
@ -82,21 +86,11 @@ void menu_rmb()
DefineButton(0, i*ITEM_HEIGHT, ITEM_WIDTH, ITEM_HEIGHT, i+10+BT_HIDE, 0xFFFFFF); DefineButton(0, i*ITEM_HEIGHT, ITEM_WIDTH, ITEM_HEIGHT, i+10+BT_HIDE, 0xFFFFFF);
if (i<>items_cur) EDX=0xFFFFFF; else EDX=0x94AECE; if (i<>items_cur) EDX=0xFFFFFF; else EDX=0x94AECE;
DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX); DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX);
WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i],0); WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2],0);
} }
} }
} }
void ItemProcess(int num_id)
{
if (num_id==10) WB1.Scan(52);
if (num_id==11) WB1.Scan(53);
//-----------------------
if (num_id==13) WB1.Scan(11); //KOI
if (num_id==14) WB1.Scan(21); //UTF
ExitProcess();
}

View File

@ -12,12 +12,12 @@ void GetNextParam()
IF (kavichki) IF (kavichki)
{ {
i=find_symbol(#tagparam, kavichki); i=strrchr(#tagparam, kavichki);
strcpy(#options, #tagparam + i); strcpy(#options, #tagparam + i);
} }
ELSE ELSE
{ {
WHILE((i > 0) && (tagparam[i] <>'=')) i--; //i=find_symbol(#tagparam, '=')+1; WHILE((i > 0) && (tagparam[i] <>'=')) i--; //i=strrchr(#tagparam, '=')+1;
i++; i++;
strcpy(#options, #tagparam + i); //êîïèðóåì îïöèþ strcpy(#options, #tagparam + i); //êîïèðóåì îïöèþ

View File

@ -27,14 +27,14 @@ inline byte chTag(dword text) {return strcmp(#tag,text);}
void GetURLfromPageLinks(int id) void GetURLfromPageLinks(int id)
{ {
int j = 0; int i, j = 0;
for (i = 0; i <= id - 401; i++) for (i = 0; i <= id - 401; i++)
{ {
do j++; do j++;
while (page_links[j] <>'|'); while (page_links[j] <>'|');
} }
page_links[j] = 0x00; page_links[j] = 0x00;
strcpy(#URL, #page_links[find_symbol(#page_links, '|')]); strcpy(#URL, #page_links[strrchr(#page_links, '|')]);
} }
@ -49,14 +49,14 @@ inline void Skew(dword x,y,w,h)
dword italic_buf; dword italic_buf;
int tile_height=2, //áóäåì âûâîäèòü äâóõïèêñåëüíûìè ïîëîñêàìè int tile_height=2, //áóäåì âûâîäèòü äâóõïèêñåëüíûìè ïîëîñêàìè
shift=-2, //ñ äâóõïèêñåëüíûì ñìåùåíèåì shift=-2, //ñ äâóõïèêñåëüíûì ñìåùåíèåì
i; i, skin_width;
italic_buf = mem_Alloc(w*h*3); italic_buf = mem_Alloc(w*h*3);
skin_width = GetSkinWidth();
CopyScreen(italic_buf, x+Form.left+2, y+Form.top+skin_width, w, h);
CopyScreen(italic_buf, x+Form.left+2, GetSkinWidth()+y+Form.top, w, h); FOR (i=0;i*tile_height<h;i++)
FOR (i=0;i*tile_height<h;i++){
PutImage(w*3*tile_height*i+italic_buf,w,tile_height,x+shift-i+1,i*tile_height+y); PutImage(w*3*tile_height*i+italic_buf,w,tile_height,x+shift-i+1,i*tile_height+y);
}
mem_Free(italic_buf); mem_Free(italic_buf);
} }

View File

@ -2,18 +2,6 @@
byte unicode_chars[] = "€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<EFBFBD><EFBFBD><EFBFBD>徕沅彐玷殛腱眍镳駂<EFBFBD>243i\105\244\0"; byte unicode_chars[] = "€亗儎厗噲墛媽崕彁憭摂晼棙櫄洔潪煚、¥ウЖ┆<EFBFBD><EFBFBD><EFBFBD>徕沅彐玷殛腱眍镳駂<EFBFBD>243i\105\244\0";
/* IF (BL==178) ESBYTE[ESI] = 73; //I
IF (BL==179) ESBYTE[ESI] = 105; //i
IF (BL==175) ESBYTE[ESI] = 244; //J
IF (BL==191) ESBYTE[ESI] = 245; //j
IF (BL==170) ESBYTE[ESI] = 242; //E
IF (BL==186) ESBYTE[ESI] = 243; //e
IF (BL==168) ESBYTE[ESI] = 240; //à
IF (BL==184) ESBYTE[ESI] = 'e'; //e
IF (BL==180) ESBYTE[ESI] = 254; //£
IF ((BL==147) || (BL==148) || (BL==171) || (BL==187)) ESBYTE[ESI] = 34;
IF ((BL==150) || (BL==151)) ESBYTE[ESI] = 45;
*/
char *unicode_tags[]={ char *unicode_tags[]={
"nbsp", " ", "nbsp", " ",
@ -74,7 +62,7 @@ char *unicode_tags[]={
"#1031", "\244", "#1031", "\244",
"#8470", "N", "#8470", "N",
"bull", "-", //¢®®¡é¥ §¤¥áì â®çª  "bull", "-", //вообще здесь точка
"percnt","%", "percnt","%",
0}; 0};

View File

@ -148,6 +148,8 @@ inline fastcall word GetButtonID()
$shr eax,8 $shr eax,8
} }
//----------------------------------------
struct proc_info struct proc_info
{ {
#define SelfInfo -1 #define SelfInfo -1
@ -169,6 +171,12 @@ void GetProcessInfo( EBX, ECX)
$int 0x40 $int 0x40
} }
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
{
$mov eax,34
$int 0x40
}
inline fastcall int GetProcessSlot( ECX) inline fastcall int GetProcessSlot( ECX)
{ {
EAX = 18; EAX = 18;
@ -183,6 +191,19 @@ inline fastcall int GetActiveProcess()
$int 0x40 $int 0x40
} }
inline fastcall int CreateThread( ECX,EDX)
{
$mov eax,51
$mov ebx,1
$int 0x40
}
inline fastcall void SwitchToAnotherThread()
{
$mov eax,68
$mov ebx,1
$int 0x40
}
inline fastcall ExitProcess() inline fastcall ExitProcess()
{ {
@ -279,13 +300,6 @@ inline fastcall void DrawTitle( ECX)
$int 0x40; $int 0x40;
} }
inline fastcall int CreateThread( ECX,EDX)
{
EAX = 51;
EBX = 1;
$int 0x40
}
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI) void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
{ {
EAX = 4; EAX = 4;

View File

@ -2,7 +2,7 @@
//library //library
dword libimg = #alibimg; dword libimg = #alibimg;
char alibimg[21] = "/sys/lib/libimg.obj\0"; //"libimg.obj\0"; char alibimg[21] = "/sys/lib/libimg.obj\0";
dword libimg_init = #alibimg_init; dword libimg_init = #alibimg_init;
dword img_is_img = #aimg_is_img; dword img_is_img = #aimg_is_img;

View File

@ -26,9 +26,15 @@ dword mem_Alloc(dword size)
} }
//mem.ReAlloc //mem.ReAlloc
inline fastcall dword mem_ReAllocR( ECX, EDX)
{
$mov eax, 68
$mov ebx, 20
$int 0x40
}
stdcall dword mem_ReAlloc(dword mptr, size) stdcall dword mem_ReAlloc(dword mptr, size)
{ {
//$push ebx ecx edx
$push ebx $push ebx
$push ecx $push ecx
$push edx $push edx
@ -41,7 +47,6 @@ stdcall dword mem_ReAlloc(dword mptr, size)
$pop edx $pop edx
$pop ecx $pop ecx
$pop ebx $pop ebx
//$pop edx ecx ebx
return EAX; return EAX;
} }

View File

@ -0,0 +1,95 @@
//lev
//:dword boxlib = #abox_lib;
:char abox_lib[]="/sys/lib/box_lib.obj";
:char aboxlib_init[] = "lib_init";
:char aScrollbar_v_draw = "scrollbar_v_draw";
:char aScrollbar_v_mouse = "scrollbar_v_mouse";
:char aScrollbar_h_draw = "scrollbar_h_draw";
:char aScrollbar_h_mouse = "scrollbar_h_mouse";
:char aVersion_scrollbar = "version_scrollbar";
dword boxlib_init = #aboxlib_init;
dword scrollbar_v_draw = #aScrollbar_v_draw;
dword scrollbar_v_mouse = #aScrollbar_v_mouse;
dword scrollbar_h_draw = #aScrollbar_h_draw;
dword scrollbar_h_mouse = #aScrollbar_h_mouse;
:dword version_scrollbar = #aVersion_scrollbar;
dword sc_am__ = 0x0;
dword sc_bm__ = 0x0;
struct scroll_bar
{
//scroll_bar:
word size_x,// equ [edi]
start_x,// equ [edi+2]
size_y,// equ [edi+4]
start_y;// equ [edi+6]
dword btn_height, // equ [edi+8]
type,// equ [edi+12]
max_area,// equ [edi+16]
cur_area,// equ [edi+20]
position,// equ [edi+24]
bckg_col,// equ [edi+28]
frnt_col,// equ [edi+32]
line_col,// equ [edi+36]
redraw;// equ [edi+40]
word delta,// equ [edi+44]
delta2,// equ [edi+46]
r_size_x,// equ [edi+48]
r_start_x,// equ [edi+50]
r_size_y,// equ [edi+52]
r_start_y;// equ [edi+54]
dword m_pos,// equ [edi+56]
m_pos_2,// equ [edi+60]
m_keys,// equ [edi+64]
run_size,// equ [edi+68]
position2,// equ [edi+72]
work_size,// equ [edi+76]
all_redraw,// equ [edi+80]
ar_offset;// equ [edi+84]
};
/*scroll_bar scroll1 = {
18,//word size_x,
200, //start_x,
398, //size_y,
44,//start_y;
18,//dword btn_height,
0,//type,
115,//max_area, (100+cur_area)
15,//cur_area,
0,//position,
0xeeeeee,//bckg_col,
0xD2CED0,//frnt_col,
0x555555,//line_col,
0,//redraw;
0,//word delta,
0,//delta2,
0,//r_size_x,
0,//r_start_x,
0,//r_size_y,
0,//r_start_y;
0,//dword m_pos,
0,//m_pos_2,
0,//m_keys,
0,//run_size,
0,//position2,
0,//work_size,
1,//all_redraw,
1//ar_offset;
};*/
//btn_height - ¢ëá®â  ¡®ª®¢ëå ª­®¯®ª («¥¢ ï ¨ ¯à ¢ ï ¤«ï £®à¨§. ¨ ¢¥àå­ïï ¨ ­¨¦­ïï ¤«ï ¢¥àâ.)
//type - type - 0-1-2, ®áâ «ì­ë¥ ¢ë£«ï¤ïâ ª ª 0.
//max_area - ®¡« áâì ¬ ªá¨¬ «ì­ ï,  ªâã «ì­® ª®£¤  ­¥ ¢« §¨â ¢ ®â®¡à ¦ ¥¬ãî ®¡« áâì, â.¥. á«ãç ©  ªâ¨¢­®á⨠ª®¬¯®­¥­â  (¢¥áì ¬ ªá¨¬ «ì­ë© à §¬¥à ¤®ªã¬¥­â )
//cur_area - à §¬¥à ¡¥£ã­ª //®¡« áâì ®â®¡à ¦ ¥¬ ï (ª ª ï ç áâì ¤®ªã¬¥­â  ¢« §¨â ¢ íªà ­)
//position - ¯®§¨æ¨ï ¡¥£ã­ª  ¨§¬¥­ï¥¬ ï ®â 0 ¤® §­ ç¥­¨ï (max_area-cur_area)
//bckg_col - 梥⠢­ãâ७­¨©, ¯à¨¬¥­ï¥âáï ¤«ï ®¡« á⥩ ¬¥¦¤ã ¡¥£ã­ª®¬ ¨ ª­®ª ¬¨
//frnt_col - 梥⠭ à㦭ë©, ¯à¨¬¥­ï¥âáï ¤«ï ®¡« á⥩ ®â«¨ç­ëå ®â ¯à¨¬¥­ï¥¬ëå ¢ bckg_col
//line_col - 梥⠫¨­¨© ¨ áâ५®ª ­  ª­®¯ª å
//redraw - ¨­¤¨ª â®à ­¥®¡å®¤¨¬®á⨠¯¥à¥à¨á®¢ª¨ ã¯à ¢«ï¥¬®© ®¡« á⨠ãç¨âë¢ ï ¨§¬¥­¥­¨¥ position ¨ cur_area
//delta2 - ¨­¤¨ª â®à § å¢ â  䮪ãá  áªà®««¡ à®¬ (㤥ঠ­¨¥ ¡¥£ã­ª )
//all_redraw - ä« £ ãáâ ­ ¢«¨¢ ¥¬ë© ¢ 1 ¤«ï ¯¥à¥à¨á®¢ª¨ ¢á¥£® ª®¬¯®­¥­â , ¥á«¨ ¯®áâ ¢¨âì 0, â® ¯¥à¥à¨á®¢ª  ¯à®¨á室¨â ⮫쪮 ¤«ï ®¡« á⨠¡¥£ã­ª . ‚¢¥¤¥­® ¤«ï ã᪮७¨ï ®âà¨á®¢ª¨, ¯®áª®«ìªã ­¥ ¢® ¢á¥å á«ãç ïå âॡã¥âáï ¯à¨­ã¤¨â¥ì­® ®âà¨á®¢ë¢ âì ¢á¥ ç á⨠ª®¬¯®­¥­â . Š®£¤  ¢ë§ë¢ ¥âáï ¯® ᮡëâ¨î ¬ëè¨ ¢á¥£¤  ®âà¨á®¢ë¢ ¥âáï á ¬¨¬ ª®¬¯®­¥­â®¬ á® §­ ç¥­¨¥¬ 0.
//ar_offset - ¢¥«¨ç¨­  ᬥ饭¨ï ¯à¨ ®¤­®ªà â­®¬ ­ ¦ â¨¨ ¡®ª®¢®© ª­®¯ª¨.

View File

@ -1,16 +1,19 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// strcmp( ESI, EDI)
// strlen( EDI) // strlen( EDI)
// strcpy( EDI, ESI) // strcpy( EDI, ESI)
// strcat( EDI, ESI) // strcat( EDI, ESI)
// strchr( ESI,BL)
// strrchr( ESI,BL)
// strstr( EBX, EDX)
//
// IntToStr( ESI) // IntToStr( ESI)
// StrToInt() // StrToInt()
// strcmp( ESI, EDI)
// find_symbol( ESI,BL)
// upcase( ESI) // upcase( ESI)
// lowcase( ESI) // lowcase( ESI)
// strstr( EBX, EDX)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
inline fastcall unsigned int strlen( EDI) inline fastcall unsigned int strlen( EDI)
{ {
$xor eax, eax $xor eax, eax
@ -59,7 +62,7 @@ inline fastcall strcat( EDI, ESI)
} }
} }
char buffer[11]=""; char buffer[11];
inline fastcall dword IntToStr( ESI) inline fastcall dword IntToStr( ESI)
{ {
$mov edi, #buffer $mov edi, #buffer
@ -115,7 +118,18 @@ inline fastcall signed int strcmp( ESI, EDI)
} }
} }
inline fastcall unsigned int find_symbol( ESI,BL) inline fastcall unsigned int strchr( ESI,BL)
{
int jj=0;
do{
jj++;
$lodsb
IF(AL==BL) return jj;
} while(AL!=0);
}
inline fastcall unsigned int strrchr( ESI,BL)
{ {
int jj=0, last=-1; int jj=0, last=-1;
do{ do{
@ -169,7 +183,7 @@ inline fastcall unsigned int strstr( EBX, EDX)
sub ecx, esi sub ecx, esi
jbe ls2 jbe ls2
mov edi, ebx mov edi, ebx
lea ebx, dsdword[ esi-1] lea ebx, DSDWORD[ esi-1]
ls1: mov esi, edx ls1: mov esi, edx
lodsb lodsb
repne scasb repne scasb
@ -181,7 +195,7 @@ ls1: mov esi, edx
pop edi pop edi
mov ecx, eax mov ecx, eax
jne ls1 jne ls1
lea eax, dsdword[ edi-1] lea eax, DSDWORD[ edi-1]
jmp short ls3 jmp short ls3
ls2: xor eax, eax ls2: xor eax, eax
ls3: ls3: