keyboard: add helper to get the keyboard's renderer, if applicable

Based on an original patch from Gert van de Kraats on Ubuntu's Launchpad:
https://bugs.launchpad.net/ubuntu/+source/plymouth/+bug/1794292Signed-off-by: Mathieu Trudel-Lapierre's avatarMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
parent 0cd06137
......@@ -587,4 +587,20 @@ ply_keyboard_remove_enter_handler (ply_keyboard_t *keyboard,
}
}
ply_renderer_t *
ply_keyboard_get_renderer (ply_keyboard_t *keyboard)
{
assert (keyboard != NULL);
switch (keyboard->provider_type) {
case PLY_KEYBOARD_PROVIDER_TYPE_RENDERER:
return keyboard->provider.if_renderer->renderer;
default:
break;
}
return NULL;
}
/* vim: set ts=4 sw=4 et ai ci cino={.5s,^-2,+.5s,t0,g0,e-2,n-2,p2s,(0,=.5s,:.5s */
......@@ -72,6 +72,7 @@ void ply_keyboard_remove_enter_handler (ply_keyboard_t *keyboard,
bool ply_keyboard_watch_for_input (ply_keyboard_t *keyboard);
void ply_keyboard_stop_watching_for_input (ply_keyboard_t *keyboard);
bool ply_keyboard_is_active (ply_keyboard_t *keyboard);
ply_renderer_t *ply_keyboard_get_renderer (ply_keyboard_t *keyboard);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment