From 07cfb8fe799901948afd6af05ef4674173713bcb Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 10 Apr 2015 13:12:05 -0700 Subject: Switch minui over to C++. Change-Id: I59e08a304ae514a3fdb6fab58721f11670bc1b01 --- minui/minui.h | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) (limited to 'minui/minui.h') 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 -#include - -#ifdef __cplusplus -extern "C" { -#endif +#include // // 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 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 -void ev_iterate_available_keys(std::function f); - -#endif - #endif -- cgit v1.2.3