コード例 #1
0
ファイル: record.py プロジェクト: atoun/melange
class QueryVersionReply(ooxcb.Reply):
    def __init__(self, conn):
        ooxcb.Reply.__init__(self, conn)
        self.major_version = None
        self.minor_version = None

    def read(self, stream):
        self._address = stream.address
        _unpacked = unpack_from_stream("=xxxxxxxxHH", stream)
        self.major_version = _unpacked[0]
        self.minor_version = _unpacked[1]

    def build(self, stream):
        count = 0
        stream.write(pack("=xxxxxxxxHH", self.major_version, self.minor_version))

_events = {
}

_errors = {
    0: (ContextError, BadContext),
}

for ev in _events.itervalues():
    if isinstance(ev.event_target_class, str):
        ev.event_target_class = globals()[ev.event_target_class]

ooxcb._add_ext(key, recordExtension, _events, _errors)
def mixin():
    pass
コード例 #2
0
ファイル: shape.py プロジェクト: samurai-x/ooxcb
                self.bounding_shape_extents_height,
                self.clip_shape_extents_x,
                self.clip_shape_extents_y,
                self.clip_shape_extents_width,
                self.clip_shape_extents_height,
            )
        )


class GetRectanglesCookie(ooxcb.Cookie):
    pass


class InputSelectedCookie(ooxcb.Cookie):
    pass


_events = {0: NotifyEvent}

_errors = {}

for ev in _events.itervalues():
    if isinstance(ev.event_target_class, str):
        ev.event_target_class = globals()[ev.event_target_class]

ooxcb._add_ext(key, shapeExtension, _events, _errors)


def mixin():
    WindowMixin.mixin()
コード例 #3
0
ファイル: xfixes.py プロジェクト: samurai-x/ooxcb
    def change_by_name(self, name):
        if isinstance(name, unicode):
            name = name.encode("utf-8")
        nbytes = len(name)
        name = map(ord, name)
        return self.conn.xfixes.send_request(ooxcb.Request(self.conn, buf.getvalue(), 27, True, False), \
            ooxcb.VoidCookie())

_events = {
    1: CursorNotifyEvent,
    0: SelectionNotifyEvent,
}

_errors = {
    0: (RegionError, BadRegion),
}

for ev in _events.itervalues():
    if isinstance(ev.event_target_class, str):
        ev.event_target_class = globals()[ev.event_target_class]

ooxcb._add_ext(key, xfixesExtension, _events, _errors)
def mixin():
    CursorMixin.mixin()
    PictureMixin.mixin()
    WindowMixin.mixin()
    GContextMixin.mixin()


コード例 #4
0
ファイル: screensaver.py プロジェクト: samurai-x/ooxcb
        self._address = stream.address
        _unpacked = unpack_from_stream("=xBxxxxxxIIIIBxxxxxxx", stream)
        self.state = _unpacked[0]
        self.saver_window = Window(self.conn, _unpacked[1])
        self.ms_until_server = _unpacked[2]
        self.ms_since_user_input = _unpacked[3]
        self.event_mask = _unpacked[4]
        self.kind = _unpacked[5]

    def build(self, stream):
        count = 0
        stream.write(pack("=xBxxxxxxIIIIBxxxxxxx", self.state, get_internal(self.saver_window), self.ms_until_server, self.ms_since_user_input, self.event_mask, self.kind))

_events = {
    0: NotifyEvent,
}

_errors = {
}

for ev in _events.itervalues():
    if isinstance(ev.event_target_class, str):
        ev.event_target_class = globals()[ev.event_target_class]

ooxcb._add_ext(key, screensaverExtension, _events, _errors)
def mixin():
    DrawableMixin.mixin()
    WindowMixin.mixin()


コード例 #5
0
ファイル: xtest.py プロジェクト: samurai-x/ooxcb
    def read(self, stream):
        self._address = stream.address
        _unpacked = unpack_from_stream("=xBxxxxxx", stream)
        self.same = _unpacked[0]

    def build(self, stream):
        count = 0
        stream.write(pack("=xBxxxxxx", self.same))

class CompareCursorCookie(ooxcb.Cookie):
    pass

class GetVersionCookie(ooxcb.Cookie):
    pass

_events = {
}

_errors = {
}

for ev in _events.itervalues():
    if isinstance(ev.event_target_class, str):
        ev.event_target_class = globals()[ev.event_target_class]

ooxcb._add_ext(key, xtestExtension, _events, _errors)
def mixin():
    WindowMixin.mixin()


コード例 #6
0
ファイル: damage.py プロジェクト: samurai-x/ooxcb
        self.major_version = None
        self.minor_version = None

    def read(self, stream):
        self._address = stream.address
        _unpacked = unpack_from_stream("=xxxxxxxxIIxxxxxxxxxxxxxxxx", stream)
        self.major_version = _unpacked[0]
        self.minor_version = _unpacked[1]

    def build(self, stream):
        count = 0
        stream.write(pack("=xxxxxxxxIIxxxxxxxxxxxxxxxx", self.major_version, self.minor_version))

_events = {
    0: DamageNotifyEvent,
}

_errors = {
    0: (DamageError, BadDamage),
}

for ev in _events.itervalues():
    if isinstance(ev.event_target_class, str):
        ev.event_target_class = globals()[ev.event_target_class]

ooxcb._add_ext(key, damageExtension, _events, _errors)
def mixin():
    DrawableMixin.mixin()


コード例 #7
0
ファイル: composite.py プロジェクト: samurai-x/ooxcb
        window = get_internal(window)
        buf = StringIO.StringIO()
        buf.write(pack("=xxxxII", region, window))
        return self.conn.composite.send_request(ooxcb.Request(self.conn, buf.getvalue(), 5, True, True), \
            ooxcb.VoidCookie())

    def create_region_from_border_clip(self, region, window):
        region = get_internal(region)
        window = get_internal(window)
        buf = StringIO.StringIO()
        buf.write(pack("=xxxxII", region, window))
        return self.conn.composite.send_request(ooxcb.Request(self.conn, buf.getvalue(), 5, True, False), \
            ooxcb.VoidCookie())

_events = {
}

_errors = {
}

for ev in _events.itervalues():
    if isinstance(ev.event_target_class, str):
        ev.event_target_class = globals()[ev.event_target_class]

ooxcb._add_ext(key, compositeExtension, _events, _errors)
def mixin():
    WindowMixin.mixin()
    RegionMixin.mixin()


コード例 #8
0
ファイル: bigreq.py プロジェクト: samurai-x/ooxcb
        buf.write(pack("=xxxx", ))
        return self.conn.bigreq.send_request(ooxcb.Request(self.conn, buf.getvalue(), 0, False, True), \
            EnableCookie(),
            EnableReply)

    def enable_unchecked(self):
        buf = StringIO.StringIO()
        buf.write(pack("=xxxx", ))
        return self.conn.bigreq.send_request(ooxcb.Request(self.conn, buf.getvalue(), 0, False, False), \
            EnableCookie(),
            EnableReply)

class EnableCookie(ooxcb.Cookie):
    pass

_events = {
}

_errors = {
}

for ev in _events.itervalues():
    if isinstance(ev.event_target_class, str):
        ev.event_target_class = globals()[ev.event_target_class]

ooxcb._add_ext(key, bigreqExtension, _events, _errors)
def mixin():
    pass