Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7647 → Rev 7648

/programs/demos/eyes/trunk/eyes.asm
5,12 → 5,8
;
; Position of "eyes" is fixed. To close "eyes" just click on them.
;
; NOTE: quite big timeout is used to disable blinking when redrawing.
; If "eyes" blink on your system, enlarge the TIMEOUT. If not, you can
; decrease it due to more realistic movement.
;
 
TIMEOUT equ 5
TIMEOUT equ 3
 
; EXECUTABLE HEADER
 
39,9 → 35,7
 
call draw_eyes ; draw those funny "eyes"
 
mov eax,23 ; wait for event with timeout
mov ebx,TIMEOUT
mcall
mcall 23,TIMEOUT ; wait for event with timeout
 
cmp eax,1 ; redraw ?
jnz no_draw
59,13 → 53,11
; EVENTS
 
key:
mov eax,2 ; just read and ignore
mcall
mcall 2 ; just read and ignore
jmp still
 
button: ; analyze button
mov eax,-1 ; this is button 1 - we have only one button :-)
mcall
mcall -1 ; exit
jmp still
 
; -====- declarations -====-
100,29 → 92,20
 
redraw_overlap: ; label for redraw event (without checkmouse)
 
mov eax,12
mov ebx,1
mcall
mcall 12,1
 
xor eax,eax ; define window
mov ebx,[win_ebx]
mov ecx,[win_ecx]
xor edx,edx
mov edx,0x11000000 ; do not draw window, just define its area
xor esi,esi
xor edi,edi
mcall
 
mov eax,8 ; define closebutton
mov ebx,60
mov ecx,45
mov edx,1
mcall
mcall 8,60,45,1+0x40000000 ; define closebutton
 
mov eax,7
mov ebx,skindata
mov ecx,60*65536+30
mov edx,15
mcall
mcall 7,,60*65536+30,15
 
mov eax,15
mov ebx,30
130,9 → 113,7
add eax,30
call draw_eye_point
 
mov eax,12
mov ebx,2
mcall
mcall 12,2
 
ret
 
/programs/media/piano/piano.asm
816,6 → 816,10
;--- Ž…„…‹…ˆ… ˆ Ž’ˆ‘Ž‚Š€ ŽŠ€ ----------------------------------
;---------------------------------------------------------------------
 
WHITE_W=48 ; While key width
BLACK_W=30 ; Black key width
BLACK_X=34 ; Black key X offset
 
draw_window:
 
mcall 12, 1 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ® ­ ç «¥ ®âà¨á®¢ª¨
835,61 → 839,61
 
mov edx, [sc.work] ; 梥â ä®­ 
or edx, 0x33000000 ; ¨ ⨯ ®ª­  3
mcall 0, <0,760>, <200,250>, , ,title
mcall 0, <20,WHITE_W*15+9>, <200,250>, , ,title
 
mcall 8, <0,50>, <0,100>, 0x21, 0xff7a74
mcall 8, <50,50>, <0,100>, 0x23, 0x907040
mcall 8, <100,50>, <0,100>, 0x25, 0xa08050
mcall 8, <150,50>, <0,100>, 0x26, 0xb09060
mcall 8, <200,50>, <00,100>, 0x28, 0xc0a070
mcall 8, <250,50>, <00,100>, 0x2a, 0xd0b080
mcall 8, <300,50>, <0,100>, 0x2c, 0xe0c090
mcall 8, <350,50>, <0,100>, 0x31, 0xffa97c
mcall 8, <400,50>, <0,100>, 0x33, 0xaf8d8d
mcall 8, <450,50>, <0,100>, 0x35, 0xbf9d9d
mcall 8, <500,50>, <0,100>, 0x36, 0xcfadad
mcall 8, <550,50>, <00,100>, 0x38, 0xdfbdbd
mcall 8, <600,50>, <00,100>, 0x3a, 0xefcdcd
mcall 8, <650,50>, <0,100>, 0x3c, 0xffdddd
mcall 8, <700,50>, <0,100>, 0x41, 0xffe558
mcall 8, <WHITE_W*0,WHITE_W>, <0,100>, 0x21, 0xff7a74
mcall 8, <WHITE_W*1,WHITE_W>, <0,100>, 0x23, 0x907040
mcall 8, <WHITE_W*2,WHITE_W>, <0,100>, 0x25, 0xa08050
mcall 8, <WHITE_W*3,WHITE_W>, <0,100>, 0x26, 0xb09060
mcall 8, <WHITE_W*4,WHITE_W>, <00,100>, 0x28, 0xc0a070
mcall 8, <WHITE_W*5,WHITE_W>, <00,100>, 0x2a, 0xd0b080
mcall 8, <WHITE_W*6,WHITE_W>, <0,100>, 0x2c, 0xe0c090
mcall 8, <WHITE_W*7,WHITE_W>, <0,100>, 0x31, 0xffa97c
mcall 8, <WHITE_W*8,WHITE_W>, <0,100>, 0x33, 0xaf8d8d
mcall 8, <WHITE_W*9,WHITE_W>, <0,100>, 0x35, 0xbf9d9d
mcall 8, <WHITE_W*10,WHITE_W>, <0,100>, 0x36, 0xcfadad
mcall 8, <WHITE_W*11,WHITE_W>, <00,100>, 0x38, 0xdfbdbd
mcall 8, <WHITE_W*12,WHITE_W>, <00,100>, 0x3a, 0xefcdcd
mcall 8, <WHITE_W*13,WHITE_W>, <0,100>, 0x3c, 0xffdddd
mcall 8, <WHITE_W*14,WHITE_W>, <0,100>, 0x41, 0xffe558
 
mcall 8, <35,30>, <0,50>, 0x22, 0x221100
mcall 8, <85,30>, <0,50>, 0x24, 0x221100
mcall 8, <185,30>, <0,50>, 0x27, 0x221100
mcall 8, <235,30>, <0,50>, 0x29, 0x221100
mcall 8, <285,30>, <0,50>, 0x2b, 0x221100
mcall 8, <385,30>, <0,50>, 0x32, 0x221100
mcall 8, <435,30>, <0,50>, 0x34, 0x221100
mcall 8, <535,30>, <0,50>, 0x37, 0x221100
mcall 8, <585,30>, <0,50>, 0x39, 0x221100
mcall 8, <635,30>, <0,50>, 0x3b, 0x221100
mcall 8, <WHITE_W*0+BLACK_X,BLACK_W>, <0,50>, 0x22, 0x221100
mcall 8, <WHITE_W*1+BLACK_X,BLACK_W>, <0,50>, 0x24, 0x221100
mcall 8, <WHITE_W*3+BLACK_X,BLACK_W>, <0,50>, 0x27, 0x221100
mcall 8, <WHITE_W*4+BLACK_X,BLACK_W>, <0,50>, 0x29, 0x221100
mcall 8, <WHITE_W*5+BLACK_X,BLACK_W>, <0,50>, 0x2b, 0x221100
mcall 8, <WHITE_W*7+BLACK_X,BLACK_W>, <0,50>, 0x32, 0x221100
mcall 8, <WHITE_W*8+BLACK_X,BLACK_W>, <0,50>, 0x34, 0x221100
mcall 8, <WHITE_W*10+BLACK_X,BLACK_W>, <0,50>, 0x37, 0x221100
mcall 8, <WHITE_W*11+BLACK_X,BLACK_W>, <0,50>, 0x39, 0x221100
mcall 8, <WHITE_W*12+BLACK_X,BLACK_W>, <0,50>, 0x3b, 0x221100
 
mcall 8, <0,50>, <100,100>, 0xa1, 0x702050
mcall 8, <50,50>, <100,100>, 0x03, 0x683638
mcall 8, <100,50>, <100,100>, 0x05, 0x784648
mcall 8, <150,50>, <100,100>, 0x06, 0x885658
mcall 8, <200,50>, <100,100>, 0x08, 0x986668
mcall 8, <250,50>, <100,100>, 0x0a, 0xa87678
mcall 8, <300,50>, <100,100>, 0x0c, 0xb88688
mcall 8, <350,50>, <100,100>, 0x11, 0x880040
mcall 8, <400,50>, <100,100>, 0x13, 0x90622b
mcall 8, <450,50>, <100,100>, 0x15, 0xa0723b
mcall 8, <500,50>, <100,100>, 0x16, 0xb0824b
mcall 8, <550,50>, <100,100>, 0x18, 0xc0925b
mcall 8, <600,50>, <100,100>, 0x1a, 0xd0a26b
mcall 8, <650,50>, <100,100>, 0x1c, 0xe0b27b
mcall 8, <700,50>, <100,100>, 0x21, 0xff7a74
mcall 8, <WHITE_W*0,WHITE_W>, <100,100>, 0xa1, 0x702050
mcall 8, <WHITE_W*1,WHITE_W>, <100,100>, 0x03, 0x683638
mcall 8, <WHITE_W*2,WHITE_W>, <100,100>, 0x05, 0x784648
mcall 8, <WHITE_W*3,WHITE_W>, <100,100>, 0x06, 0x885658
mcall 8, <WHITE_W*4,WHITE_W>, <100,100>, 0x08, 0x986668
mcall 8, <WHITE_W*5,WHITE_W>, <100,100>, 0x0a, 0xa87678
mcall 8, <WHITE_W*6,WHITE_W>, <100,100>, 0x0c, 0xb88688
mcall 8, <WHITE_W*7,WHITE_W>, <100,100>, 0x11, 0x880040
mcall 8, <WHITE_W*8,WHITE_W>, <100,100>, 0x13, 0x90622b
mcall 8, <WHITE_W*9,WHITE_W>, <100,100>, 0x15, 0xa0723b
mcall 8, <WHITE_W*10,WHITE_W>, <100,100>, 0x16, 0xb0824b
mcall 8, <WHITE_W*11,WHITE_W>, <100,100>, 0x18, 0xc0925b
mcall 8, <WHITE_W*12,WHITE_W>, <100,100>, 0x1a, 0xd0a26b
mcall 8, <WHITE_W*13,WHITE_W>, <100,100>, 0x1c, 0xe0b27b
mcall 8, <WHITE_W*14,WHITE_W>, <100,100>, 0x21, 0xff7a74
 
mcall 8, <35,30>, <100,50>, 0x02, 0x221100
mcall 8, <85,30>, <100,50>, 0x04, 0x221100
mcall 8, <185,30>, <100,50>, 0x07, 0x221100
mcall 8, <235,30>, <100,50>, 0x09, 0x221100
mcall 8, <285,30>, <100,50>, 0x0b, 0x221100
mcall 8, <385,30>, <100,50>, 0x12, 0x221100
mcall 8, <435,30>, <100,50>, 0x14, 0x221100
mcall 8, <535,30>, <100,50>, 0x17, 0x221100
mcall 8, <585,30>, <100,50>, 0x19, 0x221100
mcall 8, <635,30>, <100,50>, 0x1b, 0x221100
mcall 8, <WHITE_W*0+BLACK_X,BLACK_W>, <100,50>, 0x02, 0x221100
mcall 8, <WHITE_W*1+BLACK_X,BLACK_W>, <100,50>, 0x04, 0x221100
mcall 8, <WHITE_W*3+BLACK_X,BLACK_W>, <100,50>, 0x07, 0x221100
mcall 8, <WHITE_W*4+BLACK_X,BLACK_W>, <100,50>, 0x09, 0x221100
mcall 8, <WHITE_W*5+BLACK_X,BLACK_W>, <100,50>, 0x0b, 0x221100
mcall 8, <WHITE_W*7+BLACK_X,BLACK_W>, <100,50>, 0x12, 0x221100
mcall 8, <WHITE_W*8+BLACK_X,BLACK_W>, <100,50>, 0x14, 0x221100
mcall 8, <WHITE_W*10+BLACK_X,BLACK_W>, <100,50>, 0x17, 0x221100
mcall 8, <WHITE_W*11+BLACK_X,BLACK_W>, <100,50>, 0x19, 0x221100
mcall 8, <WHITE_W*12+BLACK_X,BLACK_W>, <100,50>, 0x1b, 0x221100
 
 
; ¢ë¢®¤ ⥪á⮢®© áâப¨
900,14 → 904,7
mcall 4, <10, 260>, , message2
mcall 4, <10, 285>, , message3
mcall 4, <10, 310>, , message4
mcall 4, <15, 185>, , message5
mcall 4, <65, 185>, , message6
mcall 4, <115, 185>, , message7
mcall 4, <165, 185>, , message8
mcall 4, <210, 185>, , message9
mcall 4, <265, 185>, , message10
mcall 4, <315, 185>, , message11
mcall 4, <365, 185>, , message5
mcall 4, <16, 185>, , t_notes
 
mcall 12, 2 ; äã­ªæ¨ï 12.2, § ª®­ç¨«¨ à¨á®¢ âì
 
929,16 → 926,10
 
message db '‘¯à ¢ª : éñ«ª­¨â¥ 2 à §  ­  § £®«®¢ª¥.',0
message1 db ' ¦¬¨â¥ «î¡ãî ª« ¢¨èã ¢  ­£«¨©áª®© à áª« ¤ª¥ - ',0
message2 db '¤®«¦¥­ §¢ãç âì ¤¨­ ¬¨ª ª®¬¯ìîâ¥à .',0
message2 db '¤®«¦¥­ §¢ãç âì ¢áâ஥­­ë© ¤¨­ ¬¨ª ª®¬¯ìîâ¥à  (­¥ ª®«®­ª¨!)',0
message3 db '®â  "„®" - ª« ¢¨è¨ V,Tab,U,Enter, ¯à¨ ¢ª«î祭¨¨',0
message4 db 'Caps Lock - ª« ¢¨è¨ V,Q,I.',0
message5 db '„Ž',0
message6 db '…',0
message7 db 'Œˆ',0
message8 db '”€',0
message9 db '‘Ž‹œ',0
message10 db '‹Ÿ',0
message11 db '‘ˆ',0
t_notes db '„Ž … Œˆ ”€ ‘Ž‹œ ‹Ÿ ‘ˆ „Ž',0
title db '„¥â᪮¥ ¯¨ ­¨­®',0
 
;---------------------------------------------------------------------
/programs/other/graph/func.cpp
388,4 → 388,12
}
 
 
Dword kos_GetSkinHeight()
{
__asm{
mov eax, 48
mov ebx, 4
int 0x40
}
}
 
/programs/other/graph/func.h
27,6 → 27,7
} TCoord;
 
 
Dword kos_GetSkinHeight();
void kos_DrawLine( Word x1, Word y1, Word x2, Word y2, Dword colour, Dword invert);
void DrawRegion(Dword x,Dword y,Dword width,Dword height,Dword color1);
int atoi(const char* string);
/programs/other/graph/hello.cpp
43,11 → 43,10
double x1,y1,x2,y2;
char *funct = NULL;
 
char edit_path[1024];
//Dword editbox_y = WND_H - 16, editbox_w = WND_W - 70;
edit_box mybox = {0,9*8-5,WND_H - 16-32,0xffffff,0x94AECE,0,0x808080,0,sizeof(edit_path),0,(dword)&edit_path, 0, 0}; //100000000000010b};
char edit_path[256];
edit_box mybox = {0,92,WND_H-16-32,0xffffff,0x94AECE,0,0x808080,0x10000000,
sizeof(edit_path)-1,0,(dword)&edit_path, 0, 0};
 
 
char *full_head;
 
char *HugeBuf = NULL;
380,11 → 379,8
double d;
Dword filesize, num_number;
 
double *p2;
double *p2=0;
 
if (edit_path[0] == '\0')
return 0;
 
// get file size
strcpy(fileInfo.fileURL,edit_path);
fileInfo.OffsetLow = 0;
397,7 → 393,7
rtlDebugOutString(debuf);
if (rr != 0)
{
kos_WriteTextToWindow(10,10,0,0x00,(char*)er_file_not_found,strlen(er_file_not_found));
kos_WriteTextToWindow(10,10,0x90,0xFF0000,(char*)er_file_not_found,strlen(er_file_not_found));
return 0;
}
 
552,51 → 548,39
void draw_window(void)
{
double xx0=0.0, yy0=0.0;
 
kos_WindowRedrawStatus(1);
kos_DefineAndDrawWindow(100,80,WND_W,WND_H, 0x33,0xFFFFFF,0,0,(Dword)full_head);
kos_WindowRedrawStatus(2);
 
sProcessInfo info;
Dword wi, he;
void *p;
 
for (int i = 0; i < 1024; i++)
info.rawData[i] = 0;
kos_ProcessInfo(&info, 0xFFFFFFFF);
int cWidth = info.processInfo.width - 9;
int cHeight = info.processInfo.height - kos_GetSkinHeight() - 4;
 
p = info.rawData + 42; // magic
wi = *(Dword *)(p);
he = *(Dword *)((Byte *)p + 4);
mybox.top = cHeight - 50;
mybox.width = cWidth - mybox.left - 80;
 
if (wi == 0)
wi = WND_W;
if (he == 0)
he = WND_H;
if (info.processInfo.status_window&0x04) return; //draw nothing if window is rolled-up
 
mybox.top = he - 50;
mybox.width = wi - mybox.left - 80;
 
kos_WindowRedrawStatus(1);
kos_DefineAndDrawWindow(10,40,WND_W,WND_H, 0x33,0xFFFFFF,0,0,(Dword)full_head);
kos_WindowRedrawStatus(2);
 
if (info.rawData[70]&0x04) return; //íè÷åãî íå äåëàòü åñëè îêíî ñõëîïíóòî â çàãîëîâîê
 
if (point_count == 0 && funct == NULL)
{
kos_WriteTextToWindow((wi - 6 * strlen(empty_text))/2,he/2,0,0x000000,(char *)empty_text,strlen(empty_text));
kos_WriteTextToWindow((cWidth - 8 * strlen(empty_text))/2,cHeight/2-25,0x90,
0x000000,(char *)empty_text,strlen(empty_text));
}
else
{
drawFunction(&fu, coord(10, 20), coord(id(wi - 20), id(he - 70)),
drawFunction(&fu, coord(10, 20), coord(id(cWidth - 20), id(cHeight - 70)),
coord(x1,y1), coord(x2,y2), 0x00ff0000);
 
}
 
kos_WriteTextToWindow(4, mybox.top + 4, 0, 0, (char*)str_filename, strlen(str_filename));
kos_WriteTextToWindow(15, mybox.top + 4, 0x90, 0x000000, (char*)str_filename, strlen(str_filename));
 
if ((void*)edit_box_draw != NULL)
edit_box_draw((DWORD)&mybox);
 
kos_DefineButton(wi - 70, mybox.top, 50, 12, 5, 0xc0c0c0);
kos_WriteTextToWindow(wi - 58, mybox.top + 4, 0, 0, (char*)str_editfile, strlen(str_editfile));
 
kos_DefineButton(cWidth - 70, mybox.top, 50, 21, 5, 0xc0c0c0);
kos_WriteTextToWindow(cWidth - 60, mybox.top + 4, 0x90, 0x000000, (char*)str_editfile,0);
}
 
void kos_Main()
/programs/other/graph/kosSyst.h
80,6 → 80,7
};
 
 
#pragma pack(push, 1)
union sProcessInfo
{
Byte rawData[1024];
87,7 → 88,7
{
Dword cpu_usage;
Word window_stack_position;
Word window_stack_value;
Word window_slot; //slot
Word reserved1;
char process_name[12];
Dword memory_start;
95,11 → 96,20
Dword PID;
Dword x_start;
Dword y_start;
Dword x_size;
Dword y_size;
Dword width;
Dword height;
Word slot_state;
Word reserved3;
Dword work_left;
Dword work_top;
Dword work_width;
Dword work_height;
char status_window;
Dword cwidth;
Dword cheight;
} processInfo;
};
#pragma pack(pop)
 
#ifndef AUTOBUILD
//