The forward mapping is used when a backend is specified on the IPython commandline (and possible elsewhere), eg.:

```
ipython --pylab=gtk
```

The backward mapping is used when the user chooses a backend in their matplotlibrc file (or some other matplotlib-based mechanism) and we need to choose the mainloop type to install in IPython to match it.

So there's a many to one mapping from matplotlib backends to IPython mainloop types.

Also, perhaps somewhat confusingly, there is a Gtk2 "Gtk" backend that uses gdk for drawing.  Gdk is totally gone in Gtk3 (replaced with Cairo) so Gtk3 only has Gtk3Cairo and Gtk3Agg, whereas Gtk as Gtk (Gdk), GtkCairo and GtkAgg.