Commit Graph

72 Commits

Author SHA1 Message Date
Emil Ernerfeldt d0876a1a60
Rename `master` branch to `main` (#7034)
For consistency with other repositories, i.e. so I can write `git
checkout main` without worrying which repo I'm browsing.
2025-05-08 09:15:42 +02:00
valadaptive d0bd525b5d
Bump accesskit to 0.18 and make it a workspace dependency (#5783)
This can't be merged until [kittest's accesskit is
bumped](https://github.com/rerun-io/kittest/pull/9) ~~and [a new version
of rfd is released](https://github.com/PolyMeilex/rfd/pull/240)~~.

---------

Co-authored-by: Lucas Meurer <lucasmeurer96@gmail.com>
2025-03-20 11:00:12 +01:00
Emil Ernerfeldt bf6ed3adfc
Add `Context::copy_image` (#5533)
* Closes https://github.com/emilk/egui/issues/5424

This adds support for copying images to the system clipboard on native
and on web using `Context::copy_image`.
2024-12-29 18:03:32 +01:00
Ted de Munnik 3af907919b
Use `profiling` crate to support more profiler backends (#5150)
Hey! I am not sure if this is something that's been considered before
and decided against (I couldn't find any PR's or issues).

This change removes the internal profiling macros in library crates and
the `puffin` feature and replaces it with similar functions in the
[profiling](https://github.com/aclysma/profiling) crate. This crate
provides a layer of abstraction over various profiler instrumentation
crates and allows library users to pick their favorite (supported)
profiler.

An additional benefit for puffin users is that dependencies of egui are
included in the instrumentation output too (mainly wgpu which uses the
profiling crate), so more details might be available when profiling.

A breaking change is that instead of using the `puffin` feature on egui,
users that want to profile the crate with puffin instead have to enable
the `profile-with-puffin` feature on the profiling crate. Similarly they
could instead choose to use `profile-with-tracy` etc.

I tried to add a 'tracy' feature to egui_demo_app in order to showcase ,
however the /scripts/check.sh currently breaks on mutually exclusive
features (which this introduces), so I decided against including it for
the initial PR. I'm happy to iterate more on this if there is interest
in taking this PR though.

Screenshot showing the additional info for wgpu now available when using
puffin

![image](https://github.com/user-attachments/assets/49fc0e7e-8f88-40cb-a69e-74ca2e3f90f3)
2024-12-16 09:15:54 +01:00
lucasmerlin e28505077d
Update accesskit to 0.17 (#5372)
Updates accesskit and kittest. 

* [x] I have followed the instructions in the PR template
2024-11-26 15:16:08 +01:00
Bruce Mitchener fba2dc85a3
egui-winit: Remove implicit `accesskit_winit` feature (#5316)
This is controlled by the `accesskit` feature and nothing needs the
implicit `accesskit_winit` feature, so use `dep:` syntax to prevent it
from being created.

* [x] I have followed the instructions in the PR template
2024-10-29 13:09:31 +01:00
Emil Ernerfeldt a72ebbeafc
Add a `cargo machete` CI step (#5171)
`cargo machete` looks for unused dependencies
2024-09-26 10:24:37 +02:00
Guillaume Gomez da04339f5e
Enable rustdoc `generate-link-to-definition` feature on docs.rs (#5030)
You can see this feature in action
[here](https://docs.rs/sysinfo/latest/src/sysinfo/common/system.rs.html#46)
or on any of dtolnay's crates and many others. I found myself going
through your project code recently on docs.rs and I was a bit sad I
couldn't have this feature enabled. This should fix it at next release.
:)
2024-08-30 11:22:29 +02:00
Arthur Brussee 1f6ae49a5f
Unpin & upgrade winit to 0.30.5 (#4939)
This updates winit to 0.30.5. 

https://github.com/emilk/egui/pull/4849 Had to pin the version to
0.30.2, as a Winit patch changed the behavior of selecting a theme.
Winit 0.30.5 reverts this, so we could stick with `window.theme()`, but
the newly added `ActiveEventLoop::system_theme` is more like what egui
wants anyway, as individual windows can have theme overrides.

Also bump `smithay-clipboard` to prevent some now duplicate
dependencies.
2024-08-09 09:15:14 +02:00
Arthur Brussee 6f2f006885
Upgrade winit to 0.30.2 (#4849)
* Closes https://github.com/emilk/egui/issues/1918
* Closes https://github.com/emilk/egui/issues/4437
* Closes https://github.com/emilk/egui/issues/4709
* [x] I have followed the instructions in the PR template

Hiya,

I need new winit for a specific fix for a android_native_actvity. There
are already two PRs, but both don't seem to have a lot of movement, or
are entirely complete:

https://github.com/emilk/egui/pull/4466
Seems to have gone stale & is missing some bits.

https://github.com/emilk/egui/pull/4702
Also seems stale (if less so), and is missing a refactor to
run_on_demand. I also *think* the accesskit integration has a mistake
and can't be enabled. I've marked them as a co-author on this as I
started from this branch. (I think! Haven't done that on git before...).

Sorry for the wall of text but just dumping some details / thoughts
here:

- There's an issue with creating child windows in winit 0.30.1 and up on
macOS. The multiple_viewports, "create immediate viewport" example
crashes on anything later 0.30.1, with a stack overflow in unsafe code.
I've create [a winit
issue](https://github.com/rust-windowing/winit/issues/3800), it *might*
already be fixed in 0.31.0 but I can't test as 0.31 will likely require
another refactoring. For now I have just pinned things to 0.30.0 exatly.

- Winit has deprecated run_on_demand, instead requiring the
ApplicationHandler interface. In 0.31.0 run_on_demand is removed. I've
refactored both the integration and the WinitApp trait to follow this
pattern. I've left user_events a bit more opaque, as it seems 0.31.0 is
doing a rework of UserEvents too.

- I've used the new lazy init approach for access kit from this branch
https://github.com/mwcampbell/egui/tree/accesskit-new-lazy-init and
marked Matt as co-author, thanks Matt!

- There was very similair but not quite the same code for run_and_return
and run_and_exit. I've merged them, but looking at the github issues
graveyard it seems vey finnicky. I *hope* this is more robust than
before but it's a bit scary.

- when receiving new_events this also used to check the redraw timing
dictionary. That doesn't seem necesarry so left this out, but that is a
slight behaviour change?

- I have reeneabled serial_windows on macOS. I wondered whether it was
fixed after this PR and does seem to be! However, even before this PR it
seems to work, so maybe winit has sorted things out before that...
Windows also works fine now without the extra hack.

- I've done a very basic test of AccessKit on Windows and screen reader
seems ok but I'm really not knowleadgable enough to say whether it's all
good or not.

- I've tested cargo tests & all examples on Windows & macOS, and ran a
basic Android app. Still, testing native platforms is wel... hard so if
anyone can test linux / iOs / older mac versions / windows 10 would
probably be a good idea!

- For consistencys sake I've made all event like functions in WinitApp
return a `Result<EventResult>`. There's quite a bit of Ok-wrapping now,
maybe too annoying? Not sure.

Thank you for having a look!

# Tested on
* [x] macOS
* [x] Windows
* [x] Wayland (thanks [SiebenCorgie](https://github.com/SiebenCorgie))
* [x] X11 (thanks
[crumblingstatue](https://github.com/crumblingstatue)!,
[SiebenCorgie](https://github.com/SiebenCorgie))


# TODO
* [x] Fix "follow system theme" not working on initial startup (winit
issue, pinning to 0.30.2 for now).
* [x] Fix `request_repaint_after`

---------

Co-authored-by: mwcampbell <mattcampbell@pobox.com>
Co-authored-by: j-axa <josef.axa@gmail.com>
Co-authored-by: DataTriny <datatriny@gmail.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-07-31 09:43:16 +02:00
Oscar Gustafsson cd45d18615
Do no use the ahash reimport (#4504)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

Related to #3482 

Not sure what the "best practice" is, to me it seems like one should
import from "the original location" if possible, but now it should at
least be possible to not re-export ahash without any breakage in the
egui code base (but possibly in projects using egui, so one should
probably deprecate it if one would like to go that path). It also seems
like epaint re-exports ahash.
2024-05-27 16:24:50 +02:00
Oscar Gustafsson c1eb3f884d
Move dependencies to workspace (#4495)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

Inspired by:

44d65f41ac/Cargo.toml (L65)

I took the liberty of removing that comment since I *think* that I got
all "relevant" ones (showing up more than once, sort of).
2024-05-14 11:02:49 +02:00
Emil Ernerfeldt 2f508d6a61
Replace cargo-cranky with workspace lints (#4413)
Replace `cargo-cranky` (which has served us well) with workspace lints
2024-04-25 17:24:50 +02:00
TÖRÖK Attila 2c590636b5
`egui-winit`: Update `webbrowser` to `v1.0.0` (#4394)
No significant changes, mostly marks API stability:
https://github.com/amodm/webbrowser-rs/releases/tag/v1.0.0
2024-04-23 08:03:36 +02:00
Magnus Larsen 7a4ab666b4
Update memoffset to 0.9.0, arboard to 3.3.1, and remove egui_glow's needless dependency on pure_glow's deps (#4036)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

These are the latest versions of memoffset and arboard.

The changes to egui_glow/pure_glow allow downstream crates to not depend
on rwh 0.5, which is only needed for pure_glow (and other projects that
use glutin)

Thanks for your time & work
2024-02-13 10:32:18 +01:00
Emil Ernerfeldt d02491425c
Put all egui crates as workspace crates (#3976)
Second attempty
2024-02-05 12:59:49 +01:00
Emil Ernerfeldt bcebfecb84
Use more workspace dependencies (#3975) 2024-02-05 12:43:58 +01:00
Emil Ernerfeldt 8f2c8664e7
Emilk/revert workspace deps (#3942)
* Closes https://github.com/emilk/egui/issues/3941

Workspace dependencies can be annoying.

If you don't set them to `default-features=false`, then you cannot opt
out of their default features anywhere else, and get warnings if you
try.

So you set `default-features=false`, and then you need to manually opt
in to the default features everywhere else.
Or, as in my case, don't.

I don't have the energy to do this tonight, so I'll just revert.
2024-02-01 21:29:48 +01:00
Emil Ernerfeldt 00cd671ad8 Use workspace dependencies for the egui crates 2024-02-01 20:25:31 +01:00
Emil Ernerfeldt dda9f79838 Remove `version` field for path-dependencies 2024-02-01 20:11:40 +01:00
Emil Ernerfeldt 21253d844e
Postpone call to get_current_texture (#3914)
This should help slightly with CPU/GPU parallelism when vsync is on.

I also return the time spent on vsync, which can help users figure out
how much CPU wall-time was used on non-vsync stuff
2024-01-29 18:06:21 +01:00
Emil Ernerfeldt b766a48fa7
Update wgpu to 0.19 (#3824)
* Closes https://github.com/emilk/egui/issues/3675

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Mingun <Alexander_Sergey@mail.ru>
2024-01-19 10:14:13 +01:00
Emil Ernerfeldt 12ad9e7b36 Release 0.25.0 - Better keyboard input 2024-01-08 12:25:43 +01:00
Fredrik Fornwall 8e5959d55d
Update to winit 0.29 (#3649)
* Closes https://github.com/emilk/egui/issues/3542
* Closes https://github.com/emilk/egui/issues/2977
* Closes https://github.com/emilk/egui/issues/3303

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-12-18 14:53:14 +01:00
Emil Ernerfeldt d17613c242 Release 0.24.1 - Bug fixes 2023-11-30 17:46:25 +01:00
Emil Ernerfeldt bd087ffb8d Release 0.24.0 - Multi-viewport 2023-11-23 15:56:46 +01:00
Emil Ernerfeldt 96bc34a66d Use workspace definitions of edition,license,rust-version,version 2023-11-23 15:45:11 +01:00
Emil Ernerfeldt bfadb90d42
Update MSRV to Rust 1.72 (#3595)
Required to update to puffin 0.18
2023-11-21 17:26:35 +01:00
Emil Ernerfeldt e823491240
Update some crate dependencies (#3594)
Nothing major
2023-11-21 16:07:56 +01:00
Emil Ernerfeldt 7bfaf49636
Update to puffin 0.17 (#3581) 2023-11-19 21:28:42 +01:00
Konkitoman 83aa3109d3
Multiple viewports/windows (#3172)
* Closes #1044

---
(new PR description written by @emilk)

## Overview
This PR introduces the concept of `Viewports`, which on the native
eframe backend corresponds to native OS windows.

You can spawn a new viewport using `Context::show_viewport` and
`Cotext::show_viewport_immediate`.
These needs to be called every frame the viewport should be visible.

This is implemented by the native `eframe` backend, but not the web one.

## Viewport classes
The viewports form a tree of parent-child relationships.

There are different classes of viewports.

### Root vieport
The root viewport is the original viewport, and cannot be closed without
closing the application.

### Deferred viewports
These are created with `Context::show_viewport`.
Deferred viewports take a closure that is called by the integration at a
later time, perhaps multiple times.
Deferred viewports are repainted independenantly of the parent viewport.
This means communication with them need to done via channels, or
`Arc/Mutex`.

This is the most performant type of child viewport, though a bit more
cumbersome to work with compared to immediate viewports.

### Immediate viewports
These are created with `Context::show_viewport_immediate`.
Immediate viewports take a `FnOnce` closure, similar to other egui
functions, and is called immediately. This makes communication with them
much simpler than with deferred viewports, but this simplicity comes at
a cost: whenever tha parent viewports needs to be repainted, so will the
child viewport, and vice versa. This means that if you have `N`
viewports you are poentially doing `N` times as much CPU work. However,
if all your viewports are showing animations, and thus are repainting
constantly anyway, this doesn't matter.

In short: immediate viewports are simpler to use, but can waste a lot of
CPU time.

### Embedded viewports
These are not real, independenant viewports, but is a fallback mode for
when the integration does not support real viewports. In your callback
is called with `ViewportClass::Embedded` it means you need to create an
`egui::Window` to wrap your ui in, which will then be embedded in the
parent viewport, unable to escape it.


## Using the viewports
Only one viewport is active at any one time, identified wth
`Context::viewport_id`.
You can send commands to other viewports using
`Context::send_viewport_command_to`.

There is an example in
<https://github.com/emilk/egui/tree/master/examples/multiple_viewports/src/main.rs>.

## For integrations
There are several changes relevant to integrations.

* There is a [`crate::RawInput::viewport`] with information about the
current viewport.
* The repaint callback set by `Context::set_request_repaint_callback`
now points to which viewport should be repainted.
* `Context::run` now returns a list of viewports in `FullOutput` which
should result in their own independant windows
* There is a new `Context::set_immediate_viewport_renderer` for setting
up the immediate viewport integration
* If you support viewports, you need to call
`Context::set_embed_viewports(false)`, or all new viewports will be
embedded (the default behavior).


## Future work
* Make it easy to wrap child viewports in the same chrome as
`egui::Window`
* Automatically show embedded viewports using `egui::Window`
* Use the new `ViewportBuilder` in `eframe::NativeOptions`
* Automatically position new viewport windows (they currently cover each
other)
* Add a `Context` method for listing all existing viewports

Find more at https://github.com/emilk/egui/issues/3556




---

<details>
<summary>
Outdated PR description by @konkitoman
</summary>


## Inspiration
- Godot because the app always work desktop or single_window because of
embedding
- Dear ImGui viewport system

## What is a Viewport

A Viewport is a egui isolated component!
Can be used by the egui integration to create native windows!

When you create a Viewport is possible that the backend do not supports
that!
So you need to check if the Viewport was created or you are in the
normal egui context!
This is how you can do that:
```rust
if ctx.viewport_id() != ctx.parent_viewport_id() {
    // In here you add the code for the viewport context, like
    egui::CentralPanel::default().show(ctx, |ui|{
        ui.label("This is in a native window!");
    });
}else{
    // In here you add the code for when viewport cannot be created!
   // You cannot use CentralPanel in here because you will override the app CentralPanel
   egui::Window::new("Virtual Viewport").show(ctx, |ui|{
       ui.label("This is without a native window!\nThis is in a embedded viewport");
   });
}
```

This PR do not support for drag and drop between Viewports!

After this PR is accepted i will begin work to intregrate the Viewport
system in `egui::Window`!
The `egui::Window` i want to behave the same on desktop and web
The `egui::Window` will be like Godot Window

## Changes and new

These are only public structs and functions!

<details>
<summary>

## New
</summary>

- `egui::ViewportId`
- `egui::ViewportBuilder`
This is like winit WindowBuilder

- `egui::ViewportCommand`
With this you can set any winit property on a viewport, when is a native
window!

- `egui::Context::new`
- `egui::Context::create_viewport`
- `egui::Context::create_viewport_sync`
- `egui::Context::viewport_id`
- `egui::Context::parent_viewport_id`
- `egui::Context::viewport_id_pair`
- `egui::Context::set_render_sync_callback`
- `egui::Context::is_desktop`
- `egui::Context::force_embedding`
- `egui::Context::set_force_embedding`
- `egui::Context::viewport_command`
- `egui::Context::send_viewport_command_to`
- `egui::Context::input_for`
- `egui::Context::input_mut_for`
- `egui::Context::frame_nr_for`
- `egui::Context::request_repaint_for`
- `egui::Context::request_repaint_after_for`
- `egui::Context::requested_repaint_last_frame`
- `egui::Context::requested_repaint_last_frame_for`
- `egui::Context::requested_repaint`
- `egui::Context::requested_repaint_for`
- `egui::Context::inner_rect`
- `egui::Context::outer_rect`

- `egui::InputState::inner_rect`
- `egui::InputState::outer_rect`

- `egui::WindowEvent`

</details>

<details>
<summary>

## Changes
</summary>

- `egui::Context::run`
Now needs the viewport that we want to render!

- `egui::Context::begin_frame`
Now needs the viewport that we want to render!

- `egui::Context::tessellate`
Now needs the viewport that we want to render!

- `egui::FullOutput`
```diff
- repaint_after
+ viewports
+ viewport_commands
```

- `egui::RawInput`
```diff
+ inner_rect
+ outer_rect
```

- `egui::Event`
```diff
+ WindowEvent
```
</details>

### Async Viewport

Async means that is independent from other viewports!

Is created by `egui::Context::create_viewport`

To be used you will need to wrap your state in `Arc<RwLock<T>>`
Look at viewports example to understand how to use it!

### Sync Viewport

Sync means that is dependent on his parent!

Is created by `egui::Context::create_viewport_sync`

This will pause the parent then render itself the resumes his parent!

#### ⚠️ This currently will make the fps/2 for every sync
viewport

### Common

#### ⚠️ Attention

You will need to do this when you render your content
```rust
ctx.create_viewport(ViewportBuilder::new("Simple Viewport"), | ctx | {
    let content = |ui: &mut egui::Ui|{
        ui.label("Content");
    };

    // This will make the content a popup if cannot create a native window
    if ctx.viewport_id() != ctx.parent_viewport_id() {
        egui::CentralPanel::default().show(ctx, content);
    } else {
        egui::Area::new("Simple Viewport").show(ctx, |ui| {
            egui::Frame::popup(ui.style()).show(ui, content);
        });
    };
});
````

## What you need to know as egui user

### If you are using eframe

You don't need to change anything!

### If you have a manual implementation

Now `egui::run` or `egui::begin` and `egui::tessellate` will need the
current viewport id!
You cannot create a `ViewportId` only `ViewportId::MAIN`

If you make a single window app you will set the viewport id to be
`egui::ViewportId::MAIN` or see the `examples/pure_glow`
If you want to have multiples window support look at `crates/eframe`
glow or wgpu implementations!

## If you want to try this

- cargo run -p viewports

## This before was wanted to change

This will probably be in feature PR's

### egui::Window

To create a native window when embedded was set to false
You can try that in viewports example before:
[78a0ae8](78a0ae879e)

### egui popups, context_menu, tooltip

To be a native window

</details>

---------

Co-authored-by: Konkitoman <konkitoman@users.noreply.github.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Pablo Sichert <mail@pablosichert.com>
2023-11-16 11:25:05 +01:00
Nolan Darilek d0ff09ac20
Update accesskit and accesskit_winit. (#3475)
* Update accesskit and accesskit_winit.

* Remove duplicated `libgtk-3-dev`

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-11-10 11:32:30 +01:00
Emil Ernerfeldt 5a0186fa2b Release 0.23.0 - New image API 2023-09-28 08:44:33 +02:00
Emil Ernerfeldt f138131bc8 Improve top-level crate docs, and sort features is Cargo.toml 2023-09-27 11:40:28 +02:00
Emil Ernerfeldt 82704bebbf
Update MSRV to Rust 1.70.0 (#3310)
* Update to Rust 1.70

* Fix renamed clippy lint

* Use let-else more

* Code cleanup

* Remove derelict Safety comments

* Enable more clippy lints
2023-09-06 07:59:24 +02:00
Emil Ernerfeldt 436996b79e
Update web-time to 0.2 (#3308) 2023-09-05 14:11:07 +02:00
Emil Ernerfeldt 9e86bb8d6a
Add opt-in `puffin` feature to egui (#3298)
* Add opt-in `puffin` feature to egui

* fix web build

* Fix web for realz
2023-09-04 15:01:22 +02:00
Emil Ernerfeldt 209cbeb030
Replace instant with web_time (#3296) 2023-09-04 09:37:35 +02:00
Emil Ernerfeldt 08fb447fb5
Increase MSRV to 1.67 (#3234)
* Bump MSRV to 1.67

* clippy fixes

* cargo clippy: inline format args

* Add `clippy::uninlined_format_args` to cranky lints

* Fix clippy on wasm

* More clippy fixes
2023-08-11 13:54:02 +02:00
Emil Ernerfeldt 7e035c6dd1
Allow users to opt-out of default `winit` features (#3228)
* Do not enable winit features by default

* Enable default winit features by default

* Add x11 feature
2023-08-10 17:09:01 +02:00
Emil Ernerfeldt 083d61fccd
Update to puffin 0.16 (#3144) 2023-07-10 12:29:01 +02:00
Emil Ernerfeldt 307565efa5 Release 0.22.0 - A plethora of small improvements 2023-05-23 19:58:04 +02:00
Emil Ernerfeldt 8c5d235bfb
cargo update (#3018)
* cargo update

    Updating crates.io index
    Updating ab_glyph v0.2.20 -> v0.2.21
    Updating aho-corasick v0.7.20 -> v1.0.1
    Updating android-activity v0.4.0 -> v0.4.1
    Updating anyhow v1.0.69 -> v1.0.71
    Updating arrayref v0.3.6 -> v0.3.7
    Updating async-broadcast v0.5.0 -> v0.5.1
    Updating async-executor v1.5.0 -> v1.5.1
    Updating async-io v1.12.0 -> v1.13.0
    Updating async-lock v2.6.0 -> v2.7.0
    Updating async-recursion v1.0.2 -> v1.0.4
    Updating async-task v4.3.0 -> v4.4.0
    Updating async-trait v0.1.64 -> v0.1.68
    Updating atomic_refcell v0.1.9 -> v0.1.10
      Adding base64 v0.21.1
    Updating bindgen v0.64.0 -> v0.65.1
    Updating bitflags v2.1.0 -> v2.3.1
    Updating block-buffer v0.10.3 -> v0.10.4
    Updating bumpalo v3.12.0 -> v3.13.0
    Updating bytemuck v1.13.0 -> v1.13.1
    Updating bytemuck_derive v1.4.0 -> v1.4.1
    Updating cfg-expr v0.11.0 -> v0.15.1
    Updating chrono v0.4.23 -> v0.4.24
    Updating ciborium v0.2.0 -> v0.2.1
    Updating ciborium-io v0.2.0 -> v0.2.1
    Updating ciborium-ll v0.2.0 -> v0.2.1
    Updating clang-sys v1.4.0 -> v1.6.1
    Updating clap v3.2.23 -> v3.2.25
    Updating cocoa-foundation v0.1.0 -> v0.1.1
    Updating concurrent-queue v2.1.0 -> v2.2.0
    Updating core-foundation-sys v0.8.3 -> v0.8.4
    Updating cpufeatures v0.2.5 -> v0.2.7
    Updating crossbeam-utils v0.8.14 -> v0.8.15
    Removing cxx v1.0.89
    Removing cxx-build v1.0.89
    Removing cxxbridge-flags v1.0.89
    Removing cxxbridge-macro v1.0.89
    Updating digest v0.10.6 -> v0.10.7
    Updating dyn-clone v1.0.10 -> v1.0.11
    Updating enum-map v2.4.2 -> v2.5.0
    Updating enumn v0.1.6 -> v0.1.8
    Removing errno v0.2.8
    Updating fastrand v1.8.0 -> v1.9.0
      Adding fdeflate v0.3.0
    Updating flate2 v1.0.25 -> v1.0.26
    Updating futures-core v0.3.26 -> v0.3.28
    Updating futures-io v0.3.26 -> v0.3.28
    Updating futures-lite v1.12.0 -> v1.13.0
    Updating futures-sink v0.3.26 -> v0.3.28
    Updating futures-task v0.3.26 -> v0.3.28
    Updating futures-util v0.3.26 -> v0.3.28
    Updating generic-array v0.14.6 -> v0.14.7
    Updating getrandom v0.2.8 -> v0.2.9
    Updating gimli v0.27.1 -> v0.27.2
    Updating glutin v0.30.4 -> v0.30.8
    Updating glutin_egl_sys v0.4.0 -> v0.5.0
    Updating gpu-alloc v0.5.3 -> v0.5.4
      Adding home v0.5.5
    Updating iana-time-zone v0.1.53 -> v0.1.56
    Updating iana-time-zone-haiku v0.1.1 -> v0.1.2
    Updating image v0.24.5 -> v0.24.6
    Updating indexmap v1.9.2 -> v1.9.3
    Updating io-lifetimes v1.0.6 -> v1.0.10
    Updating itoa v1.0.5 -> v1.0.6
    Updating jni v0.20.0 -> v0.21.1
    Updating jobserver v0.1.25 -> v0.1.26
    Updating js-sys v0.3.61 -> v0.3.63
    Updating libc v0.2.139 -> v0.2.144
    Removing link-cplusplus v1.0.8
    Removing linux-raw-sys v0.1.4
    Removing linux-raw-sys v0.3.2
      Adding linux-raw-sys v0.3.8
    Updating memmap2 v0.5.8 -> v0.5.10
      Adding miniz_oxide v0.7.1
    Updating mio v0.8.5 -> v0.8.6
    Updating naga v0.12.0 -> v0.12.1
    Removing nom8 v0.2.0
    Updating num_enum v0.5.9 -> v0.5.11
    Updating num_enum_derive v0.5.9 -> v0.5.11
    Updating objc2 v0.3.0-beta.3 -> v0.3.0-beta.3.patch-leaks.3
    Updating once_cell v1.17.0 -> v1.17.1
    Updating orbclient v0.3.42 -> v0.3.45
    Updating ordered-stream v0.1.4 -> v0.2.0
    Updating os_str_bytes v6.4.1 -> v6.5.0
    Updating owned_ttf_parser v0.18.1 -> v0.19.0
    Updating parking v2.0.0 -> v2.1.0
    Updating paste v1.0.11 -> v1.0.12
    Updating pkg-config v0.3.26 -> v0.3.27
    Updating plist v1.4.0 -> v1.4.3
    Updating png v0.17.7 -> v0.17.8
    Updating polling v2.5.2 -> v2.8.0
      Adding prettyplease v0.2.5
    Updating proc-macro-crate v1.3.0 -> v1.3.1
    Updating proc-macro2 v1.0.56 -> v1.0.58
    Updating profiling v1.0.7 -> v1.0.8
    Updating puffin v0.14.2 -> v0.14.3
    Updating quick-xml v0.26.0 -> v0.28.2
    Updating quote v1.0.26 -> v1.0.27
    Updating range-alloc v0.1.2 -> v0.1.3
    Updating redox_syscall v0.3.4 -> v0.3.5
    Updating regex v1.7.1 -> v1.8.2
    Removing regex-syntax v0.6.28
      Adding regex-syntax v0.6.29
      Adding regex-syntax v0.7.2
    Updating rfd v0.11.0 -> v0.11.4
    Updating rgb v0.8.35 -> v0.8.36
    Updating rustc-demangle v0.1.21 -> v0.1.23
    Removing rustix v0.36.9
    Removing rustix v0.37.3
      Adding rustix v0.37.19
    Updating ruzstd v0.3.0 -> v0.3.1
    Updating ryu v1.0.12 -> v1.0.13
    Removing scratch v1.0.3
    Updating sctk-adwaita v0.5.3 -> v0.5.4
    Updating serde v1.0.152 -> v1.0.163
    Updating serde_derive v1.0.152 -> v1.0.163
    Updating serde_json v1.0.92 -> v1.0.96
    Updating serde_repr v0.1.10 -> v0.1.12
      Adding serde_spanned v0.6.2
      Adding simd-adler32 v0.3.5
    Updating slab v0.4.7 -> v0.4.8
    Updating socket2 v0.4.7 -> v0.4.9
    Removing syn v1.0.107
    Removing syn v2.0.15
      Adding syn v1.0.109
      Adding syn v2.0.16
    Updating system-deps v6.0.3 -> v6.1.0
      Adding target-lexicon v0.12.7
    Updating tempfile v3.4.0 -> v3.5.0
    Updating thiserror v1.0.38 -> v1.0.40
    Updating thiserror-impl v1.0.38 -> v1.0.40
    Updating time v0.3.17 -> v0.3.21
    Updating time-core v0.1.0 -> v0.1.1
    Updating time-macros v0.2.6 -> v0.2.9
    Updating tiny-skia v0.8.3 -> v0.8.4
    Updating tiny-skia-path v0.8.3 -> v0.8.4
    Updating toml v0.5.11 -> v0.7.4
    Updating toml_datetime v0.5.1 -> v0.6.2
    Updating toml_edit v0.18.1 -> v0.19.9
    Updating tracing-attributes v0.1.23 -> v0.1.24
    Updating tracing-core v0.1.30 -> v0.1.31
    Updating ttf-parser v0.18.1 -> v0.19.0
    Updating tts v0.25.0 -> v0.25.5
    Updating unicode-bidi v0.3.10 -> v0.3.13
    Updating unicode-ident v1.0.6 -> v1.0.8
    Updating walkdir v2.3.2 -> v2.3.3
    Updating wasm-bindgen-futures v0.4.34 -> v0.4.36
    Updating web-sys v0.3.61 -> v0.3.63
    Updating webbrowser v0.8.7 -> v0.8.10
    Removing wepoll-ffi v0.1.2
    Updating windows v0.43.0 -> v0.48.0
    Removing windows-sys v0.42.0
    Updating windows-targets v0.42.1 -> v0.42.2
    Updating windows_aarch64_gnullvm v0.42.1 -> v0.42.2
    Updating windows_aarch64_msvc v0.42.1 -> v0.42.2
    Updating windows_i686_gnu v0.42.1 -> v0.42.2
    Updating windows_i686_msvc v0.42.1 -> v0.42.2
    Updating windows_x86_64_gnu v0.42.1 -> v0.42.2
    Updating windows_x86_64_gnullvm v0.42.1 -> v0.42.2
    Updating windows_x86_64_msvc v0.42.1 -> v0.42.2
    Updating winit v0.28.1 -> v0.28.6
      Adding winnow v0.4.6
    Updating xml-rs v0.8.4 -> v0.8.13
    Updating zbus v3.9.0 -> v3.10.0
    Updating zbus_macros v3.9.0 -> v3.10.0
    Updating zbus_names v2.5.0 -> v2.5.1
    Updating zstd-sys v2.0.6+zstd.1.5.2 -> v2.0.8+zstd.1.5.5
    Updating zvariant v3.10.0 -> v3.14.0
    Updating zvariant_derive v3.10.0 -> v3.14.0
      Adding zvariant_utils v1.0.1

* Downgrade flate2 and png to avoid duplicated deps

* downgrade plist to avoid duplication of base64 crate

* Allow license `Apache-2.0 WITH LLVM-exception`

* Update to puffin 0.15
2023-05-23 09:25:39 +02:00
Emil Ernerfeldt b758e9dbf0
Update accesskit to 0.11 (#3012)
* Update accesskit to 0.11

* Add instructions on how to test the web viewer to CONTRIBUTING.md

Also removed dependency on `jq`

Closes https://github.com/emilk/egui/issues/2859
2023-05-22 19:20:58 +02:00
Jinlei Li 09e1569bf3
Enable egui-winit to support wasm target (#2949) 2023-04-24 09:16:50 +02:00
Ryan Hileman ede3ded977
egui-winit: Use RawDisplayHandle for smithay clipboard init (#2914) 2023-04-19 09:14:23 +02:00
Emil Ernerfeldt 9c9a54ce36
Replace `tracing` with `log` (#2928)
* Replace tracing crate with log

It's just so much simpler to use

* Add `bacon wasm` job

* eframe: add a WebLogger for piping log events to the web console
2023-04-18 21:11:26 +02:00
Robert Bragg 89e42884fc
Remove android-activity dependency + add activity features (#2863)
Instead of depending on android-activity directly, this exposes the
android-native-activity and android-game-activity features from Winit.

This ensures that applications can choose what android-backend they use
while also relying on Winit to decide what version of android-activity to
use - without increasing the risk of a version conflict by having a direct
dependency.

_(NB: Egui doesn't currently use the android-activity API itself)_

Since android-activity provides the `android_main()` entry point for
Android applications it's not possible to link in multiple version of
the android-activity crate and so it's particularly important to
avoid unnecessary direct dependencies that could cause a version
conflict in the future.

To help avoid the need for applications to directly depend on
android-activity the Winit crate re-exports the android-activity API
and exposes features to configure the backend so that application crates
can instead rely on Winit to pull in a compatible version of
android-activity. (This way version bumps for android-activity only
need to be synchronized with the Winit crate).

CI now enables the `android-native-activity` feature for testing.

Fixes: #2829
Fixes: #2720
Closes: #2834
2023-04-18 15:40:30 +02:00
Emil Ernerfeldt 5cdbce04a8
Update to accesskit 0.10.1 (#2855)
* Update to accesskit 0.10.1

* Add helper script to run cargo deny
2023-03-30 10:23:54 +02:00
Gabriel Féron 24eccca8e6
Only enable instant/wasm-bindgen when building for wasm32 architecture (#2808) 2023-03-29 14:59:45 +02:00