summaryrefslogtreecommitdiffstats
path: root/minui/minui.h
diff options
context:
space:
mode:
Diffstat (limited to 'minui/minui.h')
-rw-r--r--minui/minui.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/minui/minui.h b/minui/minui.h
index bf796010e..766b943ff 100644
--- a/minui/minui.h
+++ b/minui/minui.h
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <functional>
+#include <string>
//
// Graphics.
@@ -79,15 +80,23 @@ unsigned int gr_get_height(GRSurface* surface);
struct input_event;
-// TODO: move these over to std::function.
+#ifdef TW_USE_MINUI_WITH_DATA
typedef int (*ev_callback)(int fd, uint32_t epevents, void* data);
typedef int (*ev_set_key_callback)(int code, int value, void* data);
int ev_init(ev_callback input_cb, void* data);
-void ev_exit();
int ev_add_fd(int fd, ev_callback cb, void* data);
-void ev_iterate_available_keys(std::function<void(int)> f);
int ev_sync_key_state(ev_set_key_callback set_key_cb, void* data);
+#else
+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);
+int ev_add_fd(int fd, ev_callback cb);
+int ev_sync_key_state(const ev_set_key_callback& set_key_cb);
+#endif
+void ev_exit();
+void ev_iterate_available_keys(const std::function<void(int)>& f);
// 'timeout' has the same semantics as poll(2).
// 0 : don't block
@@ -103,7 +112,7 @@ int ev_get_epollfd();
// Resources
//
-bool matches_locale(const char* prefix, const char* locale);
+bool matches_locale(const std::string& prefix, const std::string& locale);
// res_create_*_surface() functions return 0 if no error, else
// negative.
@@ -134,8 +143,8 @@ int res_create_alpha_surface(const char* name, GRSurface** pSurface);
// given locale. The image is expected to be a composite of multiple
// translations of the same text, with special added rows that encode
// the subimages' size and intended locale in the pixel data. See
-// development/tools/recovery_l10n for an app that will generate these
-// specialized images from Android resources.
+// bootable/recovery/tools/recovery_l10n for an app that will generate
+// these specialized images from Android resources.
int res_create_localized_alpha_surface(const char* name, const char* locale,
GRSurface** pSurface);