Struct rustwlc::handle::WlcOutput [] [src]

pub struct WlcOutput(_);

Represents a handle to a wlc output.

Methods

impl WlcOutput
[src]

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.

unsafe fn dummy(code: u32) -> WlcOutput

Create a dummy WlcOutput for testing purposes.

Unsafety

The following operations on a dummy WlcOutput will cause crashes:

  • WlcOutput::focused when wlc is not running
  • WlcOutput::list when wlc is not running
  • WlcOutput::set_resolution on a dummy output

In addition, WlcOutput::set_views will return an error.

All other methods can be used on dummy outputs.

Example

unsafe {
    let output = WlcOutput::dummy(0u32);
    let output2 = WlcOutput::dummy(1u32);
    assert!(output < output2);
    assert!(output != output2);
}

unsafe fn get_user_data<T>(&self) -> Option<&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.

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.

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.

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.

fn focused() -> WlcOutput

Gets the currently focused output.

Safety

This function will crash the program if run when wlc is not running.

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.

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.

fn set_sleep(self, sleep: bool)

Sets the sleep status of the output.

fn get_resolution(self) -> Option<Size>

Gets the output's real resolution. Do not use for coordinate boundary.

fn get_virtual_resolution(self) -> Option<Size>

Get the virtual resolution. Helpful for getting resolution on high dpi displays. Use this to calculate coordinate boundary.

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.

fn get_scale(self) -> u32

Get the scaling for the output.

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.

fn get_mask(self) -> u32

Gets the mask of this output

fn set_mask(self, mask: u32)

Sets the mask for this output

fn get_mutable_views(self) -> Vec<WlcView>

Deprecated

This function is equivalent to simply calling get_views

fn set_views(self, views: &[WlcView]) -> Result<(), &'static str>

Attempts to set the views of a given output.

Returns success if operation succeeded. An error will be returned if something went wrong or if wlc isn't running.

fn focus(output: Option<WlcOutput>)

Focuses compositor on a specific output.

Pass in Option::None for no focus.

Trait Implementations

impl Hash for WlcOutput
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl Ord for WlcOutput
[src]

fn cmp(&self, __arg_0: &WlcOutput) -> Ordering

This method returns an Ordering between self and other. Read more

impl PartialOrd for WlcOutput
[src]

fn partial_cmp(&self, __arg_0: &WlcOutput) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, __arg_0: &WlcOutput) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, __arg_0: &WlcOutput) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, __arg_0: &WlcOutput) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, __arg_0: &WlcOutput) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Eq for WlcOutput
[src]

impl PartialEq for WlcOutput
[src]

fn eq(&self, __arg_0: &WlcOutput) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &WlcOutput) -> bool

This method tests for !=.

impl Clone for WlcOutput
[src]

fn clone(&self) -> WlcOutput

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for WlcOutput
[src]

impl Debug for WlcOutput
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl From<WlcView> for WlcOutput
[src]

fn from(view: WlcView) -> Self

Performs the conversion.