summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-09-22 08:54:48 +0000
committerDave Chapman <dave@dchapman.com>2005-09-22 08:54:48 +0000
commit548c1b72c00087364c8c5ccec354a9ede1724d45 (patch)
tree873c4b5b56fec0b21a6214a5817b5b0d6ef2c697
parent6afb017642a82aabbcd6f4ea5c31ec5d3945f5f8 (diff)
downloadrockbox-548c1b72c00087364c8c5ccec354a9ede1724d45.zip
rockbox-548c1b72c00087364c8c5ccec354a9ede1724d45.tar.gz
rockbox-548c1b72c00087364c8c5ccec354a9ede1724d45.tar.bz2
rockbox-548c1b72c00087364c8c5ccec354a9ede1724d45.tar.xz
Added menu interface to plugin API - needed by Sudoku
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7533 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugin.c14
-rw-r--r--apps/plugin.h18
2 files changed, 31 insertions, 1 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 7d3b13c..6748a19 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -341,6 +341,20 @@ static const struct plugin_api rockbox_api = {
/* new stuff at the end, sort into place next time
the API gets incompatible */
+
+ menu_init,
+ menu_exit,
+ menu_show,
+ menu_run,
+ menu_cursor,
+ menu_description,
+ menu_delete,
+ menu_count,
+ menu_moveup,
+ menu_movedown,
+ menu_draw,
+ menu_insert,
+ menu_set_cursor,
};
int plugin_load(const char* plugin, void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index 5cc9c1b..f133d32 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -56,6 +56,7 @@
#include "widgets.h"
#endif
#include "sound.h"
+#include "menu.h"
#ifdef HAVE_REMOTE_LCD
#include "lcd-remote.h"
@@ -426,7 +427,22 @@ struct plugin_api {
/* new stuff at the end, sort into place next time
the API gets incompatible */
-
+
+ int (*menu_init)(const struct menu_item* mitems, int count,
+ int (*callback)(int, int),
+ const char *button1, const char *button2, const char *button3);
+ void (*menu_exit)(int menu);
+ int (*menu_show)(int m);
+ bool (*menu_run)(int menu);
+ int (*menu_cursor)(int menu);
+ char* (*menu_description)(int menu, int position);
+ void (*menu_delete)(int menu, int position);
+ int (*menu_count)(int menu);
+ bool (*menu_moveup)(int menu);
+ bool (*menu_movedown)(int menu);
+ void (*menu_draw)(int menu);
+ void (*menu_insert)(int menu, int position, char *desc, bool (*function) (void));
+ void (*menu_set_cursor)(int menu, int position);
};
int plugin_load(const char* plugin, void* parameter);