23 #include "wxgis/base.h"
25 #define wgDELETE(p,func) if(p != NULL) {p->func; delete p; p = NULL;}
26 #define wsDELETE(p) if(p != NULL) {p->Release(); p = NULL;}
27 #define wsSET(mp, p) if(p != NULL) { mp = p; mp->Reference();}else{mp = NULL;}
28 #define wsGET(p) if(p != NULL){p->Reference(); return p;} else{return NULL;}
29 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
31 #define __YEAR__ ((((__DATE__ [7] - '0') * 10 + (__DATE__ [8] - '0')) * 10 \
32 + (__DATE__ [9] - '0')) * 10 + (__DATE__ [10] - '0'))
34 #define VENDOR wxT("wxgis")
43 enum wxGISEnumConfigKey
50 enumGISHKAny = enumGISHKLM | enumGISHKCU
60 enum wxGISEnumMessageType
62 enumGISMessageUnk = 0,
65 enumGISMessageQuestion,
67 enumGISMessageWarning,
76 wxGISEnumMessageType eType;
105 virtual void SetRange(
int range) = 0;
110 virtual int GetRange(
void)
const = 0;
115 virtual void SetValue(
int value) = 0;
120 virtual int GetValue(
void)
const = 0;
125 virtual void Play(
void) = 0;
129 virtual void Stop(
void) = 0;
135 virtual void SetYield(
bool bYield =
false) = 0;
155 virtual void Cancel(
void)
157 m_bIsCanceled =
true;
159 virtual bool Continue(
void){
return !m_bIsCanceled;};
160 virtual void Reset(
void){m_bIsCanceled =
false;};
161 virtual IProgressor*
const GetProgressor(
void){
return m_pProgressor;};
162 virtual void SetProgressor(
IProgressor* pProgressor){m_pProgressor = pProgressor; };
163 virtual void PutMessage(
const wxString &sMessage,
size_t nIndex, wxGISEnumMessageType eType){};
164 virtual wxString GetLastMessage(
void){
return wxEmptyString;};
170 static bool CreateAndRunThread(wxThread*
const pThread, wxString sClassName = wxEmptyString,
const wxString sThreadName = wxEmptyString,
int nPriority = WXTHREAD_DEFAULT_PRIORITY)
172 wxCHECK_MSG(pThread,
false, wxT(
"Input wxThread pointer is null"));
174 if(sClassName.IsEmpty())
175 sClassName = wxString(_(
"wxGISCore"));
176 if ( pThread->Create() != wxTHREAD_NO_ERROR )
178 wxLogError(_(
"%s: Can't create %s Thread!"), sClassName.c_str(), sThreadName.c_str());
181 pThread->SetPriority(nPriority);
182 if(pThread->Run() != wxTHREAD_NO_ERROR )
184 wxLogError(_(
"%s: Can't run %s Thread!"), sClassName.c_str(), sThreadName.c_str());
196 enum wxGISEnumTaskStateType
212 enum wxGISEnumReturnType
214 enumGISReturnkUnk = 0,
221 inline bool IsDoubleEquil(
double a,
double b,
double epsilon = EPSILON )
223 const double diff = a - b;
224 return diff > -epsilon && diff <= epsilon;
virtual ~IProgressor(void)
A destructor.
Definition: core.h:92
virtual void Stop(void)=0
Stop undefined progressor state.
virtual void SetValue(int value)=0
Set progressor position.
virtual void SetYield(bool bYield=false)=0
SetYield Yields control to pending messages in the windowing system.
virtual ~ITrackCancel(void)
A destructor.
Definition: core.h:154
A TrackCancel interface class.
Definition: core.h:144
virtual bool ShowProgress(bool bShow)=0
Show/hide progressor.
Definition: core.h:92
ITrackCancel(void)
A constructor.
Definition: core.h:150
virtual void SetRange(int range)=0
Set progressor range.
virtual void Play(void)=0
Start undefined progressor state.
virtual int GetRange(void) const =0
Set progressor range.
virtual int GetValue(void) const =0
Get progressor position.