WL::Base - Base class for Wayland objects
# Obtain an object instance my $display = $conn->get_display (); # Attach callbacks for events $display->{'WL::wl_display::error'} = sub { my ($self, $object, $code, $message) = @_; die $message; }; # Issue a request my $registry = $display->get_registry (); # Rebless to attach event handlers bless $registry, 'MyRegistry'; package MyRegistry; use base qw/WL::wl_registry/; # Implementation of an event handler sub global { my ($self, $id, $class, $version) = @_; warn "Object $id is of class $class version $version"; }
WL::Base is a base class for Wayland protocol objects. It provides support routines for common Wayland object actions and helper routines. It should not be used directly.
Please consider this an alpha quality code, whose API can change at any time, until we reach version 1.0.
Create a new object instance. This should not be used directly, as WL::Connection creates objects whenever needed.
First argument is the WL::Connection instance while second, optional is the object number. It only makes sense for remote objects, local objects get their number allocated automatically.
Send a request. The payload is already serialized request body without opcode and size part.
Optional file is an open file handle that would get passed with the request as anciliary data.
If an attempt was made to call a method that does not exist (this happend upon event receipt), autoloader dispatches to a function reference if a property named like the event exists.
This makes it possible to attach event handlers without subclassing (it is still possible to implement event handlers in subclasses though).
This is a helper routine that serializes a Perl numeric value to a Wayland 24.8 fixed format number.
This is a helper routine that deserializes a Wayland 24.8 fixed format number to a Perl numeric value.
http://wayland.freedesktop.org/ -- Wayland project web site
WL::Connection -- Estabilish a Wayland connection
Copyright 2013 Lubomir Rintel
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Lubomir Rintel lkundrak@v3.sk
lkundrak@v3.sk
To install WL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WL
CPAN shell
perl -MCPAN -e shell install WL
For more information on module installation, please visit the detailed CPAN module installation guide.