pub struct Display {
pub name: String,
pub width: f64,
pub height: f64,
pub background: Color,
pub macros: Macros,
pub widgets: Vec<Widget>,
pub source: Option<Source>,
pub legacy: bool,
pub size: usize,
}Expand description
A parsed .bob (or translated .opi) display.
Fields§
§name: String§width: f64§height: f64§background: Color§macros: Macros§widgets: Vec<Widget>§source: Option<Source>The file or URL it was read from, used to resolve relative paths.
legacy: boolTranslated from a BOY .opi file. BOY clipped widgets to the
declared size, where Phoebus grows the display to show them.
size: usizeThe size of the file’s XML, in bytes.
Implementations§
Source§impl Display
impl Display
Sourcepub fn load(path: &Path) -> Result<Self, Error>
pub fn load(path: &Path) -> Result<Self, Error>
Read the display file at path, which may lie in an Eclipse
project’s linked folder (see project). A real BOY screen beside a
DLS launcher is taken through the launcher’s project (see
project::launcher_path), so the files it names do too; any other
display reached through a launcher’s project goes by its real path.
pub fn parse(xml: &str) -> Result<Self, Error>
Sourcepub fn resolve(&self, file: &str) -> Source
pub fn resolve(&self, file: &str) -> Source
Resolve a file named by this display (e.g. in an action) against its location.
Sourcepub fn all_widgets(&self) -> Vec<&Widget>
pub fn all_widgets(&self) -> Vec<&Widget>
Every widget, depth first.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Display
impl RefUnwindSafe for Display
impl Send for Display
impl Sync for Display
impl Unpin for Display
impl UnsafeUnpin for Display
impl UnwindSafe for Display
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