slint/tools/updater/experiments/input_output_properties.rs
Aurindam Jana 0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +02:00

28 lines
1 KiB
Rust

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
use crate::Cli;
use i_slint_compiler::parser::{SyntaxKind, SyntaxNode};
use std::io::Write;
pub(crate) fn fold_node(
node: &SyntaxNode,
file: &mut impl Write,
_state: &mut crate::State,
_args: &Cli,
) -> std::io::Result<bool> {
if node.kind() == SyntaxKind::PropertyDeclaration
&& node
.parent()
.and_then(|n| n.parent())
.map_or(false, |n| n.kind() == SyntaxKind::Component)
{
// check that the first identifier is "property" as opposed to an already converted "in-out" token
if node.child_token(SyntaxKind::Identifier).map_or(false, |t| t.text() == "property") {
// Consider that all property are in-out, because we don't do enough analysis in the slint-updater to know
// if they should be private
write!(file, "in-out ")?;
}
}
Ok(false)
}