Skip to main content

Window

Struct Window 

Source
pub struct Window {
Show 19 fields pub x: i32, pub y: i32, pub width: u32, pub height: u32, pub title: String, pub app: Box<dyn App>, pub is_dragging: bool, pub drag_offset_x: i32, pub drag_offset_y: i32, pub buffer: Option<Vec<u32>>, pub workspace: u8, pub is_minimized: bool, pub is_fullscreen: bool, pub saved_x: i32, pub saved_y: i32, pub saved_w: u32, pub saved_h: u32, pub saved_ws: u8, pub tab_pids: Vec<Option<usize>>,
}
Expand description

画面上の1つのウィンドウを表現する

Fields§

§x: i32§y: i32§width: u32§height: u32§title: String§app: Box<dyn App>§is_dragging: bool§drag_offset_x: i32§drag_offset_y: i32§buffer: Option<Vec<u32>>§workspace: u8§is_minimized: bool§is_fullscreen: bool§saved_x: i32§saved_y: i32§saved_w: u32§saved_h: u32§saved_ws: u8§tab_pids: Vec<Option<usize>>

タブごとのバックグラウンドスレッド PID(None = スレッドなし)

Implementations§

Source§

impl Window

Source

pub fn new( x: i32, y: i32, w: u32, h: u32, title: &str, app: Box<dyn App>, ) -> Self

Source

pub fn resize(&mut self, new_w: u32, new_h: u32) -> bool

ウィンドウを new_w × new_h にリサイズする。 バッファは「容量が足りていれば再利用」し、足りない時だけ再確保する(Phase 1: churn 撲滅)。 再確保時はヒープ残量を確認し、不足ならリサイズを拒否して旧状態を保つ(Phase 2: OOM ガード)。 描画・合成は stride=width で先頭 width×height 要素のみ使うため、より大きいバッファの再利用は安全。 戻り値: リサイズに成功したか。

Source

pub fn spawn_tab_thread(&mut self, tab_idx: usize)

タブ idx にスレッドを起動してPIDを記録する

Source

pub fn clear_tab_thread(&mut self, tab_idx: usize)

タブ idx のスレッド PID スロットをクリアする (スレッド自体はアプリ側の終了フラグで自然に終了させる)

Auto Trait Implementations§

§

impl !RefUnwindSafe for Window

§

impl !Send for Window

§

impl !Sync for Window

§

impl !UnwindSafe for Window

§

impl Freeze for Window

§

impl Unpin for Window

§

impl UnsafeUnpin for Window

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.