summaryrefslogtreecommitdiff
path: root/apps/plugin.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2020-07-31 22:45:10 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2020-08-17 10:15:14 -0400
commit35502834423049b319fde41ff305b48de67d2d51 (patch)
tree00d638d9348cd38f15cf6d341e700bc36153b3f8 /apps/plugin.c
parentd553bb1149800daf16dcb92bc0608fe6248e1dab (diff)
downloadrockbox-35502834423049b319fde41ff305b48de67d2d51.tar.gz
rockbox-35502834423049b319fde41ff305b48de67d2d51.zip
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
Diffstat (limited to 'apps/plugin.c')
-rw-r--r--apps/plugin.c8
1 files changed, 8 insertions, 0 deletions
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 @@
21#define DIRFUNCTIONS_DEFINED 21#define DIRFUNCTIONS_DEFINED
22#define FILEFUNCTIONS_DEFINED 22#define FILEFUNCTIONS_DEFINED
23#include "plugin.h" 23#include "plugin.h"
24#include "open_plugin.h"
24#include <ctype.h> 25#include <ctype.h>
25#include <string.h> 26#include <string.h>
26#include <stdlib.h> 27#include <stdlib.h>
@@ -807,6 +808,7 @@ static const struct plugin_api rockbox_api = {
807#ifdef HAVE_TAGCACHE 808#ifdef HAVE_TAGCACHE
808 tagcache_get_stat, 809 tagcache_get_stat,
809#endif 810#endif
811 plugin_open,
810}; 812};
811 813
812static int plugin_buffer_handle; 814static int plugin_buffer_handle;
@@ -1019,6 +1021,12 @@ static void plugin_tsr(bool (*exit_callback)(bool))
1019 pfn_tsr_exit = exit_callback; /* remember the callback for later */ 1021 pfn_tsr_exit = exit_callback; /* remember the callback for later */
1020} 1022}
1021 1023
1024int plugin_open(char *plugin, char *parameter)
1025{
1026 open_plugin_add_path(ID2P(LANG_OPEN_PLUGIN), plugin, parameter);
1027 return PLUGIN_GOTO_PLUGIN;
1028}
1029
1022char *plugin_get_current_filename(void) 1030char *plugin_get_current_filename(void)
1023{ 1031{
1024 return current_plugin; 1032 return current_plugin;