예제 #1
0
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),
        )
예제 #2
0
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),
        )
예제 #3
0
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),
        )
예제 #4
0
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),
        )
예제 #5
0
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))
예제 #6
0
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'))
예제 #7
0
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),
    )
예제 #8
0
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),
    )
예제 #9
0
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'),
    )
예제 #10
0
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),
    )
예제 #11
0
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),
        )
예제 #12
0
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)
예제 #13
0
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),
    )
예제 #14
0
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),
        )
예제 #15
0
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),
        )
예제 #16
0
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),
        )
예제 #17
0
class FreeGC(rq.Request):
    _request = rq.Struct(
        rq.Opcode(60),
        rq.Pad(1),
        rq.RequestLength(),
        rq.GC('gc')
        )
예제 #18
0
class DestroySubWindows(rq.Request):
    _request = rq.Struct(
        rq.Opcode(5),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Window('window')
        )
예제 #19
0
class FreePixmap(rq.Request):
    _request = rq.Struct(
        rq.Opcode(54),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Pixmap('pixmap')
        )
예제 #20
0
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),
        )
예제 #21
0
class CloseFont(rq.Request):
    _request = rq.Struct(
        rq.Opcode(46),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Font('font')
        )
예제 #22
0
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),
        )
예제 #23
0
class FreeCursor(rq.Request):
    _request = rq.Struct(
        rq.Opcode(95),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Cursor('cursor')
        )
예제 #24
0
class UngrabKeyboard(rq.Request):
    _request = rq.Struct(
        rq.Opcode(32),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Card32('time')
        )
예제 #25
0
class UngrabPointer(rq.Request):
    _request = rq.Struct(
        rq.Opcode(27),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Card32('time')
        )
예제 #26
0
class UnmapSubwindows(rq.Request):
    _request = rq.Struct(
        rq.Opcode(11),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Window('window')
        )
예제 #27
0
class KillClient(rq.Request):
    _request = rq.Struct(
        rq.Opcode(113),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Resource('resource')
        )
예제 #28
0
class ChangeSaveSet(rq.Request):
    _request = rq.Struct(
        rq.Opcode(6),
        rq.Set('mode', 1, (X.SetModeInsert, X.SetModeDelete)),
        rq.RequestLength(),
        rq.Window('window'),
        )
예제 #29
0
class CirculateWindow(rq.Request):
    _request = rq.Struct(
        rq.Opcode(13),
        rq.Set('direction', 1, (X.RaiseLowest, X.LowerHighest)),
        rq.RequestLength(),
        rq.Window('window'),
        )
예제 #30
0
class MapWindow(rq.Request):
    _request = rq.Struct(
        rq.Opcode(8),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Window('window')
        )