//! Interact with the window of your application. use crate::core::Rectangle; use crate::core::window::Id as SurfaceId; use iced_runtime::{ self, Action, Task, platform_specific::{ self, wayland::{ self, layer_surface::{IcedMargin, SctkLayerSurfaceSettings}, }, }, task, }; pub use cctk::sctk::shell::wlr_layer::{Anchor, KeyboardInteractivity, Layer}; // TODO ASHLEY: maybe implement as builder that outputs a batched commands /// pub fn get_layer_surface( builder: SctkLayerSurfaceSettings, ) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::LayerSurface { builder }, )), )) } /// pub fn destroy_layer_surface(id: SurfaceId) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::Destroy(id), )), )) } /// pub fn set_size( id: SurfaceId, width: Option, height: Option, ) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::Size { id, width, height }, )), )) } /// pub fn set_anchor(id: SurfaceId, anchor: Anchor) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::Anchor { id, anchor }, )), )) } /// pub fn set_exclusive_zone(id: SurfaceId, zone: i32) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::ExclusiveZone { id, exclusive_zone: zone, }, )), )) } /// pub fn set_margin( id: SurfaceId, top: i32, right: i32, bottom: i32, left: i32, ) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::Margin { id, margin: IcedMargin { top, right, bottom, left, }, }, )), )) } /// pub fn set_keyboard_interactivity( id: SurfaceId, keyboard_interactivity: KeyboardInteractivity, ) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::KeyboardInteractivity { id, keyboard_interactivity, }, )), )) } /// pub fn set_layer(id: SurfaceId, layer: Layer) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::Layer { id, layer }, )), )) } pub fn set_padding( id: SurfaceId, padding: IcedMargin, ) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::Padding { id, padding }, )), )) } /// pub fn set_input_zone( id: SurfaceId, zone: Option>, ) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::InputZone { id, zone }, )), )) } pub fn set_show_on_lock( id: SurfaceId, value: bool, ) -> Task { task::effect(Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::LayerSurface( wayland::layer_surface::Action::ShowOnLock { id, value }, )), )) }