-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements Slint animation and timer (#1198)
- Loading branch information
1 parent
ea9dc26
commit 531d875
Showing
7 changed files
with
302 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::error::Error; | ||
use winit::event::StartCause; | ||
use winit::event_loop::ControlFlow; | ||
use winit::window::WindowId; | ||
|
||
/// Provides method to be called by the runtime on a certain event. | ||
/// | ||
/// The event loop will exit immediately if any method return an error. | ||
pub trait Hook { | ||
/// Note that `cause` will never be [`StartCause::Init`] since the hook is not installed at the | ||
/// time when [`StartCause::Init`] delivered. | ||
fn new_events(&mut self, cause: &StartCause) -> Result<(), Box<dyn Error + Send + Sync>>; | ||
fn pre_window_event(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>; | ||
fn window_destroyed(&mut self, id: WindowId) -> Result<(), Box<dyn Error + Send + Sync>>; | ||
fn post_window_event(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>; | ||
fn about_to_wait(&mut self) -> Result<ControlFlow, Box<dyn Error + Send + Sync>>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.