Split cairo code off into view.py