ReactOS  0.4.14-dev-297-g23e575c
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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
GLint GLint GLsizei width
Definition: gl.h:1546
TCHAR g_szMessages[MAX_MESSAGES][MAXMSG_LENGTH]
Definition: settings.c:13
void ClearMatrixMessage(MATRIX_MESSAGE *msg)
Definition: message.c:129
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
TCHAR g_szFontName[]
Definition: settings.c:16
#define MAXMSG_WIDTH
Definition: globals.h:23
void SetMatrixMessage(MATRIX_MESSAGE *msg, HFONT hFont, TCHAR *text)
Definition: message.c:38
#define MAXMSG_HEIGHT
Definition: globals.h:24
int crc_rand()
Definition: matrix.c:18
int g_nFontSize
Definition: settings.c:20
unsigned short WORD
Definition: ntddk_ex.h:93
BOOL g_fFontBold
Definition: settings.c:22
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define min(a, b)
Definition: monoChain.cc:55
void SetMessageFont(HWND hwnd, TCHAR *szFontName, int nPointSize, BOOL fBold)
Definition: message.c:201
#define msg(x)
Definition: auth_time.c:54
#define malloc
Definition: debug_ros.c:4
#define MSGSPEED_MIN
Definition: globals.h:28
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

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 
211  ReleaseDC(hwnd, hdc);
212 
213  hFont = CreateFont(lfHeight, 0, 0, 0, fBold ? FW_BOLD: FW_NORMAL, 0, 0, 0,
215  ANTIALIASED_QUALITY, DEFAULT_PITCH, szFontName);
216 
217  if(hFont != 0)
218  {
219  if(g_hFont != 0)
221 
222  g_hFont = hFont;
223  }
224 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ANTIALIASED_QUALITY
Definition: wingdi.h:439
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HFONT hFont
Definition: main.c:53
#define CLIP_DEFAULT_PRECIS
Definition: wingdi.h:425
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CreateFont
Definition: wingdi.h:4438
#define DEFAULT_PITCH
Definition: wingdi.h:442
#define OUT_DEFAULT_PRECIS
Definition: wingdi.h:414
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:377
HFONT g_hFont
Definition: settings.c:25
#define FW_NORMAL
Definition: wingdi.h:372
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define LOGPIXELSY
Definition: wingdi.h:718
#define ANSI_CHARSET
Definition: wingdi.h:382
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

Referenced by InitMatrixMessage(), and UpdatePreview().