aboutsummaryrefslogtreecommitdiffstats
path: root/UefiMonitorTest/MainMenu.c
blob: df137797a1c0dfebacfa0d081603f7bbc22b935b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#include <Library/HiiLib.h>

#include "MainMenu.h"

#define INDENT            15
#define CHAR_PER_COLUMN   24
#define RECT_HALF_WIDTH   300
#define RECT_HALF_HEIGHT  130

VOID
MainMenuInit (
  IN UMT_CONTEXT *Ctx
  )
{
  GRAPHICS_CONTEXT  *Graphics;
  UINT32            Width;
  UINT32            Height;
  UINTN             FontHeight;
  UINTN             FontWidth;
  UINTN             LeftColX;
  UINTN             MiddleColX;
  UINTN             RightColX;
  UINTN             Y;

  Graphics   = Ctx->Graphics;
  Width      = Graphics->Width;
  Height     = Graphics->Height;
  GetFontParameters (Graphics, &FontWidth, &FontHeight);
  LeftColX   = (Width - (CHAR_PER_COLUMN * 3) * FontWidth) / 2;
  MiddleColX = LeftColX + (CHAR_PER_COLUMN * FontWidth);
  RightColX  = MiddleColX + (CHAR_PER_COLUMN * FontWidth);

  // Background
  PutRect (Graphics, 0, 0, Width, Height, &gUmtColors[UMT_COLOR_NAVY]);
  DrawHiiStringF (Graphics,
                  (Width - 24 * FontWidth) / 2,
                  Height / 2 - RECT_HALF_HEIGHT - (INDENT * 2),
                  &gUmtColors[UMT_COLOR_WHITE],
                  STRING_TOKEN (STR_MM_TITLE), gUmtHiiHandle, UMT_VERSION);

  // Menu
  DrawRoundedRect (Graphics,
                  Width  / 2 - RECT_HALF_WIDTH,
                  Height / 2 - RECT_HALF_HEIGHT,
                  Width  / 2 + RECT_HALF_WIDTH,
                  Height / 2 + RECT_HALF_HEIGHT,
                  20,
                  &gUmtColors[UMT_COLOR_WHITE]
                  );
  
  Y = Height / 2 - RECT_HALF_HEIGHT + INDENT + 5;
  DrawHiiStringF (Graphics, LeftColX, Y, &gUmtColors[UMT_COLOR_BLACK],
                  STRING_TOKEN (STR_MM_SUBTITLE), gUmtHiiHandle);

  Y += FontHeight + INDENT;
  DrawHiiStringF (Graphics, LeftColX, Y, &gUmtColors[UMT_COLOR_BLACK],
                  STRING_TOKEN (STR_MM_MENU), gUmtHiiHandle);

  Y += (FontHeight * 4) + (INDENT * 2);
  DrawHiiStringF (Graphics, (Width - 9 * FontWidth) / 2, Y, &gUmtColors[UMT_COLOR_BLACK],
                  STRING_TOKEN (STR_MM_TIP_TITLE), gUmtHiiHandle);

  Y += FontHeight + INDENT;
  DrawHiiStringF (Graphics, LeftColX, Y, &gUmtColors[UMT_COLOR_BLACK],
                  STRING_TOKEN (STR_MM_TIP_FIRST), gUmtHiiHandle);
  DrawHiiStringF (Graphics, MiddleColX, Y, &gUmtColors[UMT_COLOR_BLACK],
                  STRING_TOKEN (STR_MM_TIP_SECOND), gUmtHiiHandle);
  DrawHiiStringF (Graphics, RightColX, Y, &gUmtColors[UMT_COLOR_BLACK],
                  STRING_TOKEN (STR_MM_TIP_THIRD), gUmtHiiHandle);

}

VOID
MainMenuDoit (
  IN UMT_CONTEXT *Ctx
  )
{

}

VOID
MainMenuTip (
  IN UMT_CONTEXT *Ctx
  )
{
  
}

VOID
MainMenuChangeParam (
  IN  UMT_CONTEXT *Ctx,
  IN  INT8        ParamStep
  )
{
  
}

VOID
MainMenuChangeValue (
  IN  UMT_CONTEXT *Ctx,
  IN  INT8        ValueStep
  )
{
  
}