const/void changes in thread, tabctrl and wave files; wxTabCtrl::InsertItem
now returns bool not int. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@93 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,6 +24,8 @@ window id).
|
|||||||
|
|
||||||
Registry classes (check out wxConfig class - see issues.txt).
|
Registry classes (check out wxConfig class - see issues.txt).
|
||||||
|
|
||||||
|
Change DnD classes to use global symbols, and wxString.
|
||||||
|
|
||||||
Update manual.
|
Update manual.
|
||||||
wxApp changes DONE
|
wxApp changes DONE
|
||||||
wxMenu changes DONE
|
wxMenu changes DONE
|
||||||
@@ -37,12 +39,13 @@ Update manual.
|
|||||||
wxMsgCatalog etc.
|
wxMsgCatalog etc.
|
||||||
wxLog
|
wxLog
|
||||||
wxConfig, wxRegKey
|
wxConfig, wxRegKey
|
||||||
wxTabCtrl
|
wxTabCtrl DONE
|
||||||
wxWave
|
wxNotebook
|
||||||
|
wxWave DONE
|
||||||
wxJoystick
|
wxJoystick
|
||||||
wxStatusBar95 and wxFrame status bar functions
|
wxStatusBar95 and wxFrame status bar functions
|
||||||
wxListBox changes (for ownerdraw functionality)
|
wxListBox changes (for ownerdraw functionality)
|
||||||
wxThread
|
wxThread DONE (except for topic overview)
|
||||||
wxString
|
wxString
|
||||||
wxTString
|
wxTString
|
||||||
Drag and drop (change API if required, e.g. const).
|
Drag and drop (change API if required, e.g. const).
|
||||||
|
@@ -37,55 +37,55 @@ class WXDLLEXPORT wxTabCtrl: public wxControl
|
|||||||
* Public interface
|
* Public interface
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxTabCtrl(void);
|
wxTabCtrl();
|
||||||
|
|
||||||
inline wxTabCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
inline wxTabCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
const long style = 0, const wxString& name = "tabCtrl")
|
long style = 0, const wxString& name = "tabCtrl")
|
||||||
{
|
{
|
||||||
Create(parent, id, pos, size, style, name);
|
Create(parent, id, pos, size, style, name);
|
||||||
}
|
}
|
||||||
~wxTabCtrl(void);
|
~wxTabCtrl();
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
|
|
||||||
// Get the selection
|
// Get the selection
|
||||||
int GetSelection(void) const;
|
int GetSelection() const;
|
||||||
|
|
||||||
// Get the associated image list
|
// Get the associated image list
|
||||||
wxImageList* GetImageList(void) const;
|
wxImageList* GetImageList() const;
|
||||||
|
|
||||||
// Get the number of items
|
// Get the number of items
|
||||||
int GetItemCount(void) const;
|
int GetItemCount() const;
|
||||||
|
|
||||||
// Get the rect corresponding to the tab
|
// Get the rect corresponding to the tab
|
||||||
bool GetItemRect(const int item, wxRect& rect) const;
|
bool GetItemRect(int item, wxRect& rect) const;
|
||||||
|
|
||||||
// Get the number of rows
|
// Get the number of rows
|
||||||
int GetRowCount(void) const;
|
int GetRowCount() const;
|
||||||
|
|
||||||
// Get the item text
|
// Get the item text
|
||||||
wxString GetItemText(const int item) const ;
|
wxString GetItemText(int item) const ;
|
||||||
|
|
||||||
// Get the item image
|
// Get the item image
|
||||||
int GetItemImage(const int item) const;
|
int GetItemImage(int item) const;
|
||||||
|
|
||||||
// Get the item data
|
// Get the item data
|
||||||
void* GetItemData(const int item) const;
|
void* GetItemData(int item) const;
|
||||||
|
|
||||||
// Set the selection
|
// Set the selection
|
||||||
int SetSelection(const int item);
|
int SetSelection(int item);
|
||||||
|
|
||||||
// Set the image list
|
// Set the image list
|
||||||
void SetImageList(wxImageList* imageList);
|
void SetImageList(wxImageList* imageList);
|
||||||
|
|
||||||
// Set the text for an item
|
// Set the text for an item
|
||||||
bool SetItemText(const int item, const wxString& text);
|
bool SetItemText(int item, const wxString& text);
|
||||||
|
|
||||||
// Set the image for an item
|
// Set the image for an item
|
||||||
bool SetItemImage(const int item, const int image);
|
bool SetItemImage(int item, int image);
|
||||||
|
|
||||||
// Set the data for an item
|
// Set the data for an item
|
||||||
bool SetItemData(const int item, void* data);
|
bool SetItemData(int item, void* data);
|
||||||
|
|
||||||
// Set the size for a fixed-width tab control
|
// Set the size for a fixed-width tab control
|
||||||
void SetItemSize(const wxSize& size);
|
void SetItemSize(const wxSize& size);
|
||||||
@@ -99,16 +99,16 @@ class WXDLLEXPORT wxTabCtrl: public wxControl
|
|||||||
const long style = 0, const wxString& name = "tabCtrl");
|
const long style = 0, const wxString& name = "tabCtrl");
|
||||||
|
|
||||||
// Delete all items
|
// Delete all items
|
||||||
bool DeleteAllItems(void);
|
bool DeleteAllItems();
|
||||||
|
|
||||||
// Delete an item
|
// Delete an item
|
||||||
bool DeleteItem(const int item);
|
bool DeleteItem(int item);
|
||||||
|
|
||||||
// Hit test
|
// Hit test
|
||||||
int HitTest(const wxPoint& pt, long& flags);
|
int HitTest(const wxPoint& pt, long& flags);
|
||||||
|
|
||||||
// Insert an item
|
// Insert an item
|
||||||
int InsertItem(const int item, const wxString& text, const int imageId = -1, void* data = NULL);
|
bool InsertItem(int item, const wxString& text, int imageId = -1, void* data = NULL);
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
|
||||||
|
@@ -16,22 +16,22 @@
|
|||||||
#pragma interface "wave.h"
|
#pragma interface "wave.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <wx/object.h>
|
#include "wx/object.h"
|
||||||
|
|
||||||
class wxWave : public wxObject
|
class wxWave : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxWave(void);
|
wxWave();
|
||||||
wxWave(const wxString& fileName, bool isResource = FALSE);
|
wxWave(const wxString& fileName, bool isResource = FALSE);
|
||||||
~wxWave(void);
|
~wxWave();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool Create(const wxString& sFileName, bool isResource = FALSE);
|
bool Create(const wxString& fileName, bool isResource = FALSE);
|
||||||
bool IsOk(void) const { return (m_waveData ? TRUE : FALSE); };
|
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
|
||||||
bool Play(bool async = TRUE, bool looped = FALSE) const;
|
bool Play(bool async = TRUE, bool looped = FALSE) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool Free(void);
|
bool Free();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
byte* m_waveData;
|
byte* m_waveData;
|
||||||
|
@@ -43,18 +43,18 @@ class wxMutexInternal;
|
|||||||
class WXDLLEXPORT wxMutex {
|
class WXDLLEXPORT wxMutex {
|
||||||
public:
|
public:
|
||||||
// constructor & destructor
|
// constructor & destructor
|
||||||
wxMutex(void);
|
wxMutex();
|
||||||
~wxMutex(void);
|
~wxMutex();
|
||||||
|
|
||||||
// Lock the mutex.
|
// Lock the mutex.
|
||||||
wxMutexError Lock(void);
|
wxMutexError Lock();
|
||||||
// Try to lock the mutex: if it can't, returns immediately with an error.
|
// Try to lock the mutex: if it can't, returns immediately with an error.
|
||||||
wxMutexError TryLock(void);
|
wxMutexError TryLock();
|
||||||
// Unlock the mutex.
|
// Unlock the mutex.
|
||||||
wxMutexError Unlock(void);
|
wxMutexError Unlock();
|
||||||
|
|
||||||
// Returns true if the mutex is locked.
|
// Returns true if the mutex is locked.
|
||||||
bool IsLocked(void) { return (m_locked > 0); }
|
bool IsLocked() const { return (m_locked > 0); }
|
||||||
protected:
|
protected:
|
||||||
friend class wxCondition;
|
friend class wxCondition;
|
||||||
|
|
||||||
@@ -68,17 +68,17 @@ class wxConditionInternal;
|
|||||||
class WXDLLEXPORT wxCondition {
|
class WXDLLEXPORT wxCondition {
|
||||||
public:
|
public:
|
||||||
// constructor & destructor
|
// constructor & destructor
|
||||||
wxCondition(void);
|
wxCondition();
|
||||||
~wxCondition(void);
|
~wxCondition();
|
||||||
|
|
||||||
// Waits undefinitely.
|
// Waits indefinitely.
|
||||||
void Wait(wxMutex& mutex);
|
void Wait(wxMutex& mutex);
|
||||||
// Waits until a signal is raised or the timeout is elapsed.
|
// Waits until a signal is raised or the timeout is elapsed.
|
||||||
bool Wait(wxMutex& mutex, unsigned long sec, unsigned long nsec);
|
bool Wait(wxMutex& mutex, unsigned long sec, unsigned long nsec);
|
||||||
// Raises a signal: only one "Waiter" is released.
|
// Raises a signal: only one "Waiter" is released.
|
||||||
void Signal(void);
|
void Signal();
|
||||||
// Broadcasts to all "Waiters".
|
// Broadcasts to all "Waiters".
|
||||||
void Broadcast(void);
|
void Broadcast();
|
||||||
private:
|
private:
|
||||||
wxConditionInternal *p_internal;
|
wxConditionInternal *p_internal;
|
||||||
};
|
};
|
||||||
@@ -89,46 +89,46 @@ class wxThreadInternal;
|
|||||||
class WXDLLEXPORT wxThread {
|
class WXDLLEXPORT wxThread {
|
||||||
public:
|
public:
|
||||||
// constructor & destructor.
|
// constructor & destructor.
|
||||||
wxThread(void);
|
wxThread();
|
||||||
virtual ~wxThread(void);
|
virtual ~wxThread();
|
||||||
|
|
||||||
// Create a new thread, this method should check there is only one thread
|
// Create a new thread, this method should check there is only one thread
|
||||||
// running by object.
|
// running by object.
|
||||||
wxThreadError Create(void);
|
wxThreadError Create();
|
||||||
|
|
||||||
// Destroys the thread immediately if the flag DIFFER isn't true.
|
// Destroys the thread immediately if the defer flag isn't true.
|
||||||
wxThreadError Destroy(void);
|
wxThreadError Destroy();
|
||||||
|
|
||||||
// Switches on the DIFFER flag.
|
// Switches on the defer flag.
|
||||||
void DeferDestroy(bool on);
|
void DeferDestroy(bool on);
|
||||||
|
|
||||||
// Waits for the termination of the thread.
|
// Waits for the termination of the thread.
|
||||||
void *Join(void);
|
void *Join();
|
||||||
|
|
||||||
// Sets the priority to "prio". (Warning: The priority can only be set before
|
// Sets the priority to "prio". (Warning: The priority can only be set before
|
||||||
// the thread is created)
|
// the thread is created)
|
||||||
void SetPriority(int prio);
|
void SetPriority(int prio);
|
||||||
// Get the current priority.
|
// Get the current priority.
|
||||||
int GetPriority(void);
|
int GetPriority() const;
|
||||||
|
|
||||||
// Get the thread ID
|
// Get the thread ID
|
||||||
unsigned long GetID(void);
|
unsigned long GetID() const;
|
||||||
|
|
||||||
// Returns true if the thread is alive.
|
// Returns true if the thread is alive.
|
||||||
bool IsAlive(void);
|
bool IsAlive() const;
|
||||||
// Returns true if the thread is the main thread (aka the GUI thread).
|
// Returns true if the thread is the main thread (aka the GUI thread).
|
||||||
static bool IsMain(void);
|
static bool IsMain();
|
||||||
|
|
||||||
// Called when thread exits.
|
// Called when thread exits.
|
||||||
virtual void OnExit(void);
|
virtual void OnExit();
|
||||||
protected:
|
protected:
|
||||||
// In case, the DIFFER flag is true, enables another thread to kill this one.
|
// In case, the DIFFER flag is true, enables another thread to kill this one.
|
||||||
void TestDestroy(void);
|
void TestDestroy();
|
||||||
// Exits from the current thread.
|
// Exits from the current thread.
|
||||||
void Exit(void *status = NULL);
|
void Exit(void *status = NULL);
|
||||||
private:
|
private:
|
||||||
// Entry point for the thread.
|
// Entry point for the thread.
|
||||||
virtual void *Entry(void) = 0;
|
virtual void *Entry() = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class wxThreadInternal;
|
friend class wxThreadInternal;
|
||||||
|
@@ -14,38 +14,38 @@
|
|||||||
|
|
||||||
#include "wx/wx.h"
|
#include "wx/wx.h"
|
||||||
|
|
||||||
wxMutex::wxMutex(void)
|
wxMutex::wxMutex()
|
||||||
{
|
{
|
||||||
m_locked = FALSE;
|
m_locked = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::~wxMutex(void)
|
wxMutex::~wxMutex()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MutexError wxMutex::Lock(void)
|
MutexError wxMutex::Lock()
|
||||||
{
|
{
|
||||||
m_locked = TRUE;
|
m_locked = TRUE;
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
MutexError wxMutex::TryLock(void)
|
MutexError wxMutex::TryLock()
|
||||||
{
|
{
|
||||||
m_locked = TRUE;
|
m_locked = TRUE;
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
MutexError wxMutex::Unlock(void)
|
MutexError wxMutex::Unlock()
|
||||||
{
|
{
|
||||||
m_locked = FALSE;
|
m_locked = FALSE;
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCondition::wxCondition(void)
|
wxCondition::wxCondition()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCondition::~wxCondition(void)
|
wxCondition::~wxCondition()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,11 +59,11 @@ bool wxCondition::Wait(wxMutex& WXUNUSED(mutex), unsigned long WXUNUSED(sec),
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCondition::Signal(void)
|
void wxCondition::Signal()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCondition::Broadcast(void)
|
void wxCondition::Broadcast()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,23 +72,23 @@ struct wxThreadPrivate {
|
|||||||
void* exit_status;
|
void* exit_status;
|
||||||
};
|
};
|
||||||
|
|
||||||
ThreadError wxThread::Create(void)
|
ThreadError wxThread::Create()
|
||||||
{
|
{
|
||||||
p_internal->exit_status = Entry();
|
p_internal->exit_status = Entry();
|
||||||
OnExit();
|
OnExit();
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadError wxThread::Destroy(void)
|
ThreadError wxThread::Destroy()
|
||||||
{
|
{
|
||||||
return RUNNING;
|
return RUNNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::DifferDestroy(void)
|
void wxThread::DeferDestroy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::TestDestroy(void)
|
void wxThread::TestDestroy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,23 +97,23 @@ void *wxThread::Join()
|
|||||||
return p_internal->exit_status;
|
return p_internal->exit_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long wxThread::GetID()
|
unsigned long wxThread::GetID() const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThread::IsMain(void)
|
bool wxThread::IsMain()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThread::IsAlive(void)
|
bool wxThread::IsAlive() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::SetPriority(int WXUNUSED(prio)) { }
|
void wxThread::SetPriority(int WXUNUSED(prio)) { }
|
||||||
int wxThread::GetPriority(void) { }
|
int wxThread::GetPriority() const { }
|
||||||
|
|
||||||
wxMutex wxMainMutex; // controls access to all GUI functions
|
wxMutex wxMainMutex; // controls access to all GUI functions
|
||||||
|
|
||||||
|
@@ -47,14 +47,14 @@ public:
|
|||||||
pthread_mutex_t p_mutex;
|
pthread_mutex_t p_mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxMutex::wxMutex(void)
|
wxMutex::wxMutex()
|
||||||
{
|
{
|
||||||
p_internal = new wxMutexInternal;
|
p_internal = new wxMutexInternal;
|
||||||
pthread_mutex_init(&(p_internal->p_mutex), NULL);
|
pthread_mutex_init(&(p_internal->p_mutex), NULL);
|
||||||
m_locked = false;
|
m_locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::~wxMutex(void)
|
wxMutex::~wxMutex()
|
||||||
{
|
{
|
||||||
if (m_locked)
|
if (m_locked)
|
||||||
pthread_mutex_unlock(&(p_internal->p_mutex));
|
pthread_mutex_unlock(&(p_internal->p_mutex));
|
||||||
@@ -62,7 +62,7 @@ wxMutex::~wxMutex(void)
|
|||||||
delete p_internal;
|
delete p_internal;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutexError wxMutex::Lock(void)
|
wxMutexError wxMutex::Lock()
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ wxMutexError wxMutex::Lock(void)
|
|||||||
return MUTEX_NO_ERROR;
|
return MUTEX_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutexError wxMutex::TryLock(void)
|
wxMutexError wxMutex::TryLock()
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ wxMutexError wxMutex::TryLock(void)
|
|||||||
return MUTEX_NO_ERROR;
|
return MUTEX_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutexError wxMutex::Unlock(void)
|
wxMutexError wxMutex::Unlock()
|
||||||
{
|
{
|
||||||
if (m_locked > 0) m_locked--;
|
if (m_locked > 0) m_locked--;
|
||||||
pthread_mutex_unlock(&(p_internal->p_mutex));
|
pthread_mutex_unlock(&(p_internal->p_mutex));
|
||||||
@@ -104,13 +104,13 @@ public:
|
|||||||
pthread_cond_t p_condition;
|
pthread_cond_t p_condition;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxCondition::wxCondition(void)
|
wxCondition::wxCondition()
|
||||||
{
|
{
|
||||||
p_internal = new wxConditionInternal;
|
p_internal = new wxConditionInternal;
|
||||||
pthread_cond_init(&(p_internal->p_condition), NULL);
|
pthread_cond_init(&(p_internal->p_condition), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCondition::~wxCondition(void)
|
wxCondition::~wxCondition()
|
||||||
{
|
{
|
||||||
pthread_cond_destroy(&(p_internal->p_condition));
|
pthread_cond_destroy(&(p_internal->p_condition));
|
||||||
delete p_internal;
|
delete p_internal;
|
||||||
@@ -130,12 +130,12 @@ bool wxCondition::Wait(wxMutex& mutex, unsigned long sec, unsigned long nsec)
|
|||||||
return (pthread_cond_timedwait(&(p_internal->p_condition), &(mutex.p_internal->p_mutex), &tspec) != ETIMEDOUT);
|
return (pthread_cond_timedwait(&(p_internal->p_condition), &(mutex.p_internal->p_mutex), &tspec) != ETIMEDOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCondition::Signal(void)
|
void wxCondition::Signal()
|
||||||
{
|
{
|
||||||
pthread_cond_signal(&(p_internal->p_condition));
|
pthread_cond_signal(&(p_internal->p_condition));
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCondition::Broadcast(void)
|
void wxCondition::Broadcast()
|
||||||
{
|
{
|
||||||
pthread_cond_broadcast(&(p_internal->p_condition));
|
pthread_cond_broadcast(&(p_internal->p_condition));
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ void wxThread::SetPriority(int prio)
|
|||||||
p_internal->prio = prio;
|
p_internal->prio = prio;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxThread::GetPriority(void)
|
int wxThread::GetPriority() const
|
||||||
{
|
{
|
||||||
return p_internal->prio;
|
return p_internal->prio;
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ void wxThread::DeferDestroy(bool on)
|
|||||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxThreadError wxThread::Destroy(void)
|
wxThreadError wxThread::Destroy()
|
||||||
{
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ void *wxThread::Join()
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long wxThread::GetID()
|
unsigned long wxThread::GetID() const
|
||||||
{
|
{
|
||||||
return (unsigned long)p_internal->thread_id;
|
return (unsigned long)p_internal->thread_id;
|
||||||
}
|
}
|
||||||
@@ -274,7 +274,7 @@ void wxThread::TestDestroy()
|
|||||||
pthread_testcancel();
|
pthread_testcancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThread::IsMain(void)
|
bool wxThread::IsMain() const
|
||||||
{
|
{
|
||||||
return (bool)pthread_equal(pthread_self(), p_mainid);
|
return (bool)pthread_equal(pthread_self(), p_mainid);
|
||||||
}
|
}
|
||||||
@@ -300,7 +300,7 @@ void wxThread::OnExit()
|
|||||||
class wxThreadModule : public wxModule {
|
class wxThreadModule : public wxModule {
|
||||||
DECLARE_DYNAMIC_CLASS(wxThreadModule)
|
DECLARE_DYNAMIC_CLASS(wxThreadModule)
|
||||||
public:
|
public:
|
||||||
virtual bool OnInit(void) {
|
virtual bool OnInit() {
|
||||||
wxThreadGuiInit();
|
wxThreadGuiInit();
|
||||||
p_mainid = pthread_self();
|
p_mainid = pthread_self();
|
||||||
wxMainMutex.Lock();
|
wxMainMutex.Lock();
|
||||||
@@ -308,7 +308,7 @@ public:
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnExit(void) {
|
virtual void OnExit() {
|
||||||
wxMainMutex.Unlock();
|
wxMainMutex.Unlock();
|
||||||
wxThreadGuiExit();
|
wxThreadGuiExit();
|
||||||
}
|
}
|
||||||
|
@@ -54,20 +54,20 @@ wxMutex::~wxMutex()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::MutexError wxMutex::Lock(void)
|
wxMutex::MutexError wxMutex::Lock()
|
||||||
{
|
{
|
||||||
spin_lock(&(p_internal->p_mutex));
|
spin_lock(&(p_internal->p_mutex));
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::MutexError wxMutex::TryLock(void)
|
wxMutex::MutexError wxMutex::TryLock()
|
||||||
{
|
{
|
||||||
if (acquire_lock(&(p_internal->p_mutex)) != 0)
|
if (acquire_lock(&(p_internal->p_mutex)) != 0)
|
||||||
return BUSY;
|
return BUSY;
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::MutexError wxMutex::Unlock(void)
|
wxMutex::MutexError wxMutex::Unlock()
|
||||||
{
|
{
|
||||||
release_lock(&(p_internal->p_mutex));
|
release_lock(&(p_internal->p_mutex));
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
@@ -75,13 +75,13 @@ wxMutex::MutexError wxMutex::Unlock(void)
|
|||||||
|
|
||||||
// GLH: Don't now how it works on SGI. Wolfram ?
|
// GLH: Don't now how it works on SGI. Wolfram ?
|
||||||
|
|
||||||
wxCondition::wxCondition(void) {}
|
wxCondition::wxCondition() {}
|
||||||
wxCondition::~wxCondition(void) {}
|
wxCondition::~wxCondition() {}
|
||||||
int wxCondition::Wait(wxMutex& WXUNUSED(mutex)) { return 0;}
|
int wxCondition::Wait(wxMutex& WXUNUSED(mutex)) { return 0;}
|
||||||
int wxCondition::Wait(wxMutex& WXUNUSED(mutex), unsigned long WXUNUSED(sec),
|
int wxCondition::Wait(wxMutex& WXUNUSED(mutex), unsigned long WXUNUSED(sec),
|
||||||
unsigned long WXUNUSED(nsec)) { return 0; }
|
unsigned long WXUNUSED(nsec)) { return 0; }
|
||||||
int wxCondition::Signal(void) { return 0; }
|
int wxCondition::Signal() { return 0; }
|
||||||
int wxCondition::Broadcast(void) { return 0; }
|
int wxCondition::Broadcast() { return 0; }
|
||||||
|
|
||||||
class
|
class
|
||||||
wxThreadPrivate {
|
wxThreadPrivate {
|
||||||
@@ -153,7 +153,7 @@ void *wxThread::Join()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long wxThread::GetID()
|
unsigned long wxThread::GetID() const
|
||||||
{
|
{
|
||||||
return (unsigned long)p_internal->thread_id;
|
return (unsigned long)p_internal->thread_id;
|
||||||
}
|
}
|
||||||
@@ -170,8 +170,9 @@ void wxThread::SetPriority(int prio)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxThread::GetPriority(void)
|
int wxThread::GetPriority() const
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThreadIsMain()
|
bool wxThreadIsMain()
|
||||||
@@ -201,13 +202,13 @@ void wxThread::OnExit()
|
|||||||
class wxThreadModule : public wxModule {
|
class wxThreadModule : public wxModule {
|
||||||
DECLARE_DYNAMIC_CLASS(wxThreadModule)
|
DECLARE_DYNAMIC_CLASS(wxThreadModule)
|
||||||
public:
|
public:
|
||||||
virtual bool OnInit(void) {
|
virtual bool OnInit() {
|
||||||
wxThreadGuiInit();
|
wxThreadGuiInit();
|
||||||
p_mainid = (int)getpid();
|
p_mainid = (int)getpid();
|
||||||
wxMainMutex.Lock();
|
wxMainMutex.Lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnExit(void) {
|
virtual void OnExit() {
|
||||||
wxMainMutex.Unlock();
|
wxMainMutex.Unlock();
|
||||||
wxThreadGuiExit();
|
wxThreadGuiExit();
|
||||||
}
|
}
|
||||||
|
@@ -14,38 +14,38 @@
|
|||||||
|
|
||||||
#include "wx/wx.h"
|
#include "wx/wx.h"
|
||||||
|
|
||||||
wxMutex::wxMutex(void)
|
wxMutex::wxMutex()
|
||||||
{
|
{
|
||||||
m_locked = FALSE;
|
m_locked = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::~wxMutex(void)
|
wxMutex::~wxMutex()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MutexError wxMutex::Lock(void)
|
MutexError wxMutex::Lock()
|
||||||
{
|
{
|
||||||
m_locked = TRUE;
|
m_locked = TRUE;
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
MutexError wxMutex::TryLock(void)
|
MutexError wxMutex::TryLock()
|
||||||
{
|
{
|
||||||
m_locked = TRUE;
|
m_locked = TRUE;
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
MutexError wxMutex::Unlock(void)
|
MutexError wxMutex::Unlock()
|
||||||
{
|
{
|
||||||
m_locked = FALSE;
|
m_locked = FALSE;
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCondition::wxCondition(void)
|
wxCondition::wxCondition()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCondition::~wxCondition(void)
|
wxCondition::~wxCondition()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,11 +59,11 @@ bool wxCondition::Wait(wxMutex& WXUNUSED(mutex), unsigned long WXUNUSED(sec),
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCondition::Signal(void)
|
void wxCondition::Signal()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCondition::Broadcast(void)
|
void wxCondition::Broadcast()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,23 +72,23 @@ struct wxThreadPrivate {
|
|||||||
void* exit_status;
|
void* exit_status;
|
||||||
};
|
};
|
||||||
|
|
||||||
ThreadError wxThread::Create(void)
|
ThreadError wxThread::Create()
|
||||||
{
|
{
|
||||||
p_internal->exit_status = Entry();
|
p_internal->exit_status = Entry();
|
||||||
OnExit();
|
OnExit();
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadError wxThread::Destroy(void)
|
ThreadError wxThread::Destroy()
|
||||||
{
|
{
|
||||||
return RUNNING;
|
return RUNNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::DifferDestroy(void)
|
void wxThread::DeferDestroy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::TestDestroy(void)
|
void wxThread::TestDestroy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,23 +97,23 @@ void *wxThread::Join()
|
|||||||
return p_internal->exit_status;
|
return p_internal->exit_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long wxThread::GetID()
|
unsigned long wxThread::GetID() const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThread::IsMain(void)
|
bool wxThread::IsMain()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThread::IsAlive(void)
|
bool wxThread::IsAlive() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxThread::SetPriority(int WXUNUSED(prio)) { }
|
void wxThread::SetPriority(int WXUNUSED(prio)) { }
|
||||||
int wxThread::GetPriority(void) { }
|
int wxThread::GetPriority() const { }
|
||||||
|
|
||||||
wxMutex wxMainMutex; // controls access to all GUI functions
|
wxMutex wxMainMutex; // controls access to all GUI functions
|
||||||
|
|
||||||
|
@@ -47,14 +47,14 @@ public:
|
|||||||
pthread_mutex_t p_mutex;
|
pthread_mutex_t p_mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxMutex::wxMutex(void)
|
wxMutex::wxMutex()
|
||||||
{
|
{
|
||||||
p_internal = new wxMutexInternal;
|
p_internal = new wxMutexInternal;
|
||||||
pthread_mutex_init(&(p_internal->p_mutex), NULL);
|
pthread_mutex_init(&(p_internal->p_mutex), NULL);
|
||||||
m_locked = false;
|
m_locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::~wxMutex(void)
|
wxMutex::~wxMutex()
|
||||||
{
|
{
|
||||||
if (m_locked)
|
if (m_locked)
|
||||||
pthread_mutex_unlock(&(p_internal->p_mutex));
|
pthread_mutex_unlock(&(p_internal->p_mutex));
|
||||||
@@ -62,7 +62,7 @@ wxMutex::~wxMutex(void)
|
|||||||
delete p_internal;
|
delete p_internal;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutexError wxMutex::Lock(void)
|
wxMutexError wxMutex::Lock()
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ wxMutexError wxMutex::Lock(void)
|
|||||||
return MUTEX_NO_ERROR;
|
return MUTEX_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutexError wxMutex::TryLock(void)
|
wxMutexError wxMutex::TryLock()
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ wxMutexError wxMutex::TryLock(void)
|
|||||||
return MUTEX_NO_ERROR;
|
return MUTEX_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutexError wxMutex::Unlock(void)
|
wxMutexError wxMutex::Unlock()
|
||||||
{
|
{
|
||||||
if (m_locked > 0) m_locked--;
|
if (m_locked > 0) m_locked--;
|
||||||
pthread_mutex_unlock(&(p_internal->p_mutex));
|
pthread_mutex_unlock(&(p_internal->p_mutex));
|
||||||
@@ -104,13 +104,13 @@ public:
|
|||||||
pthread_cond_t p_condition;
|
pthread_cond_t p_condition;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxCondition::wxCondition(void)
|
wxCondition::wxCondition()
|
||||||
{
|
{
|
||||||
p_internal = new wxConditionInternal;
|
p_internal = new wxConditionInternal;
|
||||||
pthread_cond_init(&(p_internal->p_condition), NULL);
|
pthread_cond_init(&(p_internal->p_condition), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCondition::~wxCondition(void)
|
wxCondition::~wxCondition()
|
||||||
{
|
{
|
||||||
pthread_cond_destroy(&(p_internal->p_condition));
|
pthread_cond_destroy(&(p_internal->p_condition));
|
||||||
delete p_internal;
|
delete p_internal;
|
||||||
@@ -130,12 +130,12 @@ bool wxCondition::Wait(wxMutex& mutex, unsigned long sec, unsigned long nsec)
|
|||||||
return (pthread_cond_timedwait(&(p_internal->p_condition), &(mutex.p_internal->p_mutex), &tspec) != ETIMEDOUT);
|
return (pthread_cond_timedwait(&(p_internal->p_condition), &(mutex.p_internal->p_mutex), &tspec) != ETIMEDOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCondition::Signal(void)
|
void wxCondition::Signal()
|
||||||
{
|
{
|
||||||
pthread_cond_signal(&(p_internal->p_condition));
|
pthread_cond_signal(&(p_internal->p_condition));
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCondition::Broadcast(void)
|
void wxCondition::Broadcast()
|
||||||
{
|
{
|
||||||
pthread_cond_broadcast(&(p_internal->p_condition));
|
pthread_cond_broadcast(&(p_internal->p_condition));
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ void wxThread::SetPriority(int prio)
|
|||||||
p_internal->prio = prio;
|
p_internal->prio = prio;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxThread::GetPriority(void)
|
int wxThread::GetPriority() const
|
||||||
{
|
{
|
||||||
return p_internal->prio;
|
return p_internal->prio;
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ void wxThread::DeferDestroy(bool on)
|
|||||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxThreadError wxThread::Destroy(void)
|
wxThreadError wxThread::Destroy()
|
||||||
{
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ void *wxThread::Join()
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long wxThread::GetID()
|
unsigned long wxThread::GetID() const
|
||||||
{
|
{
|
||||||
return (unsigned long)p_internal->thread_id;
|
return (unsigned long)p_internal->thread_id;
|
||||||
}
|
}
|
||||||
@@ -274,7 +274,7 @@ void wxThread::TestDestroy()
|
|||||||
pthread_testcancel();
|
pthread_testcancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThread::IsMain(void)
|
bool wxThread::IsMain() const
|
||||||
{
|
{
|
||||||
return (bool)pthread_equal(pthread_self(), p_mainid);
|
return (bool)pthread_equal(pthread_self(), p_mainid);
|
||||||
}
|
}
|
||||||
@@ -300,7 +300,7 @@ void wxThread::OnExit()
|
|||||||
class wxThreadModule : public wxModule {
|
class wxThreadModule : public wxModule {
|
||||||
DECLARE_DYNAMIC_CLASS(wxThreadModule)
|
DECLARE_DYNAMIC_CLASS(wxThreadModule)
|
||||||
public:
|
public:
|
||||||
virtual bool OnInit(void) {
|
virtual bool OnInit() {
|
||||||
wxThreadGuiInit();
|
wxThreadGuiInit();
|
||||||
p_mainid = pthread_self();
|
p_mainid = pthread_self();
|
||||||
wxMainMutex.Lock();
|
wxMainMutex.Lock();
|
||||||
@@ -308,7 +308,7 @@ public:
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnExit(void) {
|
virtual void OnExit() {
|
||||||
wxMainMutex.Unlock();
|
wxMainMutex.Unlock();
|
||||||
wxThreadGuiExit();
|
wxThreadGuiExit();
|
||||||
}
|
}
|
||||||
|
@@ -54,20 +54,20 @@ wxMutex::~wxMutex()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::MutexError wxMutex::Lock(void)
|
wxMutex::MutexError wxMutex::Lock()
|
||||||
{
|
{
|
||||||
spin_lock(&(p_internal->p_mutex));
|
spin_lock(&(p_internal->p_mutex));
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::MutexError wxMutex::TryLock(void)
|
wxMutex::MutexError wxMutex::TryLock()
|
||||||
{
|
{
|
||||||
if (acquire_lock(&(p_internal->p_mutex)) != 0)
|
if (acquire_lock(&(p_internal->p_mutex)) != 0)
|
||||||
return BUSY;
|
return BUSY;
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::MutexError wxMutex::Unlock(void)
|
wxMutex::MutexError wxMutex::Unlock()
|
||||||
{
|
{
|
||||||
release_lock(&(p_internal->p_mutex));
|
release_lock(&(p_internal->p_mutex));
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
@@ -75,13 +75,13 @@ wxMutex::MutexError wxMutex::Unlock(void)
|
|||||||
|
|
||||||
// GLH: Don't now how it works on SGI. Wolfram ?
|
// GLH: Don't now how it works on SGI. Wolfram ?
|
||||||
|
|
||||||
wxCondition::wxCondition(void) {}
|
wxCondition::wxCondition() {}
|
||||||
wxCondition::~wxCondition(void) {}
|
wxCondition::~wxCondition() {}
|
||||||
int wxCondition::Wait(wxMutex& WXUNUSED(mutex)) { return 0;}
|
int wxCondition::Wait(wxMutex& WXUNUSED(mutex)) { return 0;}
|
||||||
int wxCondition::Wait(wxMutex& WXUNUSED(mutex), unsigned long WXUNUSED(sec),
|
int wxCondition::Wait(wxMutex& WXUNUSED(mutex), unsigned long WXUNUSED(sec),
|
||||||
unsigned long WXUNUSED(nsec)) { return 0; }
|
unsigned long WXUNUSED(nsec)) { return 0; }
|
||||||
int wxCondition::Signal(void) { return 0; }
|
int wxCondition::Signal() { return 0; }
|
||||||
int wxCondition::Broadcast(void) { return 0; }
|
int wxCondition::Broadcast() { return 0; }
|
||||||
|
|
||||||
class
|
class
|
||||||
wxThreadPrivate {
|
wxThreadPrivate {
|
||||||
@@ -153,7 +153,7 @@ void *wxThread::Join()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long wxThread::GetID()
|
unsigned long wxThread::GetID() const
|
||||||
{
|
{
|
||||||
return (unsigned long)p_internal->thread_id;
|
return (unsigned long)p_internal->thread_id;
|
||||||
}
|
}
|
||||||
@@ -170,8 +170,9 @@ void wxThread::SetPriority(int prio)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxThread::GetPriority(void)
|
int wxThread::GetPriority() const
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThreadIsMain()
|
bool wxThreadIsMain()
|
||||||
@@ -201,13 +202,13 @@ void wxThread::OnExit()
|
|||||||
class wxThreadModule : public wxModule {
|
class wxThreadModule : public wxModule {
|
||||||
DECLARE_DYNAMIC_CLASS(wxThreadModule)
|
DECLARE_DYNAMIC_CLASS(wxThreadModule)
|
||||||
public:
|
public:
|
||||||
virtual bool OnInit(void) {
|
virtual bool OnInit() {
|
||||||
wxThreadGuiInit();
|
wxThreadGuiInit();
|
||||||
p_mainid = (int)getpid();
|
p_mainid = (int)getpid();
|
||||||
wxMainMutex.Lock();
|
wxMainMutex.Lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnExit(void) {
|
virtual void OnExit() {
|
||||||
wxMainMutex.Unlock();
|
wxMainMutex.Unlock();
|
||||||
wxThreadGuiExit();
|
wxThreadGuiExit();
|
||||||
}
|
}
|
||||||
|
@@ -58,13 +58,13 @@ BEGIN_EVENT_TABLE(wxTabCtrl, wxControl)
|
|||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxTabCtrl::wxTabCtrl(void)
|
wxTabCtrl::wxTabCtrl()
|
||||||
{
|
{
|
||||||
m_imageList = NULL;
|
m_imageList = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTabCtrl::Create(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size,
|
bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
|
||||||
const long style, const wxString& name)
|
long style, const wxString& name)
|
||||||
{
|
{
|
||||||
m_imageList = NULL;
|
m_imageList = NULL;
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ bool wxTabCtrl::Create(wxWindow *parent, const wxWindowID id, const wxPoint& pos
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTabCtrl::~wxTabCtrl(void)
|
wxTabCtrl::~wxTabCtrl()
|
||||||
{
|
{
|
||||||
UnsubclassWin();
|
UnsubclassWin();
|
||||||
}
|
}
|
||||||
@@ -211,37 +211,37 @@ void wxTabCtrl::OnSysColourChanged(wxSysColourChangedEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete all items
|
// Delete all items
|
||||||
bool wxTabCtrl::DeleteAllItems(void)
|
bool wxTabCtrl::DeleteAllItems()
|
||||||
{
|
{
|
||||||
return ( TabCtrl_DeleteAllItems( (HWND) GetHWND() ) != FALSE );
|
return ( TabCtrl_DeleteAllItems( (HWND) GetHWND() ) != FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete an item
|
// Delete an item
|
||||||
bool wxTabCtrl::DeleteItem(const int item)
|
bool wxTabCtrl::DeleteItem(int item)
|
||||||
{
|
{
|
||||||
return ( TabCtrl_DeleteItem( (HWND) GetHWND(), item) != FALSE );
|
return ( TabCtrl_DeleteItem( (HWND) GetHWND(), item) != FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the selection
|
// Get the selection
|
||||||
int wxTabCtrl::GetSelection(void) const
|
int wxTabCtrl::GetSelection() const
|
||||||
{
|
{
|
||||||
return (int) TabCtrl_GetCurSel( (HWND) GetHWND() );
|
return (int) TabCtrl_GetCurSel( (HWND) GetHWND() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the associated image list
|
// Get the associated image list
|
||||||
wxImageList* wxTabCtrl::GetImageList(void) const
|
wxImageList* wxTabCtrl::GetImageList() const
|
||||||
{
|
{
|
||||||
return m_imageList;
|
return m_imageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the number of items
|
// Get the number of items
|
||||||
int wxTabCtrl::GetItemCount(void) const
|
int wxTabCtrl::GetItemCount() const
|
||||||
{
|
{
|
||||||
return (int) TabCtrl_GetItemCount( (HWND) GetHWND() );
|
return (int) TabCtrl_GetItemCount( (HWND) GetHWND() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the rect corresponding to the tab
|
// Get the rect corresponding to the tab
|
||||||
bool wxTabCtrl::GetItemRect(const int item, wxRect& wxrect) const
|
bool wxTabCtrl::GetItemRect(int item, wxRect& wxrect) const
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
if ( !TabCtrl_GetItemRect( (HWND) GetHWND(), item, & rect) )
|
if ( !TabCtrl_GetItemRect( (HWND) GetHWND(), item, & rect) )
|
||||||
@@ -256,13 +256,13 @@ bool wxTabCtrl::GetItemRect(const int item, wxRect& wxrect) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the number of rows
|
// Get the number of rows
|
||||||
int wxTabCtrl::GetRowCount(void) const
|
int wxTabCtrl::GetRowCount() const
|
||||||
{
|
{
|
||||||
return (int) TabCtrl_GetRowCount( (HWND) GetHWND() );
|
return (int) TabCtrl_GetRowCount( (HWND) GetHWND() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the item text
|
// Get the item text
|
||||||
wxString wxTabCtrl::GetItemText(const int item) const
|
wxString wxTabCtrl::GetItemText(int item) const
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
wxString str("");
|
wxString str("");
|
||||||
@@ -278,7 +278,7 @@ wxString wxTabCtrl::GetItemText(const int item) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the item image
|
// Get the item image
|
||||||
int wxTabCtrl::GetItemImage(const int item) const
|
int wxTabCtrl::GetItemImage(int item) const
|
||||||
{
|
{
|
||||||
TC_ITEM tcItem;
|
TC_ITEM tcItem;
|
||||||
tcItem.mask = TCIF_IMAGE;
|
tcItem.mask = TCIF_IMAGE;
|
||||||
@@ -290,7 +290,7 @@ int wxTabCtrl::GetItemImage(const int item) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the item data
|
// Get the item data
|
||||||
void* wxTabCtrl::GetItemData(const int item) const
|
void* wxTabCtrl::GetItemData(int item) const
|
||||||
{
|
{
|
||||||
TC_ITEM tcItem;
|
TC_ITEM tcItem;
|
||||||
tcItem.mask = TCIF_PARAM;
|
tcItem.mask = TCIF_PARAM;
|
||||||
@@ -321,7 +321,7 @@ int wxTabCtrl::HitTest(const wxPoint& pt, long& flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Insert an item
|
// Insert an item
|
||||||
int wxTabCtrl::InsertItem(const int item, const wxString& text, const int imageId, void* data)
|
bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* data)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
TC_ITEM tcItem;
|
TC_ITEM tcItem;
|
||||||
@@ -340,11 +340,11 @@ int wxTabCtrl::InsertItem(const int item, const wxString& text, const int imageI
|
|||||||
tcItem.iImage = imageId;
|
tcItem.iImage = imageId;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int) TabCtrl_InsertItem( (HWND) GetHWND(), item, & tcItem);
|
return (TabCtrl_InsertItem( (HWND) GetHWND(), item, & tcItem) != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the selection
|
// Set the selection
|
||||||
int wxTabCtrl::SetSelection(const int item)
|
int wxTabCtrl::SetSelection(int item)
|
||||||
{
|
{
|
||||||
return (int) TabCtrl_SetCurSel( (HWND) GetHWND(), item );
|
return (int) TabCtrl_SetCurSel( (HWND) GetHWND(), item );
|
||||||
}
|
}
|
||||||
@@ -357,7 +357,7 @@ void wxTabCtrl::SetImageList(wxImageList* imageList)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the text for an item
|
// Set the text for an item
|
||||||
bool wxTabCtrl::SetItemText(const int item, const wxString& text)
|
bool wxTabCtrl::SetItemText(int item, const wxString& text)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
TC_ITEM tcItem;
|
TC_ITEM tcItem;
|
||||||
@@ -370,7 +370,7 @@ bool wxTabCtrl::SetItemText(const int item, const wxString& text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the image for an item
|
// Set the image for an item
|
||||||
bool wxTabCtrl::SetItemImage(const int item, const int image)
|
bool wxTabCtrl::SetItemImage(int item, int image)
|
||||||
{
|
{
|
||||||
TC_ITEM tcItem;
|
TC_ITEM tcItem;
|
||||||
tcItem.mask = TCIF_IMAGE;
|
tcItem.mask = TCIF_IMAGE;
|
||||||
@@ -380,7 +380,7 @@ bool wxTabCtrl::SetItemImage(const int item, const int image)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the data for an item
|
// Set the data for an item
|
||||||
bool wxTabCtrl::SetItemData(const int item, void* data)
|
bool wxTabCtrl::SetItemData(int item, void* data)
|
||||||
{
|
{
|
||||||
TC_ITEM tcItem;
|
TC_ITEM tcItem;
|
||||||
tcItem.mask = TCIF_PARAM;
|
tcItem.mask = TCIF_PARAM;
|
||||||
|
@@ -52,19 +52,19 @@ public:
|
|||||||
HANDLE p_mutex;
|
HANDLE p_mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxMutex::wxMutex(void)
|
wxMutex::wxMutex()
|
||||||
{
|
{
|
||||||
p_internal = new wxMutexInternal;
|
p_internal = new wxMutexInternal;
|
||||||
p_internal->p_mutex = CreateMutex(NULL, FALSE, NULL);
|
p_internal->p_mutex = CreateMutex(NULL, FALSE, NULL);
|
||||||
m_locked = 0;
|
m_locked = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutex::~wxMutex(void)
|
wxMutex::~wxMutex()
|
||||||
{
|
{
|
||||||
CloseHandle(p_internal->p_mutex);
|
CloseHandle(p_internal->p_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutexError wxMutex::Lock(void)
|
wxMutexError wxMutex::Lock()
|
||||||
{
|
{
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ wxMutexError wxMutex::Lock(void)
|
|||||||
return MUTEX_NO_ERROR;
|
return MUTEX_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutexError wxMutex::TryLock(void)
|
wxMutexError wxMutex::TryLock()
|
||||||
{
|
{
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ wxMutexError wxMutex::TryLock(void)
|
|||||||
return MUTEX_NO_ERROR;
|
return MUTEX_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMutexError wxMutex::Unlock(void)
|
wxMutexError wxMutex::Unlock()
|
||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
@@ -107,14 +107,14 @@ public:
|
|||||||
int waiters;
|
int waiters;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxCondition::wxCondition(void)
|
wxCondition::wxCondition()
|
||||||
{
|
{
|
||||||
p_internal = new wxConditionInternal;
|
p_internal = new wxConditionInternal;
|
||||||
p_internal->event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
p_internal->event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||||
p_internal->waiters = 0;
|
p_internal->waiters = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCondition::~wxCondition(void)
|
wxCondition::~wxCondition()
|
||||||
{
|
{
|
||||||
CloseHandle(p_internal->event);
|
CloseHandle(p_internal->event);
|
||||||
}
|
}
|
||||||
@@ -142,12 +142,12 @@ bool wxCondition::Wait(wxMutex& mutex, unsigned long sec,
|
|||||||
return (ret != WAIT_TIMEOUT);
|
return (ret != WAIT_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCondition::Signal(void)
|
void wxCondition::Signal()
|
||||||
{
|
{
|
||||||
SetEvent(p_internal->event);
|
SetEvent(p_internal->event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCondition::Broadcast(void)
|
void wxCondition::Broadcast()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ DWORD wxThreadInternal::WinThreadStart(LPVOID arg)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxThreadError wxThread::Create(void)
|
wxThreadError wxThread::Create()
|
||||||
{
|
{
|
||||||
int win_prio, prio = p_internal->prio;
|
int win_prio, prio = p_internal->prio;
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ void wxThread::SetPriority(int prio)
|
|||||||
p_internal->prio = prio;
|
p_internal->prio = prio;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxThread::GetPriority(void)
|
int wxThread::GetPriority()
|
||||||
{
|
{
|
||||||
return p_internal->prio;
|
return p_internal->prio;
|
||||||
}
|
}
|
||||||
@@ -268,12 +268,12 @@ void *wxThread::Join()
|
|||||||
return (void *)exit_code;
|
return (void *)exit_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long wxThread::GetID()
|
unsigned long wxThread::GetID() const
|
||||||
{
|
{
|
||||||
return (unsigned long)p_internal->tid;
|
return (unsigned long)p_internal->tid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxThread::IsMain()
|
bool wxThread::IsMain() const
|
||||||
{
|
{
|
||||||
return (GetCurrentThread() == p_mainid);
|
return (GetCurrentThread() == p_mainid);
|
||||||
}
|
}
|
||||||
@@ -304,14 +304,14 @@ void wxThread::OnExit()
|
|||||||
class wxThreadModule : public wxModule {
|
class wxThreadModule : public wxModule {
|
||||||
DECLARE_DYNAMIC_CLASS(wxThreadModule)
|
DECLARE_DYNAMIC_CLASS(wxThreadModule)
|
||||||
public:
|
public:
|
||||||
virtual bool OnInit(void) {
|
virtual bool OnInit() {
|
||||||
p_mainid = GetCurrentThread();
|
p_mainid = GetCurrentThread();
|
||||||
wxMainMutex.Lock();
|
wxMainMutex.Lock();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Global cleanup
|
// Global cleanup
|
||||||
virtual void OnExit(void) {
|
virtual void OnExit() {
|
||||||
wxMainMutex.Unlock();
|
wxMainMutex.Unlock();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -21,12 +21,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include <wx/wx.h>
|
#include "wx/wx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <wx/file.h>
|
#include "wx/file.h"
|
||||||
#include <wx/msw/wave.h>
|
#include "wx/msw/wave.h"
|
||||||
#include <wx/msw/private.h>
|
#include "wx/msw/private.h"
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
@@ -36,10 +36,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUWIN32__
|
#ifdef __GNUWIN32__
|
||||||
#include <wx/msw/gnuwin32/extra.h>
|
#include "wx/msw/gnuwin32/extra.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxWave::wxWave(void)
|
wxWave::wxWave()
|
||||||
: m_waveLength(0), m_isResource(FALSE), m_waveData(NULL)
|
: m_waveLength(0), m_isResource(FALSE), m_waveData(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ wxWave::wxWave(const wxString& sFileName, bool isResource)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxWave::~wxWave(void)
|
wxWave::~wxWave()
|
||||||
{
|
{
|
||||||
Free();
|
Free();
|
||||||
}
|
}
|
||||||
@@ -117,8 +117,7 @@ bool wxWave::Play(bool async, bool looped) const
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool wxWave::Free()
|
||||||
wxWave::Free(void)
|
|
||||||
{
|
{
|
||||||
if (m_waveData)
|
if (m_waveData)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user