Commit Graph

7402 Commits

Author SHA1 Message Date
Moulins 47030b4f5b core: remove UpdateContext's unused lifetime and reborrow method 2024-08-10 22:53:27 +02:00
Moulins 13cffa4c94 core: appease clippy 2024-08-10 22:53:27 +02:00
Moulins d07437e30e core: store 'gc borrows in UpdateContext, and `&mut UC` in Activation
This leaves the second UpdateContext lifetime unused and the `reborrow`
method useless, but they're kept to avoid an unnecessarily huge diff.
2024-08-10 22:53:27 +02:00
Moulins d116ef82e9 core: rework the way the garbage-collected arena is entered in `Player`
Add `Player::enter_arena(_mut)` methods, giving more ergonomic access to
the GC'd arena by:
- handling the RefCell borrows for you;
- passing an extra `&(mut) Player` parameter into the closure;
- giving all borrows the same `'gc` lifetime (thanks to strategic `unsafe`).
2024-08-10 22:53:27 +02:00
Moulins 0b3395d21f core: simplify callstack handling in Player
Grab the AVM2 callstack handle before constructing the GC root,
so that we can set it directly instead of modify the GC root once
constructed. This means we can remove an extra GcCell.

Also switch the callstack object from GcCell to GcRefLock.
2024-08-10 22:53:27 +02:00
Adrian Wielgosik 0097aea381 avm2: Make primitive coercions way cheaper 2024-08-10 17:24:31 +02:00
Tom Schuster f202088bd8 avm2: Box E4XNamespace in E4XNodeData 2024-08-10 15:28:28 +02:00
Nathan Adams 637b1ccf4e avm2: Save an alloc when calling Regexp effective_replacement with no replacement patterns 2024-08-10 01:53:01 +02:00
Nathan Adams 0023062c82 avm2: Short circuit the regexp replacement logic if it's a simple (no pattern) string 2024-08-10 01:53:01 +02:00
Nathan Adams ef42bba20c avm2: Don't realloc the same string in Regexp.replace_with_fn, if no match was found 2024-08-10 01:53:01 +02:00
Lord-McSweeney 863e621bbb avm2: Make ScriptObjectData.vtable non-Optional 2024-08-07 14:57:17 -07:00
Lord-McSweeney fa4df53831 avm2: Change the alignment assertion to use `ScriptObjectData` instead of `RefLock<ScriptObjectData>` 2024-08-07 11:58:05 -07:00
Lord-McSweeney 732775d08a avm2: Use interior mutability in `ScriptObjectData` 2024-08-07 11:58:05 -07:00
Lord-McSweeney 117df6e3c2 avm2: Resolve review notes in `enum_trait_object` macro 2024-08-06 19:25:03 -07:00
Lord-McSweeney 53347ed088 core: Remove unnecessary defined `#[no_dynamic]` `proc_macro_attribute` 2024-08-06 19:25:03 -07:00
Lord-McSweeney c98c173c6b chore: Run `cargo fix` 2024-08-06 19:25:03 -07:00
Lord-McSweeney 806da319c0 avm2: Ensure alignment between *ObjectData and ScriptObjectData is the same 2024-08-06 19:25:03 -07:00
Lord-McSweeney 9c399da94a avm2: Add a `#[no_dynamic]` attribute to specify functions in `enum_trait_object` that don't need dynamic dispatch 2024-08-06 19:25:03 -07:00
Lord-McSweeney e58a82289a avm2: Remove some dynamic-dispatch TObject logic (both on Object variants and defined on TObject)
This results in better codegen for `Object::get_slot` and `set_slot`
2024-08-06 19:25:03 -07:00
michiel2005 6350f5cb87 avm1: made the context menu work for all avm1 objects 2024-08-06 22:11:17 +02:00
TÖRÖK Attila 124310986f render,desktop: Switch to `wgpu` `v22.1.0` and latest `egui` without `winit` 0.30
I opted to enable dithering in egui, because why not.
2024-08-06 15:00:38 +02:00
dependabot[bot] e618c6862b build(deps): bump the cargo-minor group with 9 updates
Bumps the cargo-minor group with 9 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.11` | `4.5.13` |
| [bytemuck](https://github.com/Lokathor/bytemuck) | `1.16.1` | `1.16.3` |
| [flate2](https://github.com/rust-lang/flate2-rs) | `1.0.30` | `1.0.31` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.2.6` | `2.3.0` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.121` | `1.0.122` |
| [regex](https://github.com/rust-lang/regex) | `1.10.5` | `1.10.6` |
| [zip](https://github.com/zip-rs/zip2) | `2.1.5` | `2.1.6` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.10.1` | `3.11.0` |
| [lru](https://github.com/jeromefroe/lru-rs) | `0.12.3` | `0.12.4` |


Updates `clap` from 4.5.11 to 4.5.13
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.11...v4.5.13)

Updates `bytemuck` from 1.16.1 to 1.16.3
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.16.1...v1.16.3)

Updates `flate2` from 1.0.30 to 1.0.31
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/commits)

Updates `indexmap` from 2.2.6 to 2.3.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.2.6...2.3.0)

Updates `serde_json` from 1.0.121 to 1.0.122
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.121...v1.0.122)

Updates `regex` from 1.10.5 to 1.10.6
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.5...1.10.6)

Updates `zip` from 2.1.5 to 2.1.6
- [Release notes](https://github.com/zip-rs/zip2/releases)
- [Changelog](https://github.com/zip-rs/zip2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zip-rs/zip2/compare/v2.1.5...v2.1.6)

Updates `tempfile` from 3.10.1 to 3.11.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.10.1...v3.11.0)

Updates `lru` from 0.12.3 to 0.12.4
- [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeromefroe/lru-rs/compare/0.12.3...0.12.4)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: bytemuck
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: flate2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: zip
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: lru
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 17:49:09 +02:00
Crowdin Bot 3b482b176e chore: Update translations from Crowdin 2024-08-05 13:37:33 +02:00
Kamil Jarosz 85c7370577 text: Fix laying out empty text boxes
This patch fixes how empty text boxes are laid out.
The empty boxes are now added during line fixup, and not after,
which ensures they are subjected to alignment and other adjustments.
2024-08-02 17:56:45 +02:00
Kamil Jarosz 8722642ed7 text: Reset max font size on newline
Before this patch, max font size (which claimed to be the highest font
size observed within the current line) was calculated for each span,
regardless of newlines.
2024-08-02 17:56:45 +02:00
Kamil Jarosz fcbeb92406 text: Assume there's at least one layout box
That condition related to drawing a cursor when there are no boxes is
outdated, as currently it's guaranteed that there's at least one box.

FormatSpans.normalize() ensures that there's at least one span, and
LayoutContext.fixup_line() ensures that each line has at least one box.
2024-08-02 17:56:45 +02:00
Kamil Jarosz 2de9fb83b4 text: Ignore non-text boxes when calculating line bounds 2024-08-02 17:07:02 +02:00
Lord-McSweeney 6c233ed859 avm2: Annotate all object *Data structs with `#[repr(C)]`
This ensures that the ScriptObjectData common to every *Data is always at the same offset, which results in better codegen for TObject methods
2024-08-01 09:09:29 -07:00
Lord-McSweeney c54de07382 avm2: Resolve review comments and use `activation.gc()` in some places 2024-08-01 09:09:29 -07:00
Lord-McSweeney 8f6736da74 avm2: Store a `DisplayObject` instead of `Option<DisplayObject>` in `StageObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 3ae53a6ef2 avm2: Use `Gc` instead of `GcCell` in `ScriptObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney c80bd7a55e avm2: Use `Gc` instead of `GcCell` in `FunctionObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 336e10a535 avm2: Use `Gc` instead of `GcCell` in `XmlListObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 2ff8238bf0 avm2: Remove now-unnecessary `Mutation` argument in some LoaderInfo methods 2024-08-01 09:09:29 -07:00
Lord-McSweeney 49188bd5d7 avm2: Use `Gc` instead of `GcCell` in `LoaderInfoObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney fa759a06a4 avm2: Use `Gc` instead of `GcCell` in `EventObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 5ea9b5d80b avm2: Use `Gc` instead of `GcCell` in `SoundChannelObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 458264a76a avm2: Use `Gc` instead of `GcCell` in `SoundObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 4773591c42 avm2: Use `Gc` instead of `GcCell` in `ClassObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 42e0380e2e avm2: Use `Gc` instead of `GcCell` in `DispatchObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney c551a365a3 avm2: Use `Gc` instead of `GcCell` in `PrimitiveObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 64261c8f06 avm2: Use `Gc` instead of `GcCell` in `RegExpObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 562be06fb1 avm2: Use `Gc` instead of `GcCell` in `VectorObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney b1acb17806 avm2: Use `Gc` instead of `GcCell` in `ArrayObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 7e82b3f425 avm2: Use `Gc` instead of `GcCell` in `XmlObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney a9ac849e56 avm2: Use `Gc` instead of `GcCell` in `NamespaceObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney ee4c08cc31 avm2: Use `Gc` instead of `GcCell` in `StageObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 3d80fc16c4 avm2: Use `Gc` instead of `GcCell` in `QNameObject` and `ErrorObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney bc5328892a avm2: Use `Gc` instead of `GcCell` in `BitmapDataObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 27d25a9442 avm2: Remove Mutation parameter from `TObject::as_bytearray_mut` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 313c384d41 avm2: Use `Gc` instead of `GcCell` in `ByteArrayObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney a5d2b613ac avm2: Use `Gc` instead of `GcCell` in `DomainObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 19bf1d7dcb avm2: Use `Gc` instead of `GcCell` in `DictionaryObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney e4499c2ed2 avm2: Use `Gc` instead of `GcCell` in `ProxyObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 86b8f3fe61 avm2: Use `Gc` instead of `GcCell` in `ResponderObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney fb168f46b3 avm2: Use `Gc` instead of `GcCell` in `FontObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 4e15bcb9b7 avm2: Use `Gc` instead of `GcCell` in `LocalConnectionObject` 2024-08-01 09:09:29 -07:00
Lord-McSweeney 895c13d65b avm2: Use `Gc` instead of `GcCell` in `NetStreamObject` 2024-08-01 09:09:29 -07:00
sleepycatcoding 5806e6577e debug_ui: Add a tab for AVM2 array contents 2024-07-31 00:47:11 +02:00
Kamil Jarosz c54b1b5b4a desktop: Add View menu 2024-07-30 23:42:39 +02:00
Kamil Jarosz 3ea4af481d core: Add respect_forced parameter to set_scale_mode 2024-07-30 23:42:39 +02:00
Kamil Jarosz ee5dce4c86 core: Use layout lines in screen_position_to_index
This refactor makes it possible for layout boxes in the same line to
have different extents, and it does not change the method's behavior.
2024-07-30 19:28:24 +02:00
Adrian Wielgosik 6f56016079 avm2: Support recursive Vector<Vector<T>> lookups 2024-07-30 18:45:45 +02:00
dependabot[bot] fef1cba495 build(deps): bump the cargo-minor group with 9 updates
Bumps the cargo-minor group with 9 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.9` | `4.5.11` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.38.1` | `1.39.2` |
| [quick-xml](https://github.com/tafia/quick-xml) | `0.36.0` | `0.36.1` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.120` | `1.0.121` |
| [enumset](https://github.com/Lymia/enumset) | `1.1.4` | `1.1.5` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.22.16` | `0.22.17` |
| [gilrs](https://gitlab.com/gilrs-project/gilrs) | `0.10.8` | `0.10.9` |
| [env_logger](https://github.com/rust-cli/env_logger) | `0.11.3` | `0.11.5` |
| [toml](https://github.com/toml-rs/toml) | `0.8.15` | `0.8.16` |


Updates `clap` from 4.5.9 to 4.5.11
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.9...clap_complete-v4.5.11)

Updates `tokio` from 1.38.1 to 1.39.2
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.38.1...tokio-1.39.2)

Updates `quick-xml` from 0.36.0 to 0.36.1
- [Release notes](https://github.com/tafia/quick-xml/releases)
- [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md)
- [Commits](https://github.com/tafia/quick-xml/compare/v0.36.0...v0.36.1)

Updates `serde_json` from 1.0.120 to 1.0.121
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.120...v1.0.121)

Updates `enumset` from 1.1.4 to 1.1.5
- [Changelog](https://github.com/Lymia/enumset/blob/main/RELEASES.md)
- [Commits](https://github.com/Lymia/enumset/compare/v1.1.4...v1.1.5)

Updates `toml_edit` from 0.22.16 to 0.22.17
- [Commits](https://github.com/toml-rs/toml/compare/v0.22.16...v0.22.17)

Updates `gilrs` from 0.10.8 to 0.10.9
- [Commits](https://gitlab.com/gilrs-project/gilrs/compare/v0.10.8...v0.10.9)

Updates `env_logger` from 0.11.3 to 0.11.5
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.11.3...v0.11.5)

Updates `toml` from 0.8.15 to 0.8.16
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.15...toml-v0.8.16)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: quick-xml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: enumset
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: toml_edit
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: gilrs
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-29 16:39:55 +02:00
Nathan Adams 3de0279149 avm2: ByteArray should implement IDataInput2 and IDataOutput2. For some reason. 2024-07-29 10:32:45 +02:00
Nathan Adams 892c39f24d avm2: TouchEvent.getSamples and isToolButtonDown are AIR only 2024-07-29 10:32:45 +02:00
Nathan Adams de8e9b60f6 avm2: IME _private fields should be private 2024-07-29 10:32:45 +02:00
Nathan Adams bcba6250b9 avm2: NetStream.preloadEmbeddedData and setDRMAuthenticationCredentials are AIR only 2024-07-29 10:32:45 +02:00
Nathan Adams f804cf4689 avm2: FocusEvent.direction is AIR only 2024-07-29 10:32:45 +02:00
Nathan Adams dade26e93f avm2: Event.SUSPEND is AIR only 2024-07-29 10:32:45 +02:00
Nathan Adams ce9b2337f2 avm2: TextRenderer _private fields should be private 2024-07-29 10:32:45 +02:00
Nathan Adams 0f91196ad0 avm2: FileReference requestPermission and uploadUnencoded are AIR only 2024-07-29 10:32:45 +02:00
Nathan Adams b7e78f4ca6 avm2: MouseCursorData _private fields should be private 2024-07-29 10:32:45 +02:00
Nathan Adams cc1185182d avm2: FrameLabel should extend EventDispatcher 2024-07-29 10:32:45 +02:00
Nathan Adams c2084dfd7a avm2: Worker should extend EventDispatcher 2024-07-29 10:32:45 +02:00
Nathan Adams 2dec2029e0 avm2: GameInputControl should extend EventDispatcher 2024-07-29 10:32:45 +02:00
Nathan Adams 2e2b7deaa7 avm2: HTTPStatusEvent has AIR-only fields 2024-07-29 10:32:45 +02:00
Nathan Adams 3810ae6a53 avm2: Stage.loaderInfo should not have a setter 2024-07-29 10:32:45 +02:00
Nathan Adams a5096890e0 avm2: LoaderContext.allowLoadBytesCodeExecution is actually an AIR-only wrapper around allowCodeImport 2024-07-29 10:32:45 +02:00
Nathan Adams 4bcff2655e avm2: Security.APPLICATION is AIR only 2024-07-29 10:32:45 +02:00
Nathan Adams c152605cad avm2: TextLine.hasTabs should be a getter, not a function 2024-07-29 10:32:45 +02:00
Nathan Adams 9b01d51b72 avm2: A bunch of Keyboard constants are AIR only 2024-07-29 10:32:45 +02:00
Nathan Adams dcd3949093 avm2: URLRequestDefaults is AIR only 2024-07-29 10:32:45 +02:00
Nathan Adams f6ca9bcdac avm2: Also exclude interface based virtual properties from describeTypeJSON 2024-07-28 23:18:52 +02:00
Nathan Adams 4ae2a73b54 avm2: Check API version in describeTypeJSON 2024-07-28 23:18:52 +02:00
Nathan Adams db0fd879d2 avm2: Don't include interface methods in describeTypeJSON 2024-07-28 23:18:52 +02:00
Crowdin Bot 2ac4e7e62d chore: Update translations from Crowdin 2024-07-28 01:00:18 +02:00
Kamil Jarosz 96173b0501 web: Improve virtual keyboard support
This patch integrates the virtual keyboard with the newly added focus
management and removes Android-specific code, instead using generic
logic which takes advantage of improved focus support in SWFs.
2024-07-27 21:32:35 +02:00
Kamil Jarosz 53d2d16162 core: Add UiBackend::close_virtual_keyboard
This method may be used by backends that require explicit virtual
keyboard closing.
2024-07-27 21:32:35 +02:00
Lord-McSweeney 6f0e641748 core: Link root movie to first invalid character ID registered, instead of always using character ID #0 2024-07-27 16:12:44 +03:00
Tom Schuster 93e86d977c avm2: Add flash.sensors.Geolocation stub 2024-07-27 14:13:04 +02:00
Tom Schuster 840128d81a avm2: flash.sensors.Accelerometer extends EventDispatcher 2024-07-27 14:13:04 +02:00
Tom Schuster 1687739093 avm2: Call the Proxy hasProperty override for Object.hasOwnProperty 2024-07-27 12:33:58 +02:00
Lord-McSweeney a4c6c3592b avm2: `StyleSheet` should extend `EventDispatcher` 2024-07-25 22:29:56 +03:00
Kamil Jarosz f8309bc548 avm2: Update focus before dispatching mouse events
The order of events seen during testing suggests that the focus
is updated before dispatching any mouse-related events.
2024-07-25 16:38:06 +02:00
Kamil Jarosz 84e291dc37 core: Make AVM2 objects focusable by mouse
When clicking a focusable by mouse object in AVM2,
the focus should be updated.
2024-07-25 16:38:06 +02:00
Kamil Jarosz c30b229408 avm2: Add support for mouseFocusChange/keyFocusChange events 2024-07-25 16:38:06 +02:00
Kamil Jarosz 409f01e42c avm2: Add support for focusOut events 2024-07-25 16:38:06 +02:00
Kamil Jarosz f79ab195be avm2: Add EventObject::focus_event
This method allows constructing FocusEvents.
2024-07-25 16:38:06 +02:00
Kamil Jarosz 021de2bf91 core: Fix grammar in docs 2024-07-25 16:38:06 +02:00
Lord-McSweeney cd9cfa6b26 core: Fix off-by-one in `MovieClip.frame_exists_within_scene` 2024-07-25 15:59:16 +03:00
Crowdin Bot 9065ce3a03 chore: Update translations from Crowdin 2024-07-24 21:57:36 +02:00
Aaron Hill f6737b68f4 avm2: Add 'avm_caught' trace target to log caught exceptions
When the `avm_debug` feature is enabled, we log all caught exceptions
under the `avm_caught` target at INFO level. This is useful for
debugging SWFs that catch and suppress exceptions, which can end up
hiding errors from unimplemented flash APIs.
2024-07-24 21:03:29 +02:00
Moulins cb10589758 core: Don't make dependant AvmStrings pointing to static buffers 2024-07-24 17:30:04 +02:00
Moulins aa956a286f core: Rename `avm_string::Source::Owned` to `Managed`
This avoids confusion with the owned/dependant distinction
2024-07-24 17:30:04 +02:00
Kamil Jarosz fe82a23b61 avm2: Implement TextField.getParagraphLength 2024-07-24 17:12:54 +02:00
Kamil Jarosz 670e5f9ac2 avm2: Implement TextField.getFirstCharInParagraph 2024-07-24 17:12:54 +02:00
Kamil Jarosz e9b8cfae1a wstr: Add swf_is_newline util method 2024-07-24 17:12:54 +02:00
Kamil Jarosz 9912141114 core: Use swf_is_whitespace where possible 2024-07-24 17:12:54 +02:00
TÖRÖK Attila 9e3035a8bb chore: Fix new beta lint `clippy::manual_inspect` 2024-07-23 18:54:04 +02:00
dependabot[bot] e9c610816b build(deps): bump enumset from 1.1.3 to 1.1.4 in the cargo-minor group
Bumps the cargo-minor group with 1 update: [enumset](https://github.com/Lymia/enumset).


Updates `enumset` from 1.1.3 to 1.1.4
- [Changelog](https://github.com/Lymia/enumset/blob/main/RELEASES.md)
- [Commits](https://github.com/Lymia/enumset/compare/v1.1.3...v1.1.4)

---
updated-dependencies:
- dependency-name: enumset
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-22 23:42:23 +02:00
TÖRÖK Attila bff15397d3 chore: Switch to the `image::ImageReader` alias from the deprecated `image::io::Reader` 2024-07-22 20:13:02 +02:00
dependabot[bot] 88b5fafd7d build(deps): bump the cargo-minor group with 10 updates
Bumps the cargo-minor group with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [image](https://github.com/image-rs/image) | `0.25.1` | `0.25.2` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.62` | `1.0.63` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.38.0` | `1.38.1` |
| [syn](https://github.com/dtolnay/syn) | `2.0.71` | `2.0.72` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.22.15` | `0.22.16` |
| [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource) | `2.4.2` | `2.4.3` |
| [gloo-net](https://github.com/rustwasm/gloo) | `0.5.0` | `0.6.0` |
| [zip](https://github.com/zip-rs/zip2) | `2.1.3` | `2.1.5` |
| [libloading](https://github.com/nagisa/rust_libloading) | `0.8.4` | `0.8.5` |
| [toml](https://github.com/toml-rs/toml) | `0.8.14` | `0.8.15` |


Updates `image` from 0.25.1 to 0.25.2
- [Changelog](https://github.com/image-rs/image/blob/main/CHANGES.md)
- [Commits](https://github.com/image-rs/image/compare/v0.25.1...v0.25.2)

Updates `thiserror` from 1.0.62 to 1.0.63
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.62...1.0.63)

Updates `tokio` from 1.38.0 to 1.38.1
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.38.0...tokio-1.38.1)

Updates `syn` from 2.0.71 to 2.0.72
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.71...2.0.72)

Updates `toml_edit` from 0.22.15 to 0.22.16
- [Commits](https://github.com/toml-rs/toml/compare/v0.22.15...v0.22.16)

Updates `embed-resource` from 2.4.2 to 2.4.3
- [Release notes](https://github.com/nabijaczleweli/rust-embed-resource/releases)
- [Commits](https://github.com/nabijaczleweli/rust-embed-resource/compare/v2.4.2...v2.4.3)

Updates `gloo-net` from 0.5.0 to 0.6.0
- [Release notes](https://github.com/rustwasm/gloo/releases)
- [Changelog](https://github.com/rustwasm/gloo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/gloo/compare/0.5.0...0.6.0)

Updates `zip` from 2.1.3 to 2.1.5
- [Release notes](https://github.com/zip-rs/zip2/releases)
- [Changelog](https://github.com/zip-rs/zip2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zip-rs/zip2/compare/v2.1.3...v2.1.5)

Updates `libloading` from 0.8.4 to 0.8.5
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.4...0.8.5)

Updates `toml` from 0.8.14 to 0.8.15
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.14...toml-v0.8.15)

---
updated-dependencies:
- dependency-name: image
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: toml_edit
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: embed-resource
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: gloo-net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: zip
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: libloading
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-22 20:13:02 +02:00
Kamil Jarosz 92b94d133c avm2: Stub orientation-related Stage API 2024-07-22 19:41:50 +03:00
Kamil Jarosz c6fb941da1 avm2: Add flash.display.StageOrientation 2024-07-22 19:41:50 +03:00
Kamil Jarosz 55cf29c864 avm2: Remove unused imports from Stage 2024-07-22 19:41:50 +03:00
Paulo Medeiros ead80a98a3 avm2: Stub flash.display.Stage.setAspectRatio 2024-07-22 11:53:02 +02:00
Paulo Medeiros f978a0c2e7 avm2: Add flash.display.StageAspectRatio 2024-07-22 11:53:02 +02:00
Aaron Hill 71c3245d14 avm2: Add static methods to XML in public namespace
'My Champion Oliver' relies on being able to call these methods
without the AS3 namespace.
2024-07-19 17:06:41 +03:00
Kamil Jarosz a6d321e1de avm2: Implement `TextField.alwaysShowSelection` 2024-07-19 14:15:58 +02:00
Kamil Jarosz 842f310fe7 core: Add option of rendering gray selection when text field is not focused 2024-07-19 14:15:58 +02:00
Kamil Jarosz f8577a843d core: Use non-zero winding rule for fonts 2024-07-19 12:40:12 +02:00
Kamil Jarosz aab4f7122b avm2: Support non-zero winding rule when drawing paths 2024-07-19 12:40:12 +02:00
Kamil Jarosz b160dd6dd9 core: Add support for non-zero winding rule 2024-07-19 12:40:12 +02:00
Lord-McSweeney 74b5c24b51 avm2: Fix regression with unreachable exceptions 2024-07-17 21:30:13 +03:00
Lord-McSweeney d9ce8ef9ca avm2: Only look at valid Exceptions in verifier 2024-07-16 23:03:30 +03:00
Lord-McSweeney c0565d81e6 core: Log an error when a URLLoader load fails 2024-07-16 12:24:40 +02:00
Kamil Jarosz b8fe2b5cba avm2: Fix EventDispatcher.dispatchEvent return value
This fixes a regression introduced in 250bf64.
2024-07-16 10:53:42 +03:00
Aaron Hill 6e93927f63 web: Check for locked 'Player' mutex and reschedule with setTimeout
We use 'wasm-bindgen-futures' as our futures executor on web, which
in turn uses 'queueMicroTask'. This can result in the browser executing
one of our futures while we're still inside our `requestAnimationFrame`
callback (in particular, while we still have the `Player` mutex locked).

We now detect this condition by attempting the lock the Player mutex
inside of our `spawn_local` future. If this fails, we `await`
a `setTimeout`-based promise, which ensures that our code runs in
a new top-level `setTimeout` javascript 'task' (outside of our
`requestAnimationFrame` callback).
2024-07-15 22:46:22 +02:00
Adrian Wielgosik c9fedb2cf6 avm2: Add a fast path in coerce_s 2024-07-15 22:30:46 +02:00
Adrian Wielgosik 131b2c21f4 avm2: Use small string cache when stringifying ints < 10 2024-07-15 22:30:46 +02:00
Kamil Jarosz 1c3128c8e1 avm2: Use click index for double click detection 2024-07-15 21:51:18 +02:00
Kamil Jarosz 0b64bc681a core: Add click index to ClipEvent::Release 2024-07-15 21:51:18 +02:00
Kamil Jarosz 4ec36d5b3a avm2: Dispatch mouseWheel event on mouse wheel 2024-07-15 21:36:37 +02:00
Kamil Jarosz 922e281395 core: Implement keyboard navigation
This patch implements keyboard navigation, i.e. changing focus using
arrows when an object is highlighted.
2024-07-15 21:19:21 +02:00
Kamil Jarosz fdf28ccc6e core: Refactor tab ordering code 2024-07-15 21:19:21 +02:00
dependabot[bot] 51e868d8ac build(deps): bump the cargo-minor group with 3 updates
Bumps the cargo-minor group with 3 updates: [clap](https://github.com/clap-rs/clap), [thiserror](https://github.com/dtolnay/thiserror) and [syn](https://github.com/dtolnay/syn).


Updates `clap` from 4.5.8 to 4.5.9
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.8...v4.5.9)

Updates `thiserror` from 1.0.61 to 1.0.62
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.61...1.0.62)

Updates `syn` from 2.0.70 to 2.0.71
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.70...2.0.71)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 13:26:34 +02:00
Lord-McSweeney bed5a2fd86 avm2: Add several AIR classes and version-gate `ImageDecodingPolicy` to SWF13+
`NativeProcess`, `NativeProcessStartupInfo`, and `File` classes
2024-07-14 23:25:57 +02:00
Lord-McSweeney 2a38a2caf2 avm2: Fix the globals ordering a little 2024-07-14 23:25:57 +02:00
Lord-McSweeney ceebf2bf64 avm2: Add `flash.net::NetGroup` class 2024-07-14 17:28:27 +03:00
Adrian Wielgosik 48db0e23c4 core: Fix panic on unsetting self-referential masker 2024-07-12 22:35:07 +02:00
Adrian Wielgosik 261ba7374e avm2: Correct setting builtins' types on classes 2024-07-12 21:56:37 +02:00
Kamil Jarosz bd98f72b96 core: Return from handle_event() whether the event has been handled 2024-07-12 15:41:08 +02:00
Kamil Jarosz 7621553a34 avm2: Properly detect whether the event has been handled in event_dispatch_to_avm2 2024-07-12 15:41:08 +02:00
Kamil Jarosz 250bf64a92 avm2: Return whether the event has been handled from dispatch_event
Before that, dispatch_event returned whether the event has been
canceled, but the value has never been used.
It's possible to check whether the event has been canceled
by invoking is_cancelled() on the event.
2024-07-12 15:41:08 +02:00
Kamil Jarosz 57e90d947b avm2: Fire right & middle click events 2024-07-12 15:41:08 +02:00
Kamil Jarosz c7f1f33843 avm2: Add more specific mouse event constructors 2024-07-12 15:41:08 +02:00
Kamil Jarosz 010310dd1b avm2: Add an option to simulate event dispatch 2024-07-12 15:41:08 +02:00
Kamil Jarosz ebfff6aea1 core: Fire clip events on right & middle clicks 2024-07-12 15:41:08 +02:00
Kamil Jarosz 62254d7532 core: Add clip events related to right and middle clicks 2024-07-12 15:41:08 +02:00