From: David Webster Date: Mon, 22 Nov 1999 05:27:57 +0000 (+0000) Subject: OS/2 thread updates X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/20947e08ca1865197bab22b3b5874fb104ceb16b OS/2 thread updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/app.h b/include/wx/app.h index 0e67028d0d..2ce1cad8bf 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -359,7 +359,7 @@ public: // be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this // code if required. -#if defined(__AIX__) || defined(__HPUX__) || defined( __VMS__ ) +#if defined(__AIX__) || defined(__HPUX__) || defined( __VMS__ ) || defined(__WXPM__) #define IMPLEMENT_WXWIN_MAIN \ extern int wxEntry( int argc, char *argv[] ); \ int main(int argc, char *argv[]) { return wxEntry(argc, argv); } diff --git a/include/wx/event.h b/include/wx/event.h index 93e2619606..59a6470caf 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -506,7 +506,7 @@ public: void CopyObject(wxObject& object_dest) const; public: int m_commandInt; // Additional information - long m_extraLong; + long m_extraLong; }; // Mouse event class @@ -605,10 +605,10 @@ public: bool Leaving() const { return (m_eventType == wxEVT_LEAVE_WINDOW); } // Find the position of the event - void GetPosition(wxCoord *xpos, wxCoord *ypos) const + void GetPosition(wxCoord *xpos, wxCoord *ypos) const { if (xpos) - *xpos = m_x; + *xpos = m_x; if (ypos) *ypos = m_y; } @@ -617,7 +617,7 @@ public: void GetPosition(long *xpos, long *ypos) const { if (xpos) - *xpos = (long)m_x; + *xpos = (long)m_x; if (ypos) *ypos = (long)m_y; } @@ -631,10 +631,10 @@ public: // Compatibility #if WXWIN_COMPATIBILITY - void Position(long *xpos, long *ypos) const + void Position(long *xpos, long *ypos) const { if (xpos) - *xpos = (long)m_x; + *xpos = (long)m_x; if (ypos) *ypos = (long)m_y; } @@ -692,14 +692,14 @@ public: // Find the position of the event void GetPosition(wxCoord *xpos, wxCoord *ypos) const { - if (xpos) *xpos = m_x; + if (xpos) *xpos = m_x; if (ypos) *ypos = m_y; } #ifndef __WIN16__ void GetPosition(long *xpos, long *ypos) const { - if (xpos) *xpos = (long)m_x; + if (xpos) *xpos = (long)m_x; if (ypos) *ypos = (long)m_y; } #endif @@ -1363,7 +1363,7 @@ public: // process all pending events void ProcessPendingEvents(); - // add a + // add a #if wxUSE_THREADS bool ProcessThreadEvent(wxEvent& event); #endif @@ -1395,7 +1395,13 @@ public: bool SearchDynamicEventTable( wxEvent& event ); #if wxUSE_THREADS - void ClearEventLocker() { delete m_eventsLocker; m_eventsLocker = NULL; }; + void ClearEventLocker() + { +# if !defined(__VISAGECPP__) + delete m_eventsLocker; + m_eventsLocker = NULL; +#endif + }; #endif // old stuff @@ -1430,7 +1436,11 @@ protected: wxList* m_dynamicEvents; wxList* m_pendingEvents; #if wxUSE_THREADS +#if defined (__VISAGECPP__) + wxCriticalSection m_eventsLocker; +# else wxCriticalSection* m_eventsLocker; +# endif #endif // optimization: instead of using costly IsKindOf() to decide whether we're diff --git a/include/wx/os2/dnd.h b/include/wx/os2/dnd.h index e72f3e9e9e..ec8277545c 100644 --- a/include/wx/os2/dnd.h +++ b/include/wx/os2/dnd.h @@ -13,14 +13,14 @@ #ifndef __OS2DNDH__ #define __OS2DNDH__ -#ifdef __GNUG__ -#pragma interface -#endif - #if !wxUSE_DRAG_AND_DROP #error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!" #endif //WX_DRAG_DROP +#define INCL_WINSTDDRAG +#include +#include + //------------------------------------------------------------------------- // wxDropSource //------------------------------------------------------------------------- diff --git a/include/wx/os2/private.h b/include/wx/os2/private.h index 9bb08e61f9..a80c7ddfd5 100644 --- a/include/wx/os2/private.h +++ b/include/wx/os2/private.h @@ -14,10 +14,9 @@ #ifndef _WX_PRIVATE_H_ #define _WX_PRIVATE_H_ -#define INCL_DOSPROCESS -#define INCL_DOSERRORS #define INCL_BASE #define INCL_PM +#define INCL_GPI #include class WXDLLEXPORT wxFont; diff --git a/include/wx/thread.h b/include/wx/thread.h index 552e342f0e..af59d0db30 100644 --- a/include/wx/thread.h +++ b/include/wx/thread.h @@ -134,12 +134,14 @@ private: // in order to avoid any overhead under !MSW make all wxCriticalSection class // functions inline - but this can't be done under MSW -#if defined(__WXMSW__) || defined(__WXPM__) +#if defined(__WXMSW__) class WXDLLEXPORT wxCriticalSectionInternal; #define WXCRITICAL_INLINE #elif defined(__WXMAC__) class WXDLLEXPORT wxCriticalSectionInternal; #define WXCRITICAL_INLINE +#elif defined(__WXPM__) + #define WXCRITICAL_INLINE #else // !MSW && !PM #define WXCRITICAL_INLINE inline #endif // MSW/!MSW @@ -163,7 +165,7 @@ private: wxCriticalSection(const wxCriticalSection&); wxCriticalSection& operator=(const wxCriticalSection&); -#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMAC__) +#if defined(__WXMSW__) || defined(__WXMAC__) wxCriticalSectionInternal *m_critsect; #else // !MSW wxMutex m_mutex; @@ -422,9 +424,11 @@ public: // returns TRUE if the main thread has GUI lock extern bool WXDLLEXPORT wxGuiOwnedByMainThread(); + // return TRUE if the main thread is waiting for some other to terminate: // wxApp then should block all "dangerous" messages extern bool WXDLLEXPORT wxIsWaitingForThread(); + #else // !MSW && !PM // implement wxCriticalSection using mutexes inline wxCriticalSection::wxCriticalSection() { }