slint-ui 1.6.0-nightly.2024041215 → 1.6.0-nightly.2024041703
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarnrc.yml +1 -1
- package/Cargo.toml +6 -6
- package/LICENSE.md +2 -2
- package/LICENSES/{LicenseRef-Slint-Royalty-free-1.1.md → LicenseRef-Slint-Royalty-free-1.2.md} +17 -13
- package/README.md +1 -1
- package/build-on-demand.mjs +1 -1
- package/build.rs +1 -1
- package/index.d.ts +1 -0
- package/index.js +2 -1
- package/index.ts +3 -1
- package/package.json +7 -6
- package/rust-module.cjs +2 -1
- package/rust-module.d.ts +4 -2
- package/src/interpreter/component_compiler.rs +1 -1
- package/src/interpreter/component_definition.rs +1 -1
- package/src/interpreter/component_instance.rs +1 -1
- package/src/interpreter/diagnostic.rs +1 -1
- package/src/interpreter/value.rs +1 -1
- package/src/interpreter/window.rs +1 -1
- package/src/interpreter.rs +1 -1
- package/src/lib.rs +8 -1
- package/src/types/brush.rs +4 -3
- package/src/types/image_data.rs +1 -1
- package/src/types/model.rs +1 -1
- package/src/types/point.rs +1 -1
- package/src/types/size.rs +1 -1
- package/src/types.rs +1 -1
package/.yarnrc.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
nodeLinker: node-modules
|
package/Cargo.toml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
[package]
|
|
5
5
|
name = "slint-node"
|
|
@@ -9,7 +9,7 @@ documentation = "https://slint.dev/docs"
|
|
|
9
9
|
edition = "2021"
|
|
10
10
|
homepage = "https://slint.dev"
|
|
11
11
|
keywords = ["gui", "toolkit", "graphics", "design", "ui"]
|
|
12
|
-
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
12
|
+
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial"
|
|
13
13
|
repository = "https://github.com/slint-ui/slint"
|
|
14
14
|
rust-version = "1.73"
|
|
15
15
|
version = "1.6.0"
|
|
@@ -40,10 +40,10 @@ accessibility = ["slint-interpreter/accessibility"]
|
|
|
40
40
|
[dependencies]
|
|
41
41
|
napi = { version = "2.14.0", default-features = false, features = ["napi8"] }
|
|
42
42
|
napi-derive = "2.14.0"
|
|
43
|
-
i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
44
|
-
i-slint-core = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
45
|
-
i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "
|
|
46
|
-
slint-interpreter = { default-features = false, features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "
|
|
43
|
+
i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "d3eaad771b38ff71c9b0c2982d96e75aef22be4b", version = "=1.6.0", default-features = false }
|
|
44
|
+
i-slint-core = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "d3eaad771b38ff71c9b0c2982d96e75aef22be4b", version = "=1.6.0", default-features = false }
|
|
45
|
+
i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "d3eaad771b38ff71c9b0c2982d96e75aef22be4b", version = "=1.6.0", default-features = false }
|
|
46
|
+
slint-interpreter = { default-features = false, features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "d3eaad771b38ff71c9b0c2982d96e75aef22be4b", version = "=1.6.0", default_features = false }
|
|
47
47
|
spin_on = "0.1"
|
|
48
48
|
css-color-parser2 = { version = "1.0.1" }
|
|
49
49
|
itertools = { version = "0.12" }
|
package/LICENSE.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
1
|
+
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial -->
|
|
2
2
|
|
|
3
3
|
# Slint License
|
|
4
4
|
|
|
5
5
|
You can use Slint under ***any*** of the following licenses, at your choice:
|
|
6
6
|
|
|
7
|
-
1. [Royalty-free license](LICENSES/LicenseRef-Slint-Royalty-free-1.
|
|
7
|
+
1. [Royalty-free license](LICENSES/LicenseRef-Slint-Royalty-free-1.2.md),
|
|
8
8
|
2. [GNU GPLv3](LICENSES/GPL-3.0-only.txt),
|
|
9
9
|
3. [Commercial license](LICENSES/LicenseRef-Slint-commercial.md).
|
|
10
10
|
|
package/LICENSES/{LicenseRef-Slint-Royalty-free-1.1.md → LicenseRef-Slint-Royalty-free-1.2.md}
RENAMED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
# Slint Royalty-free Desktop and Web Applications License
|
|
1
|
+
# Slint Royalty-free Desktop, Mobile, and Web Applications License v1.2
|
|
2
2
|
|
|
3
3
|
## Preamble
|
|
4
4
|
|
|
5
|
-
Slint is a toolkit that can be used to build user interfaces for applications. Slint (hereafter referred to as "Software") is made available under different licenses by SixtyFPS GmbH incorporated at Oranienburger Str. 44, 16540 Hohen Neuendorf, Germany ("SixtyFPS"). The "Slint Royalty-free Desktop and Web Applications License" is suitable for those who develop desktop or web applications and do not want to use open source components under copyleft licenses.
|
|
5
|
+
Slint is a toolkit that can be used to build user interfaces for applications. Slint (hereafter referred to as "Software") is made available under different licenses by SixtyFPS GmbH incorporated at Oranienburger Str. 44, 16540 Hohen Neuendorf, Germany ("SixtyFPS"). The "Slint Royalty-free Desktop, Mobile, and Web Applications License" is suitable for those who develop desktop, mobile, or web applications and do not want to use open source components under copyleft licenses.
|
|
6
6
|
|
|
7
7
|
### 1. Grant of Rights
|
|
8
8
|
|
|
9
|
-
SixtyFPS hereby grants You a world-wide, royalty-free, non-exclusive license to use, reproduce, make available, modify, display, perform, distribute the Software as part of a Desktop or Web Application.
|
|
9
|
+
SixtyFPS hereby grants You a world-wide, royalty-free, non-exclusive license to use, reproduce, make available, modify, display, perform, distribute the Software as part of a Desktop, Mobile, or Web Application.
|
|
10
10
|
|
|
11
|
-
A Desktop Application is a computer program that is designed to run on a general-purpose computer (PC or notebook), typically installed and executed locally on the computer's operating system.
|
|
11
|
+
A Desktop Application is a computer program that is designed to run on a general-purpose computer (PC or notebook), typically installed and executed locally on the computer's operating system.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
A Mobile Application is a computer program that is designed to run on a general-purpose mobile computer (mobile phone or tablet), typically installed and executed locally on the computer's operating system.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
A Web Application is a computer program that is running on a server and accessed using a web browser or client program.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
The license does not permit the use of the Software within Embedded Systems. An Embedded System is a computer system designed to perform a specific task within a larger mechanical or electrical system. For the purposes of this license, mobile phones are not considered to be Embedded Systems.
|
|
17
|
+
Desktop Application, Mobile Application, and Web Application are hereafter referred to as "Application".
|
|
20
18
|
|
|
21
|
-
###
|
|
19
|
+
### 2. License Conditions - Attribution
|
|
22
20
|
|
|
23
|
-
You may distribute the Software as part of an Application, modified or unmodified, provided that You do
|
|
21
|
+
You may distribute the Software as part of an Application, modified or unmodified, provided that You do either of the following:
|
|
24
22
|
|
|
25
|
-
(a) Display the [`AboutSlint`](https://slint.dev/snapshots/master/docs/slint/src/language/widgets/aboutslint.html) widget in an "About" screen or dialog that is accessible from the top level menu of the Application.
|
|
23
|
+
(a) Display the [`AboutSlint`](https://slint.dev/snapshots/master/docs/slint/src/language/widgets/aboutslint.html) widget in an "About" screen or dialog that is accessible from the top level menu of the Application. In the absence of such a screen or dialog, display the widget in the "Splash Screen" of the Application.
|
|
26
24
|
|
|
27
25
|
(b) Display the [Slint attribution badge](https://github.com/slint-ui/slint/tree/master/logo/MadeWithSlint-logo-whitebg.png) on a public webpage, preferably where the binaries of your Application can be downloaded from, in such a way that it can be easily found by any visitor to that page.
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
### 3. Limitations
|
|
28
|
+
|
|
29
|
+
The license does not permit to distribute or make the Software publicly available alone and without integration into an Application. For this purpose you may use the Software under the GNU General Public License, version 3.
|
|
30
|
+
|
|
31
|
+
The license does not permit the use of the Software within Embedded Systems. An Embedded System is a computer system designed to perform a specific task within a larger mechanical or electrical system.
|
|
32
|
+
|
|
33
|
+
You may not remove or alter any license notices (including copyright notices, disclaimers of warranty, or limitations of liability) contained within the source code form of the Software.
|
|
30
34
|
|
|
31
35
|
### 4. Warranty and Liability
|
|
32
36
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
1
|
+
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial -->
|
|
2
2
|
|
|
3
3
|
# Slint-node (Beta)
|
|
4
4
|
|
package/build-on-demand.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
// This file checks if a binary package was installed (through architecture dependencies), and
|
|
5
5
|
// builds slint if no binary was found.
|
package/build.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
fn main() {
|
|
5
5
|
napi_build::setup();
|
package/index.d.ts
CHANGED
|
@@ -586,4 +586,5 @@ export declare namespace private_api {
|
|
|
586
586
|
export import SlintImageData = napi.SlintImageData;
|
|
587
587
|
function send_mouse_click(component: Component, x: number, y: number): void;
|
|
588
588
|
function send_keyboard_string_sequence(component: Component, s: string): void;
|
|
589
|
+
export import initTesting = napi.initTesting;
|
|
589
590
|
}
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
3
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.quitEventLoop = exports.runEventLoop = exports.loadSource = exports.loadFile = exports.CompileError = exports.private_api = exports.ArrayModel = exports.Model = void 0;
|
|
6
6
|
const napi = require("./rust-module.cjs");
|
|
@@ -751,4 +751,5 @@ exports.quitEventLoop = quitEventLoop;
|
|
|
751
751
|
component.component_instance.sendKeyboardStringSequence(s);
|
|
752
752
|
}
|
|
753
753
|
private_api.send_keyboard_string_sequence = send_keyboard_string_sequence;
|
|
754
|
+
private_api.initTesting = napi.initTesting;
|
|
754
755
|
})(private_api || (exports.private_api = private_api = {}));
|
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
import * as napi from "./rust-module.cjs";
|
|
5
5
|
export {
|
|
@@ -1039,4 +1039,6 @@ export namespace private_api {
|
|
|
1039
1039
|
) {
|
|
1040
1040
|
component.component_instance.sendKeyboardStringSequence(s);
|
|
1041
1041
|
}
|
|
1042
|
+
|
|
1043
|
+
export import initTesting = napi.initTesting;
|
|
1042
1044
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slint-ui",
|
|
3
|
-
"version": "1.6.0-nightly.
|
|
3
|
+
"version": "1.6.0-nightly.2024041703",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"homepage": "https://github.com/slint-ui/slint",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"compile": "tsc",
|
|
38
38
|
"build": "napi build --platform --release --js rust-module.cjs --dts rust-module.d.ts -c binaries.json",
|
|
39
39
|
"build:debug": "napi build --platform --js rust-module.cjs --dts rust-module.d.ts -c binaries.json && npm run compile",
|
|
40
|
+
"build:testing": "napi build --platform --js rust-module.cjs --dts rust-module.d.ts -c binaries.json --features testing && npm run compile",
|
|
40
41
|
"install": "node build-on-demand.mjs",
|
|
41
42
|
"docs": "npm run build && typedoc --hideGenerator --treatWarningsAsErrors --readme cover.md index.ts",
|
|
42
43
|
"test": "ava"
|
|
@@ -58,10 +59,10 @@
|
|
|
58
59
|
"@napi-rs/cli": "^2.16.5"
|
|
59
60
|
},
|
|
60
61
|
"optionalDependencies": {
|
|
61
|
-
"@slint-ui/slint-ui-binary-linux-x64-gnu": "1.6.0-nightly.
|
|
62
|
-
"@slint-ui/slint-ui-binary-darwin-x64": "1.6.0-nightly.
|
|
63
|
-
"@slint-ui/slint-ui-binary-darwin-arm64": "1.6.0-nightly.
|
|
64
|
-
"@slint-ui/slint-ui-binary-win32-x64-msvc": "1.6.0-nightly.
|
|
65
|
-
"@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.6.0-nightly.
|
|
62
|
+
"@slint-ui/slint-ui-binary-linux-x64-gnu": "1.6.0-nightly.2024041703",
|
|
63
|
+
"@slint-ui/slint-ui-binary-darwin-x64": "1.6.0-nightly.2024041703",
|
|
64
|
+
"@slint-ui/slint-ui-binary-darwin-arm64": "1.6.0-nightly.2024041703",
|
|
65
|
+
"@slint-ui/slint-ui-binary-win32-x64-msvc": "1.6.0-nightly.2024041703",
|
|
66
|
+
"@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.6.0-nightly.2024041703"
|
|
66
67
|
}
|
|
67
68
|
}
|
package/rust-module.cjs
CHANGED
|
@@ -310,7 +310,7 @@ if (!nativeBinding) {
|
|
|
310
310
|
throw new Error(`Failed to load native binding`)
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const { DiagnosticLevel, ComponentCompiler, ComponentDefinition, ComponentInstance, ValueType, Property, Window, SlintRgbaColor, SlintBrush, SlintImageData, SharedModelNotify, jsModelNotifyNew, jsModelNotifyRowDataChanged, jsModelNotifyRowAdded, jsModelNotifyRowRemoved, jsModelNotifyReset, ReadOnlyRustModel, ModelIterator, SlintPoint, SlintSize, mockElapsedTime, getMockedTime, ProcessEventsResult, processEvents, invokeFromEventLoop, setQuitOnLastWindowClosed } = nativeBinding
|
|
313
|
+
const { DiagnosticLevel, ComponentCompiler, ComponentDefinition, ComponentInstance, ValueType, Property, Window, SlintRgbaColor, SlintBrush, SlintImageData, SharedModelNotify, jsModelNotifyNew, jsModelNotifyRowDataChanged, jsModelNotifyRowAdded, jsModelNotifyRowRemoved, jsModelNotifyReset, ReadOnlyRustModel, ModelIterator, SlintPoint, SlintSize, mockElapsedTime, getMockedTime, ProcessEventsResult, processEvents, invokeFromEventLoop, setQuitOnLastWindowClosed, initTesting } = nativeBinding
|
|
314
314
|
|
|
315
315
|
module.exports.DiagnosticLevel = DiagnosticLevel
|
|
316
316
|
module.exports.ComponentCompiler = ComponentCompiler
|
|
@@ -338,3 +338,4 @@ module.exports.ProcessEventsResult = ProcessEventsResult
|
|
|
338
338
|
module.exports.processEvents = processEvents
|
|
339
339
|
module.exports.invokeFromEventLoop = invokeFromEventLoop
|
|
340
340
|
module.exports.setQuitOnLastWindowClosed = setQuitOnLastWindowClosed
|
|
341
|
+
module.exports.initTesting = initTesting
|
package/rust-module.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export const enum ProcessEventsResult {
|
|
|
82
82
|
export function processEvents(): ProcessEventsResult
|
|
83
83
|
export function invokeFromEventLoop(callback: (...args: any[]) => any): void
|
|
84
84
|
export function setQuitOnLastWindowClosed(quitOnLastWindowClosed: boolean): void
|
|
85
|
+
export function initTesting(): void
|
|
85
86
|
export type JsComponentCompiler = ComponentCompiler
|
|
86
87
|
/**
|
|
87
88
|
* ComponentCompiler is the entry point to the Slint interpreter that can be used
|
|
@@ -232,8 +233,9 @@ export class SlintRgbaColor {
|
|
|
232
233
|
*/
|
|
233
234
|
transparentize(amount: number): SlintRgbaColor
|
|
234
235
|
/**
|
|
235
|
-
* Returns a new color that is a mix of `
|
|
236
|
-
*
|
|
236
|
+
* Returns a new color that is a mix of `this` color and `other`. The specified factor is
|
|
237
|
+
* clamped to be between `0.0` and `1.0` and then applied to `this` color, while `1.0 - factor`
|
|
238
|
+
*is applied to `other`.
|
|
237
239
|
*/
|
|
238
240
|
mix(other: SlintRgbaColor, factor: number): SlintRgbaColor
|
|
239
241
|
/** Returns a new version of this color with the opacity set to `alpha`. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use std::collections::HashMap;
|
|
5
5
|
use std::path::PathBuf;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use napi::Result;
|
|
5
5
|
use slint_interpreter::ComponentDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use i_slint_compiler::langtype::Type;
|
|
5
5
|
use i_slint_core::window::WindowInner;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use slint_interpreter::{Diagnostic, DiagnosticLevel};
|
|
5
5
|
|
package/src/interpreter/value.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use crate::{
|
|
5
5
|
js_into_rust_model, rust_into_js_model, ReadOnlyRustModel, RgbaColor, SlintBrush,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use crate::types::{SlintPoint, SlintSize};
|
|
5
5
|
use i_slint_core::window::WindowAdapterRc;
|
package/src/interpreter.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
mod diagnostic;
|
|
5
5
|
pub use diagnostic::*;
|
package/src/lib.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
mod interpreter;
|
|
5
5
|
pub use interpreter::*;
|
|
@@ -76,3 +76,10 @@ pub fn set_quit_on_last_window_closed(
|
|
|
76
76
|
}
|
|
77
77
|
env.get_undefined()
|
|
78
78
|
}
|
|
79
|
+
|
|
80
|
+
#[napi]
|
|
81
|
+
pub fn init_testing()
|
|
82
|
+
{
|
|
83
|
+
#[cfg(feature = "testing")]
|
|
84
|
+
i_slint_backend_testing::init_with_event_loop();
|
|
85
|
+
}
|
package/src/types/brush.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use i_slint_core::{graphics::GradientStop, Brush, Color};
|
|
5
5
|
use napi::{bindgen_prelude::External, Error, Result};
|
|
@@ -142,8 +142,9 @@ impl SlintRgbaColor {
|
|
|
142
142
|
SlintRgbaColor::from(self.inner.transparentize(amount as f32))
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
/// Returns a new color that is a mix of `
|
|
146
|
-
///
|
|
145
|
+
/// Returns a new color that is a mix of `this` color and `other`. The specified factor is
|
|
146
|
+
/// clamped to be between `0.0` and `1.0` and then applied to `this` color, while `1.0 - factor`
|
|
147
|
+
///is applied to `other`.
|
|
147
148
|
#[napi]
|
|
148
149
|
pub fn mix(&self, other: &SlintRgbaColor, factor: f64) -> SlintRgbaColor {
|
|
149
150
|
SlintRgbaColor::from(self.inner.mix(&other.inner, factor as f32))
|
package/src/types/image_data.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use std::vec;
|
|
5
5
|
|
package/src/types/model.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use std::rc::Rc;
|
|
5
5
|
|
package/src/types/point.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use napi::{
|
|
5
5
|
bindgen_prelude::{FromNapiValue, Object},
|
package/src/types/size.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use napi::{
|
|
5
5
|
bindgen_prelude::{FromNapiValue, Object},
|
package/src/types.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
mod brush;
|
|
5
5
|
pub use brush::*;
|