Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ApplicationHandler and matching run APIs #3517

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Conversation

kchibisov
Copy link
Member

@kchibisov kchibisov commented Feb 23, 2024

Winit is moving towards trait based end user application structure, thus add a simple ApplicationHandler trait which follows the Event<T>. To make use of this trait the new run_app group of APIs were added with the old run APIs being deprecated.

Part-of: #3432. Replaces #3386 and #3073.

  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior

@kchibisov kchibisov force-pushed the kchibisov/trait-shim branch 2 times, most recently from 3cf4bed to 71ca619 Compare February 23, 2024 13:51
@daxpedda daxpedda added the S - api Design and usability label Feb 23, 2024
@kchibisov kchibisov force-pushed the kchibisov/trait-shim branch from 71ca619 to 94fa391 Compare February 28, 2024 20:05
src/event.rs Show resolved Hide resolved
@kchibisov kchibisov force-pushed the kchibisov/trait-shim branch from 94fa391 to 4c830cb Compare March 1, 2024 09:41
@madsmtm madsmtm added this to the Version 0.30.0 milestone Mar 1, 2024
src/application.rs Outdated Show resolved Hide resolved
Copy link
Member

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nits.
Would like to change ApplicationHandler::loop_exiting() to ApplicationHandler::exiting() though!

Otherwise LGTM!

src/application.rs Outdated Show resolved Hide resolved
src/application.rs Show resolved Hide resolved
src/application.rs Outdated Show resolved Hide resolved
src/application.rs Outdated Show resolved Hide resolved
@kchibisov kchibisov force-pushed the kchibisov/trait-shim branch from 4c830cb to 33c133c Compare March 5, 2024 11:47
@kchibisov kchibisov requested a review from daxpedda March 5, 2024 11:47
Add a simple `ApplicationHandler` trait since winit is moving towards
trait based API. Add `run_app` group of APIs to accept `&mut impl
ApplicationHandler` deprecating the old `run` APIs.

Part-of: #3432
@kchibisov kchibisov force-pushed the kchibisov/trait-shim branch from 33c133c to 834f27b Compare March 5, 2024 12:07
@kchibisov kchibisov merged commit d123cd2 into master Mar 5, 2024
51 checks passed
@kchibisov kchibisov deleted the kchibisov/trait-shim branch March 5, 2024 12:13
madsmtm added a commit that referenced this pull request Mar 28, 2024
@madsmtm madsmtm mentioned this pull request Sep 1, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S - api Design and usability
Development

Successfully merging this pull request may close these issues.

4 participants