Struct cognitive_frames::Frame
[−]
[src]
pub struct Frame { /* fields omitted */ }
Frame main data structure.
Methods
impl Frame
[src]
Public constructors and destructor.
fn new(
sid: SurfaceId,
geometry: Geometry,
mobility: Mobility,
mode: Mode,
pos: Position,
size: Size,
title: String
) -> Self
sid: SurfaceId,
geometry: Geometry,
mobility: Mobility,
mode: Mode,
pos: Position,
size: Size,
title: String
) -> Self
Creates new generic frame.
fn new_root() -> Self
Creates new root frame.
fn new_display(id: i32, area: Area, title: String) -> Self
Creates new display frame.
fn new_workspace(title: String, geometry: Geometry, active: bool) -> Self
Creates new workspace frame.
fn new_container(geometry: Geometry) -> Self
Creates new container frame.
fn new_leaf(sid: SurfaceId, geometry: Geometry) -> Self
Creates new leaf frame.
fn destroy(&self)
Destroys frame recursively and deallocate memory.
impl Frame
[src]
Getting iterators.
fn time_iter(&self) -> FrameTimeIterator
Gets iterator over children in time order.
fn time_rev_iter(&self) -> FrameTimeReveresedIterator
Gets iterator over children in time reversed order.
fn space_iter(&self) -> FrameSpaceIterator
Gets iterator over children in space order.
fn space_rev_iter(&self) -> FrameSpaceReveresedIterator
Gets iterator over children in space reversed order.
impl Frame
[src]
Public getters for frame internals.
fn get_sid(&self) -> SurfaceId
Gets ID of assigned surface.
fn get_mode(&self) -> Mode
Gets mode.
fn get_geometry(&self) -> Geometry
Gets geometry.
fn get_mobility(&self) -> Mobility
Gets mobility.
fn get_position(&self) -> Position
Gets position.
fn get_size(&self) -> Size
Gets size.
fn get_area(&self) -> Area
Gets area.
fn get_title(&self) -> String
Gets title.
fn is_top(&self) -> bool
Check if frame is spacial and should be ignored while normal surface management.
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.
fn is_reorientable(&self) -> bool
Check if it should be possible to reorient or resize contents of frame.
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.
impl Frame
[src]
Public setters for frame internals.
fn set_plumbing_sid(&mut self, sid: SurfaceId)
Sets surface id without informing other parts of application.
fn set_plumbing_position(&mut self, pos: Position)
Sets size without informing other parts of application.
fn set_plumbing_size(&mut self, size: Size)
Sets size without informing other parts of application.
fn set_plumbing_geometry(&mut self, geometry: Geometry)
Sets geometry without adjusting any sizes an positions.
fn set_plumbing_mobility(&mut self, mobility: Mobility)
Sets mobility without any checks.
fn set_plumbing_mode(&mut self, mode: Mode)
Sets mode without any checks.
fn set_plumbing_position_and_size(&mut self, pos: Position, size: Size)
Sets position and size without informing other parts of application.
impl Frame
[src]
Public getters for neighbouring frames.
fn has_parent(&self) -> bool
Checks if frame has parent.
fn has_children(&self) -> bool
Checks if frame has children.
fn get_parent(&self) -> Option<Frame>
Optionally returns frames parent.
fn get_first_time(&self) -> Option<Frame>
Optionally returns child first in time order.
fn get_last_time(&self) -> Option<Frame>
Optionally returns child last in time order.
fn get_prev_time(&self) -> Option<Frame>
Optionally returns sibling previous in time order.
fn get_next_time(&self) -> Option<Frame>
Optionally returns sibling next in time order.
fn get_first_space(&self) -> Option<Frame>
Optionally returns child first in space order.
fn get_last_space(&self) -> Option<Frame>
Optionally returns child last in space order.
fn get_prev_space(&self) -> Option<Frame>
Optionally returns sibling previous in space order.
fn get_next_space(&self) -> Option<Frame>
Optionally returns sibling next in space order.
impl Frame
[src]
Public manipulators. Allow to change order relations between frames.
fn prepend(&mut self, frame: &mut Frame)
Prepends in spatial order and appends in time order given frame to self children.
fn append(&mut self, frame: &mut Frame)
Appends in spatial order and appends in time order given frame to self children.
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.
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.
fn pop(&mut self)
Make given frame first in time order of all its siblings. Spatial order is untouched.
fn remove(&mut self)
Remove given frame from its parent children.
impl Frame
[src]
Miscellaneous other methods.
fn equals_exact(&self, other: &Frame) -> bool
Compares frame internals for check if frames are not only same but the same.
fn count_children(&self) -> usize
Counts children and returns their number.
fn count_anchored_children(&self) -> usize
Counts anchored children and returns their number.
fn calculate_global_position(&self) -> Position
Calculates global position of the frame.
Trait Implementations
impl Clone for Frame
[src]
fn clone(&self) -> Frame
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Frame
[src]
impl Converting for Frame
[src]
fn to_array(
&self,
relative_position: Position,
listing: &SurfaceListing
) -> Vec<SurfaceContext>
&self,
relative_position: Position,
listing: &SurfaceListing
) -> Vec<SurfaceContext>
Converts frame three to list of SurfaceContext
suitable for drawing by renderer.
fn to_workspace_state(&self) -> WorkspaceState
Converts frame tree to structure describing state of workspaces.
impl Packing for Frame
[src]
fn relax(&mut self, sa: &mut SurfaceAccess)
TODO: Implement relaxing. Currently relaxing is equivalent to homogenizing.
fn homogenize(&mut self, sa: &mut SurfaceAccess)
Make all subsurfaces have the same size and proper layout. Homogenizing works only on directed frames. Read more
fn change_size(&mut self, vector: Vector, sa: &mut SurfaceAccess)
Set size of the frame and resize its subframe accordingly.
fn set_size(&mut self, size: Size, sa: &mut SurfaceAccess)
Set size of the frame and resize its subframe accordingly.
fn remove_self(&mut self, sa: &mut SurfaceAccess)
Remove given frame and relax old parent.
impl Searching for Frame
[src]
fn find(&self, matcher: &Fn(&Frame) -> bool) -> Option<Frame>
Returns first found frame upon which matcher
returned true
.
fn find_buildable(&self) -> Option<Frame>
Finds first frame suitable for building. Returns self
if self
has no surface ID set, its parent otherwise. Read more
fn find_top(&self) -> Option<Frame>
Finds first trunk which is Workspace
.
fn find_with_sid(&self, sid: SurfaceId) -> Option<Frame>
Finds frame with given surface ID.
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
. Read more
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
. Read more
fn find_contiguous(&self, direction: Direction, distance: u32) -> Option<Frame>
Finds top-most frame bordering with frame self
in given direction.
fn find_adjacent(&self, direction: Direction, distance: u32) -> Option<Frame>
Find find bottom-most frame bordering with frame self
in given direction.
impl Settling for Frame
[src]
fn settle(
&mut self,
target: &mut Frame,
area: Option<Area>,
sa: &mut SurfaceAccess
)
&mut self,
target: &mut Frame,
area: Option<Area>,
sa: &mut SurfaceAccess
)
Settle self in buildable of target and relax it. Read more
fn resettle(
&mut self,
target: &mut Frame,
position: Option<Position>,
sa: &mut SurfaceAccess
)
&mut self,
target: &mut Frame,
position: Option<Position>,
sa: &mut SurfaceAccess
)
Remove given frame, relax old parent and settle the frame on given target. Read more
fn pop_recursively(&mut self, pop: &mut Frame)
Pop the surface pop
and its parents inside surface self
. Read more
fn change_geometry(&mut self, geometry: Geometry, sa: &mut SurfaceAccess)
Changes frames geometry and resizes all subframe accordingly.
fn ramify(&mut self, geometry: Geometry) -> Frame
Adds another container into given place in frame layout if needed. Read more
fn deramify(&mut self)
Removes unnecessary layers of container frames containing only one container or leaf frame.
fn jumpin(&mut self, side: Side, target: &mut Frame, sa: &mut SurfaceAccess)
Places frame self
on given side
of target
frame.
fn jump(&mut self, side: Side, target: &mut Frame, sa: &mut SurfaceAccess)
Removes frame self
from frame layout and then places it using jumpin
method.
fn dock(&mut self, target: &mut Frame, size: Size, sa: &mut SurfaceAccess)
Places frame self
in target
frame as dock.
fn anchorize(&mut self, sa: &mut SurfaceAccess)
Anchorizes floating frame.
fn deanchorize(&mut self, area: Area, sa: &mut SurfaceAccess)
Deanchorizes frame. Floating frame must be attached to workspace so it will be resettled if necessary. Read more
fn resize(
&mut self,
direction: Direction,
magnitude: isize,
sa: &mut SurfaceAccess
)
&mut self,
direction: Direction,
magnitude: isize,
sa: &mut SurfaceAccess
)
Resize the frame. direction
indicates the border which will be moved and magnitude
is move distance in pixels. Read more
fn move_with_contents(&mut self, vector: Vector)
Move the frame and all subframes by given vector.
fn destroy_self(&mut self, sa: &mut SurfaceAccess)
Removes frame self
, relaxes old parent and destroys the frame.