1 // This file is part of Golly. 2 // See docs/License.html for the copyright notice. 3 4 #ifndef _WXGOLLY_H_ 5 #define _WXGOLLY_H_ 6 7 // need some forward declarations 8 class lifepoll; 9 class MainFrame; 10 class PatternView; 11 class StatusBar; 12 13 // Define our application class: 14 15 class GollyApp : public wxApp 16 { 17 public: 18 // called on application startup 19 virtual bool OnInit(); 20 21 #ifdef __WXMAC__ 22 // called in response to an open-document event; 23 // eg. when a file is dropped onto the app icon 24 virtual void MacOpenFile(const wxString& fullPath); 25 #endif 26 27 // put app icon in given frame 28 void SetFrameIcon(wxFrame* frame); 29 30 // event poller is used by non-wx modules to process events 31 lifepoll* Poller(); 32 void PollerReset(); 33 void PollerInterrupt(); 34 }; 35 36 DECLARE_APP(GollyApp) // so other files can use wxGetApp 37 38 // At the risk of offending C++ purists, we use some globals to simplify code: 39 // "mainptr->GetRect()" is more readable than "wxGetApp().GetMainFrame()->GetRect()". 40 41 extern MainFrame* mainptr; // main window 42 extern PatternView* viewptr; // current viewport window (possibly a tile) 43 extern PatternView* bigview; // big viewport window (encloses all tiles) 44 extern StatusBar* statusptr; // status bar window 45 extern wxStopWatch* stopwatch; // global stopwatch (started in OnInit) 46 extern bool insideYield; // processing an event via Yield()? 47 48 #endif 49