/programs/network/htmlv/browser/TWB.h |
---|
9,7 → 9,7 |
char download_path[]="/rd/1/.download"; |
char search_path[]="http://nigma.ru/index.php?s="; |
char version[]=" Text-based Browser 0.94u"; |
char version[]=" Text-based Browser 0.94e"; |
struct TWebBrowser { |
30,7 → 30,7 |
link, ignor_text, li_tab, first_line_drawed; |
dword text_colors[300], |
dword text_colors[30], |
text_color_index, |
link_color, |
bg_color; |
39,9 → 39,6 |
stolbec, |
tab_len; |
char anchor[256]; |
int anchor_line_num; |
char line[500], |
tag[100], |
tagparam[10000], |
48,7 → 45,10 |
parametr[1200], |
options[1000]; |
char anchor[256]; |
int anchor_line_num; |
#include "include\history.h" |
#include "include\colors.h" |
#include "include\unicode_tags.h" |
65,7 → 65,7 |
//#1 |
if (URL[0] == '#') |
{ |
strcpy(#anchor, #URL+strrchr(#URL, '#')); |
strcpy(#anchor, #URL+find_symbol(#URL, '#')); |
strcpy(#URL, BrowserHistory.CurrentUrl()); |
74,10 → 74,10 |
return; |
} |
//liner.ru#1 |
if (strrchr(#URL, '#')<>-1) |
if (find_symbol(#URL, '#')<>-1) |
{ |
strcpy(#anchor, #URL+strrchr(#URL, '#')); |
URL[strrchr(#URL, '#')-1] = 0x00; //çàãëóøêà |
strcpy(#anchor, #URL+find_symbol(#URL, '#')); |
URL[find_symbol(#URL, '#')-1] = 0x00; //çàãëóøêà |
} |
GetNewUrl(); |
197,15 → 197,15 |
_CUT_ST_LEVEL_MARK: |
if (editURL[strrchr(#editURL, '/')-2]<>'/') // åñëè íå http://pagename.ua <-- íàõðåíà ýòà ñòðîêà??? |
if (editURL[find_symbol(#editURL, '/')-2]<>'/') // åñëè íå http://pagename.ua <-- íàõðåíà ýòà ñòðîêà??? |
{ |
editURL[strrchr(#editURL, '/')] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî / |
editURL[find_symbol(#editURL, '/')] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî / |
} |
IF (!strcmp(get_URL_part(3),"../")) //íà óðîâåíü ââåðõ |
{ |
strcpy(#URL,#URL+3); |
editURL[strrchr(#editURL, '/')-1] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî / |
editURL[find_symbol(#editURL, '/')-1] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî / |
goto _CUT_ST_LEVEL_MARK; |
} |
318,7 → 318,9 |
if (!strcmp(#URL + strlen(#URL) - 4, ".txt")) pre_text = 1; |
if (!strcmp(#URL + strlen(#URL) - 4, ".mht")) ignor_text = 1; |
#ifdef DEBUG_ON |
debug("Start parsing"); |
#endif |
for ( ; buf+filesize > bword; bword++;) {//ESBYTE[bword] |
bukva = ESBYTE[bword]; |
436,7 → 438,7 |
// |
if (stolbec + strlen(#line) > lines.column_max) |
{ |
perenos_num = strrchr(#line, ' '); |
perenos_num = find_symbol(#line, ' '); |
strcpy(#temp, #line + perenos_num); //ïåðåíîñ ïî ñëîâàì |
line[perenos_num] = 0x00; |
NEXT_MARK: |
463,7 → 465,9 |
ParseHTML(buf); |
} |
#ifdef DEBUG_ON |
debug("End parsing"); |
#endif |
DrawScroller(); //ðèñóåì ñêðîëë |
} |
564,16 → 568,14 |
{ |
if (rez) |
{ |
text_color_index++; |
text_colors[text_color_index] = text_colors[text_color_index-1]; |
_A_MARK: |
if (!strcmp(#parametr, "href=")) |
{ |
if (stroka - 1 > lines.visible) || (stroka < -2) return; |
if (link) && (text_color_index > 0) text_color_index--; //åñëè íå çàêðûò òýã |
if (link == 1) text_color_index--; //åñëè êàêîé-òî äîëáî¸á íå çàêðûë òýã |
link = 1; |
blink++; |
text_color_index++; |
text_colors[text_color_index] = link_color; |
strcat(#page_links, #options); |
strcat(#page_links, "|"); |
600,14 → 602,11 |
///////////////////////// |
if (!chTag("font")) |
{ |
if (rez) |
{ |
text_color_index++; |
text_colors[text_color_index] = text_colors[text_color_index-1]; |
IF (stroka - 1 > lines.visible) return; |
COL_MARK: |
if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#') |
{ |
text_color_index++; |
text_colors[text_color_index] = GetColor(#options); |
} |
IF(tagparam) { |
614,9 → 613,7 |
GetNextParam(); |
GOTO COL_MARK; |
} |
} |
else |
if (text_color_index > 0) text_color_index--; |
IF(!rez) && (text_color_index > 0) text_color_index--; |
return; |
} |
////////////////////////// |
697,18 → 694,18 |
if (!strcmp(#parametr,"src=")) //íàäî îáúåäèíèòü ñ GetNewUrl() |
{ |
strcpy(#temp, BrowserHistory.CurrentUrl()); //äîñòà¸ì àäðåñ òåêóùåé ñòðàíèöû |
temp[strrchr(#temp, '/')] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî / |
temp[find_symbol(#temp, '/')] = 0x00; //îáðåçàåì å¸ óðë äî ïîñëåäíåãî / |
strcat(#temp, #options); |
image=load_image(#temp); |
w=DSWORD[image+4]; |
h=DSWORD[image+8]; |
} |
/*if (!strcmp(#parametr,"alt=")) |
if (!strcmp(#parametr,"alt=")) |
{ |
strcpy(#tag, "[Image: "); |
strcat(#tag, #options); |
strcat(#tag, "]"); |
}*/ |
} |
IF(tagparam) |
{ |
761,7 → 758,7 |
META: |
if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content=")) || (!strcmp(#parametr, "encoding=")) |
{ |
strcpy(#options, #options[strrchr(#options, '=')]); //ïîèñê â content= |
strcpy(#options, #options[find_symbol(#options, '=')]); //ïîèñê â content= |
if (!strcmp(#options,"utf-8")) || (!strcmp(#options,"utf8")) ReadHtml(_UTF); |
if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) ReadHtml(_KOI); |
/programs/network/htmlv/browser/include/menu_rmb.h |
---|
4,14 → 4,13 |
#define ITEM_WIDTH 138 |
char *ITEMS_LIST[]={ |
"View in Tinypad F3",52, |
"View in TextEdit F4",53, |
"-",0, |
"KOI-8 Ctrl+K",11, |
"UTF Ctrl+U",21, |
"View in Tinypad F3", |
"View in TextEdit F4", |
"-", |
"KOI-8 Ctrl+K", |
"UTF Ctrl+U", |
0}; |
proc_info MenuForm; |
20,7 → 19,7 |
mouse mm; |
int items_num, items_cur; |
int id1, key, i; |
int id1, key; |
SetEventMask(100111b); |
44,9 → 43,7 |
break; |
case evButton: |
id1=GetButtonID()-10; |
WB1.Scan(ITEMS_LIST[id1*2+1]); |
ExitProcess(); |
ItemProcess(GetButtonID()); |
break; |
case evKey: |
64,13 → 61,12 |
} |
if (key==13) |
{ |
WB1.Scan(ITEMS_LIST[items_cur*2+1]); |
ExitProcess(); |
ItemProcess(items_cur+10); |
} |
break; |
case evReDraw: |
while (ITEMS_LIST[items_num*2]) items_num++; |
for (items_num=0; ITEMS_LIST[items_num]<>0; 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); |
DrawRegion(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x777777); //îáîäîê |
77,7 → 73,7 |
_ITEMS_DRAW: |
for (i=0; i<items_num; i++;) |
{ |
if (!strcmp(ITEMS_LIST[i*2],"-")) |
if (!strcmp(ITEMS_LIST[i],"-")) |
{ |
DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, 0xFFFFFF); |
DrawBar(1, i*ITEM_HEIGHT+1+9, ITEM_WIDTH-1, 1, 0x999999); |
86,12 → 82,22 |
DefineButton(0, i*ITEM_HEIGHT, ITEM_WIDTH, ITEM_HEIGHT, i+10+BT_HIDE, 0xFFFFFF); |
if (i<>items_cur) EDX=0xFFFFFF; else EDX=0x94AECE; |
DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX); |
WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2],0); |
WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i],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(); |
} |
/programs/network/htmlv/browser/include/parce_tag.h |
---|
12,12 → 12,12 |
IF (kavichki) |
{ |
i=strrchr(#tagparam, kavichki); |
i=find_symbol(#tagparam, kavichki); |
strcpy(#options, #tagparam + i); |
} |
ELSE |
{ |
WHILE((i > 0) && (tagparam[i] <>'=')) i--; //i=strrchr(#tagparam, '=')+1; |
WHILE((i > 0) && (tagparam[i] <>'=')) i--; //i=find_symbol(#tagparam, '=')+1; |
i++; |
strcpy(#options, #tagparam + i); //êîïèðóåì îïöèþ |
/programs/network/htmlv/browser/include/some_code.h |
---|
27,7 → 27,7 |
void GetURLfromPageLinks(int id) |
{ |
int i, j = 0; |
int j = 0; |
for (i = 0; i <= id - 401; i++) |
{ |
do j++; |
34,7 → 34,7 |
while (page_links[j] <>'|'); |
} |
page_links[j] = 0x00; |
strcpy(#URL, #page_links[strrchr(#page_links, '|')]); |
strcpy(#URL, #page_links[find_symbol(#page_links, '|')]); |
} |
49,14 → 49,14 |
dword italic_buf; |
int tile_height=2, //áóäåì âûâîäèòü äâóõïèêñåëüíûìè ïîëîñêàìè |
shift=-2, //ñ äâóõïèêñåëüíûì ñìåùåíèåì |
i, skin_width; |
i; |
italic_buf = mem_Alloc(w*h*3); |
skin_width = GetSkinWidth(); |
CopyScreen(italic_buf, x+Form.left+2, y+Form.top+skin_width, w, h); |
FOR (i=0;i*tile_height<h;i++) |
CopyScreen(italic_buf, x+Form.left+2, GetSkinWidth()+y+Form.top, w, h); |
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); |
} |
mem_Free(italic_buf); |
} |
/programs/network/htmlv/browser/include/history.h |
---|
23,7 → 23,6 |
void UrlsHistory::AddUrl() //òóò íóæåí ââîäèìûé ýëåìåíò - äëÿ óíèâåðñàëüíîñòè |
{ |
int i; |
if (history_num>0) && (strcmp(#URL,#history_list[history_current].Item)==0) return; |
if (history_current>=MAX_HISTORY_NUM-1) |
/programs/network/htmlv/browser/include/unicode_tags.h |
---|
2,6 → 2,18 |
byte unicode_chars[] = " ¡¢£¤¥¦§¨©ª«¬®¯àáâãäåæçèéêëìíîïðñh£\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[]={ |
"nbsp", " ", |
62,7 → 74,7 |
"#1031", "\244", |
"#8470", "N", |
"bull", "-", //âîîáùå çäåñü òî÷êà |
"bull", "-", //¢®®¡é¥ §¤¥áì â®çª |
"percnt","%", |
0}; |
/programs/network/htmlv/browser/include/colors.h |
---|
317,7 → 317,10 |
ELSE |
FOR (ii=0; color_names[ii]!=0; ii++) |
{ |
IF(!strcmp(color_str, color_names[ii])) return colors[ii]; |
IF(!strcmp(color_str, color_names[ii])) |
{ |
return colors[ii]; |
} |
} |
return text_colors[0]; |
} |
/programs/network/htmlv/lib/scroll_lib.h |
---|
File deleted |
/programs/network/htmlv/lib/kolibri.h |
---|
148,8 → 148,6 |
$shr eax,8 |
} |
//---------------------------------------- |
struct proc_info |
{ |
#define SelfInfo -1 |
171,12 → 169,6 |
$int 0x40 |
} |
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y |
{ |
$mov eax,34 |
$int 0x40 |
} |
inline fastcall int GetProcessSlot( ECX) |
{ |
EAX = 18; |
191,20 → 183,7 |
$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() |
{ |
$mov eax,-1; |
300,6 → 279,13 |
$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) |
{ |
EAX = 4; |
/programs/network/htmlv/lib/strings.h |
---|
1,19 → 1,16 |
//------------------------------------------------------------------------------ |
// strcmp( ESI, EDI) |
// strlen( EDI) |
// strcpy( EDI, ESI) |
// strcat( EDI, ESI) |
// strchr( ESI,BL) |
// strrchr( ESI,BL) |
// strstr( EBX, EDX) |
// |
// IntToStr( ESI) |
// StrToInt() |
// strcmp( ESI, EDI) |
// find_symbol( ESI,BL) |
// upcase( ESI) |
// lowcase( ESI) |
// strstr( EBX, EDX) |
//------------------------------------------------------------------------------ |
inline fastcall unsigned int strlen( EDI) |
{ |
$xor eax, eax |
62,7 → 59,7 |
} |
} |
char buffer[11]; |
char buffer[11]=""; |
inline fastcall dword IntToStr( ESI) |
{ |
$mov edi, #buffer |
118,19 → 115,8 |
} |
} |
inline fastcall unsigned int strchr( ESI,BL) |
inline fastcall unsigned int find_symbol( 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; |
do{ |
jj++; |
183,7 → 169,7 |
sub ecx, esi |
jbe ls2 |
mov edi, ebx |
lea ebx, DSDWORD[ esi-1] |
lea ebx, dsdword[ esi-1] |
ls1: mov esi, edx |
lodsb |
repne scasb |
195,7 → 181,7 |
pop edi |
mov ecx, eax |
jne ls1 |
lea eax, DSDWORD[ edi-1] |
lea eax, dsdword[ edi-1] |
jmp short ls3 |
ls2: xor eax, eax |
ls3: |
/programs/network/htmlv/lib/libimg_lib.h |
---|
2,7 → 2,7 |
//library |
dword libimg = #alibimg; |
char alibimg[21] = "/sys/lib/libimg.obj\0"; |
char alibimg[21] = "/sys/lib/libimg.obj\0"; //"libimg.obj\0"; |
dword libimg_init = #alibimg_init; |
dword img_is_img = #aimg_is_img; |
/programs/network/htmlv/lib/mem.h |
---|
26,15 → 26,9 |
} |
//mem.ReAlloc |
inline fastcall dword mem_ReAllocR( ECX, EDX) |
{ |
$mov eax, 68 |
$mov ebx, 20 |
$int 0x40 |
} |
stdcall dword mem_ReAlloc(dword mptr, size) |
{ |
//$push ebx ecx edx |
$push ebx |
$push ecx |
$push edx |
47,6 → 41,7 |
$pop edx |
$pop ecx |
$pop ebx |
//$pop edx ecx ebx |
return EAX; |
} |