summaryrefslogtreecommitdiffstats
path: root/apps/menu.h
diff options
context:
space:
mode:
authorSt├ęphane Doyon <s.doyon@videotron.ca>2007-10-09 03:48:56 +0000
committerSt├ęphane Doyon <s.doyon@videotron.ca>2007-10-09 03:48:56 +0000
commit5acf09104644a7942cf264d80a99f6bf5ae20792 (patch)
treea9705adea534e53795112eecde1d5b08171c9ac1 /apps/menu.h
parent3fd073ed4d5e0bb819b30ee71546151f13aa2150 (diff)
downloadrockbox-5acf09104644a7942cf264d80a99f6bf5ae20792.tar.gz
rockbox-5acf09104644a7942cf264d80a99f6bf5ae20792.tar.bz2
rockbox-5acf09104644a7942cf264d80a99f6bf5ae20792.zip
Add a voice callback to dynamic menus, along side the text_callback.
From FS#7563. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15042 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.h')
-rw-r--r--apps/menu.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/menu.h b/apps/menu.h
index 0c1000ab2f..d3f7099267 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -90,6 +90,7 @@ struct menu_item_ex {
int (*menu_callback)(int action,
const struct menu_item_ex *this_item);
char *(*list_get_name)(int selected_item, void * data, char *buffer);
+ int (*list_speak_item)(int selected_item, void * data);
void *list_get_name_data;
int icon_id;
} *menu_get_name_and_icon;
@@ -165,9 +166,9 @@ int do_menu(const struct menu_item_ex *menu, int *start_selected);
/* same as above, except the item name is dynamic */
#define MENUITEM_RETURNVALUE_DYNTEXT(name, val, cb, text_callback, \
- text_cb_data, icon) \
+ voice_callback, text_cb_data, icon) \
static const struct menu_get_name_and_icon name##_ \
- = {cb,text_callback,text_cb_data,icon}; \
+ = {cb,text_callback,voice_callback,text_cb_data,icon}; \
static const struct menu_item_ex name = \
{ MT_RETURN_VALUE|MENU_DYNAMIC_DESC, { .value = val}, \
{.menu_get_name_and_icon = & name##_}};
@@ -187,10 +188,11 @@ int do_menu(const struct menu_item_ex *menu, int *start_selected);
{ .function = & name##__}, {.callback_and_desc = & name##_}};
/* As above, except the text is dynamic */
-#define MENUITEM_FUNCTION_DYNTEXT(name, flags, func, param, \
- text_callback, text_cb_data, callback, icon) \
- static const struct menu_get_name_and_icon name##_ \
- = {callback,text_callback,text_cb_data,icon}; \
+#define MENUITEM_FUNCTION_DYNTEXT(name, flags, func, param, \
+ text_callback, voice_callback, \
+ text_cb_data, callback, icon) \
+ static const struct menu_get_name_and_icon name##_ \
+ = {callback,text_callback,voice_callback,text_cb_data,icon}; \
static const struct menu_func name##__ = {{(void*)func}, param}; \
static const struct menu_item_ex name = \
{ MT_FUNCTION_CALL|MENU_DYNAMIC_DESC|flags, \