(menu_osk) Cleanup - take out configuration.h dependencies
This commit is contained in:
parent
dd01ae8ebc
commit
bb0840956f
|
@ -31,7 +31,6 @@
|
||||||
#include "menu_osk.h"
|
#include "menu_osk.h"
|
||||||
|
|
||||||
#include "../../input/input_driver.h"
|
#include "../../input/input_driver.h"
|
||||||
#include "../../configuration.h"
|
|
||||||
|
|
||||||
static char *osk_grid[45] = {NULL};
|
static char *osk_grid[45] = {NULL};
|
||||||
|
|
||||||
|
@ -82,16 +81,8 @@ void menu_event_set_osk_ptr(int i)
|
||||||
osk_ptr = i;
|
osk_ptr = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_event_osk_append(int ptr)
|
void menu_event_osk_append(int ptr, bool is_rgui)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
bool is_rgui;
|
|
||||||
|
|
||||||
if (ptr < 0 || !settings)
|
|
||||||
return;
|
|
||||||
|
|
||||||
is_rgui = string_is_equal(settings->arrays.menu_driver, "rgui");
|
|
||||||
|
|
||||||
#ifdef HAVE_LANGEXTRA
|
#ifdef HAVE_LANGEXTRA
|
||||||
if (string_is_equal(osk_grid[ptr],"\xe2\x87\xa6")) /* backspace character */
|
if (string_is_equal(osk_grid[ptr],"\xe2\x87\xa6")) /* backspace character */
|
||||||
input_keyboard_event(true, '\x7f', '\x7f', 0, RETRO_DEVICE_KEYBOARD);
|
input_keyboard_event(true, '\x7f', '\x7f', 0, RETRO_DEVICE_KEYBOARD);
|
||||||
|
@ -99,9 +90,9 @@ void menu_event_osk_append(int ptr)
|
||||||
input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD);
|
input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD);
|
||||||
else
|
else
|
||||||
if (string_is_equal(osk_grid[ptr],"\xe2\x87\xa7")) /* up arrow */
|
if (string_is_equal(osk_grid[ptr],"\xe2\x87\xa7")) /* up arrow */
|
||||||
menu_event_set_osk_idx(OSK_UPPERCASE_LATIN);
|
osk_idx = OSK_UPPERCASE_LATIN;
|
||||||
else if (string_is_equal(osk_grid[ptr],"\xe2\x87\xa9")) /* down arrow */
|
else if (string_is_equal(osk_grid[ptr],"\xe2\x87\xa9")) /* down arrow */
|
||||||
menu_event_set_osk_idx(OSK_LOWERCASE_LATIN);
|
osk_idx = OSK_LOWERCASE_LATIN;
|
||||||
else if (string_is_equal(osk_grid[ptr],"\xe2\x8a\x95")) /* plus sign (next button) */
|
else if (string_is_equal(osk_grid[ptr],"\xe2\x8a\x95")) /* plus sign (next button) */
|
||||||
#else
|
#else
|
||||||
if (string_is_equal(osk_grid[ptr], "Bksp"))
|
if (string_is_equal(osk_grid[ptr], "Bksp"))
|
||||||
|
@ -110,22 +101,22 @@ void menu_event_osk_append(int ptr)
|
||||||
input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD);
|
input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD);
|
||||||
else
|
else
|
||||||
if (string_is_equal(osk_grid[ptr], "Upper"))
|
if (string_is_equal(osk_grid[ptr], "Upper"))
|
||||||
menu_event_set_osk_idx(OSK_UPPERCASE_LATIN);
|
osk_idx = OSK_UPPERCASE_LATIN;
|
||||||
else if (string_is_equal(osk_grid[ptr], "Lower"))
|
else if (string_is_equal(osk_grid[ptr], "Lower"))
|
||||||
menu_event_set_osk_idx(OSK_LOWERCASE_LATIN);
|
osk_idx = OSK_LOWERCASE_LATIN;
|
||||||
else if (string_is_equal(osk_grid[ptr], "Next"))
|
else if (string_is_equal(osk_grid[ptr], "Next"))
|
||||||
#endif
|
#endif
|
||||||
if (menu_event_get_osk_idx() < (is_rgui ? OSK_SYMBOLS_PAGE1 : OSK_TYPE_LAST - 1))
|
if (osk_idx < (is_rgui ? OSK_SYMBOLS_PAGE1 : OSK_TYPE_LAST - 1))
|
||||||
menu_event_set_osk_idx((enum osk_type)(menu_event_get_osk_idx() + 1));
|
osk_idx = (enum osk_type)(osk_idx + 1);
|
||||||
else
|
else
|
||||||
menu_event_set_osk_idx((enum osk_type)(OSK_TYPE_UNKNOWN + 1));
|
osk_idx = ((enum osk_type)(OSK_TYPE_UNKNOWN + 1));
|
||||||
else
|
else
|
||||||
input_keyboard_line_append(osk_grid[ptr]);
|
input_keyboard_line_append(osk_grid[ptr]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_event_osk_iterate(void)
|
void menu_event_osk_iterate(void)
|
||||||
{
|
{
|
||||||
switch (menu_event_get_osk_idx())
|
switch (osk_idx)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LANGEXTRA
|
#ifdef HAVE_LANGEXTRA
|
||||||
case OSK_HIRAGANA_PAGE1:
|
case OSK_HIRAGANA_PAGE1:
|
||||||
|
|
|
@ -55,7 +55,7 @@ int menu_event_get_osk_ptr(void);
|
||||||
|
|
||||||
void menu_event_set_osk_ptr(int a);
|
void menu_event_set_osk_ptr(int a);
|
||||||
|
|
||||||
void menu_event_osk_append(int a);
|
void menu_event_osk_append(int a, bool is_rgui);
|
||||||
|
|
||||||
void menu_event_osk_iterate(void);
|
void menu_event_osk_iterate(void);
|
||||||
|
|
||||||
|
|
30
retroarch.c
30
retroarch.c
|
@ -14746,7 +14746,16 @@ static unsigned menu_event(
|
||||||
RETRO_DEVICE_ID_JOYPAD_A : RETRO_DEVICE_ID_JOYPAD_B;
|
RETRO_DEVICE_ID_JOYPAD_A : RETRO_DEVICE_ID_JOYPAD_B;
|
||||||
unsigned ok_current = BIT256_GET_PTR(p_input, menu_ok_btn);
|
unsigned ok_current = BIT256_GET_PTR(p_input, menu_ok_btn);
|
||||||
unsigned ok_trigger = ok_current & ~ok_old;
|
unsigned ok_trigger = ok_current & ~ok_old;
|
||||||
bool is_rgui = string_is_equal(settings->arrays.menu_driver, "rgui");
|
#ifdef HAVE_RGUI
|
||||||
|
/* TODO/FIXME - instead of looking explicitly for the name rgui, instead
|
||||||
|
* perhaps check if set_texture is set - I assume we want to check if
|
||||||
|
* a menu driver is framebuffer-based instead of specifically looking if
|
||||||
|
* it's RGUI */
|
||||||
|
bool is_rgui = string_is_equal(
|
||||||
|
settings->arrays.menu_driver, "rgui");
|
||||||
|
#else
|
||||||
|
bool is_rgui = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
ok_old = ok_current;
|
ok_old = ok_current;
|
||||||
|
|
||||||
|
@ -14829,26 +14838,29 @@ static unsigned menu_event(
|
||||||
|
|
||||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_L))
|
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_L))
|
||||||
{
|
{
|
||||||
if (menu_event_get_osk_idx() > OSK_TYPE_UNKNOWN + 1)
|
enum osk_type osk_type_idx = menu_event_get_osk_idx();
|
||||||
|
if (osk_type_idx > OSK_TYPE_UNKNOWN + 1)
|
||||||
menu_event_set_osk_idx((enum osk_type)(
|
menu_event_set_osk_idx((enum osk_type)(
|
||||||
menu_event_get_osk_idx() - 1));
|
osk_type_idx - 1));
|
||||||
else
|
else
|
||||||
menu_event_set_osk_idx((enum osk_type)(is_rgui ? OSK_SYMBOLS_PAGE1 : OSK_TYPE_LAST - 1));
|
menu_event_set_osk_idx((enum osk_type)(is_rgui ? OSK_SYMBOLS_PAGE1 : OSK_TYPE_LAST - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_R))
|
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_R))
|
||||||
{
|
{
|
||||||
if (menu_event_get_osk_idx() < (is_rgui ? OSK_SYMBOLS_PAGE1 : OSK_TYPE_LAST - 1))
|
enum osk_type osk_type_idx = menu_event_get_osk_idx();
|
||||||
|
if (osk_type_idx < (is_rgui ? OSK_SYMBOLS_PAGE1 : OSK_TYPE_LAST - 1))
|
||||||
menu_event_set_osk_idx((enum osk_type)(
|
menu_event_set_osk_idx((enum osk_type)(
|
||||||
menu_event_get_osk_idx() + 1));
|
osk_type_idx + 1));
|
||||||
else
|
else
|
||||||
menu_event_set_osk_idx((enum osk_type)(OSK_TYPE_UNKNOWN + 1));
|
menu_event_set_osk_idx((enum osk_type)(OSK_TYPE_UNKNOWN + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BIT256_GET_PTR(p_trigger_input, menu_ok_btn))
|
if (BIT256_GET_PTR(p_trigger_input, menu_ok_btn))
|
||||||
{
|
{
|
||||||
if (menu_event_get_osk_ptr() >= 0)
|
int ptr = menu_event_get_osk_ptr();
|
||||||
menu_event_osk_append(menu_event_get_osk_ptr());
|
if (ptr >= 0)
|
||||||
|
menu_event_osk_append(ptr, is_rgui);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BIT256_GET_PTR(p_trigger_input, menu_cancel_btn))
|
if (BIT256_GET_PTR(p_trigger_input, menu_cancel_btn))
|
||||||
|
@ -15510,7 +15522,9 @@ static int menu_input_pointer_post_iterate(
|
||||||
if (point.retcode > -1)
|
if (point.retcode > -1)
|
||||||
{
|
{
|
||||||
menu_event_set_osk_ptr(point.retcode);
|
menu_event_set_osk_ptr(point.retcode);
|
||||||
menu_event_osk_append(point.retcode);
|
menu_event_osk_append(point.retcode,
|
||||||
|
string_is_equal(
|
||||||
|
configuration_settings->arrays.menu_driver, "rgui"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue