Struct wlc::Output
[−]
[src]
#[repr(C)]pub struct Output;
An Output managed by Wlc
Methods
impl Output
[src]
unsafe fn all_outputs<'a>() -> &'a [Output]
Get all outputs currently active outputs
Safety
This function is unsafe, because it creates an unbound
lifetime.
No output lives forever and might be disconnected at any time
A disconnection is signaled by Callback::output_destroyed
and the
Output
is deallocated shortly after.
Because of this using this function one may create an invalid Output
reference.
Dont call this function on another thread, then the main thread
See Output::with_all_outputs
for a safe variant
fn with_all_outputs<F, R>(runner: F) -> R where
F: FnOnce(&[Output]) -> R,
F: FnOnce(&[Output]) -> R,
Safe version of Output::all_outputs
Work with all active outputs in a short-lived scope
Safety
By enforcing a rather harsh limit on the lifetime of the outputs to a short lived scope of an anonymous function, this function makes sure no output lives longer then it exists.
Dont call this function on another thread, then the main thread
unsafe fn focused_output<'a>() -> &'a Output
Get currently focused output
Safety
This function is unsafe, because it creates an unbound
lifetime.
No output lives forever and might be disconnected at any time
A disconnection is signaled by Callback::output_destroyed
and the
Output is
deallocated shortly after.
Because of this using this function one may create an invalid Output
reference.
Dont call this function on another thread, then the main thread
See Output::with_focused_output
for a safe variant
fn with_focused_output<F, R>(runner: F) -> R where
F: FnOnce(&Output) -> R,
F: FnOnce(&Output) -> R,
Safe version of Output::focused_output
Work with currently focused outputs in a short-lived scope
Safety
By enforcing a rather harsh limit on the lifetime of the output to a short lived scope of an anonymous function, this function makes sure the output does not live longer then it exists.
Dont call this function on another thread, then the main thread
fn set_no_focus()
fn name(&self) -> Cow<str>
Get output name
fn is_sleeping(&self) -> bool
Get sleep state
fn set_sleeping(&self, sleep: bool)
Wake up / send output to sleep
fn resolution(&self) -> Size
Get real resolution.
Resolution applied by either output.set_resolution
call or initially.
Do not use this for coordinate boundary.
fn virtual_resolution(&self) -> Size
Get virtual resolution.
Resolution with transformations applied for proper rendering for example on high density displays. Use this to figure out coordinate boundary.
fn set_resolution(&self, resolution: Size, scale: u32)
Set resolution
fn scale(&self) -> u32
Get scale factor
fn visibility(&self) -> Flags
Get current visibility bitmask
fn set_visibility(&self, slots: Flags)
Set visibility bitmask
fn views(&self) -> Vec<&View>
Get views in stack order
fn set_views<'a, I: IntoIterator<Item = &'a View>>(
&self,
views: I
) -> Result<(), Vec<&'a View>>
&self,
views: I
) -> Result<(), Vec<&'a View>>
Sets the view stack
fn focus(&self)
Focus output
fn gamma_size(&self) -> u16
Get the supported gamma ramp size of the Output
fn set_gamma(&self, r: &mut [u16], g: &mut [u16], b: &mut [u16])
Set gamma ramps for this Output
r
,g
and b
sizes should correspond to gamma_size
returned value
Panic
Panics if r
, g
, b
have different sizes
fn weak_reference(&self) -> WeakOutput
Get a weak reference of the Output that may outlive its referenced output
Since Output is always limited in its use by its lifetime, it is not very suitable for storing. This function allows you to optain a weak reference, that may outlive the output it is referencing.
Trait Implementations
impl !Sync for Output
[src]
impl !Send for Output
[src]
impl Debug for Output
[src]
impl PartialEq for Output
[src]
fn eq(&self, other: &Output) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Eq for Output
[src]
impl PartialEq<WeakOutput> for Output
[src]
fn eq(&self, other: &WeakOutput) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Hash for Output
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Handle for Output
[src]
fn set_user_data<T: Any>(&self, data: T)
Sets any data as user pointer consuming the data. Read more
unsafe fn user_data<T: Any>(&self) -> Option<Rc<T>>
Receive a shared reference to the user data of a given type, if user data exists. Read more
unsafe fn try_take_user_data<T: Any>(&self) -> Option<T>
Tries to take the userdata exclusively and removes it from the Handle. Read more
fn clear_user_data(&self)
Clears currently set user data (Drop
gets called, after all references are dropped). Read more