WL::Connection - Estabilitsh connection for Wayland protocol
use WL::Connection; # Connect to Wayland server (compositor) my $conn = new WL::Connection; # Obtain the display object singleton my $display = $conn->get_display (); ... $conn->loop ();
WL::Connection takes care of estabilishing and tearing down a Wayland protocol connection, marshalling and demarshalling the messages and event processing. Moreover it bootstraps the WL::wl_display singleton that is essential for further communication via Wayland protocol.
Please consider this an alpha quality code, whose API can change at any time, until we reach version 1.0.
Estabilish the connection. The display socket address is determined using
WAYLAND_DISPLAYenvironment variables, falling back to
- send DATA [FILE]
Send a request. The data is aready marshalled message from a WL::Base subclass and the optional second argument is a file handle to be sent as anciliary data alongside the message.
This should only be used by
send_requestcalled from WL::Base subclasses, not directly.
- recv LENGTH
Read an event, returning the data and optionally a file handle, if a file descriptor is obtained from anciliary data.
This should only be used from
process_event, not directly.
- send_request ID OPCODE PAYLOAD [FILE]
Add message heading with id, opcode and length to already marshalled payload and send it, optionally with an open file handle as anciliary data.
Read a message, decode the header and call a
callbackmethod (inherited from WL::Base) of its recipient with raw message body and optional file handle.
Create and return a WL::wl_display singleton object.
- round_trip DISPLAY
synccall for the display object and wait for
As Wayland ensures the calls are processed in order, this creates a barrier in message stream.
Process the events until the connection tears down.
Tear down the connection.
http://wayland.freedesktop.org/ -- Wayland project web site
WL::Base -- Base class for Wayland objects
Copyright 2013 Lubomir Rintel
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.