[][src]Struct pushrod_render::render::widget_config::WidgetConfig

pub struct WidgetConfig {
    pub origin: Vec<i32>,
    pub size: Vec<u32>,
    pub colors: HashMap<u8, Color>,
    pub border_width: u8,
    // some fields omitted
}

This is the store for the WidgetConfig, which each Widget object needs. This stores information about the Widget. It currently contains the point of origin, size, a HashMap of different Colors, a border width, and an invalidation flag.

Fields

origin: Vec<i32>

This Vec contains two points of origin: the physical X and Y coordinates in the Canvas.

size: Vec<u32>

This Vec contains the width and height of the object.

colors: HashMap<u8, Color>

This HashMap contains a key/value pair containing colors for the Widget.

border_width: u8

This is the border width in pixels.

Methods

impl WidgetConfig[src]

This is the implementation of the WidgetConfig.

pub fn new(x: i32, y: i32, w: u32, h: u32) -> Self[src]

Constructor - takes the X, Y, W, and H coordinates of the Widget, physically in the main Canvas.

pub fn to_x(&self, x: i32) -> i32[src]

Converts an X point to the physical X point on the Canvas plus the point of origin. Returns i32 containing the modified X coordinate. This is a convenience method for the Widget to draw based on a 0x0 point of origin.

pub fn to_y(&self, y: i32) -> i32[src]

Converts a Y point to the physical Y point on the Canvas plus the point of origin. Returns i32 containing the modified Y coordinate. This is a convenience method for the Widget to draw based on a 0x0 point of origin.

pub fn set_invalidate(&mut self, flag: bool)[src]

Sets the invalidation state of the Widget, telling the Engine that the Widget contents has changed, and must be redrawn. Setting the flag to true indicates that the Widget needs to be redrawn on the screen, false indicates that it its state has not changed, and its image can be pulled from a buffer if necessary, skipping the draw call.

pub fn invalidated(&self) -> bool[src]

Returns the invalidation state. Returns a bool containing the state.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]