/programs/cmm/browser/HTMLv.c |
---|
1,8 → 1,9 |
//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" |
10,13 → 11,12 |
#include "..\lib\file_system.h" |
#include "..\lib\mem.h" |
#include "..\lib\dll.h" |
//áèáëèîòåêè .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" |
//êàðòèíêè |
//*.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 |
#include "img\toolbar_icons.c" |
#include "img\URLgoto.txt"; |
92,11 → 92,10 |
int scroll_used=0; |
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();} |
load_dll2(#abox_lib, #boxlib_init,0); |
if (load_dll2(libtruetype, #truetype,0)!=0) {debug("Íå óäàëîñü ïîäêëþ÷èòü áèáëèîòåêó TrueType"w); use_truetype = 2; } |
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; } |
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...", 0); |
if (GetProcessSlot(downloader_id)<>0) WriteText(left + 10, top + 18, 0x80, 0, "Loading..."); |
else |
{ |
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); |
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."); |
} |
//return; |
} |
551,7 → 551,7 |
} |
else |
{ |
WriteText(start_x, start_y, 0x80, text_colors[text_color_index], #line, 0); |
WriteText(start_x, start_y, 0x80, text_colors[text_color_index], #line); |
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) { |
DefineButton(start_x-2, start_y, line_length + 3, 9, blink + BT_HIDE, 0xB5BFC9); |
UnsafeDefineButton(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],0); |
WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2]); |
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/lib/scroll_lib.h |
---|
File deleted |
/programs/cmm/lib/memory.h |
---|
File deleted |
/programs/cmm/lib/truetype.h |
---|
File deleted |
/programs/cmm/lib/network.h |
---|
File deleted |
/programs/cmm/lib/libimg_lib.h |
---|
File deleted |
/programs/cmm/lib/libio_lib.h |
---|
File deleted |
/programs/cmm/lib/figures.h |
---|
1,3 → 1,5 |
//#include "strings.h" |
void DrawRectangle(dword x,y,width,height,color1) |
{ |
DrawBar(x,y,width,1,color1); |
/programs/cmm/lib/kolibri.h |
---|
35,7 → 35,7 |
struct mouse |
{ |
int x,y,lkm,pkm,hor,vert; |
signed 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; |
void GetInfo( ECX); |
byte reserved[1024-71]; |
dword cwidth,cheight; |
byte reserved[1024-71-8]; |
}; |
inline fastcall void GetProcessInfo( EBX, ECX) |
195,6 → 195,8 |
{ |
$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 |
320,14 → 322,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 |
361,15 → 363,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 |
383,14 → 376,25 |
$int 0x40; |
} |
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI) |
void WriteTextB(dword x,y,byte fontType, dword color, EDX) |
{ |
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; |
448,6 → 452,7 |
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; |
457,11 → 462,23 |
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/lib.obj/box_lib.h |
---|
0,0 → 1,95 |
//BOX_LIB - Asper |
dword boxlib = #aEdit_box_lib; |
char aEdit_box_lib[22]="/sys/lib/box_lib.obj\0"; |
dword box_lib_init = #aboxlib_init; |
dword edit_box_draw = #aEdit_box_draw; |
dword edit_box_key = #aEdit_box_key; |
dword edit_box_mouse = #aEdit_box_mouse; |
dword version_ed = #aVersion_ed; |
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 am__ = 0x0; |
dword bm__ = 0x0; |
char aEdit_box_draw[9] = "edit_box\0"; |
char aEdit_box_key[13] = "edit_box_key\0"; |
char aEdit_box_mouse[15] = "edit_box_mouse\0"; |
char aVersion_ed[11] = "version_ed\0"; |
char aboxlib_init[9] = "lib_init\0"; |
char aScrollbar_v_draw[17] = "scrollbar_v_draw\0"; |
char aScrollbar_v_mouse[18] = "scrollbar_v_mouse\0"; |
char aScrollbar_h_draw[17] = "scrollbar_h_draw\0"; |
char aScrollbar_h_mouse[18] = "scrollbar_h_mouse\0"; |
char aVersion_scrollbar[18] = "version_scrollbar\0"; |
char aCheck_box_draw [15] = "check_box_draw\0"; |
char aCheck_box_mouse [16] = "check_box_mouse\0"; |
char aVersion_ch [11] = "version_ch\0"; |
char aOption_box_draw [16] = "option_box_draw\0"; |
char aOption_box_mouse[17] = "option_box_mouse\0"; |
char aVersion_op [11] = "version_op\0" ; |
struct edit_box{ |
dword width, left, top, color, shift_color, focus_border_color, blur_border_color, |
text_color, max, text, mouse_variable, flags, size, pos, offset, cl_curs_x, cl_curs_y, shift, shift_old; |
}; |
struct 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] |
}; |
//ed_width equ [edi] ;è¨à¨ ª®¬¯®¥â |
//ed_left equ [edi+4] ;¯®«®¦¥¨¥ ¯® ®á¨ å |
//ed_top equ [edi+8] ;¯®«®¦¥¨¥ ¯® ®á¨ ã |
//ed_color equ [edi+12] ;梥â ä® ª®¬¯®¥â |
//shift_color equ [edi+16] ;=0x6a9480 |
//ed_focus_border_color equ [edi+20] ;梥â à ¬ª¨ ª®¬¯®¥â |
//ed_blur_border_color equ [edi+24] ;梥⠥ ªâ¨¢®£® ª®¬¯®¥â |
//ed_text_color equ [edi+28] ;梥â ⥪áâ |
//ed_max equ [edi+32] ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦® ¬ ªá¨¬ «ì® ¢¢¥á⨠|
//ed_text equ [edi+36] ;㪠§ â¥«ì ¡ãä¥à |
//ed_flags equ [edi+40] ;ä« £¨ |
//ed_size equ [edi+42] ;ª®«-¢® ᨬ¢®«®¢ |
//ed_pos equ [edi+46] ;¯®§¨æ¨ï ªãàá®à |
//ed_offset equ [edi+50] ;ᬥ饨¥ |
//cl_curs_x equ [edi+54] ;¯à¥¤ë¤ãé ï ª®®à¤¨ â ªãàá®à ¯® å |
//cl_curs_y equ [edi+58] ;¯à¥¤ë¤ãé ï ª®®à¤¨ â ªãàá®à ¯® ã |
//ed_shift_pos equ [edi+62] ;¯®«®¦¥¨¥ ªãàá®à |
//ed_shift_pos_old equ [edi+66] ;áâ ஥ ¯®«®¦¥¨¥ ªãàá®à |
/programs/cmm/lib/lib.obj/iconv.h |
---|
1,4 → 1,4 |
//Network library |
//convert text characters |
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: semething is wrong with stdcall iconv()"); |
debug("iconv: something is wrong with stdcall iconv()"); |
debug(itoa(cd)); |
debug("in_len"); |
debug(itoa(in_len)); |
/programs/cmm/lib/lib.obj/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/lib.obj/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/lib.obj/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/lib.obj/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/lib/mem.h |
---|
1,5 → 1,5 |
//mem.Init |
dword mem_Init() |
dword mem_init() |
{ |
$push ebx |
$mov eax, 68 |
10,8 → 10,7 |
return EAX; |
} |
//mem.Alloc |
dword mem_Alloc(dword size) |
dword malloc(dword size) |
{ |
$push ebx |
$push ecx |
25,8 → 24,7 |
return EAX; |
} |
//mem.ReAlloc |
stdcall dword mem_ReAlloc(dword mptr, size) |
stdcall dword realloc(dword mptr, size) |
{ |
$push ebx |
$push ecx |
43,8 → 41,7 |
return EAX; |
} |
//mem.Free |
void mem_Free(dword mptr) |
dword free(dword mptr) |
{ |
$push eax |
$push ebx |
59,10 → 56,10 |
$pop ecx |
$pop ebx |
$pop eax |
return 0; |
} |
//stdcall dword ?? |
inline fastcall mem_Move( EDI, ESI, ECX) |
inline fastcall memmov( EDI, ESI, ECX) |
{ |
asm { |
MOV EAX, ECX |
92,6 → 89,10 |
} |
} |
#define mem_Alloc malloc |
#define mem_ReAlloc realloc |
#define mem_Free free |
#define mem_Init mem_init |
/*:void fastcall memsetz( EDI, ECX) |
{ |
106,7 → 107,7 |
} |
} |
:void fastcall memset( EDI, ECX, AL) |
:void fastcall memset( EDI, ECX, AL) //copy AL to EDI of ECX num (void *dest, size_t, char c ) |
{ |
asm { |
MOV AH, AL |
/programs/cmm/lib/strings.h |
---|
1,7 → 1,7 |
//------------------------------------------------------------------------------ |
// strcmp( ESI, EDI) |
// strlen( EDI) |
// strcpy( EDI, ESI) |
// strcpy( EDI, ESI) --- 0 if == |
// strcat( EDI, ESI) |
// strchr( ESI,BL) |
// strrchr( ESI,BL) |
9,9 → 9,11 |
// itoa( ESI) |
// atoi( EAX) |
// strupr( ESI) |
// strlwr( ESI) ----- âîçìîæíî íå ïîääåðæèâàåò êèðèëëèöó |
// strlwr( ESI) --- kyrillic symbols may not work |
// 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) |
49,39 → 51,6 |
} |
/* |
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 |
94,11 → 63,11 |
inline fastcall strcpy( EDI, ESI) |
{ |
$cld |
l2: |
L2: |
$lodsb |
$stosb |
$test al,al |
$jnz l2 |
$jnz L2 |
} |
156,17 → 125,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 |
186,7 → 155,7 |
BL=DSBYTE[ESI]-'0'; |
EAX=EAX*10+EBX; |
ESI++; |
}while(DSBYTE[ESI]>0); |
}while(DSBYTE[ESI]>='0'); |
IF(DSBYTE[EDI]=='-') -EAX; |
} |
294,9 → 263,37 |
} |
} |
// |
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/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], 0); |
WriteText(PANEL_X+59, i*23 + PANEL_Y+NIGHT_PALEL_HEIGHT+22, 0x80,sc.work_button_text, BUTTONS_CAPTIONS[i*2]); |
} |
draw_stars(); |
/programs/cmm/notify/notify.c |
---|
20,7 → 20,7 |
if (!param) |
{ |
if (GetSystemLanguage()==4) |
strcpy(#param, "Ýòà ïðîãðàììà ïîêàçûâàåò óâåäîìëåíèÿ."w); |
strcpy(#param, "â ¯à®£à ¬¬ ¯®ª §ë¢ ¥â 㢥¤®¬«¥¨ï."); |
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,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-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,TEXT_Y, 0x80, 0xFFFfff,#param,0); |
WriteText(TEXT_X,TEXT_Y, 0x80, 0xFFFfff,#param); |
break; |
default: |
ExitProcess(); |
/programs/cmm/rb/rb.c |
---|
1,6 → 1,7 |
//@RB - v0.6 |
#include "..\lib\kolibri.h" |
#include "..\lib\strings.h" |
#include "..\lib\figures.h" |
#include "..\lib\file_system.h" |
80,7 → 81,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],0); |
WriteText(8,items_cur*ITEM_HEIGHT+6,0x80,sc.work_button_text,ITEMS_LIST[items_cur*3]); |
pause(4); |
ItemProcess(items_cur); |
129,12 → 130,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],0); |
WriteText(8,i*ITEM_HEIGHT+6,0x80,sc.work_button_text,ITEMS_LIST[i*3]); |
} |
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],0); |
WriteText(8,i*ITEM_HEIGHT+6,0x80,sc.work_text,ITEMS_LIST[i*3]); |
} |
} |
} |
/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, 0); |
WriteText(17,45+15, 0x90, 0x777777, INTRO_TEXT_2, 0); |
WriteText(17,45+42, 0x90, 0x777777, INTRO_TEXT_3, 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); |
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, 0); |
WriteText(disk_pos_x[i]+25,disk_pos_y[i]+6, 0x90, 0, #disk_list[i].Item); |
_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], 0); |
WriteText(x+22,11, 0x80, sc.work_button_text, but_text[i]); |
x+=strlen(but_text[i])*6+37; |
} |