From 43e1d9873fbb78584641e81ef0a42030627192ad Mon Sep 17 00:00:00 2001 From: Avii Date: Thu, 6 Aug 2026 18:07:00 +0200 Subject: [PATCH] 1786032420 --- src/trekstor.rs | 91 +++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/src/trekstor.rs b/src/trekstor.rs index 4130f74..983e2e3 100644 --- a/src/trekstor.rs +++ b/src/trekstor.rs @@ -1,13 +1,10 @@ -use std::cell::OnceCell; use std::rc::Rc; -use std::sync::Arc; -use std::sync::atomic::AtomicUsize; use evdev::KeyCode; use linfb::shape::Color; use slint::platform::software_renderer::{MinimalSoftwareWindow, RepaintBufferType, Rgb565Pixel}; -use slint::platform::{EventLoopProxy, Platform, WindowEvent}; -use slint::{EventLoopError, LogicalPosition, PhysicalSize, Rgb8Pixel, WindowSize}; +use slint::platform::{Platform, WindowEvent}; +use slint::{LogicalPosition, PhysicalSize, Rgb8Pixel, WindowSize}; use self::input::InputState; use self::screen::Screen; @@ -15,8 +12,6 @@ use self::screen::Screen; mod input; mod screen; -static EVENTLOOP_PROXY: OnceCell> = OnceCell::new(); - pub struct Context { pub screen: Screen, pub input: InputState, @@ -106,52 +101,52 @@ impl Platform for Trekstor { } } - fn new_event_loop_proxy(&self) -> Option> { - // struct Proxy( - // winit::event_loop::EventLoopProxy, - // Arc, - // ); - // impl EventLoopProxy for Proxy { - // fn quit_event_loop(&self) -> Result<(), EventLoopError> { - // Err(EventLoopError::EventLoopTerminated) - // } + // fn new_event_loop_proxy(&self) -> Option> { + // // struct Proxy( + // // winit::event_loop::EventLoopProxy, + // // Arc, + // // ); + // // impl EventLoopProxy for Proxy { + // // fn quit_event_loop(&self) -> Result<(), EventLoopError> { + // // Err(EventLoopError::EventLoopTerminated) + // // } - // fn invoke_from_event_loop( - // &self, - // event: Box, - // ) -> Result<(), EventLoopError> { - // self.0 - // .send_event(SlintEvent(CustomEvent::UserEvent(event))) - // .map_err(|_| EventLoopError::EventLoopTerminated) - // } - // } - // Some(Box::new(Proxy( - // self.shared_data.event_loop_proxy.clone(), - // Arc::clone(&self.shared_data.event_loop_generation), - // ))) - None - } + // // fn invoke_from_event_loop( + // // &self, + // // event: Box, + // // ) -> Result<(), EventLoopError> { + // // self.0 + // // .send_event(SlintEvent(CustomEvent::UserEvent(event))) + // // .map_err(|_| EventLoopError::EventLoopTerminated) + // // } + // // } + // // Some(Box::new(Proxy( + // // self.shared_data.event_loop_proxy.clone(), + // // Arc::clone(&self.shared_data.event_loop_generation), + // // ))) + // None + // } - fn click_interval(&self) -> core::time::Duration { - // 500ms is the default delay according to https://en.wikipedia.org/wiki/Double-click#Speed_and_timing - core::time::Duration::from_millis(500) - } + // fn click_interval(&self) -> core::time::Duration { + // // 500ms is the default delay according to https://en.wikipedia.org/wiki/Double-click#Speed_and_timing + // core::time::Duration::from_millis(500) + // } - fn cursor_flash_cycle(&self) -> core::time::Duration { - core::time::Duration::from_millis(1000) - } + // fn cursor_flash_cycle(&self) -> core::time::Duration { + // core::time::Duration::from_millis(1000) + // } - fn set_clipboard_text(&self, _text: &str, _clipboard: slint::platform::Clipboard) {} + // fn set_clipboard_text(&self, _text: &str, _clipboard: slint::platform::Clipboard) {} - fn clipboard_text(&self, _clipboard: slint::platform::Clipboard) -> Option { - None - } + // fn clipboard_text(&self, _clipboard: slint::platform::Clipboard) -> Option { + // None + // } - fn debug_log(&self, _arguments: core::fmt::Arguments) { - crate::debug_log::default_log_message(_arguments); - } + // fn debug_log(&self, _arguments: core::fmt::Arguments) { + // crate::debug_log::default_log_message(_arguments); + // } - fn open_url(&self, _url: &str) -> Result<(), slint::PlatformError> { - Err(slint::PlatformError::Unsupported) - } + // fn open_url(&self, _url: &str) -> Result<(), slint::PlatformError> { + // Err(slint::PlatformError::Unsupported) + // } }