2 AcessOS Window Manager
\r
6 #include "desktop_font.h"
\r
11 #define FGC 0xFFFFFFFF
\r
12 #define BGC 0xFF000000
\r
19 // === PROTOTYPES ===
\r
20 void Desktop_Init();
\r
21 int Desktop_WndProc(void *handle, int message, int arg1, int arg2);
\r
22 void Desktop_PrintAt(BITMAP *bmp, int x, int y, char *text);
\r
27 gHwnd = WM_CreateWindow(0, 0, -1, -1, Desktop_WndProc, WNDFLAG_NOBORDER|WNDFLAG_SHOW);
\r
30 //write(giConsoleFP, 32, "Unable to create desktop window\n");
\r
33 WM_SetTitle(gHwnd, "Desktop");
\r
36 int Desktop_WndProc(void *handle, int message, int arg1, int arg2)
\r
42 BITMAP *bmp = (BITMAP*)arg1;
\r
43 memset( bmp->data, BGC, bmp->width*bmp->height*4 );
\r
44 Desktop_PrintAt( bmp, 0, 0, "CAB@1337!" );
\r
51 return 1; // Handled
\r
54 void Desktop_PrintAt(BITMAP *bmp, int x, int y, char *text)
\r
59 if( bmp == NULL || text == NULL )
\r
69 int c = cFONT_ASCII[(int)*text][j];
\r
72 if(c&(1<<(7-k))) buf[j*w+k] = FGC;
\r
73 else buf[j*w+k] = BGC;
\r