pub struct Window {
pub has_frame: bool,
pub scale_factor: f64,
pub requested_redraw: bool,
window: Window,
title: String,
is_x11: bool,
current_mouse_cursor: CursorIcon,
mouse_visible: bool,
}
Expand description
A window which can be used for displaying the terminal.
Wraps the underlying windowing library to provide a stable API in Alacritty.
Fields§
§has_frame: bool
Flag tracking that we have a frame we can draw.
scale_factor: f64
Cached scale factor for quickly scaling pixel sizes.
requested_redraw: bool
Flag indicating whether redraw was requested.
window: Window
§title: String
Current window title.
is_x11: bool
§current_mouse_cursor: CursorIcon
§mouse_visible: bool
Implementations§
source§impl Window
impl Window
sourcepub fn new(
event_loop: &ActiveEventLoop,
config: &UiConfig,
identity: &Identity,
x11_visual: Option<X11VisualInfo>
) -> Result<Window, Error>
pub fn new( event_loop: &ActiveEventLoop, config: &UiConfig, identity: &Identity, x11_visual: Option<X11VisualInfo> ) -> Result<Window, Error>
Create a new window.
This creates a window and fully initializes a window.
pub fn raw_window_handle(&self) -> RawWindowHandle
pub fn request_inner_size(&self, size: PhysicalSize<u32>)
pub fn inner_size(&self) -> PhysicalSize<u32>
pub fn set_visible(&self, visibility: bool)
pub fn request_redraw(&mut self)
pub fn set_mouse_cursor(&mut self, cursor: CursorIcon)
sourcepub fn set_mouse_visible(&mut self, visible: bool)
pub fn set_mouse_visible(&mut self, visible: bool)
Set mouse cursor visible.
pub fn get_platform_window( identity: &Identity, window_config: &WindowConfig, x11_visual: Option<X11VisualInfo> ) -> WindowAttributes
pub fn set_urgent(&self, is_urgent: bool)
pub fn id(&self) -> WindowId
pub fn set_transparent(&self, transparent: bool)
pub fn set_blur(&self, blur: bool)
pub fn set_maximized(&self, maximized: bool)
pub fn set_minimized(&self, minimized: bool)
pub fn set_resize_increments(&self, increments: PhysicalSize<f32>)
sourcepub fn toggle_fullscreen(&self)
pub fn toggle_fullscreen(&self)
Toggle the window’s fullscreen state.
sourcepub fn toggle_maximized(&self)
pub fn toggle_maximized(&self)
Toggle the window’s maximized state.
sourcepub fn pre_present_notify(&self)
pub fn pre_present_notify(&self)
Inform windowing system about presenting to the window.
Should be called right before presenting to the window with e.g. eglSwapBuffers
.
pub fn set_theme(&self, theme: Option<Theme>)
pub fn set_fullscreen(&self, fullscreen: bool)
pub fn current_monitor(&self) -> Option<MonitorHandle>
pub fn set_ime_allowed(&self, allowed: bool)
sourcepub fn update_ime_position(&self, point: Point<usize>, size: &SizeInfo)
pub fn update_ime_position(&self, point: Point<usize>, size: &SizeInfo)
Adjust the IME editor position according to the new location of the cursor.
Auto Trait Implementations§
impl !RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl !UnwindSafe for Window
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.