2012-11-26 16:26:15 +01:00
|
|
|
|
//notify 0.5
|
2013-03-12 22:43:15 +01:00
|
|
|
|
//SoUrcerer 2010, Leency 2012-2013, GNU GPLv2
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
2013-02-27 21:53:46 +01:00
|
|
|
|
#define MEMSIZE 0x3E80
|
2012-11-26 16:26:15 +01:00
|
|
|
|
#include "..\lib\kolibri.h"
|
|
|
|
|
#include "..\lib\strings.h"
|
2013-03-11 19:16:24 +01:00
|
|
|
|
#include "..\lib\mem.h"
|
|
|
|
|
#include "..\lib\figures.h"
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
|
|
|
|
int SCREEN_SIZE_X,
|
|
|
|
|
SCREEN_SIZE_Y;
|
|
|
|
|
|
|
|
|
|
int WIN_Y=0,
|
|
|
|
|
WIN_SIZE_X=300,
|
|
|
|
|
WIN_SIZE_Y=28;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
|
int TEXT_X=4,
|
|
|
|
|
TEXT_Y=12;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
dword shadow_buf, lighter_pixel1, lighter_pixel2;
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
mem_Init();
|
2012-11-26 16:26:15 +01:00
|
|
|
|
if (!param)
|
|
|
|
|
{
|
|
|
|
|
if (GetSystemLanguage()==4)
|
2012-12-15 01:16:06 +01:00
|
|
|
|
strcpy(#param, "<EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> <20><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0> 㢥<><E3A2A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.");
|
2012-11-26 16:26:15 +01:00
|
|
|
|
else
|
|
|
|
|
strcpy(#param, "This program shows notices. Open it with params.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SCREEN_SIZE_X=GetScreenWidth()+1;
|
|
|
|
|
if (strlen(#param)*6>WIN_SIZE_X) WIN_SIZE_X=strlen(#param)*6+8;
|
|
|
|
|
|
|
|
|
|
TEXT_X=-6*strlen(#param)+WIN_SIZE_X/2;
|
|
|
|
|
TEXT_Y=WIN_SIZE_Y/2-3;
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
while (GetPixelColor(SCREEN_SIZE_X-1, SCREEN_SIZE_X, WIN_Y)==0x333333) WIN_Y+=WIN_SIZE_Y+17;
|
|
|
|
|
|
2013-03-12 22:36:50 +01:00
|
|
|
|
#if !defined(AUTOBUILD)
|
|
|
|
|
{
|
|
|
|
|
shadow_buf = malloc(WIN_SIZE_X*WIN_SIZE_Y*3);
|
|
|
|
|
lighter_pixel1 = malloc(3);
|
|
|
|
|
lighter_pixel2 = malloc(3);
|
|
|
|
|
CopyScreen(shadow_buf, SCREEN_SIZE_X-WIN_SIZE_X-1, WIN_Y, WIN_SIZE_X, WIN_SIZE_Y);
|
|
|
|
|
CopyScreen(lighter_pixel1, SCREEN_SIZE_X-WIN_SIZE_X-1, WIN_Y, 1, 1);
|
|
|
|
|
CopyScreen(lighter_pixel2, SCREEN_SIZE_X-WIN_SIZE_X-1, WIN_Y+WIN_SIZE_Y, 1, 1);
|
|
|
|
|
ShadowImage(shadow_buf, WIN_SIZE_X, WIN_SIZE_Y, 4);
|
|
|
|
|
ShadowImage(lighter_pixel1, 1, 1, 1);
|
|
|
|
|
ShadowImage(lighter_pixel2, 1, 1, 1);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
|
|
|
|
loop()
|
2013-03-12 22:36:50 +01:00
|
|
|
|
{
|
2012-11-26 16:26:15 +01:00
|
|
|
|
WaitEventTimeout(500);
|
|
|
|
|
switch(EAX & 0xFF)
|
|
|
|
|
{
|
|
|
|
|
case evButton:
|
|
|
|
|
if (GetButtonID()==1) ExitProcess();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evReDraw:
|
2013-03-11 19:16:24 +01:00
|
|
|
|
DefineAndDrawWindow(SCREEN_SIZE_X-WIN_SIZE_X,WIN_Y,WIN_SIZE_X, WIN_SIZE_Y-1, 0x01, 0, 0, 0x01fffFFF);
|
2012-11-26 16:26:15 +01:00
|
|
|
|
DefineButton(0,0, WIN_SIZE_X, WIN_SIZE_Y, 1+BT_HIDE+BT_NOFRAME, 0);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
//draw_grid();
|
|
|
|
|
//PutShadow(0,0,WIN_SIZE_X,WIN_SIZE_Y, 0, 4);
|
2013-03-12 22:36:50 +01:00
|
|
|
|
#ifdef AUTOBUILD
|
|
|
|
|
{ draw_grid(); }
|
|
|
|
|
#else
|
2013-03-12 22:43:15 +01:00
|
|
|
|
{
|
|
|
|
|
_PutImage(0,0,WIN_SIZE_X,WIN_SIZE_Y,shadow_buf);
|
|
|
|
|
PutPixel(0,0,ESDWORD[lighter_pixel1]);
|
|
|
|
|
PutPixel(0,WIN_SIZE_Y-1,ESDWORD[lighter_pixel2]);
|
|
|
|
|
}
|
2013-03-12 22:36:50 +01:00
|
|
|
|
#endif
|
2013-03-11 19:16:24 +01:00
|
|
|
|
DrawBar(WIN_SIZE_X,0, 1, WIN_SIZE_Y, 0x333333);
|
2012-12-15 01:16:06 +01:00
|
|
|
|
WriteText(TEXT_X-1,TEXT_Y, 0x80, 0,#param); //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
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);
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
2012-12-15 01:16:06 +01:00
|
|
|
|
WriteText(TEXT_X,TEXT_Y, 0x80, 0xFFFfff,#param);
|
2012-11-26 16:26:15 +01:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-12 22:36:50 +01:00
|
|
|
|
:void draw_grid()
|
2012-11-26 16:26:15 +01:00
|
|
|
|
{
|
|
|
|
|
int x, y;
|
|
|
|
|
|
|
|
|
|
for (y=0; y<=WIN_SIZE_Y; y++)
|
|
|
|
|
{
|
|
|
|
|
for (x=0; x<=WIN_SIZE_X; x++)
|
|
|
|
|
{
|
|
|
|
|
if (! y&1) && (! x&1) PutPixel(x, y, 0);
|
|
|
|
|
if ( y&1) && ( x&1) PutPixel(x, y, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stop:
|