Interface Module

Interface Class

Interface objects are only created as a subclass of Interface. The Interface class wraps the protocol objects, and serves to initialize a set of parameters for the Interface and provide decorators for defining Message objects on the interface. See Protocol Modules for more on the Wayland protocol objects.

class pywayland.interface.Interface

Wrapper class for wl_wayland structs

Base class for interfaces that are defined by the wayland.xml class and generated by the scanner. Sub-classes should use the InterfaceMeta metaclass, which will define subclass.events and subclass.requests, the lists of the methods on this interface. These class variables are populated by the Interface.event() and Interface.request() decorators.

classmethod event(signature, types)

Decorator for interface events

Adds the decorated method to the list of events of the interface (server-side method).

Parameters:
  • signature (string) – Encodes the types of the arguments to the decorated function.
  • types (list) – List of the types of any objects included in the argument list, None if otherwise.
global_class

alias of InterfaceGlobal

classmethod request(signature, types)

Decorator for interface requests

Adds the decorated method to the list of requests of the interface (client-side method).

Parameters:
  • signature (string) – Encodes the types of the arguments to the decorated function.
  • types (list) – List of the types of any objects included in the argument list, None if otherwise.
resource_class

alias of InterfaceResource

Interface Metaclass

This metaclass initializes lists for the requests and events on an interface and initializes a cdata struct for the class.

class pywayland.interface.InterfaceMeta(name, bases, dct)

Metaclass for Interfaces

Initializes empty lists for events and requests for the given class.