1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     wxApp class 
   4 // Author:      Julian Smart 
   8 // Copyright:   (c) Julian Smart 
   9 // Licence:     wxWindows licence 
  10 ///////////////////////////////////////////////////////////////////////////// 
  16 #pragma interface "app.h" 
  22 class WXDLLEXPORT wxFrame
; 
  23 class WXDLLEXPORT wxWindow
; 
  24 class WXDLLEXPORT wxApp 
; 
  25 class WXDLLEXPORT wxKeyEvent
; 
  26 class WXDLLEXPORT wxLog
; 
  28 // Represents the application. Derive OnInit and declare 
  29 // a new App object to start application 
  30 class WXDLLEXPORT wxApp 
: public wxAppBase
 
  32     DECLARE_DYNAMIC_CLASS(wxApp
) 
  38     // override base class (pure) virtuals 
  39     virtual bool Initialize(int& argc
, wxChar 
**argv
); 
  40     virtual void CleanUp(); 
  42     virtual int MainLoop(); 
  43     virtual void ExitMainLoop(); 
  44     virtual bool Initialized(); 
  45     virtual bool Pending(); 
  46     virtual void Dispatch(); 
  48     virtual bool Yield(bool onlyIfNeeded 
= FALSE
); 
  49     virtual void WakeUpIdle(); 
  51     virtual void SetPrintMode(int mode
) { m_printMode 
= mode
; } 
  52     virtual int GetPrintMode() const { return m_printMode
; } 
  54     // implementation only 
  55     void OnIdle(wxIdleEvent
& event
); 
  56     void OnEndSession(wxCloseEvent
& event
); 
  57     void OnQueryEndSession(wxCloseEvent
& event
); 
  60     int    m_printMode
; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT 
  62     /* Windows-specific wxApp definitions */ 
  67     static bool RegisterWindowClasses(); 
  68     static bool UnregisterWindowClasses(); 
  73     // process the given message 
  74     virtual void DoMessage(WXMSG 
*pMsg
); 
  76     // retrieve the next message from the queue and process it 
  77     virtual bool DoMessage(); 
  79     // preprocess the message 
  80     virtual bool ProcessMessage(WXMSG
* pMsg
); 
  86     // initialize the richedit DLL of (at least) given version, return TRUE if 
  87     // ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3) 
  88     static bool InitRichEdit(int version 
= 2); 
  89 #endif // wxUSE_RICHEDIT 
  91     // returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it 
  92     // wasn't found at all 
  93     static int GetComCtl32Version(); 
  96     // the SW_XXX value to be used for the frames opened by the application 
  97     // (currently seems unused which is a bug -- TODO) 
  98     static int m_nCmdShow
; 
 101     // we exit the main event loop when this flag becomes false 
 104     DECLARE_EVENT_TABLE() 
 105     DECLARE_NO_COPY_CLASS(wxApp
) 
 108 int WXDLLEXPORT 
wxEntry(WXHINSTANCE hInstance
, WXHINSTANCE hPrevInstance
, 
 109                         char *lpszCmdLine
, int nCmdShow
);