notaz.gp2x.de
/
libpicofe.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
menu: add pre-draw func and move pico ext filter
[libpicofe.git]
/
common
/
menu.c
diff --git
a/common/menu.c
b/common/menu.c
index
b05c755
..
f55b48d
100644
(file)
--- a/
common/menu.c
+++ b/
common/menu.c
@@
-573,14
+573,14
@@
static int me_process(menu_entry *entry, int is_next, int is_lr)
\r
static void debug_menu_loop(void);
\r
\r
\r
static void debug_menu_loop(void);
\r
\r
-static
void me_loop(menu_entry *menu, int *menu_sel
, void (*draw_more)(void))
\r
+static
int me_loop_d(menu_entry *menu, int *menu_sel, void (*draw_prep)(void)
, void (*draw_more)(void))
\r
{
\r
{
\r
- int ret, inp, sel = *menu_sel, menu_sel_max;
\r
+ int ret
= 0
, inp, sel = *menu_sel, menu_sel_max;
\r
\r
menu_sel_max = me_count(menu) - 1;
\r
if (menu_sel_max < 0) {
\r
lprintf("no enabled menu entries\n");
\r
\r
menu_sel_max = me_count(menu) - 1;
\r
if (menu_sel_max < 0) {
\r
lprintf("no enabled menu entries\n");
\r
- return;
\r
+ return
0
;
\r
}
\r
\r
while ((!menu[sel].enabled || !menu[sel].selectable) && sel < menu_sel_max)
\r
}
\r
\r
while ((!menu[sel].enabled || !menu[sel].selectable) && sel < menu_sel_max)
\r
@@
-592,6
+592,9
@@
static void me_loop(menu_entry *menu, int *menu_sel, void (*draw_more)(void))
\r
for (;;)
\r
{
\r
\r
for (;;)
\r
{
\r
+ if (draw_prep != NULL)
\r
+ draw_prep();
\r
+
\r
me_draw(menu, sel, draw_more);
\r
inp = in_menu_wait(PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT|
\r
PBTN_MOK|PBTN_MBACK|PBTN_MENU|PBTN_L|PBTN_R, 70);
\r
me_draw(menu, sel, draw_more);
\r
inp = in_menu_wait(PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT|
\r
PBTN_MOK|PBTN_MBACK|PBTN_MENU|PBTN_L|PBTN_R, 70);
\r
@@
-636,6
+639,13
@@
static void me_loop(menu_entry *menu, int *menu_sel, void (*draw_more)(void))
}
\r
}
\r
*menu_sel = sel;
\r
}
\r
}
\r
*menu_sel = sel;
\r
+
\r
+ return ret;
\r
+}
\r
+
\r
+static int me_loop(menu_entry *menu, int *menu_sel)
\r
+{
\r
+ return me_loop_d(menu, menu_sel, NULL, NULL);
\r
}
\r
\r
/* ***************************************** */
\r
}
\r
\r
/* ***************************************** */
\r
@@
-766,11
+776,6
@@
static int scandir_cmp(const void *p1, const void *p2)
return alphasort(d1, d2);
\r
}
\r
\r
return alphasort(d1, d2);
\r
}
\r
\r
-static const char *filter_exts[] = {
\r
- ".mp3", ".MP3", ".srm", ".brm", "s.gz", ".mds", "bcfg", ".txt", ".htm", "html",
\r
- ".jpg", ".gpe"
\r
-};
\r
-
\r
static int scandir_filter(const struct dirent *ent)
\r
{
\r
const char *p;
\r
static int scandir_filter(const struct dirent *ent)
\r
{
\r
const char *p;
\r