Example #1
0
class UngrabButton(rq.Request):
    _request = rq.Struct(
        rq.Opcode(29),
        rq.Card8('button'),
        rq.RequestLength(),
        rq.Window('grab_window'),
        rq.Card16('modifiers'),
        rq.Pad(2),
        )
Example #2
0
class EnterLeave(rq.Event):
    _code = None
    _fields = rq.Struct(
        rq.Card8('type'),
        rq.Card8('detail'),
        rq.Card16('sequence_number'),
        rq.Card32('time'),
        rq.Window('root'),
        rq.Window('window'),
        rq.Window('child', (X.NONE, )),
        rq.Int16('root_x'),
        rq.Int16('root_y'),
        rq.Int16('event_x'),
        rq.Int16('event_y'),
        rq.Card16('state'),
        rq.Card8('mode'),
        rq.Card8('flags'),
    )
Example #3
0
class KeyButtonPointer(rq.Event):
    _code = None
    _fields = rq.Struct(
        rq.Card8('type'),
        rq.Card8('detail'),
        rq.Card16('sequence_number'),
        rq.Card32('time'),
        rq.Window('root'),
        rq.Window('window'),
        rq.Window('child', (X.NONE, )),
        rq.Int16('root_x'),
        rq.Int16('root_y'),
        rq.Int16('event_x'),
        rq.Int16('event_y'),
        rq.Card16('state'),
        rq.Card8('same_screen'),
        rq.Pad(1),
    )
Example #4
0
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'),
        )
Example #5
0
class ChangeKeyboardControl(rq.Request):
    _request = rq.Struct(
        rq.Opcode(102),
        rq.Pad(1),
        rq.RequestLength(),
        rq.ValueList( 'attrs', 4, 0,
                      rq.Int8('key_click_percent'),
                      rq.Int8('bell_percent'),
                      rq.Int16('bell_pitch'),
                      rq.Int16('bell_duration'),
                      rq.Card8('led'),
                      rq.Set('led_mode', 1, (X.LedModeOff, X.LedModeOn)),
                      rq.Card8('key'),
                      rq.Set('auto_repeat_mode', 1, (X.AutoRepeatModeOff,
                                                     X.AutoRepeatModeOn,
                                                     X.AutoRepeatModeDefault))
                      )
        )
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))
Example #7
0
class UngrabKey(rq.Request):
    _request = rq.Struct(
        rq.Opcode(34),
        rq.Card8('key'),
        rq.RequestLength(),
        rq.Window('grab_window'),
        rq.Card16('modifiers'),
        rq.Pad(2),
        )
Example #8
0
class GetScreenSaver(rq.ReplyRequest):
    _request = rq.Struct(
        rq.Opcode(108),
        rq.Pad(1),
        rq.RequestLength(),
        )

    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.Card16('timeout'),
        rq.Card16('interval'),
        rq.Card8('prefer_blanking'),
        rq.Card8('allow_exposures'),
        rq.Pad(18),
        )
Example #9
0
class CreatePixmap(rq.Request):
    _request = rq.Struct(
        rq.Opcode(53),
        rq.Card8('depth'),
        rq.RequestLength(),
        rq.Pixmap('pid'),
        rq.Drawable('drawable'),
        rq.Card16('width'),
        rq.Card16('height'),
        )
Example #10
0
class ChangeKeyboardMapping(rq.Request):
    _request = rq.Struct(
        rq.Opcode(100),
        rq.LengthOf('keysyms', 1),
        rq.RequestLength(),
        rq.Card8('first_keycode'),
        rq.Format('keysyms', 1),
        rq.Pad(2),
        rq.KeyboardMapping('keysyms'),
        )
Example #11
0
class ClientMessage(rq.Event):
    _code = X.ClientMessage
    _fields = rq.Struct(
        rq.Card8('type'),
        rq.Format('data', 1),
        rq.Card16('sequence_number'),
        rq.Window('window'),
        rq.Card32('client_type'),
        rq.FixedPropertyData('data', 20),
    )
Example #12
0
class DestroyNotify(rq.Event):
    _code = X.DestroyNotify
    _fields = rq.Struct(
        rq.Card8('type'),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.Window('event'),
        rq.Window('window'),
        rq.Pad(20),
    )
Example #13
0
class MapRequest(rq.Event):
    _code = X.MapRequest
    _fields = rq.Struct(
        rq.Card8('type'),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.Window('parent'),
        rq.Window('window'),
        rq.Pad(20),
    )
Example #14
0
class SetModifierMapping(rq.ReplyRequest):
    _request = rq.Struct(rq.Opcode(118), rq.Format('keycodes', 1),
                         rq.RequestLength(), rq.ModifierMapping('keycodes'))

    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Card8('status'),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.Pad(24),
    )
Example #15
0
class StoreNamedColor(rq.Request):
    _request = rq.Struct(
        rq.Opcode(90),
        rq.Card8('flags'),
        rq.RequestLength(),
        rq.Colormap('cmap'),
        rq.Card32('pixel'),
        rq.LengthOf('name', 2),
        rq.Pad(2),
        rq.String8('name'),
        )
Example #16
0
class ResizeRequest(rq.Event):
    _code = X.ResizeRequest
    _fields = rq.Struct(
        rq.Card8('type'),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.Window('window'),
        rq.Card16('width'),
        rq.Card16('height'),
        rq.Pad(20),
    )
Example #17
0
class SelectionClear(rq.Event):
    _code = X.SelectionClear
    _fields = rq.Struct(
        rq.Card8('type'),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.Card32('time'),
        rq.Window('window'),
        rq.Card32('atom'),
        rq.Pad(16),
    )
Example #18
0
class GetKeyboardControl(rq.ReplyRequest):
    _request = rq.Struct(
        rq.Opcode(103),
        rq.Pad(1),
        rq.RequestLength(),
        )

    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Card8('global_auto_repeat'),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.Card32('led_mask'),
        rq.Card8('key_click_percent'),
        rq.Card8('bell_percent'),
        rq.Card16('bell_pitch'),
        rq.Card16('bell_duration'),
        rq.Pad(2),
        rq.FixedList('auto_repeats', 32, rq.Card8Obj),
        )
Example #19
0
class QueryExtension(rq.ReplyRequest):
    _request = rq.Struct(
        rq.Opcode(98),
        rq.Pad(1),
        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.Card8('present'),
        rq.Card8('major_opcode'),
        rq.Card8('first_event'),
        rq.Card8('first_error'),
        rq.Pad(20),
        )
Example #20
0
class GrabKey(rq.Request):
    _request = rq.Struct(
        rq.Opcode(33),
        rq.Bool('owner_events'),
        rq.RequestLength(),
        rq.Window('grab_window'),
        rq.Card16('modifiers'),
        rq.Card8('key'),
        rq.Set('pointer_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
        rq.Set('keyboard_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
        rq.Pad(3),
        )
Example #21
0
class GravityNotify(rq.Event):
    _code = X.GravityNotify
    _fields = rq.Struct(
        rq.Card8('type'),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.Window('event'),
        rq.Window('window'),
        rq.Int16('x'),
        rq.Int16('y'),
        rq.Pad(16),
    )
Example #22
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)
Example #23
0
class SelectionNotify(rq.Event):
    _code = X.SelectionNotify
    _fields = rq.Struct(
        rq.Card8('type'),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.Card32('time'),
        rq.Window('requestor'),
        rq.Card32('selection'),
        rq.Card32('target'),
        rq.Card32('property'),
        rq.Pad(8),
    )
Example #24
0
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),
    )
Example #25
0
class SetPointerMapping(rq.ReplyRequest):
    _request = rq.Struct(
        rq.Opcode(116),
        rq.LengthOf('map', 1),
        rq.RequestLength(),
        rq.List('map', rq.Card8Obj),
        )

    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Card8('status'),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.Pad(24),
        )
Example #26
0
class GrabButton(rq.Request):
    _request = rq.Struct(
        rq.Opcode(28),
        rq.Bool('owner_events'),
        rq.RequestLength(),
        rq.Window('grab_window'),
        rq.Card16('event_mask'),
        rq.Set('pointer_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
        rq.Set('keyboard_mode', 1, (X.GrabModeSync, X.GrabModeAsync)),
        rq.Window('confine_to', (X.NONE, )),
        rq.Cursor('cursor', (X.NONE, )),
        rq.Card8('button'),
        rq.Pad(1),
        rq.Card16('modifiers'),
        )
Example #27
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),
        )
Example #28
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),
        )
Example #29
0
class CreateWindow(rq.Request):
    _request = rq.Struct(
        rq.Opcode(1),
        rq.Card8('depth'),
        rq.RequestLength(),
        rq.Window('wid'),
        rq.Window('parent'),
        rq.Int16('x'),
        rq.Int16('y'),
        rq.Card16('width'),
        rq.Card16('height'),
        rq.Card16('border_width'),
        rq.Set('window_class', 2, (X.CopyFromParent, X.InputOutput, X.InputOnly)),
        rq.Card32('visual'),
        structs.WindowValues('attrs'),
        )
Example #30
0
class QueryPointer(rq.ReplyRequest):
    _request = rq.Struct(rq.Opcode(38), rq.Pad(1), rq.RequestLength(),
                         rq.Window('window'))

    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Card8('same_screen'),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.Window('root'),
        rq.Window('child', (X.NONE, )),
        rq.Int16('root_x'),
        rq.Int16('root_y'),
        rq.Int16('win_x'),
        rq.Int16('win_y'),
        rq.Card16('mask'),
        rq.Pad(6),
    )