/usr/lib/python3/dist-packages/xcffib/xtest.py is in python3-xcffib 0.5.1-1build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | import xcffib
import struct
import six
MAJOR_VERSION = 2
MINOR_VERSION = 2
key = xcffib.ExtensionKey("XTEST")
_events = {}
_errors = {}
from . import xproto
class GetVersionReply(xcffib.Reply):
def __init__(self, unpacker):
if isinstance(unpacker, xcffib.Protobj):
unpacker = xcffib.MemoryUnpacker(unpacker.pack())
xcffib.Reply.__init__(self, unpacker)
base = unpacker.offset
self.major_version, self.minor_version = unpacker.unpack("xB2x4xH")
self.bufsize = unpacker.offset - base
class GetVersionCookie(xcffib.Cookie):
reply_type = GetVersionReply
class Cursor:
_None = 0
Current = 1
class CompareCursorReply(xcffib.Reply):
def __init__(self, unpacker):
if isinstance(unpacker, xcffib.Protobj):
unpacker = xcffib.MemoryUnpacker(unpacker.pack())
xcffib.Reply.__init__(self, unpacker)
base = unpacker.offset
self.same, = unpacker.unpack("xB2x4x")
self.bufsize = unpacker.offset - base
class CompareCursorCookie(xcffib.Cookie):
reply_type = CompareCursorReply
class xtestExtension(xcffib.Extension):
def GetVersion(self, major_version, minor_version, is_checked=True):
buf = six.BytesIO()
buf.write(struct.pack("=xx2xBxH", major_version, minor_version))
return self.send_request(0, buf, GetVersionCookie, is_checked=is_checked)
def CompareCursor(self, window, cursor, is_checked=True):
buf = six.BytesIO()
buf.write(struct.pack("=xx2xII", window, cursor))
return self.send_request(1, buf, CompareCursorCookie, is_checked=is_checked)
def FakeInput(self, type, detail, time, root, rootX, rootY, deviceid, is_checked=False):
buf = six.BytesIO()
buf.write(struct.pack("=xx2xBB2xII8xhh7xB", type, detail, time, root, rootX, rootY, deviceid))
return self.send_request(2, buf, is_checked=is_checked)
def GrabControl(self, impervious, is_checked=False):
buf = six.BytesIO()
buf.write(struct.pack("=xx2xB3x", impervious))
return self.send_request(3, buf, is_checked=is_checked)
xcffib._add_ext(key, xtestExtension, _events, _errors)
|