summaryrefslogtreecommitdiffstats
path: root/minui/minui.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-10 22:12:05 +0200
committerElliott Hughes <enh@google.com>2015-04-10 22:42:55 +0200
commit07cfb8fe799901948afd6af05ef4674173713bcb (patch)
treedbb3c6ea45cb910397cec50054460d46c99b454f /minui/minui.h
parentMerge "Fix ScreenRecoveryUI to handle devices without power/up/down." (diff)
downloadandroid_bootable_recovery-07cfb8fe799901948afd6af05ef4674173713bcb.tar
android_bootable_recovery-07cfb8fe799901948afd6af05ef4674173713bcb.tar.gz
android_bootable_recovery-07cfb8fe799901948afd6af05ef4674173713bcb.tar.bz2
android_bootable_recovery-07cfb8fe799901948afd6af05ef4674173713bcb.tar.lz
android_bootable_recovery-07cfb8fe799901948afd6af05ef4674173713bcb.tar.xz
android_bootable_recovery-07cfb8fe799901948afd6af05ef4674173713bcb.tar.zst
android_bootable_recovery-07cfb8fe799901948afd6af05ef4674173713bcb.zip
Diffstat (limited to '')
-rw-r--r--minui/minui.h42
1 files changed, 15 insertions, 27 deletions
diff --git a/minui/minui.h b/minui/minui.h
index 82abb8a63..eca3a5030 100644
--- a/minui/minui.h
+++ b/minui/minui.h
@@ -19,33 +19,30 @@
#include <sys/types.h>
-#include <stdbool.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <functional>
//
// Graphics.
//
-typedef struct {
+struct GRSurface {
int width;
int height;
int row_bytes;
int pixel_bytes;
unsigned char* data;
-} GRSurface;
+};
+// TODO: remove this.
typedef GRSurface* gr_surface;
-int gr_init(void);
-void gr_exit(void);
+int gr_init();
+void gr_exit();
-int gr_fb_width(void);
-int gr_fb_height(void);
+int gr_fb_width();
+int gr_fb_height();
-void gr_flip(void);
+void gr_flip();
void gr_fb_blank(bool blank);
void gr_clear(); // clear entire surface to current color
@@ -66,12 +63,14 @@ unsigned int gr_get_height(gr_surface 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);
int ev_init(ev_callback input_cb, void* data);
-void ev_exit(void);
+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);
// 'timeout' has the same semantics as poll(2).
@@ -80,9 +79,9 @@ int ev_sync_key_state(ev_set_key_callback set_key_cb, void* data);
// > 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);
+int ev_get_input(int fd, uint32_t epevents, input_event* ev);
+void ev_dispatch();
+int ev_get_epollfd();
//
// Resources
@@ -124,15 +123,4 @@ int res_create_localized_alpha_surface(const char* name, const char* locale,
// functions.
void res_free_surface(gr_surface surface);
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef __cplusplus
-
-#include <functional>
-void ev_iterate_available_keys(std::function<void(int)> f);
-
-#endif
-
#endif