1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! # winshift
//!
//! A cross-platform library for monitoring window focus changes.
//!
//! ## Features
//!
//! - Native window focus tracking on Linux via X11
//! - macOS support via Accessibility API (requires app tracking workaround)
//! - Windows support planned (not yet implemented)
//! - Event-driven callback system
//! - Minimal overhead window monitoring
//! - Thread-safe design
//!
//! Note: The app tracking functionality on macOS exists solely to work around
//! platform limitations for reliable window focus detection.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use winshift::{FocusChangeHandler, WindowFocusHook};
//!
//! struct MyHandler;
//!
//! impl FocusChangeHandler for MyHandler {
//! fn on_app_change(&self, pid: i32, app_name: String) {
//! println!("App changed: {} (PID: {})", app_name, pid);
//! }
//!
//! fn on_window_change(&self, window_title: String) {
//! println!("Window changed to: {}", window_title);
//! }
//! }
//!
//! fn main() -> Result<(), winshift::WinshiftError> {
//! let handler = MyHandler;
//! let hook = WindowFocusHook::new(handler);
//! hook.run()
//! }
//! ```
// Platform-specific implementations
// TODO: Windows implementation (planned to use SetWinEventHook)
pub use WinshiftError;
pub use ;
// Re-export standard log macros for convenience
pub use ;
// Re-export env_logger for examples and users
pub use env_logger;
pub use stop_hook;
pub use ;
pub const VERSION: &str = env!;