def unregister_clients(self, client_specs): num_client_specs = len(client_specs) context = get_internal(self) buf = StringIO.StringIO() buf.write(pack("=xxxxII", context, num_client_specs)) buf.write(make_array(client_specs, "I")) return self.conn.record.send_request(ooxcb.Request(self.conn, buf.getvalue(), 3, True, False), \ ooxcb.VoidCookie())
def create_context(self, context, element_header, client_specs, ranges): num_client_specs = len(client_specs) num_ranges = len(ranges) context = get_internal(context) element_header = get_internal(element_header) buf = StringIO.StringIO() buf.write(pack("=xxxxIBxxxII", context, element_header, num_client_specs, num_ranges)) buf.write(make_array(client_specs, "I")) for elt in ranges: elt.build(buf) return self.conn.record.send_request(ooxcb.Request(self.conn, buf.getvalue(), 1, True, False), \ ooxcb.VoidCookie())
def set_attributes(self, x, y, width, height, border_width, _class, depth, visual, value_mask, value_list): value_mask, value_list = 0, [] if "back_pixmap" in values: value_mask |= 1 value_list.append(get_internal(values["back_pixmap"])) if "back_pixel" in values: value_mask |= 2 value_list.append(values["back_pixel"]) if "border_pixmap" in values: value_mask |= 4 value_list.append(values["border_pixmap"]) if "border_pixel" in values: value_mask |= 8 value_list.append(values["border_pixel"]) if "bit_gravity" in values: value_mask |= 16 value_list.append(values["bit_gravity"]) if "win_gravity" in values: value_mask |= 32 value_list.append(values["win_gravity"]) if "backing_store" in values: value_mask |= 64 value_list.append(values["backing_store"]) if "backing_planes" in values: value_mask |= 128 value_list.append(values["backing_planes"]) if "backing_pixel" in values: value_mask |= 256 value_list.append(values["backing_pixel"]) if "override_redirect" in values: value_mask |= 512 value_list.append(values["override_redirect"]) if "save_under" in values: value_mask |= 1024 value_list.append(values["save_under"]) if "event_mask" in values: value_mask |= 2048 value_list.append(values["event_mask"]) if "dont_propagate" in values: value_mask |= 4096 value_list.append(values["dont_propagate"]) if "colormap" in values: value_mask |= 8192 value_list.append(get_internal(values["colormap"])) if "cursor" in values: value_mask |= 16384 value_list.append(get_internal(values["cursor"])) drawable = get_internal(self) buf = StringIO.StringIO() buf.write(pack("=xxxxIhhHHHBBII", drawable, x, y, width, height, border_width, _class, depth, visual, value_mask)) buf.write(make_array(value_list, "I")) return self.conn.screensaver.send_request(ooxcb.Request(self.conn, buf.getvalue(), 3, True, False), \ ooxcb.VoidCookie())