ReactOS 0.4.16-dev-125-g798ea90
message.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MATRIX_MESSAGE
 

Functions

void SetMessageFont (HWND hwnd, TCHAR *szFontName, int nPointSize, BOOL fBold)
 
MATRIX_MESSAGEInitMatrixMessage (HWND hwnd, int width, int height)
 

Function Documentation

◆ InitMatrixMessage()

MATRIX_MESSAGE * InitMatrixMessage ( HWND  hwnd,
int  width,
int  height 
)

Definition at line 229 of file message.c.

230{
232
233 if((msg = malloc(sizeof(MATRIX_MESSAGE))) == 0)
234 return 0;
235
237
238 msg->msgindex = 0;
239 msg->width = min(width, MAXMSG_WIDTH);
240 msg->height = min(height, MAXMSG_HEIGHT);
241 msg->counter = -(int)(crc_rand() % MSGSPEED_MIN + MSGSPEED_MIN);
242
243 msg->random_reg1 = (WORD)GetTickCount();
244
246
248
249 return msg;
250}
#define msg(x)
Definition: auth_time.c:54
#define malloc
Definition: debug_ros.c:4
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
unsigned short WORD
Definition: ntddk_ex.h:93
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
#define MAXMSG_WIDTH
Definition: globals.h:23
#define MAXMSG_HEIGHT
Definition: globals.h:24
TCHAR g_szMessages[MAX_MESSAGES][MAXMSG_LENGTH]
Definition: settings.c:13
BOOL g_fFontBold
Definition: settings.c:22
TCHAR g_szFontName[]
Definition: settings.c:16
int g_nFontSize
Definition: settings.c:20
#define MSGSPEED_MIN
Definition: globals.h:28
int crc_rand()
Definition: matrix.c:18
void SetMessageFont(HWND hwnd, TCHAR *szFontName, int nPointSize, BOOL fBold)
Definition: message.c:201
void ClearMatrixMessage(MATRIX_MESSAGE *msg)
Definition: message.c:129
void SetMatrixMessage(MATRIX_MESSAGE *msg, HFONT hFont, TCHAR *text)
Definition: message.c:38
#define min(a, b)
Definition: monoChain.cc:55
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by CreateMatrix().

◆ SetMessageFont()

void SetMessageFont ( HWND  hwnd,
TCHAR szFontName,
int  nPointSize,
BOOL  fBold 
)

Definition at line 201 of file message.c.

202{
203 int lfHeight;
204 HDC hdc;
205 HFONT hFont;
206
207 hdc = GetDC(hwnd);
208
209 lfHeight = -MulDiv(nPointSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
210
212
213 hFont = CreateFont(lfHeight, 0, 0, 0, fBold ? FW_BOLD: FW_NORMAL, 0, 0, 0,
216
217 if(hFont != 0)
218 {
219 if(g_hFont != 0)
221
222 g_hFont = hFont;
223 }
224}
HFONT hFont
Definition: main.c:53
pKey DeleteObject()
HFONT g_hFont
Definition: settings.c:25
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
#define DEFAULT_PITCH
Definition: wingdi.h:443
#define ANTIALIASED_QUALITY
Definition: wingdi.h:440
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define LOGPIXELSY
Definition: wingdi.h:719
#define OUT_DEFAULT_PRECIS
Definition: wingdi.h:415
#define CreateFont
Definition: wingdi.h:4443
#define ANSI_CHARSET
Definition: wingdi.h:383
#define CLIP_DEFAULT_PRECIS
Definition: wingdi.h:426
#define FW_NORMAL
Definition: wingdi.h:373
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by InitMatrixMessage(), and UpdatePreview().