class AllocColorPlanes(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(87), rq.Bool('contiguous'), rq.RequestLength(), rq.Colormap('cmap'), rq.Card16('colors'), rq.Card16('red'), rq.Card16('green'), rq.Card16('blue'), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.LengthOf('pixels', 2), rq.Pad(2), rq.Card32('red_mask'), rq.Card32('green_mask'), rq.Card32('blue_mask'), rq.Pad(8), rq.List('pixels', rq.Card32Obj), )
class GetWindowAttributes(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(3), rq.Pad(1), rq.RequestLength(), rq.Window('window') ) _reply = rq.Struct( rq.ReplyCode(), rq.Card8('backing_store'), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Card32('visual'), rq.Card16('win_class'), rq.Card8('bit_gravity'), rq.Card8('win_gravity'), rq.Card32('backing_bit_planes'), rq.Card32('backing_pixel'), rq.Card8('save_under'), rq.Card8('map_is_installed'), rq.Card8('map_state'), rq.Card8('override_redirect'), rq.Colormap('colormap', (X.NONE, )), rq.Card32('all_event_masks'), rq.Card32('your_event_mask'), rq.Card16('do_not_propagate_mask'), rq.Pad(2), )
class QueryFont(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(47), rq.Pad(1), rq.RequestLength(), rq.Fontable('font') ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Object('min_bounds', structs.CharInfo), rq.Pad(4), rq.Object('max_bounds', structs.CharInfo), rq.Pad(4), rq.Card16('min_char_or_byte2'), rq.Card16('max_char_or_byte2'), rq.Card16('default_char'), rq.LengthOf('properties', 2), rq.Card8('draw_direction'), rq.Card8('min_byte1'), rq.Card8('max_byte1'), rq.Card8('all_chars_exist'), rq.Int16('font_ascent'), rq.Int16('font_descent'), rq.LengthOf('char_infos', 4), rq.List('properties', structs.FontProp), rq.List('char_infos', structs.CharInfo), )
class AllocNamedColor(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(85), rq.Pad(1), rq.RequestLength(), rq.Colormap('cmap'), 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('pixel'), rq.Card16('exact_red'), rq.Card16('exact_green'), rq.Card16('exact_blue'), rq.Card16('screen_red'), rq.Card16('screen_green'), rq.Card16('screen_blue'), rq.Pad(8), )
class GetGeometry(rq.ReplyRequest): _request = rq.Struct(rq.Opcode(14), rq.Pad(1), rq.RequestLength(), rq.Drawable('drawable')) _reply = rq.Struct(rq.ReplyCode(), rq.Card8('depth'), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Window('root'), rq.Int16('x'), rq.Int16('y'), rq.Card16('width'), rq.Card16('height'), rq.Card16('border_width'), rq.Pad(10))
class GetModifierMapping(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(119), rq.Pad(1), rq.RequestLength(), ) _reply = rq.Struct(rq.ReplyCode(), rq.Format('keycodes', 1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Pad(24), rq.ModifierMapping('keycodes'))
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 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 QueryKeymap(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(44), rq.Pad(1), rq.RequestLength(), ) _reply = rq.Struct( rq.ReplyCode(), rq.Pad(1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.FixedList('map', 32, rq.Card8Obj), )
class ConnectionSetupRequest(rq.GetAttrData): _request = rq.Struct(rq.Set('byte_order', 1, (0x42, 0x6c)), rq.Pad(1), rq.Card16('protocol_major'), rq.Card16('protocol_minor'), rq.LengthOf('auth_prot_name', 2), rq.LengthOf('auth_prot_data', 2), rq.Pad(2), rq.String8('auth_prot_name'), rq.String8('auth_prot_data')) _reply = rq.Struct(rq.Card8('status'), rq.Card8('reason_length'), rq.Card16('protocol_major'), rq.Card16('protocol_minor'), rq.Card16('additional_length')) _success_reply = rq.Struct( rq.Card32('release_number'), rq.Card32('resource_id_base'), rq.Card32('resource_id_mask'), rq.Card32('motion_buffer_size'), rq.LengthOf('vendor', 2), rq.Card16('max_request_length'), rq.LengthOf('roots', 1), rq.LengthOf('pixmap_formats', 1), rq.Card8('image_byte_order'), rq.Card8('bitmap_format_bit_order'), rq.Card8('bitmap_format_scanline_unit'), rq.Card8('bitmap_format_scanline_pad'), rq.Card8('min_keycode'), rq.Card8('max_keycode'), rq.Pad(4), rq.String8('vendor'), rq.List('pixmap_formats', PixmapFormat), rq.List('roots', Screen), ) def __init__(self, display, *args, **keys): self._binary = apply(self._request.to_binary, args, keys) self._data = None # Don't bother about locking, since no other threads have # access to the display yet display.request_queue.append((self, 1)) # However, we must lock send_and_recv, but we don't have # to loop. display.send_recv_lock.acquire() display.send_and_recv(request=-1)
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 GetPointerMapping(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(117), rq.Pad(1), rq.RequestLength(), ) _reply = rq.Struct( rq.ReplyCode(), rq.LengthOf('map', 1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Pad(24), rq.List('map', rq.Card8Obj), )
class GetInputFocus(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(43), rq.Pad(1), rq.RequestLength(), ) _reply = rq.Struct( rq.ReplyCode(), rq.Card8('revert_to'), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Window('focus', (X.NONE, X.PointerRoot)), rq.Pad(20), )
class ListExtensions(rq.ReplyRequest): _request = rq.Struct( rq.Opcode(99), rq.Pad(1), rq.RequestLength(), ) _reply = rq.Struct( rq.ReplyCode(), rq.LengthOf('names', 1), rq.Card16('sequence_number'), rq.ReplyLength(), rq.Pad(24), rq.List('names', rq.Str), )
class FreeGC(rq.Request): _request = rq.Struct( rq.Opcode(60), rq.Pad(1), rq.RequestLength(), rq.GC('gc') )
class DestroySubWindows(rq.Request): _request = rq.Struct( rq.Opcode(5), rq.Pad(1), rq.RequestLength(), rq.Window('window') )
class FreePixmap(rq.Request): _request = rq.Struct( rq.Opcode(54), rq.Pad(1), rq.RequestLength(), rq.Pixmap('pixmap') )
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 CloseFont(rq.Request): _request = rq.Struct( rq.Opcode(46), rq.Pad(1), rq.RequestLength(), rq.Font('font') )
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 FreeCursor(rq.Request): _request = rq.Struct( rq.Opcode(95), rq.Pad(1), rq.RequestLength(), rq.Cursor('cursor') )
class UngrabKeyboard(rq.Request): _request = rq.Struct( rq.Opcode(32), rq.Pad(1), rq.RequestLength(), rq.Card32('time') )
class UngrabPointer(rq.Request): _request = rq.Struct( rq.Opcode(27), rq.Pad(1), rq.RequestLength(), rq.Card32('time') )
class UnmapSubwindows(rq.Request): _request = rq.Struct( rq.Opcode(11), rq.Pad(1), rq.RequestLength(), rq.Window('window') )
class KillClient(rq.Request): _request = rq.Struct( rq.Opcode(113), rq.Pad(1), rq.RequestLength(), rq.Resource('resource') )
class ChangeSaveSet(rq.Request): _request = rq.Struct( rq.Opcode(6), rq.Set('mode', 1, (X.SetModeInsert, X.SetModeDelete)), rq.RequestLength(), rq.Window('window'), )
class CirculateWindow(rq.Request): _request = rq.Struct( rq.Opcode(13), rq.Set('direction', 1, (X.RaiseLowest, X.LowerHighest)), rq.RequestLength(), rq.Window('window'), )
class MapWindow(rq.Request): _request = rq.Struct( rq.Opcode(8), rq.Pad(1), rq.RequestLength(), rq.Window('window') )