summaryrefslogtreecommitdiffstats
path: root/minui/include
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-01-14 16:46:10 +0100
committerTao Bao <tbao@google.com>2017-01-23 17:59:56 +0100
commit0b1118d6b9f5de948048b5ed86e639571c744a7f (patch)
tree8e46705ec385121116f70a406d2de2c6b933b1ff /minui/include
parentMerge "minui: Export minui/minui.h." (diff)
downloadandroid_bootable_recovery-0b1118d6b9f5de948048b5ed86e639571c744a7f.tar
android_bootable_recovery-0b1118d6b9f5de948048b5ed86e639571c744a7f.tar.gz
android_bootable_recovery-0b1118d6b9f5de948048b5ed86e639571c744a7f.tar.bz2
android_bootable_recovery-0b1118d6b9f5de948048b5ed86e639571c744a7f.tar.lz
android_bootable_recovery-0b1118d6b9f5de948048b5ed86e639571c744a7f.tar.xz
android_bootable_recovery-0b1118d6b9f5de948048b5ed86e639571c744a7f.tar.zst
android_bootable_recovery-0b1118d6b9f5de948048b5ed86e639571c744a7f.zip
Diffstat (limited to 'minui/include')
-rw-r--r--minui/include/minui/minui.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/minui/include/minui/minui.h b/minui/include/minui/minui.h
index 78890b84b..a1749dfe6 100644
--- a/minui/include/minui/minui.h
+++ b/minui/include/minui/minui.h
@@ -70,15 +70,14 @@ unsigned int gr_get_height(GRSurface* surface);
struct input_event;
-// TODO: move these over to std::function.
-typedef int (*ev_callback)(int fd, uint32_t epevents, void* data);
-typedef int (*ev_set_key_callback)(int code, int value, void* data);
+using ev_callback = std::function<int(int fd, uint32_t epevents)>;
+using ev_set_key_callback = std::function<int(int code, int value)>;
-int ev_init(ev_callback input_cb, void* data);
+int ev_init(ev_callback input_cb);
void ev_exit();
-int ev_add_fd(int fd, ev_callback cb, void* data);
+int ev_add_fd(int fd, ev_callback cb);
void ev_iterate_available_keys(const std::function<void(int)>& f);
-int ev_sync_key_state(ev_set_key_callback set_key_cb, void* data);
+int ev_sync_key_state(const ev_set_key_callback& set_key_cb);
// 'timeout' has the same semantics as poll(2).
// 0 : don't block