diff options
author | Elliott Hughes <enh@google.com> | 2015-04-10 13:12:05 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-04-10 13:42:55 -0700 |
commit | 07cfb8fe799901948afd6af05ef4674173713bcb (patch) | |
tree | dbb3c6ea45cb910397cec50054460d46c99b454f /minui/minui.h | |
parent | 5d1630a926a02ca13a66eb1e385eabba16b04cfc (diff) | |
download | bootable_recovery-07cfb8fe799901948afd6af05ef4674173713bcb.zip bootable_recovery-07cfb8fe799901948afd6af05ef4674173713bcb.tar.gz bootable_recovery-07cfb8fe799901948afd6af05ef4674173713bcb.tar.bz2 |
Switch minui over to C++.
Change-Id: I59e08a304ae514a3fdb6fab58721f11670bc1b01
Diffstat (limited to 'minui/minui.h')
-rw-r--r-- | minui/minui.h | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/minui/minui.h b/minui/minui.h index 82abb8a..eca3a50 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 |