class QueryVersion(rq.ReplyRequest): _request = rq.Struct(rq.Card8('opcode'), rq.Opcode(0), rq.RequestLength(), rq.Card32('major_version'), rq.Card32('minor_version'), ) _reply = rq.Struct(rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Card32('major_version'), rq.Card32('minor_version'), rq.Pad(16), )
class ListOutputProperties(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(10), rq.RequestLength(), rq.Card32('output'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('atoms', 2), rq.Pad(22), rq.List('atoms', rq.Card32Obj), )
class GetFontPath(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(52), rq.Pad(1), rq.RequestLength(), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('paths', 2), rq.Pad(22), rq.List('paths', rq.Str), )
class GetSelectionOwner(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(23), rq.Pad(1), rq.RequestLength(), rq.Card32('selection') ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Window('owner', (X.NONE,)), rq.Pad(20), )
class ListHosts(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(110), rq.Pad(1), rq.RequestLength(), ) _reply = rq.Struct( rq.ReplyCode(), rq.Card8('mode'), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('hosts', 2), rq.Pad(22), rq.List('hosts', structs.Host), )
class QueryPictIndexValues(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(2), rq.RequestLength(), PictFormat('format'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('indexvalues', 4), rq.Pad(20), rq.List('indexvalues', IndexValue), )
class _CreateMode(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(16), rq.RequestLength(), rq.Window('window'), rq.Object('mode', randr.RandR_ModeInfo), rq.String8('name'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Card32('mode'), rq.Pad(20), )
class ListProperties(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(21), rq.Pad(1), rq.RequestLength(), rq.Window('window') ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('atoms', 2), rq.Pad(22), rq.List('atoms', rq.Card32Obj), )
class GetAtomName(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(17), rq.Pad(1), rq.RequestLength(), rq.Card32('atom') ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('name', 2), rq.Pad(22), rq.String8('name'), )
class ListInstalledColormaps(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(83), rq.Pad(1), rq.RequestLength(), rq.Window('window') ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('cmaps', 2), rq.Pad(22), rq.List('cmaps', rq.ColormapObj), )
class GraphicsExpose(rq.Event): _code = X.GraphicsExpose _fields = rq.Struct( rq.Card8('type'), rq.Pad(1), rq.Card16('sequence_number'), rq.Drawable('drawable'), rq.Card16('x'), rq.Card16('y'), rq.Card16('width'), rq.Card16('height'), rq.Card16('minor_event'), rq.Card16('count'), rq.Card8('major_event'), rq.Pad(11), )
class GetCrtcGamma(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(23), rq.RequestLength(), rq.Card32('crtc'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Card8('status'), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf(('red', 'green', 'blue'), 2), rq.Pad(22), rq.List('red', rq.Card16Obj), rq.List('green', rq.Card16Obj), rq.List('blue', rq.Card16Obj), )
class InternAtom(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(16), rq.Bool('only_if_exists'), rq.RequestLength(), rq.LengthOf('name', 2), rq.Pad(2), rq.String8('name'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Card32('atom'), rq.Pad(20), )
class XIQueryDevice(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(48), rq.RequestLength(), DEVICEID('deviceid'), rq.Pad(2), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('devices', 2), rq.Pad(22), rq.List('devices', DeviceInfo), )
class GetKeyboardMapping(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(101), rq.Pad(1), rq.RequestLength(), rq.Card8('first_keycode'), rq.Card8('count'), rq.Pad(2), ) _reply = rq.Struct( rq.ReplyCode(), rq.Format('keysyms', 1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Pad(24), rq.KeyboardMapping('keysyms'), )
class QueryColors(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(91), rq.Pad(1), rq.RequestLength(), rq.Colormap('cmap'), rq.List('pixels', rq.Card32Obj), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('colors', 2), rq.Pad(22), rq.List('colors', structs.RGB), )
class XIListProperties(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(56), rq.RequestLength(), DEVICEID('deviceid'), rq.Pad(2), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('atoms', 2), rq.Pad(22), rq.List('atoms', rq.Card32Obj), )
class QueryFilters(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(29), rq.RequestLength(), rq.Drawable('drawable'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.LengthOf('aliases', 4), rq.LengthOf('filters', 4), rq.Pad(4), rq.List('aliases', rq.Card16), rq.List('filters', rq.Str), )
class RecolorCursor(rq.Request): _request = rq.Struct( rq.Opcode(96), rq.Pad(1), rq.RequestLength(), rq.Cursor('cursor'), rq.Card16('fore_red'), rq.Card16('fore_green'), rq.Card16('fore_blue'), rq.Card16('back_red'), rq.Card16('back_green'), rq.Card16('back_blue'), )
class EnableContext(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(5), rq.RequestLength(), rq.Card32('context')) # Record_RC _reply = rq.Struct( rq.Pad(1), rq.Card8('category'), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Card8('element_header'), # Record_Element_Header rq.Bool('client_swapped'), rq.Pad(2), rq.Card32('id_base'), # Record_XIDBase rq.Card32('server_time'), rq.Card32('recorded_sequence_number'), rq.Pad(8), RawField('data')) # This request receives multiple responses, so we need to keep # ourselves in the 'sent_requests' list in order to receive them all. # See the discussion on ListFonstsWithInfo in request.py def __init__(self, callback, *args, **keys): self._callback = callback rq.ReplyRequest.__init__(self, *args, **keys) def _parse_response(self, data): r, d = self._reply.parse_binary(data, self._display) self._callback(r) if r.category == StartOfData: # Hack ourselves a sequence number, used by the code in # Xlib.protocol.display.Display.parse_request_response() self.sequence_number = r.sequence_number if r.category == EndOfData: self._response_lock.acquire() self._data = r self._response_lock.release() else: self._display.sent_requests.insert(0, self)
class ScreenChangeNotify(rq.Event): _code = None _fields = rq.Struct( rq.Card8('type'), rq.Card8('rotation'), rq.Card16('sequence_number'), rq.Card32('timestamp'), rq.Card32('config_timestamp'), rq.Window('root'), rq.Window('window'), rq.Card16('size_id'), rq.Card16('subpixel_order'), rq.Card16('width_in_pixels'), rq.Card16('height_in_pixels'), rq.Card16('width_in_millimeters'), rq.Card16('height_in_millimeters'), )
class GrabKeyboard(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(31), rq.Bool('owner_events'), rq.RequestLength(), rq.Window('grab_window'), rq.Card32('time'), rq.Set('pointer_mode', 1, (X.GrabModeSync, X.GrabModeAsync)), rq.Set('keyboard_mode', 1, (X.GrabModeSync, X.GrabModeAsync)), rq.Pad(2), ) _reply = rq.Struct( rq.ReplyCode(), rq.Card8('status'), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Pad(24), )
class QueryTree(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(15), rq.Pad(1), rq.RequestLength(), rq.Window('window') ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Window('root'), rq.Window('parent', (X.NONE, )), rq.LengthOf('children', 2), rq.Pad(14), rq.List('children', rq.WindowObj), )
class XIGetProperty(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(59), rq.RequestLength(), DEVICEID('deviceid'), rq.Card8('delete'), rq.Pad(1), rq.Card32('property'), rq.Card32('type'), rq.Card32('offset'), rq.Card32('length'), ) _reply = rq.Struct(rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Card32('type'), rq.Card32('bytes_after'), rq.LengthOf('value', 4), rq.Format('value', 1), rq.Pad(11), rq.PropertyData('value'))
class QueryOutputProperty(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(11), rq.RequestLength(), rq.Card32('output'), rq.Card32('property'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Bool('pending'), rq.Bool('range'), rq.Bool('immutable'), rq.Pad(21), rq.List('valid_values', rq.Card32Obj), )
class ScreenSaverQueryInfo(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(1), rq.RequestLength(), rq.Drawable('drawable'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Card8('state'), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Window('saver_window'), rq.Card32('saver_time'), rq.Card32('idle_time'), rq.Card32('events'), rq.Card8('kind'), rq.Pad(7), # spec said 10 but only 7 works )
class GetMotionEvents(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(39), rq.Pad(1), rq.RequestLength(), rq.Window('window'), rq.Card32('start'), rq.Card32('stop'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('events', 4), rq.Pad(20), rq.List('events', structs.TimeCoord), )
class GetScreenSize(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(3), rq.RequestLength(), rq.Window('window'), rq.Card32('screen'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.Card32('length'), rq.Card32('width'), rq.Card32('height'), rq.Window('window'), rq.Card32('screen'), rq.Pad(8), )
class GetRectangles(rq.ReplyRequest): _request = rq.Struct( rq.Card8('opcode'), rq.Opcode(8), rq.RequestLength(), rq.Window('window'), rq.Set('region', 1, (ShapeBounding, ShapeClip)), rq.Pad(3), ) _reply = rq.Struct( rq.ReplyCode(), rq.Card8('ordering'), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('rectangles', 4), rq.Pad(20), rq.List('rectangles', structs.Rectangle), )
class Expose(rq.Event): _code = X.Expose _fields = rq.Struct( rq.Card8('type'), rq.Pad(1), rq.Card16('sequence_number'), rq.Window('window'), rq.Card16('x'), rq.Card16('y'), rq.Card16('width'), rq.Card16('height'), rq.Card16('count'), rq.Pad(14), )