add common main window class, modify paintclouds to use it