This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
forked from tych0/xpyb-ng
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added response.py, implements Response, Event, Reply, Error
- Loading branch information
Showing
13 changed files
with
56 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
from xcb import * | ||
from iter import Iterator | ||
from response import Response, Event, Reply, Error | ||
xcb.Event = Event | ||
xcb.Error = Error | ||
xcb.Reply = Reply | ||
|
||
__all__ = [ 'xproto', 'bigreq', 'xc_misc' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import xcb | ||
import struct | ||
|
||
class Response(xcb.Protobj): | ||
"""XCB generic response object""" | ||
def __init__(self, parent): | ||
xcb.Protobj.__init__(self, parent) | ||
# self is a xcb_generic_event_t | ||
self.response_type, self.sequence = struct.unpack_from('BxH', self) | ||
|
||
class Event(Response): | ||
"""XCB generic event object""" | ||
pass | ||
|
||
class Reply(Response): | ||
"""XCB generic reply object""" | ||
def __init__(self, parent): | ||
Response.__init__(self, parent) | ||
# self is a xcb_generic_reply_t | ||
(self.length, ) = struct.unpack_from('4xI', self) | ||
|
||
class Error(Response): | ||
"""XCB generic error object""" | ||
def __init__(self, parent): | ||
Response.__init__(self, parent) | ||
# self is a xcb_generic_error_t | ||
(self.code, ) = struct.unpack_from('xB', self) |