#[repr(C)]pub struct WlcOutput(pub uintptr_t);Expand description
Represents a handle to a wlc output.
Tuple Fields§
§0: uintptr_tImplementations§
Source§impl WlcOutput
impl WlcOutput
Sourcepub fn as_view(self) -> WlcView
pub fn as_view(self) -> WlcView
Compatability/debugging function.
wlc internally stores views and outputs under the same type. If for some reason a conversion between the two was required, this function could be called. If this is the case please submit a bug report.
Sourcepub fn dummy(code: u32) -> WlcOutput
pub fn dummy(code: u32) -> WlcOutput
Create a dummy WlcOutput for testing purposes.
§Unsafety
The following operations on a dummy WlcOutput will cause crashes:
WlcOutput::focusedwhen wlc is not runningWlcOutput::listwhen wlc is not runningWlcOutput::set_resolutionon a dummy output
In addition, WlcOutput::set_views will return an error.
All other methods can be used on dummy outputs.
§Example
let output = WlcOutput::dummy(0u32);
let output2 = WlcOutput::dummy(1u32);
assert!(output < output2);
assert!(output != output2);Sourcepub unsafe fn get_user_data<T>(&self) -> &mut T
pub unsafe fn get_user_data<T>(&self) -> &mut T
Gets user-specified data.
§Unsafety
The wlc implementation of this method uses void* pointers
for raw C data. This function will internaly do a conversion
between the input T and a libc::c_void.
This is a highly unsafe conversion with no guarantees. As such, usage of these functions requires an understanding of what data they will have. Please review wlc’s usage of these functions before attempting to use them yourself.
Sourcepub unsafe fn set_user_data<T>(&self, data: &T)
pub unsafe fn set_user_data<T>(&self, data: &T)
Sets user-specified data.
§Unsafety
The wlc implementation of this method uses void* pointers
for raw C data. This function will internaly do a conversion
between the input T and a libc::c_void.
This is a highly unsafe conversion with no guarantees. As such, usage of these functions requires an understanding of what data they will have. Please review wlc’s usage of these functions before attempting to use them yourself.
Sourcepub fn schedule_render(&self)
pub fn schedule_render(&self)
Schedules output for rendering next frame.
If the output was already scheduled, this is a no-op; if output is currently rendering, it will render immediately after.
Sourcepub fn list() -> Vec<WlcOutput>
pub fn list() -> Vec<WlcOutput>
Gets a list of the current outputs.
§Safety
This function will crash the program if run when wlc is not running.
Sourcepub fn focused() -> WlcOutput
pub fn focused() -> WlcOutput
Gets the currently focused output.
§Safety
This function will crash the program if run when wlc is not running.
Sourcepub fn get_name(&self) -> String
pub fn get_name(&self) -> String
Gets the name of the WlcOutput.
Names are usually assigned in the format WLC-n, where the first output is WLC-1.
Sourcepub fn get_sleep(&self) -> bool
pub fn get_sleep(&self) -> bool
Gets the sleep status of the output.
Returns true if the monitor is sleeping,
such as having been set with set_sleep.
Sourcepub fn get_resolution(&self) -> Option<Size>
pub fn get_resolution(&self) -> Option<Size>
Gets the output resolution in pixels.
Sourcepub fn set_resolution(&self, size: Size, scaling: u32)
pub fn set_resolution(&self, size: Size, scaling: u32)
Sets the resolution of the output.
§Safety
This method will crash the program if use when wlc is not running.
Sourcepub fn get_views(&self) -> Vec<WlcView>
pub fn get_views(&self) -> Vec<WlcView>
Get views in stack order.
This is mainly useful for wm’s who need another view stack for inplace sorting.
For example tiling wms, may want to use this to keep their tiling order separated
from floating order.
This handles wlc_output_get_views and wlc_output_get_mutable_views.
Sourcepub fn get_mutable_views(&self) -> Vec<WlcView>
pub fn get_mutable_views(&self) -> Vec<WlcView>
§Deprecated
This function is equivalent to simply calling get_views