(OSK) Move runtime state (OSK callbacks) to g_extern

This commit is contained in:
twinaphex 2013-11-16 15:54:50 +01:00
parent 683c6432cd
commit 6828183b64
3 changed files with 16 additions and 11 deletions

View File

@ -994,17 +994,17 @@ static int menu_iterate_func(void *data, unsigned action)
#ifdef HAVE_OSK
// process pending osk init callback
if (g_settings.osk.cb_init != NULL)
if (g_extern.osk.cb_init != NULL)
{
if (g_settings.osk.cb_init(driver.osk_data))
g_settings.osk.cb_init = NULL;
if (g_extern.osk.cb_init(driver.osk_data))
g_extern.osk.cb_init = NULL;
}
// process pending osk callback
if (g_settings.osk.cb_callback != NULL)
if (g_extern.osk.cb_callback != NULL)
{
if (g_settings.osk.cb_callback(driver.osk_data))
g_settings.osk.cb_callback = NULL;
if (g_extern.osk.cb_callback(driver.osk_data))
g_extern.osk.cb_callback = NULL;
}
#endif

View File

@ -1344,8 +1344,8 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
#if defined(HAVE_RSOUND) && defined(HAVE_OSK)
if (action == RGUI_ACTION_OK)
{
g_settings.osk.cb_init = osk_callback_enter_rsound_init;
g_settings.osk.cb_callback = osk_callback_enter_rsound;
g_extern.osk.cb_init = osk_callback_enter_rsound_init;
g_extern.osk.cb_callback = osk_callback_enter_rsound;
}
#endif
break;

View File

@ -194,9 +194,6 @@ struct settings
struct
{
char driver[32];
uint64_t state;
bool (*cb_init)(void *data);
bool (*cb_callback)(void *data);
} osk;
#endif
@ -512,6 +509,14 @@ struct global
} bsv;
#endif
#ifdef HAVE_OSK
struct
{
bool (*cb_init)(void *data);
bool (*cb_callback)(void *data);
} osk;
#endif
bool sram_load_disable;
bool sram_save_disable;
bool use_sram;