Insert Cairo surface as new layer.


        Args
        ----

            position (int) : Index position to insert layer at.
            name (str) : Name of layer.
            surface (cairo.Context) : Surface to render.
            alpha (float) : Alpha/transparency level in the range `[0, 1]`.

def insert_surface(self, position, name, surface, alpha=1.):
        '''
        Insert Cairo surface as new layer.


        Args
        ----

            position (int) : Index position to insert layer at.
            name (str) : Name of layer.
            surface (cairo.Context) : Surface to render.
            alpha (float) : Alpha/transparency level in the range `[0, 1]`.
        '''
        if name in self.df_surfaces.index:
            raise NameError('Surface already exists with `name="{}"`.'
                            .format(name))
        self.df_surfaces.loc[name] = surface, alpha

        # Reorder layers such that the new surface is placed at the specified
        # layer position (relative to the background surface).
        surfaces_order = self.df_surfaces.index.values.tolist()
        surfaces_order.remove(name)
        base_index = surfaces_order.index('background') + 1
        if position < 0:
            position = len(surfaces_order) + position
        surfaces_order.insert(base_index + position, name)
        self.reorder_surfaces(surfaces_order)