+ t=0
+ pressed=False
+
+ if not pressed and self.cached_icons.has_key(angle):
+ return(self.cached_icons[angle])
+
+ w=self.config.iconsize + self.config.iconspace
+ s=cairo.ImageSurface(cairo.FORMAT_ARGB32, w, w)
+ cr0=cairo.Context(s)
+ cr=gtk.gdk.CairoContext(cr0)
+
+ # Paint the background
+ s2=self.mkbg(t)
+ cr.save()
+ cr.set_source_surface(s2, 0, 0)
+ cr.paint()
+ cr.restore()
+
+ # If there is no icon then don't do anything more
+ if self.icon!=None:
+ # Get the icon as a surface (get_sicon() will cache the surface)
+ sicon=self.get_sicon()
+
+ # Width is the iconsize plus the empty border around the icon
+ #w=self.config.iconsize + self.config.iconspace
+
+ # This is used to locate the center of the surface
+ dx=int(w/2)
+
+ # This is the delta from the center where icons are drawn
+ dx2=int(self.config.iconsize/2)
+
+# cr.save()
+
+ # A transformation matrix with dx/dy set to point to the center
+ m=cairo.Matrix(1, 0, 0, 1, dx, dx)
+ cr.set_matrix(m)
+ # Transform degrees to rads
+ rot=-1 * pi * 2 * self.angle / 360
+ cr.rotate(rot)
+ # Draw the icon
+ cr.set_source_surface(sicon, -dx2, -dx2) # Faster than pixbuf
+# cr.set_source_pixbuf(icon2, -dx2, -dx2)
+ cr.paint()
+
+# cr.restore()
+
+ if not pressed:
+ self.cached_icons[angle]=s
+
+ return(s)
+
+
+ def draw(self, cr, x, y):
+ self.draw_queued=False
+ self.x=x
+ self.y=y
+
+ if self.icon==None and not self.isconfig:
+ return