extern const PCSTR UiMonthNames[12];
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// User Interface Functions
-//
-///////////////////////////////////////////////////////////////////////////////////////
+/* User Interface Functions **************************************************/
BOOLEAN UiInitialize(BOOLEAN ShowUi); // Initialize User-Interface
VOID UiUnInitialize(PCSTR BootText); // Un-initialize User-Interface
VOID UiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen
VOID UiUpdateDateTime(VOID); // Updates the date and time
-VOID UiInfoBox(PCSTR MessageText); // Displays a info box on the screen
-VOID UiMessageBox(PCSTR Format, ...); // Displays a message box on the screen with an ok button
-VOID UiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources
+/* Displays an info box on the screen */
+VOID
+UiInfoBox(
+ _In_ PCSTR MessageText);
+
+/* Displays a message box on the screen with an ok button */
+VOID
+UiMessageBox(
+ _In_ PCSTR Format, ...);
+
+/* Displays a message box on the screen with an ok button using no system resources */
+VOID
+UiMessageBoxCritical(
+ _In_ PCSTR MessageText);
/* Loading Progress-Bar Functions ********************************************/
VOID UiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in
VOID UiFadeOut(VOID); // Fades the screen out
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// Menu Functions
-//
-///////////////////////////////////////////////////////////////////////////////////////
+/* Menu Functions ************************************************************/
typedef struct tagUI_MENU_INFO
{
#define TITLE_BOX_CHAR_HEIGHT 5
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// Graphical User Interface Functions
-//
-///////////////////////////////////////////////////////////////////////////////////////
+/* Graphical User Interface Functions ****************************************/
+
VOID GuiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
VOID GuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
VOID GuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified
VOID GuiUpdateDateTime(VOID); // Updates the date and time
VOID GuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later
VOID GuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save
-VOID GuiMessageBox(PCSTR MessageText); // Displays a message box on the screen with an ok button
-VOID GuiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources
+
+/* Displays a message box on the screen with an ok button */
+VOID
+GuiMessageBox(
+ _In_ PCSTR MessageText);
+
+/* Displays a message box on the screen with an ok button using no system resources */
+VOID
+GuiMessageBoxCritical(
+ _In_ PCSTR MessageText);
+
VOID GuiDrawProgressBar(ULONG Position, ULONG Range); // Draws the progress bar showing nPos percent filled
UCHAR GuiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value
UCHAR GuiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into it's equivalent fill value
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// Menu Functions
-//
-///////////////////////////////////////////////////////////////////////////////////////
+/* Menu Functions ************************************************************/
BOOLEAN
GuiDisplayMenu(
VOID NoUiDrawStatusText(PCSTR StatusText);
VOID NoUiUpdateDateTime(VOID);
-VOID NoUiMessageBox(PCSTR MessageText);
-VOID NoUiMessageBoxCritical(PCSTR MessageText);
+
+VOID
+NoUiMessageBox(
+ _In_ PCSTR MessageText);
+
+VOID
+NoUiMessageBoxCritical(
+ _In_ PCSTR MessageText);
/* Loading Progress-Bar Functions ********************************************/
VOID TuiUpdateDateTime(VOID); // Updates the date and time
VOID TuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later
VOID TuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save
-VOID TuiMessageBox(PCSTR MessageText); // Displays a message box on the screen with an ok button
-VOID TuiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources
+
+/* Displays a message box on the screen with an ok button */
+VOID
+TuiMessageBox(
+ _In_ PCSTR MessageText);
+
+/* Displays a message box on the screen with an ok button using no system resources */
+VOID
+TuiMessageBoxCritical(
+ _In_ PCSTR MessageText);
BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length);
UCHAR TuiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value
}
VOID
-UiInfoBox(IN PCSTR MessageText)
+UiInfoBox(
+ _In_ PCSTR MessageText)
{
TuiPrintf(MessageText);
}
VOID
-UiMessageBox(IN PCSTR MessageText)
+UiMessageBox(
+ _In_ PCSTR MessageText)
{
TuiPrintf(MessageText);
}
VOID
-UiMessageBoxCritical(IN PCSTR MessageText)
+UiMessageBoxCritical(
+ _In_ PCSTR MessageText)
{
TuiPrintf(MessageText);
}
{
}
-VOID GuiMessageBox(PCSTR MessageText)
+VOID
+GuiMessageBox(
+ _In_ PCSTR MessageText)
{
}
-VOID GuiMessageBoxCritical(PCSTR MessageText)
+VOID
+GuiMessageBoxCritical(
+ _In_ PCSTR MessageText)
{
}
{
}
-VOID NoUiMessageBox(PCSTR MessageText)
+VOID
+NoUiMessageBox(
+ _In_ PCSTR MessageText)
{
- // We have not yet displayed the user interface
- // We are probably still reading the .ini file
- // and have encountered an error. Just use printf()
- // and return.
- printf("%s\n", MessageText);
- printf("Press any key\n");
- MachConsGetCh();
+ NoUiMessageBoxCritical(MessageText);
}
-VOID NoUiMessageBoxCritical(PCSTR MessageText)
-{
- // We have not yet displayed the user interface
- // We are probably still reading the .ini file
- // and have encountered an error. Just use printf()
- // and return.
+VOID
+NoUiMessageBoxCritical(
+ _In_ PCSTR MessageText)
+{
+ /*
+ * We have not yet displayed the user interface
+ * We are probably still reading the .ini file
+ * and have encountered an error. Just use printf()
+ * and return.
+ */
printf("%s\n", MessageText);
printf("Press any key\n");
MachConsGetCh();
VideoCopyOffScreenBufferToVRAM();
}
-VOID TuiMessageBox(PCSTR MessageText)
+VOID
+TuiMessageBox(
+ _In_ PCSTR MessageText)
{
PVOID ScreenBuffer;
FrLdrTempFree(ScreenBuffer, TAG_TUI_SCREENBUFFER);
}
-VOID TuiMessageBoxCritical(PCSTR MessageText)
+VOID
+TuiMessageBoxCritical(
+ _In_ PCSTR MessageText)
{
int width = 8;
unsigned int height = 1;
UiVtbl.UpdateDateTime();
}
-VOID UiInfoBox(PCSTR MessageText)
+VOID
+UiInfoBox(
+ _In_ PCSTR MessageText)
{
- SIZE_T TextLength;
- ULONG BoxWidth;
- ULONG BoxHeight;
- ULONG LineBreakCount;
- SIZE_T Index;
- SIZE_T LastIndex;
- ULONG Left;
- ULONG Top;
- ULONG Right;
- ULONG Bottom;
+ SIZE_T TextLength;
+ ULONG BoxWidth;
+ ULONG BoxHeight;
+ ULONG LineBreakCount;
+ SIZE_T Index;
+ SIZE_T LastIndex;
+ ULONG Left;
+ ULONG Top;
+ ULONG Right;
+ ULONG Bottom;
TextLength = strlen(MessageText);
- // Count the new lines and the box width
+ /* Count the new lines and the box width */
LineBreakCount = 0;
BoxWidth = 0;
LastIndex = 0;
}
}
- // Calc the box width & height
+ /* Calc the box width & height */
BoxWidth += 6;
BoxHeight = LineBreakCount + 4;
- // Calc the box coordinates
+ /* Calc the box coordinates */
Left = (UiScreenWidth / 2) - (BoxWidth / 2);
- Top =(UiScreenHeight / 2) - (BoxHeight / 2);
- Right = (UiScreenWidth / 2) + (BoxWidth / 2);
+ Top = (UiScreenHeight / 2) - (BoxHeight / 2);
+ Right = (UiScreenWidth / 2) + (BoxWidth / 2);
Bottom = (UiScreenHeight / 2) + (BoxHeight / 2);
- // Draw the box
+ /* Draw the box */
UiDrawBox(Left,
Top,
Right,
HORZ,
TRUE,
TRUE,
- ATTR(UiMenuFgColor, UiMenuBgColor)
- );
+ ATTR(UiMenuFgColor, UiMenuBgColor));
- // Draw the text
+ /* Draw the text */
UiDrawCenteredText(Left, Top, Right, Bottom, MessageText, ATTR(UiTextColor, UiMenuBgColor));
}
-VOID UiMessageBox(PCSTR Format, ...)
+VOID
+UiMessageBox(
+ _In_ PCSTR Format, ...)
{
- CHAR Buffer[256];
va_list ap;
+ CHAR Buffer[256];
va_start(ap, Format);
vsnprintf(Buffer, sizeof(Buffer) - sizeof(CHAR), Format, ap);
va_end(ap);
}
-VOID UiMessageBoxCritical(PCSTR MessageText)
+VOID
+UiMessageBoxCritical(
+ _In_ PCSTR MessageText)
{
UiVtbl.MessageBoxCritical(MessageText);
}
return UiVtbl.EditBox(MessageText, EditTextBuffer, Length);
}
+/* EOF */