aboutsummaryrefslogtreecommitdiffstats
path: root/minui/minui.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-10 09:40:53 -0700
committerElliott Hughes <enh@google.com>2015-04-10 09:40:53 -0700
commit0713819fd256bfdfcf241c71195b7e8c4e18c742 (patch)
treee68f2fac4bb1c6de65c29b4886d135f05511b84a /minui/minui.h
parentf471861e832e4be3a07359dfb72c1812de64b7ac (diff)
downloadbootable_recovery-0713819fd256bfdfcf241c71195b7e8c4e18c742.zip
bootable_recovery-0713819fd256bfdfcf241c71195b7e8c4e18c742.tar.gz
bootable_recovery-0713819fd256bfdfcf241c71195b7e8c4e18c742.tar.bz2
Add ev_iterate_available_keys to minui.
This lets us recognize whether we have up/down/power, say, and tailor the UI accordingly. Change-Id: If94e454f14243b59d2f473ac9a436bd60591da01
Diffstat (limited to 'minui/minui.h')
-rw-r--r--minui/minui.h35
1 files changed, 22 insertions, 13 deletions
diff --git a/minui/minui.h b/minui/minui.h
index 733b675..8f2ff11 100644
--- a/minui/minui.h
+++ b/minui/minui.h
@@ -25,6 +25,10 @@
extern "C" {
#endif
+//
+// Graphics.
+//
+
typedef struct {
int width;
int height;
@@ -56,30 +60,35 @@ void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy);
unsigned int gr_get_width(gr_surface surface);
unsigned int gr_get_height(gr_surface surface);
-// input event structure, include <linux/input.h> for the definition.
-// see http://www.mjmwired.net/kernel/Documentation/input/ for info.
+//
+// Input events.
+//
+
struct input_event;
-typedef int (*ev_callback)(int fd, uint32_t epevents, void *data);
-typedef int (*ev_set_key_callback)(int code, int value, void *data);
+typedef int (*ev_callback)(int fd, uint32_t epevents, void* data);
+typedef int (*ev_set_key_callback)(int code, int value, void* data);
+typedef void (*ev_key_callback)(int code, void* data);
-int ev_init(ev_callback input_cb, void *data);
+int ev_init(ev_callback input_cb, void* data);
void ev_exit(void);
-int ev_add_fd(int fd, ev_callback cb, void *data);
-int ev_sync_key_state(ev_set_key_callback set_key_cb, void *data);
-
-/* timeout has the same semantics as for poll
- * 0 : don't block
- * < 0 : block forever
- * > 0 : block for 'timeout' milliseconds
- */
+int ev_add_fd(int fd, ev_callback cb, void* data);
+int ev_sync_key_state(ev_set_key_callback set_key_cb, void* data);
+void ev_iterate_available_keys(ev_key_callback cb, void* data);
+
+// 'timeout' has the same semantics as poll(2).
+// 0 : don't block
+// < 0 : block forever
+// > 0 : block for 'timeout' milliseconds
int ev_wait(int timeout);
int ev_get_input(int fd, uint32_t epevents, struct input_event *ev);
void ev_dispatch(void);
int ev_get_epollfd(void);
+//
// Resources
+//
// res_create_*_surface() functions return 0 if no error, else
// negative.