def FillRectangles(self, op, dst, color, rects_len, rects): buf = cStringIO.StringIO() buf.write(pack('=xx2xB3xI', op, dst)) for elt in xcb.Iterator(color, 4, 'color', False): buf.write(pack('=HHHH', *elt)) for elt in xcb.Iterator(rects, 4, 'rects', True): buf.write(pack('=hhHH', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 26, True, False), xcb.VoidCookie())
def CreateConicalGradient(self, picture, center, angle, num_stops, stops, colors): buf = cStringIO.StringIO() buf.write(pack('=xx2xI', picture)) for elt in xcb.Iterator(center, 2, 'center', False): buf.write(pack('=ii', *elt)) buf.write(pack('=iI', angle, num_stops)) buf.write(str(buffer(array('i', stops)))) for elt in xcb.Iterator(colors, 4, 'colors', True): buf.write(pack('=HHHH', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 36, True, False), xcb.VoidCookie())
def CreateLinearGradient(self, picture, p1, p2, num_stops, stops, colors): buf = cStringIO.StringIO() buf.write(pack('=xx2xI', picture)) for elt in xcb.Iterator(p1, 2, 'p1', False): buf.write(pack('=ii', *elt)) for elt in xcb.Iterator(p2, 2, 'p2', False): buf.write(pack('=ii', *elt)) buf.write(pack('=I', num_stops)) buf.write(str(buffer(array('i', stops)))) for elt in xcb.Iterator(colors, 4, 'colors', True): buf.write(pack('=HHHH', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 34, True, False), xcb.VoidCookie())
def CreateRadialGradient(self, picture, inner, outer, inner_radius, outer_radius, num_stops, stops, colors): buf = cStringIO.StringIO() buf.write(pack('=xx2xI', picture)) for elt in xcb.Iterator(inner, 2, 'inner', False): buf.write(pack('=ii', *elt)) for elt in xcb.Iterator(outer, 2, 'outer', False): buf.write(pack('=ii', *elt)) buf.write(pack('=iiI', inner_radius, outer_radius, num_stops)) buf.write(str(buffer(array('i', stops)))) for elt in xcb.Iterator(colors, 4, 'colors', True): buf.write(pack('=HHHH', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 35, True, False), xcb.VoidCookie())
def CreateSolidFill(self, picture, color): buf = cStringIO.StringIO() buf.write(pack('=xx2xI', picture)) for elt in xcb.Iterator(color, 4, 'color', False): buf.write(pack('=HHHH', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 33, True, False), xcb.VoidCookie())
def SetRegion(self, region, rectangles_len, rectangles): buf = cStringIO.StringIO() buf.write(pack('=xx2xI', region)) for elt in xcb.Iterator(rectangles, 4, 'rectangles', True): buf.write(pack('=hhHH', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 11, True, False), xcb.VoidCookie())
def Rectangles(self, operation, destination_kind, ordering, destination_window, x_offset, y_offset, rectangles_len, rectangles): buf = cStringIO.StringIO() buf.write(pack('=xx2xBBBxIhh', operation, destination_kind, ordering, destination_window, x_offset, y_offset)) for elt in xcb.Iterator(rectangles, 4, 'rectangles', True): buf.write(pack('=hhHH', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 1, True, False), xcb.VoidCookie())
def ChangeAlarm(self, id, value_mask, value_list): buf = cStringIO.StringIO() buf.write(pack('=xx2xII', id, value_mask)) for elt in xcb.Iterator(value_list, 8, 'value_list', False): buf.write(pack('=IIiIIiII', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 9, True, False), 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 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 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 AddTraps(self, picture, x_off, y_off, traps_len, traps): buf = cStringIO.StringIO() buf.write(pack('=xx2xIhh', picture, x_off, y_off)) for elt in xcb.Iterator(traps, 6, 'traps', True): buf.write(pack('=iiiiii', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 32, True, False), 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 SetPictureTransform(self, picture, transform): buf = cStringIO.StringIO() buf.write(pack('=xx2xI', picture)) for elt in xcb.Iterator(transform, 9, 'transform', False): buf.write(pack('=iiiiiiiii', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 28, True, False), xcb.VoidCookie())
def CreateAnimCursor(self, cid, cursors_len, cursors): buf = cStringIO.StringIO() buf.write(pack('=xx2xI', cid)) for elt in xcb.Iterator(cursors, 2, 'cursors', True): buf.write(pack('=II', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 31, True, False), xcb.VoidCookie())
def SetPictureClipRectangles(self, picture, clip_x_origin, clip_y_origin, rectangles_len, rectangles): buf = cStringIO.StringIO() buf.write(pack('=xx2xIhh', picture, clip_x_origin, clip_y_origin)) for elt in xcb.Iterator(rectangles, 4, 'rectangles', True): buf.write(pack('=hhHH', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 6, True, False), xcb.VoidCookie())
def RegisterClients(self, context, element_header, num_client_specs, num_ranges, client_specs, ranges): buf = cStringIO.StringIO() buf.write(pack('=xx2xIB3xII', context, element_header, num_client_specs, num_ranges)) buf.write(str(buffer(array('I', client_specs)))) for elt in xcb.Iterator(ranges, 20, 'ranges', True): buf.write(pack('=BBBBBBHHBBHHBBBBBBBB', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 2, True, False), xcb.VoidCookie())
def InvertRegion(self, source, bounds, destination): buf = cStringIO.StringIO() buf.write(pack('=xx2xI', source)) for elt in xcb.Iterator(bounds, 4, 'bounds', False): buf.write(pack('=hhHH', *elt)) buf.write(pack('=I', destination)) return self.send_request(xcb.Request(buf.getvalue(), 16, True, False), xcb.VoidCookie())
def QueryResourceBytesUnchecked(self, client, num_specs, specs): buf = cStringIO.StringIO() buf.write(pack('=xx2xII', client, num_specs)) for elt in xcb.Iterator(specs, 2, 'specs', True): buf.write(pack('=II', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 5, False, False), QueryResourceBytesCookie(), QueryResourceBytesReply)
def QueryClientIds(self, num_specs, specs): buf = cStringIO.StringIO() buf.write(pack('=xx2xI', num_specs)) for elt in xcb.Iterator(specs, 2, 'specs', True): buf.write(pack('=II', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 4, False, True), QueryClientIdsCookie(), QueryClientIdsReply)
def SendUnchecked(self, event, data_type): buf = cStringIO.StringIO() buf.write(pack('=xx2x', )) for elt in xcb.Iterator(event, 0, 'event', False): buf.write(pack('=32x', *elt)) buf.write(pack('=I64x', data_type)) return self.send_request(xcb.Request(buf.getvalue(), 3, False, False), SendCookie(), SendReply)
def TrapezoidsChecked(self, op, src, dst, mask_format, src_x, src_y, traps_len, traps): buf = cStringIO.StringIO() buf.write( pack('=xx2xB3xIIIhh', op, src, dst, mask_format, src_x, src_y)) for elt in xcb.Iterator(traps, 10, 'traps', True): buf.write(pack('=iiiiiiiiii', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 10, True, True), xcb.VoidCookie())
def Triangles(self, op, src, dst, mask_format, src_x, src_y, triangles_len, triangles): buf = cStringIO.StringIO() buf.write( pack('=xx2xB3xIIIhh', op, src, dst, mask_format, src_x, src_y)) for elt in xcb.Iterator(triangles, 6, 'triangles', True): buf.write(pack('=iiiiii', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 11, True, False), xcb.VoidCookie())
def TriFan(self, op, src, dst, mask_format, src_x, src_y, points_len, points): buf = cStringIO.StringIO() buf.write( pack('=xx2xB3xIIIhh', op, src, dst, mask_format, src_x, src_y)) for elt in xcb.Iterator(points, 2, 'points', True): buf.write(pack('=ii', *elt)) return self.send_request(xcb.Request(buf.getvalue(), 13, True, False), xcb.VoidCookie())
def AddGlyphs(self, glyphset, glyphs_len, glyphids, glyphs, data_len, data): buf = cStringIO.StringIO() buf.write(pack('=xx2xII', glyphset, glyphs_len)) buf.write(str(buffer(array('I', glyphids)))) for elt in xcb.Iterator(glyphs, 6, 'glyphs', True): buf.write(pack('=HHhhhh', *elt)) buf.write(str(buffer(array('B', data)))) return self.send_request(xcb.Request(buf.getvalue(), 20, True, False), xcb.VoidCookie())