ReactOS 0.4.16-dev-927-g467dec4
minitui.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

VOID MiniTuiDrawBackdrop (ULONG DrawHeight)
 
VOID MiniTuiDrawStatusText (PCSTR StatusText)
 
VOID MiniTuiSetProgressBarText (_In_ PCSTR ProgressText)
 
VOID MiniTuiTickProgressBar (_In_ ULONG SubPercentTimes100)
 
VOID MiniTuiDrawProgressBarCenter (_In_ PCSTR ProgressText)
 
VOID MiniTuiDrawProgressBar (_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
 
VOID MiniTuiDrawMenu (_In_ PUI_MENU_INFO MenuInfo)
 

Variables

const UIVTBL MiniTuiVtbl
 

Function Documentation

◆ MiniTuiDrawBackdrop()

VOID MiniTuiDrawBackdrop ( ULONG  DrawHeight)

Definition at line 56 of file minitui.c.

57{
58 /* Fill in a black background */
59 TuiFillArea(0, 0, UiScreenWidth - 1, DrawHeight - 1,
62
63 /* Update the screen buffer */
65}
VOID VideoCopyOffScreenBufferToVRAM(VOID)
Definition: video.c:38
ULONG UiScreenWidth
Definition: ui.c:54
#define ATTR(cFore, cBack)
Definition: ui.h:323
UCHAR UiBackdropFgColor
Definition: ui.c:27
UCHAR UiBackdropFillStyle
Definition: ui.c:29
UCHAR UiBackdropBgColor
Definition: ui.c:28
VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: tui.c:329

Referenced by MiniTuiFadeInBackdrop().

◆ MiniTuiDrawMenu()

VOID MiniTuiDrawMenu ( _In_ PUI_MENU_INFO  MenuInfo)

Definition at line 189 of file minitui.c.

191{
192 ULONG i;
193
194 /* Draw the backdrop */
196
197 /* No GUI status bar text, just minimal text. Show the menu header. */
198 if (MenuInfo->MenuHeader)
199 {
201 MenuInfo->Top - 2,
202 MenuInfo->MenuHeader,
204 }
205
206 /* Draw the menu box */
208
209 /* Draw each line of the menu */
210 for (i = 0; i < MenuInfo->MenuItemCount; ++i)
211 {
213 }
214
215 /* Now tell the user how to choose */
217 MenuInfo->Bottom + 1,
218 "Use \x18 and \x19 to move the highlight to your choice.",
221 MenuInfo->Bottom + 2,
222 "Press ENTER to choose.",
224
225 /* And show the menu footer */
226 if (MenuInfo->MenuFooter)
227 {
229 UiScreenHeight - 4,
230 MenuInfo->MenuFooter,
232 }
233
235}
UCHAR UiMenuBgColor
Definition: ui.c:35
VOID UiDrawBackdrop(ULONG DrawHeight)
Definition: ui.c:233
ULONG UiGetScreenHeight(VOID)
Definition: ui.c:655
ULONG UiScreenHeight
Definition: ui.c:55
UIVTBL UiVtbl
Definition: ui.c:64
UCHAR UiMenuFgColor
Definition: ui.c:34
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
Definition: glfuncs.h:248
menu info structure
Definition: window.h:276
VOID(* DrawText)(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
Definition: ui.h:261
VOID TuiDrawMenuItem(_In_ PUI_MENU_INFO MenuInfo, _In_ ULONG MenuItemNumber)
Definition: tuimenu.c:367
VOID TuiDrawMenuBox(_In_ PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:343
uint32_t ULONG
Definition: typedefs.h:59

◆ MiniTuiDrawProgressBar()

VOID MiniTuiDrawProgressBar ( _In_ ULONG  Left,
_In_ ULONG  Top,
_In_ ULONG  Right,
_In_ ULONG  Bottom,
_In_ PCSTR  ProgressText 
)

Definition at line 178 of file minitui.c.

184{
185 UiInitProgressBar(Left, Top, Right, Bottom, ProgressText);
186}
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53
VOID UiInitProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: ui.c:389

Referenced by MiniTuiDrawProgressBarCenter().

◆ MiniTuiDrawProgressBarCenter()

VOID MiniTuiDrawProgressBarCenter ( _In_ PCSTR  ProgressText)

Definition at line 153 of file minitui.c.

155{
156 ULONG Left, Top, Right, Bottom, Width, Height;
157
158 /* Build the coordinates and sizes */
159#ifdef NTLDR_PROGRESSBAR
160 Height = 2;
162 Left = 0;
163 Top = UiScreenHeight - Height - 2;
164#else // BTMGR_PROGRESSBAR
165 Height = 3;
166 Width = UiScreenWidth - 4;
167 Left = 2;
168 Top = UiScreenHeight - Height - 3;
169#endif
170 Right = Left + Width - 1;
171 Bottom = Top + Height - 1;
172
173 /* Draw the progress bar */
174 MiniTuiDrawProgressBar(Left, Top, Right, Bottom, ProgressText);
175}
VOID MiniTuiDrawProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: minitui.c:178
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88

◆ MiniTuiDrawStatusText()

VOID MiniTuiDrawStatusText ( PCSTR  StatusText)

Definition at line 73 of file minitui.c.

74{
75 /* Minimal UI doesn't have a status bar */
76}

◆ MiniTuiSetProgressBarText()

VOID MiniTuiSetProgressBarText ( _In_ PCSTR  ProgressText)

Definition at line 79 of file minitui.c.

81{
82 ULONG ProgressBarWidth;
83 CHAR ProgressString[256];
84
85 /* Make sure the progress bar is enabled */
87
88 /* Calculate the width of the bar proper */
89 ProgressBarWidth = UiProgressBar.Right - UiProgressBar.Left + 1;
90
91 /* First make sure the progress bar text fits */
92 RtlStringCbCopyA(ProgressString, sizeof(ProgressString), ProgressText);
93 TuiTruncateStringEllipsis(ProgressString, ProgressBarWidth);
94
95 /* Clear the text area */
98#ifdef NTLDR_PROGRESSBAR
100#else // BTMGR_PROGRESSBAR
101 UiProgressBar.Bottom - 2, // One empty line between text and bar.
102#endif
104
105 /* Draw the "Loading..." text */
108#ifdef NTLDR_PROGRESSBAR
110#else // BTMGR_PROGRESSBAR
111 UiProgressBar.Bottom - 2, // One empty line between text and bar.
112#endif
113 ProgressString, ATTR(UiTextColor, UiMenuBgColor));
114}
UI_PROGRESS_BAR UiProgressBar
Definition: ui.c:62
UCHAR UiTextColor
Definition: ui.c:36
#define ASSERT(a)
Definition: mode.c:44
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:156
ULONG Top
Definition: ui.h:138
ULONG Bottom
Definition: ui.h:140
BOOLEAN Show
Definition: ui.h:142
ULONG Left
Definition: ui.h:137
ULONG Right
Definition: ui.h:139
VOID TuiDrawCenteredText(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR TextString, _In_ UCHAR Attr)
Definition: tui.c:118
VOID TuiTruncateStringEllipsis(_Inout_z_ PSTR StringText, _In_ ULONG MaxChars)
Definition: tui.c:63
char CHAR
Definition: xmlstorage.h:175

◆ MiniTuiTickProgressBar()

VOID MiniTuiTickProgressBar ( _In_ ULONG  SubPercentTimes100)

Definition at line 117 of file minitui.c.

119{
120 ULONG ProgressBarWidth;
121 ULONG FillCount;
122
123 /* Make sure the progress bar is enabled */
125
126 ASSERT(SubPercentTimes100 <= (100 * 100));
127
128 /* Calculate the width of the bar proper */
129 ProgressBarWidth = UiProgressBar.Right - UiProgressBar.Left + 1;
130
131 /* Compute fill count */
132 // FillCount = (ProgressBarWidth * Position) / Range;
133 FillCount = ProgressBarWidth * SubPercentTimes100 / (100 * 100);
134
135 /* Fill the progress bar */
136 /* Draw the percent complete -- Use the fill character */
137 if (FillCount > 0)
138 {
140 UiProgressBar.Left + FillCount - 1, UiProgressBar.Bottom,
141 '\xDB', ATTR(UiTextColor, UiMenuBgColor));
142 }
143 /* Fill the remaining with blanks */
147
150}
VOID TuiUpdateDateTime(VOID)
Definition: tui.c:547

Variable Documentation

◆ MiniTuiVtbl

const UIVTBL MiniTuiVtbl
extern

Definition at line 237 of file minitui.c.

Referenced by UiInitialize(), and UiResetForSOS().