Message Module

Message objects are used to wrap the method calls on the protocol objects. The Message objects are added to the Interface’s as either requests (client-side functions) or events (server-side functions). See Protocol Modules for more information.

class pywayland.message.Message(func, signature, types)

Wrapper class for wl_message structs

Base class that correspond to the methods defined on an interface in the wayland.xml protocol, and are generated by the scanner. Subclasses specify the type of method, whether it is a server-side or client-side method.

Parameters:
  • func (function) – The function that is represented by the message
  • signature (string) – The signature of the arguments of the message
  • types (list) – List of the types of any objects included in the argument list, None if otherwise.
arguments_to_c(*args)

Create an array of wl_argument C structs

Generate the CFFI cdata array of wl_argument structs that correspond to the arguments of the method as specified by the method signature.

Parameters:args (list) – Input arguments
Returns:cdata union wl_argument [] of args
c_to_arguments(args_ptr)

Create a list of arguments

Generate the arguments of the method from a CFFI cdata array of wl_argument structs that correspond to the arguments of the method as specified by the method signature.

Parameters:args_ptr (cdata union wl_argument []) – Input arguments
Returns:list of args