Exemple #1
0
class _GetCrtcInfo(rq.ReplyRequest):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(20),
        rq.RequestLength(),
        rq.Card32('crtc'),
        rq.Card32('config_timestamp'),
        )
    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Card8('status'),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.Card32('timestamp'),
        rq.Int16('x'),
        rq.Int16('y'),
        rq.Card16('width'),
        rq.Card16('height'),
        rq.Card32('mode'),
        rq.Card16('rotation'),
        rq.Card16('possible_rotations'),
        rq.LengthOf('outputs', 2),
        rq.LengthOf('possible_outputs', 2),
        rq.List('outputs', rq.Card32Obj),
        rq.List('possible_outputs', rq.Card32Obj),
        )
Exemple #2
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)))
Exemple #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),
        )
Exemple #4
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
Exemple #5
0
class SetPanning(rq.ReplyRequest):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(29),
        rq.RequestLength(),
        rq.Card32('crtc'),
        rq.Card32('timestamp'),
        rq.Card16('left'),
        rq.Card16('top'),
        rq.Card16('width'),
        rq.Card16('height'),
        rq.Card16('track_left'),
        rq.Card16('track_top'),
        rq.Card16('track_width'),
        rq.Card16('track_height'),
        rq.Int16('border_left'),
        rq.Int16('border_top'),
        rq.Int16('border_right'),
        rq.Int16('border_bottom'),
    )
    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Card8('status'),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.Card32('new_timestamp'),
        rq.Pad(20),
    )
Exemple #6
0
class QueryExtents(rq.ReplyRequest):

    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(5),
        rq.RequestLength(),
        rq.Window('destination_window'),
    )

    _reply = rq.Struct(
        rq.ReplyCode(),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.ReplyLength(),
        rq.Card8('bounding_shaped'),
        rq.Card8('clip_shaped'),
        rq.Pad(2),
        rq.Int16('bounding_shape_extents_x'),
        rq.Int16('bounding_shape_extents_y'),
        rq.Card16('bounding_shape_extents_width'),
        rq.Card16('bounding_shape_extents_height'),
        rq.Int16('clip_shape_extents_x'),
        rq.Int16('clip_shape_extents_y'),
        rq.Card16('clip_shape_extents_width'),
        rq.Card16('clip_shape_extents_height'),
    )
Exemple #7
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))
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 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))))
Exemple #10
0
class SetPictureClipRectangles(rq.Request):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(6),
        rq.RequestLength(),
        rq.Picture('picture'),
        rq.Int16('clip_x_origin'),
        rq.Int16('clip_y_origin'),
        rq.List('rectangles', structs.Rectangle),
    )
Exemple #11
0
class AddTraps(rq.Request):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(32),
        rq.RequestLength(),
        rq.Picture('picture'),
        rq.Int16('off_x'),
        rq.Int16('off_y'),
        rq.List('trapezoids', Trap),
    )
Exemple #12
0
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),
        )
Exemple #13
0
class ReparentWindow(rq.Request):
    _request = rq.Struct(
        rq.Opcode(7),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Window('window'),
        rq.Window('parent'),
        rq.Int16('x'),
        rq.Int16('y'),
        )
Exemple #14
0
class ClearArea(rq.Request):
    _request = rq.Struct(
        rq.Opcode(61),
        rq.Bool('exposures'),
        rq.RequestLength(),
        rq.Window('window'),
        rq.Int16('x'),
        rq.Int16('y'),
        rq.Card16('width'),
        rq.Card16('height'),
        )
Exemple #15
0
class ChangePointerControl(rq.Request):
    _request = rq.Struct(
        rq.Opcode(105),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Int16('accel_num'),
        rq.Int16('accel_denum'),
        rq.Int16('threshold'),
        rq.Bool('do_accel'),
        rq.Bool('do_thresh'),
        )
Exemple #16
0
class ImageText16(rq.Request):
    _request = rq.Struct(
        rq.Opcode(77),
        rq.LengthOf('string', 1),
        rq.RequestLength(),
        rq.Drawable('drawable'),
        rq.GC('gc'),
        rq.Int16('x'),
        rq.Int16('y'),
        rq.String16('string'),
        )
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'),
    )
Exemple #18
0
class PolyText16(rq.Request):
    _request = rq.Struct(
        rq.Opcode(75),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Drawable('drawable'),
        rq.GC('gc'),
        rq.Int16('x'),
        rq.Int16('y'),
        rq.TextElements16('items'),
        )
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))))
Exemple #20
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),
    )
Exemple #21
0
class Offset(rq.Request):

    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(4),
        rq.RequestLength(),
        KIND('destination_kind'),
        rq.Pad(3),
        rq.Window('destination_window'),
        rq.Int16('x_offset'),
        rq.Int16('y_offset'),
    )
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),
    )
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, )),
    )
Exemple #24
0
class WarpPointer(rq.Request):
    _request = rq.Struct(
        rq.Opcode(41),
        rq.Pad(1),
        rq.RequestLength(),
        rq.Window('src_window'),
        rq.Window('dst_window'),
        rq.Int16('src_x'),
        rq.Int16('src_y'),
        rq.Card16('src_width'),
        rq.Card16('src_height'),
        rq.Int16('dst_x'),
        rq.Int16('dst_y'),
        )
Exemple #25
0
class Mask(rq.Request):

    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(2),
        rq.RequestLength(),
        OP('operation'),
        KIND('destination_kind'),
        rq.Pad(2),
        rq.Window('destination_window'),
        rq.Int16('x_offset'),
        rq.Int16('y_offset'),
        rq.Pixmap('source_bitmap'),
    )
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),
    )
Exemple #27
0
class Triangles(rq.Request):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(11),
        rq.RequestLength(),
        PictOp('op'),
        rq.Pad(3),
        rq.Picture('src'),
        rq.Picture('dst'),
        PictFormat('mask_format', (X.NONE, )),
        rq.Int16('src_x'),
        rq.Int16('src_y'),
        rq.List('triangles', Triangle),
    )
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'),
    )
Exemple #29
0
class ReparentNotify(rq.Event):
    _code = X.ReparentNotify
    _fields = rq.Struct(
        rq.Card8('type'),
        rq.Pad(1),
        rq.Card16('sequence_number'),
        rq.Window('event'),
        rq.Window('window'),
        rq.Window('parent'),
        rq.Int16('x'),
        rq.Int16('y'),
        rq.Card8('override'),
        rq.Pad(11),
    )
Exemple #30
0
class TriFan(rq.Request):
    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(13),
        rq.RequestLength(),
        PictOp('op'),
        rq.Pad(3),
        rq.Picture('src'),
        rq.Picture('dst'),
        PictFormat('mask_format', (X.NONE, )),
        rq.Int16('src_x'),
        rq.Int16('src_y'),
        rq.List('points', PointFix),
    )