Commit graph

30 commits

Author SHA1 Message Date
Simon Hausmann
a875c532ba Improve internal default logging behavior with std
Previously, any use of our internal debug_log!() macro would require a
platform backend to be initialized. This was confusing when debugging
something in the (headless) wasm lsp implementation and nothing showed
up on the console.

Now if we can, we will always log. If a platform backend exists, we
route through it, otherwise we can do the fallback ourselves.
2022-09-30 11:13:32 +02:00
Olivier Goffart
adb1b24c28 Fix the slint_mock_elapsed_time when not using the testing backend
The nodejs tests don't use the testing backend, as a result, calling
`platform::update_timers_and_animations` would use the real time instead
of the fake time.
So call `maybe_activate_timers` with the fake time instead
2022-09-16 19:14:15 +02:00
Simon Hausmann
6875e35ec9
Polish the platform module level-docs (#1616)
Various edits and tweaks.
2022-09-09 09:24:59 +02:00
Simon Hausmann
8ee88a53c1
MCU Doc fixes (#1615)
Various edits to the introduction of how to use Slint on MCUs.
2022-09-09 08:35:01 +02:00
Olivier Goffart
6ede77436b api: Return an error from invoke_from_event_loop and quit_event_loop 2022-09-07 10:13:58 +02:00
Tobias Hunger
625546304c Remove software-renderer feature more aggressively
I missed some instances as the CI and @ogoffart both pointed out. Fix
that.

Also make the `text_layout`and `ìnteger-sqrt` features that were set by
the `swrenderer` feature mandatory -- by removing them completely.
2022-09-07 10:11:11 +02:00
Tobias Hunger
639dcaf702 api: Rename module swrenderer to software_renderer
Also rename the `swrenderer` feature to `software-renderer`.
2022-09-07 10:11:11 +02:00
Simon Hausmann
ea94089b05 Provide an error enum for the error case of slint::platform::set_platform
cc #1502
2022-09-06 15:42:16 +02:00
Olivier Goffart
9a2b1c7b6b Don't export PLATFORM_INSTANCE in the public API
Use a hidden internal helper function instead
2022-09-03 11:45:54 +02:00
Olivier Goffart
ec19ef77f1 platform: don't re-export types that are no longer needed 2022-09-03 11:11:43 +02:00
Simon Hausmann
f648f152f9 Improve debug_log interface in the Platform
Pass Arguments and let the caller decide how/when to convert to a string.
2022-09-02 20:13:41 +02:00
Simon Hausmann
437218db70 Replace the built-in defmt debug logging to the platform trait
This way we don't have to add defmt, esp32-println and others as features to corelib and the slint api crate
(which would also expose them as public dependencies),
but instead this can be simply delegated to the Platform trait.
2022-09-02 20:13:41 +02:00
Olivier Goffart
1237285fef Fixup some documentaion links
And add a test in the CI that checks for warnings in the internal
crates

(Also changed --exlcude in the test to be matching the one from build,
since c++ test are tested separately)
2022-09-01 12:16:24 +02:00
Olivier Goffart
fcca38e0f6 Rename set_event_loop_quit_on_last_window_closed to remove EventLoopQuitBehavior
For the winit backend, also make the function work after a call to run()
2022-09-01 12:08:05 +02:00
Olivier Goffart
b9c2dec922 API: seal the WindowAdaptor trait
And hide most of its functions in the sealed trait.
2022-08-30 22:21:24 +02:00
Tobias Hunger
3430a13bf8 API cleanup: Remove quit behavior parameter from run_event_loop 2022-08-30 08:34:45 +02:00
Olivier Goffart
cb8a59683f Fix formating 2022-08-29 19:45:29 +02:00
Olivier Goffart
3ed8ca6fc8 Introduce MinimalSoftwareWindow
This simplifies the implementation of the pico and STM, as they both
have the same PlatformWindow implementation, and is likely to be the
same for every MCU
2022-08-29 19:45:29 +02:00
Tobias Hunger
10c3c9d16d Api cleanup: Rename some remaining platform abstractions to platform 2022-08-29 16:53:47 +02:00
Tobias Hunger
88cf874d03 API cleanup: Rename create_window to create_window_adapter 2022-08-29 16:53:47 +02:00
Tobias Hunger
1e6ffeaa0f API cleanup: Rename PlatformWindow to WindowAdapter 2022-08-29 16:53:47 +02:00
Tobias Hunger
53053683a1 API cleanup: Rename PlatformAbstraction to Platform 2022-08-29 13:26:36 +02:00
Tobias Hunger
3557e92a84 API cleanup: Fix typos in comments/documentation 2022-08-29 13:26:36 +02:00
Tobias Hunger
259457eff8 API cleanup: Fix typo in variable name 2022-08-29 13:26:36 +02:00
Tobias Hunger
13701b4b3f API cleanup: Rename set_paltrom_abstraction to set_platform 2022-08-29 13:26:36 +02:00
Olivier Goffart
8fba65a282 Rename and expose the unsafe-single-threaded feature 2022-08-25 16:47:53 +02:00
Olivier Goffart
13c9c3bbab Re-export the platform module as public api in slint::platform
Tweek some documentation
2022-08-24 14:28:51 +02:00
Olivier Goffart
c14e2d41d8 Rename PlatformAbstraction::event_loop_proxy to new_event_loop_proxy 2022-08-24 11:32:21 +02:00
Olivier Goffart
7417422e3c Make the PlatformAbstraction not Send using a EventLoopProxy trait
This changes the way the platform abstraction is initialized
2022-08-24 11:32:21 +02:00
Olivier Goffart
2e5ab86bea Rename backend module to platform
and the Backend trait into PlatfromAbstraction trait
2022-08-23 19:39:49 +02:00
Renamed from internal/core/backend.rs (Browse further)