Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3107 → Rev 3106

/programs/cmm/lib/figures.h
1,5 → 1,3
//#include "strings.h"
 
void DrawRectangle(dword x,y,width,height,color1)
{
DrawBar(x,y,width,1,color1);
/programs/cmm/lib/lib.obj/truetype.h
File deleted
/programs/cmm/lib/lib.obj/box_lib.h
File deleted
/programs/cmm/lib/lib.obj/network.h
File deleted
/programs/cmm/lib/lib.obj/libimg_lib.h
File deleted
/programs/cmm/lib/lib.obj/libio_lib.h
File deleted
/programs/cmm/lib/lib.obj/iconv.h
1,4 → 1,4
//convert text characters
//Network library
 
dword iconv_lib = #a_iconv_lib;
char a_iconv_lib[19]="/sys/lib/iconv.obj\0";
29,7 → 29,7
cd = EAX;
if (cd!=0)
{
debug("iconv: something is wrong with stdcall iconv()");
debug("iconv: semething is wrong with stdcall iconv()");
debug(itoa(cd));
debug("in_len");
debug(itoa(in_len));
/programs/cmm/lib/network.h
0,0 → 1,65
//Network library
 
dword network_lib = #a_network_lib;
char a_network_lib[21]="/sys/lib/network.obj\0";
 
dword network_lib_init = #aLib_init;
dword inet_addr = #aInet_addr; //"192.168.0.1" -> dword IP
dword inet_ntoa = #aInet_ntoa;
dword getaddrinfo = #aGetaddrinfo;
dword getaddrinfo_start = #aGetaddrinfo_start;
dword getaddrinfo_process = #aGetaddrinfo_process;
dword getaddrinfo_abort = #aGetaddrinfo_abort;
dword freeaddrinfo = #aFreeaddrinfo;
 
dword am3__ = 0x0;
dword bm3__ = 0x0;
 
char aLib_init[9] = "lib_init\0";
char aInet_addr[10] = "inet_addr\0";
char aInet_ntoa[10] = "inet_ntoa\0";
char aGetaddrinfo[12] = "getaddrinfo\0";
char aGetaddrinfo_start[18] = "getaddrinfo_start\0";
char aGetaddrinfo_process[20] = "getaddrinfo_process\0";
char aGetaddrinfo_abort[18] = "getaddrinfo_abort\0";
char aFreeaddrinfo[13] = "freeaddrinfo\0";
 
/*
addr соответствует IP 10.101.102.103
itoa((addr&0xFF000000)>>24) равно 103
itoa((addr&0xFF0000)>>16) —это 102
itoa((addr&0xFF00)>>8) — это 101
itoa(addr&0xFF) — это 10
*/
 
dword GetIPfromAdress(dword addr)
{
dword lpointer, IPa;
getaddrinfo stdcall (addr, 0, 0, #lpointer);
if (EAX!=0) IPa = 0; else IPa = DSDWORD[DSDWORD[lpointer+24]+4];
freeaddrinfo stdcall (lpointer);
return IPa;
}
 
/*
//Convert the string from standard IPv4 dotted notation to integer IP addr.
inet_addr stdcall ("192.168.0.1");
server_IP = EAX;
 
 
char* __stdcall inet_ntoa(struct in_addr in);
Convert the Internet host address to standard IPv4 dotted notation.
 
getaddrinfo(__in const char* hostname, __in const char* servname,
__in const struct addrinfo* hints, __out struct addrinfo **res);
struct addrinfo {
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
size_t ai_addrlen;
struct sockaddr *ai_addr;
char *ai_canonname;
struct addrinfo *ai_next;
};
*/
/programs/cmm/lib/kolibri.h
35,7 → 35,7
 
struct mouse
{
signed int x,y,lkm,pkm,hor,vert;
int x,y,lkm,pkm,hor,vert;
void get();
};
 
121,17 → 121,17
inline fastcall word GetKey() //+Gluk fix
{
$push edx
GETKEY:
@getkey:
$mov eax,2
$int 0x40
$cmp eax,1
$jne GETKEYI
$jne getkeyi
$mov ah,dh
$jmp GETKEYII //jz?
GETKEYI:
$jmp getkeyii //jz?
@getkeyi:
$mov dh,ah
$jmp GETKEY
GETKEYII:
$jmp getkey
@getkeyii:
$pop edx
$shr eax,8
}
187,8 → 187,8
word status_slot,rezerv3;
dword work_left,work_top,work_width,work_height;
char status_window;
dword cwidth,cheight;
byte reserved[1024-71-8];
void GetInfo( ECX);
byte reserved[1024-71];
};
 
inline fastcall void GetProcessInfo( EBX, ECX)
195,8 → 195,6
{
$mov eax,9;
$int 0x40
DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth
DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight
}
 
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
322,14 → 320,14
$push ecx
$mov eax, 63
$mov ebx, 1
NEXT_CHAR:
next_char:
$mov ecx, DSDWORD[edx]
$or cl, cl
$jz DONE
$jz done
$int 0x40
$inc edx
$jmp NEXT_CHAR
DONE:
$jmp next_char
done:
$mov cl, 13
$int 0x40
$mov cl, 10
363,6 → 361,15
$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
376,25 → 383,14
$int 0x40;
}
 
void WriteTextB(dword x,y,byte fontType, dword color, EDX)
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
{
EAX = 4;
EBX = x<<16+y;
ECX = fontType<<24+color;
$int 0x40;
$add ebx, 1<<16
$int 0x40
}
 
void WriteText(dword x,y,byte fontType, dword color, EDX)
{
EAX = 4;
EBX = x<<16+y;
ECX = fontType<<24+color;
$xor esi, esi
$int 0x40;
}
 
void WriteNumber(dword x,y,byte fontType, dword color, count, ECX)
{
EAX = 47;
452,7 → 448,6
 
void DrawBar(dword x,y,w,h,EDX)
{
if (h<=0) || (h>65000) return; //bad boy :)
EAX = 13;
EBX = x<<16+w;
ECX = y<<16+h;
462,23 → 457,11
void DefineButton(dword x,y,w,h,EDX,ESI)
{
EAX = 8;
$push edx
EDX += BT_DEL;
$int 0x40;
$pop edx
EBX = x<<16+w;
ECX = y<<16+h;
$int 0x40
}
 
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
{
EAX = 8;
EBX = x<<16+w;
ECX = y<<16+h;
$int 0x40
}
 
inline fastcall void DeleteButton( EDX)
{
EAX = 8;
/programs/cmm/lib/strings.h
1,7 → 1,7
//------------------------------------------------------------------------------
// strcmp( ESI, EDI)
// strlen( EDI)
// strcpy( EDI, ESI) --- 0 if ==
// strcpy( EDI, ESI)
// strcat( EDI, ESI)
// strchr( ESI,BL)
// strrchr( ESI,BL)
9,11 → 9,9
// itoa( ESI)
// atoi( EAX)
// strupr( ESI)
// strlwr( ESI) --- kyrillic symbols may not work
// strlwr( ESI) ----- âîçìîæíî íå ïîääåðæèâàåò êèðèëëèöó
// strttl( EDX)
// strtok( ESI)
// strcpyb(dword searchin, copyin, startstr, endstr) --- copy string between strings
//chrnum(dword searchin, char symbol) --- count of symbol in string
//------------------------------------------------------------------------------
 
inline fastcall signed int strcmp( ESI, EDI)
51,6 → 49,39
}
 
 
 
/*
 
inline fastcall signed int strcmpi( ESI,EDI)
uses EBX
{
do{
$lodsb
IF(AL>='a')&&(AL<='z')AL-=0x20;
BL=DSBYTE[(E)DI];
IF(BL>='a')&&(BL<='z')BL-=0x20;
AL-=BL;
IF(!ZEROFLAG)BREAK;
(E)DI++;
}while(BL!=0);
}
 
inline char STRNCMPI((E)SI,(E)DI,(E)CX)
{
(E)AX=0;
LOOPNZ((E)CX){
$lodsb
IF(AL>='a')&&(AL<='z')AL-=0x20;
AH=DSBYTE[EDI];
IF(AH>='a')&&(AH<='z')AH-=0x20;
EDI++;
IF(AL==0)||(AH==0)||(AL!=AH)BREAK;
}
AL=AL-AH;
}*/
 
 
 
inline fastcall unsigned int strlen( EDI)
{
$xor eax, eax
63,11 → 94,11
inline fastcall strcpy( EDI, ESI)
{
$cld
L2:
l2:
$lodsb
$stosb
$test al,al
$jnz L2
$jnz l2
}
 
 
125,17 → 156,17
 
$mov eax, esi
$push -'0'
F2:
f2:
$xor edx, edx
$div ecx
$push edx
$test eax, eax
$jnz F2
F3:
$jnz f2
f3:
$pop eax
$add al, '0'
$stosb
$jnz F3
$jnz f3
$mov al, '\0'
$stosb
155,7 → 186,7
BL=DSBYTE[ESI]-'0';
EAX=EAX*10+EBX;
ESI++;
}while(DSBYTE[ESI]>='0');
}while(DSBYTE[ESI]>0);
IF(DSBYTE[EDI]=='-') -EAX;
}
 
263,37 → 294,9
}
}
 
//
void strcpyb(dword searchin, copyin, startstr, endstr)
{
dword startp, endp;
startp = strstr(searchin, startstr) + strlen(startstr);
endp = strstr(startp, endstr);
if (startp==endp) return;
do
{
DSBYTE[copyin] = DSBYTE[startp];
copyin++;
startp++;
}
while (startp<endp);
DSBYTE[copyin] = '\0';
}
 
int chrnum(dword searchin, char symbol)
{
int num = 0;
while(DSBYTE[searchin])
{
if (DSBYTE[searchin] == symbol) num++;
searchin++;
}
return num;
}
 
 
 
 
/* strtok( LPSTR dest, src, divs);
src - óêàçàòåëü íà èñõîäíóþ ñòðîêó èëè ðåçóëüòàò ïðåäûäóùåãî âûçîâà
dest - óêàçàòåëü íà áóôåð, êóäà áóäåò ñêîïèðîâàíî ñëîâî
/programs/cmm/lib/scroll_lib.h
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 - ¢¥«¨ç¨­  ᬥ饭¨ï ¯à¨ ®¤­®ªà â­®¬ ­ ¦ â¨¨ ¡®ª®¢®© ª­®¯ª¨.
/programs/cmm/lib/libimg_lib.h
0,0 → 1,104
//Asper
 
//library
dword libimg = #alibimg;
char alibimg[21] = "/sys/lib/libimg.obj\0";
 
dword libimg_init = #alibimg_init;
dword img_is_img = #aimg_is_img;
dword img_to_rgb2 = #aimg_to_rgb2;
dword img_decode = #aimg_decode;
dword img_destroy = #aimg_destroy;
dword img_draw = #aimg_draw;
//dword img_flip = #aimg_flip;
//dword img_rotate = #aimg_rotate;
 
dword am1__ = 0x0;
dword bm1__ = 0x0;
 
//import libimg , \
char alibimg_init[9] = "lib_init\0";
char aimg_is_img[11] = "img_is_img\0";
char aimg_to_rgb2[12] = "img_to_rgb2\0";
char aimg_decode[11] = "img_decode\0";
char aimg_destroy[12] = "img_destroy\0";
char aimg_draw[9] = "img_draw\0";
//char aimg_flip[9] = "img_flip\0";
//char aimg_rotate[11] = "img_rotate\0 ";
 
 
 
dword load_image(dword filename)
{
//align 4
dword img_data=0;
dword img_data_len=0;
dword fh=0;
dword image=0;
 
byte tmp_buf[40];
$and img_data, 0
//$mov eax, filename
//$push eax
//invoke file.open, eax, O_READ
file_open stdcall (filename, O_READ);
$or eax, eax
$jnz loc05
$stc
return 0;
@loc05:
$mov fh, eax
//invoke file.size
file_size stdcall (filename);
$mov img_data_len, ebx
//stdcall mem.Alloc, ebx
mem_Alloc(EBX);
$test eax, eax
$jz error_close
$mov img_data, eax
//invoke file.read, [fh], eax, [img_data_len]
file_read stdcall (fh, EAX, img_data_len);
$cmp eax, -1
$jz error_close
$cmp eax, img_data_len
$jnz error_close
//invoke file.close, [fh]
file_close stdcall (fh);
$inc eax
$jz error_
//; img.decode checks for img.is_img
//; //invoke img.is_img, [img_data], [img_data_len]
//; $or eax, eax
//; $jz exit
//invoke img.decode, [img_data], [img_data_len], 0
EAX=img_data;
img_decode stdcall (EAX, img_data_len,0);
$or eax, eax
$jz error_
$cmp image, 0
$pushf
$mov image, eax
//call init_frame
$popf
//call update_image_sizes
mem_Free(img_data);//free_img_data(img_data);
$clc
return image;
 
@error_free:
//invoke img.destroy, [image]
img_destroy stdcall (image);
$jmp error_
 
@error_pop:
$pop eax
$jmp error_
@error_close:
//invoke file.close, [fh]
file_close stdcall (fh);
@error_:
mem_Free(img_data);
$stc
return 0;
}
/programs/cmm/lib/libio_lib.h
0,0 → 1,36
//Asper
 
//library
dword libio = #alibio;
char alibio[21] = "/sys/lib/libio.obj\0"; //"libio.obj\0";
 
dword libio_init = #alibio_init;
dword file_size = #afile_size;
dword file_open = #afile_open;
dword file_read = #afile_read;
dword file_close = #afile_close;
 
dword am2__ = 0x0;
dword bm2__ = 0x0;
 
 
//import libio , \
char alibio_init[9] = "lib_init\0";
char afile_size[11] = "file_size\0";
char afile_open[12] = "file_open\0";
char afile_read[11] = "file_read\0";
char afile_close[12] = "file_close\0";
 
//align 4
//dword fh=0;
 
#define O_BINARY 0
#define O_READ 1
#define O_WRITE 2
#define O_CREATE 4
#define O_SHARE 8
#define O_TEXT 16
 
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
/programs/cmm/lib/mem.h
1,5 → 1,5
 
dword mem_init()
//mem.Init
dword mem_Init()
{
$push ebx
$mov eax, 68
10,7 → 10,8
return EAX;
}
 
dword malloc(dword size)
//mem.Alloc
dword mem_Alloc(dword size)
{
$push ebx
$push ecx
24,7 → 25,8
return EAX;
}
 
stdcall dword realloc(dword mptr, size)
//mem.ReAlloc
stdcall dword mem_ReAlloc(dword mptr, size)
{
$push ebx
$push ecx
41,7 → 43,8
return EAX;
}
 
dword free(dword mptr)
//mem.Free
void mem_Free(dword mptr)
{
$push eax
$push ebx
56,10 → 59,10
$pop ecx
$pop ebx
$pop eax
return 0;
}
 
inline fastcall memmov( EDI, ESI, ECX)
//stdcall dword ??
inline fastcall mem_Move( EDI, ESI, ECX)
{
asm {
MOV EAX, ECX
89,10 → 92,6
}
}
 
#define mem_Alloc malloc
#define mem_ReAlloc realloc
#define mem_Free free
#define mem_Init mem_init
 
/*:void fastcall memsetz( EDI, ECX)
{
107,7 → 106,7
}
}
 
:void fastcall memset( EDI, ECX, AL) //copy AL to EDI of ECX num (void *dest, size_t, char c )
:void fastcall memset( EDI, ECX, AL)
{
asm {
MOV AH, AL
/programs/cmm/lib/memory.h
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:
}
}
/programs/cmm/lib/truetype.h
0,0 → 1,29
//ýòî âñòàâèòü ïîñëå çàãðóçêè îñíîâíûõ áèáëèîòåê
char fontinfo[28];
dword libtruetype = #att;
char att[] = "/sys/lib/truetype.obj"; //"truetype.obj\0";
dword truetype = #att_truetype;
dword get_length = #att_get_length;
dword get_width = #att_get_width;
dword text_out = #att_text_out;
dword init_font = #att_init_font;
dword am3__ = 0x0;
dword bm3__ = 0x0;
//import libimg , \
char att_truetype[] = "truetype";
char att_get_length[] = "get_length";
char att_get_width[] = "get_width";
char att_text_out[] = "text_out";
char att_init_font[] = "init_font";
//load_dll2(libtruetype, #truetype,0);
//à ýòî - â ìîìåíò îòðèñîâêè îêíà
//text_out stdcall (#text, -1, 40, 0xFF0000, 100, 100);
/programs/cmm/browser/HTMLv.c
1,9 → 1,8
//HTML Viewer in C--
//Copyright 2007-2012 by Veliant & Leency
//Asper, lev, Lrz, Barsuk, Nable...
//Asper, lev, Lrz, Barsuk, Nable.
//home icon - rachel fu, GPL licence
 
//libraries
#include "..\lib\kolibri.h"
#include "..\lib\strings.h"
#include "..\lib\figures.h"
11,12 → 10,13
#include "..\lib\file_system.h"
#include "..\lib\mem.h"
#include "..\lib\dll.h"
//*.obj libraries
#include "..\lib\lib.obj\box_lib.h"
#include "..\lib\lib.obj\libio_lib.h"
#include "..\lib\lib.obj\libimg_lib.h"
#include "..\lib\lib.obj\truetype.h"
//images
//áèáëèîòåêè .obj
#include "..\lib\libio_lib.h"
#include "..\lib\libimg_lib.h"
#include "..\lib\edit_box_lib.h"
#include "..\lib\scroll_lib.h"
#include "..\lib\truetype.h"
//êàðòèíêè
#include "img\toolbar_icons.c"
#include "img\URLgoto.txt";
 
92,10 → 92,11
int scroll_used=0;
mem_Init();
if (load_dll2(boxlib, #box_lib_init,0)!=0) {notify("System Error: library doesn't exists /rd/1/lib/box_lib.obj"); ExitProcess();}
if (load_dll2(libio, #libio_init,1)!=0) debug("Error: library doesn't exists - libio"w);
if (load_dll2(libimg, #libimg_init,1)!=0) debug("Error: library doesn't exists - libimg"w);
if (load_dll2(libtruetype, #truetype,0)!=0) {debug("Error: library doesn't exists - TrueType"w); use_truetype = 2; }
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();}
load_dll2(#abox_lib, #boxlib_init,0);
if (load_dll2(libtruetype, #truetype,0)!=0) {debug("Íå óäàëîñü ïîäêëþ÷èòü áèáëèîòåêó TrueType"w); use_truetype = 2; }
else init_font(#fontlol);
if (!URL) strcpy(#URL, "/sys/home.htm");
/programs/cmm/browser/TWB.h
314,11 → 314,11
if (!filesize)
{
DrawBar(left, top, width+4, height, 0xFFFFFF); //çàêðàøèâàåì âñ¸ äîíèçó
if (GetProcessSlot(downloader_id)<>0) WriteText(left + 10, top + 18, 0x80, 0, "Loading...");
if (GetProcessSlot(downloader_id)<>0) WriteText(left + 10, top + 18, 0x80, 0, "Loading...", 0);
else
{
WriteText(left + 10, top + 18, 0x80, 0, "Page not found. May be, URL contains some errors.");
if (!strcmp(get_URL_part(5),"http:"))) WriteText(left + 10, top + 32, 0x80, 0, "Or Internet unavilable for your configuration.");
WriteText(left + 10, top + 18, 0x80, 0, "Page not found. May be, URL contains some errors.", 0);
if (!strcmp(get_URL_part(5),"http:"))) WriteText(left + 10, top + 32, 0x80, 0, "Or Internet unavilable for your configuration.", 0);
}
//return;
}
551,7 → 551,7
}
else
{
WriteText(start_x, start_y, 0x80, text_colors[text_color_index], #line);
WriteText(start_x, start_y, 0x80, text_colors[text_color_index], #line, 0);
IF (b_text) { $add ebx, 1<<16 $int 0x40 }
}
IF (i_text) Skew(start_x, start_y, line_length+6, 10);
558,7 → 558,7
IF (s_text) DrawBar(start_x, start_y + 4, line_length, 1, text_colors[text_color_index]);
IF (u_text) DrawBar(start_x, start_y + 8, line_length, 1, text_colors[text_color_index]);
IF (link) {
UnsafeDefineButton(start_x-2, start_y, line_length + 3, 9, blink + BT_HIDE, 0xB5BFC9);
DefineButton(start_x-2, start_y, line_length + 3, 9, blink + BT_HIDE, 0xB5BFC9);
DrawBar(start_x, start_y + 8, line_length, 1, text_colors[text_color_index]);
}
stolbec += strlen(#line);
/programs/cmm/browser/include/menu_rmb.h
85,7 → 85,7
{
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]);
WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2],0);
if (ITEMS_LIST[i*2+1]==1) && (pre_text==2) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444);
if (ITEMS_LIST[i*2+1]==5) && (use_truetype==1) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444);
}
/programs/cmm/notify/notify.c
20,7 → 20,7
if (!param)
{
if (GetSystemLanguage()==4)
strcpy(#param, "â  ¯à®£à ¬¬  ¯®ª §ë¢ ¥â 㢥¤®¬«¥­¨ï.");
strcpy(#param, "Ýòà ïðîãðàììà ïîêàçûâàåò óâåäîìëåíèÿ."w);
else
strcpy(#param, "This program shows notices. Open it with params.");
}
51,16 → 51,16
DefineAndDrawWindow(SCREEN_SIZE_X-WIN_SIZE_X,WIN_Y,WIN_SIZE_X, WIN_SIZE_Y, 0x01, 0, 0, 0x01fffFFF);
DefineButton(0,0, WIN_SIZE_X, WIN_SIZE_Y, 1+BT_HIDE+BT_NOFRAME, 0);
draw_grid();
WriteText(TEXT_X-1,TEXT_Y, 0x80, 0,#param); //òåíü
WriteText(TEXT_X+1,TEXT_Y, 0x80, 0,#param);
WriteText(TEXT_X,TEXT_Y-1, 0x80, 0,#param);
WriteText(TEXT_X,TEXT_Y+1, 0x80, 0,#param);
WriteText(TEXT_X-1,TEXT_Y-1, 0x80, 0,#param);
WriteText(TEXT_X+1,TEXT_Y+1, 0x80, 0,#param);
WriteText(TEXT_X-1,TEXT_Y+1, 0x80, 0,#param);
WriteText(TEXT_X+1,TEXT_Y-1, 0x80, 0,#param);
WriteText(TEXT_X-1,TEXT_Y, 0x80, 0,#param,0); //òåíü
WriteText(TEXT_X+1,TEXT_Y, 0x80, 0,#param,0);
WriteText(TEXT_X,TEXT_Y-1, 0x80, 0,#param,0);
WriteText(TEXT_X,TEXT_Y+1, 0x80, 0,#param,0);
WriteText(TEXT_X-1,TEXT_Y-1, 0x80, 0,#param,0);
WriteText(TEXT_X+1,TEXT_Y+1, 0x80, 0,#param,0);
WriteText(TEXT_X-1,TEXT_Y+1, 0x80, 0,#param,0);
WriteText(TEXT_X+1,TEXT_Y-1, 0x80, 0,#param,0);
WriteText(TEXT_X,TEXT_Y, 0x80, 0xFFFfff,#param);
WriteText(TEXT_X,TEXT_Y, 0x80, 0xFFFfff,#param,0);
break;
default:
ExitProcess();
/programs/cmm/tmpdisk/t_window.c
178,9 → 178,9
DrawBar(0,31, Form.width-9,Form.height-GetSkinHeight()-5-30, 0xFFFFFF);
if (disk_num==0)
{
WriteText(17,45, 0x90, 0x777777, INTRO_TEXT_1);
WriteText(17,45+15, 0x90, 0x777777, INTRO_TEXT_2);
WriteText(17,45+42, 0x90, 0x777777, INTRO_TEXT_3);
WriteText(17,45, 0x90, 0x777777, INTRO_TEXT_1, 0);
WriteText(17,45+15, 0x90, 0x777777, INTRO_TEXT_2, 0);
WriteText(17,45+42, 0x90, 0x777777, INTRO_TEXT_3, 0);
return;
};
if (selected>=disk_num) selected=disk_num-1; //âîññòàíàâëèâàåò âûäåëåíèå - õîðîøàÿ ôè÷à
188,7 → 188,7
for (i=0; i<disk_num; i++)
{
DefineButton(disk_pos_x[i], disk_pos_y[i], 60, 20, 20+i, 0xFFFfff);
WriteText(disk_pos_x[i]+25,disk_pos_y[i]+6, 0x90, 0, #disk_list[i].Item);
WriteText(disk_pos_x[i]+25,disk_pos_y[i]+6, 0x90, 0, #disk_list[i].Item, 0);
_PutImage(disk_pos_x[i]+5,disk_pos_y[i]+4, 14,14, 3*14*14*3+#icons);
if (selected==i) DrawRectangle(disk_pos_x[i], disk_pos_y[i], 60-1, 20-1, 0x00459A);
}
235,7 → 235,7
{
DefineButton(x,5, strlen(but_text[i])*6+28,19, 10+i, sc.work_button);
_PutImage(x+3,8, 14,14, i*14*14*3+#icons);
WriteText(x+22,11, 0x80, sc.work_button_text, but_text[i]);
WriteText(x+22,11, 0x80, sc.work_button_text, but_text[i], 0);
x+=strlen(but_text[i])*6+37;
}
/programs/cmm/rb/rb.c
1,7 → 1,6
//@RB - v0.6
 
#include "..\lib\kolibri.h"
#include "..\lib\strings.h"
#include "..\lib\figures.h"
#include "..\lib\file_system.h"
 
81,7 → 80,7
{
//feel clicking
DrawBar(1, items_cur*ITEM_HEIGHT+2, ITEM_WIDTH-1, ITEM_HEIGHT-2, sc.work_graph);
WriteText(8,items_cur*ITEM_HEIGHT+6,0x80,sc.work_button_text,ITEMS_LIST[items_cur*3]);
WriteText(8,items_cur*ITEM_HEIGHT+6,0x80,sc.work_button_text,ITEMS_LIST[items_cur*3],0);
pause(4);
ItemProcess(items_cur);
130,12 → 129,12
DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, 1, sc.work_graph);
DrawBar(1, i+1*ITEM_HEIGHT, ITEM_WIDTH-1, 1, 0xFFFfff);
DrawBar(1, i*ITEM_HEIGHT+2, ITEM_WIDTH-1, ITEM_HEIGHT-2, sc.work_button);
WriteText(8,i*ITEM_HEIGHT+6,0x80,sc.work_button_text,ITEMS_LIST[i*3]);
WriteText(8,i*ITEM_HEIGHT+6,0x80,sc.work_button_text,ITEMS_LIST[i*3],0);
}
else
{
DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, sc.work);
WriteText(8,i*ITEM_HEIGHT+6,0x80,sc.work_text,ITEMS_LIST[i*3]);
WriteText(8,i*ITEM_HEIGHT+6,0x80,sc.work_text,ITEMS_LIST[i*3],0);
}
}
}
/programs/cmm/new_end/end.c
43,7 → 43,7
{
int key;
pause(10);
Pause(10);
WIN_SIZE_X=GetScreenWidth()+1;
WIN_SIZE_Y=GetScreenHeight()+1;
119,7 → 119,7
for (i=0; i<4; i++)
{
DefineButton(PANEL_X+33, i*23 + PANEL_Y+NIGHT_PALEL_HEIGHT+16, 190,19, BUTTONS_CAPTIONS[i*2+1],sc.work_button);
WriteText(PANEL_X+59, i*23 + PANEL_Y+NIGHT_PALEL_HEIGHT+22, 0x80,sc.work_button_text, BUTTONS_CAPTIONS[i*2]);
WriteText(PANEL_X+59, i*23 + PANEL_Y+NIGHT_PALEL_HEIGHT+22, 0x80,sc.work_button_text, BUTTONS_CAPTIONS[i*2], 0);
}
draw_stars();