예제 #1
0
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),
                       )
예제 #2
0
파일: randr.py 프로젝트: dd4e/python-xlib
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),
    )
예제 #3
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),
    )
예제 #4
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),
    )
예제 #5
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),
    )
예제 #6
0
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),
    )
예제 #7
0
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),
        )
예제 #8
0
파일: request.py 프로젝트: oN0/Nagstamon
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
파일: request.py 프로젝트: oN0/Nagstamon
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
파일: request.py 프로젝트: oN0/Nagstamon
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 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),
    )
예제 #12
0
파일: randr.py 프로젝트: dd4e/python-xlib
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),
    )
예제 #13
0
파일: request.py 프로젝트: oN0/Nagstamon
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),
        )
예제 #14
0
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),
    )
예제 #15
0
파일: request.py 프로젝트: oN0/Nagstamon
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'),
        )
예제 #16
0
파일: request.py 프로젝트: oN0/Nagstamon
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),
        )
예제 #17
0
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),
    )
예제 #18
0
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),
    )
예제 #19
0
파일: request.py 프로젝트: oN0/Nagstamon
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'),
        )
예제 #20
0
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)
예제 #21
0
파일: randr.py 프로젝트: dd4e/python-xlib
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'),
    )
예제 #22
0
파일: request.py 프로젝트: oN0/Nagstamon
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),
        )
예제 #23
0
파일: request.py 프로젝트: oN0/Nagstamon
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),
        )
예제 #24
0
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'))
예제 #25
0
파일: randr.py 프로젝트: dd4e/python-xlib
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),
    )
예제 #26
0
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
    )
예제 #27
0
파일: request.py 프로젝트: oN0/Nagstamon
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),
        )
예제 #28
0
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),
    )
예제 #29
0
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),
    )
예제 #30
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),
    )