From 42a1a3f9800e96621a91228918cf24f37639f510 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Wed, 4 May 2022 20:26:36 +0300 Subject: extend state actions API --- UefiMonitorTest/MainMenu.c | 9 +++++++++ UefiMonitorTest/MainMenu.h | 6 ++++++ UefiMonitorTest/UefiMonitorTest.c | 6 +++++- UefiMonitorTest/UefiMonitorTest.h | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/UefiMonitorTest/MainMenu.c b/UefiMonitorTest/MainMenu.c index 85c9e64..df13779 100644 --- a/UefiMonitorTest/MainMenu.c +++ b/UefiMonitorTest/MainMenu.c @@ -86,6 +86,15 @@ MainMenuTip ( } +VOID +MainMenuChangeParam ( + IN UMT_CONTEXT *Ctx, + IN INT8 ParamStep + ) +{ + +} + VOID MainMenuChangeValue ( IN UMT_CONTEXT *Ctx, diff --git a/UefiMonitorTest/MainMenu.h b/UefiMonitorTest/MainMenu.h index 0b97250..e50418a 100644 --- a/UefiMonitorTest/MainMenu.h +++ b/UefiMonitorTest/MainMenu.h @@ -18,6 +18,12 @@ MainMenuTip ( IN UMT_CONTEXT *Ctx ); +VOID +MainMenuChangeParam ( + IN UMT_CONTEXT *Ctx, + IN INT8 ParamStep + ); + VOID MainMenuChangeValue ( IN UMT_CONTEXT *Ctx, diff --git a/UefiMonitorTest/UefiMonitorTest.c b/UefiMonitorTest/UefiMonitorTest.c index c7034f0..63429d7 100644 --- a/UefiMonitorTest/UefiMonitorTest.c +++ b/UefiMonitorTest/UefiMonitorTest.c @@ -12,7 +12,7 @@ #include "MainMenu.h" STATIC CONST UMT_STATE_ACTIONS mStateActions[UMT_STATE_END] = { - { MainMenuInit, MainMenuDoit, MainMenuTip, MainMenuChangeValue } + { MainMenuInit, MainMenuDoit, MainMenuTip, MainMenuChangeParam, MainMenuChangeValue } }; EFI_HII_HANDLE gUmtHiiHandle = NULL; @@ -148,7 +148,11 @@ HandleInput ( switch (KeyData.Key.ScanCode) { case SCAN_UP: + Ctx->Actions->ChangeParam (Ctx, -1); + break; + case SCAN_DOWN: + Ctx->Actions->ChangeParam (Ctx, +1); break; case SCAN_RIGHT: diff --git a/UefiMonitorTest/UefiMonitorTest.h b/UefiMonitorTest/UefiMonitorTest.h index 0138bce..185b900 100644 --- a/UefiMonitorTest/UefiMonitorTest.h +++ b/UefiMonitorTest/UefiMonitorTest.h @@ -12,6 +12,7 @@ typedef struct { VOID (*Init)(UMT_CONTEXT *); VOID (*Doit)(UMT_CONTEXT *); VOID (*Tip)(UMT_CONTEXT *); + VOID (*ChangeParam)(UMT_CONTEXT *, INT8); VOID (*ChangeValue)(UMT_CONTEXT *, INT8); } UMT_STATE_ACTIONS; -- cgit v1.2.3-18-g5258