68 if (
strlen(StringText) > MaxChars)
69 strcpy(&StringText[MaxChars - 3],
"...");
128 ULONG LineBreakCount;
129 ULONG BoxWidth, BoxHeight;
130 ULONG RealLeft, RealTop;
135 TextLength =
strlen(TextString);
144 if (TextString[
Index] ==
'\n')
153 if ((
Index - LastIndex) > BoxWidth)
162 BoxHeight = LineBreakCount + 1;
169 RealLeft = (Left + Right - BoxWidth + 1) / 2;
170 RealTop = (
Top +
Bottom - BoxHeight + 1) / 2;
177 if (TextString[
Index] ==
'\n')
186 X = (
ULONG)(RealLeft + LastIndex);
189 Temp[0] = TextString[
Index];
198#define TAG_TUI_SCREENBUFFER 'SiuT'
199#define TAG_TUI_PALETTE 'PiuT'
244 "[Time Remaining: %d]");
347 for (
j = Left;
j <= Right; ++
j)
376 for (;
i <= Right; ++
i)
399 if (RightShadow && BottomShadow)
403 if (
DoubleWidth && DoubleRightShadow && BottomShadow)
422 UCHAR ULCorner, URCorner;
425 if (HorzStyle ==
HORZ)
427 if (VertStyle ==
VERT)
440 if (VertStyle ==
VERT)
466 UCHAR LLCorner, LRCorner;
469 if (HorzStyle ==
HORZ)
471 if (VertStyle ==
VERT)
484 if (VertStyle ==
VERT)
558 if (TimeInfo->
Year < 1 || 9999 < TimeInfo->
Year ||
559 TimeInfo->
Month < 1 || 12 < TimeInfo->
Month ||
560 TimeInfo->
Day < 1 || 31 < TimeInfo->
Day ||
561 23 < TimeInfo->
Hour ||
570 if (1 == TimeInfo->
Day || 21 == TimeInfo->
Day || 31 == TimeInfo->
Day)
572 else if (2 == TimeInfo->
Day || 22 == TimeInfo->
Day)
574 else if (3 == TimeInfo->
Day || 23 == TimeInfo->
Day)
592 if (TimeInfo->
Hour > 12)
594 TimeInfo->
Hour -= 12;
597 if (TimeInfo->
Hour == 0)
608 PMHour ?
"PM" :
"AM");
675 for (
i = 0;
i <
strlen(MessageText);
i++)
677 if (MessageText[
i] ==
'\n')
684 while ((MessageText[
j] !=
'\n') && (MessageText[
j] !=
ANSI_NULL))
718 MsgBoxRect->Left =
x1; MsgBoxRect->Right =
x2;
719 MsgBoxRect->Top =
y1; MsgBoxRect->Bottom =
y2;
727 for (
i =
j = 0;
i <
strlen(MessageText) + 1;
i++)
729 if ((MessageText[
i] ==
'\n') || (MessageText[
i] ==
ANSI_NULL))
739 temp[
j++] = MessageText[
i];
805 ULONG ProgressBarWidth;
806 CHAR ProgressString[256];
833 ULONG ProgressBarWidth;
839 ASSERT(SubPercentTimes100 <= (100 * 100));
846 FillCount = ProgressBarWidth * SubPercentTimes100 / (100 * 100);
884 Right = Left +
Width - 1;
946 if (
_stricmp(ColorText,
"Default") == 0)
963 UCHAR FillStyleValue;
975 if (
_stricmp(FillStyleText, FillStyles[
i].FillStyleName) == 0)
976 return FillStyles[
i].FillStyleValue;
991 if (TuiFadePalette !=
NULL)
1017 if (TuiFadePalette !=
NULL)
1043 ULONG EditBoxStartX, EditBoxEndX;
1045 ULONG EditBoxTextLength, EditBoxTextPosition;
1046 INT EditBoxTextDisplayIndex;
1057 EditBoxTextLength = (
ULONG)
strlen(EditTextBuffer);
1058 EditBoxTextLength =
min(EditBoxTextLength,
Length - 1);
1059 EditBoxTextPosition = 0;
1060 EditBoxLine = BoxRect.
Bottom - 2;
1061 EditBoxStartX = BoxRect.
Left + 3;
1062 EditBoxEndX = BoxRect.
Right - 3;
1069 EditBoxCursorX = EditBoxStartX;
1107 if ( (EditBoxTextLength > 0) && (EditBoxTextPosition > 0) &&
1108 (EditBoxTextPosition <= EditBoxTextLength) )
1110 EditBoxTextPosition--;
1111 memmove(EditTextBuffer + EditBoxTextPosition,
1112 EditTextBuffer + EditBoxTextPosition + 1,
1113 EditBoxTextLength - EditBoxTextPosition);
1114 EditBoxTextLength--;
1115 EditTextBuffer[EditBoxTextLength] = 0;
1124 if ( (EditBoxTextLength > 0) &&
1125 (EditBoxTextPosition < EditBoxTextLength) )
1127 memmove(EditTextBuffer + EditBoxTextPosition,
1128 EditTextBuffer + EditBoxTextPosition + 1,
1129 EditBoxTextLength - EditBoxTextPosition);
1130 EditBoxTextLength--;
1131 EditTextBuffer[EditBoxTextLength] = 0;
1140 EditBoxTextPosition = 0;
1144 EditBoxTextPosition = EditBoxTextLength;
1148 if (EditBoxTextPosition < EditBoxTextLength)
1149 EditBoxTextPosition++;
1155 if (EditBoxTextPosition > 0)
1156 EditBoxTextPosition--;
1162 if ( (EditBoxTextLength <
Length - 1) &&
1163 (EditBoxTextPosition <
Length - 1) )
1165 memmove(EditTextBuffer + EditBoxTextPosition + 1,
1166 EditTextBuffer + EditBoxTextPosition,
1167 EditBoxTextLength - EditBoxTextPosition);
1168 EditTextBuffer[EditBoxTextPosition] =
key;
1169 EditBoxTextPosition++;
1170 EditBoxTextLength++;
1171 EditTextBuffer[EditBoxTextLength] = 0;
1188 if (EditBoxTextPosition > (EditBoxEndX - EditBoxStartX))
1190 EditBoxTextDisplayIndex = EditBoxTextPosition - (EditBoxEndX - EditBoxStartX);
1191 EditBoxCursorX = EditBoxEndX;
1195 EditBoxTextDisplayIndex = 0;
1196 EditBoxCursorX = EditBoxStartX + EditBoxTextPosition;
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
TIMEINFO * ArcGetTime(VOID)
static LPHIST_ENTRY Bottom
#define MachVideoClearScreen(Attr)
#define MachConsPutChar(Ch)
#define MachVideoSetTextCursorPosition(X, Y)
#define MachVideoSetDisplayMode(Mode, Init)
#define MachVideoHideShowTextCursor(Show)
#define MachVideoIsPaletteFixed()
FORCEINLINE PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
FORCEINLINE VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
VOID VideoFadeIn(PPALETTE_ENTRY Palette, ULONG ColorCount)
VOID VideoSetAllColorsToBlack(ULONG ColorCount)
VOID VideoFadeOut(ULONG ColorCount)
struct _PALETTE_ENTRY * PPALETTE_ENTRY
VOID VideoFreeOffScreenBuffer(VOID)
VOID VideoRestorePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount)
PVOID VideoAllocateOffScreenBuffer(VOID)
VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount)
VOID VideoCopyOffScreenBufferToVRAM(VOID)
#define COLOR_LIGHTMAGENTA
UCHAR UiMessageBoxFgColor
UCHAR UiMessageBoxBgColor
UI_PROGRESS_BAR UiProgressBar
VOID UiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
BOOLEAN UiUseSpecialEffects
VOID UiDrawText2(_In_ ULONG X, _In_ ULONG Y, _In_opt_ ULONG MaxNumChars, _In_reads_or_z_(MaxNumChars) PCSTR Text, _In_ UCHAR Attr)
const PCSTR UiMonthNames[12]
#define ATTR(cFore, cBack)
CHAR UiTitleBoxTitleText[260]
UCHAR UiBackdropFillStyle
VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
VOID UiDrawStatusText(PCSTR StatusText)
UCHAR UiSelectedTextColor
UCHAR UiSelectedTextBgColor
VOID UiInitProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
struct _SMALL_RECT * PSMALL_RECT
VOID TuiMessageBoxCritical(_In_ PCSTR MessageText)
struct _SMALL_RECT SMALL_RECT
VOID TuiDrawCenteredText(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR TextString, _In_ UCHAR Attr)
VOID TuiTruncateStringEllipsis(_Inout_z_ PSTR StringText, _In_ ULONG MaxChars)
VOID TuiDrawBox(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ BOOLEAN Fill, _In_ BOOLEAN Shadow, _In_ UCHAR Attr)
VOID TuiRestoreScreen(_In_opt_ __drv_freesMem(Mem) PUCHAR Buffer)
VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
UCHAR TuiTextToColor(PCSTR ColorText)
static VOID TuiDrawMsgBoxCommon(_In_ PCSTR MessageText, _Out_ PSMALL_RECT MsgBoxRect)
VOID TuiUnInitialize(VOID)
static VOID TuiSetProgressBarText(_In_ PCSTR ProgressText)
VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
UCHAR TuiTextToFillStyle(PCSTR FillStyleText)
VOID TuiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
static VOID TuiDrawProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
VOID TuiDrawBackdrop(VOID)
VOID TuiDrawStatusText(PCSTR StatusText)
#define TAG_TUI_SCREENBUFFER
VOID TuiDrawBoxBottomLine(_In_ ULONG Left, _In_ ULONG Bottom, _In_ ULONG Right, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ UCHAR Attr)
static VOID TuiTickProgressBar(_In_ ULONG SubPercentTimes100)
VOID TuiFadeInBackdrop(VOID)
VOID TuiDrawText2(_In_ ULONG X, _In_ ULONG Y, _In_opt_ ULONG MaxNumChars, _In_reads_or_z_(MaxNumChars) PCSTR Text, _In_ UCHAR Attr)
VOID TuiUpdateDateTime(VOID)
UCHAR MachDefaultTextColor
static VOID TuiDrawProgressBarCenter(_In_ PCSTR ProgressText)
BOOLEAN TuiInitialize(VOID)
BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
VOID TuiDrawBoxTopLine(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ UCHAR Attr)
VOID TuiMessageBox(_In_ PCSTR MessageText)
INT TuiPrintf(_In_ PCSTR Format,...)
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
#define __drv_freesMem(kind)
#define __drv_allocatesMem(kind)
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define memmove(s1, s2, n)
#define _In_reads_or_z_(s)
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
static BOOLEAN DoubleWidth
VOID TuiDrawMenu(_In_ PUI_MENU_INFO MenuInfo)
#define TUI_TITLE_BOX_CHAR_HEIGHT
BOOLEAN TuiDisplayMenu(IN PCSTR MenuHeader, IN PCSTR MenuFooter OPTIONAL, IN BOOLEAN ShowBootOptions, IN PCSTR MenuItemList[], IN ULONG MenuItemCount, IN ULONG DefaultMenuItem, IN LONG MenuTimeOut, OUT PULONG SelectedMenuItem, IN BOOLEAN CanEscape, IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL, IN PVOID Context OPTIONAL)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
void int int ULONGLONG int va_list * ap