Struct wayland_client::Proxy [−][src]
pub struct Proxy<I: Interface> { /* fields omitted */ }
An handle to a wayland proxy
This represents a wayland object instanciated in your client session. Several handles to the same object can exist at a given time, and cloning them won't create a new protocol object, only clone the handle. The lifetime of the protocol object is not tied to the lifetime of these handles, but rather to sending or receiving destroying messages.
These handles are notably used to send requests to the server. To do
you need to import the associated RequestsTrait
trait from the module
of this interface.
Methods
impl<I: Interface> Proxy<I>
[src]
impl<I: Interface> Proxy<I>
pub fn send(&self, msg: I::Request)
[src]
pub fn send(&self, msg: I::Request)
Send a request through this object
This is the generic method to send requests.
Several requests require the creation of new objects using
the child()
method, which if done wrong can cause protocol
errors (in which case the server will terminate your connexion).
Thus unless your know exactly what you are doing, you should use
the helper methods provided by the various RequestsTrait
for
each interface, which handle this correctly for you.
pub fn is_alive(&self) -> bool
[src]
pub fn is_alive(&self) -> bool
Check if the object associated with this proxy is still alive
Will return false
if either:
- The object has been destroyed
- The object is not managed by this library (see the
from_c_ptr
method)
pub fn version(&self) -> u32
[src]
pub fn version(&self) -> u32
Retrieve the interface version of this wayland object instance
Returns 0 on dead objects
pub fn id(&self) -> u32
[src]
pub fn id(&self) -> u32
Retrieve the object id of this wayland object
pub fn set_user_data(&self, ptr: *mut ())
[src]
pub fn set_user_data(&self, ptr: *mut ())
Associate an arbitrary payload to this object
The pointer you associate here can be retrieved from any other proxy to the same wayland object.
Setting or getting user data is done as an atomic operation. You are responsible for the correct initialization of this pointer, synchronisation of access, and destruction of the contents at the appropriate time.
pub fn get_user_data(&self) -> *mut ()
[src]
pub fn get_user_data(&self) -> *mut ()
Retrieve the arbitrary payload associated to this object
See set_user_data
for explanations.
pub fn equals(&self, other: &Proxy<I>) -> bool
[src]
pub fn equals(&self, other: &Proxy<I>) -> bool
Check if the other proxy refers to the same underlying wayland object
pub fn child<C: Interface>(&self) -> NewProxy<C>
[src]
pub fn child<C: Interface>(&self) -> NewProxy<C>
Create a new child object
This creates a new wayland object, considered as a child of this object. It will notably inherit its interface version.
The created object should immediatly be implemented and sent in a request to the server, to keep the object list properly synchronized. Failure to do so will likely cause a protocol error.
pub fn anonymize(&self) -> Proxy<AnonymousObject>
[src]
pub fn anonymize(&self) -> Proxy<AnonymousObject>
Creates a handle of this proxy with its actual type erased
pub fn is_implemented_with<Impl>(&self) -> bool where
Impl: Implementation<Proxy<I>, I::Event> + 'static,
I::Event: MessageGroup<Map = ProxyMap>,
[src]
pub fn is_implemented_with<Impl>(&self) -> bool where
Impl: Implementation<Proxy<I>, I::Event> + 'static,
I::Event: MessageGroup<Map = ProxyMap>,
Check whether this proxy has been implemented with given type
Always returns false if the proxy is no longer alive
Trait Implementations
impl<I: Interface> Clone for Proxy<I>
[src]
impl<I: Interface> Clone for Proxy<I>
fn clone(&self) -> Proxy<I>
[src]
fn clone(&self) -> Proxy<I>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<I: Interface> PartialEq for Proxy<I>
[src]
impl<I: Interface> PartialEq for Proxy<I>
fn eq(&self, other: &Proxy<I>) -> bool
[src]
fn eq(&self, other: &Proxy<I>) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<I: Interface> Eq for Proxy<I>
[src]
impl<I: Interface> Eq for Proxy<I>
impl RequestsTrait for Proxy<WlDisplay>
[src]
impl RequestsTrait for Proxy<WlDisplay>
fn sync<F>(&self, implementor: F) -> Result<Proxy<WlCallback>, ()> where
F: FnOnce(NewProxy<WlCallback>) -> Proxy<WlCallback>,
[src]
fn sync<F>(&self, implementor: F) -> Result<Proxy<WlCallback>, ()> where
F: FnOnce(NewProxy<WlCallback>) -> Proxy<WlCallback>,
asynchronous roundtrip Read more
fn get_registry<F>(&self, implementor: F) -> Result<Proxy<WlRegistry>, ()> where
F: FnOnce(NewProxy<WlRegistry>) -> Proxy<WlRegistry>,
[src]
fn get_registry<F>(&self, implementor: F) -> Result<Proxy<WlRegistry>, ()> where
F: FnOnce(NewProxy<WlRegistry>) -> Proxy<WlRegistry>,
get global registry object Read more
impl RequestsTrait for Proxy<WlRegistry>
[src]
impl RequestsTrait for Proxy<WlRegistry>
fn bind<T: Interface, F>(
&self,
version: u32,
name: u32,
implementor: F
) -> Result<Proxy<T>, ()> where
F: FnOnce(NewProxy<T>) -> Proxy<T>,
[src]
fn bind<T: Interface, F>(
&self,
version: u32,
name: u32,
implementor: F
) -> Result<Proxy<T>, ()> where
F: FnOnce(NewProxy<T>) -> Proxy<T>,
bind an object to the display Read more
impl RequestsTrait for Proxy<WlCallback>
[src]
impl RequestsTrait for Proxy<WlCallback>
impl RequestsTrait for Proxy<WlCompositor>
[src]
impl RequestsTrait for Proxy<WlCompositor>
fn create_surface<F>(&self, implementor: F) -> Result<Proxy<WlSurface>, ()> where
F: FnOnce(NewProxy<WlSurface>) -> Proxy<WlSurface>,
[src]
fn create_surface<F>(&self, implementor: F) -> Result<Proxy<WlSurface>, ()> where
F: FnOnce(NewProxy<WlSurface>) -> Proxy<WlSurface>,
create new surface Read more
fn create_region<F>(&self, implementor: F) -> Result<Proxy<WlRegion>, ()> where
F: FnOnce(NewProxy<WlRegion>) -> Proxy<WlRegion>,
[src]
fn create_region<F>(&self, implementor: F) -> Result<Proxy<WlRegion>, ()> where
F: FnOnce(NewProxy<WlRegion>) -> Proxy<WlRegion>,
create new region Read more
impl RequestsTrait for Proxy<WlShmPool>
[src]
impl RequestsTrait for Proxy<WlShmPool>
fn create_buffer<F>(
&self,
offset: i32,
width: i32,
height: i32,
stride: i32,
format: Format,
implementor: F
) -> Result<Proxy<WlBuffer>, ()> where
F: FnOnce(NewProxy<WlBuffer>) -> Proxy<WlBuffer>,
[src]
fn create_buffer<F>(
&self,
offset: i32,
width: i32,
height: i32,
stride: i32,
format: Format,
implementor: F
) -> Result<Proxy<WlBuffer>, ()> where
F: FnOnce(NewProxy<WlBuffer>) -> Proxy<WlBuffer>,
create a buffer from the pool Read more
fn destroy(&self)
[src]
fn destroy(&self)
destroy the pool Read more
fn resize(&self, size: i32)
[src]
fn resize(&self, size: i32)
change the size of the pool mapping Read more
impl RequestsTrait for Proxy<WlShm>
[src]
impl RequestsTrait for Proxy<WlShm>
fn create_pool<F>(
&self,
fd: RawFd,
size: i32,
implementor: F
) -> Result<Proxy<WlShmPool>, ()> where
F: FnOnce(NewProxy<WlShmPool>) -> Proxy<WlShmPool>,
[src]
fn create_pool<F>(
&self,
fd: RawFd,
size: i32,
implementor: F
) -> Result<Proxy<WlShmPool>, ()> where
F: FnOnce(NewProxy<WlShmPool>) -> Proxy<WlShmPool>,
create a shm pool Read more
impl RequestsTrait for Proxy<WlBuffer>
[src]
impl RequestsTrait for Proxy<WlBuffer>
impl RequestsTrait for Proxy<WlDataOffer>
[src]
impl RequestsTrait for Proxy<WlDataOffer>
fn accept(&self, serial: u32, mime_type: Option<String>)
[src]
fn accept(&self, serial: u32, mime_type: Option<String>)
accept one of the offered mime types Read more
fn receive(&self, mime_type: String, fd: RawFd)
[src]
fn receive(&self, mime_type: String, fd: RawFd)
request that the data is transferred Read more
fn destroy(&self)
[src]
fn destroy(&self)
destroy data offer Read more
fn finish(&self)
[src]
fn finish(&self)
the offer will no longer be used Read more
fn set_actions(&self, dnd_actions: u32, preferred_action: u32)
[src]
fn set_actions(&self, dnd_actions: u32, preferred_action: u32)
set the available/preferred drag-and-drop actions Read more
impl RequestsTrait for Proxy<WlDataSource>
[src]
impl RequestsTrait for Proxy<WlDataSource>
fn offer(&self, mime_type: String)
[src]
fn offer(&self, mime_type: String)
add an offered mime type Read more
fn destroy(&self)
[src]
fn destroy(&self)
destroy the data source Read more
fn set_actions(&self, dnd_actions: u32)
[src]
fn set_actions(&self, dnd_actions: u32)
set the available drag-and-drop actions Read more
impl RequestsTrait for Proxy<WlDataDevice>
[src]
impl RequestsTrait for Proxy<WlDataDevice>
fn start_drag(
&self,
source: Option<&Proxy<WlDataSource>>,
origin: &Proxy<WlSurface>,
icon: Option<&Proxy<WlSurface>>,
serial: u32
)
[src]
fn start_drag(
&self,
source: Option<&Proxy<WlDataSource>>,
origin: &Proxy<WlSurface>,
icon: Option<&Proxy<WlSurface>>,
serial: u32
)
start drag-and-drop operation Read more
fn set_selection(&self, source: Option<&Proxy<WlDataSource>>, serial: u32)
[src]
fn set_selection(&self, source: Option<&Proxy<WlDataSource>>, serial: u32)
copy data to the selection Read more
fn release(&self)
[src]
fn release(&self)
destroy data device Read more
impl RequestsTrait for Proxy<WlDataDeviceManager>
[src]
impl RequestsTrait for Proxy<WlDataDeviceManager>
fn create_data_source<F>(
&self,
implementor: F
) -> Result<Proxy<WlDataSource>, ()> where
F: FnOnce(NewProxy<WlDataSource>) -> Proxy<WlDataSource>,
[src]
fn create_data_source<F>(
&self,
implementor: F
) -> Result<Proxy<WlDataSource>, ()> where
F: FnOnce(NewProxy<WlDataSource>) -> Proxy<WlDataSource>,
create a new data source Read more
fn get_data_device<F>(
&self,
seat: &Proxy<WlSeat>,
implementor: F
) -> Result<Proxy<WlDataDevice>, ()> where
F: FnOnce(NewProxy<WlDataDevice>) -> Proxy<WlDataDevice>,
[src]
fn get_data_device<F>(
&self,
seat: &Proxy<WlSeat>,
implementor: F
) -> Result<Proxy<WlDataDevice>, ()> where
F: FnOnce(NewProxy<WlDataDevice>) -> Proxy<WlDataDevice>,
create a new data device Read more
impl RequestsTrait for Proxy<WlShell>
[src]
impl RequestsTrait for Proxy<WlShell>
fn get_shell_surface<F>(
&self,
surface: &Proxy<WlSurface>,
implementor: F
) -> Result<Proxy<WlShellSurface>, ()> where
F: FnOnce(NewProxy<WlShellSurface>) -> Proxy<WlShellSurface>,
[src]
fn get_shell_surface<F>(
&self,
surface: &Proxy<WlSurface>,
implementor: F
) -> Result<Proxy<WlShellSurface>, ()> where
F: FnOnce(NewProxy<WlShellSurface>) -> Proxy<WlShellSurface>,
create a shell surface from a surface Read more
impl RequestsTrait for Proxy<WlShellSurface>
[src]
impl RequestsTrait for Proxy<WlShellSurface>
fn pong(&self, serial: u32)
[src]
fn pong(&self, serial: u32)
respond to a ping event Read more
fn _move(&self, seat: &Proxy<WlSeat>, serial: u32)
[src]
fn _move(&self, seat: &Proxy<WlSeat>, serial: u32)
start an interactive move Read more
fn resize(&self, seat: &Proxy<WlSeat>, serial: u32, edges: Resize)
[src]
fn resize(&self, seat: &Proxy<WlSeat>, serial: u32, edges: Resize)
start an interactive resize Read more
fn set_toplevel(&self)
[src]
fn set_toplevel(&self)
make the surface a toplevel surface Read more
fn set_transient(
&self,
parent: &Proxy<WlSurface>,
x: i32,
y: i32,
flags: Transient
)
[src]
fn set_transient(
&self,
parent: &Proxy<WlSurface>,
x: i32,
y: i32,
flags: Transient
)
make the surface a transient surface Read more
fn set_fullscreen(
&self,
method: FullscreenMethod,
framerate: u32,
output: Option<&Proxy<WlOutput>>
)
[src]
fn set_fullscreen(
&self,
method: FullscreenMethod,
framerate: u32,
output: Option<&Proxy<WlOutput>>
)
make the surface a fullscreen surface Read more
fn set_popup(
&self,
seat: &Proxy<WlSeat>,
serial: u32,
parent: &Proxy<WlSurface>,
x: i32,
y: i32,
flags: Transient
)
[src]
fn set_popup(
&self,
seat: &Proxy<WlSeat>,
serial: u32,
parent: &Proxy<WlSurface>,
x: i32,
y: i32,
flags: Transient
)
make the surface a popup surface Read more
fn set_maximized(&self, output: Option<&Proxy<WlOutput>>)
[src]
fn set_maximized(&self, output: Option<&Proxy<WlOutput>>)
make the surface a maximized surface Read more
fn set_title(&self, title: String)
[src]
fn set_title(&self, title: String)
set surface title Read more
fn set_class(&self, class_: String)
[src]
fn set_class(&self, class_: String)
set surface class Read more
impl RequestsTrait for Proxy<WlSurface>
[src]
impl RequestsTrait for Proxy<WlSurface>
fn destroy(&self)
[src]
fn destroy(&self)
delete surface Read more
fn attach(&self, buffer: Option<&Proxy<WlBuffer>>, x: i32, y: i32)
[src]
fn attach(&self, buffer: Option<&Proxy<WlBuffer>>, x: i32, y: i32)
set the surface contents Read more
fn damage(&self, x: i32, y: i32, width: i32, height: i32)
[src]
fn damage(&self, x: i32, y: i32, width: i32, height: i32)
mark part of the surface damaged Read more
fn frame<F>(&self, implementor: F) -> Result<Proxy<WlCallback>, ()> where
F: FnOnce(NewProxy<WlCallback>) -> Proxy<WlCallback>,
[src]
fn frame<F>(&self, implementor: F) -> Result<Proxy<WlCallback>, ()> where
F: FnOnce(NewProxy<WlCallback>) -> Proxy<WlCallback>,
request a frame throttling hint Read more
fn set_opaque_region(&self, region: Option<&Proxy<WlRegion>>)
[src]
fn set_opaque_region(&self, region: Option<&Proxy<WlRegion>>)
set opaque region Read more
fn set_input_region(&self, region: Option<&Proxy<WlRegion>>)
[src]
fn set_input_region(&self, region: Option<&Proxy<WlRegion>>)
set input region Read more
fn commit(&self)
[src]
fn commit(&self)
commit pending surface state Read more
fn set_buffer_transform(&self, transform: Transform)
[src]
fn set_buffer_transform(&self, transform: Transform)
sets the buffer transformation Read more
fn set_buffer_scale(&self, scale: i32)
[src]
fn set_buffer_scale(&self, scale: i32)
sets the buffer scaling factor Read more
fn damage_buffer(&self, x: i32, y: i32, width: i32, height: i32)
[src]
fn damage_buffer(&self, x: i32, y: i32, width: i32, height: i32)
mark part of the surface damaged using buffer coordinates Read more
impl RequestsTrait for Proxy<WlSeat>
[src]
impl RequestsTrait for Proxy<WlSeat>
fn get_pointer<F>(&self, implementor: F) -> Result<Proxy<WlPointer>, ()> where
F: FnOnce(NewProxy<WlPointer>) -> Proxy<WlPointer>,
[src]
fn get_pointer<F>(&self, implementor: F) -> Result<Proxy<WlPointer>, ()> where
F: FnOnce(NewProxy<WlPointer>) -> Proxy<WlPointer>,
return pointer object Read more
fn get_keyboard<F>(&self, implementor: F) -> Result<Proxy<WlKeyboard>, ()> where
F: FnOnce(NewProxy<WlKeyboard>) -> Proxy<WlKeyboard>,
[src]
fn get_keyboard<F>(&self, implementor: F) -> Result<Proxy<WlKeyboard>, ()> where
F: FnOnce(NewProxy<WlKeyboard>) -> Proxy<WlKeyboard>,
return keyboard object Read more
fn get_touch<F>(&self, implementor: F) -> Result<Proxy<WlTouch>, ()> where
F: FnOnce(NewProxy<WlTouch>) -> Proxy<WlTouch>,
[src]
fn get_touch<F>(&self, implementor: F) -> Result<Proxy<WlTouch>, ()> where
F: FnOnce(NewProxy<WlTouch>) -> Proxy<WlTouch>,
return touch object Read more
fn release(&self)
[src]
fn release(&self)
release the seat object Read more
impl RequestsTrait for Proxy<WlPointer>
[src]
impl RequestsTrait for Proxy<WlPointer>
fn set_cursor(
&self,
serial: u32,
surface: Option<&Proxy<WlSurface>>,
hotspot_x: i32,
hotspot_y: i32
)
[src]
fn set_cursor(
&self,
serial: u32,
surface: Option<&Proxy<WlSurface>>,
hotspot_x: i32,
hotspot_y: i32
)
set the pointer surface Read more
fn release(&self)
[src]
fn release(&self)
release the pointer object Read more
impl RequestsTrait for Proxy<WlKeyboard>
[src]
impl RequestsTrait for Proxy<WlKeyboard>
impl RequestsTrait for Proxy<WlTouch>
[src]
impl RequestsTrait for Proxy<WlTouch>
impl RequestsTrait for Proxy<WlOutput>
[src]
impl RequestsTrait for Proxy<WlOutput>
impl RequestsTrait for Proxy<WlRegion>
[src]
impl RequestsTrait for Proxy<WlRegion>
fn destroy(&self)
[src]
fn destroy(&self)
destroy region Read more
fn add(&self, x: i32, y: i32, width: i32, height: i32)
[src]
fn add(&self, x: i32, y: i32, width: i32, height: i32)
add rectangle to region Read more
fn subtract(&self, x: i32, y: i32, width: i32, height: i32)
[src]
fn subtract(&self, x: i32, y: i32, width: i32, height: i32)
subtract rectangle from region Read more
impl RequestsTrait for Proxy<WlSubcompositor>
[src]
impl RequestsTrait for Proxy<WlSubcompositor>
fn destroy(&self)
[src]
fn destroy(&self)
unbind from the subcompositor interface Read more
fn get_subsurface<F>(
&self,
surface: &Proxy<WlSurface>,
parent: &Proxy<WlSurface>,
implementor: F
) -> Result<Proxy<WlSubsurface>, ()> where
F: FnOnce(NewProxy<WlSubsurface>) -> Proxy<WlSubsurface>,
[src]
fn get_subsurface<F>(
&self,
surface: &Proxy<WlSurface>,
parent: &Proxy<WlSurface>,
implementor: F
) -> Result<Proxy<WlSubsurface>, ()> where
F: FnOnce(NewProxy<WlSubsurface>) -> Proxy<WlSubsurface>,
give a surface the role sub-surface Read more
impl RequestsTrait for Proxy<WlSubsurface>
[src]
impl RequestsTrait for Proxy<WlSubsurface>
fn destroy(&self)
[src]
fn destroy(&self)
remove sub-surface interface Read more
fn set_position(&self, x: i32, y: i32)
[src]
fn set_position(&self, x: i32, y: i32)
reposition the sub-surface Read more
fn place_above(&self, sibling: &Proxy<WlSurface>)
[src]
fn place_above(&self, sibling: &Proxy<WlSurface>)
restack the sub-surface Read more
fn place_below(&self, sibling: &Proxy<WlSurface>)
[src]
fn place_below(&self, sibling: &Proxy<WlSurface>)
restack the sub-surface Read more
fn set_sync(&self)
[src]
fn set_sync(&self)
set sub-surface to synchronized mode Read more
fn set_desync(&self)
[src]
fn set_desync(&self)
set sub-surface to desynchronized mode Read more