Commit Graph

7314 Commits

Author SHA1 Message Date
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
Kamil Jarosz 392101611e core: Add support for pressing multiple mouse buttons 2024-07-12 15:41:08 +02:00
Kamil Jarosz 368a95cf3b core: Add button parameter to is_mouse_down() 2024-07-12 15:41:08 +02:00
Kamil Jarosz 7a52360965 avm2: Parameterize mouse button in mouse_event() 2024-07-12 15:41:08 +02:00
Kamil Jarosz d625c0a779 avm2: Add API versions to MouseEvent constants 2024-07-12 15:41:08 +02:00
Kamil Jarosz 01ad20f8a3 core: Hide focus highlight on invalid and empty bounds 2024-07-12 14:44:49 +02:00
Kamil Jarosz 9a88496763 core: Reset focus on player focus loss
FP resets focus when the window (or the element on web) loses its focus.
2024-07-12 14:20:35 +02:00
Kamil Jarosz 6b0bbb85b1 avm2: Implement TextField.condenseWhite 2024-07-12 14:01:24 +02:00
Kamil Jarosz 12edbc8b75 avm1: Implement TextField.condenseWhite 2024-07-12 14:01:24 +02:00
Kamil Jarosz 83179129e3 core: Implement condensing whitespace in HTML 2024-07-12 14:01:24 +02:00
Kamil Jarosz 96468a4445 core: Use CR as the newline character in HTML
Tests show that CR is the newline character internally used in FP
both on Linux and on Windows.
2024-07-12 14:01:24 +02:00
Lord-McSweeney d7a46b1eb2 avm2: Add `flash.text.engine::TextLineMirrorRegion` class 2024-07-12 13:10:15 +02:00
Lord-McSweeney af6a66b8cf avm2: Partially implement `flash.trace::Trace` 2024-07-12 13:10:15 +02:00
Lord-McSweeney ea0bbce184 avm2: Use return type of `ConstructProp` in optimizer 2024-07-12 09:50:58 +03:00
Lord-McSweeney 604ac514b8 avm2: Properly push return value of `getsuper` in optimizer 2024-07-12 09:50:58 +03:00
Lord-McSweeney 08b2c5d0d6 avm2: Function's c_class should be named `Function$`, not `Function` 2024-07-12 09:50:58 +03:00
Lord-McSweeney f15128f6a2 avm2: Add `CallProperty` -> `Coerce(I/U/D)SwapPop` optimization, propagate types from `AsTypeLate` 2024-07-12 09:50:58 +03:00
Tom Schuster f788586e22 avm2: Add flash.events.NetFilterEvent 2024-07-12 00:20:16 +02:00
Kamil Jarosz ac9b39a652 core: Fix double caret rendering in justified text
The condition

  visible_selection.start() >= *start && visible_selection.end() <= *end

was inaccurate, because the end of the selection is exclusive.
That caused the condition to be true for two adjacent boxes.
For instance:

  box 1: from 0 to 6,  "hello "
  box 2: from 6 to 11, "world"

The caret was rendered for both boxes when it was at position 6.

When applying a correct condition (i.e. treating the end as exclusive)
there is a problem with rendering the caret at the very end of the text,
because the condition will not be triggered for any box
(position 11 in the example above).

That is why a condition specific to this case is added, i.e.

  *end == text_len

When the box is the last box in the text, we are forcing
the caret to be rendered.
2024-07-10 14:36:27 +02:00
Tom Schuster 8768143d7e avm2: Throw error for missing end tag in E4X 2024-07-09 01:01:15 +02:00
Tom Schuster 5aeae40bc5 avm2: Ignore mismatched end tags in E4X 2024-07-09 01:01:15 +02:00
dependabot[bot] 69abfa4528 build(deps): bump the cargo-minor group with 3 updates
Bumps the cargo-minor group with 3 updates: [bitstream-io](https://github.com/tuffy/bitstream-io), [syn](https://github.com/dtolnay/syn) and [toml_edit](https://github.com/toml-rs/toml).


Updates `bitstream-io` from 2.4.2 to 2.5.0
- [Commits](https://github.com/tuffy/bitstream-io/compare/v2.4.2...v2.5.0)

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

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

---
updated-dependencies:
- dependency-name: bitstream-io
  dependency-type: direct:production
  update-type: version-update:semver-minor
  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
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 00:42:31 +02:00
dependabot[bot] 54ce439a5b build(deps): bump quick-xml in the cargo-minor group
Bumps the cargo-minor group with 1 update: [quick-xml](https://github.com/tafia/quick-xml).


Updates `quick-xml` from 0.35.0 to 0.36.0
- [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.35.0...v0.36.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-08 21:38:42 +02:00
Lord-McSweeney 62fd898c0d avm2: Remove two unused `Class` functions
`define_builtin_class_properties` and `define_slot_number_instance_traits`
2024-07-08 12:59:15 +03:00
Lord-McSweeney fffcd5184e avm2: Don't mark a class created from `Class::custom_new` as having its traits already loaded 2024-07-08 12:59:15 +03:00
Lord-McSweeney 1b5daf5981 avm2: Initialize global scope object earlier and remove `set_instance_class` 2024-07-08 12:59:15 +03:00
Lord-McSweeney 0d637d34dd avm2: Remove `void`'s ClassObject 2024-07-08 12:59:15 +03:00
Lord-McSweeney f81136af2c avm2: De-optionify ScriptObjectData.instance_class 2024-07-08 12:59:15 +03:00
Lord-McSweeney 6cc1488f73 avm2: Remove all classless objects 2024-07-08 12:59:15 +03:00
Lord-McSweeney 953a02533f avm2: Fix created receiver value when constructing function 2024-07-08 12:59:15 +03:00
Lord-McSweeney 73e3728c03 avm2: Merge `init_instance_vtable` into `ClassObject::from_class_partial` 2024-07-08 12:59:15 +03:00
Lord-McSweeney 01bdbd20d6 avm2: Pass a `Mutation` to `VTable::init_vtable` instead of an `UpdateContext` 2024-07-08 12:59:15 +03:00
Lord-McSweeney 343ea346d2 avm2: Rename `Class::instance_vtable` to `Class::vtable` 2024-07-08 12:59:15 +03:00
Lord-McSweeney a68c48037b avm2: Remove `class_vtable` field from `ClassObject` 2024-07-08 12:59:15 +03:00
Lord-McSweeney b67dafb93c avm2: Convert `i_class` and `c_class` to a single enum 2024-07-08 12:59:15 +03:00
Lord-McSweeney 4442350912 avm2: Push correct type in optimizer for `NewClass` op 2024-07-08 12:59:15 +03:00
Lord-McSweeney efbaf6a0b0 avm2: Use proper slot type for `TraitKind::Class` 2024-07-08 12:59:15 +03:00
Lord-McSweeney e222a1646c avm2: Remove `Class::class_init` 2024-07-08 12:59:15 +03:00
Lord-McSweeney 13ee356b8c avm2: Fix function prototype 2024-07-08 12:59:15 +03:00
Lord-McSweeney bac18c1a84 avm2: Simplify `ClassObject::link_type` 2024-07-08 12:59:15 +03:00
Lord-McSweeney 9c872860e9 avm2: Actually apply class refactor to ClassObject and describeType
This requires changing the AVM2 ClassObject symbol registry to use Classes
2024-07-08 12:59:15 +03:00
Lord-McSweeney bb50a6f926 avm2: Split `Class` into a i_class `Class` and a c_class `Class` 2024-07-08 12:59:15 +03:00
TÖRÖK Attila acc84769b6 desktop,chore: Bump `egui` to `v0.28.1` 2024-07-08 01:29:40 +02:00
Nathan Adams dd7692b211 core: Document audio+DO methods slightly 2024-07-07 23:57:24 +02:00
Nathan Adams 229697fbbd core: Correctly handle sound events attached to buttons. Fixes #2473 2024-07-07 23:57:24 +02:00
Nathan Adams 1ffb9d2ab9 avm1: Remove sounds when their clip is unloaded, fixes #7447, #14663 2024-07-07 23:57:24 +02:00
Nathan Adams 84df034f84 core: When stopping sounds associated with movieclips, go by path instead of pointer - fixes #9795 2024-07-07 23:57:24 +02:00
Kamil Jarosz dda4cbfd62 core: Use existing methods for rounding twips
Replace `round_to_pixel_half_even` and `round_down_to_pixel` with
existing methods used for rounding twips to pixels.
2024-07-07 21:45:52 +02:00
Lord-McSweeney 1c1fc099cb avm2: Add `flash.net.drm::LoadVoucherSetting` class 2024-07-07 16:03:52 +03:00
Lord-McSweeney 2d650faec0 avm2: Implement `flash.events::AVStatusEvent` and `flash.media::AVCaptionStyle` 2024-07-07 16:03:52 +03:00
Aaron Hill f0d224d88e avm2: Make 'Loader.unloadAndStop' call 'Loader.unload'
We still need to implement the 'stop' behavior, but this should
bring us closer to matching Flash Player.
2024-07-07 08:13:10 -04:00
dependabot[bot] cb8770663f build(deps): bump the cargo-minor group with 3 updates
Bumps the cargo-minor group with 3 updates: [serde](https://github.com/serde-rs/serde), [syn](https://github.com/dtolnay/syn) and [gilrs](https://gitlab.com/gilrs-project/gilrs).


Updates `serde` from 1.0.203 to 1.0.204
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204)

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

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

---
updated-dependencies:
- dependency-name: serde
  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: gilrs
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-07 13:10:44 +02:00
Lord-McSweeney 62f0e07171 avm2: Implement `flash.media::AVResult` 2024-07-07 13:10:33 +03:00
Polo da4eccfc68 avm2: Implement AuthenticationMethod 2024-07-06 22:23:00 +02:00
Polo e015695f47 avm2: Implement NetStreamAppendBytesAction 2024-07-06 22:23:00 +02:00
Polo 430c799e9d avm2: API versioning added for NetStreamPlayTransitions 2024-07-06 22:23:00 +02:00
Polo 3f0c693793 avm2: Implement NetStreamPlayTransitions 2024-07-06 22:23:00 +02:00
Kamil Jarosz 594201adc8 text: Implement double/triple click selection
This patch implements selecting words by double-clicking and
selecting lines by triple-clicking.
It also includes support for selecting words and lines while dragging.
2024-07-06 18:32:10 +02:00
Kamil Jarosz dc4ea60d13 text: Add TODO related to opening links 2024-07-06 18:32:10 +02:00
Kamil Jarosz d770422724 core: Calculate click index when not supplied 2024-07-06 18:32:10 +02:00
Kamil Jarosz 9f9d462381 core: Add click index to PlayerEvent::MouseDown 2024-07-06 18:32:10 +02:00
Kamil Jarosz 9188005820 core: Add click index to ClipEvent::Press 2024-07-06 18:32:10 +02:00
Nathan Adams f8cba925c3 core: Update flash-lso, removes cookie-factory 2024-07-06 12:27:26 +02:00
dependabot[bot] 26ee124eb7 build(deps): bump the cargo-minor group across 1 directory with 2 updates
Bumps the cargo-minor group with 2 updates in the / directory: [ttf-parser](https://github.com/RazrFalcon/ttf-parser) and [fontdb](https://github.com/RazrFalcon/fontdb).


Updates `ttf-parser` from 0.21.1 to 0.24.0
- [Changelog](https://github.com/RazrFalcon/ttf-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/ttf-parser/compare/v0.21.1...v0.24.0)

Updates `fontdb` from 0.18.0 to 0.20.0
- [Changelog](https://github.com/RazrFalcon/fontdb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/fontdb/compare/v0.18.0...v0.20.0)

---
updated-dependencies:
- dependency-name: ttf-parser
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: fontdb
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-05 01:41:48 +02:00
Tom Schuster 7884a35e87 avm2: Properly enumerate Proxy objects for AMF serialization
Fixes #16931:
2024-07-04 18:43:01 +02:00
TÖRÖK Attila 4dd77f903e desktop: Update `egui` to `v0.28.0` 2024-07-04 11:32:48 +02:00
Aaron Hill c65033aa37 avm2: Ignore errors when setting properties in amf deserializer
Flash Player *traces* any errors that occur during setting properties
on the newly-constructed object durting AMf deserialization, and
continues deserializing.
2024-07-03 17:42:02 -04:00
Kamil Jarosz 5aaff966aa text: Render caret using lines
This patch makes the caret be drawn using lines.
This ensures that the width of the caret is always 1px.

Additionally, it improves caret positioning, so that it's closer to FP.
2024-07-03 15:09:31 +02:00
Kamil Jarosz 59c0bcf073 core: Improve EditText's border and background rendering
This patch removes the drawing used for rendering the border and
the background and renders them using primitives instead.

It provides two methods for drawing the border and the background:
* draw_device_text_box -- when device fonts are used,
* draw_text_box -- when fonts are embedded.

Updated expected images in tests as they are closer to FP now:
* text/auto_size/height,
* text/auto_size/return,
* text/auto_size/width,
* visual/shumway_acid_tests/acid_color_0.

For the test avm2/stage3d_texture it's hard to say whether the current
output is closer to FP or not, as FP renders it with a different scale.
However, I have confirmed that there exists a scale at which FP renders
the text fields exactly as Ruffle after this patch.
2024-07-02 23:40:50 +02:00
Kamil Jarosz 23f01e0dd9 render: Add Matrix::create_box_with_rotation
This patch splits the current method of create_box into
1. create_box -- without rotation, and
2. create_box_with_rotation -- with rotation.

The reason for that refactor is that create_box was often used without
rotation, and always passing 0.0 as rotation and having
a dedicated condition for 0.0 was superfluous.
2024-07-02 23:40:50 +02:00
Marco Bartoli fe08638d26
Implement ImportAssets/ImportAssets2 (#16420) 2024-07-02 11:41:48 +00:00
Aaron Hill 617cb3330d avm2: Ignore ClassObject call receiver
This allows a class to be used with `callproplex`
2024-07-02 07:18:22 -04:00
Lord-McSweeney 83d0316ac3 avm2: Add stub notices for reusing Loader 2024-07-02 06:58:37 +03:00
Lord-McSweeney d2e3de4cc4 avm2: Unload the contents of a Loader before `load` and `loadBytes` 2024-07-02 06:58:37 +03:00
Aaron Hill ebab349458 avm2: Stub Stage.mouseLock 2024-07-01 23:13:02 -04:00
dependabot[bot] 28aa2e65a9 build(deps): bump the cargo-minor group across 1 directory with 7 updates
Bumps the cargo-minor group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.7` | `4.5.8` |
| [bitflags](https://github.com/bitflags/bitflags) | `2.5.0` | `2.6.0` |
| [log](https://github.com/rust-lang/log) | `0.4.21` | `0.4.22` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.117` | `1.0.120` |
| [num-bigint](https://github.com/rust-num/num-bigint) | `0.4.5` | `0.4.6` |
| [id3](https://github.com/polyfloyd/rust-id3) | `1.13.1` | `1.14.0` |
| [either](https://github.com/rayon-rs/either) | `1.12.0` | `1.13.0` |



Updates `clap` from 4.5.7 to 4.5.8
- [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.7...v4.5.8)

Updates `bitflags` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.5.0...2.6.0)

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

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

Updates `num-bigint` from 0.4.5 to 0.4.6
- [Changelog](https://github.com/rust-num/num-bigint/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-bigint/compare/num-bigint-0.4.5...num-bigint-0.4.6)

Updates `id3` from 1.13.1 to 1.14.0
- [Changelog](https://github.com/polyfloyd/rust-id3/blob/main/CHANGELOG.md)
- [Commits](https://github.com/polyfloyd/rust-id3/compare/v1.13.1...v1.14.0)

Updates `either` from 1.12.0 to 1.13.0
- [Commits](https://github.com/rayon-rs/either/compare/1.12.0...1.13.0)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: log
  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: num-bigint
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: id3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: either
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-02 01:04:52 +02:00
Lord-McSweeney 67c9936bf4 avm2: Use proper coercion in XMLList prototype methods 2024-07-01 18:40:47 +02:00
Tom Schuster 58c231588d core: Stop searching after finding the first default font 2024-06-30 11:32:06 +02:00
TÖRÖK Attila 6aa2dde859 chore: Update quick-xml to 0.35.0 2024-06-30 11:17:38 +02:00
Tom Schuster 5618a3d048 avm2: FP10 version DisplayObject rotationX/Y/Z and scaleZ
Fixes #16910
2024-06-30 09:48:40 +02:00
Kamil Jarosz 19649cc69b text: Do not clamp font size for SWF13+ 2024-06-29 22:57:55 +02:00
Kamil Jarosz c350be43b8 avm2: Implement TextField.getTextRuns() 2024-06-29 22:57:55 +02:00
Kamil Jarosz bcbf3ba3d1 text: Support TextFormat.display 2024-06-29 22:57:55 +02:00
Kamil Jarosz 3bf5e28348 avm2: Implement TextRun 2024-06-29 22:57:55 +02:00
Kamil Jarosz 95cc3c52f3 avm2: Fix highlight bounds for buttons
Similarly to AVM1, AVM2 buttons also use their
hit bounds as highlight bounds.
2024-06-29 22:42:25 +02:00
Kamil Jarosz a3dddbd80d avm2: Roughly implement `TextField.*IndexAtPoint`
Both implementations currently use `screen_position_to_index`, which
is inaccurate, and that's why these methods still produce a stub warning.
However, this implementation makes some games work, is a lot better than
a perfect implementation which would require a lot of work and time,
and infinitely better than no implementation at all.
2024-06-29 22:28:16 +02:00
Kamil Jarosz a9708a8017 debug_ui: Draw bounds on hover
When the user hovers on world bounds and highlight bounds,
debug rects signifying their positions are automatically drawn.
2024-06-29 21:57:32 +02:00
Kamil Jarosz 59a8d1e8a1 debug_ui: Improve debug rect bounds calculation
Before this patch, it was possible that some objects did not have a
debug rect despite existing on the stage and interacting with the user.
That was the case for instance for buttons with hit bounds and no up state.

This patch ensures that debug rect is at least as big as highlight bounds,
which are used to highlight focused objects on the stage.
2024-06-29 21:57:32 +02:00
Kamil Jarosz 056650337e chore: Remove unnecessary returns 2024-06-29 11:29:02 +02:00