/usr/share/pyshared/xcb/sync.py is in python-xpyb 1.3.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 | #
# This file generated automatically from sync.xml by py_client.py.
# Edit at your peril.
#
import xcb
import cStringIO
from struct import pack, unpack_from
from array import array
import xproto
MAJOR_VERSION = 3
MINOR_VERSION = 1
key = xcb.ExtensionKey('SYNC')
class ALARMSTATE:
Active = 0
Inactive = 1
Destroyed = 2
class TESTTYPE:
PositiveTransition = 0
NegativeTransition = 1
PositiveComparison = 2
NegativeComparison = 3
class VALUETYPE:
Absolute = 0
Relative = 1
class CA:
Counter = 1
ValueType = 2
Value = 4
TestType = 8
Delta = 16
Events = 32
class INT64(xcb.Struct):
def __init__(self, parent, offset, size):
xcb.Struct.__init__(self, parent, offset, size)
(self.hi, self.lo,) = unpack_from('iI', parent, offset)
class SYSTEMCOUNTER(xcb.Struct):
def __init__(self, parent, offset):
xcb.Struct.__init__(self, parent, offset)
base = offset
(self.counter,) = unpack_from('I', parent, offset)
offset += 4
self.resolution = INT64(parent, offset, 8)
offset += 8
(self.name_len,) = unpack_from('H', parent, offset)
offset += 2
offset += xcb.type_pad(1, offset)
self.name = xcb.List(parent, offset, self.name_len, 'b', 1)
offset += len(self.name.buf())
xcb._resize_obj(self, offset - base)
class TRIGGER(xcb.Struct):
def __init__(self, parent, offset, size):
xcb.Struct.__init__(self, parent, offset, size)
(self.counter, self.wait_type,) = unpack_from('II', parent, offset)
offset += 8
self.wait_value = INT64(parent, offset, 8)
offset += 8
offset += xcb.type_pad(4, offset)
(self.test_type,) = unpack_from('I', parent, offset)
class WAITCONDITION(xcb.Struct):
def __init__(self, parent, offset, size):
xcb.Struct.__init__(self, parent, offset, size)
self.trigger = TRIGGER(parent, offset, 20)
offset += 20
offset += xcb.type_pad(8, offset)
self.event_threshold = INT64(parent, offset, 8)
class CounterError(xcb.Error):
def __init__(self, parent, offset=0):
xcb.Error.__init__(self, parent, offset)
(self.bad_counter, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB', parent, offset)
class BadCounter(xcb.ProtocolException):
pass
class AlarmError(xcb.Error):
def __init__(self, parent, offset=0):
xcb.Error.__init__(self, parent, offset)
(self.bad_alarm, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB', parent, offset)
class BadAlarm(xcb.ProtocolException):
pass
class InitializeCookie(xcb.Cookie):
pass
class InitializeReply(xcb.Reply):
def __init__(self, parent, offset=0):
xcb.Reply.__init__(self, parent, offset)
(self.major_version, self.minor_version,) = unpack_from('xx2x4xBB22x', parent, offset)
class ListSystemCountersCookie(xcb.Cookie):
pass
class ListSystemCountersReply(xcb.Reply):
def __init__(self, parent, offset=0):
xcb.Reply.__init__(self, parent, offset)
(self.counters_len,) = unpack_from('xx2x4xI20x', parent, offset)
offset += 32
self.counters = xcb.List(parent, offset, self.counters_len, SYSTEMCOUNTER, -1)
class QueryCounterCookie(xcb.Cookie):
pass
class QueryCounterReply(xcb.Reply):
def __init__(self, parent, offset=0):
xcb.Reply.__init__(self, parent, offset)
offset += 8
self.counter_value = INT64(parent, offset, 8)
class QueryAlarmCookie(xcb.Cookie):
pass
class QueryAlarmReply(xcb.Reply):
def __init__(self, parent, offset=0):
xcb.Reply.__init__(self, parent, offset)
offset += 8
self.trigger = TRIGGER(parent, offset, 20)
offset += 20
offset += xcb.type_pad(8, offset)
self.delta = INT64(parent, offset, 8)
offset += 8
offset += xcb.type_pad(4, offset)
(self.events, self.state,) = unpack_from('BB2x', parent, offset)
class GetPriorityCookie(xcb.Cookie):
pass
class GetPriorityReply(xcb.Reply):
def __init__(self, parent, offset=0):
xcb.Reply.__init__(self, parent, offset)
(self.priority,) = unpack_from('xx2x4xi', parent, offset)
class QueryFenceCookie(xcb.Cookie):
pass
class QueryFenceReply(xcb.Reply):
def __init__(self, parent, offset=0):
xcb.Reply.__init__(self, parent, offset)
(self.triggered,) = unpack_from('xx2x4xB23x', parent, offset)
class CounterNotifyEvent(xcb.Event):
def __init__(self, parent, offset=0):
xcb.Event.__init__(self, parent, offset)
(self.kind, self.counter,) = unpack_from('xB2xI', parent, offset)
offset += 8
self.wait_value = INT64(parent, offset, 8)
offset += 8
offset += xcb.type_pad(8, offset)
self.counter_value = INT64(parent, offset, 8)
offset += 8
offset += xcb.type_pad(4, offset)
(self.timestamp, self.count, self.destroyed,) = unpack_from('IHBx', parent, offset)
class AlarmNotifyEvent(xcb.Event):
def __init__(self, parent, offset=0):
xcb.Event.__init__(self, parent, offset)
(self.kind, self.alarm,) = unpack_from('xB2xI', parent, offset)
offset += 8
self.counter_value = INT64(parent, offset, 8)
offset += 8
offset += xcb.type_pad(8, offset)
self.alarm_value = INT64(parent, offset, 8)
offset += 8
offset += xcb.type_pad(4, offset)
(self.timestamp, self.state,) = unpack_from('IB3x', parent, offset)
class syncExtension(xcb.Extension):
def Initialize(self, desired_major_version, desired_minor_version):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xBB', desired_major_version, desired_minor_version))
return self.send_request(xcb.Request(buf.getvalue(), 0, False, True),
InitializeCookie(),
InitializeReply)
def InitializeUnchecked(self, desired_major_version, desired_minor_version):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xBB', desired_major_version, desired_minor_version))
return self.send_request(xcb.Request(buf.getvalue(), 0, False, False),
InitializeCookie(),
InitializeReply)
def ListSystemCounters(self, ):
buf = cStringIO.StringIO()
buf.write(pack('=xx2x', ))
return self.send_request(xcb.Request(buf.getvalue(), 1, False, True),
ListSystemCountersCookie(),
ListSystemCountersReply)
def ListSystemCountersUnchecked(self, ):
buf = cStringIO.StringIO()
buf.write(pack('=xx2x', ))
return self.send_request(xcb.Request(buf.getvalue(), 1, False, False),
ListSystemCountersCookie(),
ListSystemCountersReply)
def CreateCounterChecked(self, id, initial_value):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', id))
for elt in xcb.Iterator(initial_value, 2, 'initial_value', False):
buf.write(pack('=iI', *elt))
return self.send_request(xcb.Request(buf.getvalue(), 2, True, True),
xcb.VoidCookie())
def CreateCounter(self, id, initial_value):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', id))
for elt in xcb.Iterator(initial_value, 2, 'initial_value', False):
buf.write(pack('=iI', *elt))
return self.send_request(xcb.Request(buf.getvalue(), 2, True, False),
xcb.VoidCookie())
def DestroyCounterChecked(self, counter):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', counter))
return self.send_request(xcb.Request(buf.getvalue(), 6, True, True),
xcb.VoidCookie())
def DestroyCounter(self, counter):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', counter))
return self.send_request(xcb.Request(buf.getvalue(), 6, True, False),
xcb.VoidCookie())
def QueryCounter(self, counter):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', counter))
return self.send_request(xcb.Request(buf.getvalue(), 5, False, True),
QueryCounterCookie(),
QueryCounterReply)
def QueryCounterUnchecked(self, counter):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', counter))
return self.send_request(xcb.Request(buf.getvalue(), 5, False, False),
QueryCounterCookie(),
QueryCounterReply)
def AwaitChecked(self, wait_list_len, wait_list):
buf = cStringIO.StringIO()
buf.write(pack('=xx2x', ))
for elt in xcb.Iterator(wait_list, 7, 'wait_list', True):
buf.write(pack('=IIiIIiI', *elt))
return self.send_request(xcb.Request(buf.getvalue(), 7, True, True),
xcb.VoidCookie())
def Await(self, wait_list_len, wait_list):
buf = cStringIO.StringIO()
buf.write(pack('=xx2x', ))
for elt in xcb.Iterator(wait_list, 7, 'wait_list', True):
buf.write(pack('=IIiIIiI', *elt))
return self.send_request(xcb.Request(buf.getvalue(), 7, True, False),
xcb.VoidCookie())
def ChangeCounterChecked(self, counter, amount):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', counter))
for elt in xcb.Iterator(amount, 2, 'amount', False):
buf.write(pack('=iI', *elt))
return self.send_request(xcb.Request(buf.getvalue(), 4, True, True),
xcb.VoidCookie())
def ChangeCounter(self, counter, amount):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', counter))
for elt in xcb.Iterator(amount, 2, 'amount', False):
buf.write(pack('=iI', *elt))
return self.send_request(xcb.Request(buf.getvalue(), 4, True, False),
xcb.VoidCookie())
def SetCounterChecked(self, counter, value):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', counter))
for elt in xcb.Iterator(value, 2, 'value', False):
buf.write(pack('=iI', *elt))
return self.send_request(xcb.Request(buf.getvalue(), 3, True, True),
xcb.VoidCookie())
def SetCounter(self, counter, value):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', counter))
for elt in xcb.Iterator(value, 2, 'value', False):
buf.write(pack('=iI', *elt))
return self.send_request(xcb.Request(buf.getvalue(), 3, True, False),
xcb.VoidCookie())
def CreateAlarmChecked(self, id, value_mask, value_list):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xII', id, value_mask))
buf.write(str(buffer(array('I', value_list))))
return self.send_request(xcb.Request(buf.getvalue(), 8, True, True),
xcb.VoidCookie())
def CreateAlarm(self, id, value_mask, value_list):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xII', id, value_mask))
buf.write(str(buffer(array('I', value_list))))
return self.send_request(xcb.Request(buf.getvalue(), 8, True, False),
xcb.VoidCookie())
def ChangeAlarmChecked(self, id, value_mask, value_list):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xII', id, value_mask))
buf.write(str(buffer(array('I', value_list))))
return self.send_request(xcb.Request(buf.getvalue(), 9, True, True),
xcb.VoidCookie())
def ChangeAlarm(self, id, value_mask, value_list):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xII', id, value_mask))
buf.write(str(buffer(array('I', value_list))))
return self.send_request(xcb.Request(buf.getvalue(), 9, True, False),
xcb.VoidCookie())
def DestroyAlarmChecked(self, alarm):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', alarm))
return self.send_request(xcb.Request(buf.getvalue(), 11, True, True),
xcb.VoidCookie())
def DestroyAlarm(self, alarm):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', alarm))
return self.send_request(xcb.Request(buf.getvalue(), 11, True, False),
xcb.VoidCookie())
def QueryAlarm(self, alarm):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', alarm))
return self.send_request(xcb.Request(buf.getvalue(), 10, False, True),
QueryAlarmCookie(),
QueryAlarmReply)
def QueryAlarmUnchecked(self, alarm):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', alarm))
return self.send_request(xcb.Request(buf.getvalue(), 10, False, False),
QueryAlarmCookie(),
QueryAlarmReply)
def SetPriorityChecked(self, id, priority):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xIi', id, priority))
return self.send_request(xcb.Request(buf.getvalue(), 12, True, True),
xcb.VoidCookie())
def SetPriority(self, id, priority):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xIi', id, priority))
return self.send_request(xcb.Request(buf.getvalue(), 12, True, False),
xcb.VoidCookie())
def GetPriority(self, id):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', id))
return self.send_request(xcb.Request(buf.getvalue(), 13, False, True),
GetPriorityCookie(),
GetPriorityReply)
def GetPriorityUnchecked(self, id):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', id))
return self.send_request(xcb.Request(buf.getvalue(), 13, False, False),
GetPriorityCookie(),
GetPriorityReply)
def CreateFenceChecked(self, drawable, fence, initially_triggered):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xIIB', drawable, fence, initially_triggered))
return self.send_request(xcb.Request(buf.getvalue(), 14, True, True),
xcb.VoidCookie())
def CreateFence(self, drawable, fence, initially_triggered):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xIIB', drawable, fence, initially_triggered))
return self.send_request(xcb.Request(buf.getvalue(), 14, True, False),
xcb.VoidCookie())
def TriggerFenceChecked(self, fence):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', fence))
return self.send_request(xcb.Request(buf.getvalue(), 15, True, True),
xcb.VoidCookie())
def TriggerFence(self, fence):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', fence))
return self.send_request(xcb.Request(buf.getvalue(), 15, True, False),
xcb.VoidCookie())
def ResetFenceChecked(self, fence):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', fence))
return self.send_request(xcb.Request(buf.getvalue(), 16, True, True),
xcb.VoidCookie())
def ResetFence(self, fence):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', fence))
return self.send_request(xcb.Request(buf.getvalue(), 16, True, False),
xcb.VoidCookie())
def DestroyFenceChecked(self, fence):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', fence))
return self.send_request(xcb.Request(buf.getvalue(), 17, True, True),
xcb.VoidCookie())
def DestroyFence(self, fence):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', fence))
return self.send_request(xcb.Request(buf.getvalue(), 17, True, False),
xcb.VoidCookie())
def QueryFence(self, fence):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', fence))
return self.send_request(xcb.Request(buf.getvalue(), 18, False, True),
QueryFenceCookie(),
QueryFenceReply)
def QueryFenceUnchecked(self, fence):
buf = cStringIO.StringIO()
buf.write(pack('=xx2xI', fence))
return self.send_request(xcb.Request(buf.getvalue(), 18, False, False),
QueryFenceCookie(),
QueryFenceReply)
def AwaitFenceChecked(self, fence_list_len, fence_list):
buf = cStringIO.StringIO()
buf.write(pack('=xx2x', ))
buf.write(str(buffer(array('I', fence_list))))
return self.send_request(xcb.Request(buf.getvalue(), 19, True, True),
xcb.VoidCookie())
def AwaitFence(self, fence_list_len, fence_list):
buf = cStringIO.StringIO()
buf.write(pack('=xx2x', ))
buf.write(str(buffer(array('I', fence_list))))
return self.send_request(xcb.Request(buf.getvalue(), 19, True, False),
xcb.VoidCookie())
_events = {
0 : CounterNotifyEvent,
1 : AlarmNotifyEvent,
}
_errors = {
0 : (CounterError, BadCounter),
1 : (AlarmError, BadAlarm),
}
xcb._add_ext(key, syncExtension, _events, _errors)
|