diff --git a/minui/Android.mk b/minui/Android.mk
index 66dea74..52f0662 100644
--- a/minui/Android.mk
+++ b/minui/Android.mk
@@ -3,10 +3,10 @@
 
 LOCAL_SRC_FILES := \
     events.cpp \
-    graphics.c \
-    graphics_adf.c \
-    graphics_fbdev.c \
-    resources.c \
+    graphics.cpp \
+    graphics_adf.cpp \
+    graphics_fbdev.cpp \
+    resources.cpp \
 
 LOCAL_WHOLE_STATIC_LIBRARIES += libadf
 LOCAL_STATIC_LIBRARIES += libpng
diff --git a/minui/events.cpp b/minui/events.cpp
index daa10c6..2d47a58 100644
--- a/minui/events.cpp
+++ b/minui/events.cpp
@@ -39,10 +39,10 @@
 };
 
 static int g_epoll_fd;
-static struct epoll_event polledevents[MAX_DEVICES + MAX_MISC_FDS];
+static epoll_event polledevents[MAX_DEVICES + MAX_MISC_FDS];
 static int npolledevents;
 
-static struct fd_info ev_fdinfo[MAX_DEVICES + MAX_MISC_FDS];
+static fd_info ev_fdinfo[MAX_DEVICES + MAX_MISC_FDS];
 
 static unsigned ev_count = 0;
 static unsigned ev_dev_count = 0;
@@ -62,7 +62,7 @@
 
     DIR* dir = opendir("/dev/input");
     if (dir != NULL) {
-        struct dirent* de;
+        dirent* de;
         while ((de = readdir(dir))) {
             unsigned long ev_bits[BITS_TO_LONGS(EV_MAX)];
 
@@ -83,7 +83,7 @@
                 continue;
             }
 
-            struct epoll_event ev;
+            epoll_event ev;
             ev.events = EPOLLIN | EPOLLWAKEUP;
             ev.data.ptr = &ev_fdinfo[ev_count];
             if (epoll_ctl(g_epoll_fd, EPOLL_CTL_ADD, fd, &ev) == -1) {
@@ -121,7 +121,7 @@
         return -1;
     }
 
-    struct epoll_event ev;
+    epoll_event ev;
     ev.events = EPOLLIN | EPOLLWAKEUP;
     ev.data.ptr = (void *)&ev_fdinfo[ev_count];
     int ret = epoll_ctl(g_epoll_fd, EPOLL_CTL_ADD, fd, &ev);
@@ -163,7 +163,7 @@
     }
 }
 
-int ev_get_input(int fd, uint32_t epevents, struct input_event* ev) {
+int ev_get_input(int fd, uint32_t epevents, input_event* ev) {
     if (epevents & EPOLLIN) {
         ssize_t r = read(fd, ev, sizeof(*ev));
         if (r == sizeof(*ev)) {
diff --git a/minui/graphics.c b/minui/graphics.cpp
similarity index 96%
rename from minui/graphics.c
rename to minui/graphics.cpp
index 9d1e1b4..d7d6e8d 100644
--- a/minui/graphics.c
+++ b/minui/graphics.cpp
@@ -35,11 +35,11 @@
 #include "minui.h"
 #include "graphics.h"
 
-typedef struct {
+struct GRFont {
     GRSurface* texture;
     int cwidth;
     int cheight;
-} GRFont;
+};
 
 static GRFont* gr_font = NULL;
 static minui_backend* gr_backend = NULL;
@@ -269,7 +269,7 @@
 
 static void gr_init_font(void)
 {
-    gr_font = calloc(sizeof(*gr_font), 1);
+    gr_font = reinterpret_cast<GRFont*>(calloc(sizeof(*gr_font), 1));
 
     int res = res_create_alpha_surface("font", &(gr_font->texture));
     if (res == 0) {
@@ -282,14 +282,14 @@
         printf("failed to read font: res=%d\n", res);
 
         // fall back to the compiled-in font.
-        gr_font->texture = malloc(sizeof(*gr_font->texture));
+        gr_font->texture = reinterpret_cast<GRSurface*>(malloc(sizeof(*gr_font->texture)));
         gr_font->texture->width = font.width;
         gr_font->texture->height = font.height;
         gr_font->texture->row_bytes = font.width;
         gr_font->texture->pixel_bytes = 1;
 
-        unsigned char* bits = malloc(font.width * font.height);
-        gr_font->texture->data = (void*) bits;
+        unsigned char* bits = reinterpret_cast<unsigned char*>(malloc(font.width * font.height));
+        gr_font->texture->data = reinterpret_cast<unsigned char*>(bits);
 
         unsigned char data;
         unsigned char* in = font.rundata;
diff --git a/minui/graphics.h b/minui/graphics.h
index 993e986..ed229a0 100644
--- a/minui/graphics.h
+++ b/minui/graphics.h
@@ -17,34 +17,26 @@
 #ifndef _GRAPHICS_H_
 #define _GRAPHICS_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdbool.h>
 #include "minui.h"
 
-typedef struct minui_backend {
+// TODO: lose the function pointers.
+struct minui_backend {
     // Initializes the backend and returns a gr_surface to draw into.
-    gr_surface (*init)(struct minui_backend*);
+    gr_surface (*init)(minui_backend*);
 
     // Causes the current drawing surface (returned by the most recent
     // call to flip() or init()) to be displayed, and returns a new
     // drawing surface.
-    gr_surface (*flip)(struct minui_backend*);
+    gr_surface (*flip)(minui_backend*);
 
     // Blank (or unblank) the screen.
-    void (*blank)(struct minui_backend*, bool);
+    void (*blank)(minui_backend*, bool);
 
     // Device cleanup when drawing is done.
-    void (*exit)(struct minui_backend*);
-} minui_backend;
+    void (*exit)(minui_backend*);
+};
 
 minui_backend* open_fbdev();
 minui_backend* open_adf();
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
diff --git a/minui/graphics_adf.c b/minui/graphics_adf.cpp
similarity index 81%
rename from minui/graphics_adf.c
rename to minui/graphics_adf.cpp
index c023d4d..ea7c0ab 100644
--- a/minui/graphics_adf.c
+++ b/minui/graphics_adf.cpp
@@ -44,15 +44,13 @@
 
     unsigned int current_surface;
     unsigned int n_surfaces;
-    struct adf_surface_pdata surfaces[2];
+    adf_surface_pdata surfaces[2];
 };
 
-static gr_surface adf_flip(struct minui_backend *backend);
-static void adf_blank(struct minui_backend *backend, bool blank);
+static gr_surface adf_flip(minui_backend *backend);
+static void adf_blank(minui_backend *backend, bool blank);
 
-static int adf_surface_init(struct adf_pdata *pdata,
-        struct drm_mode_modeinfo *mode, struct adf_surface_pdata *surf)
-{
+static int adf_surface_init(adf_pdata *pdata, drm_mode_modeinfo *mode, adf_surface_pdata *surf) {
     memset(surf, 0, sizeof(*surf));
 
     surf->fd = adf_interface_simple_buffer_alloc(pdata->intf_fd, mode->hdisplay,
@@ -65,8 +63,9 @@
     surf->base.row_bytes = surf->pitch;
     surf->base.pixel_bytes = (pdata->format == DRM_FORMAT_RGB565) ? 2 : 4;
 
-    surf->base.data = mmap(NULL, surf->pitch * surf->base.height, PROT_WRITE,
-            MAP_SHARED, surf->fd, surf->offset);
+    surf->base.data = reinterpret_cast<uint8_t*>(mmap(NULL,
+                                                      surf->pitch * surf->base.height, PROT_WRITE,
+                                                      MAP_SHARED, surf->fd, surf->offset));
     if (surf->base.data == MAP_FAILED) {
         close(surf->fd);
         return -errno;
@@ -75,9 +74,9 @@
     return 0;
 }
 
-static int adf_interface_init(struct adf_pdata *pdata)
+static int adf_interface_init(adf_pdata *pdata)
 {
-    struct adf_interface_data intf_data;
+    adf_interface_data intf_data;
     int ret = 0;
     int err;
 
@@ -107,7 +106,7 @@
     return ret;
 }
 
-static int adf_device_init(struct adf_pdata *pdata, struct adf_device *dev)
+static int adf_device_init(adf_pdata *pdata, adf_device *dev)
 {
     adf_id_t intf_id;
     int intf_fd;
@@ -137,7 +136,7 @@
 
 static gr_surface adf_init(minui_backend *backend)
 {
-    struct adf_pdata *pdata = (struct adf_pdata *)backend;
+    adf_pdata *pdata = (adf_pdata *)backend;
     adf_id_t *dev_ids = NULL;
     ssize_t n_dev_ids, i;
     gr_surface ret;
@@ -164,7 +163,7 @@
     pdata->intf_fd = -1;
 
     for (i = 0; i < n_dev_ids && pdata->intf_fd < 0; i++) {
-        struct adf_device dev;
+        adf_device dev;
 
         int err = adf_device_open(dev_ids[i], O_RDWR, &dev);
         if (err < 0) {
@@ -194,10 +193,10 @@
     return ret;
 }
 
-static gr_surface adf_flip(struct minui_backend *backend)
+static gr_surface adf_flip(minui_backend *backend)
 {
-    struct adf_pdata *pdata = (struct adf_pdata *)backend;
-    struct adf_surface_pdata *surf = &pdata->surfaces[pdata->current_surface];
+    adf_pdata *pdata = (adf_pdata *)backend;
+    adf_surface_pdata *surf = &pdata->surfaces[pdata->current_surface];
 
     int fence_fd = adf_interface_simple_post(pdata->intf_fd, pdata->eng_id,
             surf->base.width, surf->base.height, pdata->format, surf->fd,
@@ -209,22 +208,22 @@
     return &pdata->surfaces[pdata->current_surface].base;
 }
 
-static void adf_blank(struct minui_backend *backend, bool blank)
+static void adf_blank(minui_backend *backend, bool blank)
 {
-    struct adf_pdata *pdata = (struct adf_pdata *)backend;
+    adf_pdata *pdata = (adf_pdata *)backend;
     adf_interface_blank(pdata->intf_fd,
             blank ? DRM_MODE_DPMS_OFF : DRM_MODE_DPMS_ON);
 }
 
-static void adf_surface_destroy(struct adf_surface_pdata *surf)
+static void adf_surface_destroy(adf_surface_pdata *surf)
 {
     munmap(surf->base.data, surf->pitch * surf->base.height);
     close(surf->fd);
 }
 
-static void adf_exit(struct minui_backend *backend)
+static void adf_exit(minui_backend *backend)
 {
-    struct adf_pdata *pdata = (struct adf_pdata *)backend;
+    adf_pdata *pdata = (adf_pdata *)backend;
     unsigned int i;
 
     for (i = 0; i < pdata->n_surfaces; i++)
@@ -236,7 +235,7 @@
 
 minui_backend *open_adf()
 {
-    struct adf_pdata *pdata = calloc(1, sizeof(*pdata));
+    adf_pdata* pdata = reinterpret_cast<adf_pdata*>(calloc(1, sizeof(*pdata)));
     if (!pdata) {
         perror("allocating adf backend failed");
         return NULL;
diff --git a/minui/graphics_fbdev.c b/minui/graphics_fbdev.cpp
similarity index 95%
rename from minui/graphics_fbdev.c
rename to minui/graphics_fbdev.cpp
index 4a5b5b5..9dbdde8 100644
--- a/minui/graphics_fbdev.c
+++ b/minui/graphics_fbdev.cpp
@@ -43,7 +43,7 @@
 static GRSurface* gr_draw = NULL;
 static int displayed_buffer;
 
-static struct fb_var_screeninfo vi;
+static fb_var_screeninfo vi;
 static int fb_fd = -1;
 
 static minui_backend my_backend = {
@@ -80,17 +80,13 @@
 }
 
 static gr_surface fbdev_init(minui_backend* backend) {
-    int fd;
-    void *bits;
-
-    struct fb_fix_screeninfo fi;
-
-    fd = open("/dev/graphics/fb0", O_RDWR);
-    if (fd < 0) {
+    int fd = open("/dev/graphics/fb0", O_RDWR);
+    if (fd == -1) {
         perror("cannot open fb0");
         return NULL;
     }
 
+    fb_fix_screeninfo fi;
     if (ioctl(fd, FBIOGET_FSCREENINFO, &fi) < 0) {
         perror("failed to get fb0 info");
         close(fd);
@@ -124,7 +120,7 @@
            vi.green.offset, vi.green.length,
            vi.blue.offset, vi.blue.length);
 
-    bits = mmap(0, fi.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+    void* bits = mmap(0, fi.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
     if (bits == MAP_FAILED) {
         perror("failed to mmap framebuffer");
         close(fd);
@@ -137,7 +133,7 @@
     gr_framebuffer[0].height = vi.yres;
     gr_framebuffer[0].row_bytes = fi.line_length;
     gr_framebuffer[0].pixel_bytes = vi.bits_per_pixel / 8;
-    gr_framebuffer[0].data = bits;
+    gr_framebuffer[0].data = reinterpret_cast<uint8_t*>(bits);
     memset(gr_framebuffer[0].data, 0, gr_framebuffer[0].height * gr_framebuffer[0].row_bytes);
 
     /* check if we can use double buffering */
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 @@
 
 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 @@
 //  > 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 @@
 // 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
diff --git a/minui/resources.c b/minui/resources.cpp
similarity index 95%
rename from minui/resources.c
rename to minui/resources.cpp
index 886c325..fa413b6 100644
--- a/minui/resources.c
+++ b/minui/resources.cpp
@@ -37,7 +37,8 @@
 #define SURFACE_DATA_ALIGNMENT 8
 
 static gr_surface malloc_surface(size_t data_size) {
-    unsigned char* temp = malloc(sizeof(GRSurface) + data_size + SURFACE_DATA_ALIGNMENT);
+    size_t size = sizeof(GRSurface) + data_size + SURFACE_DATA_ALIGNMENT;
+    unsigned char* temp = reinterpret_cast<unsigned char*>(malloc(size));
     if (temp == NULL) return NULL;
     gr_surface surface = (gr_surface) temp;
     surface->data = temp + sizeof(GRSurface) +
@@ -50,6 +51,8 @@
     char resPath[256];
     unsigned char header[8];
     int result = 0;
+    int color_type, bit_depth;
+    size_t bytesRead;
 
     snprintf(resPath, sizeof(resPath)-1, "/res/images/%s.png", name);
     resPath[sizeof(resPath)-1] = '\0';
@@ -59,7 +62,7 @@
         goto exit;
     }
 
-    size_t bytesRead = fread(header, 1, sizeof(header), fp);
+    bytesRead = fread(header, 1, sizeof(header), fp);
     if (bytesRead != sizeof(header)) {
         result = -2;
         goto exit;
@@ -91,7 +94,6 @@
     png_set_sig_bytes(*png_ptr, sizeof(header));
     png_read_info(*png_ptr, *info_ptr);
 
-    int color_type, bit_depth;
     png_get_IHDR(*png_ptr, *info_ptr, width, height, &bit_depth,
             &color_type, NULL, NULL, NULL);
 
@@ -204,6 +206,8 @@
     png_infop info_ptr = NULL;
     png_uint_32 width, height;
     png_byte channels;
+    unsigned char* p_row;
+    unsigned int y;
 
     *pSurface = NULL;
 
@@ -220,8 +224,7 @@
     png_set_bgr(png_ptr);
 #endif
 
-    unsigned char* p_row = malloc(width * 4);
-    unsigned int y;
+    p_row = reinterpret_cast<unsigned char*>(malloc(width * 4));
     for (y = 0; y < height; ++y) {
         png_read_row(png_ptr, p_row, NULL);
         transform_rgb_to_draw(p_row, surface->data + y * surface->row_bytes, channels, width);
@@ -244,6 +247,10 @@
     png_uint_32 width, height;
     png_byte channels;
     int i;
+    png_textp text;
+    int num_text;
+    unsigned char* p_row;
+    unsigned int y;
 
     *pSurface = NULL;
     *frames = -1;
@@ -252,8 +259,6 @@
     if (result < 0) return result;
 
     *frames = 1;
-    png_textp text;
-    int num_text;
     if (png_get_text(png_ptr, info_ptr, &text, &num_text)) {
         for (i = 0; i < num_text; ++i) {
             if (text[i].key && strcmp(text[i].key, "Frames") == 0 && text[i].text) {
@@ -270,7 +275,7 @@
         goto exit;
     }
 
-    surface = malloc(*frames * sizeof(gr_surface));
+    surface = reinterpret_cast<gr_surface*>(malloc(*frames * sizeof(gr_surface)));
     if (surface == NULL) {
         result = -8;
         goto exit;
@@ -287,8 +292,7 @@
     png_set_bgr(png_ptr);
 #endif
 
-    unsigned char* p_row = malloc(width * 4);
-    unsigned int y;
+    p_row = reinterpret_cast<unsigned char*>(malloc(width * 4));
     for (y = 0; y < height; ++y) {
         png_read_row(png_ptr, p_row, NULL);
         int frame = y % *frames;
@@ -387,6 +391,8 @@
     png_infop info_ptr = NULL;
     png_uint_32 width, height;
     png_byte channels;
+    unsigned char* row;
+    png_uint_32 y;
 
     *pSurface = NULL;
 
@@ -407,8 +413,7 @@
         goto exit;
     }
 
-    unsigned char* row = malloc(width);
-    png_uint_32 y;
+    row = reinterpret_cast<unsigned char*>(malloc(width));
     for (y = 0; y < height; ++y) {
         png_read_row(png_ptr, row, NULL);
         int w = (row[1] << 8) | row[0];
