although I changed msw files also, so please wait until this evening if you
want to be sure that it compiles. This change should fix 64 bit compilation
problems, but it would be nice to test it...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@591
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
41 files changed:
virtual bool GetNextEntry (wxString& str, long& lIndex) const = 0;
// get number of entries/subgroups in the current group, with or without
// it's subgroups
virtual bool GetNextEntry (wxString& str, long& lIndex) const = 0;
// get number of entries/subgroups in the current group, with or without
// it's subgroups
- virtual uint GetNumberOfEntries(bool bRecursive = FALSE) const = 0;
- virtual uint GetNumberOfGroups(bool bRecursive = FALSE) const = 0;
+ virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const = 0;
+ virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const = 0;
// tests of existence
// returns TRUE if the group by this name exists
// tests of existence
// returns TRUE if the group by this name exists
class WXDLLEXPORT wxObject;
class WXDLLEXPORT wxEvent;
class WXDLLEXPORT wxObject;
class WXDLLEXPORT wxEvent;
-// Vadim's types - check whether we need them all
-
-/// the type for various indexes (string, arrays, ...)
-typedef unsigned int uint;
-
-/// extended boolean type: { yes, no, may be }
-typedef signed int EBool;
-
-/// with TRUE and FALSE is a possible value for a "3-state" boolean var
-#define UNKNOWN (-1)
- /** symbolic constant used by all Find()-like functions returning positive
+ /** symbolic constant used by all Find()-like functions returning positive
integer on success as failure indicator */
#define NOT_FOUND (-1)
integer on success as failure indicator */
#define NOT_FOUND (-1)
- /** useful for Windows programmers: makes somewhat more clear all these
- zeroes being passed to Windows APIs */
-#define RESERVED (NULL)
// ----------------------------------------------------------------------------
// Error codes
// ----------------------------------------------------------------------------
// Error codes
-#if defined(__UNIX__)
- #define FILE_PATH_SEPARATOR ('/')
-#elif defined(__WXMSW__)
- #define FILE_PATH_SEPARATOR ('\\')
-#else
- #define FILE_PATH_SEPARATOR ('/')
-#endif
-
// ----------------------------------------------------------------------------
// compiler specific settings
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// compiler specific settings
// ----------------------------------------------------------------------------
/// empties the list and releases memory
void Clear();
/// preallocates memory for given number of items
/// empties the list and releases memory
void Clear();
/// preallocates memory for given number of items
- void Alloc(uint uiSize);
+ void Alloc(size_t uiSize);
//@}
/** @name simple accessors */
//@{
/// number of elements in the array
//@}
/** @name simple accessors */
//@{
/// number of elements in the array
- uint Count() const { return m_uiCount; }
+ size_t Count() const { return m_uiCount; }
/// is it empty?
bool IsEmpty() const { return m_uiCount == 0; }
//@}
/// is it empty?
bool IsEmpty() const { return m_uiCount == 0; }
//@}
/** @name items access */
//@{
/// get item at position uiIndex (range checking is done in debug version)
/** @name items access */
//@{
/// get item at position uiIndex (range checking is done in debug version)
- long& Item(uint uiIndex) const
+ long& Item(size_t uiIndex) const
{ wxASSERT( uiIndex < m_uiCount ); return m_pItems[uiIndex]; }
/// same as Item()
{ wxASSERT( uiIndex < m_uiCount ); return m_pItems[uiIndex]; }
/// same as Item()
- long& operator[](uint uiIndex) const { return Item(uiIndex); }
+ long& operator[](size_t uiIndex) const { return Item(uiIndex); }
//@}
/** @name item management */
//@}
/** @name item management */
/// add item assuming the array is sorted with fnCompare function
void Add(long lItem, CMPFUNC fnCompare);
/// add new element at given position (it becomes Item[uiIndex])
/// add item assuming the array is sorted with fnCompare function
void Add(long lItem, CMPFUNC fnCompare);
/// add new element at given position (it becomes Item[uiIndex])
- void Insert(long lItem, uint uiIndex);
+ void Insert(long lItem, size_t uiIndex);
/// remove first item matching this value
void Remove(long lItem);
/// remove item by index
/// remove first item matching this value
void Remove(long lItem);
/// remove item by index
- void Remove(uint uiIndex);
+ void Remove(size_t uiIndex);
//@}
/// sort array elements using given compare function
//@}
/// sort array elements using given compare function
private:
void Grow(); // makes array bigger if needed
private:
void Grow(); // makes array bigger if needed
- uint m_uiSize, // current size of the array
+ size_t m_uiSize, // current size of the array
m_uiCount; // current number of elements
long *m_pItems; // pointer to data
m_uiCount; // current number of elements
long *m_pItems; // pointer to data
{ ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); \
return *this; } \
\
{ ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); \
return *this; } \
\
- T& operator[](uint uiIndex) const \
+ T& operator[](size_t uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
- T& Item(uint uiIndex) const \
+ T& Item(size_t uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
T& Last() const \
{ return (T&)(wxBaseArray::Item(Count() - 1)); } \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
T& Last() const \
{ return (T&)(wxBaseArray::Item(Count() - 1)); } \
\
void Add(T Item) \
{ wxBaseArray::Add((long)Item); } \
\
void Add(T Item) \
{ wxBaseArray::Add((long)Item); } \
- void Insert(T Item, uint uiIndex) \
+ void Insert(T Item, size_t uiIndex) \
{ wxBaseArray::Insert((long)Item, uiIndex) ; } \
\
{ wxBaseArray::Insert((long)Item, uiIndex) ; } \
\
- void Remove(uint uiIndex) { wxBaseArray::Remove(uiIndex); } \
+ void Remove(size_t uiIndex) { wxBaseArray::Remove(uiIndex); } \
void Remove(T Item) \
{ int iIndex = Index(Item); \
wxCHECK2_MSG( iIndex != NOT_FOUND, return, \
"removing inexisting element in wxArray::Remove" ); \
void Remove(T Item) \
{ int iIndex = Index(Item); \
wxCHECK2_MSG( iIndex != NOT_FOUND, return, \
"removing inexisting element in wxArray::Remove" ); \
- wxBaseArray::Remove((uint)iIndex); } \
+ wxBaseArray::Remove((size_t)iIndex); } \
\
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
}
\
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
}
m_fnCompare = src.m_fnCompare; \
return *this; } \
\
m_fnCompare = src.m_fnCompare; \
return *this; } \
\
- T& operator[](uint uiIndex) const \
+ T& operator[](size_t uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
- T& Item(uint uiIndex) const \
+ T& Item(size_t uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
T& Last() const \
{ return (T&)(wxBaseArray::Item(Count() - 1)); } \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
T& Last() const \
{ return (T&)(wxBaseArray::Item(Count() - 1)); } \
void Add(T Item) \
{ wxBaseArray::Add((long)Item, (CMPFUNC)m_fnCompare); } \
\
void Add(T Item) \
{ wxBaseArray::Add((long)Item, (CMPFUNC)m_fnCompare); } \
\
- void Remove(uint uiIndex) { wxBaseArray::Remove(uiIndex); } \
+ void Remove(size_t uiIndex) { wxBaseArray::Remove(uiIndex); } \
void Remove(T Item) \
{ int iIndex = Index(Item); \
wxCHECK2_MSG( iIndex != NOT_FOUND, return, \
"removing inexisting element in wxArray::Remove" ); \
void Remove(T Item) \
{ int iIndex = Index(Item); \
wxCHECK2_MSG( iIndex != NOT_FOUND, return, \
"removing inexisting element in wxArray::Remove" ); \
- wxBaseArray::Remove((uint)iIndex); } \
+ wxBaseArray::Remove((size_t)iIndex); } \
\
private: \
SCMPFUNC##T m_fnCompare; \
\
private: \
SCMPFUNC##T m_fnCompare; \
- T& operator[](uint uiIndex) const \
+ T& operator[](size_t uiIndex) const \
{ return *(T*)wxBaseArray::Item(uiIndex); } \
{ return *(T*)wxBaseArray::Item(uiIndex); } \
- T& Item(uint uiIndex) const \
+ T& Item(size_t uiIndex) const \
{ return *(T*)wxBaseArray::Item(uiIndex); } \
T& Last() const \
{ return *(T*)(wxBaseArray::Item(Count() - 1)); } \
{ return *(T*)wxBaseArray::Item(uiIndex); } \
T& Last() const \
{ return *(T*)(wxBaseArray::Item(Count() - 1)); } \
void Add(const T* pItem) \
{ wxBaseArray::Add((long)pItem); } \
\
void Add(const T* pItem) \
{ wxBaseArray::Add((long)pItem); } \
\
- void Insert(const T& Item, uint uiIndex); \
- void Insert(const T* pItem, uint uiIndex) \
+ void Insert(const T& Item, size_t uiIndex); \
+ void Insert(const T* pItem, size_t uiIndex) \
{ wxBaseArray::Insert((long)pItem, uiIndex); } \
\
void Empty(); \
\
{ wxBaseArray::Insert((long)pItem, uiIndex); } \
\
void Empty(); \
\
- T* Detach(uint uiIndex) \
+ T* Detach(size_t uiIndex) \
{ T* p = (T*)wxBaseArray::Item(uiIndex); \
wxBaseArray::Remove(uiIndex); return p; } \
{ T* p = (T*)wxBaseArray::Item(uiIndex); \
wxBaseArray::Remove(uiIndex); return p; } \
- void Remove(uint uiIndex); \
+ void Remove(size_t uiIndex); \
\
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
\
\
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
\
// returns number of bytes read or ofsInvalid on error
off_t Read(void *pBuf, off_t nCount);
// returns true on success
// returns number of bytes read or ofsInvalid on error
off_t Read(void *pBuf, off_t nCount);
// returns true on success
- uint Write(const void *pBuf, uint nCount);
+ size_t Write(const void *pBuf, size_t nCount);
// returns true on success
bool Write(const wxString& s) { return Write(s.c_str(), s.Len()) != 0; }
// flush data not yet written
// returns true on success
bool Write(const wxString& s) { return Write(s.c_str(), s.Len()) != 0; }
// flush data not yet written
bool IsOpened() const { return m_file.IsOpened(); }
// I/O (both functions return true on success, false on failure)
bool IsOpened() const { return m_file.IsOpened(); }
// I/O (both functions return true on success, false on failure)
- bool Write(const void *p, uint n) { return m_file.Write(p, n) != 0; }
+ bool Write(const void *p, size_t n) { return m_file.Write(p, n) != 0; }
bool Write(const wxString& str) { return m_file.Write(str); }
// different ways to close the file
bool Write(const wxString& str) { return m_file.Write(str); }
// different ways to close the file
virtual bool GetFirstEntry(wxString& str, long& lIndex) const;
virtual bool GetNextEntry (wxString& str, long& lIndex) const;
virtual bool GetFirstEntry(wxString& str, long& lIndex) const;
virtual bool GetNextEntry (wxString& str, long& lIndex) const;
- virtual uint GetNumberOfEntries(bool bRecursive = FALSE) const;
- virtual uint GetNumberOfGroups(bool bRecursive = FALSE) const;
+ virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const;
+ virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const;
virtual bool HasGroup(const wxString& strName) const;
virtual bool HasEntry(const wxString& strName) const;
virtual bool HasGroup(const wxString& strName) const;
virtual bool HasEntry(const wxString& strName) const;
// StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data
// StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data
- virtual uint GetDataSize() const = 0;
+ virtual size_t GetDataSize() const = 0;
// copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0;
// copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0;
{ return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; }
{ return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; }
- virtual uint GetDataSize() const
+ virtual size_t GetDataSize() const
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
{ return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; }
{ return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; }
- virtual uint GetDataSize() const
+ virtual size_t GetDataSize() const
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
wxImageList* m_imageList;
wxList m_pages;
wxImageList* m_imageList;
wxList m_pages;
- uint m_idHandler; // the change page handler id
+ size_t m_idHandler; // the change page handler id
DECLARE_DYNAMIC_CLASS(wxNotebook)
};
DECLARE_DYNAMIC_CLASS(wxNotebook)
};
return m_childlist.Number();
}
return m_childlist.Number();
}
- guint expand_handler;
- guint collapse_handler;
+ guit expand_handler;
+ guit collapse_handler;
DECLARE_DYNAMIC_CLASS(wxTreeItem)
};
DECLARE_DYNAMIC_CLASS(wxTreeItem)
};
// StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data
// StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data
- virtual uint GetDataSize() const = 0;
+ virtual size_t GetDataSize() const = 0;
// copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0;
// copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0;
{ return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; }
{ return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; }
- virtual uint GetDataSize() const
+ virtual size_t GetDataSize() const
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
{ return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; }
{ return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; }
- virtual uint GetDataSize() const
+ virtual size_t GetDataSize() const
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
wxImageList* m_imageList;
wxList m_pages;
wxImageList* m_imageList;
wxList m_pages;
- uint m_idHandler; // the change page handler id
+ size_t m_idHandler; // the change page handler id
DECLARE_DYNAMIC_CLASS(wxNotebook)
};
DECLARE_DYNAMIC_CLASS(wxNotebook)
};
return m_childlist.Number();
}
return m_childlist.Number();
}
- guint expand_handler;
- guint collapse_handler;
+ guit expand_handler;
+ guit collapse_handler;
DECLARE_DYNAMIC_CLASS(wxTreeItem)
};
DECLARE_DYNAMIC_CLASS(wxTreeItem)
};
// ----------------------------------------------------------------------------
// # adjust if necessary
// ----------------------------------------------------------------------------
// # adjust if necessary
-typedef unsigned char uint8;
-typedef unsigned long uint32;
+typedef unsigned char size_t8;
+typedef unsigned long size_t32;
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
// macros
#endif
typedef wxColour wxColor;
#endif
typedef wxColour wxColor;
-typedef unsigned int uint;
+typedef unsigned int size_t;
// ----------------------------------------------------------------------------
// wxOwnerDrawn - a mix-in base class, derive from it to implement owner-drawn
// ----------------------------------------------------------------------------
// wxOwnerDrawn - a mix-in base class, derive from it to implement owner-drawn
//
// NB: default is too small for bitmaps, but ok for checkmarks.
inline void SetMarginWidth(int nWidth)
//
// NB: default is too small for bitmaps, but ok for checkmarks.
inline void SetMarginWidth(int nWidth)
- { ms_nLastMarginWidth = m_nMarginWidth = (uint) nWidth;
- if ( ((uint) nWidth) != ms_nDefaultMarginWidth ) m_bOwnerDrawn = TRUE; }
+ { ms_nLastMarginWidth = m_nMarginWidth = (size_t) nWidth;
+ if ( ((size_t) nWidth) != ms_nDefaultMarginWidth ) m_bOwnerDrawn = TRUE; }
inline int GetMarginWidth() const { return (int) m_nMarginWidth; }
inline static int GetDefaultMarginWidth() { return (int) ms_nDefaultMarginWidth; }
inline int GetMarginWidth() const { return (int) m_nMarginWidth; }
inline static int GetDefaultMarginWidth() { return (int) ms_nDefaultMarginWidth; }
};
// virtual functions to implement drawing (return TRUE if processed)
};
// virtual functions to implement drawing (return TRUE if processed)
- virtual bool OnMeasureItem(uint *pwidth, uint *pheight);
+ virtual bool OnMeasureItem(size_t *pwidth, size_t *pheight);
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
protected:
wxString m_strName; // label for a manu item
private:
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
protected:
wxString m_strName; // label for a manu item
private:
- static uint ms_nDefaultMarginWidth; // menu check mark width
- static uint ms_nLastMarginWidth; // handy for aligning all items
+ static size_t ms_nDefaultMarginWidth; // menu check mark width
+ static size_t ms_nLastMarginWidth; // handy for aligning all items
bool m_bCheckable, // used only for menu or check listbox items
m_bOwnerDrawn; // true if something is non standard
bool m_bCheckable, // used only for menu or check listbox items
m_bOwnerDrawn; // true if something is non standard
wxBitmap m_bmpChecked, // bitmap to put near the item
m_bmpUnchecked; // (checked is used also for 'uncheckable' items)
wxBitmap m_bmpChecked, // bitmap to put near the item
m_bmpUnchecked; // (checked is used also for 'uncheckable' items)
- uint m_nHeight, // font height
+ size_t m_nHeight, // font height
m_nMarginWidth; // space occupied by bitmap to the left of the item
};
m_nMarginWidth; // space occupied by bitmap to the left of the item
};
// StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data
// StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data
- virtual uint GetDataSize() const = 0;
+ virtual size_t GetDataSize() const = 0;
// copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0;
// copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0;
{ return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; }
{ return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; }
- virtual uint GetDataSize() const
+ virtual size_t GetDataSize() const
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
{ return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; }
{ return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; }
- virtual uint GetDataSize() const
+ virtual size_t GetDataSize() const
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
struct WXDLLEXPORT wxStringData
{
int nRefs; // reference count
struct WXDLLEXPORT wxStringData
{
int nRefs; // reference count
- uint nDataLength, // actual string length
+ size_t nDataLength, // actual string length
nAllocLength; // allocated memory size
// mimics declaration 'char data[nAllocLength]'
nAllocLength; // allocated memory size
// mimics declaration 'char data[nAllocLength]'
/** @name generic attributes & operations */
//@{
/// as standard strlen()
/** @name generic attributes & operations */
//@{
/// as standard strlen()
- uint Len() const { return GetStringData()->nDataLength; }
+ size_t Len() const { return GetStringData()->nDataLength; }
/// string contains any characters?
bool IsEmpty() const { return Len() == 0; }
/// reinitialize string (and free data!)
/// string contains any characters?
bool IsEmpty() const { return Len() == 0; }
/// reinitialize string (and free data!)
@param bReplaceAll: global replace (default) or only the first occurence
@return the number of replacements made
*/
@param bReplaceAll: global replace (default) or only the first occurence
@return the number of replacements made
*/
- uint Replace(const char *szOld, const char *szNew, bool bReplaceAll = TRUE);
+ size_t Replace(const char *szOld, const char *szNew, bool bReplaceAll = TRUE);
//@}
/// check if the string contents matches a mask containing '*' and '?'
//@}
/// check if the string contents matches a mask containing '*' and '?'
//@{
/// ensure that string has space for at least nLen characters
// only works if the data of this string is not shared
//@{
/// ensure that string has space for at least nLen characters
// only works if the data of this string is not shared
+ void Alloc(size_t nLen);
/// minimize the string's memory
// only works if the data of this string is not shared
void Shrink();
/// minimize the string's memory
// only works if the data of this string is not shared
void Shrink();
Unget() *must* be called a.s.a.p. to put string back in a reasonable
state!
*/
Unget() *must* be called a.s.a.p. to put string back in a reasonable
state!
*/
- char *GetWriteBuf(uint nLen);
+ char *GetWriteBuf(size_t nLen);
/// call this immediately after GetWriteBuf() has been used
void UngetWriteBuf();
//@}
/// call this immediately after GetWriteBuf() has been used
void UngetWriteBuf();
//@}
/** @name simple accessors */
//@{
/// number of elements in the array
/** @name simple accessors */
//@{
/// number of elements in the array
- uint Count() const { return m_nCount; }
+ size_t Count() const { return m_nCount; }
/// is it empty?
bool IsEmpty() const { return m_nCount == 0; }
//@}
/// is it empty?
bool IsEmpty() const { return m_nCount == 0; }
//@}
/// add new element at the end
void Add (const wxString& str);
/// add new element at given position
/// add new element at the end
void Add (const wxString& str);
/// add new element at given position
- void Insert(const wxString& str, uint uiIndex);
+ void Insert(const wxString& str, size_t uiIndex);
/// remove first item matching this value
void Remove(const char *sz);
/// remove item by index
/// remove first item matching this value
void Remove(const char *sz);
/// remove item by index
void Grow(); // makes array bigger if needed
void Free(); // free the string stored
void Grow(); // makes array bigger if needed
void Free(); // free the string stored
- size_t m_nSize, // current size of the array
+ size_t m_nSize, // current size of the array
m_nCount; // current number of elements
char **m_pItems; // pointer to data
m_nCount; // current number of elements
char **m_pItems; // pointer to data
-typedef unsigned int uint;
+typedef unsigned int size_t;
class wxCheckListBox : public wxListBox
{
class wxCheckListBox : public wxListBox
{
const wxString& name = wxListBoxNameStr);
// items may be checked
const wxString& name = wxListBoxNameStr);
// items may be checked
- bool IsChecked(uint uiIndex) const;
- void Check(uint uiIndex, bool bCheck = TRUE);
+ bool IsChecked(size_t uiIndex) const;
+ void Check(size_t uiIndex, bool bCheck = TRUE);
// StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data
// StdFormat enumerations or a user-defined format)
virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
// get the (total) size of data
- virtual uint GetDataSize() const = 0;
+ virtual size_t GetDataSize() const = 0;
// copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0;
// copy raw data to provided pointer
virtual void GetDataHere(void *pBuf) const = 0;
{ return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; }
{ return wxDF_TEXT; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_TEXT; }
- virtual uint GetDataSize() const
+ virtual size_t GetDataSize() const
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
{ return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; }
{ return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_FILENAME; }
- virtual uint GetDataSize() const
+ virtual size_t GetDataSize() const
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
// get the number of lines in the file
size_t GetLineCount() const { return m_aLines.Count(); }
// the returned line may be modified (but don't add CR/LF at the end!)
// get the number of lines in the file
size_t GetLineCount() const { return m_aLines.Count(); }
// the returned line may be modified (but don't add CR/LF at the end!)
- wxString& GetLine(uint n) const { return m_aLines[n]; }
- wxString& operator[](uint n) const { return m_aLines[n]; }
+ wxString& GetLine(size_t n) const { return m_aLines[n]; }
+ wxString& operator[](size_t n) const { return m_aLines[n]; }
// get the type of the line (see also GetEOL)
// get the type of the line (see also GetEOL)
- Type GetLineType(uint n) const { return m_aTypes[n]; }
+ Type GetLineType(size_t n) const { return m_aTypes[n]; }
// guess the type of file (m_file is supposed to be opened)
Type GuessType() const;
// get the name of the file
// guess the type of file (m_file is supposed to be opened)
Type GuessType() const;
// get the name of the file
void AddLine(const wxString& str, Type type = typeDefault)
{ m_aLines.Add(str); m_aTypes.Add(type); }
// insert a line before the line number n
void AddLine(const wxString& str, Type type = typeDefault)
{ m_aLines.Add(str); m_aTypes.Add(type); }
// insert a line before the line number n
- void InsertLine(const wxString& str, uint n, Type type = typeDefault)
+ void InsertLine(const wxString& str, size_t n, Type type = typeDefault)
{ m_aLines.Insert(str, n); m_aTypes.Insert(type, n); }
// delete one line
{ m_aLines.Insert(str, n); m_aTypes.Insert(type, n); }
// delete one line
- void RemoveLine(uint n) { m_aLines.Remove(n); m_aTypes.Remove(n); }
+ void RemoveLine(size_t n) { m_aLines.Remove(n); m_aTypes.Remove(n); }
// change the file on disk (default argument means "don't change type")
// possibly in another format
// change the file on disk (default argument means "don't change type")
// possibly in another format
- uint m;
- for ( uint n = 0; n < str.Len(); n++ ) {
+ size_t m;
+ for ( size_t n = 0; n < str.Len(); n++ ) {
switch ( str[n] ) {
#ifdef __WXMSW__
case '%':
switch ( str[n] ) {
#ifdef __WXMSW__
case '%':
else
{
// add 50% but not too much
else
{
// add 50% but not too much
- uint uiIncrement = m_uiSize < WX_ARRAY_DEFAULT_INITIAL_SIZE
+ size_t uiIncrement = m_uiSize < WX_ARRAY_DEFAULT_INITIAL_SIZE
? WX_ARRAY_DEFAULT_INITIAL_SIZE : m_uiSize >> 1;
if ( uiIncrement > ARRAY_MAXSIZE_INCREMENT )
uiIncrement = ARRAY_MAXSIZE_INCREMENT;
? WX_ARRAY_DEFAULT_INITIAL_SIZE : m_uiSize >> 1;
if ( uiIncrement > ARRAY_MAXSIZE_INCREMENT )
uiIncrement = ARRAY_MAXSIZE_INCREMENT;
}
// pre-allocates memory (frees the previous data!)
}
// pre-allocates memory (frees the previous data!)
-void wxBaseArray::Alloc(uint uiSize)
+void wxBaseArray::Alloc(size_t uiSize)
{
wxASSERT( uiSize > 0 );
{
wxASSERT( uiSize > 0 );
{
if ( bFromEnd ) {
if ( m_uiCount > 0 ) {
{
if ( bFromEnd ) {
if ( m_uiCount > 0 ) {
do {
if ( m_pItems[--ui] == lItem )
return ui;
do {
if ( m_pItems[--ui] == lItem )
return ui;
- for( uint ui = 0; ui < m_uiCount; ui++ ) {
+ for( size_t ui = 0; ui < m_uiCount; ui++ ) {
if( m_pItems[ui] == lItem )
return ui;
}
if( m_pItems[ui] == lItem )
return ui;
}
// search for an item in a sorted array (binary search)
int wxBaseArray::Index(long lItem, CMPFUNC fnCompare) const
{
// search for an item in a sorted array (binary search)
int wxBaseArray::Index(long lItem, CMPFUNC fnCompare) const
{
lo = 0,
hi = m_uiCount;
int res;
lo = 0,
hi = m_uiCount;
int res;
// add item assuming the array is sorted with fnCompare function
void wxBaseArray::Add(long lItem, CMPFUNC fnCompare)
{
// add item assuming the array is sorted with fnCompare function
void wxBaseArray::Add(long lItem, CMPFUNC fnCompare)
{
lo = 0,
hi = m_uiCount;
int res;
lo = 0,
hi = m_uiCount;
int res;
}
// add item at the given position
}
// add item at the given position
-void wxBaseArray::Insert(long lItem, uint uiIndex)
+void wxBaseArray::Insert(long lItem, size_t uiIndex)
{
wxCHECK_RET( uiIndex <= m_uiCount, _("bad index in wxArray::Insert") );
{
wxCHECK_RET( uiIndex <= m_uiCount, _("bad index in wxArray::Insert") );
}
// removes item from array (by index)
}
// removes item from array (by index)
-void wxBaseArray::Remove(uint uiIndex)
+void wxBaseArray::Remove(size_t uiIndex)
{
wxCHECK_RET( uiIndex <= m_uiCount, _("bad index in wxArray::Remove") );
{
wxCHECK_RET( uiIndex <= m_uiCount, _("bad index in wxArray::Remove") );
wxCHECK_RET( iIndex != NOT_FOUND,
_("removing inexistent item in wxArray::Remove") );
wxCHECK_RET( iIndex != NOT_FOUND,
_("removing inexistent item in wxArray::Remove") );
+ Remove((size_t)iIndex);
}
// sort array elements using passed comparaison function
}
// sort array elements using passed comparaison function
wxClassLibrary::~wxClassLibrary(void)
{
wxClassLibrary::~wxClassLibrary(void)
{
for (i=0;i<m_list.Count();i++)
delete (m_list[i]);
for (i=0;i<m_list.Count();i++)
delete (m_list[i]);
void wxClassLibrary::UnregisterClass(wxClassInfo *class_info)
{
void wxClassLibrary::UnregisterClass(wxClassInfo *class_info)
{
while (i < m_list.Count()) {
if (m_list[i]->class_info == class_info) {
while (i < m_list.Count()) {
if (m_list[i]->class_info == class_info) {
wxArrayClassInfo& objs)
{
wxClassLibInfo *info;
wxArrayClassInfo& objs)
{
wxClassLibInfo *info;
while (i < m_list.Count()) {
info = m_list[i];
while (i < m_list.Count()) {
info = m_list[i];
wxArrayClassLibInfo& infos)
{
wxClassLibInfo *info;
wxArrayClassLibInfo& infos)
{
wxClassLibInfo *info;
while (i < m_list.Count()) {
info = m_list[i];
while (i < m_list.Count()) {
info = m_list[i];
wxObject *wxClassLibrary::CreateObject(const wxString& path)
{
wxClassLibInfo *info;
wxObject *wxClassLibrary::CreateObject(const wxString& path)
{
wxClassLibInfo *info;
while (i < m_list.Count()) {
info = m_list[i];
while (i < m_list.Count()) {
info = m_list[i];
return wxInvalidOffset;
}
else
return wxInvalidOffset;
}
else
-uint wxFile::Write(const void *pBuf, uint nCount)
+size_t wxFile::Write(const void *pBuf, size_t nCount)
{
wxCHECK( (pBuf != NULL) && IsOpened(), 0 );
{
wxCHECK( (pBuf != NULL) && IsOpened(), 0 );
const char *pEnd;
wxString strLine;
const char *pEnd;
wxString strLine;
- uint nLineCount = file.GetLineCount();
- for ( uint n = 0; n < nLineCount; n++ ) {
+ size_t nLineCount = file.GetLineCount();
+ for ( size_t n = 0; n < nLineCount; n++ ) {
strLine = file[n];
// add the line to linked list
strLine = file[n];
// add the line to linked list
}
// change current group
}
// change current group
m_pCurrentGroup = m_pRootGroup;
for ( n = 0; n < aParts.Count(); n++ ) {
ConfigGroup *pNextGroup = m_pCurrentGroup->FindSubgroup(aParts[n]);
m_pCurrentGroup = m_pRootGroup;
for ( n = 0; n < aParts.Count(); n++ ) {
ConfigGroup *pNextGroup = m_pCurrentGroup->FindSubgroup(aParts[n]);
bool wxFileConfig::GetNextGroup (wxString& str, long& lIndex) const
{
bool wxFileConfig::GetNextGroup (wxString& str, long& lIndex) const
{
- if ( uint(lIndex) < m_pCurrentGroup->Groups().Count() ) {
+ if ( size_t(lIndex) < m_pCurrentGroup->Groups().Count() ) {
str = m_pCurrentGroup->Groups()[lIndex++]->Name();
return TRUE;
}
str = m_pCurrentGroup->Groups()[lIndex++]->Name();
return TRUE;
}
bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const
{
bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const
{
- if ( uint(lIndex) < m_pCurrentGroup->Entries().Count() ) {
+ if ( size_t(lIndex) < m_pCurrentGroup->Entries().Count() ) {
str = m_pCurrentGroup->Entries()[lIndex++]->Name();
return TRUE;
}
str = m_pCurrentGroup->Entries()[lIndex++]->Name();
return TRUE;
}
-uint wxFileConfig::GetNumberOfEntries(bool bRecursive) const
+size_t wxFileConfig::GetNumberOfEntries(bool bRecursive) const
- uint n = m_pCurrentGroup->Entries().Count();
+ size_t n = m_pCurrentGroup->Entries().Count();
if ( bRecursive ) {
ConfigGroup *pOldCurrentGroup = m_pCurrentGroup;
if ( bRecursive ) {
ConfigGroup *pOldCurrentGroup = m_pCurrentGroup;
- uint nSubgroups = m_pCurrentGroup->Groups().Count();
- for ( uint nGroup = 0; nGroup < nSubgroups; nGroup++ ) {
+ size_t nSubgroups = m_pCurrentGroup->Groups().Count();
+ for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) {
CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup];
n += GetNumberOfEntries(TRUE);
CONST_CAST m_pCurrentGroup = pOldCurrentGroup;
CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup];
n += GetNumberOfEntries(TRUE);
CONST_CAST m_pCurrentGroup = pOldCurrentGroup;
-uint wxFileConfig::GetNumberOfGroups(bool bRecursive) const
+size_t wxFileConfig::GetNumberOfGroups(bool bRecursive) const
- uint n = m_pCurrentGroup->Groups().Count();
+ size_t n = m_pCurrentGroup->Groups().Count();
if ( bRecursive ) {
ConfigGroup *pOldCurrentGroup = m_pCurrentGroup;
if ( bRecursive ) {
ConfigGroup *pOldCurrentGroup = m_pCurrentGroup;
- uint nSubgroups = m_pCurrentGroup->Groups().Count();
- for ( uint nGroup = 0; nGroup < nSubgroups; nGroup++ ) {
+ size_t nSubgroups = m_pCurrentGroup->Groups().Count();
+ for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) {
CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup];
n += GetNumberOfGroups(TRUE);
CONST_CAST m_pCurrentGroup = pOldCurrentGroup;
CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup];
n += GetNumberOfGroups(TRUE);
CONST_CAST m_pCurrentGroup = pOldCurrentGroup;
wxFileConfig::ConfigGroup::~ConfigGroup()
{
// entries
wxFileConfig::ConfigGroup::~ConfigGroup()
{
// entries
- uint n, nCount = m_aEntries.Count();
+ size_t n, nCount = m_aEntries.Count();
for ( n = 0; n < nCount; n++ )
delete m_aEntries[n];
for ( n = 0; n < nCount; n++ )
delete m_aEntries[n];
wxFileConfig::ConfigEntry *
wxFileConfig::ConfigGroup::FindEntry(const char *szName) const
{
wxFileConfig::ConfigEntry *
wxFileConfig::ConfigGroup::FindEntry(const char *szName) const
{
lo = 0,
hi = m_aEntries.Count();
int res;
lo = 0,
hi = m_aEntries.Count();
int res;
wxFileConfig::ConfigGroup *
wxFileConfig::ConfigGroup::FindSubgroup(const char *szName) const
{
wxFileConfig::ConfigGroup *
wxFileConfig::ConfigGroup::FindSubgroup(const char *szName) const
{
lo = 0,
hi = m_aSubgroups.Count();
int res;
lo = 0,
hi = m_aSubgroups.Count();
int res;
wxCHECK( pGroup != NULL, FALSE ); // deleting non existing group?
// delete all entries
wxCHECK( pGroup != NULL, FALSE ); // deleting non existing group?
// delete all entries
- uint nCount = pGroup->m_aEntries.Count();
- for ( uint nEntry = 0; nEntry < nCount; nEntry++ ) {
+ size_t nCount = pGroup->m_aEntries.Count();
+ for ( size_t nEntry = 0; nEntry < nCount; nEntry++ ) {
LineList *pLine = pGroup->m_aEntries[nEntry]->GetLine();
if ( pLine != NULL )
m_pConfig->LineListRemove(pLine);
LineList *pLine = pGroup->m_aEntries[nEntry]->GetLine();
if ( pLine != NULL )
m_pConfig->LineListRemove(pLine);
// and subgroups of this sungroup
nCount = pGroup->m_aSubgroups.Count();
// and subgroups of this sungroup
nCount = pGroup->m_aSubgroups.Count();
- for ( uint nGroup = 0; nGroup < nCount; nGroup++ ) {
+ for ( size_t nGroup = 0; nGroup < nCount; nGroup++ ) {
pGroup->DeleteSubgroup(pGroup->m_aSubgroups[nGroup]);
}
pGroup->DeleteSubgroup(pGroup->m_aSubgroups[nGroup]);
}
// go back until we find a subgroup or reach the group's line
ConfigGroup *pNewLast = NULL;
// go back until we find a subgroup or reach the group's line
ConfigGroup *pNewLast = NULL;
- uint n, nSubgroups = m_aSubgroups.Count();
+ size_t n, nSubgroups = m_aSubgroups.Count();
LineList *pl;
for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) {
// is it our subgroup?
LineList *pl;
for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) {
// is it our subgroup?
// go back until we find another entry or reach the group's line
ConfigEntry *pNewLast = NULL;
// go back until we find another entry or reach the group's line
ConfigEntry *pNewLast = NULL;
- uint n, nEntries = m_aEntries.Count();
+ size_t n, nEntries = m_aEntries.Count();
LineList *pl;
for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) {
// is it our subgroup?
LineList *pl;
for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) {
// is it our subgroup?
bool bQuoted = !str.IsEmpty() && str[0] == '"';
bool bQuoted = !str.IsEmpty() && str[0] == '"';
- for ( uint n = bQuoted ? 1 : 0; n < str.Len(); n++ ) {
+ for ( size_t n = bQuoted ? 1 : 0; n < str.Len(); n++ ) {
if ( str[n] == '\\' ) {
switch ( str[++n] ) {
case 'n':
if ( str[n] == '\\' ) {
switch ( str[++n] ) {
case 'n':
strResult += '"';
char c;
strResult += '"';
char c;
- for ( uint n = 0; n < str.Len(); n++ ) {
+ for ( size_t n = 0; n < str.Len(); n++ ) {
switch ( str[n] ) {
case '\n':
c = 'n';
switch ( str[n] ) {
case '\n':
c = 'n';
const char *pSepDos = strrchr(pszFileName, FILE_SEP_PATH_DOS);
// take the last of the two
const char *pSepDos = strrchr(pszFileName, FILE_SEP_PATH_DOS);
// take the last of the two
- uint nPosUnix = pSepUnix ? pSepUnix - pszFileName : 0;
- uint nPosDos = pSepDos ? pSepDos - pszFileName : 0;
+ size_t nPosUnix = pSepUnix ? pSepUnix - pszFileName : 0;
+ size_t nPosDos = pSepDos ? pSepDos - pszFileName : 0;
if ( nPosDos > nPosUnix )
nPosUnix = nPosDos;
if ( nPosDos > nPosUnix )
nPosUnix = nPosDos;
-// uint nLen = Strlen(pszFileName);
+// size_t nLen = Strlen(pszFileName);
if ( pstrPath )
*pstrPath = wxString(pszFileName, nPosUnix);
if ( pDot ) {
if ( pstrPath )
*pstrPath = wxString(pszFileName, nPosUnix);
if ( pDot ) {
- uint nPosDot = pDot - pszFileName;
+ size_t nPosDot = pDot - pszFileName;
if ( pstrName )
*pstrName = wxString(pszFileName + nPosUnix + 1, nPosDot - nPosUnix);
if ( pstrExt )
if ( pstrName )
*pstrName = wxString(pszFileName + nPosUnix + 1, nPosDot - nPosUnix);
if ( pstrExt )
// ----------------------------------------------------------------------------
// magic number identifying the .mo format file
// ----------------------------------------------------------------------------
// magic number identifying the .mo format file
-const uint32 MSGCATALOG_MAGIC = 0x950412de;
-const uint32 MSGCATALOG_MAGIC_SW = 0xde120495;
+const size_t32 MSGCATALOG_MAGIC = 0x950412de;
+const size_t32 MSGCATALOG_MAGIC_SW = 0xde120495;
// extension of ".mo" files
#define MSGCATALOG_EXTENSION ".mo"
// extension of ".mo" files
#define MSGCATALOG_EXTENSION ".mo"
// an entry in the string table
struct wxMsgTableEntry
{
// an entry in the string table
struct wxMsgTableEntry
{
- uint32 nLen; // length of the string
- uint32 ofsString; // pointer to the string
+ size_t32 nLen; // length of the string
+ size_t32 ofsString; // pointer to the string
};
// header of a .mo file
struct wxMsgCatalogHeader
{
};
// header of a .mo file
struct wxMsgCatalogHeader
{
- uint32 magic, // offset +00: magic id
+ size_t32 magic, // offset +00: magic id
revision, // +04: revision
numStrings; // +08: number of strings in the file
revision, // +04: revision
numStrings; // +08: number of strings in the file
- uint32 ofsOrigTable, // +0C: start of original string table
+ size_t32 ofsOrigTable, // +0C: start of original string table
ofsTransTable; // +10: start of translated string table
ofsTransTable; // +10: start of translated string table
- uint32 nHashSize, // +14: hash table size
+ size_t32 nHashSize, // +14: hash table size
ofsHashTable; // +18: offset of hash table start
};
// all data is stored here, NULL if no data loaded
ofsHashTable; // +18: offset of hash table start
};
// all data is stored here, NULL if no data loaded
- uint32 m_numStrings, // number of strings in this domain
+ size_t32 m_numStrings, // number of strings in this domain
m_nHashSize; // number of entries in hash table
m_nHashSize; // number of entries in hash table
- uint32 *m_pHashTable; // pointer to hash table
+ size_t32 *m_pHashTable; // pointer to hash table
wxMsgTableEntry *m_pOrigTable, // pointer to original strings
*m_pTransTable; // translated
wxMsgTableEntry *m_pOrigTable, // pointer to original strings
*m_pTransTable; // translated
- const char *StringAtOfs(wxMsgTableEntry *pTable, uint32 index) const
+ const char *StringAtOfs(wxMsgTableEntry *pTable, size_t32 index) const
{ return (const char *)(m_pData + Swap(pTable[index].ofsString)); }
// utility functions
// calculate the hash value of given string
{ return (const char *)(m_pData + Swap(pTable[index].ofsString)); }
// utility functions
// calculate the hash value of given string
- static inline uint32 GetHash(const char *sz);
+ static inline size_t32 GetHash(const char *sz);
- inline uint32 Swap(uint32 ui) const;
+ inline size_t32 Swap(size_t32 ui) const;
// internal state
bool HasHashTable() const // true if hash table is present
// internal state
bool HasHashTable() const // true if hash table is present
// calculate hash value using the so called hashpjw function by P.J. Weinberger
// [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools]
// calculate hash value using the so called hashpjw function by P.J. Weinberger
// [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools]
-uint32 wxMsgCatalog::GetHash(const char *sz)
+size_t32 wxMsgCatalog::GetHash(const char *sz)
- #define HASHWORDBITS 32 // the length of uint32
+ #define HASHWORDBITS 32 // the length of size_t32
- uint32 hval = 0;
- uint32 g;
+ size_t32 hval = 0;
+ size_t32 g;
while ( *sz != '\0' ) {
hval <<= 4;
while ( *sz != '\0' ) {
hval <<= 4;
- hval += (uint32)*sz++;
- g = hval & ((uint32)0xf << (HASHWORDBITS - 4));
+ hval += (size_t32)*sz++;
+ g = hval & ((size_t32)0xf << (HASHWORDBITS - 4));
if ( g != 0 ) {
hval ^= g >> (HASHWORDBITS - 8);
hval ^= g;
if ( g != 0 ) {
hval ^= g >> (HASHWORDBITS - 8);
hval ^= g;
}
// swap the 2 halves of 32 bit integer if needed
}
// swap the 2 halves of 32 bit integer if needed
-uint32 wxMsgCatalog::Swap(uint32 ui) const
+size_t32 wxMsgCatalog::Swap(size_t32 ui) const
{
return m_bSwapped ? (ui << 24) | ((ui & 0xff00) << 8) |
((ui >> 8) & 0xff00) | (ui >> 24)
{
return m_bSwapped ? (ui << 24) | ((ui & 0xff00) << 8) |
((ui >> 8) & 0xff00) | (ui >> 24)
return FALSE;
// read the whole file in memory
return FALSE;
// read the whole file in memory
- m_pData = new uint8[nSize];
+ m_pData = new size_t8[nSize];
if ( fileMsg.Read(m_pData, nSize) != nSize ) {
wxDELETEA(m_pData);
return FALSE;
if ( fileMsg.Read(m_pData, nSize) != nSize ) {
wxDELETEA(m_pData);
return FALSE;
Swap(pHeader->ofsTransTable));
m_nHashSize = Swap(pHeader->nHashSize);
Swap(pHeader->ofsTransTable));
m_nHashSize = Swap(pHeader->nHashSize);
- m_pHashTable = (uint32 *)(m_pData + Swap(pHeader->ofsHashTable));
+ m_pHashTable = (size_t32 *)(m_pData + Swap(pHeader->ofsHashTable));
m_pszName = new char[strlen(szName) + 1];
strcpy(m_pszName, szName);
m_pszName = new char[strlen(szName) + 1];
strcpy(m_pszName, szName);
return NULL;
if ( HasHashTable() ) { // use hash table for lookup if possible
return NULL;
if ( HasHashTable() ) { // use hash table for lookup if possible
- uint32 nHashVal = GetHash(szOrig);
- uint32 nIndex = nHashVal % m_nHashSize;
+ size_t32 nHashVal = GetHash(szOrig);
+ size_t32 nIndex = nHashVal % m_nHashSize;
- uint32 nIncr = 1 + (nHashVal % (m_nHashSize - 2));
+ size_t32 nIncr = 1 + (nHashVal % (m_nHashSize - 2));
- uint32 nStr = Swap(m_pHashTable[nIndex]);
+ size_t32 nStr = Swap(m_pHashTable[nIndex]);
if ( nStr == 0 )
return NULL;
if ( nStr == 0 )
return NULL;
}
}
else { // no hash table: use default binary search
}
}
else { // no hash table: use default binary search
top = m_numStrings,
current;
while ( bottom < top ) {
top = m_numStrings,
current;
while ( bottom < top ) {
// concatenate all strings (but not too many to not overfill the msg box)
wxString str;
// concatenate all strings (but not too many to not overfill the msg box)
wxString str;
nMsgCount = m_aMessages.Count();
// start from the most recent message
nMsgCount = m_aMessages.Count();
// start from the most recent message
- for ( uint n = nMsgCount; n > 0; n-- ) {
+ for ( size_t n = nMsgCount; n > 0; n-- ) {
// for Windows strings longer than this value are wrapped (NT 4.0)
// for Windows strings longer than this value are wrapped (NT 4.0)
- const uint nMsgLineWidth = 156;
+ const size_t nMsgLineWidth = 156;
nLines += (m_aMessages[n - 1].Len() + nMsgLineWidth - 1) / nMsgLineWidth;
nLines += (m_aMessages[n - 1].Len() + nMsgLineWidth - 1) / nMsgLineWidth;
~Averager()
{ printf("wxString: average %s = %f\n", m_sz, ((float)m_nTotal)/m_nCount); }
~Averager()
{ printf("wxString: average %s = %f\n", m_sz, ((float)m_nTotal)/m_nCount); }
- void Add(uint n) { m_nTotal += n; m_nCount++; }
+ void Add(size_t n) { m_nTotal += n; m_nCount++; }
- uint m_nCount, m_nTotal;
+ size_t m_nCount, m_nTotal;
const char *m_sz;
} g_averageLength("allocation size"),
g_averageSummandLength("summand length"),
const char *m_sz;
} g_averageLength("allocation size"),
g_averageSummandLength("summand length"),
if ( pData->IsShared() ) {
pData->Unlock(); // memory not freed because shared
if ( pData->IsShared() ) {
pData->Unlock(); // memory not freed because shared
- uint nLen = pData->nDataLength;
+ size_t nLen = pData->nDataLength;
AllocBuffer(nLen);
memcpy(m_pchData, pData->data(), nLen*sizeof(char));
}
AllocBuffer(nLen);
memcpy(m_pchData, pData->data(), nLen*sizeof(char));
}
}
// allocate enough memory for nLen characters
}
// allocate enough memory for nLen characters
-void wxString::Alloc(uint nLen)
+void wxString::Alloc(size_t nLen)
{
wxStringData *pData = GetStringData();
if ( pData->nAllocLength <= nLen ) {
{
wxStringData *pData = GetStringData();
if ( pData->nAllocLength <= nLen ) {
}
else if ( pData->IsShared() ) {
pData->Unlock(); // memory not freed because shared
}
else if ( pData->IsShared() ) {
pData->Unlock(); // memory not freed because shared
- uint nOldLen = pData->nDataLength;
+ size_t nOldLen = pData->nDataLength;
AllocBuffer(nLen);
memcpy(m_pchData, pData->data(), nOldLen*sizeof(char));
}
AllocBuffer(nLen);
memcpy(m_pchData, pData->data(), nOldLen*sizeof(char));
}
}
// get the pointer to writable buffer of (at least) nLen bytes
}
// get the pointer to writable buffer of (at least) nLen bytes
-char *wxString::GetWriteBuf(uint nLen)
+char *wxString::GetWriteBuf(size_t nLen)
{
AllocBeforeWrite(nLen);
{
AllocBeforeWrite(nLen);
// so we don't waste our time checking for it
// if ( nSrcLen > 0 )
wxStringData *pData = GetStringData();
// so we don't waste our time checking for it
// if ( nSrcLen > 0 )
wxStringData *pData = GetStringData();
- uint nLen = pData->nDataLength;
- uint nNewLen = nLen + nSrcLen;
+ size_t nLen = pData->nDataLength;
+ size_t nNewLen = nLen + nSrcLen;
// alloc new buffer if current is too small
if ( pData->IsShared() ) {
// alloc new buffer if current is too small
if ( pData->IsShared() ) {
}
// replace first (or all) occurences of some substring with another one
}
// replace first (or all) occurences of some substring with another one
-uint wxString::Replace(const char *szOld, const char *szNew, bool bReplaceAll)
+size_t wxString::Replace(const char *szOld, const char *szNew, bool bReplaceAll)
- uint uiCount = 0; // count of replacements made
+ size_t uiCount = 0; // count of replacements made
- uint uiOldLen = Strlen(szOld);
+ size_t uiOldLen = Strlen(szOld);
wxString strTemp;
const char *pCurrent = m_pchData;
wxString strTemp;
const char *pCurrent = m_pchData;
return TRUE;
// are there any other metacharacters in the mask?
return TRUE;
// are there any other metacharacters in the mask?
const char *pEndMask = strpbrk(pszMask, "*?");
if ( pEndMask != NULL ) {
const char *pEndMask = strpbrk(pszMask, "*?");
if ( pEndMask != NULL ) {
// we can't just copy the pointers here because otherwise we would share
// the strings with another array
// we can't just copy the pointers here because otherwise we would share
// the strings with another array
- for ( uint n = 0; n < src.m_nCount; n++ )
+ for ( size_t n = 0; n < src.m_nCount; n++ )
Add(src[n]);
if ( m_nCount != 0 )
Add(src[n]);
if ( m_nCount != 0 )
{
if ( bFromEnd ) {
if ( m_nCount > 0 ) {
{
if ( bFromEnd ) {
if ( m_nCount > 0 ) {
do {
if ( STRING(m_pItems[--ui])->IsSameAs(sz, bCase) )
return ui;
do {
if ( STRING(m_pItems[--ui])->IsSameAs(sz, bCase) )
return ui;
- for( uint ui = 0; ui < m_nCount; ui++ ) {
+ for( size_t ui = 0; ui < m_nCount; ui++ ) {
if( STRING(m_pItems[ui])->IsSameAs(sz, bCase) )
return ui;
}
if( STRING(m_pItems[ui])->IsSameAs(sz, bCase) )
return ui;
}
wxCHECK_RET( iIndex != NOT_FOUND,
_("removing inexistent element in wxArrayString::Remove") );
wxCHECK_RET( iIndex != NOT_FOUND,
_("removing inexistent element in wxArrayString::Remove") );
- Remove((size_t)iIndex);
}
// sort array elements using passed comparaison function
}
// sort array elements using passed comparaison function
wxASSERT( m_file.IsOpened() && m_file.Tell() == 0 );
// scan the file lines
wxASSERT( m_file.IsOpened() && m_file.Tell() == 0 );
// scan the file lines
- uint nUnix = 0, // number of '\n's alone
+ size_t nUnix = 0, // number of '\n's alone
nDos = 0, // number of '\r\n'
nMac = 0; // number of '\r's
// we take MAX_LINES_SCAN in the beginning, middle and the end of file
#define MAX_LINES_SCAN (10)
nDos = 0, // number of '\r\n'
nMac = 0; // number of '\r's
// we take MAX_LINES_SCAN in the beginning, middle and the end of file
#define MAX_LINES_SCAN (10)
- uint nCount = m_aLines.Count() / 3,
+ size_t nCount = m_aLines.Count() / 3,
nScan = nCount > 3*MAX_LINES_SCAN ? MAX_LINES_SCAN : nCount / 3;
#define AnalyseLine(n) \
nScan = nCount > 3*MAX_LINES_SCAN ? MAX_LINES_SCAN : nCount / 3;
#define AnalyseLine(n) \
default: wxFAIL_MSG(_("unknown line terminator")); \
}
default: wxFAIL_MSG(_("unknown line terminator")); \
}
for ( n = 0; n < nScan; n++ ) // the beginning
AnalyseLine(n);
for ( n = (nCount - nScan)/2; n < (nCount + nScan)/2; n++ )
for ( n = 0; n < nScan; n++ ) // the beginning
AnalyseLine(n);
for ( n = (nCount - nScan)/2; n < (nCount + nScan)/2; n++ )
- uint nCount = m_aLines.Count();
- for ( uint n = 0; n < nCount; n++ ) {
+ size_t nCount = m_aLines.Count();
+ for ( size_t n = 0; n < nCount; n++ ) {
fileTmp.Write(m_aLines[n] +
GetEOL(typeNew == Type_None ? m_aTypes[n] : typeNew));
}
fileTmp.Write(m_aLines[n] +
GetEOL(typeNew == Type_None ? m_aTypes[n] : typeNew));
}
common/memory.cpp \
common/module.cpp \
common/object.cpp \
common/memory.cpp \
common/module.cpp \
common/object.cpp \
common/postscrp.cpp \
common/prntbase.cpp \
common/resource.cpp \
common/postscrp.cpp \
common/prntbase.cpp \
common/resource.cpp \
gdk_imlib/misc.c \
gdk_imlib/rend.c \
gdk_imlib/save.c \
gdk_imlib/misc.c \
gdk_imlib/rend.c \
gdk_imlib/save.c \
- gdk_imlib/utils.c \
-\
- iodbc/dlf.c \
- iodbc/dlproc.c \
- iodbc/herr.c \
- iodbc/henv.c \
- iodbc/hdbc.c \
- iodbc/hstmt.c \
- iodbc/connect.c \
- iodbc/prepare.c \
- iodbc/result.c \
- iodbc/execute.c \
- iodbc/fetch.c \
- iodbc/info.c \
- iodbc/catalog.c \
- iodbc/misc.c \
- iodbc/itrace.c
+ gdk_imlib/utils.c
+# \
+# iodbc/dlf.c \
+# iodbc/dlproc.c \
+# iodbc/herr.c \
+# iodbc/henv.c \
+# iodbc/hdbc.c \
+# iodbc/hstmt.c \
+# iodbc/connect.c \
+# iodbc/prepare.c \
+# iodbc/result.c \
+# iodbc/execute.c \
+# iodbc/fetch.c \
+# iodbc/info.c \
+# iodbc/catalog.c \
+# iodbc/misc.c \
+# iodbc/itrace.c
wxString formats;
int valid = 0;
wxString formats;
int valid = 0;
- for ( uint i = 0; i < GetFormatCount(); i++ )
+ for ( size_t i = 0; i < GetFormatCount(); i++ )
{
wxDataFormat df = GetFormat( i );
switch (df)
{
wxDataFormat df = GetFormat( i );
switch (df)
wxDataObject *data = source->m_data;
wxDataObject *data = source->m_data;
- uint size = data->GetDataSize();
+ size_t size = data->GetDataSize();
char *ptr = new char[size];
data->GetDataHere( ptr );
char *ptr = new char[size];
data->GetDataHere( ptr );
wxString formats;
int valid = 0;
wxString formats;
int valid = 0;
- for ( uint i = 0; i < GetFormatCount(); i++ )
+ for ( size_t i = 0; i < GetFormatCount(); i++ )
{
wxDataFormat df = GetFormat( i );
switch (df)
{
wxDataFormat df = GetFormat( i );
switch (df)
wxDataObject *data = source->m_data;
wxDataObject *data = source->m_data;
- uint size = data->GetDataSize();
+ size_t size = data->GetDataSize();
char *ptr = new char[size];
data->GetDataHere( ptr );
char *ptr = new char[size];
data->GetDataHere( ptr );
- wxCheckListBoxItem(wxCheckListBox *pParent, uint nIndex);
+ wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex);
// drawing functions
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
// drawing functions
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
private:
bool m_bChecked;
wxCheckListBox *m_pParent;
private:
bool m_bChecked;
wxCheckListBox *m_pParent;
-wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, uint nIndex)
+wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex)
: wxOwnerDrawn("", TRUE) // checkable
{
m_bChecked = FALSE;
: wxOwnerDrawn("", TRUE) // checkable
{
m_bChecked = FALSE;
if ( wxOwnerDrawn::OnDrawItem(dc, rc, act, stat) ) {
// ## using native API for performance and precision
if ( wxOwnerDrawn::OnDrawItem(dc, rc, act, stat) ) {
// ## using native API for performance and precision
- uint nCheckWidth = GetDefaultMarginWidth(),
+ size_t nCheckWidth = GetDefaultMarginWidth(),
nCheckHeight = m_pParent->GetItemHeight();
int x = rc.GetX(),
nCheckHeight = m_pParent->GetItemHeight();
int x = rc.GetX(),
{
m_bChecked = !m_bChecked;
{
m_bChecked = !m_bChecked;
- uint nHeight = m_pParent->GetItemHeight();
- uint y = m_nIndex * nHeight;
+ size_t nHeight = m_pParent->GetItemHeight();
+ size_t y = m_nIndex * nHeight;
RECT rcUpdate = { 0, y, GetDefaultMarginWidth(), y + nHeight};
InvalidateRect((HWND)m_pParent->GetHWND(), &rcUpdate, FALSE);
RECT rcUpdate = { 0, y, GetDefaultMarginWidth(), y + nHeight};
InvalidateRect((HWND)m_pParent->GetHWND(), &rcUpdate, FALSE);
// --------------------
// create a check list box item
// --------------------
// create a check list box item
-wxOwnerDrawn *wxCheckListBox::CreateItem(uint nIndex)
+wxOwnerDrawn *wxCheckListBox::CreateItem(size_t nIndex)
{
wxCheckListBoxItem *pItem = new wxCheckListBoxItem(this, nIndex);
if ( m_windowFont.Ok() )
{
wxCheckListBoxItem *pItem = new wxCheckListBoxItem(this, nIndex);
if ( m_windowFont.Ok() )
// check items
// -----------
// check items
// -----------
-bool wxCheckListBox::IsChecked(uint uiIndex) const
+bool wxCheckListBox::IsChecked(size_t uiIndex) const
{
return GetItem(uiIndex)->IsChecked();
}
{
return GetItem(uiIndex)->IsChecked();
}
-void wxCheckListBox::Check(uint uiIndex, bool bCheck)
+void wxCheckListBox::Check(size_t uiIndex, bool bCheck)
{
GetItem(uiIndex)->Check(bCheck);
}
{
GetItem(uiIndex)->Check(bCheck);
}
// clicking on the item selects it, clicking on the checkmark toggles
if ( event.GetX() <= wxOwnerDrawn::GetDefaultMarginWidth() ) {
// # better use LB_ITEMFROMPOINT perhaps?
// clicking on the item selects it, clicking on the checkmark toggles
if ( event.GetX() <= wxOwnerDrawn::GetDefaultMarginWidth() ) {
// # better use LB_ITEMFROMPOINT perhaps?
- uint nItem = ((uint)event.GetY()) / m_nItemHeight;
- if ( nItem < (uint)m_noItems )
+ size_t nItem = ((size_t)event.GetY()) / m_nItemHeight;
+ if ( nItem < (size_t)m_noItems )
GetItem(nItem)->Toggle();
//else: it's not an error, just click outside of client zone
}
GetItem(nItem)->Toggle();
//else: it's not an error, just click outside of client zone
}
// for example, if calling a base class OnPaint.
WXHDC wxPaintDC::ms_PaintHDC = 0;
// for example, if calling a base class OnPaint.
WXHDC wxPaintDC::ms_PaintHDC = 0;
-uint wxPaintDC::ms_PaintCount = 0; // count of ms_PaintHDC usage
+size_t wxPaintDC::ms_PaintCount = 0; // count of ms_PaintHDC usage
wxPaintDC::wxPaintDC(wxWindow *canvas)
{
wxPaintDC::wxPaintDC(wxWindow *canvas)
{
wxSplitPath(aParts, strFullPath);
}
wxSplitPath(aParts, strFullPath);
}
- uint nPartsCount = aParts.Count();
+ size_t nPartsCount = aParts.Count();
m_strPath.Empty();
if ( nPartsCount == 0 ) {
// go to the root
m_strPath.Empty();
if ( nPartsCount == 0 ) {
// go to the root
else {
// translate
m_strGroup = aParts[0u];
else {
// translate
m_strGroup = aParts[0u];
- for ( uint nPart = 1; nPart < nPartsCount; nPart++ ) {
+ for ( size_t nPart = 1; nPart < nPartsCount; nPart++ ) {
if ( nPart > 1 )
m_strPath << PATH_SEP_REPLACE;
m_strPath << aParts[nPart];
if ( nPart > 1 )
m_strPath << PATH_SEP_REPLACE;
m_strPath << aParts[nPart];
// ----------------------------------------------------------------------------
// not implemented
// ----------------------------------------------------------------------------
// not implemented
-uint wxIniConfig::GetNumberOfEntries(bool bRecursive) const
+size_t wxIniConfig::GetNumberOfEntries(bool bRecursive) const
{
wxFAIL_MSG("not implemented");
{
wxFAIL_MSG("not implemented");
-uint wxIniConfig::GetNumberOfGroups(bool bRecursive) const
+size_t wxIniConfig::GetNumberOfGroups(bool bRecursive) const
{
wxFAIL_MSG("not implemented");
{
wxFAIL_MSG("not implemented");
}
bool wxIniConfig::HasGroup(const wxString& strName) const
}
bool wxIniConfig::HasGroup(const wxString& strName) const
// then delete our own ini file
char szBuf[MAX_PATH];
// then delete our own ini file
char szBuf[MAX_PATH];
- uint nRc = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf));
+ size_t nRc = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf));
if ( nRc == 0 )
wxLogLastError("GetWindowsDirectory");
else if ( nRc > WXSIZEOF(szBuf) )
if ( nRc == 0 )
wxLogLastError("GetWindowsDirectory");
else if ( nRc > WXSIZEOF(szBuf) )
-wxOwnerDrawn *wxListBox::CreateItem(uint n)
+wxOwnerDrawn *wxListBox::CreateItem(size_t n)
{
return new wxListBoxItem();
}
{
return new wxListBoxItem();
}
// Subclass again to catch messages
SubclassWin((WXHWND)wx_list);
// Subclass again to catch messages
SubclassWin((WXHWND)wx_list);
- uint ui;
- for (ui = 0; ui < (uint)n; ui++) {
+ size_t ui;
+ for (ui = 0; ui < (size_t)n; ui++) {
SendMessage(wx_list, LB_ADDSTRING, 0, (LPARAM)(const char *)choices[ui]);
}
#if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
SendMessage(wx_list, LB_ADDSTRING, 0, (LPARAM)(const char *)choices[ui]);
}
#if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
- for (ui = 0; ui < (uint)n; ui++) {
+ for (ui = 0; ui < (size_t)n; ui++) {
// create new item which will process WM_{DRAW|MEASURE}ITEM messages
wxOwnerDrawn *pNewItem = CreateItem(ui);
pNewItem->SetName(choices[ui]);
// create new item which will process WM_{DRAW|MEASURE}ITEM messages
wxOwnerDrawn *pNewItem = CreateItem(ui);
pNewItem->SetName(choices[ui]);
wxListBox::~wxListBox(void)
{
#if USE_OWNER_DRAWN
wxListBox::~wxListBox(void)
{
#if USE_OWNER_DRAWN
- uint uiCount = m_aItems.Count();
+ size_t uiCount = m_aItems.Count();
while ( uiCount-- != 0 ) {
delete m_aItems[uiCount];
}
while ( uiCount-- != 0 ) {
delete m_aItems[uiCount];
}
#if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
// first delete old items
#if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
// first delete old items
- uint ui = m_aItems.Count();
+ size_t ui = m_aItems.Count();
while ( ui-- != 0 ) {
delete m_aItems[ui];
}
m_aItems.Empty();
// then create new ones
while ( ui-- != 0 ) {
delete m_aItems[ui];
}
m_aItems.Empty();
// then create new ones
- for (ui = 0; ui < (uint)n; ui++) {
+ for (ui = 0; ui < (size_t)n; ui++) {
wxOwnerDrawn *pNewItem = CreateItem(ui);
pNewItem->SetName(choices[ui]);
m_aItems.Add(pNewItem);
wxOwnerDrawn *pNewItem = CreateItem(ui);
pNewItem->SetName(choices[ui]);
m_aItems.Add(pNewItem);
#if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
for ( i = 0; i < nItems; i++ ) {
#if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
for ( i = 0; i < nItems; i++ ) {
- wxOwnerDrawn *pNewItem = CreateItem((uint)(pos + i));
+ wxOwnerDrawn *pNewItem = CreateItem((size_t)(pos + i));
pNewItem->SetName(items[i]);
pNewItem->SetName(items[i]);
- m_aItems.Insert(pNewItem, (uint)(pos + i));
+ m_aItems.Insert(pNewItem, (size_t)(pos + i));
ListBox_SetItemData(hwnd, i, pNewItem);
}
}
ListBox_SetItemData(hwnd, i, pNewItem);
}
}
GetSize((int *)&rc.right, (int *)&rc.bottom);
TabCtrl_AdjustRect(m_hwnd, FALSE, &rc);
GetSize((int *)&rc.right, (int *)&rc.bottom);
TabCtrl_AdjustRect(m_hwnd, FALSE, &rc);
- uint nCount = m_aPages.Count();
- for ( uint nPage = 0; nPage < nCount; nPage++ ) {
+ size_t nCount = m_aPages.Count();
+ for ( size_t nPage = 0; nPage < nCount; nPage++ ) {
wxNotebookPage *pPage = m_aPages[nPage];
pPage->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
if ( pPage->GetAutoLayout() )
wxNotebookPage *pPage = m_aPages[nPage];
pPage->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
if ( pPage->GetAutoLayout() )
#undef ADD_KNOWN_IID
// try to find the interface in the table
#undef ADD_KNOWN_IID
// try to find the interface in the table
- for ( uint ui = 0; ui < WXSIZEOF(aKnownIids); ui++ ) {
+ for ( size_t ui = 0; ui < WXSIZEOF(aKnownIids); ui++ ) {
if ( riid == *aKnownIids[ui].pIid ) {
return aKnownIids[ui].szName;
}
if ( riid == *aKnownIids[ui].pIid ) {
return aKnownIids[ui].szName;
}
}
#if defined(__WXMSW__) && defined(__WIN32__)
}
#if defined(__WXMSW__) && defined(__WIN32__)
- uint wxOwnerDrawn::ms_nDefaultMarginWidth = GetSystemMetrics(SM_CXMENUCHECK);
+ size_t wxOwnerDrawn::ms_nDefaultMarginWidth = GetSystemMetrics(SM_CXMENUCHECK);
#else // # what is the reasonable default?
#else // # what is the reasonable default?
- uint wxOwnerDrawn::ms_nDefaultMarginWidth = 15;
+ size_t wxOwnerDrawn::ms_nDefaultMarginWidth = 15;
-uint wxOwnerDrawn::ms_nLastMarginWidth = ms_nDefaultMarginWidth;
+size_t wxOwnerDrawn::ms_nLastMarginWidth = ms_nDefaultMarginWidth;
// drawing
// -------
// get size of the item
// drawing
// -------
// get size of the item
-bool wxOwnerDrawn::OnMeasureItem(uint *pwidth, uint *pheight)
+bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight)
{
wxMemoryDC dc;
dc.SetFont(GetFont());
{
wxMemoryDC dc;
dc.SetFont(GetFont());
// recombine path parts in one variable
wxString strRegPath;
m_strPath.Empty();
// recombine path parts in one variable
wxString strRegPath;
m_strPath.Empty();
- for ( uint n = 0; n < aParts.Count(); n++ ) {
+ for ( size_t n = 0; n < aParts.Count(); n++ ) {
strRegPath << '\\' << aParts[n];
m_strPath << wxCONFIG_PATH_SEPARATOR << aParts[n];
}
strRegPath << '\\' << aParts[n];
m_strPath << wxCONFIG_PATH_SEPARATOR << aParts[n];
}
-uint wxRegConfig::GetNumberOfEntries(bool bRecursive) const
+size_t wxRegConfig::GetNumberOfEntries(bool bRecursive) const
// dummy vars
wxString str;
// dummy vars
wxString str;
-uint wxRegConfig::GetNumberOfGroups(bool bRecursive) const
+size_t wxRegConfig::GetNumberOfGroups(bool bRecursive) const
// dummy vars
wxString str;
// dummy vars
wxString str;
m_rects = new wxRect[header->nCount];
RECT* rect = (RECT*) (rgnData + sizeof(RGNDATAHEADER)) ;
m_rects = new wxRect[header->nCount];
RECT* rect = (RECT*) (rgnData + sizeof(RGNDATAHEADER)) ;
for (i = 0; i < header->nCount; i++)
{
m_rects[i] = wxRect(rect->left, rect->top,
for (i = 0; i < header->nCount; i++)
{
m_rects[i] = wxRect(rect->left, rect->top,
// the registry name separator (perhaps one day MS will change it to '/' ;-)
#define REG_SEPARATOR '\\'
// the registry name separator (perhaps one day MS will change it to '/' ;-)
#define REG_SEPARATOR '\\'
+// useful for Windows programmers: makes somewhat more clear all these zeroes
+// being passed to Windows APIs
+#define RESERVED (NULL)
+
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
// @@ should take a `StdKey key', but as it's often going to be used in loops
// it would require casts in user code.
// @@ should take a `StdKey key', but as it's often going to be used in loops
// it would require casts in user code.
-const char *wxRegKey::GetStdKeyName(uint key)
+const char *wxRegKey::GetStdKeyName(size_t key)
{
// return empty string if key is invalid
wxCHECK_MSG( key < nStdKeys, "", "invalid key in wxRegKey::GetStdKeyName" );
{
// return empty string if key is invalid
wxCHECK_MSG( key < nStdKeys, "", "invalid key in wxRegKey::GetStdKeyName" );
return aStdKeys[key].szName;
}
return aStdKeys[key].szName;
}
-const char *wxRegKey::GetStdKeyShortName(uint key)
+const char *wxRegKey::GetStdKeyShortName(size_t key)
{
// return empty string if key is invalid
wxCHECK( key < nStdKeys, "" );
{
// return empty string if key is invalid
wxCHECK( key < nStdKeys, "" );
wxString strRoot = strKey.Left(REG_SEPARATOR);
HKEY hRootKey;
wxString strRoot = strKey.Left(REG_SEPARATOR);
HKEY hRootKey;
for ( ui = 0; ui < nStdKeys; ui++ ) {
if ( strRoot.CmpNoCase(aStdKeys[ui].szName) == 0 ||
strRoot.CmpNoCase(aStdKeys[ui].szShortName) == 0 ) {
for ( ui = 0; ui < nStdKeys; ui++ ) {
if ( strRoot.CmpNoCase(aStdKeys[ui].szName) == 0 ||
strRoot.CmpNoCase(aStdKeys[ui].szShortName) == 0 ) {
wxRegKey::StdKey wxRegKey::GetStdKeyFromHkey(HKEY hkey)
{
wxRegKey::StdKey wxRegKey::GetStdKeyFromHkey(HKEY hkey)
{
- for ( uint ui = 0; ui < nStdKeys; ui++ ) {
+ for ( size_t ui = 0; ui < nStdKeys; ui++ ) {
if ( aStdKeys[ui].hkey == hkey )
return (StdKey)ui;
}
if ( aStdKeys[ui].hkey == hkey )
return (StdKey)ui;
}
-bool wxRegKey::GetKeyInfo(uint* pnSubKeys,
- uint* pnMaxKeyLen,
- uint* pnValues,
- uint* pnMaxValueLen) const
+bool wxRegKey::GetKeyInfo(size_t* pnSubKeys,
+ size_t* pnMaxKeyLen,
+ size_t* pnValues,
+ size_t* pnMaxValueLen) const
#else
bool wxRegKey::GetKeyInfo(ulong *pnSubKeys,
ulong *pnMaxKeyLen,
#else
bool wxRegKey::GetKeyInfo(ulong *pnSubKeys,
ulong *pnMaxKeyLen,
bCont = GetNextKey(strKey, lIndex);
}
bCont = GetNextKey(strKey, lIndex);
}
- uint nKeyCount = astrSubkeys.Count();
- for ( uint nKey = 0; nKey < nKeyCount; nKey++ ) {
+ size_t nKeyCount = astrSubkeys.Count();
+ for ( size_t nKey = 0; nKey < nKeyCount; nKey++ ) {
wxRegKey key(*this, astrSubkeys[nKey]);
if ( !key.DeleteSelf() )
return FALSE;
wxRegKey key(*this, astrSubkeys[nKey]);
if ( !key.DeleteSelf() )
return FALSE;