pub struct WindowManager {
pub windows: Vec<Window>,
pub dirty: bool,
pub terminal_focused: bool,
pub active_workspace: u8,
pub slide_out: bool,
pub alt_hold_mode: bool,
pub alt_input_buffer: String,
pub dirty_rects: Vec<Rect>,
last_mouse_x: i32,
last_mouse_y: i32,
last_mouse_btn: bool,
}Fields§
§windows: Vec<Window>§dirty: bool§terminal_focused: bool§active_workspace: u8§slide_out: bool§alt_hold_mode: bool§alt_input_buffer: String§dirty_rects: Vec<Rect>§last_mouse_x: i32§last_mouse_y: i32§last_mouse_btn: boolImplementations§
Source§impl WindowManager
impl WindowManager
pub fn new() -> Self
pub fn add_dirty_rect(&mut self, rect: Rect)
pub fn clear_dirty_rects(&mut self)
pub fn get_dirty_bounding_box( &self, screen_w: u32, screen_h: u32, ) -> Option<Rect>
pub fn add_window(&mut self, win: Window)
pub fn remove_active_window(&mut self)
Sourcepub fn activate_window(&mut self, idx: usize)
pub fn activate_window(&mut self, idx: usize)
指定したインデックス of ウィンドウを最前面に移動してアクティブにする
Sourcepub fn any_window_covers_rect(&self, x0: i32, y0: i32, x1: i32, y1: i32) -> bool
pub fn any_window_covers_rect(&self, x0: i32, y0: i32, x1: i32, y1: i32) -> bool
全画面(背景の上にウィンドウ)を描画 (合成ウィンドウマネージャ方式) 指定矩形 (スクリーン座標) を、可視ウィンドウ (アクティブ WS・非最小化) が 少しでも覆っているかを返す。
システムモニタのような「背景レイヤー」要素を部分再描画してよいかの判定に使う。 背景要素はウィンドウより下の z 順にあるため、ウィンドウが覆っている領域へ 単独で描画すると z 順を破ってウィンドウを突き破ってしまう。それを防ぐ。
pub fn draw_all(&mut self, screen: &Screen)
Sourcepub fn handle_mouse(
&mut self,
mx: i32,
my: i32,
btn_left: bool,
btn_right: bool,
wheel: i32,
screen: &Screen,
) -> bool
pub fn handle_mouse( &mut self, mx: i32, my: i32, btn_left: bool, btn_right: bool, wheel: i32, screen: &Screen, ) -> bool
マウスイベント処理。Zオーダー順(手前から)判定する。
Sourcepub fn handle_key(
&mut self,
keycode: u8,
pressed: bool,
ascii: Option<char>,
alt_pressed: bool,
screen: &Screen,
) -> bool
pub fn handle_key( &mut self, keycode: u8, pressed: bool, ascii: Option<char>, alt_pressed: bool, screen: &Screen, ) -> bool
キーボードイベントの処理(ファンクションキーおよびアクティブウィンドウ宛て)
Sourcepub fn needs_timer_redraw(&self) -> bool
pub fn needs_timer_redraw(&self) -> bool
何らかのアクティブなウィンドウがタイマー再描画を要求しているか
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WindowManager
impl !Send for WindowManager
impl !Sync for WindowManager
impl !UnwindSafe for WindowManager
impl Freeze for WindowManager
impl Unpin for WindowManager
impl UnsafeUnpin for WindowManager
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