// SPDX-License-Identifier: MIT
//
// Generated by `rlvgl-creator qt emit` from `tests/fixtures/qt/hello.qml`.
// Do not edit by hand — regenerate with:
//   cargo run --features creator --bin rlvgl-creator -- \
//       qt emit <input.qml> <out_dir>
//
// Emit-shape contract: docs/qt-support/03-rlvgl-emitter-widgets.md
// QT-03 phase notes:
//   * widget API mapping is intentionally deferred to QT-03b.
//   * properties / signals / handlers are not yet lowered;
//     they remain in the JSON IR (qt-ir.json) and are not
//     materialised in this static `Node` form.
//
// The emitted module uses no `String`/`Vec`/`std` paths and is
// safe to consume from a `no_std` crate. We deliberately do NOT
// emit `#![no_std]` because that is a crate-root attribute and
// would be rejected when this file is pulled in via `#[path]`.

#![allow(dead_code)]

/// QT-03 emit-shape version. Bumping is Specification-Required.
pub const QT_EMIT_VERSION: u32 = 1;

/// `qt-ir` schema version this module was generated from.
pub const QT_IR_VERSION: u32 = 2;

/// Source `.qml` file path as recorded at emit time.
pub const QT_SOURCE: &str = "tests/fixtures/qt/hello.qml";

/// One QML type instance lowered to static data.
///
/// QT-03 carries only type name, optional id, expression-valued
/// assignments, and children. Object-valued assignments and list-valued
/// assignments are surfaced as preceding `// emitter-skipped:` comments
/// so reviewers can see what was elided. Property declarations,
/// signal declarations, and signal handlers remain in the upstream
/// `qt-ir.json` and are not yet lowered here — see
/// `docs/qt-support/03-rlvgl-emitter-widgets.md` §6.
#[derive(Debug, Clone, Copy)]
pub struct Node {
    pub type_name: &'static str,
    pub id: Option<&'static str>,
    pub assignments: &'static [Assignment],
    pub children: &'static [Node],
}

/// One `target: <expression>` assignment whose value is an opaque QML
/// expression. Object-valued and list-valued assignments are not
/// represented here at QT-03 — see the comments preceding each `Node`
/// literal for the elided entries.
#[derive(Debug, Clone, Copy)]
pub struct Assignment {
    pub target: &'static str,
    pub value: &'static str,
}

/// Top-level screen tree, lowered from the source `.qml`.
///
/// `#[rustfmt::skip]` keeps the deterministic emit-shape
/// stable across `cargo fmt` runs. The shape is owned by
/// QT-03 §6 / §7; rustfmt's collapsing heuristics are not.
#[rustfmt::skip]
pub static SCREEN: Node = Node {
    type_name: "Item",
    id: Some("root"),
    // emitter-skipped (QT-04+): 3 property declaration(s)
    // emitter-skipped (QT-04+): 1 signal declaration(s)
    assignments: &[
        // emitter-skipped (QT-03b): font: <object>
        // emitter-skipped (QT-03b): transitions: <object>
        Assignment {
            target: "width",
            value: "800",
        },
        Assignment {
            target: "height",
            value: "480",
        },
        Assignment {
            target: "anchors.fill",
            value: "parent",
        },
        Assignment {
            target: "anchors.margins",
            value: "16",
        },
    ],
    children: &[
        Node {
            type_name: "Rectangle",
            id: Some("bg"),
            assignments: &[
                Assignment {
                    target: "anchors.fill",
                    value: "parent",
                },
                Assignment {
                    target: "color",
                    value: "\"#1e1e2e\"",
                },
            ],
            children: &[],
        },
        Node {
            type_name: "QC.Label",
            id: None,
            assignments: &[
                Assignment {
                    target: "text",
                    value: "root.title",
                },
                Assignment {
                    target: "anchors.centerIn",
                    value: "parent",
                },
            ],
            children: &[],
        },
        Node {
            type_name: "MouseArea",
            id: None,
            // emitter-skipped (QT-04+): 2 signal handler(s)
            assignments: &[
                Assignment {
                    target: "anchors.fill",
                    value: "parent",
                },
            ],
            children: &[],
        },
    ],
};
