Commit Graph

292 Commits

Author SHA1 Message Date
Nathan Adams 1f7a5f44f9 desktop: Disallow unwrap() and unwrap_err() in desktop crate 2023-01-10 11:10:46 +01:00
Nathan Adams fbe1630a4b desktop: Removed unwraps in ui backend 2023-01-10 11:10:46 +01:00
Nathan Adams f812030f70 desktop: Removed unwrap and replaced with ? in storage backend 2023-01-10 11:10:46 +01:00
Nathan Adams ee17d05a84 desktop: Removed unwrap in navigator 2023-01-10 11:10:46 +01:00
Nathan Adams e20eb77035 desktop: movie_url is always Some, simplify code 2023-01-10 11:10:46 +01:00
Nathan Adams 48d8cb54f4 desktop: Replaced most unwraps with expects or ? in main.rs 2023-01-10 11:10:46 +01:00
Nathan Adams f606735720 desktop: Add tracy feature 2023-01-08 20:02:26 +01:00
Nathan Adams b27a1045a1 desktop: Switch from env_logger to tracing-subscriber 2023-01-06 04:25:22 +01:00
Nathan Adams ab6012c42c desktop: Switch from log to tracing 2023-01-06 04:25:22 +01:00
Marco Grassi 6873cda76e move away from unmaintained clipboard crate and use arboard crate 2022-11-26 14:04:59 -05:00
TÖRÖK Attila 2b4d8d9c6e core,desktop: Add and implement AudioBackend::get_sample_history() 2022-11-10 19:11:29 -05:00
relrelb 89f3445d62 swf: Introduce and use `Rectangle::width()` and `Rectangle::height()` 2022-11-01 09:49:04 +02:00
Aaron Hill 68471723b3 core: Fix clippy format string lint 2022-10-27 08:49:39 +03:00
cyraid f51e4dd67f
desktop: Fix #8315 by setting the base_url from the movie_url so requests later can use relative url's. (#8358)
Co-authored-by: Dennis Fehr <dennis.james.fehr@gmail.com>
2022-10-25 13:26:19 +03:00
Aaron Hill 9dd0914bda core: Add root movie URL spoofing (desktop only).
The desktop player now takes a `--spoof-url` argument, which overrides
the movie URL provided to ActionScript. This does not affect non-root
movies loaded through `Loader`.
2022-10-22 15:24:14 -05:00
David Wendt 058a7a8b66 desktop: Allow specifying the load behavior for desktop 2022-10-18 16:47:49 -06:00
relrelb 47a22070a4 desktop: Avoid deprecated `winit::EventLoop::with_user_event()`
Use `EventLoopBuilder::with_user_event().build()` instead, as suggested
by the deprecation warning.
2022-10-11 10:59:19 +03:00
relrelb a9dedf759a chore: Fix `clap` update
As described in https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#400---2022-09-28.
2022-10-05 21:33:34 +03:00
Aaron Hill 474fd7fa8f desktop: Always mark task as ready on wake
We were incorrectly skipping the call to `task.set_ready`
if `self.waiting_for_poll` was set. The `waiting_for_poll` flag
should only be used to avoid redundant messages being sent into
the event loop.

This was causing us to ignore wakeups if more than one wakup
arrived in between calls to `poll_all`.
2022-09-11 15:48:17 -05:00
Nathan Adams c7f420dde5 wgpu: Moved WgpuRenderBackend into backend.rs 2022-09-11 09:07:53 +02:00
= 2b3249c9a4 core: Made core no longer depend on software video decoders 2022-09-04 17:46:58 -07:00
EmperorBale f8289b47d8
avm2: Implement call stack & stack traces (#7564)
* avm2: Implement call stack

* avm2: Class traits should have a special prefix

* avm2: Stack tracebacks should also contain error message

* avm2: Move method naming to Executable

* avm2: Handle getter and setter methods in tracebacks

* chore: Formatting

* chore: Add comments

* avm2: Make full_name write to a string, instead of creating a new one

* core: Make GcArena publicly accessible

* core: Add Deref impl for Either type

* desktop: Add AVM2 call stack to panic message

* avm2: Prefix native methods with a `/`

* chore: Appease clippy

* avm2: Check if method actually contains bytecode instead of unwrapping

* web: Add AVM2 stack trace to panic message

* chore: Formatting

* chore: Clippy

* avm2: Fix stack traces for free standing functions

* core: Remove global data from context

* core: Rename GcGlobalData to GcCallstack

* core: Introduce StaticCallstack, make GcArena private again

Co-authored-by: Adrian Wielgosik <4729533+adrian17@users.noreply.github.com>
2022-08-28 18:30:20 +02:00
= b7dcd26c38 core: Use Cow<str> for FullscreenError in UI backend, as it can't ever be anything else 2022-08-25 23:43:21 +02:00
= 726217c6c2 desktop: Use anyhow to replace generic errors with more meaningful ones 2022-08-25 23:43:21 +02:00
= 30e7d23cc0 desktop: Use anyhow errors for desktop audio errors 2022-08-25 23:43:21 +02:00
= 5b5ee7d448 core: Made audio backend use actual real error enums, and not box<error> 2022-08-25 23:43:21 +02:00
Aaron Hill 98c7f443ce core: Only store viewport dimensions in `RenderBackend`
Previously, the viewport height and width were stored in
both `Stage` and the `RenderBackend`. Any changes to the viewport
dimensions (e.g. due to window resizing) needed to be updated in both
places to keep our handling of the viewport consistent.

This PR adds a new `ViewportDimensions` type, which holds the
width, height, and scale factor. It is stored inside the
`RenderBackend` impl, and is retrieved using the newly added
method `RenderBackend.get_viewport_dimensions`. After a `Player`
has been constructed, any code that needes access to the viewport
dimensions will ultimate go through this method.

Unfortunately, `Stage` needs to use the viewport dimensions
in `build_matrices`. Therefore, any code modifying the viewport
dimensions should go through `player.set_viewport_dimensions`,
which ensures that the stage matrices are rebuilt after the render
backend is updated.
2022-08-22 13:44:30 -07:00
relrelb e42a6b62e6 core: Require `target` in `NavigatorBackend::navigate_to_url`
Make the `target` parameter just a `String` instead of an `Option<String>`.
`None` is not needed as it's totally equivalent to an empty string.
2022-08-06 11:20:03 +03:00
relrelb afd24cad12 desktop: Tiny cleanup 2022-07-09 11:06:39 +03:00
relrelb f643048c1c core: Introduce `Request`
Which holds both a URL and what was `RequestOptions` formerly.
2022-07-09 09:43:42 +03:00
relrelb 4978158638 chore: Resolve `clap` deprecation warnings
As suggested in https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#320---2022-06-13.
2022-06-17 07:58:21 +03:00
relrelb 102fc46ca2 desktop: Fetch root movie asynchronously
Use `Player::fetch_root_movie` for loading the root movie, as an
early preparation for chunked loading.
2022-06-06 21:02:09 +03:00
relrelb 0097a75703 desktop: Organize UI event loop
Run (almost) all event handlers regardless of whether a movie is loaded
or not. This will be useful for rendering a blank screen before a
movie has been loaded.
2022-06-06 21:02:09 +03:00
Robert Setter 6114f14fe0
Updating the verbiage for the AS3 warnings to try and reduce the number of support questions about it. (#7106)
* Updating AS3 warning verbiage.

* Updating AS3 verbiage

* Increase root font size

* Refining font size.

* correcting font size in .message
2022-05-29 15:08:46 +03:00
Mike Welsh 32bf7e1412 chore: Appease clippy 2022-05-22 02:34:18 -07:00
bbb651 cf820b4f95 desktop: Add fullscreen command line option 2022-05-20 19:51:22 -07:00
relrelb 87ce0f56b7 core: Remove `NavigatorBackend::resolve_relative_url`
The resolved URL only used by `NavigatorBackend::fetch`. So simply
inline `NavigatorBackend::resolve_relative_url` into `NavigatorBackend::fetch`,
per implementation.
2022-05-07 09:06:53 -07:00
relrelb ea665d91f2 core: Introduce and use `Response::url` 2022-05-07 09:06:53 -07:00
relrelb 2517d8de4b core: Introduce struct `Response`
Currently it's a trivial wrapper around `Vec<u8>`, but more fields
will be added in the future (e.g. response URL, HTTP status code).
2022-05-07 09:06:53 -07:00
Mike Welsh 1eb06908c8 core: Make PlayerBuilder::build infallible 2022-04-29 09:14:32 -07:00
Mike Welsh f48182ef3d core: Add various settings to PlayerBuilder 2022-04-29 09:14:32 -07:00
Mike Welsh e1e2b1008a core: Add PlayerBuilder 2022-04-29 09:14:32 -07:00
relrelb 86da42459c desktop: Use `Arc::new_cyclic`
It became stable on Rust 1.60.0.
2022-04-29 09:11:58 -07:00
relrelb 66492441f1 desktop: De-duplicate file reading code
Unify the sandboxed and non-sandboxed cases.
2022-04-08 16:51:59 -07:00
relrelb 7497fb7008 core: Change `Player::set_root_movie` to accept a `SwfMovie`
Move the `Arc::new` to within the function.
2022-04-08 15:16:25 -07:00
David Wendt c664f0b9ba desktop: Add a `sandbox` feature that opens a native file picker to request access to movie subresources.
We notify the user with a message box first to explain why we need them to pick a file.
2022-03-30 11:37:25 -07:00
relrelb ad944800be core: Perfer `Loader`'s `FetchError`
`NetworkError` and `NetworkUnavailable` were rarely used, and they
were very similar to `FetchError`.
2022-03-17 20:31:59 -07:00
relrelb 8a17d88c77 core: Remove `NavigatorBackend::time_since_launch`
`core` already depends on the `instant` crate which abstracts
`std::instant::Instant` and polyfills it on Web. Use it to replace
`NavigatorBackend::time_since_launch` in order to make `NavigatorBackend`
a little smaller and more simple.
2022-03-17 00:08:44 +02:00
relrelb 031126a1b8 core: Remove `LocaleBackend`
Previously there were 3 implementations of `LocaleBackend`:
`DesktopLocaleBackend`, `WebLocaleBackend` and `NullLocaleBackend`.

While `DesktopLocaleBackend`, `WebLocaleBackend` were identical,
`NullLocaleBackend` always returned a fixed date/time for tests
determinism.

Unify them in a single file, and use `cfg!(test)` and a new dedicated
`deterministic` feature to decide whether to mock date/time or not.
This should not cause any behavioral changes.
2022-03-16 19:57:53 +02:00
relrelb 5da7149aaf desktop: Access `App` fields directly
I think older Rust versions couldn't handle this, but I may be wrong.
Anyway, now it works and is more straight-forward.
2022-03-16 18:49:59 +02:00