Utilities Module¶
AnonymousFile Class¶
-
class
pywayland.utils.AnonymousFile(size: int)¶ Anonymous file object
Provides access to anonymous file objects that can be used by Wayland clients to render to surfaces. Uses a method similar to Weston to open an anonymous file, so XDG_RUNTIME_DIR must be set for this to work properly.
This class provides a content manager, that is, it can be used with Python
withstatements, where the value returned is the file descriptor.-
close() → None¶ Close the anonymous file
Closes the file descriptor and sets the
fdproperty toNone. Does nothing if the file is not open.
-
open() → None¶ Open an anonymous file
Opens the anonymous file and sets the
fdproperty to the file descriptor that has been opened.
-