Struct fake_dpi::FakeDpiWindow

source ·
pub struct FakeDpiWindow<W> {
    pub inner: W,
    pub dpi: f64,
}
Expand description

Wraps a window to simulate Hi-DPI screen.

Fields§

§inner: W

The inner window.

§dpi: f64

Controls DPI factor.

This can be changed at run-time to test application logic. By default, this is set to 2.0.

Trait Implementations§

source§

impl<W: AdvancedWindow> AdvancedWindow for FakeDpiWindow<W>

source§

fn get_title(&self) -> String

Gets a copy of the title of the window.
source§

fn set_title(&mut self, val: String)

Sets the title of the window.
source§

fn get_exit_on_esc(&self) -> bool

Gets whether to exit when pressing esc. Read more
source§

fn set_exit_on_esc(&mut self, val: bool)

Sets whether to exit when pressing esc. Read more
source§

fn get_automatic_close(&self) -> bool

Gets whether the window will automatically close when attempting to close it. Read more
source§

fn set_automatic_close(&mut self, val: bool)

Sets whether the window will automatically close when attempting to close it. If this is disabled, attempts to close the window can be detected via an Input::Close(..) event, and Window::set_should_close() can be called to actually close the window. Read more
source§

fn set_capture_cursor(&mut self, val: bool)

Sets whether to capture/grab the cursor. Read more
source§

fn show(&mut self)

Shows the window. Read more
source§

fn hide(&mut self)

Hides the window. Read more
source§

fn get_position(&self) -> Option<Position>

Gets the position of window.
source§

fn set_position<P: Into<Position>>(&mut self, val: P)

Sets the position of window. Read more
source§

fn set_size<S: Into<Size>>(&mut self, val: S)

Sets the window size. Read more
source§

fn title(self, value: String) -> Self

Sets title on window. Read more
source§

fn exit_on_esc(self, value: bool) -> Self

Sets whether to exit when pressing the Esc button. Read more
source§

fn automatic_close(self, value: bool) -> Self

Sets whether the window will automatically close when attempting to close it. If this is disabled, attempts to close the window can be detected via an Input::Close(..) event, and Window::set_should_close() can be called to actually close the window. Read more
source§

fn capture_cursor(self, value: bool) -> Self

Sets whether to capture/grab the cursor. Read more
source§

fn position<P>(self, val: P) -> Selfwhere P: Into<Position>,

Sets the position of window. Read more
source§

impl<W: BuildFromWindowSettings> BuildFromWindowSettings for FakeDpiWindow<W>

source§

fn build_from_window_settings( settings: &WindowSettings ) -> Result<Self, Box<dyn Error + 'static>>

Builds the window from a WindowSettings object. Read more
source§

impl<W: Window> Window for FakeDpiWindow<W>

source§

fn set_should_close(&mut self, val: bool)

Tells the window to close or stay open.
source§

fn should_close(&self) -> bool

Returns true if the window should close.
source§

fn size(&self) -> Size

Gets the size of the window.
source§

fn swap_buffers(&mut self)

Swaps render buffers. Read more
source§

fn wait_event(&mut self) -> Event

Wait indefinitely for an input event to be available from the window.
source§

fn wait_event_timeout(&mut self, val: Duration) -> Option<Event>

Wait for an input event to be available from the window or for the specified timeout to be reached. Read more
source§

fn poll_event(&mut self) -> Option<Event>

Polls an input event from the window. Read more
source§

fn draw_size(&self) -> Size

Gets the draw size of the window. Read more

Auto Trait Implementations§

§

impl<W> RefUnwindSafe for FakeDpiWindow<W>where W: RefUnwindSafe,

§

impl<W> Send for FakeDpiWindow<W>where W: Send,

§

impl<W> Sync for FakeDpiWindow<W>where W: Sync,

§

impl<W> Unpin for FakeDpiWindow<W>where W: Unpin,

§

impl<W> UnwindSafe for FakeDpiWindow<W>where W: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.