(menu_input_line_cb.c) Params for public functions should be opaque

pointers instead of rgui_handle_t
This commit is contained in:
twinaphex 2014-04-26 02:08:03 +02:00
parent a299e00e4f
commit 40409a2ab0
2 changed files with 13 additions and 3 deletions

View File

@ -28,15 +28,25 @@
#include "../../input/keyboard_line.h"
#include "menu_input_line_cb.h"
void menu_key_start_line(rgui_handle_t *rgui, const char *label, input_keyboard_line_complete_t cb)
void menu_key_start_line(void *data, const char *label, input_keyboard_line_complete_t cb)
{
rgui_handle_t *rgui = (rgui_handle_t*)data;
if (!rgui)
return;
rgui->keyboard.display = true;
rgui->keyboard.label = label;
rgui->keyboard.buffer = input_keyboard_start_line(rgui, cb);
}
static void menu_key_end_line(rgui_handle_t *rgui)
static void menu_key_end_line(void *data)
{
rgui_handle_t *rgui = (rgui_handle_t*)data;
if (!rgui)
return;
rgui->keyboard.display = false;
rgui->keyboard.label = NULL;
rgui->old_input_state = -1ULL; // Avoid triggering states on pressing return.

View File

@ -22,7 +22,7 @@
void menu_key_event(bool down, unsigned keycode, uint32_t character, uint16_t key_modifiers);
void menu_key_start_line(rgui_handle_t *rgui, const char *label, input_keyboard_line_complete_t cb);
void menu_key_start_line(void *data, const char *label, input_keyboard_line_complete_t cb);
void netplay_port_callback(void *userdata, const char *str);
void netplay_ipaddress_callback(void *userdata, const char *str);