ltk/platform/wayland/
mod.rsmod cursor;
pub( crate ) mod data_device;
mod handlers;
mod input;
mod output_probe;
mod overlays_reconcile;
pub( crate ) mod present;
pub( crate ) mod primary_selection;
pub( crate ) mod run;
mod session;
mod state;
mod subsurface;
mod surface;
mod text_input;
mod window;
mod window_fit;
pub( crate ) use state::WaylandPlatform;
pub( crate ) use surface::{ LayerConfig, SurfaceKind, WaylandSurfaceState };
use smithay_client_toolkit::reexports::client::protocol::wl_output::WlOutput;
use crate::app::App;
use crate::event_loop::SurfaceFocus;
use crate::event_loop::cursor_shape::ResizeEdge;
use crate::osk::Purpose;
use crate::render::Canvas;
use crate::types::CursorShape;
use super::{ Platform, Presentation };
impl<A: App> Platform for WaylandPlatform<A>
{
type Surface = WaylandSurfaceState;
type Output = WlOutput;
fn is_toplevel( &self, main: &WaylandSurfaceState ) -> bool
{
window::window( main ).is_some()
}
fn back_leaves( &self, main: &WaylandSurfaceState ) -> bool
{
self.is_toplevel( main )
}
fn begin_window_move( &self, main: &WaylandSurfaceState )
{
window::begin_move( self, main );
}
fn begin_window_resize( &self, main: &WaylandSurfaceState, edge: ResizeEdge )
{
window::begin_resize( self, main, edge );
}
fn minimize_window( &self, main: &WaylandSurfaceState )
{
if let Some( window ) = window::window( main ) { window.set_minimized(); }
}
fn set_fullscreen( &self, main: &WaylandSurfaceState, fullscreen: bool ) -> bool
{
window::set_fullscreen( main, fullscreen )
}
fn request_frame( &self, surface: &WaylandSurfaceState, focus: SurfaceFocus ) -> bool
{
window::request_frame( self, surface, focus )
}
fn precise_damage( &self, surface: &WaylandSurfaceState ) -> bool
{
self.egl_context.is_none() || surface.egl_surface.is_none()
}
fn prepare_canvas( &self, surface: &mut WaylandSurfaceState, canvas: &mut Option<Canvas>, pw: u32, ph: u32, scale: f32 ) -> bool
{
present::prepare_canvas( self, surface, canvas, pw, ph, scale )
}
fn present( &self, surface: &mut WaylandSurfaceState, canvas: &mut Canvas, frame: &Presentation<'_> ) -> bool
{
present::present( self, surface, canvas, frame )
}
fn publish_clipboard( &mut self, _text: &str )
{
data_device::publish_clipboard( self );
}
fn publish_primary_selection( &mut self, _text: &str )
{
primary_selection::publish( self );
}
fn primary_selection_pending( &self ) -> bool
{
self.primary.pending()
}
fn set_cursor_shape( &mut self, shape: CursorShape ) -> bool
{
cursor::set_shape( self, shape )
}
fn text_input_active( &self ) -> bool
{
self.text_input.is_some()
}
fn activate_text_input( &mut self, secure: bool, purpose: Purpose )
{
text_input::activate( self, secure, purpose );
}
fn deactivate_text_input( &mut self )
{
text_input::deactivate( self );
}
fn reenable_text_input( &self, secure: bool, purpose: Purpose )
{
text_input::reenable( self, secure, purpose );
}
}