use wxEventLoop in wxApp under wxMSW; factored out common code from wxX11/wxMotif/wxMGL to wxAppBase; changed wxApp::Dispatch() return type
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -32,6 +32,8 @@ class WXDLLIMPEXP_BASE wxCmdLineParser;
|
||||
class WXDLLIMPEXP_BASE wxLog;
|
||||
class WXDLLIMPEXP_BASE wxMessageOutput;
|
||||
|
||||
class WXDLLEXPORT wxEventLoop;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// typedefs
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -367,24 +369,27 @@ public:
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
// execute the main GUI loop, the function returns when the loop ends
|
||||
virtual int MainLoop() = 0;
|
||||
virtual int MainLoop();
|
||||
|
||||
// exit the main loop thus terminating the application
|
||||
virtual void Exit();
|
||||
|
||||
// exit the main GUI loop during the next iteration (i.e. it does not
|
||||
// stop the program immediately!)
|
||||
virtual void ExitMainLoop() = 0;
|
||||
virtual void ExitMainLoop();
|
||||
|
||||
// returns TRUE if the program is initialized
|
||||
// returns true if the program is initialized, i.e. OnInit() has been
|
||||
// completed successfully
|
||||
virtual bool Initialized() = 0;
|
||||
|
||||
// returns TRUE if there are unprocessed events in the event queue
|
||||
virtual bool Pending() = 0;
|
||||
virtual bool Pending();
|
||||
|
||||
// process the first event in the event queue (blocks until an event
|
||||
// apperas if there are none currently)
|
||||
virtual void Dispatch() = 0;
|
||||
// appears if there are none currently, use Pending() if this is not
|
||||
// wanted), returns false if the event loop should stop and true
|
||||
// otherwise
|
||||
virtual bool Dispatch();
|
||||
|
||||
// process all currently pending events right now
|
||||
//
|
||||
@@ -402,7 +407,7 @@ public:
|
||||
// parties
|
||||
//
|
||||
// it should return TRUE if more idle events are needed, FALSE if not
|
||||
virtual bool ProcessIdle() ;
|
||||
virtual bool ProcessIdle();
|
||||
|
||||
// Send idle event to window and all subwindows
|
||||
// Returns TRUE if more idle time is requested.
|
||||
@@ -493,6 +498,10 @@ protected:
|
||||
virtual wxAppTraits *CreateTraits();
|
||||
|
||||
|
||||
// the main event loop of the application (may be NULL if the loop hasn't
|
||||
// been started yet or has already terminated)
|
||||
wxEventLoop *m_mainLoop;
|
||||
|
||||
// the main top level window (may be NULL)
|
||||
wxWindow *m_topWindow;
|
||||
|
||||
|
@@ -50,7 +50,7 @@ public:
|
||||
virtual void ExitMainLoop();
|
||||
virtual bool Initialized();
|
||||
virtual bool Pending();
|
||||
virtual void Dispatch();
|
||||
virtual bool Dispatch();
|
||||
|
||||
virtual void Exit();
|
||||
|
||||
|
@@ -45,7 +45,7 @@ public:
|
||||
virtual void ExitMainLoop();
|
||||
virtual bool Initialized();
|
||||
virtual bool Pending();
|
||||
virtual void Dispatch();
|
||||
virtual bool Dispatch();
|
||||
|
||||
virtual void Exit();
|
||||
|
||||
|
@@ -45,7 +45,7 @@ public:
|
||||
virtual void ExitMainLoop();
|
||||
virtual bool Initialized();
|
||||
virtual bool Pending();
|
||||
virtual void Dispatch();
|
||||
virtual bool Dispatch();
|
||||
|
||||
virtual void Exit();
|
||||
|
||||
|
@@ -51,7 +51,7 @@ class WXDLLEXPORT wxApp: public wxAppBase
|
||||
virtual void ExitMainLoop();
|
||||
virtual bool Initialized();
|
||||
virtual bool Pending() ;
|
||||
virtual void Dispatch() ;
|
||||
virtual bool Dispatch() ;
|
||||
|
||||
virtual void Exit();
|
||||
|
||||
|
@@ -42,11 +42,7 @@ public:
|
||||
virtual bool OnInitGui();
|
||||
|
||||
// override base class (pure) virtuals
|
||||
virtual int MainLoop();
|
||||
virtual void ExitMainLoop();
|
||||
virtual bool Initialized();
|
||||
virtual bool Pending();
|
||||
virtual void Dispatch();
|
||||
|
||||
virtual bool Initialize(int& argc, wxChar **argv);
|
||||
virtual void CleanUp();
|
||||
@@ -59,8 +55,7 @@ public:
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
wxEventLoop *m_mainLoop;
|
||||
|
||||
wxDisplayModeInfo m_displayMode;
|
||||
};
|
||||
|
||||
|
@@ -53,8 +53,6 @@ public:
|
||||
virtual int MainLoop();
|
||||
virtual void ExitMainLoop();
|
||||
virtual bool Initialized();
|
||||
virtual bool Pending();
|
||||
virtual void Dispatch();
|
||||
|
||||
virtual void Exit();
|
||||
|
||||
|
@@ -39,11 +39,7 @@ public:
|
||||
virtual bool Initialize(int& argc, wxChar **argv);
|
||||
virtual void CleanUp();
|
||||
|
||||
virtual int MainLoop();
|
||||
virtual void ExitMainLoop();
|
||||
virtual bool Initialized();
|
||||
virtual bool Pending();
|
||||
virtual void Dispatch();
|
||||
|
||||
virtual bool Yield(bool onlyIfNeeded = FALSE);
|
||||
virtual void WakeUpIdle();
|
||||
@@ -67,18 +63,6 @@ public:
|
||||
static bool RegisterWindowClasses();
|
||||
static bool UnregisterWindowClasses();
|
||||
|
||||
// message processing
|
||||
// ------------------
|
||||
|
||||
// process the given message
|
||||
virtual void DoMessage(WXMSG *pMsg);
|
||||
|
||||
// retrieve the next message from the queue and process it
|
||||
virtual bool DoMessage();
|
||||
|
||||
// preprocess the message
|
||||
virtual bool ProcessMessage(WXMSG* pMsg);
|
||||
|
||||
// idle processing
|
||||
// ---------------
|
||||
|
||||
@@ -98,9 +82,6 @@ public:
|
||||
static int m_nCmdShow;
|
||||
|
||||
protected:
|
||||
// we exit the main event loop when this flag becomes false
|
||||
bool m_keepGoing;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_NO_COPY_CLASS(wxApp)
|
||||
};
|
||||
|
@@ -75,7 +75,7 @@ public:
|
||||
virtual void ExitMainLoop(void);
|
||||
virtual bool Initialized(void);
|
||||
virtual bool Pending(void) ;
|
||||
virtual void Dispatch(void);
|
||||
virtual bool Dispatch(void);
|
||||
|
||||
virtual void Exit();
|
||||
|
||||
|
@@ -32,7 +32,6 @@ class WXDLLEXPORT wxWindow;
|
||||
class WXDLLEXPORT wxApp;
|
||||
class WXDLLEXPORT wxKeyEvent;
|
||||
class WXDLLEXPORT wxLog;
|
||||
class WXDLLEXPORT wxEventLoop;
|
||||
class WXDLLEXPORT wxXVisualInfo;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -42,14 +41,14 @@ class WXDLLEXPORT wxXVisualInfo;
|
||||
class WXDLLEXPORT wxApp : public wxAppBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||
|
||||
|
||||
public:
|
||||
wxApp();
|
||||
~wxApp();
|
||||
|
||||
|
||||
// override base class (pure) virtuals
|
||||
// -----------------------------------
|
||||
|
||||
|
||||
virtual int MainLoop();
|
||||
virtual void ExitMainLoop();
|
||||
virtual bool Initialized();
|
||||
@@ -60,45 +59,45 @@ public:
|
||||
|
||||
virtual bool Yield(bool onlyIfNeeded = FALSE);
|
||||
virtual void WakeUpIdle();
|
||||
|
||||
|
||||
virtual bool OnInitGui();
|
||||
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
|
||||
|
||||
// Processes an X event.
|
||||
virtual bool ProcessXEvent(WXEvent* event);
|
||||
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
virtual void OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg);
|
||||
#endif // __WXDEBUG__
|
||||
|
||||
|
||||
protected:
|
||||
bool m_showOnInit;
|
||||
|
||||
|
||||
public:
|
||||
// Implementation
|
||||
virtual bool Initialize(int& argc, wxChar **argv);
|
||||
virtual void CleanUp();
|
||||
|
||||
|
||||
WXWindow GetTopLevelWidget() const { return m_topLevelWidget; }
|
||||
WXColormap GetMainColormap(WXDisplay* display);
|
||||
long GetMaxRequestSize() const { return m_maxRequestSize; }
|
||||
|
||||
|
||||
// This handler is called when a property change event occurs
|
||||
virtual bool HandlePropertyChange(WXEvent *event);
|
||||
|
||||
|
||||
// Values that can be passed on the command line.
|
||||
// Returns -1, -1 if none specified.
|
||||
const wxSize& GetInitialSize() const { return m_initialSize; }
|
||||
bool GetShowIconic() const { return m_showIconic; }
|
||||
|
||||
|
||||
#if wxUSE_UNICODE
|
||||
// Global context for Pango layout. Either use X11
|
||||
// or use Xft rendering according to GDK_USE_XFT
|
||||
// environment variable
|
||||
PangoContext* GetPangoContext();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
wxXVisualInfo* GetVisualInfo(WXDisplay* display)
|
||||
{
|
||||
@@ -113,21 +112,20 @@ public:
|
||||
|
||||
public:
|
||||
static long sm_lastMessageTime;
|
||||
bool m_showIconic;
|
||||
bool m_showIconic;
|
||||
wxSize m_initialSize;
|
||||
|
||||
#if !wxUSE_NANOX
|
||||
wxXVisualInfo* m_visualInfo;
|
||||
#endif
|
||||
|
||||
|
||||
protected:
|
||||
bool m_keepGoing;
|
||||
|
||||
|
||||
WXWindow m_topLevelWidget;
|
||||
WXColormap m_mainColormap;
|
||||
long m_maxRequestSize;
|
||||
wxEventLoop* m_mainLoop;
|
||||
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user