Struct rustwlc::handle::WlcView
[−]
[src]
#[repr(C)]pub struct WlcView(pub uintptr_t);
Represents a handle to a wlc view.
Methods
impl WlcView
[src]
fn as_output(self) -> WlcOutput
[src]
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
[src]
Create a dummy WlcView for testing purposes.
Unsafety
The following methods on views may crash the program:
WlcView::focus
if wlc is not runningWlcView::send_to_back
if wlc is not runningWlcView::send_below
if wlc is not runningWlcView::bring_above
if wlc is not runningWlcView::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
[src]
Returns a reference to the root window (desktop background).
Example
let view = WlcView::root(); assert!(view.is_root());
fn is_root(self) -> bool
[src]
Whether this view is the root window (desktop background).
Example
let view = WlcView::root(); assert!(view.is_root());
fn is_window(self) -> bool
[src]
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>
[src]
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)
[src]
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)
[src]
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
[src]
Gets the WlcOutput this view is currently part of.
fn set_output(self, output: WlcOutput)
[src]
Sets the output that the view renders on.
This may not be supported by wlc at this time.
fn focus(self)
[src]
Brings this view to focus.
Can be called on WlcView::root()
to lose all focus.
fn send_to_back(self)
[src]
Sends the view to the back of the compositor
fn send_below(self, other: WlcView)
[src]
Sends this view underneath another.
fn bring_above(self, other: WlcView)
[src]
Brings this view above another.
fn bring_to_front(self)
[src]
Brings this view to the front of the stack within its WlcOutput.
fn get_mask(self) -> u32
[src]
Gets the current visibilty bitmask for the view.
fn set_mask(self, mask: u32)
[src]
Sets the visibilty bitmask for the view.
fn get_geometry(self) -> Option<Geometry>
[src]
Gets the geometry of the view.
fn get_visible_geometry(self) -> Geometry
[src]
Gets the geometry of the view (that wlc displays).
fn set_geometry(self, edges: ResizeEdge, geometry: Geometry)
[src]
Sets the geometry of the view.
Set edges if geometry is caused by interactive resize.
fn get_type(self) -> ViewType
[src]
Gets the type bitfield of the curent view
fn set_type(self, view_type: ViewType, toggle: bool)
[src]
Set flag in the type field. Toggle indicates whether it is set.
fn get_state(self) -> ViewState
[src]
Get the current ViewState bitfield.
fn set_state(self, state: ViewState, toggle: bool)
[src]
Set ViewState bit. Toggle indicates whether it is set or not.
fn get_parent(self) -> WlcView
[src]
Gets parent view, returns WlcView::root()
if this view has no parent.
fn set_parent(self, parent: &WlcView)
[src]
Set the parent of this view.
Call with WlcView::root()
to make its parent the root window.
fn get_title(self) -> String
[src]
Get the title of the view
fn get_class(self) -> String
[src]
Get class (shell surface only).
fn get_app_id(self) -> String
[src]
Get app id (xdg-surface only).
fn get_pid(self) -> pid_t
[src]
Get the pid associated with this WlcView
.
Trait Implementations
impl Copy for WlcView
[src]
impl Clone for WlcView
[src]
fn clone(&self) -> WlcView
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for WlcView
[src]
fn eq(&self, __arg_0: &WlcView) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &WlcView) -> bool
[src]
This method tests for !=
.
impl Eq for WlcView
[src]
impl PartialOrd for WlcView
[src]
fn partial_cmp(&self, __arg_0: &WlcView) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &WlcView) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &WlcView) -> bool
[src]
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
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &WlcView) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for WlcView
[src]
fn cmp(&self, __arg_0: &WlcView) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for WlcView
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for WlcView
[src]
impl Display for WlcView
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more