mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
(input_keyboard.c) Refactor more functions into static functions
This commit is contained in:
parent
ce9573e4c3
commit
d04940a159
@ -110,7 +110,7 @@ static input_keyboard_line_t *input_keyboard_line_new(void *userdata,
|
|||||||
*
|
*
|
||||||
* Returns: true (1) on success, otherwise false (0).
|
* Returns: true (1) on success, otherwise false (0).
|
||||||
**/
|
**/
|
||||||
bool input_keyboard_line_event(
|
static bool input_keyboard_line_event(
|
||||||
input_keyboard_line_t *state, uint32_t character)
|
input_keyboard_line_t *state, uint32_t character)
|
||||||
{
|
{
|
||||||
char c = character >= 128 ? '?' : character;
|
char c = character >= 128 ? '?' : character;
|
||||||
@ -157,24 +157,6 @@ bool input_keyboard_line_event(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* input_keyboard_line_get_buffer:
|
|
||||||
* @state : Input keyboard line handle.
|
|
||||||
*
|
|
||||||
* Gets the underlying buffer of the keyboard line.
|
|
||||||
*
|
|
||||||
* The underlying buffer can be reallocated at any time
|
|
||||||
* (or be NULL), but the pointer to it remains constant
|
|
||||||
* throughout the objects lifetime.
|
|
||||||
*
|
|
||||||
* Returns: pointer to string.
|
|
||||||
**/
|
|
||||||
const char **input_keyboard_line_get_buffer(
|
|
||||||
const input_keyboard_line_t *state)
|
|
||||||
{
|
|
||||||
return (const char**)&state->buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* input_keyboard_start_line:
|
* input_keyboard_start_line:
|
||||||
* @userdata : Userdata.
|
* @userdata : Userdata.
|
||||||
@ -182,8 +164,11 @@ const char **input_keyboard_line_get_buffer(
|
|||||||
*
|
*
|
||||||
* Sets function pointer for keyboard line handle.
|
* Sets function pointer for keyboard line handle.
|
||||||
*
|
*
|
||||||
* Returns: underlying buffer returned by
|
* The underlying buffer can be reallocated at any time
|
||||||
* input_keyboard_line_get_buffer().
|
* (or be NULL), but the pointer to it remains constant
|
||||||
|
* throughout the objects lifetime.
|
||||||
|
*
|
||||||
|
* Returns: underlying buffer of the keyboard line.
|
||||||
**/
|
**/
|
||||||
const char **input_keyboard_start_line(void *userdata,
|
const char **input_keyboard_start_line(void *userdata,
|
||||||
input_keyboard_line_complete_t cb)
|
input_keyboard_line_complete_t cb)
|
||||||
@ -195,7 +180,7 @@ const char **input_keyboard_start_line(void *userdata,
|
|||||||
/* While reading keyboard line input, we have to block all hotkeys. */
|
/* While reading keyboard line input, we have to block all hotkeys. */
|
||||||
input_driver_keyboard_mapping_set_block(true);
|
input_driver_keyboard_mapping_set_block(true);
|
||||||
|
|
||||||
return input_keyboard_line_get_buffer(g_keyboard_line);
|
return (const char**)&g_keyboard_line->buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,34 +66,6 @@ typedef struct input_keyboard_ctx_wait
|
|||||||
input_keyboard_press_t cb;
|
input_keyboard_press_t cb;
|
||||||
} input_keyboard_ctx_wait_t;
|
} input_keyboard_ctx_wait_t;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* input_keyboard_line_event:
|
|
||||||
* @state : Input keyboard line handle.
|
|
||||||
* @character : Inputted character.
|
|
||||||
*
|
|
||||||
* Called on every keyboard character event.
|
|
||||||
*
|
|
||||||
* Returns: true (1) on success, otherwise false (0).
|
|
||||||
**/
|
|
||||||
bool input_keyboard_line_event(input_keyboard_line_t *state,
|
|
||||||
uint32_t character);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* input_keyboard_line_get_buffer:
|
|
||||||
* @state : Input keyboard line handle.
|
|
||||||
*
|
|
||||||
* Gets the underlying buffer of the keyboard line.
|
|
||||||
*
|
|
||||||
* The underlying buffer can be reallocated at any time
|
|
||||||
* (or be NULL), but the pointer to it remains constant
|
|
||||||
* throughout the objects lifetime.
|
|
||||||
*
|
|
||||||
* Returns: pointer to string.
|
|
||||||
**/
|
|
||||||
const char **input_keyboard_line_get_buffer(
|
|
||||||
const input_keyboard_line_t *state);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* input_keyboard_event:
|
* input_keyboard_event:
|
||||||
* @down : Keycode was pressed down?
|
* @down : Keycode was pressed down?
|
||||||
@ -114,8 +86,11 @@ void input_keyboard_event(bool down, unsigned code, uint32_t character,
|
|||||||
*
|
*
|
||||||
* Sets function pointer for keyboard line handle.
|
* Sets function pointer for keyboard line handle.
|
||||||
*
|
*
|
||||||
* Returns: underlying buffer returned by
|
* The underlying buffer can be reallocated at any time
|
||||||
* input_keyboard_line_get_buffer().
|
* (or be NULL), but the pointer to it remains constant
|
||||||
|
* throughout the objects lifetime.
|
||||||
|
*
|
||||||
|
* Returns: underlying buffer of the keyboard line.
|
||||||
**/
|
**/
|
||||||
const char **input_keyboard_start_line(void *userdata,
|
const char **input_keyboard_start_line(void *userdata,
|
||||||
input_keyboard_line_complete_t cb);
|
input_keyboard_line_complete_t cb);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user