complete update c-- libraries

git-svn-id: svn://kolibrios.org@3107 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2012-12-15 00:16:06 +00:00
parent 14d166eb1e
commit 11403613c7
19 changed files with 230 additions and 279 deletions

View File

@ -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 @@ void main()
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");

View File

@ -314,11 +314,11 @@ void TWebBrowser::ShowPage()
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,14 +551,14 @@ void TWebBrowser::DrawPage() //
}
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);
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);

View File

@ -85,7 +85,7 @@ void menu_rmb()
{
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);
}

View File

@ -1,3 +1,5 @@
//#include "strings.h"
void DrawRectangle(dword x,y,width,height,color1)
{
DrawBar(x,y,width,1,color1);

View File

@ -35,7 +35,7 @@ char program_path[4096];
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 ScancodesGeting(){
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,14 +187,16 @@ struct proc_info
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)
{
$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 @@ inline fastcall void debug( EDX)
$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 @@ void DefineAndDrawWindow(dword x,y, sizeX,sizeY, byte WindowType,dword WindowAre
$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,12 +376,23 @@ inline fastcall void DrawTitle( ECX)
$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)
@ -448,6 +452,7 @@ inline fastcall void PutPixel( EBX,ECX,EDX)
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;
@ -456,7 +461,19 @@ void DrawBar(dword x,y,w,h,EDX)
void DefineButton(dword x,y,w,h,EDX,ESI)
{
EAX = 8;
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

View File

@ -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] ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 

View File

@ -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 @@ dword ChangeCharset(dword from_chs, to_chs, conv_buf)
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));

View File

@ -1,5 +1,5 @@
//mem.Init
dword mem_Init()
dword mem_init()
{
$push ebx
$mov eax, 68
@ -10,8 +10,7 @@ dword mem_Init()
return EAX;
}
//mem.Alloc
dword mem_Alloc(dword size)
dword malloc(dword size)
{
$push ebx
$push ecx
@ -25,8 +24,7 @@ dword mem_Alloc(dword size)
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 @@ stdcall dword mem_ReAlloc(dword mptr, size)
return EAX;
}
//mem.Free
void mem_Free(dword mptr)
dword free(dword mptr)
{
$push eax
$push ebx
@ -59,10 +56,10 @@ void mem_Free(dword mptr)
$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 @@ L2:
}
}
#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 @@ L2:
}
}
: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

View File

@ -1,66 +0,0 @@
#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:
}
}

View File

@ -1,95 +0,0 @@
//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,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 @@ L1:
}
/*
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 unsigned int strlen( EDI)
inline fastcall strcpy( EDI, ESI)
{
$cld
l2:
L2:
$lodsb
$stosb
$test al,al
$jnz l2
$jnz L2
}
@ -156,17 +125,17 @@ dword itoa( ESI)
$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 @@ inline fastcall dword atoi( EDI)
BL=DSBYTE[ESI]-'0';
EAX=EAX*10+EBX;
ESI++;
}while(DSBYTE[ESI]>0);
}while(DSBYTE[ESI]>='0');
IF(DSBYTE[EDI]=='-') -EAX;
}
@ -294,6 +263,34 @@ LS3:
}
}
//
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;
}

View File

@ -43,7 +43,7 @@ void main()
{
int key;
Pause(10);
pause(10);
WIN_SIZE_X=GetScreenWidth()+1;
WIN_SIZE_Y=GetScreenHeight()+1;
@ -119,7 +119,7 @@ void draw_main_area()
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();

View File

@ -20,7 +20,7 @@ void main()
if (!param)
{
if (GetSystemLanguage()==4)
strcpy(#param, "Ýòà ïðîãðàììà ïîêàçûâàåò óâåäîìëåíèÿ."w);
strcpy(#param, "<EFBFBD>â  ¯à®£à ¬¬  ¯®ª §ë¢ ¥â 㢥¤®¬«¥­¨ï.");
else
strcpy(#param, "This program shows notices. Open it with params.");
}
@ -51,16 +51,16 @@ void main()
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();

View File

@ -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 @@ void window()
{
//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 @@ void window()
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]);
}
}
}

View File

@ -178,9 +178,9 @@ void DrawTmpDisks()
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 @@ void DrawTmpDisks()
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 @@ void Draw_Window()
{
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;
}