Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3020 → Rev 3019

/programs/network/htmlv/browser/HTMLv.c
47,36 → 47,7
#include "TWB.h"
#include "include\menu_rmb.h"
 
/*void tre()
{
char *font_picture;
char text[12];
int width=600;
int height=40;
char palette[256*4];
int x;
 
 
strcpy(#text, "hello world\0");
 
get_width stdcall (#text, -1, height);
width=EAX;
 
font_picture=mem_Alloc(width*height);
truetype stdcall (#text, -1, font_picture, width, height);
 
for (x=0;x<256;x++) {
palette[x*4]=255-x;
palette[x*4+1]=255-x;
palette[x*4+2]=255-x;
palette[x*4+3]=0;
}
 
PutPaletteImage(font_picture,width,height,0,0,8,#palette);
mem_Free(font_picture);
};*/
 
 
void main()
{
int btn;
87,7 → 58,7
mem_Init();
if (load_dll2(libio, #libio_init,1)!=0) debug("Íå óäàëîñü ïîäêëþ÷èòü áèáëèîòåêó libio"w);
if (load_dll2(libimg, #libimg_init,1)!=0) debug("Íå óäàëîñü ïîäêëþ÷èòü áèáëèîòåêó libimg"w);
if (load_dll2(boxlib, #edit_box_draw,0)!=0) {RunProgram("@notify", "System Error: library doesn't exists /rd/1/lib/box_lib.obj"); ExitProcess();}
if (load_dll2(boxlib, #edit_box_draw,0)!=0) debug("Íå óäàëîñü ïîäêëþ÷èòü áèáëèîòåêó boxlib"w);
load_dll2(#abox_lib, #boxlib_init,0);
if (load_dll2(libtruetype, #truetype,0)!=0) {debug("Íå óäàëîñü ïîäêëþ÷èòü áèáëèîòåêó TrueType"w); use_truetype = 2;}
/programs/network/htmlv/browser/TWB.h
8,7 → 8,7
 
char download_path[]="/rd/1/.download";
char search_path[]="http://nigma.ru/index.php?s=";
char version[]=" Text-based Browser 0.97.6";
char version[]=" Text-based Browser 0.97.5";
 
 
struct TWebBrowser {
122,7 → 122,8
case 005: //truetype
if (use_truetype == 2)
{
RunProgram("@notify", "Library does not exists /rd/1/lib/truetype.obj"w);
debug("Íå óäàëîñü ïîäêëþ÷èòü áèáëèîòåêó TrueType");
debug("/rd/1/lib/truetype.obj íå îáíàðóæåí èëè èìååò íåïðàâèëüíûé ôîðìàò");
return;
}
if (use_truetype == 1) use_truetype=0; else use_truetype=1;
549,6 → 550,7
{
//line_length = get_length stdcall (#line,-1,16,line_length);
text_out stdcall (#line, -1, 17, text_colors[text_color_index], start_x, start_y-3);
Pause(10);
}
else
{
778,7 → 780,7
 
if (!chTag("img"))
{
if (GetFileInfo(libimg)<>0) return; //åñëè áèáëèîòåêè íåò
//if (GetFileInfo(#libimg)<>0) return; //åñëè áèáëèîòåêè íåò
IMG_TAG:
if (!strcmp(#parametr,"src=")) //íàäî îáúåäèíèòü ñ GetNewUrl()
{
804,13 → 806,21
GOTO IMG_TAG;
}
if (!image) return;
if (!image)
{
//debug(#tag);
return;
}
if (w>width1) w=width1;
if (stroka==0) DrawBar(left, top, width-15, 15, bg_color); //çàêðàøèâàåì ïåðâóþ ñòðîêó
stroka+=h/10;
if (top1+h<WB1.top) || (top1>WB1.top+WB1.height-10) return; //åñëè ÂѨ èçîáðàæåíèå óøëî ÂÅÐÕ èëè ÂÍÈÇ
if (top1+h<WB1.top) || (top1>WB1.top+WB1.height-10) //åñëè ÂѨ èçîáðàæåíèå óøëî ÂÅÐÕ èëè ÂÍÈÇ
return;
 
if (top1<WB1.top) //åñëè ÷àñòü èçîáðàæåíèÿ ñâåðõó
{
DrawBar(left, top, width-15, 10, bg_color); //çàêðàøèâàåì ïåðâóþ ñòðîêó
818,16 → 828,22
h=h-img_lines_first;
top1=WB1.top;
}
if (top1>WB1.top+WB1.height-h-15) //åñëè ÷àñòü èçîáðàæåíèÿ ñíèçó
if (top1>WB1.top+WB1.height-h-15) //åñëè ÷àñòü èçîáðàæåíèÿ ñíèçó IF (stroka - 2 < lines.visible)
{
h=WB1.top+WB1.height-top1-15;
}
 
if (h<=0) return;
if (anchor) return;
img_draw stdcall (image,left1-5,top1+10,w, h,0,img_lines_first);
DrawBar(left1+w - 5, top1 + 10, width1-w + 5, h, bg_color);
IF (link) DefineButton(left1 - 5, top1+10, w, h, blink + BT_HIDE, 0xB5BFC9);
IF (link)
{
DefineButton(left1 - 5, top1+10, w, h, blink + BT_HIDE, 0xB5BFC9);
}
 
return;
}
 
/programs/network/htmlv/browser/History.txt
1,10 → 1,3
10.11.12 - 0.97.6
- íîðìàëüíûé çàïóñê ïðîãðàììû äàæå áåç áèáëèîòåêè lib_img;
- îïîâåùåíèå åñëè box_lib íå íàéäåíà;
- èñïðàâëåíà îøèáêà ïðèâîäÿùàÿ ê òîðìîæåíèþ ïðè îòîáðàæåíèè
TrueType øðèôòîâ;
- îáíîâëåíèå áèáëèîòåê.
 
05.11.12 - 0.97.5
Ïåðåêëþ÷àëêà íà øðèôòû TrueType èç ìåíþ ÏÊÌ.
 
/programs/network/htmlv/lib/kolibri.h
306,15 → 306,6
$int 0x40
}
 
inline fastcall DeleteAllButtons()
{
EAX = 12; // function 12:tell os about windowdraw
EBX = 1;
$int 0x40
EBX = 2;
$int 0x40
}
 
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
{
$mov eax, 67
/programs/network/htmlv/lib/strings.h
203,8 → 203,6
do{
AL=DSBYTE[ESI];
IF(AL>='a')IF(AL<='z')DSBYTE[ESI]=AL&0x5f;
IF (AL>=160) && (AL<=175) DSBYTE[ESI] = AL - 32; //à-ï
IF (AL>=224) && (AL<=239) DSBYTE[ESI] = AL - 80; //à-ï
ESI++;
}while(AL!=0);
}
238,42 → 236,42
 
 
 
inline fastcall dword strstr( EBX, EDX)
inline fastcall unsigned int strstr( EBX, EDX)
{
asm {
MOV EDI, EDX
XOR ECX, ECX
XOR EAX, EAX
DEC ECX
REPNE SCASB
NOT ECX
DEC ECX
JE LS2
MOV ESI, ECX
XOR ECX, ECX
MOV EDI, EBX
DEC ECX
REPNE SCASB
NOT ECX
SUB ECX, ESI
JBE LS2
MOV EDI, EBX
LEA EBX, DSDWORD[ ESI-1]
LS1: MOV ESI, EDX
LODSB
REPNE SCASB
JNE LS2
MOV EAX, ECX
PUSH EDI
MOV ECX, EBX
REPE CMPSB
POP EDI
MOV ECX, EAX
JNE LS1
LEA EAX, DSDWORD[ EDI-1]
JMP SHORT LS3
LS2: XOR EAX, EAX
LS3:
mov edi, edx
xor ecx, ecx
xor eax, eax
dec ecx
repne scasb
not ecx
dec ecx
je ls2
mov esi, ecx
xor ecx, ecx
mov edi, ebx
dec ecx
repne scasb
not ecx
sub ecx, esi
jbe ls2
mov edi, ebx
lea ebx, DSDWORD[ esi-1]
ls1: mov esi, edx
lodsb
repne scasb
jne ls2
mov eax, ecx
push edi
mov ecx, ebx
repe cmpsb
pop edi
mov ecx, eax
jne ls1
lea eax, DSDWORD[ edi-1]
jmp short ls3
ls2: xor eax, eax
ls3:
}
}
 
300,7 → 298,7
íå 0, åñëè ñëîâî ñêîïèðîâàíî â dest (ïåðåäàéòå ýòî çíà÷åíèå
â êà÷åñòâå src äëÿ ïîñëåäóþùåãî ïîèñêà) */
 
inline fastcall dword strtok( EDX, ESI, EBX)
dword fastcall strtok( EDX, ESI, EBX)
{
asm {
XOR ECX, ECX
/programs/network/htmlv/lib/file_system.h
46,7 → 46,7
// Ñîçäàíèå ïàïêè //
///////////////////////////
f70 create_dir_70;
:int CreateDir(dword new_folder_path)
:int CreateFolder(dword new_folder_path)
{
create_dir_70.func = 9;
create_dir_70.param1 =
186,18 → 186,4
$mov eax,70
$mov ebx,#read_file_70.func
$int 0x40
}
 
inline fastcall void SetCurDir( ECX)
{
$mov eax,30
$mov ebx,1
$int 0x40
}
 
inline fastcall void GetCurDir( ECX, EDX)
{
$mov eax,30
$mov ebx,2
$int 0x40
}
/programs/network/htmlv/lib/mem.h
26,6 → 26,13
}
 
//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
65,30 → 72,30
inline fastcall mem_Move( 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:
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:
}
}