From 7f52a8165e59c60e36052d7f6f71163f4c528acf Mon Sep 17 00:00:00 2001 From: Patrick Gaskin Date: Mon, 15 Jun 2020 16:12:14 -0400 Subject: [PATCH] Implemented nickel_misc:home action (closes #39) (#44) --- res/doc | 1 + src/action_cc.cc | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/res/doc b/res/doc index 00f788b..4f18261 100644 --- a/res/doc +++ b/res/doc @@ -58,6 +58,7 @@ # sudoku # word_scramble # nickel_misc - one of: +# home - goes to the home screen # force_usb_connection - forces a usb connection dialog to be shown # rescan_books - forces nickel to rescan books (4.13.12638+) # rescan_books_full - forces a full usb connect/disconnect cycle (4.13.12638+) diff --git a/src/action_cc.cc b/src/action_cc.cc index 8e3151b..d9a4f1f 100644 --- a/src/action_cc.cc +++ b/src/action_cc.cc @@ -355,7 +355,14 @@ NM_ACTION_(nickel_extras) { NM_ACTION_(nickel_misc) { #define NM_ERR_RET nullptr - if (!strcmp(arg, "rescan_books")) { + if (!strcmp(arg, "home")) { + //libnickel 4.6 * _ZN19StatusBarController4homeEv + void (*StatusBarController_home)(); + reinterpret_cast(StatusBarController_home) = dlsym(RTLD_DEFAULT, "_ZN19StatusBarController4homeEv"); + NM_ASSERT(StatusBarController_home, "could not dlsym StatusBarController::home"); + + StatusBarController_home(); + } else if (!strcmp(arg, "rescan_books")) { //libnickel 4.13.12638 * _ZN19PlugWorkflowManager14sharedInstanceEv PlugWorkflowManager *(*PlugWorkflowManager_sharedInstance)(); reinterpret_cast(PlugWorkflowManager_sharedInstance) = dlsym(RTLD_DEFAULT, "_ZN19PlugWorkflowManager14sharedInstanceEv");