aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-12-08 20:42:50 +0300
committerJoursoir <chat@joursoir.net>2021-12-08 20:42:50 +0300
commitbbe0ce6ecd203f86cd10e5f4ed7c8362ec71e8e2 (patch)
treec345d8b1350b56df97688d61f4f9497714146845
parent53a6fa5479cd1b8ce54500de087f33a9f595a8dd (diff)
downloadufm-bbe0ce6ecd203f86cd10e5f4ed7c8362ec71e8e2.tar.gz
ufm-bbe0ce6ecd203f86cd10e5f4ed7c8362ec71e8e2.tar.bz2
ufm-bbe0ce6ecd203f86cd10e5f4ed7c8362ec71e8e2.zip
actions: add and use macros for parts of the context
-rw-r--r--Library/UefiShellUfmCommandLib/actions.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/Library/UefiShellUfmCommandLib/actions.c b/Library/UefiShellUfmCommandLib/actions.c
index 8c75c67..144e8f8 100644
--- a/Library/UefiShellUfmCommandLib/actions.c
+++ b/Library/UefiShellUfmCommandLib/actions.c
@@ -12,35 +12,41 @@
#include "filemanager.h"
#include "actions.h"
+#define MENUBAR (fm_ctx.menubar)
+#define CMDBAR (fm_ctx.cmdbar)
+#define PANEL (fm_ctx.curpanel)
+#define LEFT_PANEL (fm_ctx.left)
+#define RIGHT_PANEL (fm_ctx.right)
+
BOOLEAN jump_up(VOID)
{
- panel_move_cursor(fm_ctx.curpanel, fm_ctx.curpanel->curline - 1);
+ panel_move_cursor(PANEL, PANEL->curline - 1);
return TRUE;
}
BOOLEAN jump_down(VOID)
{
- panel_move_cursor(fm_ctx.curpanel, fm_ctx.curpanel->curline + 1);
+ panel_move_cursor(PANEL, PANEL->curline + 1);
return TRUE;
}
BOOLEAN change_panel(VOID)
{
- panel_set_active(fm_ctx.curpanel, FALSE);
- fm_ctx.curpanel = (fm_ctx.curpanel == fm_ctx.left) ? fm_ctx.right : fm_ctx.left;
- panel_set_active(fm_ctx.curpanel, TRUE);
+ panel_set_active(PANEL, FALSE);
+ PANEL = (PANEL == LEFT_PANEL) ? RIGHT_PANEL : LEFT_PANEL;
+ panel_set_active(PANEL, TRUE);
return TRUE;
}
BOOLEAN mark(VOID)
{
- panel_mark_file(fm_ctx.curpanel, fm_ctx.curpanel->curline);
+ panel_mark_file(PANEL, PANEL->curline);
return TRUE;
}
BOOLEAN show_filesystems(VOID)
{
- return panel_cd_to(fm_ctx.curpanel, NULL);
+ return panel_cd_to(PANEL, NULL);
}
BOOLEAN do_nothing(VOID)