Clean up unused code: Remove unused imports, static variables, functions, and fields
This commit is contained in:
+3
-64
@@ -668,19 +668,6 @@ mod windows {
|
||||
}
|
||||
}
|
||||
|
||||
// Main set_cursor function - now uses the separate functions
|
||||
pub fn set_cursor(path: &Path) -> bool {
|
||||
// First, ensure system cursor is hidden (only happens once)
|
||||
if !unsafe { CURSOR_HIDDEN } {
|
||||
if !hide_system_cursor() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Then update the cursor image
|
||||
update_cursor_image(path)
|
||||
}
|
||||
|
||||
// Function to restore the cursor when the program exits
|
||||
pub fn restore_cursor() {
|
||||
println!("Explicit restore_cursor called");
|
||||
@@ -836,14 +823,6 @@ mod macos {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn set_cursor(_path: &Path) -> bool {
|
||||
// macOS cursor implementation would go here
|
||||
// This is a placeholder - actual implementation would require
|
||||
// Objective-C/Cocoa bindings to NSCursor
|
||||
println!("macOS cursor swapping not yet implemented");
|
||||
false
|
||||
}
|
||||
|
||||
pub fn restore_cursor() {
|
||||
// Placeholder for restoring cursor on macOS
|
||||
println!("macOS cursor restoration not yet implemented");
|
||||
@@ -874,14 +853,6 @@ mod linux {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn set_cursor(_path: &Path) -> bool {
|
||||
// Linux cursor implementation would go here
|
||||
// This is a placeholder - actual implementation would require
|
||||
// X11 or Wayland bindings
|
||||
println!("Linux cursor swapping not yet implemented");
|
||||
false
|
||||
}
|
||||
|
||||
pub fn restore_cursor() {
|
||||
// Placeholder for restoring cursor on Linux
|
||||
println!("Linux cursor restoration not yet implemented");
|
||||
@@ -893,41 +864,15 @@ mod linux {
|
||||
}
|
||||
}
|
||||
|
||||
// Windows-specific function to hide a window - DEPRECATED
|
||||
// We now use iced's window::change_mode instead for cross-platform compatibility
|
||||
#[cfg(windows)]
|
||||
pub fn hide_window() {
|
||||
println!("WARNING: platform::hide_window is deprecated. Use iced::window::change_mode instead.");
|
||||
}
|
||||
|
||||
// Windows-specific function to show a window - DEPRECATED
|
||||
// We now use iced's window::change_mode instead for cross-platform compatibility
|
||||
#[cfg(windows)]
|
||||
pub fn show_window() {
|
||||
println!("WARNING: platform::show_window is deprecated. Use iced::window::change_mode instead.");
|
||||
}
|
||||
|
||||
// Placeholder for non-Windows platforms - DEPRECATED
|
||||
#[cfg(not(windows))]
|
||||
pub fn hide_window() {
|
||||
println!("WARNING: platform::hide_window is deprecated. Use iced::window::change_mode instead.");
|
||||
}
|
||||
|
||||
// Placeholder for non-Windows platforms - DEPRECATED
|
||||
#[cfg(not(windows))]
|
||||
pub fn show_window() {
|
||||
println!("WARNING: platform::show_window is deprecated. Use iced::window::change_mode instead.");
|
||||
}
|
||||
|
||||
// Export the appropriate implementation based on platform
|
||||
#[cfg(windows)]
|
||||
pub use windows::{set_cursor, restore_cursor, render_cursor, hide_system_cursor, update_cursor_image};
|
||||
pub use windows::{restore_cursor, render_cursor, hide_system_cursor, update_cursor_image};
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub use macos::{set_cursor, restore_cursor, render_cursor, hide_system_cursor, update_cursor_image};
|
||||
pub use macos::{restore_cursor, render_cursor, hide_system_cursor, update_cursor_image};
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
pub use linux::{set_cursor, restore_cursor, render_cursor, hide_system_cursor, update_cursor_image};
|
||||
pub use linux::{restore_cursor, render_cursor, hide_system_cursor, update_cursor_image};
|
||||
|
||||
// Default implementation for other platforms
|
||||
#[cfg(not(any(windows, target_os = "macos", target_os = "linux")))]
|
||||
@@ -942,12 +887,6 @@ pub fn update_cursor_image(_path: &Path) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
#[cfg(not(any(windows, target_os = "macos", target_os = "linux")))]
|
||||
pub fn set_cursor(_path: &Path) -> bool {
|
||||
println!("Cursor swapping not supported on this platform");
|
||||
false
|
||||
}
|
||||
|
||||
#[cfg(not(any(windows, target_os = "macos", target_os = "linux")))]
|
||||
pub fn restore_cursor() {
|
||||
println!("Cursor restoration not supported on this platform");
|
||||
|
||||
Reference in New Issue
Block a user