Struct rustwlc::handle::WlcView [] [src]

pub struct WlcView(_);

Represents a handle to a wlc view.

Methods

impl WlcView
[src]

fn as_output(self) -> WlcOutput

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) -> WlcView

Create a dummy WlcView for testing purposes.

Unsafety

The following methods on views may crash the program:

  • WlcView::focus if wlc is not running
  • WlcView::send_to_back if wlc is not running
  • WlcView::send_below if wlc is not running
  • WlcView::bring_above if wlc is not running
  • WlcView::bring_to_font if wlc is not running

All other methods can be used on dummy views.

Note

WlcView::root() is equivalent to WlcView::dummy(0).

assert!(WlcView::root() == unsafe { WlcView::dummy(0) })

Example

unsafe {
    let view = WlcView::dummy(0u32);
    let view2 = WlcView::dummy(1u32);
    assert!(view < view2);
    assert!(view != view2);
}

fn root() -> WlcView

Returns a reference to the root window (desktop background).

Example

let view = WlcView::root();
assert!(view.is_root());

fn is_root(self) -> bool

Whether this view is the root window (desktop background).

Example

let view = WlcView::root();
assert!(view.is_root());

fn is_window(self) -> bool

Whether this view is not the root window (desktop background).

Usage

A convenience method, the opposite of view.is_root().

Example

let view = WlcView::root();
assert!(view.is_root());
assert!(!view.is_window());

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 close(self)

Closes this view.

For the main windows of most programs, this should close the program where applicable.

Behavior

This function will not do anything if view.is_root().

fn get_output(self) -> WlcOutput

Gets the WlcOutput this view is currently part of.

fn set_output(self, output: WlcOutput)

Sets the output that the view renders on.

This may not be supported by wlc at this time.

fn focus(self)

Brings this view to focus.

Can be called on WlcView::root() to lose all focus.

fn send_to_back(self)

Sends the view to the back of the compositor

fn send_below(self, other: WlcView)

Sends this view underneath another.

fn bring_above(self, other: WlcView)

Brings this view above another.

fn bring_to_front(self)

Brings this view to the front of the stack within its WlcOutput.

fn get_mask(self) -> u32

Gets the current visibilty bitmask for the view.

fn set_mask(self, mask: u32)

Sets the visibilty bitmask for the view.

fn get_geometry(self) -> Option<Geometry>

Gets the geometry of the view.

fn get_visible_geometry(self) -> Geometry

Gets the geometry of the view (that wlc displays).

fn set_geometry(self, edges: ResizeEdge, geometry: Geometry)

Sets the geometry of the view.

Set edges if geometry is caused by interactive resize.

fn get_type(self) -> ViewType

Gets the type bitfield of the curent view

fn set_type(self, view_type: ViewType, toggle: bool)

Set flag in the type field. Toggle indicates whether it is set.

fn get_state(self) -> ViewState

Get the current ViewState bitfield.

fn set_state(self, state: ViewState, toggle: bool)

Set ViewState bit. Toggle indicates whether it is set or not.

fn get_parent(self) -> WlcView

Gets parent view, returns WlcView::root() if this view has no parent.

fn set_parent(self, parent: &WlcView)

Set the parent of this view.

Call with WlcView::root() to make its parent the root window.

fn get_title(self) -> String

Get the title of the view

fn get_class(self) -> String

Get class (shell surface only).

fn get_app_id(self) -> String

Get app id (xdg-surface only).

Trait Implementations

impl Hash for WlcView
[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 WlcView
[src]

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

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

impl PartialOrd for WlcView
[src]

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

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

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

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

fn le(&self, __arg_0: &WlcView) -> 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: &WlcView) -> bool

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

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

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

impl Eq for WlcView
[src]

impl PartialEq for WlcView
[src]

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

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

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

This method tests for !=.

impl Clone for WlcView
[src]

fn clone(&self) -> WlcView

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 WlcView
[src]

impl Debug for WlcView
[src]

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

Formats the value using the given formatter.

impl From<WlcOutput> for WlcView
[src]

fn from(output: WlcOutput) -> Self

Performs the conversion.