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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//! Tauri plugin for macOS 26+ Liquid Glass effect support
//!
//! This plugin provides native macOS Liquid Glass effects for Tauri applications.
//! On macOS 26 (Tahoe) and later, it uses the private NSGlassEffectView API.
//! On older macOS versions, it falls back to NSVisualEffectView.
//!
//! # Example
//!
//! ```rust,no_run
//! use tauri_plugin_liquid_glass::LiquidGlassExt;
//!
//! tauri::Builder::default()
//! .plugin(tauri_plugin_liquid_glass::init())
//! .setup(|app| {
//! // Access the plugin API via extension trait
//! let supported = app.liquid_glass().is_supported();
//! println!("Liquid Glass supported: {}", supported);
//! Ok(())
//! })
//! .run(tauri::generate_context!())
//! .expect("error while running tauri application");
//! ```
// The cocoa/objc crates are deprecated in favor of objc2, but objc2 requires
// significant architectural changes (MainThreadMarker, strict Send/Sync) without
// functional benefit. These crates remain fully functional for our use case.
use ;
pub use LiquidGlass;
pub use ;
pub use *;
// ============================================================================
// Extension Trait
// ============================================================================
/// Extension trait for accessing the Liquid Glass plugin API
///
/// This trait is implemented for all types that implement [`Manager`],
/// including [`AppHandle`](tauri::AppHandle), [`App`](tauri::App), and [`WebviewWindow`](tauri::WebviewWindow).
///
/// # Example
///
/// ```rust,no_run
/// use tauri_plugin_liquid_glass::LiquidGlassExt;
///
/// fn example(app: tauri::AppHandle, window: tauri::WebviewWindow) {
/// // Check if supported
/// let supported = app.liquid_glass().is_supported();
///
/// // Apply effect
/// app.liquid_glass().set_effect(&window, Default::default()).unwrap();
/// }
/// ```
// ============================================================================
// Plugin Initialization
// ============================================================================
/// Initialize the liquid-glass plugin
///
/// # Example
///
/// ```rust,no_run
/// use tauri_plugin_liquid_glass::LiquidGlassExt;
///
/// tauri::Builder::default()
/// .plugin(tauri_plugin_liquid_glass::init())
/// .setup(|app| {
/// // Use the extension trait to access the API
/// let supported = app.liquid_glass().is_supported();
/// Ok(())
/// })
/// .run(tauri::generate_context!())
/// .expect("error while running tauri application");
/// ```