Struct Screen
pub struct Screen {
pub n: i32,
}
dep_fltk
only.Expand description
An available screen
Unlike the standalone functions, it automatically checks the provided coordinates and screen numbers are currently valid and inside boundaries.
Fields§
§n: i32
The screen number
Implementations§
§impl Screen
impl Screen
pub fn all_screens() -> Vec<Screen> ⓘ
pub fn all_screens() -> Vec<Screen> ⓘ
Returns a vector containing all the Screen
s, ordered by screen number
pub fn new(number: i32) -> Result<Screen, FltkError> ⓘ
pub fn new(number: i32) -> Result<Screen, FltkError> ⓘ
Returns the Screen
associated with the given screen number
Returns an error if the provided number
is not a valid screen number.
pub fn new_at<C>(pos: C) -> Result<Screen, FltkError> ⓘ
pub fn new_at<C>(pos: C) -> Result<Screen, FltkError> ⓘ
Returns the Screen
that contains the specified screen position
Returns an error if the provided coordinates are out of bounds.
pub fn new_inside<R>(rect: R) -> Result<Screen, FltkError> ⓘ
pub fn new_inside<R>(rect: R) -> Result<Screen, FltkError> ⓘ
Returns the Screen
which intersects the most with the provided rectangle
Returns an error if any coordinates on the provided retangle are out of bounds.
pub fn scaling_supported() -> bool
pub fn scaling_supported() -> bool
Returns true if scaling factors are supported by this platform, wether shared by all screens, or each screen having its own value
pub fn scaling_supported_separately() -> bool
pub fn scaling_supported_separately() -> bool
Returns true if each screen can have its own scaling factor value
pub fn num_at<C>(pos: C) -> Result<i32, FltkError> ⓘ
pub fn num_at<C>(pos: C) -> Result<i32, FltkError> ⓘ
Returns the screen number of the screen that contains the specified screen position coordinates
Returns an error if the provided coordinates are out of bounds.
pub fn work_area_at<C>(pos: C) -> Result<Rectangle<i32>, FltkError> ⓘ
pub fn work_area_at<C>(pos: C) -> Result<Rectangle<i32>, FltkError> ⓘ
Returns the bounding rectangle of the work area of the screen that contains the specified screen position coordinates
Returns an error if the provided coordinates are out of bounds.
pub fn work_area_mouse() -> Rectangle<i32>
pub fn work_area_mouse() -> Rectangle<i32>
Returns the bounding rectangle of the work area of the screen currently under the mouse pointer coordinates
pub fn work_area_num(number: i32) -> Result<Rectangle<i32>, FltkError> ⓘ
pub fn work_area_num(number: i32) -> Result<Rectangle<i32>, FltkError> ⓘ
Returns the bounding rectangle of the work area
with the provided screen number
Returns an error if the provided number
is not a valid screen number.
pub fn xywh_at<C>(pos: C) -> Result<Rectangle<i32>, FltkError> ⓘ
pub fn xywh_at<C>(pos: C) -> Result<Rectangle<i32>, FltkError> ⓘ
Returns the bounding rectangle of the screen that contains the specified screen position coordinates
Returns an error if the provided coordinates are out of bounds.
pub fn xywh_inside<R>(rect: R) -> Result<Rectangle<i32>, FltkError> ⓘ
pub fn xywh_inside<R>(rect: R) -> Result<Rectangle<i32>, FltkError> ⓘ
Returns the bounding rectangle of the screen that contains the specified screen position coordinates
Returns an error if the provided coordinates are out of bounds.
pub fn xywh_mouse() -> Rectangle<i32>
pub fn xywh_mouse() -> Rectangle<i32>
Gets the bounding rectangle of the screen currently under the mouse pointer coordinates
pub fn xywh_num(number: i32) -> Result<Rectangle<i32>, FltkError> ⓘ
pub fn xywh_num(number: i32) -> Result<Rectangle<i32>, FltkError> ⓘ
Returns the bounding rectangle of the screen
with the provided screen number
Returns an error if the provided number
is not a valid screen number.
pub fn keyboard_scaling(value: bool)
pub fn keyboard_scaling(value: bool)
Controls the possibility to scale all windows by ctrl/+/-/0/ or cmd/+/-/0/
This function should be called before app::open_display
runs.
If it is not called, the default is to handle these keys for window scaling.
Pass a value
of false
to stop recognition of ctrl/+/-/0/
(or cmd/+/-/0/ under macOS) keys as window scaling.
pub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Returns true
if the current screen’s number corresponds
to a currently connected screen, or false
otherwise.
pub fn dpi(&self) -> (f32, f32) ⓘ
pub fn dpi(&self) -> (f32, f32) ⓘ
Returns the current screen (vertical, horizontal) resolution in dots-per-inch
pub fn top_left(&self) -> Coordinates<i32>
pub fn top_left(&self) -> Coordinates<i32>
Returns the top-left x,y
coordinates of the current screen’s work area
pub fn bottom_right(&self) -> Coordinates<i32>
pub fn bottom_right(&self) -> Coordinates<i32>
Returns the bottom-right x+w, y+h
coordinates of the current screen’s work area
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Screen
impl RefUnwindSafe for Screen
impl Send for Screen
impl Sync for Screen
impl Unpin for Screen
impl UnwindSafe for Screen
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
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId
of Self
using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more