Struct Frame

Source
pub struct Frame { /* private fields */ }
Expand description

Frame main data structure.

Implementations§

Source§

impl Frame

Public constructors and destructor.

Source

pub fn new( sid: SurfaceId, geometry: Geometry, mobility: Mobility, mode: Mode, pos: Position, size: Size, title: String, ) -> Self

Creates new generic frame.

Source

pub fn new_root() -> Self

Creates new root frame.

Source

pub fn new_display(id: i32, area: Area, title: String) -> Self

Creates new display frame.

Source

pub fn new_workspace(title: String, geometry: Geometry, active: bool) -> Self

Creates new workspace frame.

Source

pub fn new_container(geometry: Geometry) -> Self

Creates new container frame.

Source

pub fn new_leaf(sid: SurfaceId, geometry: Geometry) -> Self

Creates new leaf frame.

Source

pub fn destroy(&self)

Destroys frame recursively and deallocate memory.

Source§

impl Frame

Getting iterators.

Source

pub fn time_iter(&self) -> FrameTimeIterator

Gets iterator over children in time order.

Source

pub fn time_rev_iter(&self) -> FrameTimeReveresedIterator

Gets iterator over children in time reversed order.

Source

pub fn space_iter(&self) -> FrameSpaceIterator

Gets iterator over children in space order.

Source

pub fn space_rev_iter(&self) -> FrameSpaceReveresedIterator

Gets iterator over children in space reversed order.

Source§

impl Frame

Public getters for frame internals.

Source

pub fn get_sid(&self) -> SurfaceId

Gets ID of assigned surface.

Source

pub fn get_mode(&self) -> Mode

Gets mode.

Source

pub fn get_geometry(&self) -> Geometry

Gets geometry.

Source

pub fn get_mobility(&self) -> Mobility

Gets mobility.

Source

pub fn get_position(&self) -> Position

Gets position.

Source

pub fn get_size(&self) -> Size

Gets size.

Source

pub fn get_area(&self) -> Area

Gets area.

Source

pub fn get_title(&self) -> String

Gets title.

Source

pub fn is_top(&self) -> bool

Check if frame is spacial and should be ignored while normal surface management.

Source

pub fn is_reanchorizable(&self) -> bool

Returns true if frame with this mode can be reanchorized, false otherwise.

NOTE: Display must be floating. Otherwise it could be relaxed. For the same reason workspace must be anchored.

Source

pub fn is_reorientable(&self) -> bool

Check if it should be possible to reorient or resize contents of frame.

Source

pub fn make_active(&self, active: bool)

Activates or deactivates the frame.

This method has effect only on workspaces. Not active workspace should not be drawn on screen.

Source§

impl Frame

Public setters for frame internals.

Source

pub fn set_plumbing_sid(&mut self, sid: SurfaceId)

Sets surface id without informing other parts of application.

Source

pub fn set_plumbing_position(&mut self, pos: Position)

Sets size without informing other parts of application.

Source

pub fn set_plumbing_size(&mut self, size: Size)

Sets size without informing other parts of application.

Source

pub fn set_plumbing_geometry(&mut self, geometry: Geometry)

Sets geometry without adjusting any sizes an positions.

Source

pub fn set_plumbing_mobility(&mut self, mobility: Mobility)

Sets mobility without any checks.

Source

pub fn set_plumbing_mode(&mut self, mode: Mode)

Sets mode without any checks.

Source

pub fn set_plumbing_position_and_size(&mut self, pos: Position, size: Size)

Sets position and size without informing other parts of application.

Source§

impl Frame

Public getters for neighbouring frames.

Source

pub fn has_parent(&self) -> bool

Checks if frame has parent.

Source

pub fn has_children(&self) -> bool

Checks if frame has children.

Source

pub fn get_parent(&self) -> Option<Frame>

Optionally returns frames parent.

Source

pub fn get_first_time(&self) -> Option<Frame>

Optionally returns child first in time order.

Source

pub fn get_last_time(&self) -> Option<Frame>

Optionally returns child last in time order.

Source

pub fn get_prev_time(&self) -> Option<Frame>

Optionally returns sibling previous in time order.

Source

pub fn get_next_time(&self) -> Option<Frame>

Optionally returns sibling next in time order.

Source

pub fn get_first_space(&self) -> Option<Frame>

Optionally returns child first in space order.

Source

pub fn get_last_space(&self) -> Option<Frame>

Optionally returns child last in space order.

Source

pub fn get_prev_space(&self) -> Option<Frame>

Optionally returns sibling previous in space order.

Source

pub fn get_next_space(&self) -> Option<Frame>

Optionally returns sibling next in space order.

Source§

impl Frame

Public manipulators. Allow to change order relations between frames.

Source

pub fn prepend(&mut self, frame: &mut Frame)

Prepends in spatial order and appends in time order given frame to self children.

Source

pub fn append(&mut self, frame: &mut Frame)

Appends in spatial order and appends in time order given frame to self children.

Source

pub fn prejoin(&mut self, frame: &mut Frame)

Inserts given frame as previous in spatial order sibling of self. Frame becomes last sibling in time order.

Source

pub fn adjoin(&mut self, frame: &mut Frame)

Inserts given frame as next in spatial order sibling of self. Frame becomes last sibling in time order.

Source

pub fn pop(&mut self)

Make given frame first in time order of all its siblings. Spatial order is untouched.

Source

pub fn remove(&mut self)

Remove given frame from its parent children.

Source§

impl Frame

Miscellaneous other methods.

Source

pub fn equals_exact(&self, other: &Frame) -> bool

Compares frame internals for check if frames are not only same but the same.

Source

pub fn count_children(&self) -> usize

Counts children and returns their number.

Source

pub fn count_anchored_children(&self) -> usize

Counts anchored children and returns their number.

Source

pub fn calculate_global_position(&self) -> Position

Calculates global position of the frame.

Trait Implementations§

Source§

impl Clone for Frame

Source§

fn clone(&self) -> Frame

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Converting for Frame

Source§

fn to_array( &self, relative_position: Position, listing: &dyn SurfaceListing, ) -> Vec<SurfaceContext>

Converts frame three to list of SurfaceContext suitable for drawing by renderer.
Source§

fn to_workspace_state(&self) -> WorkspaceState

Converts frame tree to structure describing state of workspaces.
Source§

impl Debug for Frame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Packing for Frame

Source§

fn relax(&mut self, sa: &mut dyn SurfaceAccess)

TODO: Implement relaxing. Currently relaxing is equivalent to homogenizing.
Source§

fn homogenize(&mut self, sa: &mut dyn SurfaceAccess)

Make all subsurfaces have the same size and proper layout. Homogenizing works only on directed frames.
Source§

fn change_size(&mut self, vector: Vector, sa: &mut dyn SurfaceAccess)

Set size of the frame and resize its subframe accordingly.
Source§

fn set_size(&mut self, size: Size, sa: &mut dyn SurfaceAccess)

Set size of the frame and resize its subframe accordingly.
Source§

fn remove_self(&mut self, sa: &mut dyn SurfaceAccess)

Remove given frame and relax old parent.
Source§

impl Searching for Frame

Source§

fn find(&self, matcher: &dyn Fn(&Frame) -> bool) -> Option<Frame>

Returns first found frame upon which matcher returned true.
Source§

fn find_buildable(&self) -> Option<Frame>

Finds first frame suitable for building. Returns self if self has no surface ID set, its parent otherwise.
Source§

fn find_top(&self) -> Option<Frame>

Finds first trunk which is Workspace.
Source§

fn find_with_sid(&self, sid: SurfaceId) -> Option<Frame>

Finds frame with given surface ID.
Source§

fn find_pointed(&self, point: Position) -> Frame

Finds leaf frame contained in frame self containing point or the closest one if point lies outside self.
Source§

fn find_neighbouring(&self, direction: Direction) -> Option<Frame>

Returns neighbour in given planar direction. If parent is not aligned in the direction or neighbour is not found returns None.
Source§

fn find_contiguous(&self, direction: Direction, distance: u32) -> Option<Frame>

Finds top-most frame bordering with frame self in given direction.
Source§

fn find_adjacent(&self, direction: Direction, distance: u32) -> Option<Frame>

Find find bottom-most frame bordering with frame self in given direction.
Source§

impl Settling for Frame

Source§

fn settle( &mut self, target: &mut Frame, area: Option<Area>, sa: &mut dyn SurfaceAccess, )

Settle self in buildable of target and relax it. Read more
Source§

fn resettle( &mut self, target: &mut Frame, position: Option<Position>, sa: &mut dyn SurfaceAccess, )

Remove given frame, relax old parent and settle the frame on given target. Read more
Source§

fn pop_recursively(&mut self, pop: &mut Frame)

Pop the surface pop and its parents inside surface self. Read more
Source§

fn change_geometry(&mut self, geometry: Geometry, sa: &mut dyn SurfaceAccess)

Changes frames geometry and resizes all subframe accordingly.
Source§

fn ramify(&mut self, geometry: Geometry) -> Frame

Adds another container into given place in frame layout if needed. Read more
Source§

fn deramify(&mut self)

Removes unnecessary layers of container frames containing only one container or leaf frame.
Source§

fn jumpin(&mut self, side: Side, target: &mut Frame, sa: &mut dyn SurfaceAccess)

Places frame self on given side of target frame.
Source§

fn jump(&mut self, side: Side, target: &mut Frame, sa: &mut dyn SurfaceAccess)

Removes frame self from frame layout and then places it using jumpin method.
Source§

fn dock(&mut self, target: &mut Frame, size: Size, sa: &mut dyn SurfaceAccess)

Places frame self in target frame as dock.
Source§

fn anchorize(&mut self, sa: &mut dyn SurfaceAccess)

Anchorizes floating frame.
Source§

fn deanchorize(&mut self, area: Area, sa: &mut dyn SurfaceAccess)

Deanchorizes frame. Floating frame must be attached to workspace so it will be resettled if necessary.
Source§

fn resize( &mut self, direction: Direction, magnitude: isize, sa: &mut dyn SurfaceAccess, )

Resize the frame. direction indicates the border which will be moved and magnitude is move distance in pixels.
Source§

fn move_with_contents(&mut self, vector: Vector)

Move the frame and all subframes by given vector.
Source§

fn destroy_self(&mut self, sa: &mut dyn SurfaceAccess)

Removes frame self, relaxes old parent and destroys the frame.

Auto Trait Implementations§

§

impl Freeze for Frame

§

impl RefUnwindSafe for Frame

§

impl !Send for Frame

§

impl !Sync for Frame

§

impl Unpin for Frame

§

impl UnwindSafe for Frame

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.