// SPDX-License-Identifier: MIT
//
// Generated by `rlvgl-creator qt emit-externals` from `tests/fixtures/qt/stopwatch.qml`.
// Hand-edit the method bodies below; regeneration
// overwrites this file. See QT-05e §9.
//
// Emit-shape contract: docs/qt-support/05e-externals-stubs.md
// Install path (QT-05e §7):
//   let (_, _, machine, _) = build_screen(bounds);
//   machine.borrow_mut().externals = Box::new(stopwatch_externals::ScreenExternals::new());

#![allow(dead_code)]
#![allow(unused_variables)]

use stopwatch_gen::{Externals, Machine};

/// QT-05e per-file emit-shape version.
pub const QT_EXTERNALS_VERSION: u32 = 1;

/// QT-05e §3 — `pub struct ScreenExternals`. v1 is
/// stateless; the user adds fields by hand.
pub struct ScreenExternals;

impl ScreenExternals {
    pub fn new() -> Self {
        Self
    }
}

impl Default for ScreenExternals {
    fn default() -> Self {
        Self::new()
    }
}

impl Externals for ScreenExternals {
    fn tick_start(&mut self, m: &mut Machine) {
        // QT-05e externals-stub: tick_start from OnEntry { state: "running" }
        // TODO — fill in side-effect code.
        let _ = m;
    }

    fn tick_stop(&mut self, m: &mut Machine) {
        // QT-05e externals-stub: tick_stop from OnExit { state: "running" }
        // TODO — fill in side-effect code.
        let _ = m;
    }
}
