diff --git a/core/embed/rust/src/ui/api/bootloader_c.rs b/core/embed/rust/src/ui/api/bootloader_c.rs index 9783f9c427e..30590d6ec8b 100644 --- a/core/embed/rust/src/ui/api/bootloader_c.rs +++ b/core/embed/rust/src/ui/api/bootloader_c.rs @@ -2,8 +2,9 @@ use crate::{ strutil::hexlify, trezorhal::secbool::secbool, ui::{ - ui_features::{ModelUI, UIFeaturesBootloader}, + ui_bootloader::BootloaderUI, util::{from_c_array, from_c_str}, + ModelUI, }, }; diff --git a/core/embed/rust/src/ui/api/common_c.rs b/core/embed/rust/src/ui/api/common_c.rs index 1050e1b45bc..16c81443ce5 100644 --- a/core/embed/rust/src/ui/api/common_c.rs +++ b/core/embed/rust/src/ui/api/common_c.rs @@ -1,7 +1,7 @@ //! Reexporting the `screens` module according to the //! current feature (Trezor model) -use crate::ui::ui_features::{ModelUI, UIFeaturesCommon}; +use crate::ui::{CommonUI, ModelUI}; use crate::ui::shape; diff --git a/core/embed/rust/src/ui/api/firmware_upy.rs b/core/embed/rust/src/ui/api/firmware_micropython.rs similarity index 99% rename from core/embed/rust/src/ui/api/firmware_upy.rs rename to core/embed/rust/src/ui/api/firmware_micropython.rs index 1677d84f906..ed4d6244bd3 100644 --- a/core/embed/rust/src/ui/api/firmware_upy.rs +++ b/core/embed/rust/src/ui/api/firmware_micropython.rs @@ -21,10 +21,10 @@ use crate::{ result::{CANCELLED, CONFIRMED, INFO}, util::{upy_disable_animation, RecoveryType}, }, - ui_features::ModelUI, - ui_features_fw::{ - UIFeaturesFirmware, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_WORD_QUIZ_ITEMS, + ui_firmware::{ + FirmwareUI, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_WORD_QUIZ_ITEMS, }, + ModelUI, }, }; use heapless::Vec; diff --git a/core/embed/rust/src/ui/api/mod.rs b/core/embed/rust/src/ui/api/mod.rs index 8569a55b7e6..4b91b6315aa 100644 --- a/core/embed/rust/src/ui/api/mod.rs +++ b/core/embed/rust/src/ui/api/mod.rs @@ -4,4 +4,4 @@ pub mod common_c; pub mod bootloader_c; #[cfg(feature = "micropython")] -pub mod firmware_upy; +pub mod firmware_micropython; diff --git a/core/embed/rust/src/ui/backlight.rs b/core/embed/rust/src/ui/backlight.rs index 98f6aff2695..14bfa68b9c0 100644 --- a/core/embed/rust/src/ui/backlight.rs +++ b/core/embed/rust/src/ui/backlight.rs @@ -3,7 +3,7 @@ use crate::{ micropython::{ ffi, macros::obj_type, obj::Obj, qstr::Qstr, simple_type::SimpleTypeObj, typ::Type, util, }, - ui::{ui_features::ModelUI, UIFeaturesCommon}, + ui::{CommonUI, ModelUI}, }; /* diff --git a/core/embed/rust/src/ui/flow/swipe.rs b/core/embed/rust/src/ui/flow/swipe.rs index 2268cb8ebd6..a4039072b45 100644 --- a/core/embed/rust/src/ui/flow/swipe.rs +++ b/core/embed/rust/src/ui/flow/swipe.rs @@ -16,9 +16,8 @@ use crate::{ geometry::{Direction, Rect}, layout::base::{Layout, LayoutState}, shape::{render_on_display, ConcreteRenderer, Renderer, ScopedRenderer}, - ui_features::ModelUI, util::animation_disabled, - UIFeaturesCommon, + CommonUI, ModelUI, }, }; diff --git a/core/embed/rust/src/ui/layout/obj.rs b/core/embed/rust/src/ui/layout/obj.rs index 2c74c378d56..51ae2231405 100644 --- a/core/embed/rust/src/ui/layout/obj.rs +++ b/core/embed/rust/src/ui/layout/obj.rs @@ -37,8 +37,7 @@ use crate::{ }, display, event::USBEvent, - ui_features::ModelUI, - UIFeaturesCommon, + CommonUI, ModelUI, }, }; @@ -97,7 +96,7 @@ impl ComponentMaybeTrace for T where T: Component + ComponentMsgObj + MaybeTr pub struct RootComponent where T: Component, - M: UIFeaturesCommon, + M: CommonUI, { inner: T, returned_value: Option>, @@ -107,7 +106,7 @@ where impl RootComponent where T: ComponentMaybeTrace, - M: UIFeaturesCommon, + M: CommonUI, { pub fn new(component: T) -> Self { Self { diff --git a/core/embed/rust/src/ui/layout/simplified.rs b/core/embed/rust/src/ui/layout/simplified.rs index 6ecc692a4d4..3ed54b99c76 100644 --- a/core/embed/rust/src/ui/layout/simplified.rs +++ b/core/embed/rust/src/ui/layout/simplified.rs @@ -8,9 +8,7 @@ use crate::ui::event::ButtonEvent; use crate::ui::event::TouchEvent; use crate::ui::{ component::{Component, Event, EventCtx, Never}, - display, - ui_features::ModelUI, - UIFeaturesCommon, + display, CommonUI, ModelUI, }; use num_traits::ToPrimitive; diff --git a/core/embed/rust/src/ui/mod.rs b/core/embed/rust/src/ui/mod.rs index 7636c026a3e..6ed81d9f915 100644 --- a/core/embed/rust/src/ui/mod.rs +++ b/core/embed/rust/src/ui/mod.rs @@ -24,8 +24,23 @@ pub mod model_tr; #[cfg(feature = "model_tt")] pub mod model_tt; -pub mod ui_features; +#[cfg(feature = "bootloader")] +pub mod ui_bootloader; +pub mod ui_common; #[cfg(feature = "micropython")] -pub mod ui_features_fw; +pub mod ui_firmware; -pub use ui_features::UIFeaturesCommon; +pub use ui_common::CommonUI; + +#[cfg(all( + feature = "model_mercury", + not(feature = "model_tr"), + not(feature = "model_tt") +))] +pub type ModelUI = crate::ui::model_mercury::UIMercury; + +#[cfg(all(feature = "model_tr", not(feature = "model_tt")))] +pub type ModelUI = crate::ui::model_tr::UIModelTR; + +#[cfg(feature = "model_tt")] +pub type ModelUI = crate::ui::model_tt::UIModelTT; diff --git a/core/embed/rust/src/ui/model_mercury/bootloader/mod.rs b/core/embed/rust/src/ui/model_mercury/bootloader/mod.rs index e36169ed2ac..22e557ecaea 100644 --- a/core/embed/rust/src/ui/model_mercury/bootloader/mod.rs +++ b/core/embed/rust/src/ui/model_mercury/bootloader/mod.rs @@ -26,10 +26,10 @@ use super::{ }, GREEN_LIGHT, GREY, }, - ModelMercuryFeatures, + UIMercury, }; -use crate::ui::{ui_features::UIFeaturesBootloader, UIFeaturesCommon}; +use crate::ui::{ui_bootloader::BootloaderUI, CommonUI}; use crate::ui::{ display::{toif::Toif, LOADER_MAX}, @@ -53,10 +53,10 @@ pub type BootloaderString = String<128>; const RECONNECT_MESSAGE: &str = "PLEASE RECONNECT\nTHE DEVICE"; -const SCREEN: Rect = ModelMercuryFeatures::SCREEN; +const SCREEN: Rect = UIMercury::SCREEN; const PROGRESS_TEXT_ORIGIN: Point = Point::new(2, 28); -impl ModelMercuryFeatures { +impl UIMercury { fn screen_progress( text: &str, progress: u16, @@ -122,7 +122,7 @@ impl ModelMercuryFeatures { } } -impl UIFeaturesBootloader for ModelMercuryFeatures { +impl BootloaderUI for UIMercury { fn screen_welcome() { let mut frame = Welcome::new(); show(&mut frame, true); diff --git a/core/embed/rust/src/ui/model_mercury/layout.rs b/core/embed/rust/src/ui/model_mercury/component_msg_obj.rs similarity index 100% rename from core/embed/rust/src/ui/model_mercury/layout.rs rename to core/embed/rust/src/ui/model_mercury/component_msg_obj.rs diff --git a/core/embed/rust/src/ui/model_mercury/mod.rs b/core/embed/rust/src/ui/model_mercury/mod.rs index 79ee10cc908..fcbf33ee4b1 100644 --- a/core/embed/rust/src/ui/model_mercury/mod.rs +++ b/core/embed/rust/src/ui/model_mercury/mod.rs @@ -1,4 +1,4 @@ -use super::{geometry::Rect, UIFeaturesCommon}; +use super::{geometry::Rect, CommonUI}; use crate::ui::model_mercury::theme::backlight; #[cfg(feature = "bootloader")] @@ -7,18 +7,18 @@ pub mod component; pub mod constant; pub mod theme; +#[cfg(feature = "micropython")] +pub mod component_msg_obj; pub mod cshape; #[cfg(feature = "micropython")] pub mod flow; -#[cfg(feature = "micropython")] -pub mod layout; pub mod screens; #[cfg(feature = "micropython")] -pub mod ui_features_fw; +pub mod ui_firmware; -pub struct ModelMercuryFeatures; +pub struct UIMercury; -impl UIFeaturesCommon for ModelMercuryFeatures { +impl CommonUI for UIMercury { #[cfg(feature = "backlight")] fn fadein() { crate::ui::display::fade_backlight_duration(backlight::get_backlight_normal(), 150); diff --git a/core/embed/rust/src/ui/model_mercury/ui_features_fw.rs b/core/embed/rust/src/ui/model_mercury/ui_firmware.rs similarity index 99% rename from core/embed/rust/src/ui/model_mercury/ui_features_fw.rs rename to core/embed/rust/src/ui/model_mercury/ui_firmware.rs index 3cfdd4566a6..ba22ac4e2c5 100644 --- a/core/embed/rust/src/ui/model_mercury/ui_features_fw.rs +++ b/core/embed/rust/src/ui/model_mercury/ui_firmware.rs @@ -25,10 +25,10 @@ use crate::{ obj::{LayoutMaybeTrace, LayoutObj, RootComponent}, util::{PropsList, RecoveryType}, }, - ui_features::ModelUI, - ui_features_fw::{ - UIFeaturesFirmware, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_WORD_QUIZ_ITEMS, + ui_firmware::{ + FirmwareUI, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_WORD_QUIZ_ITEMS, }, + ModelUI, }, }; @@ -42,10 +42,10 @@ use super::{ self, new_confirm_action_simple, ConfirmActionExtra, ConfirmActionMenuStrings, ConfirmActionStrings, ConfirmBlobParams, ShowInfoParams, }, - theme, ModelMercuryFeatures, + theme, UIMercury, }; -impl UIFeaturesFirmware for ModelMercuryFeatures { +impl FirmwareUI for UIMercury { fn confirm_action( title: TString<'static>, action: Option>, diff --git a/core/embed/rust/src/ui/model_tr/bootloader/mod.rs b/core/embed/rust/src/ui/model_tr/bootloader/mod.rs index f23e7bb13a0..e5f66199a4c 100644 --- a/core/embed/rust/src/ui/model_tr/bootloader/mod.rs +++ b/core/embed/rust/src/ui/model_tr/bootloader/mod.rs @@ -21,7 +21,7 @@ use super::{ bootloader::{BLD_BG, BLD_FG, ICON_ALERT, ICON_SPINNER, ICON_SUCCESS}, ICON_ARM_LEFT, ICON_ARM_RIGHT, TEXT_BOLD, TEXT_NORMAL, }, - ModelTRFeatures, + UIModelTR, }; use crate::ui::{ @@ -34,7 +34,7 @@ mod intro; mod menu; mod welcome; -use crate::ui::ui_features::UIFeaturesBootloader; +use crate::ui::ui_bootloader::BootloaderUI; use intro::Intro; use menu::Menu; use welcome::Welcome; @@ -47,7 +47,7 @@ impl ReturnToC for ConfirmMsg { } } -impl ModelTRFeatures { +impl UIModelTR { fn screen_progress( text: &str, text2: &str, @@ -92,7 +92,7 @@ impl ModelTRFeatures { } } -impl UIFeaturesBootloader for ModelTRFeatures { +impl BootloaderUI for UIModelTR { fn screen_welcome() { let mut frame = Welcome::new(); show(&mut frame, true); diff --git a/core/embed/rust/src/ui/model_tr/layout.rs b/core/embed/rust/src/ui/model_tr/component_msg_obj.rs similarity index 100% rename from core/embed/rust/src/ui/model_tr/layout.rs rename to core/embed/rust/src/ui/model_tr/component_msg_obj.rs diff --git a/core/embed/rust/src/ui/model_tr/mod.rs b/core/embed/rust/src/ui/model_tr/mod.rs index d7369d81d39..cce8bdaf422 100644 --- a/core/embed/rust/src/ui/model_tr/mod.rs +++ b/core/embed/rust/src/ui/model_tr/mod.rs @@ -1,22 +1,22 @@ -use super::{geometry::Rect, UIFeaturesCommon}; +use super::{geometry::Rect, CommonUI}; #[cfg(feature = "bootloader")] pub mod bootloader; pub mod common_messages; pub mod component; +#[cfg(feature = "micropython")] +pub mod component_msg_obj; pub mod constant; pub mod cshape; -#[cfg(feature = "micropython")] -pub mod layout; mod screens; pub mod theme; -pub struct ModelTRFeatures {} +pub struct UIModelTR {} #[cfg(feature = "micropython")] -pub mod ui_features_fw; +pub mod ui_firmware; -impl UIFeaturesCommon for ModelTRFeatures { +impl CommonUI for UIModelTR { const SCREEN: Rect = constant::SCREEN; fn screen_fatal_error(title: &str, msg: &str, footer: &str) { diff --git a/core/embed/rust/src/ui/model_tr/ui_features_fw.rs b/core/embed/rust/src/ui/model_tr/ui_firmware.rs similarity index 99% rename from core/embed/rust/src/ui/model_tr/ui_features_fw.rs rename to core/embed/rust/src/ui/model_tr/ui_firmware.rs index e58df99040d..ef3b4e18f86 100644 --- a/core/embed/rust/src/ui/model_tr/ui_features_fw.rs +++ b/core/embed/rust/src/ui/model_tr/ui_firmware.rs @@ -30,10 +30,10 @@ use crate::{ component::{ButtonActions, ButtonLayout, Page}, constant, }, - ui_features::ModelUI, - ui_features_fw::{ - UIFeaturesFirmware, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_WORD_QUIZ_ITEMS, + ui_firmware::{ + FirmwareUI, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_WORD_QUIZ_ITEMS, }, + ModelUI, }, }; @@ -43,12 +43,12 @@ use super::{ FlowPages, Frame, Homescreen, Lockscreen, NumberInput, PassphraseEntry, PinEntry, Progress, ScrollableFrame, ShareWords, ShowMore, SimpleChoice, WordlistEntry, WordlistType, }, - theme, ModelTRFeatures, + theme, UIModelTR, }; use heapless::Vec; -impl UIFeaturesFirmware for ModelTRFeatures { +impl FirmwareUI for UIModelTR { fn confirm_action( title: TString<'static>, action: Option>, diff --git a/core/embed/rust/src/ui/model_tt/bootloader/mod.rs b/core/embed/rust/src/ui/model_tt/bootloader/mod.rs index 939d05b7bbb..b55bea3355d 100644 --- a/core/embed/rust/src/ui/model_tt/bootloader/mod.rs +++ b/core/embed/rust/src/ui/model_tt/bootloader/mod.rs @@ -26,10 +26,10 @@ use super::{ }, FG, }, - ModelTTFeatures, + UIModelTT, }; -use crate::ui::{ui_features::UIFeaturesBootloader, UIFeaturesCommon}; +use crate::ui::{ui_bootloader::BootloaderUI, CommonUI}; use crate::ui::{ display::toif::Toif, @@ -56,9 +56,9 @@ pub type BootloaderString = String<128>; const RECONNECT_MESSAGE: &str = "PLEASE RECONNECT\nTHE DEVICE"; -const SCREEN: Rect = ModelTTFeatures::SCREEN; +const SCREEN: Rect = UIModelTT::SCREEN; -impl ModelTTFeatures { +impl UIModelTT { fn screen_progress( text: &str, progress: u16, @@ -133,7 +133,7 @@ impl ModelTTFeatures { } } -impl UIFeaturesBootloader for ModelTTFeatures { +impl BootloaderUI for UIModelTT { fn screen_welcome() { let mut frame = Welcome::new(); show(&mut frame, true); diff --git a/core/embed/rust/src/ui/model_tt/layout.rs b/core/embed/rust/src/ui/model_tt/component_msg_obj.rs similarity index 100% rename from core/embed/rust/src/ui/model_tt/layout.rs rename to core/embed/rust/src/ui/model_tt/component_msg_obj.rs diff --git a/core/embed/rust/src/ui/model_tt/mod.rs b/core/embed/rust/src/ui/model_tt/mod.rs index 4554c422dc1..370c9bc695c 100644 --- a/core/embed/rust/src/ui/model_tt/mod.rs +++ b/core/embed/rust/src/ui/model_tt/mod.rs @@ -1,4 +1,4 @@ -use super::{geometry::Rect, UIFeaturesCommon}; +use super::{geometry::Rect, CommonUI}; #[cfg(feature = "bootloader")] pub mod bootloader; @@ -9,21 +9,21 @@ pub mod theme; #[cfg(feature = "backlight")] use crate::ui::model_tt::theme::backlight; -pub mod cshape; #[cfg(feature = "micropython")] -pub mod layout; +pub mod component_msg_obj; +pub mod cshape; use crate::ui::{ layout::simplified::show, model_tt::component::{ErrorScreen, WelcomeScreen}, }; -pub struct ModelTTFeatures; +pub struct UIModelTT; #[cfg(feature = "micropython")] -pub mod ui_features_fw; +pub mod ui_firmware; -impl UIFeaturesCommon for ModelTTFeatures { +impl CommonUI for UIModelTT { #[cfg(feature = "backlight")] fn fadein() { crate::ui::display::fade_backlight_duration(backlight::get_backlight_normal(), 150); diff --git a/core/embed/rust/src/ui/model_tt/ui_features_fw.rs b/core/embed/rust/src/ui/model_tt/ui_firmware.rs similarity index 99% rename from core/embed/rust/src/ui/model_tt/ui_features_fw.rs rename to core/embed/rust/src/ui/model_tt/ui_firmware.rs index bd20da0ce49..d2790d3c167 100644 --- a/core/embed/rust/src/ui/model_tt/ui_features_fw.rs +++ b/core/embed/rust/src/ui/model_tt/ui_firmware.rs @@ -25,10 +25,10 @@ use crate::{ obj::{LayoutMaybeTrace, LayoutObj, RootComponent}, util::{ConfirmBlob, PropsList, RecoveryType}, }, - ui_features::ModelUI, - ui_features_fw::{ - UIFeaturesFirmware, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_WORD_QUIZ_ITEMS, + ui_firmware::{ + FirmwareUI, MAX_CHECKLIST_ITEMS, MAX_GROUP_SHARE_LINES, MAX_WORD_QUIZ_ITEMS, }, + ModelUI, }, }; @@ -40,10 +40,10 @@ use super::{ PassphraseKeyboard, PinKeyboard, Progress, SelectWordCount, SetBrightnessDialog, ShareWords, SimplePage, Slip39Input, }, - theme, ModelTTFeatures, + theme, UIModelTT, }; -impl UIFeaturesFirmware for ModelTTFeatures { +impl FirmwareUI for UIModelTT { fn confirm_action( title: TString<'static>, action: Option>, diff --git a/core/embed/rust/src/ui/ui_features.rs b/core/embed/rust/src/ui/ui_bootloader.rs similarity index 57% rename from core/embed/rust/src/ui/ui_features.rs rename to core/embed/rust/src/ui/ui_bootloader.rs index 2aca8f45dfa..1a76428c956 100644 --- a/core/embed/rust/src/ui/ui_features.rs +++ b/core/embed/rust/src/ui/ui_bootloader.rs @@ -1,38 +1,8 @@ -use crate::ui::geometry::Rect; - #[cfg(feature = "bootloader")] use crate::trezorhal::secbool::secbool; -pub trait UIFeaturesCommon { - fn fadein() {} - fn fadeout() {} - fn backlight_on() {} - - fn get_backlight_none() -> u8 { - 0 - } - fn get_backlight_normal() -> u8 { - 0 - } - fn get_backlight_low() -> u8 { - 0 - } - fn get_backlight_dim() -> u8 { - 0 - } - fn get_backlight_max() -> u8 { - 0 - } - - const SCREEN: Rect; - - fn screen_fatal_error(title: &str, msg: &str, footer: &str); - - fn screen_boot_stage_2(); -} - #[cfg(feature = "bootloader")] -pub trait UIFeaturesBootloader { +pub trait BootloaderUI { fn screen_welcome(); fn screen_install_success(restart_seconds: u8, initial_setup: bool, complete_draw: bool); @@ -79,16 +49,3 @@ pub trait UIFeaturesBootloader { wait: i32, ); } - -#[cfg(all( - feature = "model_mercury", - not(feature = "model_tr"), - not(feature = "model_tt") -))] -pub type ModelUI = crate::ui::model_mercury::ModelMercuryFeatures; - -#[cfg(all(feature = "model_tr", not(feature = "model_tt")))] -pub type ModelUI = crate::ui::model_tr::ModelTRFeatures; - -#[cfg(feature = "model_tt")] -pub type ModelUI = crate::ui::model_tt::ModelTTFeatures; diff --git a/core/embed/rust/src/ui/ui_common.rs b/core/embed/rust/src/ui/ui_common.rs new file mode 100644 index 00000000000..8bf6cf54806 --- /dev/null +++ b/core/embed/rust/src/ui/ui_common.rs @@ -0,0 +1,29 @@ +use crate::ui::geometry::Rect; + +pub trait CommonUI { + fn fadein() {} + fn fadeout() {} + fn backlight_on() {} + + fn get_backlight_none() -> u8 { + 0 + } + fn get_backlight_normal() -> u8 { + 0 + } + fn get_backlight_low() -> u8 { + 0 + } + fn get_backlight_dim() -> u8 { + 0 + } + fn get_backlight_max() -> u8 { + 0 + } + + const SCREEN: Rect; + + fn screen_fatal_error(title: &str, msg: &str, footer: &str); + + fn screen_boot_stage_2(); +} diff --git a/core/embed/rust/src/ui/ui_features_fw.rs b/core/embed/rust/src/ui/ui_firmware.rs similarity index 99% rename from core/embed/rust/src/ui/ui_features_fw.rs rename to core/embed/rust/src/ui/ui_firmware.rs index 817b2b80fdf..3c29d736a15 100644 --- a/core/embed/rust/src/ui/ui_features_fw.rs +++ b/core/embed/rust/src/ui/ui_firmware.rs @@ -15,7 +15,7 @@ pub const MAX_CHECKLIST_ITEMS: usize = 3; pub const MAX_WORD_QUIZ_ITEMS: usize = 3; pub const MAX_GROUP_SHARE_LINES: usize = 4; -pub trait UIFeaturesFirmware { +pub trait FirmwareUI { #[allow(clippy::too_many_arguments)] fn confirm_action( title: TString<'static>, diff --git a/core/mocks/generated/trezorui_api.pyi b/core/mocks/generated/trezorui_api.pyi index 6c1316204b4..1de4c9e95c5 100644 --- a/core/mocks/generated/trezorui_api.pyi +++ b/core/mocks/generated/trezorui_api.pyi @@ -3,7 +3,7 @@ from trezor import utils T = TypeVar("T") -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs class LayoutObj(Generic[T]): """Representation of a Rust-based layout object. see `trezor::ui::layout::obj::LayoutObj`. @@ -61,7 +61,7 @@ class LayoutObj(Generic[T]): """Calls drop on contents of the root component.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs class UiResult: """Result of a UI operation.""" pass @@ -70,17 +70,17 @@ CANCELLED: UiResult INFO: UiResult -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def check_homescreen_format(data: bytes) -> bool: """Check homescreen format and dimensions.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def disable_animation(disable: bool) -> None: """Disable animations, debug builds only.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_action( *, title: str, @@ -98,7 +98,7 @@ def confirm_action( """Confirm action.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_address( *, title: str, @@ -111,7 +111,7 @@ def confirm_address( """Confirm address.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_blob( *, title: str, @@ -133,7 +133,7 @@ def confirm_blob( """Confirm byte sequence data.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_blob_intro( *, title: str, @@ -148,7 +148,7 @@ def confirm_blob_intro( which can then be confirmed using confirm_blob.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_coinjoin( *, max_rounds: str, @@ -157,7 +157,7 @@ def confirm_coinjoin( """Confirm coinjoin authorization.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_emphasized( *, title: str, @@ -168,7 +168,7 @@ def confirm_emphasized( the first component is a bool indicating whether this part is emphasized.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_fido( *, title: str, @@ -181,7 +181,7 @@ def confirm_fido( """ -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_firmware_update( *, description: str, @@ -190,7 +190,7 @@ def confirm_firmware_update( """Ask whether to update firmware, optionally show fingerprint.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_homescreen( *, title: str, @@ -199,7 +199,7 @@ def confirm_homescreen( """Confirm homescreen.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_modify_fee( *, title: str, @@ -211,7 +211,7 @@ def confirm_modify_fee( """Decrease or increase transaction fee.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_modify_output( *, sign: int, @@ -221,7 +221,7 @@ def confirm_modify_output( """Decrease or increase output amount.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_more( *, title: str, @@ -233,7 +233,7 @@ def confirm_more( Meant to be used with confirm_with_info on model TT and TR.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_properties( *, title: str, @@ -244,12 +244,12 @@ def confirm_properties( the value is to be rendered as binary with monospace font, False otherwise.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_reset_device(recovery: bool) -> LayoutObj[UiResult]: """Confirm TOS before creating wallet creation or wallet recovery.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_summary( *, amount: str, @@ -265,7 +265,7 @@ def confirm_summary( """Confirm summary of a transaction.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_value( *, title: str, @@ -283,7 +283,7 @@ def confirm_value( """Confirm value. Merge of confirm_total and confirm_output.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def confirm_with_info( *, title: str, @@ -297,7 +297,7 @@ def confirm_with_info( context menu.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def continue_recovery_homepage( *, text: str, @@ -310,7 +310,7 @@ def continue_recovery_homepage( """Device recovery homescreen.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def flow_confirm_output( *, title: str | None, @@ -335,7 +335,7 @@ def flow_confirm_output( """Confirm the recipient, (optionally) confirm the amount and (optionally) confirm the summary and present a Hold to Sign page.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def flow_confirm_set_new_pin( *, title: str, @@ -344,7 +344,7 @@ def flow_confirm_set_new_pin( """Confirm new PIN setup with an option to cancel action.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def flow_get_address( *, address: str | bytes, @@ -364,7 +364,7 @@ def flow_get_address( """Get address / receive funds.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def multiple_pages_texts( *, title: str, @@ -374,12 +374,12 @@ def multiple_pages_texts( """Show multiple texts, each on its own page. TR specific.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def prompt_backup() -> LayoutObj[UiResult]: """Strongly recommend user to do a backup.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def request_bip39( *, prompt: str, @@ -389,7 +389,7 @@ def request_bip39( """BIP39 word input keyboard.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def request_slip39( *, prompt: str, @@ -399,7 +399,7 @@ def request_slip39( """SLIP39 word input keyboard.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def request_number( *, title: str, @@ -413,7 +413,7 @@ def request_number( description.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def request_pin( *, prompt: str, @@ -424,7 +424,7 @@ def request_pin( """Request pin on device.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def request_passphrase( *, prompt: str, @@ -433,7 +433,7 @@ def request_passphrase( """Passphrase input keyboard.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def select_word( *, title: str, @@ -444,7 +444,7 @@ def select_word( iterable must be of exact size. Returns index in range `0..3`.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def select_word_count( *, recovery_type: RecoveryType, @@ -453,12 +453,12 @@ def select_word_count( For unlocking a repeated backup, select from 20 or 33.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def set_brightness(*, current: int | None = None) -> LayoutObj[UiResult]: """Show the brightness configuration dialog.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_address_details( *, qr_title: str, @@ -472,7 +472,7 @@ def show_address_details( """Show address details - QR code, account, path, cosigner xpubs.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_checklist( *, title: str, @@ -484,7 +484,7 @@ def show_checklist( mark next to them. Limited to 3 items.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_danger( *, title: str, @@ -495,7 +495,7 @@ def show_danger( """Warning modal that makes it easier to cancel than to continue.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_error( *, title: str, @@ -507,7 +507,7 @@ def show_error( """Error modal. No buttons shown when `button` is empty string.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_group_share_success( *, lines: Iterable[str], @@ -515,7 +515,7 @@ def show_group_share_success( """Shown after successfully finishing a group.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_homescreen( *, label: str | None, @@ -527,7 +527,7 @@ def show_homescreen( """Idle homescreen.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_info( *, title: str, @@ -538,7 +538,7 @@ def show_info( """Info screen.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_info_with_cancel( *, title: str, @@ -549,7 +549,7 @@ def show_info_with_cancel( """Show metadata for outgoing transaction.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_lockscreen( *, label: str | None, @@ -560,12 +560,12 @@ def show_lockscreen( """Homescreen for locked device.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_mismatch(*, title: str) -> LayoutObj[UiResult]: """Warning of receiving address mismatch.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_progress( *, description: str, @@ -577,7 +577,7 @@ def show_progress( make sure the initial description has at least that amount of lines.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_progress_coinjoin( *, title: str, @@ -589,7 +589,7 @@ def show_progress_coinjoin( time_ms timeout is passed.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_remaining_shares( *, pages: Iterable[tuple[str, str]], @@ -597,7 +597,7 @@ def show_remaining_shares( """Shows SLIP39 state after info button is pressed on `confirm_recovery`.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_share_words( *, words: Iterable[str], @@ -606,7 +606,7 @@ def show_share_words( """Show mnemonic for backup.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_share_words_mercury( *, words: Iterable[str], @@ -619,7 +619,7 @@ def show_share_words_mercury( confirmation screen.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_simple( *, text: str, @@ -629,7 +629,7 @@ def show_simple( """Simple dialog with text. TT: optional button.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_success( *, title: str, @@ -641,12 +641,12 @@ def show_success( """Success modal. No buttons shown when `button` is empty string.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_wait_text(message: str, /) -> LayoutObj[None]: """Show single-line text in the middle of the screen.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def show_warning( *, title: str, @@ -659,12 +659,12 @@ def show_warning( """Warning modal. TT: No buttons shown when `button` is empty string. TR: middle button and centered text.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs def tutorial() -> LayoutObj[UiResult]: """Show user how to interact with the device.""" -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs class BacklightLevels: """Backlight levels. Values dynamically update based on user settings.""" MAX: ClassVar[int] @@ -674,7 +674,7 @@ class BacklightLevels: NONE: ClassVar[int] -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs class AttachType: INITIAL: ClassVar[int] RESUME: ClassVar[int] @@ -684,7 +684,7 @@ class AttachType: SWIPE_RIGHT: ClassVar[int] -# rust/src/ui/api/firmware_upy.rs +# rust/src/ui/api/firmware_micropython.rs class LayoutState: """Layout state.""" INITIAL: "ClassVar[LayoutState]"