f196b0aa6c0d4c140d8b653faa53528ee110358c
[reactos.git] / reactos / base / applications / screensavers / matrix / matrix.h
1 #ifndef MATRIX_INCLUDED
2 #define MATRIX_INCLUDED
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 //
9 // Top BYTE of each glyph is used as flags
10 // (redraw state, intensity etc)
11 //
12 // Bottom BYTE of each glyph is the character value
13 //
14 // Bit: 15 14 13-8 | 7-0
15 //
16 // [Redraw][Blank][Intensity] [Glyph]
17 //
18 typedef unsigned short GLYPH;
19
20 #define GLYPH_REDRAW 0x8000
21 #define GLYPH_BLANK 0x4000
22
23 //
24 // The "matrix" is basically an array of these
25 // column structures, positioned side-by-side
26 //
27 typedef struct
28 {
29 BOOL state;
30 int countdown;
31
32 BOOL started;
33 int runlen;
34
35 int blippos;
36 int bliplen;
37
38 int length;
39 GLYPH *glyph;
40
41 } MATRIX_COLUMN;
42
43 typedef struct
44 {
45 int width;
46 int height;
47 int numcols;
48 int numrows;
49
50 // bitmap containing glyphs.
51 HDC hdcBitmap;
52 HBITMAP hbmBitmap;
53
54 MATRIX_MESSAGE *message;
55
56 MATRIX_COLUMN column[1];
57
58 } MATRIX;
59
60 GLYPH RandomGlyph(int intensity);
61 void DrawGlyph(MATRIX *matrix, HDC hdc, int xpos, int ypos, GLYPH glyph);
62
63 HWND CreateScreenSaveWnd(HWND hwndParent, RECT *rect);
64 void InitScreenSaveClass();
65
66 #ifdef __cplusplus
67 }
68 #endif
69
70 #endif