|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <PluginUiState.h>
Public Member Functions | |
| int | pushList (const char *title, const ui_item_t *items, uint16_t count, uint32_t select_action_id, uint32_t menu_action_id, bool replace_top=false) |
| int | updateListItem (uint16_t index, const ui_item_t *item) |
| Redraw a single row of the current plugin list in place (partial refresh). | |
| int | insertListItem (uint16_t index, const ui_item_t *item) |
| Insert a row at index into the current plugin list (rebuild + partial refresh). | |
| int | removeListItem (uint16_t index) |
| Remove the row at index from the current plugin list (rebuild + partial refresh). | |
| int | pushContextMenu (const char *title, const ui_item_t *items, uint16_t count, uint32_t select_action_id) |
| int | pushConfirm (const char *text, uint8_t icon, uint32_t action_id) |
| int | pushT9 (const char *title, const char *initial, uint16_t max_len, uint32_t action_id) |
| int | pushPin (const char *title, uint8_t max_len, uint8_t max_attempts, uint32_t action_id) |
| int | pushSlider (const char *title, int32_t min, int32_t max, int32_t init, int32_t step, const char *unit, uint32_t action_id) |
| int | pushDate (const char *title, uint8_t d, uint8_t m, uint16_t y, uint32_t action_id) |
| int | pushTime (const char *title, uint8_t h, uint8_t m, uint32_t action_id) |
| int | pushColorPicker (uint8_t r, uint8_t g, uint8_t b, uint32_t action_id) |
| int | pushCanvas (const char *title, uint32_t key_action_id, uint32_t widget_action_id) |
| int | setCanvasLongPressAction (uint32_t action_id) |
| cdc::ui::CanvasView * | canvasView () |
| int | acquireExclusive () |
| int | releaseExclusive () |
| int | setInactivity (uint32_t timeout_ms, uint32_t action_id) |
| int | consumeInputText (char *out, size_t out_size) |
| int | consumeInputInt (int32_t *out) |
| int | setViewFooter (const char *hint) |
| int | setViewEmpty (const char *text) |
| int | setViewLifecycle (uint32_t hide_action_id, uint32_t show_action_id) |
| void | resetForPluginStop () |
| void | dispatchContextSelect (uint8_t idx) |
Static Public Member Functions | |
| static PluginUiState & | instance () noexcept |
Definition at line 36 of file PluginUiState.h.
|
nodiscard |
Definition at line 707 of file PluginUiState.cpp.
References cdc::ui::ViewStack::acquireExclusive(), HOST_ERR_BUSY, HOST_ERR_NO_CAPABILITY, HOST_OK, cdc::ui::ViewStack::instance(), and plg_get_active_plugin().
Referenced by host_ui_acquire_exclusive().
|
nodiscard |
Definition at line 702 of file PluginUiState.cpp.
|
nodiscard |
Definition at line 740 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NOT_FOUND, and HOST_OK.
Referenced by host_ui_consume_input_int().
|
nodiscard |
Definition at line 732 of file PluginUiState.cpp.
References cdc::plugin_manager::copyUtf8(), and HOST_ERR_INVALID_ARG.
Referenced by host_ui_consume_input_text().
| void cdc::plugin_manager::PluginUiState::dispatchContextSelect | ( | uint8_t | idx | ) |
Definition at line 321 of file PluginUiState.cpp.
References cdc::plugin_manager::PluginManager::dispatchAction(), and cdc::plugin_manager::PluginManager::instance().
|
nodiscard |
Insert a row at index into the current plugin list (rebuild + partial refresh).
Definition at line 495 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NO_MEMORY, HOST_ERR_NOT_FOUND, HOST_OK, ui_item_t::icon, ui_item_t::icon_disabled, cdc::ui::ViewStack::instance(), ui_item_t::item_id, ui_item_t::label, cdc::ui::ListView::MAX_ITEMS, cdc::plugin_manager::psramAlloc(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_insert_list_item().
|
staticnodiscardnoexcept |
Definition at line 36 of file PluginUiState.cpp.
Referenced by host_ui_acquire_exclusive(), host_ui_consume_input_int(), host_ui_consume_input_text(), host_ui_insert_list_item(), host_ui_push_color_picker(), host_ui_push_confirm(), host_ui_push_context_menu(), host_ui_push_date(), host_ui_push_list(), host_ui_push_pin_entry(), host_ui_push_slider(), host_ui_push_t9_input(), host_ui_push_time(), host_ui_release_exclusive(), host_ui_remove_list_item(), host_ui_replace_list(), host_ui_set_inactivity(), host_ui_set_view_empty(), host_ui_set_view_footer(), host_ui_set_view_lifecycle(), host_ui_update_list_item(), host_view_canvas_push(), host_view_canvas_set_footer(), host_view_canvas_set_long_press_action(), cdc::plugin_manager::PluginManager::stopActivePlugin(), cdc::plugin_manager::PluginManager::unloadAllFromRam(), and cdc::plugin_manager::PluginManager::unloadFromRam().
|
nodiscard |
Definition at line 671 of file PluginUiState.cpp.
References HOST_ERR_NO_MEMORY, HOST_OK, cdc::ui::ViewStack::instance(), cdc::plugin_manager::psramAlloc(), cdc::ui::ViewStack::push(), and cdc::plugin_manager::toDisplay().
Referenced by host_view_canvas_push().
|
nodiscard |
Definition at line 659 of file PluginUiState.cpp.
References HOST_OK, cdc::ui::ViewStack::instance(), and cdc::ui::ViewStack::push().
Referenced by host_ui_push_color_picker().
|
nodiscard |
Definition at line 560 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_OK, cdc::ui::ViewStack::instance(), cdc::ui::ViewStack::showModal(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_push_confirm().
|
nodiscard |
Definition at line 329 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NO_MEMORY, HOST_OK, cdc::ui::ViewStack::instance(), ui_item_t::item_id, cdc::ui::ContextMenuView::MAX_ITEMS, cdc::plugin_manager::psramAlloc(), cdc::ui::ViewStack::showModal(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_push_context_menu().
|
nodiscard |
Definition at line 630 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_OK, cdc::ui::ViewStack::instance(), cdc::ui::ViewStack::push(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_push_date().
|
nodiscard |
Definition at line 377 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NO_MEMORY, HOST_OK, ui_item_t::icon, ui_item_t::icon_disabled, cdc::ui::ViewStack::instance(), ui_item_t::item_id, cdc::plugin_manager::psramAlloc(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_push_list(), and host_ui_replace_list().
|
nodiscard |
Definition at line 593 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_OK, cdc::ui::ViewStack::instance(), cdc::ui::ViewStack::push(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_push_pin_entry().
|
nodiscard |
Definition at line 608 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NO_MEMORY, HOST_OK, cdc::ui::ViewStack::instance(), cdc::plugin_manager::psramAlloc(), cdc::ui::ViewStack::push(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_push_slider().
|
nodiscard |
Definition at line 574 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NO_MEMORY, HOST_OK, cdc::ui::ViewStack::instance(), cdc::plugin_manager::psramAlloc(), cdc::ui::ViewStack::push(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_push_t9_input().
|
nodiscard |
Definition at line 645 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_OK, cdc::ui::ViewStack::instance(), cdc::ui::ViewStack::push(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_push_time().
|
nodiscard |
Definition at line 715 of file PluginUiState.cpp.
References HOST_ERR_GENERIC, HOST_ERR_NOT_FOUND, HOST_OK, cdc::ui::ViewStack::instance(), and cdc::ui::ViewStack::releaseExclusive().
Referenced by host_ui_release_exclusive().
|
nodiscard |
Remove the row at index from the current plugin list (rebuild + partial refresh).
Definition at line 534 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NOT_FOUND, HOST_OK, and cdc::ui::ViewStack::instance().
Referenced by host_ui_remove_list_item().
| void cdc::plugin_manager::PluginUiState::resetForPluginStop | ( | ) |
Drop ownership of every plugin-pushed view and reset transient state. Called by PluginManager when the active plugin stops; views that may still be on the view stack (popped naturally or not) are destroyed only here, never inline while user input is being dispatched.
Definition at line 120 of file PluginUiState.cpp.
References cdc::ui::ViewStack::instance().
Referenced by cdc::plugin_manager::PluginManager::stopActivePlugin(), cdc::plugin_manager::PluginManager::unloadAllFromRam(), and cdc::plugin_manager::PluginManager::unloadFromRam().
|
nodiscard |
Definition at line 694 of file PluginUiState.cpp.
References HOST_ERR_NOT_FOUND, and HOST_OK.
Referenced by host_view_canvas_set_long_press_action().
|
nodiscard |
Definition at line 723 of file PluginUiState.cpp.
References HOST_OK, cdc::ui::ViewStack::instance(), and cdc::ui::ViewStack::setInactivityTimeout().
Referenced by host_ui_set_inactivity().
|
nodiscard |
Definition at line 58 of file PluginUiState.cpp.
References HOST_ERR_NO_MEMORY, HOST_ERR_NOT_FOUND, HOST_OK, cdc::plugin_manager::psramAlloc(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_set_view_empty().
|
nodiscard |
Definition at line 75 of file PluginUiState.cpp.
References cdc::ui::ViewStack::current(), HOST_ERR_NO_MEMORY, HOST_ERR_NOT_FOUND, HOST_OK, cdc::ui::ViewStack::instance(), cdc::plugin_manager::psramAlloc(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_set_view_footer(), and host_view_canvas_set_footer().
|
nodiscard |
Wire hide/show callbacks on the current plugin view. The action ids fire via plugin_on_action when the view is covered (hide) or revealed (show).
Definition at line 106 of file PluginUiState.cpp.
References cdc::ui::ViewStack::current(), HOST_ERR_NOT_FOUND, HOST_OK, and cdc::ui::ViewStack::instance().
Referenced by host_ui_set_view_lifecycle().
|
nodiscard |
Redraw a single row of the current plugin list in place (partial refresh).
Definition at line 433 of file PluginUiState.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NO_MEMORY, HOST_ERR_NOT_FOUND, HOST_OK, ui_item_t::icon, ui_item_t::icon_disabled, cdc::ui::ViewStack::instance(), ui_item_t::item_id, ui_item_t::label, cdc::plugin_manager::psramAlloc(), and cdc::plugin_manager::toDisplay().
Referenced by host_ui_update_list_item().