Commit graph

20 commits

Author SHA1 Message Date
Simon Hausmann
0c51f69b0a Upgrade to PyO3 0.23 2025-04-03 12:24:02 +02:00
Simon Hausmann
9001966dc9 Python: Fix mypy also on the Slint module implementation 2025-02-16 08:58:47 +00:00
Simon Hausmann
607d70b3fa Python: run mypy on the tests 2025-02-16 08:58:47 +00:00
Simon Hausmann
c111098e49 Python: Add more type stubs to the internal Rust API 2025-02-16 08:58:47 +00:00
Milian Wolff
69c68b22b2 Also wrap langtype::Type::Struct in an Rc
This makes copying such types much cheaper and will allow us to
intern common struct types in the future too. This further
drops the sample cost for langtype.rs from ~6.6% down to 4.0%.

We are now also able to share/intern common struct types.

Before:
```
  Time (mean ± σ):      1.073 s ±  0.021 s    [User: 0.759 s, System: 0.215 s]
  Range (min … max):    1.034 s …  1.105 s    10 runs

        allocations:            3074261
```

After:
```
  Time (mean ± σ):      1.034 s ±  0.026 s    [User: 0.733 s, System: 0.201 s]
  Range (min … max):    1.000 s …  1.078 s    10 runs

        allocations:            2917476
```
2024-10-28 09:39:54 +01:00
Simon Hausmann
636de6fc7c Python: Fix support for named exports 2024-08-13 12:04:04 +02:00
Simon Hausmann
1e3f05c983 Python: Expose Slint structs
Structs declared and exported in Slint are now available in the module namespace
with a constructor.

Fixes #5708
2024-08-13 12:04:04 +02:00
Simon Hausmann
0c7d2062a5 Python: Add support for exporting multiple components 2024-07-02 10:52:22 +02:00
Simon Hausmann
b98035526b Python: Add the ability to invoke functions declared in Slint from Python 2024-06-05 14:06:10 -07:00
Aurindam Jana
3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00
Aurindam Jana
9a3aa265d5
Update Royalty-free license (#5257)
Add clarification that Application may not expose Slint APIs.
2024-05-31 10:53:19 +02:00
Simon Hausmann
6408eaf0ad Python: build against abi3 to support multiple Python versions
- Upgrade to pyo3 0.21 to enable timedelta for chrono
- Enable abi3 for multi-python support
2024-04-18 09:34:43 +02:00
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
Simon Hausmann
c83615cfb1 Python: Improve diagnostics when invoking a callback fails 2024-03-07 08:33:45 +01:00
Simon Hausmann
a29cc4ddf2 Python: Don't panic when invoking a python callback fails
Instead, log a message and return.
2024-03-06 18:55:23 +01:00
Simon Hausmann
1b17fe3c1d Python: Fix GC support for callbacks
Make the references to the callbacks visible to the GC
to be able to break cycles.
2024-03-04 15:42:37 +01:00
Simon Hausmann
82c2728cfd Add show/hide/run to component instance 2023-12-21 12:57:35 +01:00
Simon Hausmann
644ebbb2aa Split value conversion into a separate module 2023-12-21 12:57:35 +01:00
Simon Hausmann
10d6aa199c Split errors out into a separate module 2023-12-21 12:57:35 +01:00
Simon Hausmann
73024beb98 Begin wrapping the component compiler 2023-12-21 12:57:35 +01:00