From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3 v2] common, menu: add statusline support
Date: Tue, 17 Jan 2012 08:13:20 +0100 [thread overview]
Message-ID: <1326784400-4810-1-git-send-email-hs@denx.de> (raw)
In-Reply-To: <1326614022-24014-3-git-send-email-hs@denx.de>
add the possibility to show a statusline when printing a menu
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>
---
- changes for v2:
- add comments from Mike Frysinger <vapier@gentoo.org>:
- add a prototype for the new function menu_display_statusline
in menu.h and document it in doc/README.menu
| 8 ++++++++
| 5 +++++
| 1 +
3 files changed, 14 insertions(+), 0 deletions(-)
--git a/common/menu.c b/common/menu.c
index 3b1e0d0..754a9f9 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -113,6 +113,13 @@ static inline void *menu_item_destroy(struct menu *m,
return NULL;
}
+void __menu_display_statusline(struct menu *m)
+{
+ return;
+}
+void menu_display_statusline(struct menu *m)
+ __attribute__ ((weak, alias("__menu_display_statusline")));
+
/*
* Display a menu so the user can make a choice of an item. First display its
* title, if any, and then each item in the menu.
@@ -123,6 +130,7 @@ static inline void menu_display(struct menu *m)
puts(m->title);
putc('\n');
}
+ menu_display_statusline(m);
menu_items_iter(m, menu_item_print, NULL);
}
--git a/doc/README.menu b/doc/README.menu
index 0dad6a2..4ddf914 100644
--- a/doc/README.menu
+++ b/doc/README.menu
@@ -69,6 +69,11 @@ int menu_get_choice(struct menu *m, void **choice);
*/
int menu_destroy(struct menu *m);
+/*
+ * menu_display_statusline(struct menu *m);
+ * shows a statusline for every menu_display call.
+ */
+void menu_display_statusline(struct menu *m);
Example Code
------------
--git a/include/menu.h b/include/menu.h
index cf14a9c..b806a02 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -26,5 +26,6 @@ int menu_default_set(struct menu *m, char *item_key);
int menu_get_choice(struct menu *m, void **choice);
int menu_item_add(struct menu *m, char *item_key, void *item_data);
int menu_destroy(struct menu *m);
+void menu_display_statusline(struct menu *m);
#endif /* __MENU_H__ */
--
1.7.7.4
next prev parent reply other threads:[~2012-01-17 7:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-15 7:53 [U-Boot] [PATCH 0/3] common, menu: enhancements Heiko Schocher
2012-01-15 7:53 ` [U-Boot] [PATCH 1/3] common: add possibility for readline_into_buffer timeout Heiko Schocher
2012-01-15 17:35 ` Mike Frysinger
2012-01-16 6:43 ` Heiko Schocher
2012-01-17 7:13 ` [U-Boot] [PATCH 1/3 v2] " Heiko Schocher
2012-01-17 19:14 ` Mike Frysinger
2012-02-17 21:33 ` Stephan Linz
2012-02-17 23:18 ` Mike Frysinger
2012-01-15 7:53 ` [U-Boot] [PATCH 2/3] common, menu: add statusline support Heiko Schocher
2012-01-15 17:36 ` Mike Frysinger
2012-01-16 6:54 ` Heiko Schocher
2012-01-17 7:13 ` Heiko Schocher [this message]
2012-01-17 19:14 ` [U-Boot] [PATCH 2/3 v2] " Mike Frysinger
2012-01-15 7:53 ` [U-Boot] [PATCH 3/3] common, menu: show menu on startup if CONFIG_MENU_SHOW is defined Heiko Schocher
2012-01-15 17:38 ` Mike Frysinger
2012-01-16 6:55 ` Heiko Schocher
2012-01-17 7:13 ` [U-Boot] [PATCH 3/3 v2] " Heiko Schocher
2012-01-17 12:55 ` Jason Hobbs
2012-01-18 6:05 ` [U-Boot] [PATCH 3/3 v3] " Heiko Schocher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1326784400-4810-1-git-send-email-hs@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.