refactor(animation): rename animation mod to engine

Linter was upset about this:
> error: module has the same name as its containing module
This commit is contained in:
thearturca
2024-11-10 12:03:25 +03:00
parent 44189d8382
commit e502cb3ffb
5 changed files with 12 additions and 12 deletions

View File

@@ -14,9 +14,9 @@ use super::ANIMATION_FPS;
use super::ANIMATION_MANAGER; use super::ANIMATION_MANAGER;
#[derive(Debug, Default, Clone, Copy, Serialize, Deserialize, JsonSchema, PartialEq)] #[derive(Debug, Default, Clone, Copy, Serialize, Deserialize, JsonSchema, PartialEq)]
pub struct Animation; pub struct AnimationEngine;
impl Animation { impl AnimationEngine {
pub fn wait_for_all_animations() { pub fn wait_for_all_animations() {
let max_duration = Duration::from_secs(20); let max_duration = Duration::from_secs(20);
let spent_duration = Instant::now(); let spent_duration = Instant::now();

View File

@@ -8,9 +8,9 @@ use std::sync::Arc;
use parking_lot::Mutex; use parking_lot::Mutex;
pub mod animation; pub use engine::AnimationEngine;
pub use animation::Animation;
pub mod animation_manager; pub mod animation_manager;
pub mod engine;
pub mod lerp; pub mod lerp;
pub mod prefix; pub mod prefix;
pub mod render_dispatcher; pub mod render_dispatcher;

View File

@@ -17,7 +17,7 @@ use std::time::Duration;
use clap::Parser; use clap::Parser;
use color_eyre::Result; use color_eyre::Result;
use crossbeam_utils::Backoff; use crossbeam_utils::Backoff;
use komorebi::animation::Animation; use komorebi::animation::AnimationEngine;
use komorebi::animation::ANIMATION_ENABLED; use komorebi::animation::ANIMATION_ENABLED;
#[cfg(feature = "deadlock_detection")] #[cfg(feature = "deadlock_detection")]
use parking_lot::deadlock; use parking_lot::deadlock;
@@ -291,7 +291,7 @@ fn main() -> Result<()> {
ANIMATION_ENABLED.store(false, Ordering::SeqCst); ANIMATION_ENABLED.store(false, Ordering::SeqCst);
wm.lock().restore_all_windows()?; wm.lock().restore_all_windows()?;
Animation::wait_for_all_animations(); AnimationEngine::wait_for_all_animations();
if WindowsApi::focus_follows_mouse()? { if WindowsApi::focus_follows_mouse()? {
WindowsApi::disable_focus_follows_mouse()?; WindowsApi::disable_focus_follows_mouse()?;

View File

@@ -22,7 +22,7 @@ use schemars::gen::SchemaSettings;
use schemars::schema_for; use schemars::schema_for;
use uds_windows::UnixStream; use uds_windows::UnixStream;
use crate::animation::Animation; use crate::animation::AnimationEngine;
use crate::core::config_generation::ApplicationConfiguration; use crate::core::config_generation::ApplicationConfiguration;
use crate::core::config_generation::IdWithIdentifier; use crate::core::config_generation::IdWithIdentifier;
use crate::core::config_generation::MatchingRule; use crate::core::config_generation::MatchingRule;
@@ -880,7 +880,7 @@ impl WindowManager {
ANIMATION_ENABLED.store(false, Ordering::SeqCst); ANIMATION_ENABLED.store(false, Ordering::SeqCst);
self.restore_all_windows()?; self.restore_all_windows()?;
Animation::wait_for_all_animations(); AnimationEngine::wait_for_all_animations();
if WindowsApi::focus_follows_mouse()? { if WindowsApi::focus_follows_mouse()? {
WindowsApi::disable_focus_follows_mouse()?; WindowsApi::disable_focus_follows_mouse()?;

View File

@@ -1,6 +1,7 @@
use crate::animation::lerp::Lerp; use crate::animation::lerp::Lerp;
use crate::animation::prefix::new_animation_key; use crate::animation::prefix::new_animation_key;
use crate::animation::prefix::AnimationPrefix; use crate::animation::prefix::AnimationPrefix;
use crate::animation::AnimationEngine;
use crate::animation::RenderDispatcher; use crate::animation::RenderDispatcher;
use crate::animation::ANIMATION_DURATION; use crate::animation::ANIMATION_DURATION;
use crate::animation::ANIMATION_ENABLED; use crate::animation::ANIMATION_ENABLED;
@@ -41,7 +42,6 @@ use crate::core::ApplicationIdentifier;
use crate::core::HidingBehaviour; use crate::core::HidingBehaviour;
use crate::core::Rect; use crate::core::Rect;
use crate::animation::animation::Animation;
use crate::styles::ExtendedWindowStyle; use crate::styles::ExtendedWindowStyle;
use crate::styles::WindowStyle; use crate::styles::WindowStyle;
use crate::transparency_manager; use crate::transparency_manager;
@@ -353,7 +353,7 @@ impl Window {
let render_dispatcher = let render_dispatcher =
WindowMoveRenderDispatcher::new(self.hwnd, window_rect, *layout, top, style); WindowMoveRenderDispatcher::new(self.hwnd, window_rect, *layout, top, style);
Animation::animate(render_dispatcher, duration) AnimationEngine::animate(render_dispatcher, duration)
} else { } else {
WindowsApi::position_window(self.hwnd, layout, top) WindowsApi::position_window(self.hwnd, layout, top)
} }
@@ -474,7 +474,7 @@ impl Window {
style, style,
); );
Animation::animate(render_dispatcher, duration) AnimationEngine::animate(render_dispatcher, duration)
} else { } else {
let mut ex_style = self.ex_style()?; let mut ex_style = self.ex_style()?;
ex_style.insert(ExtendedWindowStyle::LAYERED); ex_style.insert(ExtendedWindowStyle::LAYERED);
@@ -500,7 +500,7 @@ impl Window {
style, style,
); );
Animation::animate(render_dispatcher, duration) AnimationEngine::animate(render_dispatcher, duration)
} else { } else {
let mut ex_style = self.ex_style()?; let mut ex_style = self.ex_style()?;
ex_style.remove(ExtendedWindowStyle::LAYERED); ex_style.remove(ExtendedWindowStyle::LAYERED);