+
+ # 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)
+
+ # A surface to draw on
+ t_s=cairo.ImageSurface(cairo.FORMAT_ARGB32, w, w)
+
+ # And a context to draw
+ t_cr0=cairo.Context(t_s)
+ t_cr=gtk.gdk.CairoContext(t_cr0)
+
+ # A transformation matrix with dx/dy set to point to the center
+ m=cairo.Matrix(1, 0, 0, 1, dx, dx)
+ t_cr.set_matrix(m)
+ # Transform degrees to rads
+ rot=-1 * pi * 2 * self.angle / 360
+ t_cr.rotate(rot)
+ # Draw the icon
+ t_cr.set_source_pixbuf(icon2, -dx2, -dx2)
+ t_cr.paint()
+
+ # Draw the rotated icon on the main cairo context