예제 #1
0
class XIGrabDevice(rq.ReplyRequest):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(51),
        rq.RequestLength(),
        rq.Window('grab_window'),
        rq.Card32('time'),
        rq.Cursor('cursor', (X.NONE, )),
        DEVICEID('deviceid'),
        rq.Set('grab_mode', 1, (GrabModeSync, GrabModeAsync)),
        rq.Set('paired_device_mode', 1, (GrabModeSync, GrabModeAsync)),
        rq.Bool('owner_events'),
        rq.Pad(1),
        rq.LengthOf('mask', 2),
        Mask('mask'),
    )

    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.Card8('status'),
        rq.Pad(23),
    )
예제 #2
0
class XIPassiveGrabDevice(rq.ReplyRequest):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(54),
        rq.RequestLength(),
        rq.Card32('time'),
        rq.Window('grab_window'),
        rq.Cursor('cursor', (X.NONE, )),
        rq.Card32('detail'),
        DEVICEID('deviceid'),
        rq.LengthOf('modifiers', 2),
        rq.LengthOf('mask', 2),
        rq.Set('grab_type', 1, (GrabtypeButton, GrabtypeKeycode, GrabtypeEnter,
                                GrabtypeFocusIn, GrabtypeTouchBegin)),
        rq.Set('grab_mode', 1, (GrabModeSync, GrabModeAsync)),
        rq.Set('paired_device_mode', 1, (GrabModeSync, GrabModeAsync)),
        rq.Bool('owner_events'),
        rq.Pad(2),
        Mask('mask'),
        rq.List('modifiers', rq.Card32),
    )

    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.LengthOf('modifiers', 2),
        rq.Pad(22),
        rq.List('modifiers', rq.Card32),
    )
예제 #3
0
class ChangeHosts(rq.Request):
    _request = rq.Struct(
        rq.Opcode(109), rq.Set('mode', 1, (X.HostInsert, X.HostDelete)),
        rq.RequestLength(),
        rq.Set('host_family', 1,
               (X.FamilyInternet, X.FamilyDECnet, X.FamilyChaos)), rq.Pad(1),
        rq.LengthOf('host', 2), rq.List('host', rq.Card8Obj))
예제 #4
0
파일: request.py 프로젝트: oN0/Nagstamon
class FillPoly(rq.Request):
    _request = rq.Struct(
        rq.Opcode(69),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Drawable('drawable'),
        rq.GC('gc'),
        rq.Set('shape', 1, (X.Complex, X.Nonconvex, X.Convex)),
        rq.Set('coord_mode', 1, (X.CoordModeOrigin, X.CoordModePrevious)),
        rq.Pad(2),
        rq.List('points', structs.Point),
        )
예제 #5
0
파일: request.py 프로젝트: oN0/Nagstamon
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),
        )
예제 #6
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))))
예제 #7
0
class SetScreenSaver(rq.Request):
    _request = rq.Struct(
        rq.Opcode(107),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Int16('timeout'),
        rq.Int16('interval'),
        rq.Set('prefer_blank', 1,
               (X.DontPreferBlanking, X.PreferBlanking, X.DefaultBlanking)),
        rq.Set('allow_exposures', 1,
               (X.DontAllowExposures, X.AllowExposures, X.DefaultExposures)),
        rq.Pad(2),
    )
예제 #8
0
class Combine(rq.Request):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(3),
        rq.RequestLength(),
        rq.Card8('operation'),
        rq.Set('dest_region', 1, (ShapeBounding, ShapeClip)),
        rq.Set('source_region', 1, (ShapeBounding, ShapeClip)),
        rq.Pad(1),
        rq.Window('dest'),
        rq.Int16('x'),
        rq.Int16('y'),
        rq.Window('source'),
    )
예제 #9
0
def GCValues(arg):
    return rq.ValueList(
        arg, 4, 0,
        rq.Set('function', 1,
               (X.GXclear, X.GXand, X.GXandReverse, X.GXcopy, X.GXandInverted,
                X.GXnoop, X.GXxor, X.GXor, X.GXnor, X.GXequiv, X.GXinvert,
                X.GXorReverse, X.GXcopyInverted, X.GXorInverted, X.GXnand,
                X.GXset)), rq.Card32('plane_mask'), rq.Card32('foreground'),
        rq.Card32('background'), rq.Card16('line_width'),
        rq.Set('line_style', 1,
               (X.LineSolid, X.LineOnOffDash, X.LineDoubleDash)),
        rq.Set('cap_style', 1,
               (X.CapNotLast, X.CapButt, X.CapRound, X.CapProjecting)),
        rq.Set('join_style', 1, (X.JoinMiter, X.JoinRound, X.JoinBevel)),
        rq.Set(
            'fill_style', 1,
            (X.FillSolid, X.FillTiled, X.FillStippled, X.FillOpaqueStippled)),
        rq.Set('fill_rule', 1, (X.EvenOddRule, X.WindingRule)),
        rq.Pixmap('tile'), rq.Pixmap('stipple'),
        rq.Int16('tile_stipple_x_origin'), rq.Int16('tile_stipple_y_origin'),
        rq.Font('font'),
        rq.Set('subwindow_mode', 1, (X.ClipByChildren, X.IncludeInferiors)),
        rq.Bool('graphics_exposures'), rq.Int16('clip_x_origin'),
        rq.Int16('clip_y_origin'), rq.Pixmap('clip_mask'),
        rq.Card16('dash_offset'), rq.Card8('dashes'),
        rq.Set('arc_mode', 1, (X.ArcChord, X.ArcPieSlice)))
예제 #10
0
파일: request.py 프로젝트: oN0/Nagstamon
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'),
        )
예제 #11
0
파일: request.py 프로젝트: oN0/Nagstamon
class CirculateWindow(rq.Request):
    _request = rq.Struct(
        rq.Opcode(13),
        rq.Set('direction', 1, (X.RaiseLowest, X.LowerHighest)),
        rq.RequestLength(),
        rq.Window('window'),
        )
예제 #12
0
class SetCloseDownMode(rq.Request):
    _request = rq.Struct(
        rq.Opcode(112),
        rq.Set('mode', 1,
               (X.DestroyAll, X.RetainPermanent, X.RetainTemporary)),
        rq.RequestLength(),
    )
예제 #13
0
파일: request.py 프로젝트: oN0/Nagstamon
class ChangeSaveSet(rq.Request):
    _request = rq.Struct(
        rq.Opcode(6),
        rq.Set('mode', 1, (X.SetModeInsert, X.SetModeDelete)),
        rq.RequestLength(),
        rq.Window('window'),
        )
예제 #14
0
class FakeInput(object):
    _request = rq.Struct(rq.Card8('opcode'),
                         rq.Opcode(2),
                         rq.RequestLength(),
                         rq.Set('event_type', 1, (X.KeyPress,
                                                  X.KeyRelease,
                                                  X.ButtonPress,
                                                  X.ButtonRelease,
                                                  X.MotionNotify)),
                         rq.Card8('detail'),
                         rq.Pad(2),
                         rq.Card32('time'),
                         rq.Window('root', (X.NONE, )),
                         rq.Pad(8),
                         rq.Int16('x'),
                         rq.Int16('y'),
                         rq.Pad(8)
                         )

    def __init__(self, display, onerror = None, *args, **keys):
        self._errorhandler = onerror
        self._binary = self._request.to_binary(*args, **keys)
        self._serial = None
        display.send_request(self, onerror is not None)

    def _set_error(self, error):
        if self._errorhandler is not None:
            return call_error_handler(self._errorhandler, error, self)
        else:
            return 0
예제 #15
0
class FakeInput(rq.Request):
    _request = rq.Struct(
        rq.Card8('opcode'), rq.Opcode(2), rq.RequestLength(),
        rq.Set('event_type', 1, (X.KeyPress, X.KeyRelease, X.ButtonPress,
                                 X.ButtonRelease, X.MotionNotify)),
        rq.Card8('detail'), rq.Pad(2), rq.Card32('time'),
        rq.Window('root', (X.NONE, )), rq.Pad(8), rq.Int16('x'), rq.Int16('y'),
        rq.Pad(8))
예제 #16
0
class ConfigureWindow(rq.Request):
    _request = rq.Struct(
        rq.Opcode(12), rq.Pad(1), rq.RequestLength(), rq.Window('window'),
        rq.ValueList(
            'attrs', 2, 2, rq.Int16('x'), rq.Int16('y'), rq.Card16('width'),
            rq.Card16('height'), rq.Int16('border_width'),
            rq.Window('sibling'),
            rq.Set('stack_mode', 1,
                   (X.Above, X.Below, X.TopIf, X.BottomIf, X.Opposite))))
예제 #17
0
파일: request.py 프로젝트: oN0/Nagstamon
class CreateColormap(rq.Request):
    _request = rq.Struct(
        rq.Opcode(78),
        rq.Set('alloc', 1, (X.AllocNone, X.AllocAll)),
        rq.RequestLength(),
        rq.Colormap('mid'),
        rq.Window('window'),
        rq.Card32('visual'),
        )
예제 #18
0
파일: request.py 프로젝트: oN0/Nagstamon
class PolyLine(rq.Request):
    _request = rq.Struct(
        rq.Opcode(65),
        rq.Set('coord_mode', 1, (X.CoordModeOrigin, X.CoordModePrevious)),
        rq.RequestLength(),
        rq.Drawable('drawable'),
        rq.GC('gc'),
        rq.List('points', structs.Point),
        )
예제 #19
0
파일: request.py 프로젝트: oN0/Nagstamon
class SetInputFocus(rq.Request):
    _request = rq.Struct(
        rq.Opcode(42),
        rq.Set('revert_to', 1, (X.RevertToNone, X.RevertToPointerRoot,
                                X.RevertToParent)),
        rq.RequestLength(),
        rq.Window('focus'),
        rq.Card32('time'),
        )
예제 #20
0
class RedirectSubwindows(rq.Request):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(2),
        rq.RequestLength(),
        rq.Window('window'),
        rq.Set('update', 1, (RedirectAutomatic, RedirectManual)),
        rq.Pad(3),
    )
예제 #21
0
class DamageCreate(rq.Request):
    _request = rq.Struct(rq.Card8('opcode'),
                         rq.Opcode(1),
                         rq.RequestLength(),
                         DAMAGE('damage'),
                         rq.Drawable('drawable'),
                         rq.Set('level', 1, DamageReportLevel),
                         rq.Pad(3),
                         )
예제 #22
0
파일: request.py 프로젝트: oN0/Nagstamon
class SetClipRectangles(rq.Request):
    _request = rq.Struct(
        rq.Opcode(59),
        rq.Set('ordering', 1, (X.Unsorted, X.YSorted, X.YXSorted, X.YXBanded)),
        rq.RequestLength(),
        rq.GC('gc'),
        rq.Int16('x_origin'),
        rq.Int16('y_origin'),
        rq.List('rectangles', structs.Rectangle),
        )
예제 #23
0
class AllowEvents(rq.Request):
    _request = rq.Struct(
        rq.Opcode(35),
        rq.Set(
            'mode', 1,
            (X.AsyncPointer, X.SyncPointer, X.ReplayPointer, X.AsyncKeyboard,
             X.SyncKeyboard, X.ReplayKeyboard, X.AsyncBoth, X.SyncBoth)),
        rq.RequestLength(),
        rq.Card32('time'),
    )
예제 #24
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),
        )
예제 #25
0
class Offset(rq.Request):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(4),
        rq.RequestLength(),
        rq.Set('region', 1, (ShapeBounding, ShapeClip)),
        rq.Pad(3),
        rq.Window('window'),
        rq.Int16('x'),
        rq.Int16('y'),
    )
예제 #26
0
파일: request.py 프로젝트: oN0/Nagstamon
class GrabPointer(rq.ReplyRequest):
    _request = rq.Struct(
        rq.Opcode(26),
        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.Card32('time'),
        )

    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Card8('status'),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.Pad(24),
        )
예제 #27
0
class Mask(rq.Request):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(2),
        rq.RequestLength(),
        rq.Card8('operation'),
        rq.Set('region', 1, (ShapeBounding, ShapeClip)),
        rq.Pad(2),
        rq.Window('window'),
        rq.Int16('x'),
        rq.Int16('y'),
        rq.Pixmap('source', (X.NONE, )),
    )
예제 #28
0
파일: request.py 프로젝트: oN0/Nagstamon
class ChangeProperty(rq.Request):
    _request = rq.Struct(
        rq.Opcode(18),
        rq.Set('mode', 1, (X.PropModeReplace, X.PropModePrepend, X.PropModeAppend)),
        rq.RequestLength(),
        rq.Window('window'),
        rq.Card32('property'),
        rq.Card32('type'),
        rq.Format('data', 1),
        rq.Pad(3),
        rq.LengthOf('data', 4),
        rq.PropertyData('data'),
        )
예제 #29
0
class ShapeNotify(rq.Event):
    _code = None
    _fields = rq.Struct(rq.Card8('type'),
                        rq.Set('region', 1, (ShapeBounding, ShapeClip)),
                        rq.Card16('sequence_number'),
                        rq.Window('window'),
                        rq.Int16('x'),
                        rq.Int16('y'),
                        rq.Card16('width'),
                        rq.Card16('height'),
                        rq.Card32('time'),
                        rq.Bool('shaped'),
                        rq.Pad(11),
                        )
예제 #30
0
class Rectangles(rq.Request):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(1),
        rq.RequestLength(),
        rq.Card8('operation'),
        rq.Set('region', 1, (ShapeBounding, ShapeClip)),
        rq.Card8('ordering'),
        rq.Pad(1),
        rq.Window('window'),
        rq.Int16('x'),
        rq.Int16('y'),
        rq.List('rectangles', structs.Rectangle),
    )