summaryrefslogtreecommitdiffstats
path: root/minui/include
diff options
context:
space:
mode:
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