ReactOS 0.4.15-dev-7918-g2a2556c
consup.c File Reference
#include <usetup.h>
#include <debug.h>
Include dependency graph for consup.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

BOOLEAN CONSOLE_Init (VOID)
 
VOID CONSOLE_ConInKey (OUT PINPUT_RECORD Buffer)
 
BOOLEAN CONSOLE_ConInKeyPeek (OUT PINPUT_RECORD Buffer)
 
VOID CONSOLE_ConOutChar (IN CHAR c)
 
VOID CONSOLE_ConOutPuts (IN LPCSTR szText)
 
VOID CONSOLE_ConOutPrintfV (IN LPCSTR szFormat, IN va_list args)
 
VOID __cdecl CONSOLE_ConOutPrintf (IN LPCSTR szFormat,...)
 
BOOL CONSOLE_Flush (VOID)
 
VOID CONSOLE_GetCursorXY (OUT PSHORT x, OUT PSHORT y)
 
SHORT CONSOLE_GetCursorX (VOID)
 
SHORT CONSOLE_GetCursorY (VOID)
 
VOID CONSOLE_SetCursorType (IN BOOL bInsert, IN BOOL bVisible)
 
VOID CONSOLE_SetCursorXY (IN SHORT x, IN SHORT y)
 
VOID CONSOLE_ClearScreen (VOID)
 
VOID CONSOLE_InvertTextXY (IN SHORT x, IN SHORT y, IN SHORT col, IN SHORT row)
 
VOID CONSOLE_NormalTextXY (IN SHORT x, IN SHORT y, IN SHORT col, IN SHORT row)
 
VOID CONSOLE_SetTextXY (IN SHORT x, IN SHORT y, IN LPCSTR Text)
 
VOID CONSOLE_ClearTextXY (IN SHORT x, IN SHORT y, IN SHORT Length)
 
VOID CONSOLE_SetInputTextXY (IN SHORT x, IN SHORT y, IN SHORT len, IN LPCWSTR Text)
 
VOID CONSOLE_SetUnderlinedTextXY (IN SHORT x, IN SHORT y, IN LPCSTR Text)
 
VOID CONSOLE_SetStatusTextXV (IN SHORT x, IN LPCSTR fmt, IN va_list args)
 
VOID __cdecl CONSOLE_SetStatusTextX (IN SHORT x, IN LPCSTR fmt,...)
 
VOID CONSOLE_SetStatusTextV (IN LPCSTR fmt, IN va_list args)
 
VOID __cdecl CONSOLE_SetStatusText (IN LPCSTR fmt,...)
 
static VOID CONSOLE_ClearStatusTextX (IN SHORT x, IN SHORT Length)
 
VOID __cdecl CONSOLE_SetStatusTextAutoFitX (IN SHORT x, IN LPCSTR fmt,...)
 
VOID CONSOLE_SetInvertedTextXY (IN SHORT x, IN SHORT y, IN LPCSTR Text)
 
VOID CONSOLE_SetHighlightedTextXY (IN SHORT x, IN SHORT y, IN LPCSTR Text)
 
VOID __cdecl CONSOLE_PrintTextXY (IN SHORT x, IN SHORT y, IN LPCSTR fmt,...)
 
VOID __cdecl CONSOLE_PrintTextXYN (IN SHORT x, IN SHORT y, IN SHORT len, IN LPCSTR fmt,...)
 
VOID CONSOLE_SetStyledText (IN SHORT x, IN SHORT y, IN INT Flags, IN LPCSTR Text)
 
VOID CONSOLE_ClearStyledText (IN SHORT x, IN SHORT y, IN INT Flags, IN SHORT Length)
 

Variables

HANDLE StdInput = NULL
 
HANDLE StdOutput = NULL
 
SHORT xScreen = 0
 
SHORT yScreen = 0
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 31 of file consup.c.

Function Documentation

◆ CONSOLE_ClearScreen()

VOID CONSOLE_ClearScreen ( VOID  )

Definition at line 239 of file consup.c.

240{
241 COORD coPos;
242 DWORD Written;
243
244 coPos.X = 0;
245 coPos.Y = 0;
246
247 /*
248 * Hide everything under the same foreground & background colors, so that
249 * the actual color and text blanking reset does not create a visual "blinking".
250 * We do this because we cannot do the screen scrolling trick that would
251 * allow to change both the text and the colors at the same time (the
252 * function is currently not available in our console "emulation" layer).
253 */
257 coPos,
258 &Written);
259
260 /* Blank the text */
262 ' ',
264 coPos,
265 &Written);
266
267 /* Reset the actual foreground & background colors */
271 coPos,
272 &Written);
273}
BOOL WINAPI FillConsoleOutputCharacterA(IN HANDLE hConsoleOutput, IN CHAR cCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
Definition: console.c:560
BOOL WINAPI FillConsoleOutputAttribute(IN HANDLE hConsoleOutput, IN WORD wAttribute, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfAttrsWritten)
Definition: console.c:525
#define BACKGROUND_BLUE
Definition: blue.h:65
#define FOREGROUND_BLUE
Definition: blue.h:61
SHORT yScreen
Definition: consup.c:40
SHORT xScreen
Definition: consup.c:39
HANDLE StdOutput
Definition: consup.c:37
#define FOREGROUND_WHITE
Definition: consup.h:29
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: bl.h:1338
ULONG Y
Definition: bl.h:1340
ULONG X
Definition: bl.h:1339

Referenced by BootLoaderRemovableDiskPage(), CommandCls(), RecoveryConsole(), RunUSetup(), and SelectFileSystemPage().

◆ CONSOLE_ClearStatusTextX()

static VOID CONSOLE_ClearStatusTextX ( IN SHORT  x,
IN SHORT  Length 
)
static

Definition at line 493 of file consup.c.

496{
497 COORD coPos;
498 DWORD Written;
499
500 coPos.X = x;
501 coPos.Y = yScreen - 1;
502
504 ' ',
505 Length,
506 coPos,
507 &Written);
508}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102

Referenced by CONSOLE_ClearStyledText().

◆ CONSOLE_ClearStyledText()

VOID CONSOLE_ClearStyledText ( IN SHORT  x,
IN SHORT  y,
IN INT  Flags,
IN SHORT  Length 
)

Definition at line 746 of file consup.c.

751{
752 COORD coPos;
753
754 coPos.X = x;
755 coPos.Y = y;
756
758 {
759 coPos.X = x;
760 coPos.Y = yScreen - 1;
761 }
762 else /* TEXT_TYPE_REGULAR (Default) */
763 {
764 coPos.X = x;
765 coPos.Y = y;
766 }
767
769 {
770 coPos.X = (xScreen - Length) / 2;
771 }
772 else if(Flags & TEXT_ALIGN_RIGHT)
773 {
774 coPos.X = coPos.X - Length;
775
777 {
778 coPos.X -= 1;
779 }
780 else if (Flags & TEXT_PADDING_MEDIUM)
781 {
782 coPos.X -= 2;
783 }
784 else if (Flags & TEXT_PADDING_BIG)
785 {
786 coPos.X -= 3;
787 }
788 }
789 else /* TEXT_ALIGN_LEFT (Default) */
790 {
792 {
793 coPos.X += 1;
794 }
795 else if (Flags & TEXT_PADDING_MEDIUM)
796 {
797 coPos.X += 2;
798 }
799 else if (Flags & TEXT_PADDING_BIG)
800 {
801 coPos.X += 3;
802 }
803 }
804
806 {
808 }
809 else if (Flags & TEXT_STYLE_UNDERLINE)
810 {
811 CONSOLE_ClearTextXY(coPos.X, coPos.Y, Length);
812 CONSOLE_ClearTextXY(coPos.X, coPos.Y + 1, Length);
813 }
814 else /* TEXT_TYPE_REGULAR (Default) */
815 {
816 CONSOLE_ClearTextXY(coPos.X, coPos.Y, Length);
817 }
818}
static VOID CONSOLE_ClearStatusTextX(IN SHORT x, IN SHORT Length)
Definition: consup.c:493
VOID CONSOLE_ClearTextXY(IN SHORT x, IN SHORT y, IN SHORT Length)
Definition: consup.c:339
#define TEXT_PADDING_SMALL
Definition: consup.h:49
#define TEXT_TYPE_STATUS
Definition: consup.h:40
#define TEXT_PADDING_BIG
Definition: consup.h:51
#define TEXT_ALIGN_CENTER
Definition: consup.h:46
#define TEXT_PADDING_MEDIUM
Definition: consup.h:50
#define TEXT_ALIGN_RIGHT
Definition: consup.h:44
#define TEXT_STYLE_UNDERLINE
Definition: consup.h:36
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by MUIClearPage(), and MUIClearStyledText().

◆ CONSOLE_ClearTextXY()

VOID CONSOLE_ClearTextXY ( IN SHORT  x,
IN SHORT  y,
IN SHORT  Length 
)

Definition at line 339 of file consup.c.

342{
343 COORD coPos;
344 DWORD Written;
345
346 coPos.X = x;
347 coPos.Y = y;
348
350 ' ',
351 Length,
352 coPos,
353 &Written);
354}

Referenced by CONSOLE_ClearStyledText(), and MUIClearText().

◆ CONSOLE_ConInKey()

VOID CONSOLE_ConInKey ( OUT PINPUT_RECORD  Buffer)

Definition at line 70 of file consup.c.

72{
73 DWORD Read;
74
75 while (TRUE)
76 {
77 /* Wait for a key press */
79
80 if ((Buffer->EventType == KEY_EVENT) &&
81 (Buffer->Event.KeyEvent.bKeyDown != FALSE))
82 {
83 break;
84 }
85 }
86}
Definition: bufpool.h:45
HANDLE StdInput
Definition: consup.c:36
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_In_ BOOLEAN Read
Definition: strmini.h:479
#define ReadConsoleInput
Definition: wincon.h:778
#define KEY_EVENT
Definition: wincon.h:128

Referenced by BootLoaderRemovableDiskPage(), BootLoaderSelectPage(), CheckFileSystemPage(), ConfirmDeleteSystemPartitionPage(), ConfirmQuit(), DeletePartitionPage(), DeviceSettingsPage(), FormatPartitionPage(), HandleGenericList(), InstallDirectoryPage(), InstallIntroPage(), LanguagePage(), LicensePage(), PopupError(), ReadCommand(), RepairIntroPage(), SelectFileSystemPage(), SelectPartitionPage(), ShowPartitionSizeInputBox(), UpgradeRepairPage(), and WelcomePage().

◆ CONSOLE_ConInKeyPeek()

BOOLEAN CONSOLE_ConInKeyPeek ( OUT PINPUT_RECORD  Buffer)

Definition at line 89 of file consup.c.

91{
92 DWORD Read = 0;
93
94 while (TRUE)
95 {
96 /* Try to get a key press without blocking */
98 return FALSE;
99 if (Read == 0)
100 return FALSE;
101
102 /* Consume it */
104
105 if ((Buffer->EventType == KEY_EVENT) &&
106 (Buffer->Event.KeyEvent.bKeyDown != FALSE))
107 {
108 return TRUE;
109 }
110 }
111}
#define PeekConsoleInput
Definition: wincon.h:776

Referenced by ProgressCountdown().

◆ CONSOLE_ConOutChar()

VOID CONSOLE_ConOutChar ( IN CHAR  c)

Definition at line 114 of file consup.c.

116{
117 DWORD Written;
118
120 &c,
121 1,
122 &Written,
123 NULL);
124}
#define NULL
Definition: types.h:112
const GLubyte * c
Definition: glext.h:8905
#define WriteConsole
Definition: wincon.h:784

Referenced by ClearCommandLine(), and ReadCommand().

◆ CONSOLE_ConOutPrintf()

VOID __cdecl CONSOLE_ConOutPrintf ( IN LPCSTR  szFormat,
  ... 
)

Definition at line 163 of file consup.c.

166{
167 va_list arg_ptr;
168
169 va_start(arg_ptr, szFormat);
170 CONSOLE_ConOutPrintfV(szFormat, arg_ptr);
171 va_end(arg_ptr);
172}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
VOID CONSOLE_ConOutPrintfV(IN LPCSTR szFormat, IN va_list args)
Definition: consup.c:145

Referenced by CommandDumpSector(), CommandHelp(), CommandPartInfo(), HelpCls(), HelpDumpSector(), HelpExit(), HelpHelp(), HelpPartInfo(), HexDump(), ReadCommand(), and RecoveryConsole().

◆ CONSOLE_ConOutPrintfV()

VOID CONSOLE_ConOutPrintfV ( IN LPCSTR  szFormat,
IN va_list  args 
)

Definition at line 145 of file consup.c.

148{
149 CHAR szOut[256];
150 DWORD dwWritten;
151
152 vsprintf(szOut, szFormat, args);
153
155 szOut,
156 (ULONG)strlen(szOut),
157 &dwWritten,
158 NULL);
159}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
Definition: match.c:390
uint32_t ULONG
Definition: typedefs.h:59
char CHAR
Definition: xmlstorage.h:175

Referenced by CONSOLE_ConOutPrintf().

◆ CONSOLE_ConOutPuts()

VOID CONSOLE_ConOutPuts ( IN LPCSTR  szText)

Definition at line 127 of file consup.c.

129{
130 DWORD Written;
131
133 szText,
134 (ULONG)strlen(szText),
135 &Written,
136 NULL);
138 "\n",
139 1,
140 &Written,
141 NULL);
142}

Referenced by DoCommand().

◆ CONSOLE_Flush()

BOOL CONSOLE_Flush ( VOID  )

Definition at line 175 of file consup.c.

176{
178}
BOOL WINAPI FlushConsoleInputBuffer(IN HANDLE hConsoleInput)
Definition: console.c:220

Referenced by BootLoaderRemovableDiskPage(), ProgressCountdown(), RunUSetup(), and SelectFileSystemPage().

◆ CONSOLE_GetCursorX()

SHORT CONSOLE_GetCursorX ( VOID  )

Definition at line 194 of file consup.c.

195{
197
199
200 return csbi.dwCursorPosition.X;
201}
BOOL WINAPI GetConsoleScreenBufferInfo(IN HANDLE hConsoleOutput, OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
Definition: console.c:595
SHORT X
Definition: blue.h:26

Referenced by ReadCommand().

◆ CONSOLE_GetCursorXY()

VOID CONSOLE_GetCursorXY ( OUT PSHORT  x,
OUT PSHORT  y 
)

Definition at line 181 of file consup.c.

184{
186
188
189 *x = csbi.dwCursorPosition.X;
190 *y = csbi.dwCursorPosition.Y;
191}
SHORT Y
Definition: blue.h:27

Referenced by ReadCommand().

◆ CONSOLE_GetCursorY()

SHORT CONSOLE_GetCursorY ( VOID  )

Definition at line 204 of file consup.c.

205{
207
209
210 return csbi.dwCursorPosition.Y;
211}

Referenced by ReadCommand().

◆ CONSOLE_Init()

BOOLEAN CONSOLE_Init ( VOID  )

Definition at line 45 of file consup.c.

46{
48
49 /* Allocate a new console */
50 if (!AllocConsole())
51 return FALSE;
52
53 /* Get the standard handles */
56
57 /* Retrieve the size of the console */
59 {
61 return FALSE;
62 }
63 xScreen = csbi.dwSize.X;
64 yScreen = csbi.dwSize.Y;
65
66 return TRUE;
67}
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:203
BOOL WINAPI AllocConsole(VOID)
Definition: console.c:74
BOOL WINAPI FreeConsole(VOID)
Definition: console.c:156
#define STD_OUTPUT_HANDLE
Definition: winbase.h:268
#define STD_INPUT_HANDLE
Definition: winbase.h:267

Referenced by RunUSetup().

◆ CONSOLE_InvertTextXY()

VOID CONSOLE_InvertTextXY ( IN SHORT  x,
IN SHORT  y,
IN SHORT  col,
IN SHORT  row 
)

Definition at line 276 of file consup.c.

281{
282 COORD coPos;
283 DWORD Written;
284
285 for (coPos.Y = y; coPos.Y < y + row; coPos.Y++)
286 {
287 coPos.X = x;
288
291 col,
292 coPos,
293 &Written);
294 }
295}
#define BACKGROUND_WHITE
Definition: consup.h:31
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

Referenced by BootLoaderSelectPage(), and DeviceSettingsPage().

◆ CONSOLE_NormalTextXY()

VOID CONSOLE_NormalTextXY ( IN SHORT  x,
IN SHORT  y,
IN SHORT  col,
IN SHORT  row 
)

Definition at line 298 of file consup.c.

303{
304 COORD coPos;
305 DWORD Written;
306
307 for (coPos.Y = y; coPos.Y < y + row; coPos.Y++)
308 {
309 coPos.X = x;
310
313 col,
314 coPos,
315 &Written);
316 }
317}

Referenced by BootLoaderSelectPage(), and DeviceSettingsPage().

◆ CONSOLE_PrintTextXY()

VOID __cdecl CONSOLE_PrintTextXY ( IN SHORT  x,
IN SHORT  y,
IN LPCSTR  fmt,
  ... 
)

Definition at line 595 of file consup.c.

600{
601 CHAR buffer[512];
602 va_list ap;
603 COORD coPos;
604 DWORD Written;
605
606 va_start(ap, fmt);
608 va_end(ap);
609
610 coPos.X = x;
611 coPos.Y = y;
612
614 buffer,
616 coPos,
617 &Written);
618}
BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE hConsoleOutput, IN LPCSTR lpCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
Definition: console.c:407
GLuint buffer
Definition: glext.h:5915
Definition: dsound.c:943
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

Referenced by CheckFileSystemPage(), CreatePartitionPage(), DeletePartitionPage(), FormatPartitionPage(), and SelectFileSystemPage().

◆ CONSOLE_PrintTextXYN()

VOID __cdecl CONSOLE_PrintTextXYN ( IN SHORT  x,
IN SHORT  y,
IN SHORT  len,
IN LPCSTR  fmt,
  ... 
)

Definition at line 622 of file consup.c.

628{
629 CHAR buffer[512];
630 va_list ap;
631 COORD coPos;
633 DWORD Written;
634
635 va_start(ap, fmt);
637 va_end(ap);
638
639 coPos.X = x;
640 coPos.Y = y;
641
643 if (Length > len - 1)
644 Length = len - 1;
645
647 buffer,
648 Length,
649 coPos,
650 &Written);
651
652 coPos.X += Length;
653
654 if (len > Length)
655 {
657 ' ',
658 len - Length,
659 coPos,
660 &Written);
661 }
662}
GLenum GLsizei len
Definition: glext.h:6722
short SHORT
Definition: pedump.c:59

◆ CONSOLE_SetCursorType()

VOID CONSOLE_SetCursorType ( IN BOOL  bInsert,
IN BOOL  bVisible 
)

Definition at line 214 of file consup.c.

217{
219
220 cci.dwSize = bInsert ? 10 : 99;
221 cci.bVisible = bVisible;
222
224}
BOOL WINAPI SetConsoleCursorInfo(IN HANDLE hConsoleOutput, IN const CONSOLE_CURSOR_INFO *lpConsoleCursorInfo)
Definition: console.c:618
static BOOL bInsert
Definition: cmdinput.c:121

Referenced by InstallDirectoryPage(), ReadCommand(), RunUSetup(), and ShowPartitionSizeInputBox().

◆ CONSOLE_SetCursorXY()

VOID CONSOLE_SetCursorXY ( IN SHORT  x,
IN SHORT  y 
)

Definition at line 227 of file consup.c.

230{
231 COORD coPos;
232
233 coPos.X = x;
234 coPos.Y = y;
236}
BOOL WINAPI SetConsoleCursorPosition(IN HANDLE hConsoleOutput, IN COORD dwCursorPosition)
Definition: console.c:641

Referenced by ClearCommandLine(), CommandCls(), InstallDirectoryPage(), ReadCommand(), RecoveryConsole(), and ShowPartitionSizeInputBox().

◆ CONSOLE_SetHighlightedTextXY()

VOID CONSOLE_SetHighlightedTextXY ( IN SHORT  x,
IN SHORT  y,
IN LPCSTR  Text 
)

Definition at line 566 of file consup.c.

570{
571 COORD coPos;
573 DWORD Written;
574
575 coPos.X = x;
576 coPos.Y = y;
577
579
582 Length,
583 coPos,
584 &Written);
585
587 Text,
588 Length,
589 coPos,
590 &Written);
591}
#define FOREGROUND_INTENSITY
Definition: blue.h:64
char * Text
Definition: combotst.c:136

Referenced by CONSOLE_SetStyledText().

◆ CONSOLE_SetInputTextXY()

VOID CONSOLE_SetInputTextXY ( IN SHORT  x,
IN SHORT  y,
IN SHORT  len,
IN LPCWSTR  Text 
)

Definition at line 357 of file consup.c.

362{
363 COORD coPos;
365 DWORD Written;
366
367 coPos.X = x;
368 coPos.Y = y;
369
371 if (Length > len - 1)
372 Length = len - 1;
373
376 len,
377 coPos,
378 &Written);
379
381 Text,
382 (ULONG)Length,
383 coPos,
384 &Written);
385
386 coPos.X += Length;
387 if (len > Length)
388 {
390 ' ',
391 len - Length,
392 coPos,
393 &Written);
394 }
395}
BOOL WINAPI WriteConsoleOutputCharacterW(HANDLE hConsoleOutput, IN LPCWSTR lpCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
Definition: console.c:451
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by InstallDirectoryPage(), and ShowPartitionSizeInputBox().

◆ CONSOLE_SetInvertedTextXY()

VOID CONSOLE_SetInvertedTextXY ( IN SHORT  x,
IN SHORT  y,
IN LPCSTR  Text 
)

Definition at line 538 of file consup.c.

542{
543 COORD coPos;
545 DWORD Written;
546
547 coPos.X = x;
548 coPos.Y = y;
549
551
554 Length,
555 coPos,
556 &Written);
557
559 Text,
560 Length,
561 coPos,
562 &Written);
563}

Referenced by DrawFileSystemList().

◆ CONSOLE_SetStatusText()

VOID __cdecl CONSOLE_SetStatusText ( IN LPCSTR  fmt,
  ... 
)

Definition at line 480 of file consup.c.

483{
484 va_list ap;
485
486 va_start(ap, fmt);
488 va_end(ap);
489}
VOID CONSOLE_SetStatusTextV(IN LPCSTR fmt, IN va_list args)
Definition: consup.c:471

Referenced by BootLoaderSelectPage(), CreatePartitionPage(), FileCopyCallback(), FormatPartitionPage(), QuitPage(), RegistryPage(), RegistryStatus(), and SelectPartitionPage().

◆ CONSOLE_SetStatusTextAutoFitX()

VOID __cdecl CONSOLE_SetStatusTextAutoFitX ( IN SHORT  x,
IN LPCSTR  fmt,
  ... 
)

Definition at line 512 of file consup.c.

516{
517 CHAR Buffer[128];
519 va_list ap;
520
521 va_start(ap, fmt);
523 va_end(ap);
524
526
527 if (Length + x <= 79)
528 {
530 }
531 else
532 {
534 }
535}
VOID __cdecl CONSOLE_SetStatusTextX(IN SHORT x, IN LPCSTR fmt,...)
Definition: consup.c:458

◆ CONSOLE_SetStatusTextV()

VOID CONSOLE_SetStatusTextV ( IN LPCSTR  fmt,
IN va_list  args 
)

Definition at line 471 of file consup.c.

474{
476}
VOID CONSOLE_SetStatusTextXV(IN SHORT x, IN LPCSTR fmt, IN va_list args)
Definition: consup.c:427

Referenced by CONSOLE_SetStatusText(), and RegistryStatus().

◆ CONSOLE_SetStatusTextX()

VOID __cdecl CONSOLE_SetStatusTextX ( IN SHORT  x,
IN LPCSTR  fmt,
  ... 
)

Definition at line 458 of file consup.c.

462{
463 va_list ap;
464
465 va_start(ap, fmt);
467 va_end(ap);
468}

Referenced by CONSOLE_SetStatusTextAutoFitX(), and CONSOLE_SetStyledText().

◆ CONSOLE_SetStatusTextXV()

VOID CONSOLE_SetStatusTextXV ( IN SHORT  x,
IN LPCSTR  fmt,
IN va_list  args 
)

Definition at line 427 of file consup.c.

431{
432 INT nLength;
433 COORD coPos;
434 DWORD Written;
435 CHAR Buffer[128];
436
437 memset(Buffer, ' ', min(sizeof(Buffer), xScreen));
439 ASSERT(x + nLength < sizeof(Buffer));
440 Buffer[x + nLength] = ' ';
441
442 coPos.X = 0;
443 coPos.Y = yScreen - 1;
446 xScreen,
447 coPos,
448 &Written);
450 Buffer,
451 min(sizeof(Buffer), xScreen),
452 coPos,
453 &Written);
454}
#define ASSERT(a)
Definition: mode.c:44
#define min(a, b)
Definition: monoChain.cc:55
#define memset(x, y, z)
Definition: compat.h:39
int32_t INT
Definition: typedefs.h:58
_In_ DWORD nLength
Definition: wincon.h:473

Referenced by CONSOLE_SetStatusTextV(), and CONSOLE_SetStatusTextX().

◆ CONSOLE_SetStyledText()

VOID CONSOLE_SetStyledText ( IN SHORT  x,
IN SHORT  y,
IN INT  Flags,
IN LPCSTR  Text 
)

Definition at line 665 of file consup.c.

670{
671 COORD coPos;
672
673 coPos.X = x;
674 coPos.Y = y;
675
677 {
678 coPos.X = x;
679 coPos.Y = yScreen - 1;
680 }
681 else /* TEXT_TYPE_REGULAR (Default) */
682 {
683 coPos.X = x;
684 coPos.Y = y;
685 }
686
688 {
689 coPos.X = (xScreen - (SHORT)strlen(Text)) / 2;
690 }
691 else if(Flags & TEXT_ALIGN_RIGHT)
692 {
693 coPos.X = coPos.X - (SHORT)strlen(Text);
694
696 {
697 coPos.X -= 1;
698 }
699 else if (Flags & TEXT_PADDING_MEDIUM)
700 {
701 coPos.X -= 2;
702 }
703 else if (Flags & TEXT_PADDING_BIG)
704 {
705 coPos.X -= 3;
706 }
707 }
708 else /* TEXT_ALIGN_LEFT (Default) */
709 {
711 {
712 coPos.X += 1;
713 }
714 else if (Flags & TEXT_PADDING_MEDIUM)
715 {
716 coPos.X += 2;
717 }
718 else if (Flags & TEXT_PADDING_BIG)
719 {
720 coPos.X += 3;
721 }
722 }
723
725 {
727 }
728 else /* TEXT_TYPE_REGULAR (Default) */
729 {
731 {
732 CONSOLE_SetHighlightedTextXY(coPos.X, coPos.Y, Text);
733 }
734 else if (Flags & TEXT_STYLE_UNDERLINE)
735 {
736 CONSOLE_SetUnderlinedTextXY(coPos.X, coPos.Y, Text);
737 }
738 else /* TEXT_STYLE_NORMAL (Default) */
739 {
740 CONSOLE_SetTextXY(coPos.X, coPos.Y, Text);
741 }
742 }
743}
VOID CONSOLE_SetTextXY(IN SHORT x, IN SHORT y, IN LPCSTR Text)
Definition: consup.c:320
VOID CONSOLE_SetHighlightedTextXY(IN SHORT x, IN SHORT y, IN LPCSTR Text)
Definition: consup.c:566
VOID CONSOLE_SetUnderlinedTextXY(IN SHORT x, IN SHORT y, IN LPCSTR Text)
Definition: consup.c:398
#define TEXT_STYLE_HIGHLIGHT
Definition: consup.h:35

Referenced by MUIDisplayPage(), and MUISetStyledText().

◆ CONSOLE_SetTextXY()

VOID CONSOLE_SetTextXY ( IN SHORT  x,
IN SHORT  y,
IN LPCSTR  Text 
)

Definition at line 320 of file consup.c.

324{
325 COORD coPos;
326 DWORD Written;
327
328 coPos.X = x;
329 coPos.Y = y;
330
332 Text,
333 (ULONG)strlen(Text),
334 coPos,
335 &Written);
336}

Referenced by CheckFileSystemPage(), CONSOLE_SetStyledText(), CreatePartitionPage(), DeletePartitionPage(), DrawFileSystemList(), DrawGenericListCurrentItem(), DrawProgressBar(), FormatPartitionPage(), MUISetText(), and SelectFileSystemPage().

◆ CONSOLE_SetUnderlinedTextXY()

VOID CONSOLE_SetUnderlinedTextXY ( IN SHORT  x,
IN SHORT  y,
IN LPCSTR  Text 
)

Definition at line 398 of file consup.c.

402{
403 COORD coPos;
405 DWORD Written;
406
407 coPos.X = x;
408 coPos.Y = y;
409
411
413 Text,
414 Length,
415 coPos,
416 &Written);
417
418 coPos.Y++;
421 Length,
422 coPos,
423 &Written);
424}
CHAR CharDoubleHorizontalLine
Definition: mui.c:47

Referenced by CONSOLE_SetStyledText().

Variable Documentation

◆ StdInput

◆ StdOutput

◆ xScreen

◆ yScreen