OS/2 thread updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
1999-11-22 05:27:57 +00:00
parent 892b89f3b7
commit 20947e08ca
5 changed files with 32 additions and 19 deletions

View File

@@ -359,7 +359,7 @@ public:
// be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this // be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this
// code if required. // code if required.
#if defined(__AIX__) || defined(__HPUX__) || defined( __VMS__ ) #if defined(__AIX__) || defined(__HPUX__) || defined( __VMS__ ) || defined(__WXPM__)
#define IMPLEMENT_WXWIN_MAIN \ #define IMPLEMENT_WXWIN_MAIN \
extern int wxEntry( int argc, char *argv[] ); \ extern int wxEntry( int argc, char *argv[] ); \
int main(int argc, char *argv[]) { return wxEntry(argc, argv); } int main(int argc, char *argv[]) { return wxEntry(argc, argv); }

View File

@@ -506,7 +506,7 @@ public:
void CopyObject(wxObject& object_dest) const; void CopyObject(wxObject& object_dest) const;
public: public:
int m_commandInt; // Additional information int m_commandInt; // Additional information
long m_extraLong; long m_extraLong;
}; };
// Mouse event class // Mouse event class
@@ -605,10 +605,10 @@ public:
bool Leaving() const { return (m_eventType == wxEVT_LEAVE_WINDOW); } bool Leaving() const { return (m_eventType == wxEVT_LEAVE_WINDOW); }
// Find the position of the event // Find the position of the event
void GetPosition(wxCoord *xpos, wxCoord *ypos) const void GetPosition(wxCoord *xpos, wxCoord *ypos) const
{ {
if (xpos) if (xpos)
*xpos = m_x; *xpos = m_x;
if (ypos) if (ypos)
*ypos = m_y; *ypos = m_y;
} }
@@ -617,7 +617,7 @@ public:
void GetPosition(long *xpos, long *ypos) const void GetPosition(long *xpos, long *ypos) const
{ {
if (xpos) if (xpos)
*xpos = (long)m_x; *xpos = (long)m_x;
if (ypos) if (ypos)
*ypos = (long)m_y; *ypos = (long)m_y;
} }
@@ -631,10 +631,10 @@ public:
// Compatibility // Compatibility
#if WXWIN_COMPATIBILITY #if WXWIN_COMPATIBILITY
void Position(long *xpos, long *ypos) const void Position(long *xpos, long *ypos) const
{ {
if (xpos) if (xpos)
*xpos = (long)m_x; *xpos = (long)m_x;
if (ypos) if (ypos)
*ypos = (long)m_y; *ypos = (long)m_y;
} }
@@ -692,14 +692,14 @@ public:
// Find the position of the event // 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; if (xpos) *xpos = m_x;
if (ypos) *ypos = m_y; if (ypos) *ypos = m_y;
} }
#ifndef __WIN16__ #ifndef __WIN16__
void GetPosition(long *xpos, long *ypos) const 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; if (ypos) *ypos = (long)m_y;
} }
#endif #endif
@@ -1363,7 +1363,7 @@ public:
// process all pending events // process all pending events
void ProcessPendingEvents(); void ProcessPendingEvents();
// add a // add a
#if wxUSE_THREADS #if wxUSE_THREADS
bool ProcessThreadEvent(wxEvent& event); bool ProcessThreadEvent(wxEvent& event);
#endif #endif
@@ -1395,7 +1395,13 @@ public:
bool SearchDynamicEventTable( wxEvent& event ); bool SearchDynamicEventTable( wxEvent& event );
#if wxUSE_THREADS #if wxUSE_THREADS
void ClearEventLocker() { delete m_eventsLocker; m_eventsLocker = NULL; }; void ClearEventLocker()
{
# if !defined(__VISAGECPP__)
delete m_eventsLocker;
m_eventsLocker = NULL;
#endif
};
#endif #endif
// old stuff // old stuff
@@ -1430,7 +1436,11 @@ protected:
wxList* m_dynamicEvents; wxList* m_dynamicEvents;
wxList* m_pendingEvents; wxList* m_pendingEvents;
#if wxUSE_THREADS #if wxUSE_THREADS
#if defined (__VISAGECPP__)
wxCriticalSection m_eventsLocker;
# else
wxCriticalSection* m_eventsLocker; wxCriticalSection* m_eventsLocker;
# endif
#endif #endif
// optimization: instead of using costly IsKindOf() to decide whether we're // optimization: instead of using costly IsKindOf() to decide whether we're

View File

@@ -13,14 +13,14 @@
#ifndef __OS2DNDH__ #ifndef __OS2DNDH__
#define __OS2DNDH__ #define __OS2DNDH__
#ifdef __GNUG__
#pragma interface
#endif
#if !wxUSE_DRAG_AND_DROP #if !wxUSE_DRAG_AND_DROP
#error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!" #error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
#endif //WX_DRAG_DROP #endif //WX_DRAG_DROP
#define INCL_WINSTDDRAG
#include <os2.h>
#include <pmstddlg.h>
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// wxDropSource // wxDropSource
//------------------------------------------------------------------------- //-------------------------------------------------------------------------

View File

@@ -14,10 +14,9 @@
#ifndef _WX_PRIVATE_H_ #ifndef _WX_PRIVATE_H_
#define _WX_PRIVATE_H_ #define _WX_PRIVATE_H_
#define INCL_DOSPROCESS
#define INCL_DOSERRORS
#define INCL_BASE #define INCL_BASE
#define INCL_PM #define INCL_PM
#define INCL_GPI
#include <os2.h> #include <os2.h>
class WXDLLEXPORT wxFont; class WXDLLEXPORT wxFont;

View File

@@ -134,12 +134,14 @@ private:
// in order to avoid any overhead under !MSW make all wxCriticalSection class // in order to avoid any overhead under !MSW make all wxCriticalSection class
// functions inline - but this can't be done under MSW // functions inline - but this can't be done under MSW
#if defined(__WXMSW__) || defined(__WXPM__) #if defined(__WXMSW__)
class WXDLLEXPORT wxCriticalSectionInternal; class WXDLLEXPORT wxCriticalSectionInternal;
#define WXCRITICAL_INLINE #define WXCRITICAL_INLINE
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
class WXDLLEXPORT wxCriticalSectionInternal; class WXDLLEXPORT wxCriticalSectionInternal;
#define WXCRITICAL_INLINE #define WXCRITICAL_INLINE
#elif defined(__WXPM__)
#define WXCRITICAL_INLINE
#else // !MSW && !PM #else // !MSW && !PM
#define WXCRITICAL_INLINE inline #define WXCRITICAL_INLINE inline
#endif // MSW/!MSW #endif // MSW/!MSW
@@ -163,7 +165,7 @@ private:
wxCriticalSection(const wxCriticalSection&); wxCriticalSection(const wxCriticalSection&);
wxCriticalSection& operator=(const wxCriticalSection&); wxCriticalSection& operator=(const wxCriticalSection&);
#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMAC__) #if defined(__WXMSW__) || defined(__WXMAC__)
wxCriticalSectionInternal *m_critsect; wxCriticalSectionInternal *m_critsect;
#else // !MSW #else // !MSW
wxMutex m_mutex; wxMutex m_mutex;
@@ -422,9 +424,11 @@ public:
// returns TRUE if the main thread has GUI lock // returns TRUE if the main thread has GUI lock
extern bool WXDLLEXPORT wxGuiOwnedByMainThread(); extern bool WXDLLEXPORT wxGuiOwnedByMainThread();
// return TRUE if the main thread is waiting for some other to terminate: // return TRUE if the main thread is waiting for some other to terminate:
// wxApp then should block all "dangerous" messages // wxApp then should block all "dangerous" messages
extern bool WXDLLEXPORT wxIsWaitingForThread(); extern bool WXDLLEXPORT wxIsWaitingForThread();
#else // !MSW && !PM #else // !MSW && !PM
// implement wxCriticalSection using mutexes // implement wxCriticalSection using mutexes
inline wxCriticalSection::wxCriticalSection() { } inline wxCriticalSection::wxCriticalSection() { }