notify: optimizations, manual build

git-svn-id: svn://kolibrios.org@2862 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2012-07-13 08:13:19 +00:00
parent 7d7bbe9a8f
commit 5dfb64cfd9
3 changed files with 10 additions and 55 deletions

View File

@ -18,7 +18,7 @@
dd 0x0 ; зарезервировано
include 'macros.inc' ;
include "..\..\..\macros.inc"
;---------------------------------------------------------------------
;--- НАЧАЛО ПРОГРАММЫ ----------------------------------------------
@ -59,8 +59,7 @@ red: ; перерисовать окно
cmp ah, 1
jne still ; return if button id != 1
or eax, -1 ; exit application
mcall
call exit
key: ; key event handler
mov al, 2 ; get key code
@ -79,9 +78,7 @@ draw_window:
mcall 12, 1 ; функция 12: сообщить ОС об отрисовке окна
mov eax,14 ;получим ширину экрана
mov ebx, 4
mcall
mcall 14, 4 ;получим ширину экрана
shr eax, 16
and eax,0x0000FFFF
sub eax,300 ;отнимем от нее 300
@ -126,10 +123,10 @@ jmp drawy ;рисуем новую точку
fin: ;дорисовали
mcall 4, <3, 12>, 0x80000000, I_PARAM, 0 ;тень за текстом
mcall 4, <5, 12>, 0x80000000, I_PARAM, 0 ;
mcall 4, <4, 11>, 0x80000000, I_PARAM, 0 ;
mcall 4, <4, 13>, 0x80000000, I_PARAM, 0 ;
mcall 4, <4, 12>, 0x80EFEFEF, I_PARAM, 0 ;текст
mcall , <5, 12>
mcall , <4, 11>
mcall , <4, 13>
mcall , <4, 12>, 0x80EFEFEF ;текст
mcall 12, 2 ; конец рисования

View File

@ -1,45 +0,0 @@
#include "..\lib\kolibri.h--"
#include "..\lib\memory.h--"
// Kolibri Notify Daemon. v0.1 by SoUrcerer
dword id;
void main()
{
word key;
id=GetScreenWidth();
loop()
{
switch(WaitEvent())
{
case evButton:
id=GetButtonID();
ExitProcess();
break;
case evKey:
key = GetKey();
ExitProcess();
break;
case evReDraw:
draw_window();
break;
}
Pause (500);
ExitProcess();
}
}
void draw_window()
{
WindowRedrawStatus(1);
DefineAndDrawWindow(id-300,0,300,44,0x30000000,0x1012141F,0,0,"Kolibri Notify");
// DefineButton(0,300,0,96,0x30000001,0x0) ;
WriteText(7,7,0x80,0xFFFFFF,"Kolibri Notify",0);
WriteText(7,25,0x80,0xEFEFEF,I_Param,0);
WindowRedrawStatus(2);
}
stop:

View File

@ -0,0 +1,3 @@
@fasm @notify.asm @notify
@kpack @notify
@pause