def _read_xshape(self, x=0, y=0): if not X11Window.displayHasXShape() or not XSHAPE: return {} extents = X11Window.XShapeQueryExtents(self.xid) if not extents: shapelog("read_shape for window %#x: no extents", self.xid) return {} #w,h = X11Window.getGeometry(xid)[2:4] shapelog("read_shape for window %#x: extents=%s", self.xid, extents) bextents = extents[0] cextents = extents[1] if bextents[0]==0 and cextents[0]==0: shapelog("read_shape for window %#x: none enabled", self.xid) return {} v = { "x" : x, "y" : y, "Bounding.extents" : bextents, "Clip.extents" : cextents, } for kind in SHAPE_KIND.keys(): kind_name = SHAPE_KIND[kind] rectangles = X11Window.XShapeGetRectangles(self.xid, kind) v[kind_name+".rectangles"] = rectangles shapelog("_read_shape()=%s", v) return v
def _read_xshape(self, x=0, y=0): if not X11Window.displayHasXShape(): return {} extents = X11Window.XShapeQueryExtents(self.xid) if not extents: shapelog("read_shape for window %#x: no extents", self.xid) return {} #w,h = X11Window.getGeometry(xid)[2:4] shapelog("read_shape for window %#x: extents=%s", self.xid, extents) bextents = extents[0] cextents = extents[1] if bextents[0]==0 and cextents[0]==0: shapelog("read_shape for window %#x: none enabled", self.xid) return {} v = { "x" : x, "y" : y, "Bounding.extents" : bextents, "Clip.extents" : cextents, } for kind in SHAPE_KIND.keys(): kind_name = SHAPE_KIND[kind] rectangles = X11Window.XShapeGetRectangles(self.xid, kind) v[kind_name+".rectangles"] = rectangles shapelog("_read_shape()=%s", v) return v
def dump_xshape(xid): extents = X11Window.XShapeQueryExtents(xid) if not extents: print("read_shape for window %#x: no extents" % xid) return {} v = {} bextents = extents[0] cextents = extents[1] if bextents[0]==0 and cextents[0]==0: print("read_shape for window %#x: none enabled" % xid) return {} v["Bounding.extents"] = bextents v["Clip.extents"] = cextents for kind in SHAPE_KIND.keys(): kind_name = SHAPE_KIND[kind] rectangles = X11Window.XShapeGetRectangles(xid, kind) v[kind_name+".rectangles"] = rectangles print("read_shape()=%s" % v)
def dump_xshape(xid): extents = X11Window.XShapeQueryExtents(xid) if not extents: print("read_shape for window %#x: no extents" % xid) return {} v = {} bextents = extents[0] cextents = extents[1] if bextents[0] == 0 and cextents[0] == 0: print("read_shape for window %#x: none enabled" % xid) return {} v["Bounding.extents"] = bextents v["Clip.extents"] = cextents for kind in SHAPE_KIND.keys(): kind_name = SHAPE_KIND[kind] rectangles = X11Window.XShapeGetRectangles(xid, kind) v[kind_name + ".rectangles"] = rectangles print("read_shape()=%s" % v)
def _read_xshape(self): if not X11Window.displayHasXShape(): return {} extents = X11Window.XShapeQueryExtents(self.xid) if not extents: shapelog("read_shape for window %#x: no extents", self.xid) return {} v = {} #w,h = X11Window.getGeometry(xid)[2:4] bextents = extents[0] cextents = extents[1] if bextents[0] == 0 and cextents[0] == 0: shapelog("read_shape for window %#x: none enabled", self.xid) return {} v["Bounding.extents"] = bextents v["Clip.extents"] = cextents for kind in SHAPE_KIND.keys(): kind_name = SHAPE_KIND[kind] rectangles = X11Window.XShapeGetRectangles(self.xid, kind) v[kind_name + ".rectangles"] = rectangles shapelog("_read_shape()=%s", v) return v