Example #1
0
 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())
Example #2
0
 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())
Example #3
0
 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())
Example #4
0
 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())
Example #5
0
 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())
Example #6
0
 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())
Example #7
0
 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())
Example #8
0
 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())
Example #9
0
 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())
Example #10
0
 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())
Example #11
0
 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())
Example #12
0
 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())
Example #13
0
 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())
Example #14
0
 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())
Example #15
0
 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())
Example #16
0
 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())
Example #17
0
 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())
Example #18
0
 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())
Example #19
0
 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)
Example #20
0
 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)
Example #21
0
 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)
Example #22
0
 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())
Example #23
0
 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())
Example #24
0
 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())
Example #25
0
 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())