Skip to main content

WindowManager

Struct WindowManager 

Source
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: bool

Implementations§

Source§

impl WindowManager

Source

pub fn new() -> Self

Source

pub fn add_dirty_rect(&mut self, rect: Rect)

Source

pub fn clear_dirty_rects(&mut self)

Source

pub fn get_dirty_bounding_box( &self, screen_w: u32, screen_h: u32, ) -> Option<Rect>

Source

pub fn add_window(&mut self, win: Window)

Source

pub fn remove_active_window(&mut self)

Source

pub fn activate_window(&mut self, idx: usize)

指定したインデックス of ウィンドウを最前面に移動してアクティブにする

Source

pub fn any_window_covers_rect(&self, x0: i32, y0: i32, x1: i32, y1: i32) -> bool

全画面(背景の上にウィンドウ)を描画 (合成ウィンドウマネージャ方式) 指定矩形 (スクリーン座標) を、可視ウィンドウ (アクティブ WS・非最小化) が 少しでも覆っているかを返す。

システムモニタのような「背景レイヤー」要素を部分再描画してよいかの判定に使う。 背景要素はウィンドウより下の z 順にあるため、ウィンドウが覆っている領域へ 単独で描画すると z 順を破ってウィンドウを突き破ってしまう。それを防ぐ。

Source

pub fn draw_all(&mut self, screen: &Screen)

Source

pub fn handle_mouse( &mut self, mx: i32, my: i32, btn_left: bool, btn_right: bool, wheel: i32, screen: &Screen, ) -> bool

マウスイベント処理。Zオーダー順(手前から)判定する。

Source

pub fn handle_key( &mut self, keycode: u8, pressed: bool, ascii: Option<char>, alt_pressed: bool, screen: &Screen, ) -> bool

キーボードイベントの処理(ファンクションキーおよびアクティブウィンドウ宛て)

Source

pub fn needs_timer_redraw(&self) -> bool

何らかのアクティブなウィンドウがタイマー再描画を要求しているか

Trait Implementations§

Source§

impl Default for WindowManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.