From 35502834423049b319fde41ff305b48de67d2d51 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 31 Jul 2020 22:45:10 -0400 Subject: Add open_plugin to core open_plugin allows arbitrary plugins to be called in hotkey and start screen replaces PictureFlow Integration shortcuts menu plays plugins now too rather than store paths and parameters in the settings that reside in memory instead entries in a file are searched by hash. after all, the plugin has to be loaded from disk anyways ---------------------------------------------------------------------------- shortcut_viewer.rock-- can now call plugins rather than taking you to them in the browser ----------------------------------------------------------------------------- Added a new option to menus: F_CB_ON_SELECT_ONLY instead of option callback every time a item is accessed F_CB_ON_SELECT_ONLY fires callback only when item is selected ----------------------------------------------------------------------------- Added manual entries ----------------------------------------------------------------------------- Change-Id: I078b57b1d2b4dd633c89212c1082fcbc1b516e6a --- apps/plugin.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps/plugin.c') diff --git a/apps/plugin.c b/apps/plugin.c index 2066d3a108..749132cde8 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -21,6 +21,7 @@ #define DIRFUNCTIONS_DEFINED #define FILEFUNCTIONS_DEFINED #include "plugin.h" +#include "open_plugin.h" #include #include #include @@ -807,6 +808,7 @@ static const struct plugin_api rockbox_api = { #ifdef HAVE_TAGCACHE tagcache_get_stat, #endif + plugin_open, }; static int plugin_buffer_handle; @@ -1019,6 +1021,12 @@ static void plugin_tsr(bool (*exit_callback)(bool)) pfn_tsr_exit = exit_callback; /* remember the callback for later */ } +int plugin_open(char *plugin, char *parameter) +{ + open_plugin_add_path(ID2P(LANG_OPEN_PLUGIN), plugin, parameter); + return PLUGIN_GOTO_PLUGIN; +} + char *plugin_get_current_filename(void) { return current_plugin; -- cgit v1.2.3