//
// the cast is safe as in GUI build we only use wxApp, not wxAppConsole, and in
// console mode it does nothing at all
-#define wxTheApp wx_static_cast(wxApp*, wxApp::GetInstance())
+#define wxTheApp static_cast<wxApp*>(wxApp::GetInstance())
// ----------------------------------------------------------------------------
// global functions
wxAppInitializer \
wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
DECLARE_APP(appname) \
- appname& wxGetApp() { return *wx_static_cast(appname*, wxApp::GetInstance()); }
+ appname& wxGetApp() { return *static_cast<appname*>(wxApp::GetInstance()); }
// Same as IMPLEMENT_APP() normally but doesn't include themes support in
// wxUniversal builds
size_t ui = size() - 1; \
do { \
if ( (T*)base_array::operator[](ui) == &Item ) \
- return wx_static_cast(int, ui); \
+ return static_cast<int>(ui); \
ui--; \
} \
while ( ui != 0 ); \
else { \
for( size_t ui = 0; ui < size(); ui++ ) { \
if( (T*)base_array::operator[](ui) == &Item ) \
- return wx_static_cast(int, ui); \
+ return static_cast<int>(ui); \
} \
} \
\
inline bool operator==(wxBrushStyle s, wxDeprecatedGUIConstants t)
{
- return wx_static_cast(int, s) == wx_static_cast(int, t);
+ return static_cast<int>(s) == static_cast<int>(t);
}
inline bool operator!=(wxBrushStyle s, wxDeprecatedGUIConstants t)
{
wxCharTypeBuffer buf;
if ( str )
- buf.m_data = new Data(wx_const_cast(CharType*, str), Data::NonOwned);
+ buf.m_data = new Data(const_cast<CharType*>(str), Data::NonOwned);
return buf;
}
CharType * const p = m_data->Get();
- wxCharTypeBuffer *self = wx_const_cast(wxCharTypeBuffer*, this);
+ wxCharTypeBuffer *self = const_cast<wxCharTypeBuffer*>(this);
self->m_data->Set(NULL);
self->DecRef();
wxASSERT_MSG( GetClientDataType() != wxClientData_Void,
_T("can't mix different types of client data") );
- return AppendItems(items, wx_reinterpret_cast(void **, clientData),
+ return AppendItems(items, reinterpret_cast<void **>(clientData),
wxClientData_Object);
}
_T("can't mix different types of client data") );
return InsertItems(items, pos,
- wx_reinterpret_cast(void **, clientData),
+ reinterpret_cast<void **>(clientData),
wxClientData_Object);
}
// this is used to make the event table entry type safe, so that for an event
// handler only a function with proper parameter list can be given.
-#define wxStaticCastEvent(type, val) wx_static_cast(type, val)
+#define wxStaticCastEvent(type, val) static_cast<type>(val)
#define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \
wxEventTableEntry(type, winid, idLast, fn, obj)
{
// the cast here is safe because the derived classes always create
// wxGDIRefData objects
- return m_refData && wx_static_cast(wxGDIRefData *, m_refData)->IsOk();
+ return m_refData && static_cast<wxGDIRefData *>(m_refData)->IsOk();
}
// don't use in the new code, use IsOk() instead
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const
{
- return CloneGDIRefData(wx_static_cast(const wxGDIRefData *, data));
+ return CloneGDIRefData(static_cast<const wxGDIRefData *>(data));
}
virtual wxGDIRefData *CreateGDIRefData() const = 0;
// would break the existing code overriding them, so instead we provide
// these const synonyms which can be used from const-correct code
int GetRowsCount() const
- { return wx_const_cast(wxGridTableBase *, this)->GetNumberRows(); }
+ { return const_cast<wxGridTableBase *>(this)->GetNumberRows(); }
int GetColsCount() const
- { return wx_const_cast(wxGridTableBase *, this)->GetNumberCols(); }
+ { return const_cast<wxGridTableBase *>(this)->GetNumberCols(); }
virtual bool IsEmptyCell( int row, int col ) = 0;
#ifdef wxNEEDS_CHARPP
// needed for old GCC
wxBitmap(char** data)
- { *this = wxBitmap(wx_const_cast(const char* const*, data)); }
+ { *this = wxBitmap(const_cast<const char* const*>(data)); }
#endif
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE );
#if wxUSE_IMAGE
// both
void *GetTextObject() const
{
- return IsMultiLine() ? wx_static_cast(void *, m_buffer)
- : wx_static_cast(void *, m_text);
+ return IsMultiLine() ? static_cast<void *>(m_buffer)
+ : static_cast<void *>(m_text);
}
// needed for old GCC
wxBitmap(char** data)
{
- *this = wxBitmap(wx_const_cast(const char* const*, data));
+ *this = wxBitmap(const_cast<const char* const*>(data));
}
#endif
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE );
public: \
Node( const value_type& value ) \
: m_value( value ) {} \
- Node* next() { return wx_static_cast(Node*, m_next); } \
+ Node* next() { return static_cast<Node*>(m_next); } \
\
value_type m_value; \
}; \
protected: \
static void DeleteNode( _wxHashTable_NodeBase* node ) \
{ \
- delete wx_static_cast(Node*, node); \
+ delete static_cast<Node*>(node); \
} \
public: \
/* */ \
\
Iterator() : m_node(NULL), m_ht(NULL) {} \
Iterator( Node* node, const Self* ht ) \
- : m_node(node), m_ht(wx_const_cast(Self*, ht)) {} \
+ : m_node(node), m_ht(const_cast<Self*>(ht)) {} \
bool operator ==( const Iterator& it ) const \
{ return m_node == it.m_node; } \
bool operator !=( const Iterator& it ) const \
for( size_type i = bucket + 1; i < m_ht->m_tableBuckets; ++i ) \
{ \
if( m_ht->m_table[i] ) \
- return wx_static_cast(Node*, m_ht->m_table[i]); \
+ return static_cast<Node*>(m_ht->m_table[i]); \
} \
return NULL; \
} \
const_iterator() : Iterator() {} \
const_iterator(iterator i) : Iterator(i) {} \
const_iterator( Node* node, const Self* ht ) \
- : Iterator(node, wx_const_cast(Self*, ht)) {} \
+ : Iterator(node, const_cast<Self*>(ht)) {} \
const_iterator& operator++() { PlusPlus();return *this; } \
const_iterator operator++(int) { const_iterator it=*this;PlusPlus();return it; } \
const_reference operator *() const { return m_node->m_value; } \
const_iterator end() const { return const_iterator(NULL, this); } \
iterator end() { return iterator(NULL, this); } \
const_iterator begin() const \
- { return const_iterator(wx_static_cast(Node*, GetFirstNode(m_tableBuckets, m_table)), this); } \
+ { return const_iterator(static_cast<Node*>(GetFirstNode(m_tableBuckets, m_table)), this); } \
iterator begin() \
- { return iterator(wx_static_cast(Node*, GetFirstNode(m_tableBuckets, m_table)), this); } \
+ { return iterator(static_cast<Node*>(GetFirstNode(m_tableBuckets, m_table)), this); } \
\
size_type erase( const const_key_type& key ) \
{ \
\
--m_items; \
_wxHashTable_NodeBase* temp = (*node)->m_next; \
- delete wx_static_cast(Node*, *node); \
+ delete static_cast<Node*>(*node); \
(*node) = temp; \
if( SHOULD_SHRINK( m_tableBuckets, m_items ) ) \
ResizeTable( GetPreviousPrime( (unsigned long) m_tableBuckets ) - 1 ); \
{ \
const const_key_type& key = m_getKey( value ); \
size_t bucket = m_hasher( key ) % m_tableBuckets; \
- Node* node = wx_static_cast(Node*, m_table[bucket]); \
+ Node* node = static_cast<Node*>(m_table[bucket]); \
\
while( node ) \
{ \
\
while( *node ) \
{ \
- if (m_equals(m_getKey(wx_static_cast(Node*, *node)->m_value), key)) \
+ if (m_equals(m_getKey(static_cast<Node*>(*node)->m_value), key)) \
return node; \
node = &(*node)->m_next; \
} \
Node* GetNode( const const_key_type& key ) const \
{ \
size_t bucket = m_hasher( key ) % m_tableBuckets; \
- Node* node = wx_static_cast(Node*, m_table[bucket]); \
+ Node* node = static_cast<Node*>(m_table[bucket]); \
\
while( node ) \
{ \
typedef const VALUE_T const_t2; \
\
CLASSNAME(const const_t1& f, const const_t2& s) \
- : first(wx_const_cast(t1&, f)), second(wx_const_cast(t2&, s)) {} \
+ : first(const_cast<t1&>(f)), second(const_cast<t2&>(s)) {} \
\
t1 first; \
t2 second; \
unsigned long operator()( short x ) const { return (unsigned long)x; }
unsigned long operator()( unsigned short x ) const { return x; }
#if defined wxLongLong_t && !defined wxLongLongIsLong
- wxULongLong_t operator()( wxLongLong_t x ) const { return wx_static_cast(wxULongLong_t, x); }
+ wxULongLong_t operator()( wxLongLong_t x ) const { return static_cast<wxULongLong_t>(x); }
wxULongLong_t operator()( wxULongLong_t x ) const { return x; }
#endif
bool Create( const char* const* xpmData );
#ifdef __BORLANDC__
// needed for Borland 5.5
- wxImage( char** xpmData ) { Create(wx_const_cast(const char* const*, xpmData)); }
- bool Create( char** xpmData ) { return Create(wx_const_cast(const char* const*, xpmData)); }
+ wxImage( char** xpmData ) { Create(const_cast<const char* const*>(xpmData)); }
+ bool Create( char** xpmData ) { return Create(const_cast<const char* const*>(xpmData)); }
#endif
void Destroy();
virtual void DeleteData() { }
public:
// for wxList::iterator
- void** GetDataPtr() const { return &(wx_const_cast(wxNodeBase*, this)->m_data); }
+ void** GetDataPtr() const { return &(const_cast<wxNodeBase*>(this)->m_data); }
private:
// optional key stuff
wxListKeyValue m_key;
const wxString& GetLabel() const { return m_item.m_text; }
const wxString& GetText() const { return m_item.m_text; }
int GetImage() const { return m_item.m_image; }
- long GetData() const { return wx_static_cast(long, m_item.m_data); }
+ long GetData() const { return static_cast<long>(m_item.m_data); }
long GetMask() const { return m_item.m_mask; }
const wxListItem& GetItem() const { return m_item; }
// (non const) "char *" but many Motif functions take "char *" parameters which
// are really "const char *" so use this macro to suppress the warnings when we
// know it's ok
-#define wxMOTIF_STR(x) wx_const_cast(char *, x)
+#define wxMOTIF_STR(x) const_cast<char *>(x)
// ----------------------------------------------------------------------------
// Miscellaneous functions
#ifdef wxNEEDS_CHARPP
wxBitmap(char** data)
{
- *this = wxBitmap(wx_const_cast(const char* const*, data));
+ *this = wxBitmap(const_cast<const char* const*>(data));
}
#endif
static bool CallHtmlHelp(wxWindow *win, const wxChar *str,
unsigned cmd, const void *param = NULL)
{
- return CallHtmlHelp(win, str, cmd, wx_reinterpret_cast(WXWPARAM, param));
+ return CallHtmlHelp(win, str, cmd, reinterpret_cast<WXWPARAM>(param));
}
// even simpler wrappers using GetParentWindow() and GetValidFilename() as
bool CallHtmlHelp(unsigned cmd, const void *param = NULL)
{
- return CallHtmlHelp(cmd, wx_reinterpret_cast(WXWPARAM, param));
+ return CallHtmlHelp(cmd, reinterpret_cast<WXWPARAM>(param));
}
// wrapper around CallHtmlHelp(HH_DISPLAY_TEXT_POPUP): only one of text and
// from XPM data
wxIcon(const char* const* data) { CreateIconFromXpm(data); }
#ifdef wxNEEDS_CHARPP
- wxIcon(char **data) { CreateIconFromXpm(wx_const_cast(const char* const*, data)); }
+ wxIcon(char **data) { CreateIconFromXpm(const_cast<const char* const*>(data)); }
#endif
// from resource/file
wxIcon(const wxString& name,
// without STRICT WXHWND is the same as HWND anyhow
inline wxWindow* wxFindWinFromHandle(WXHWND hWnd)
{
- return wxFindWinFromHandle(wx_static_cast(HWND, hWnd));
+ return wxFindWinFromHandle(static_cast<HWND>(hWnd));
}
// find the window for HWND which is part of some wxWindow, i.e. unlike
{
private:
wxStackFrame *ConstCast() const
- { return wx_const_cast(wxStackFrame *, this); }
+ { return const_cast<wxStackFrame *>(this); }
size_t DoGetParamCount() const { return m_paramTypes.GetCount(); }
// helper for debug API: it wants to have addresses as DWORDs
size_t GetSymAddr() const
{
- return wx_reinterpret_cast(size_t, m_address);
+ return reinterpret_cast<size_t>(m_address);
}
private:
HWND operator[](size_t n) const
{
- return wx_const_cast(wxSubwindows *, this)->Get(n);
+ return const_cast<wxSubwindows *>(this)->Get(n);
}
// initialize the given window: id will be stored in wxWindowIDRef ensuring
// be replaced by it as long as there are any compilers not supporting it
#define wxDynamicCast(obj, className) \
((className *) wxCheckDynamicCast( \
- wx_const_cast(wxObject *, wx_static_cast(const wxObject *, \
- wx_const_cast(className *, wx_static_cast(const className *, obj)))), \
+ const_cast<wxObject *>(static_cast<const wxObject *>(\
+ const_cast<className *>(static_cast<const className *>(obj)))), \
&className::ms_classInfo))
// The 'this' pointer is always true, so use this version
#else // !__WXDEBUG__
#define wxStaticCast(obj, className) \
- wx_const_cast(className *, wx_static_cast(const className *, obj))
+ const_cast<className *>(static_cast<const className *>(obj))
#endif // __WXDEBUG__
#ifdef _MSC_VER
return (wxClassInfo*) m_classInfo;
#else
- wxDynamicClassInfo *nonconst = wx_const_cast(wxDynamicClassInfo *, m_classInfo);
- return wx_static_cast(wxClassInfo *, nonconst);
+ wxDynamicClassInfo *nonconst = const_cast<wxDynamicClassInfo *>(m_classInfo);
+ return static_cast<wxClassInfo *>(nonconst);
#endif
}
// needed for old GCC
wxBitmap(char** data)
{
- *this = wxBitmap(wx_const_cast(const char* const*, data));
+ *this = wxBitmap(const_cast<const char* const*>(data));
}
#endif
);
wxIcon(const char* const* ppData) { CreateIconFromXpm(ppData); }
#ifdef wxNEEDS_CHARPP
- wxIcon(char** ppData) { CreateIconFromXpm(wx_const_cast(const char* const*, ppData)); }
+ wxIcon(char** ppData) { CreateIconFromXpm(const_cast<const char* const*>(ppData)); }
#endif
wxIcon( const wxString& rName
,wxBitmapType lFlags = wxICON_DEFAULT_TYPE
inline bool operator==(wxPenStyle s, wxDeprecatedGUIConstants t)
{
- return wx_static_cast(int, s) == wx_static_cast(int, t);
+ return static_cast<int>(s) == static_cast<int>(t);
}
inline bool operator!=(wxPenStyle s, wxDeprecatedGUIConstants t)
private:
// put this inline function here so that it is defined before use
wxStackFrameBase *ConstCast() const
- { return wx_const_cast(wxStackFrameBase *, this); }
+ { return const_cast<wxStackFrameBase *>(this); }
public:
wxStackFrameBase(size_t level, void *address = NULL)
iterator(wxString *str, underlying_iterator ptr)
: m_cur(ptr), m_node(str, &m_cur) {}
- wxString* str() const { return wx_const_cast(wxString*, m_node.m_str); }
+ wxString* str() const { return const_cast<wxString*>(m_node.m_str); }
wxStringIteratorNode m_node;
inline wxCStrData::~wxCStrData()
{
if ( m_owned )
- delete wx_const_cast(wxString*, m_str); // cast to silence warnings
+ delete const_cast<wxString*>(m_str); // cast to silence warnings
}
// simple cases for AsChar() and AsWChar(), the complicated ones are
if ( str )
{
m_next = str->m_iterators.ptr;
- wx_const_cast(wxString*, m_str)->m_iterators.ptr = this;
+ const_cast<wxString*>(m_str)->m_iterators.ptr = this;
if ( m_next )
m_next->m_prev = this;
}
if ( m_prev )
m_prev->m_next = m_next;
else if ( m_str ) // first in the list
- wx_const_cast(wxString*, m_str)->m_iterators.ptr = m_next;
+ const_cast<wxString*>(m_str)->m_iterators.ptr = m_next;
m_next = m_prev = NULL;
m_citer = NULL;
#if !wxUSE_UNICODE_WCHAR
operator const char*() const
- { return wx_const_cast(wxFormatString*, this)->AsChar(); }
+ { return const_cast<wxFormatString*>(this)->AsChar(); }
private:
// InputAsChar() returns the value converted passed to ctor, only converted
// to char, while AsChar() takes the the string returned by InputAsChar()
#if wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY
public:
operator const wchar_t*() const
- { return wx_const_cast(wxFormatString*, this)->AsWChar(); }
+ { return const_cast<wxFormatString*>(this)->AsWChar(); }
private:
const wchar_t* InputAsWChar();
const wchar_t* AsWChar();
// wxInputConsumer pure virtual
virtual wxWindow *GetInputWindow() const
- { return wx_const_cast(wxStatusBar*, this); }
+ { return const_cast<wxStatusBar*>(this); }
protected:
// recalculate the field widths
virtual wxSize GetMinSize() const;
- virtual wxWindow *GetInputWindow() const { return wx_const_cast(wxTopLevelWindow*, this); }
+ virtual wxWindow *GetInputWindow() const { return const_cast<wxTopLevelWindow*>(this); }
protected:
virtual void DoGetClientSize(int *width, int *height) const;
virtual bool Init_Socket(GSocket *socket)
{
socket->m_gui_dependent = malloc(sizeof(int)*2);
- int * const fds = wx_static_cast(int *, socket->m_gui_dependent);
+ int * const fds = static_cast<int *>(socket->m_gui_dependent);
fds[0] = -1;
fds[1] = -1;
// access the FDs we store
int& FD(GSocket *socket, SocketDir d)
{
- return wx_static_cast(int *, socket->m_gui_dependent)[d];
+ return static_cast<int *>(socket->m_gui_dependent)[d];
}
};
// needed for old GCC
wxBitmap(char** data)
{
- *this = wxBitmap(wx_const_cast(const char* const*, data));
+ *this = wxBitmap(const_cast<const char* const*>(data));
}
#endif
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE );
#define wxCRT_Toupper_lA wxXLOCALE_IDENT(toupper_l)
inline int wxIsalnum_l(char c, const wxXLocale& loc)
- { return wxCRT_Isalnum_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Isalnum_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxIsalpha_l(char c, const wxXLocale& loc)
- { return wxCRT_Isalpha_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Isalpha_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxIscntrl_l(char c, const wxXLocale& loc)
- { return wxCRT_Iscntrl_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Iscntrl_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxIsdigit_l(char c, const wxXLocale& loc)
- { return wxCRT_Isdigit_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Isdigit_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxIsgraph_l(char c, const wxXLocale& loc)
- { return wxCRT_Isgraph_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Isgraph_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxIslower_l(char c, const wxXLocale& loc)
- { return wxCRT_Islower_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Islower_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxIsprint_l(char c, const wxXLocale& loc)
- { return wxCRT_Isprint_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Isprint_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxIspunct_l(char c, const wxXLocale& loc)
- { return wxCRT_Ispunct_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Ispunct_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxIsspace_l(char c, const wxXLocale& loc)
- { return wxCRT_Isspace_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Isspace_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxIsupper_l(char c, const wxXLocale& loc)
- { return wxCRT_Isupper_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Isupper_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxIsxdigit_l(char c, const wxXLocale& loc)
- { return wxCRT_Isxdigit_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Isxdigit_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxTolower_l(char c, const wxXLocale& loc)
- { return wxCRT_Tolower_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Tolower_lA(static_cast<unsigned char>(c), loc.Get()); }
inline int wxToupper_l(char c, const wxXLocale& loc)
- { return wxCRT_Toupper_lA(wx_static_cast(unsigned char, c), loc.Get()); }
+ { return wxCRT_Toupper_lA(static_cast<unsigned char>(c), loc.Get()); }
#if wxUSE_UNICODE
#define wxCRT_Isalnum_lW wxXLOCALE_IDENT(iswalnum_l)
wxImage ReadData(const char* const* xpm_data);
#ifdef __BORLANDC__
// needed for Borland 5.5
- wxImage ReadData(char** xpm_data) { return ReadData(wx_const_cast(const char* const*, xpm_data)); }
+ wxImage ReadData(char** xpm_data) { return ReadData(const_cast<const char* const*>(xpm_data)); }
#endif
};
NSRect imageRect = {{0,0}, [nsimage size]};
imageRect.origin.x = imageRect.size.width * rect.x / GetWidth();
imageRect.origin.y = imageRect.size.height * rect.y / GetHeight();
- imageRect.size.width *= wx_static_cast(CGFloat, rect.width) / GetWidth();
- imageRect.size.height *= wx_static_cast(CGFloat, rect.height) / GetHeight();
+ imageRect.size.width *= static_cast<CGFloat>(rect.width) / GetWidth();
+ imageRect.size.height *= static_cast<CGFloat>(rect.height) / GetHeight();
NSBitmapImageRep *newBitmapRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:imageRect];
[nsimage unlockFocus];
wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data));
+ return new wxFontRefData(*static_cast<const wxFontRefData *>(data));
}
void wxFont::SetEncoding(wxFontEncoding)
wxGDIRefData *wxIcon::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxIconRefData(*wx_static_cast(const wxIconRefData *, data));
+ return new wxIconRefData(*static_cast<const wxIconRefData *>(data));
}
bool wxIcon::CreateFromXpm(const char* const* xpm)
m_traits = NULL;
m_mainLoop = NULL;
- ms_appInstance = wx_static_cast(wxAppConsole *, this);
+ ms_appInstance = static_cast<wxAppConsole *>(this);
#ifdef __WXDEBUG__
SetTraceMasks();
{
wxCHECK_MSG( src_, wxCONV_FAILED, _T("NULL input buffer") );
- const unsigned char *src = wx_static_cast(const unsigned char *, src_);
+ const unsigned char *src = static_cast<const unsigned char *>(src_);
static const char b64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
{
wxCHECK_MSG( src, wxCONV_FAILED, _T("NULL input buffer") );
- unsigned char *dst = wx_static_cast(unsigned char *, dst_);
+ unsigned char *dst = static_cast<unsigned char *>(dst_);
size_t decLen = 0;
const char *p;
for ( p = src; srcLen; p++, srcLen-- )
{
- const unsigned char c = decode[wx_static_cast(unsigned char, *p)];
+ const unsigned char c = decode[static_cast<unsigned char>(*p)];
switch ( c )
{
case WSP:
if ( (flags & wxC2S_NAME) && isOpaque )
{
colName = wxTheColourDatabase->FindName(
- wx_static_cast(const wxColour &, *this)).MakeLower();
+ static_cast<const wxColour &>(*this)).MakeLower();
}
if ( colName.empty() )
!m_winLastFocused->HasFlag(wxRB_SINGLE) )
{
wxRadioButton * const
- lastBtn = wx_static_cast(wxRadioButton *, m_winLastFocused);
+ lastBtn = static_cast<wxRadioButton *>(m_winLastFocused);
// cursor keys don't navigate out of a radio button group so
// find the correct radio button to focus
// during this initial call but also during the first call with non-NULL
// dst as typically we're first called with NULL dst to calculate the
// needed buffer size
- wxConvAuto *self = wx_const_cast(wxConvAuto *, this);
+ wxConvAuto *self = const_cast<wxConvAuto *>(this);
if ( !m_conv )
{
self->InitFromInput(&src, &srcLen);
if ( !m_conv )
{
// default to UTF-8 for the multibyte output
- wx_const_cast(wxConvAuto *, this)->InitWithUTF8();
+ const_cast<wxConvAuto *>(this)->InitWithUTF8();
}
return m_conv->FromWChar(dst, dstLen, src, srcLen);
if ( HasClientObjectData() )
{
wxClientData * clientDataOld
- = wx_static_cast(wxClientData *, DoGetItemClientData(n));
+ = static_cast<wxClientData *>(DoGetItemClientData(n));
if ( clientDataOld )
delete clientDataOld;
}
wxCHECK_MSG( HasClientObjectData(), NULL,
wxT("this window doesn't have object client data") );
- return wx_static_cast(wxClientData *, DoGetItemClientData(n));
+ return static_cast<wxClientData *>(DoGetItemClientData(n));
}
void wxItemContainer::SetClientData(unsigned int n, void *data)
SetClientObject
(
pos,
- (wx_reinterpret_cast(wxClientData **, clientData))[n]
+ (reinterpret_cast<wxClientData **>(clientData))[n]
);
break;
const wxDataViewCtrl* wxDataViewRendererBase::GetView() const
{
- return wx_const_cast(wxDataViewRendererBase*, this)->GetOwner()->GetOwner();
+ return const_cast<wxDataViewRendererBase*>(this)->GetOwner()->GetOwner();
}
class wxKillRef: public wxWindowRef
wxDateTime& wxDateTime::SetFromMSWSysTime(const SYSTEMTIME& st)
{
return Set(st.wDay,
- wx_static_cast(wxDateTime::Month, wxDateTime::Jan + st.wMonth - 1),
+ static_cast<wxDateTime::Month>(wxDateTime::Jan + st.wMonth - 1),
st.wYear,
0, 0, 0);
}
bool wxTextDataObject::SetData(const wxDataFormat& format,
size_t len, const void *buf_)
{
- const char * const buf = wx_static_cast(const char *, buf_);
+ const char * const buf = static_cast<const char *>(buf_);
if ( buf == NULL )
return false;
"should have pending events if called" );
wxList::compatibility_iterator node = m_pendingEvents->GetFirst();
- wxEventPtr event(wx_static_cast(wxEvent *, node->GetData()));
+ wxEventPtr event(static_cast<wxEvent *>(node->GetData()));
// it's important we remove event from list before processing it, else a
// nested event loop, for example from a modal dialog, might process the
const wxString pathOld = GetPath();
- wxFileConfig *self = wx_const_cast(wxFileConfig *, this);
+ wxFileConfig *self = const_cast<wxFileConfig *>(this);
const bool
rc = self->DoSetPath(strName, false /* don't create missing components */);
// change to the path of the entry if necessary and remember the old path
// to restore it later
wxString pathOld;
- wxFileConfig * const self = wx_const_cast(wxFileConfig *, this);
+ wxFileConfig * const self = const_cast<wxFileConfig *>(this);
if ( !path.empty() )
{
pathOld = GetPath();
wxLogTrace( FILECONF_TRACE_MASK,
_T(" (m_pLine) = prev: %p, this %p, next %p"),
- m_pLine ? wx_static_cast(void*, m_pLine->Prev()) : 0,
- wx_static_cast(void*, m_pLine),
- m_pLine ? wx_static_cast(void*, m_pLine->Next()) : 0 );
+ m_pLine ? static_cast<void*>(m_pLine->Prev()) : 0,
+ static_cast<void*>(m_pLine),
+ m_pLine ? static_cast<void*>(m_pLine->Next()) : 0 );
wxLogTrace( FILECONF_TRACE_MASK,
_T(" text: '%s'"),
m_pLine ? (const wxChar*)m_pLine->Text().c_str()
const wxBrush* wxStockGDI::GetBrush(Item item)
{
- wxBrush* brush = wx_static_cast(wxBrush*, ms_stockObject[item]);
+ wxBrush* brush = static_cast<wxBrush*>(ms_stockObject[item]);
if (brush == NULL)
{
switch (item)
const wxColour* wxStockGDI::GetColour(Item item)
{
- wxColour* colour = wx_static_cast(wxColour*, ms_stockObject[item]);
+ wxColour* colour = static_cast<wxColour*>(ms_stockObject[item]);
if (colour == NULL)
{
switch (item)
const wxCursor* wxStockGDI::GetCursor(Item item)
{
- wxCursor* cursor = wx_static_cast(wxCursor*, ms_stockObject[item]);
+ wxCursor* cursor = static_cast<wxCursor*>(ms_stockObject[item]);
if (cursor == NULL)
{
switch (item)
const wxFont* wxStockGDI::GetFont(Item item)
{
- wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]);
+ wxFont* font = static_cast<wxFont*>(ms_stockObject[item]);
if (font == NULL)
{
switch (item)
const wxPen* wxStockGDI::GetPen(Item item)
{
- wxPen* pen = wx_static_cast(wxPen*, ms_stockObject[item]);
+ wxPen* pen = static_cast<wxPen*>(ms_stockObject[item]);
if (pen == NULL)
{
switch (item)
{
for (wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext())
{
- delete wx_static_cast(wxObject*, node->GetData());
+ delete static_cast<wxObject*>(node->GetData());
}
}
// that SetCurrent() can only be called for a shown window, so check for it
wxASSERT_MSG( IsShownOnScreen(), _T("can't make hidden GL canvas current") );
- return context.SetCurrent(*wx_static_cast(const wxGLCanvas *, this));
+ return context.SetCurrent(*static_cast<const wxGLCanvas *>(this));
}
bool wxGLCanvasBase::SetColour(const wxString& colour)
wxGDIRefData *wxIconBundle::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxIconBundleRefData(*wx_static_cast(const wxIconBundleRefData *, data));
+ return new wxIconBundleRefData(*static_cast<const wxIconBundleRefData *>(data));
}
void wxIconBundle::DeleteIcons()
//-----------------------------------------------------------------------------
-#define M_IMGDATA wx_static_cast(wxImageRefData*, m_refData)
+#define M_IMGDATA static_cast<wxImageRefData*>(m_refData)
IMPLEMENT_DYNAMIC_CLASS(wxImage, wxObject)
wxObjectRefData* wxImage::CloneRefData(const wxObjectRefData* that) const
{
- const wxImageRefData* refData = wx_static_cast(const wxImageRefData*, that);
+ const wxImageRefData* refData = static_cast<const wxImageRefData*>(that);
wxCHECK_MSG(refData->m_ok, NULL, wxT("invalid image") );
wxImageRefData* refData_new = new wxImageRefData;
{
// calculate the luma
double luma = (src[0] * lr + src[1] * lg + src[2] * lb) + 0.5;
- dest[0] = dest[1] = dest[2] = wx_static_cast(unsigned char, luma);
+ dest[0] = dest[1] = dest[2] = static_cast<unsigned char>(luma);
}
}
bool wxImage::DoSave(wxImageHandler& handler, wxOutputStream& stream) const
{
- wxImage * const self = wx_const_cast(wxImage *, this);
+ wxImage * const self = const_cast<wxImage *>(this);
if ( !handler.SaveFile(self, stream) )
return false;
// facilitate doing pointer arithmetic with it
char *StringData() const
{
- return wx_static_cast(char *, m_data.GetData());
+ return static_cast<char *>(m_data.GetData());
}
const char *StringAtOfs(wxMsgTableEntry *pTable, size_t32 n) const
if ( size )
size--;
- s = wxString(wx_static_cast(const char *, data), size);
+ s = wxString(static_cast<const char *>(data), size);
break;
#if wxUSE_UNICODE
size--;
}
- s = wxString(wx_static_cast(const wchar_t *, data), size);
+ s = wxString(static_cast<const wchar_t *>(data), size);
break;
case wxIPC_UTF8TEXT:
if ( size )
size--;
- s = wxString::FromUTF8(wx_static_cast(const char *, data), size);
+ s = wxString::FromUTF8(static_cast<const char *>(data), size);
break;
#endif // wxUSE_UNICODE
{
appNameStr = wxTheApp->GetAppName();
appName = appNameStr.c_str();
- OutputDumpLine(wxT("----- Memory dump of %s at %s -----"), appName, wx_static_cast(const wxChar *, wxNow().c_str()));
+ OutputDumpLine(wxT("----- Memory dump of %s at %s -----"), appName, static_cast<const wxChar *>(wxNow().c_str()));
}
else
{
{
appNameStr = wxTheApp->GetAppName();
appName = appNameStr.c_str();
- OutputDumpLine(wxT("----- Memory statistics of %s at %s -----"), appName, wx_static_cast(const wxChar *, wxNow().c_str()));
+ OutputDumpLine(wxT("----- Memory statistics of %s at %s -----"), appName, static_cast<const wxChar *>(wxNow().c_str()));
}
else
{
if ( item != wxNOT_FOUND )
{
- wxString text = GetItemHelpText(wx_static_cast(unsigned int, item));
+ wxString text = GetItemHelpText(static_cast<unsigned int>(item));
if( !text.empty() )
return text;
}
re_registers *matches,
int eflags)
{
- regex_t *pattern = wx_const_cast(regex_t*, preg);
+ regex_t *pattern = const_cast<regex_t*>(preg);
pattern->not_bol = (eflags & REG_NOTBOL) != 0;
pattern->not_eol = (eflags & REG_NOTEOL) != 0;
dc.SelectObject(bmp);
dc.SetBackground(*wxBLACK_BRUSH);
dc.Clear();
- dc.SetDeviceClippingRegion(*wx_static_cast(const wxRegion *, this));
+ dc.SetDeviceClippingRegion(*static_cast<const wxRegion *>(this));
dc.SetBackground(*wxWHITE_BRUSH);
dc.Clear();
dc.SelectObject(wxNullBitmap);
return wxInvalidOffset;
}
- if ( ofs < 0 || ofs > wx_static_cast(wxFileOffset, m_len) )
+ if ( ofs < 0 || ofs > static_cast<wxFileOffset>(m_len) )
return wxInvalidOffset;
// FIXME: this can't be right
wxFileOffset wxStringInputStream::OnSysTell() const
{
- return wx_static_cast(wxFileOffset, m_pos);
+ return static_cast<wxFileOffset>(m_pos);
}
// ----------------------------------------------------------------------------
wxFileOffset wxStringOutputStream::OnSysTell() const
{
- return wx_static_cast(wxFileOffset, m_pos);
+ return static_cast<wxFileOffset>(m_pos);
}
// ----------------------------------------------------------------------------
size_t wxStringOutputStream::OnSysWrite(const void *buffer, size_t size)
{
- const char *p = wx_static_cast(const char *, buffer);
+ const char *p = static_cast<const char *>(buffer);
#if wxUSE_UNICODE_WCHAR
// the part of the string we have here may be incomplete, i.e. it can stop
return label;
}
- wxClientDC dc(wx_const_cast(wxStaticTextBase*, this));
+ wxClientDC dc(const_cast<wxStaticTextBase*>(this));
dc.SetFont(GetFont());
wxArrayInt charOffsets;
{
wxUint32 out;
const size_t
- n = decode_utf16(wx_reinterpret_cast(const wxUint16 *, *pSrc), out);
+ n = decode_utf16(reinterpret_cast<const wxUint16 *>(*pSrc), out);
if ( n == wxCONV_FAILED )
*pSrc = NULL;
else
}
else // when working with partial strings we do use the shift state
{
- statePtr = wx_const_cast(DecoderState *, &m_stateDecoder);
+ statePtr = const_cast<DecoderState *>(&m_stateDecoder);
// also save the old state to be able to rollback to it on error
stateOrig = m_stateDecoder;
else // do use the mode we left the output in previously
{
stateOrig = m_stateEncoder;
- statePtr = wx_const_cast(EncoderState *, &m_stateEncoder);
+ statePtr = const_cast<EncoderState *>(&m_stateEncoder);
}
EncoderState& state = *statePtr;
if ( srcLen == wxNO_LEN )
{
// count the number of bytes in input, including the trailing NULs
- const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src);
+ const wxUint16 *inBuff = reinterpret_cast<const wxUint16 *>(src);
for ( srcLen = 1; *inBuff++; srcLen++ )
;
if ( dstLen < srcLen )
return wxCONV_FAILED;
- const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src);
+ const wxUint16 *inBuff = reinterpret_cast<const wxUint16 *>(src);
for ( size_t n = 0; n < srcLen; n++, inBuff++ )
{
*dst++ = wxUINT16_SWAP_ALWAYS(*inBuff);
if ( dstLen < srcLen )
return wxCONV_FAILED;
- wxUint16 *outBuff = wx_reinterpret_cast(wxUint16 *, dst);
+ wxUint16 *outBuff = reinterpret_cast<wxUint16 *>(dst);
for ( size_t n = 0; n < srcLen; n += BYTES_PER_CHAR, src++ )
{
*outBuff++ = wxUINT16_SWAP_ALWAYS(*src);
}
size_t outLen = 0;
- const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src);
+ const wxUint16 *inBuff = reinterpret_cast<const wxUint16 *>(src);
for ( const wxUint16 * const inEnd = inBuff + inLen; inBuff < inEnd; )
{
const wxUint32 ch = wxDecodeSurrogate(&inBuff);
srcLen = wxWcslen(src) + 1;
size_t outLen = 0;
- wxUint16 *outBuff = wx_reinterpret_cast(wxUint16 *, dst);
+ wxUint16 *outBuff = reinterpret_cast<wxUint16 *>(dst);
for ( size_t n = 0; n < srcLen; n++ )
{
wxUint16 cc[2];
}
size_t outLen = 0;
- const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src);
+ const wxUint16 *inBuff = reinterpret_cast<const wxUint16 *>(src);
for ( const wxUint16 * const inEnd = inBuff + inLen; inBuff < inEnd; )
{
wxUint32 ch;
srcLen = wxWcslen(src) + 1;
size_t outLen = 0;
- wxUint16 *outBuff = wx_reinterpret_cast(wxUint16 *, dst);
+ wxUint16 *outBuff = reinterpret_cast<wxUint16 *>(dst);
for ( const wchar_t *srcEnd = src + srcLen; src < srcEnd; src++ )
{
wxUint16 cc[2];
if ( srcLen == wxNO_LEN )
{
// count the number of bytes in input, including the trailing NULs
- const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src);
+ const wxUint32 *inBuff = reinterpret_cast<const wxUint32 *>(src);
for ( srcLen = 1; *inBuff++; srcLen++ )
;
if ( srcLen == wxNO_LEN )
return wxCONV_FAILED;
- const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src);
+ const wxUint32 *inBuff = reinterpret_cast<const wxUint32 *>(src);
const size_t inLen = srcLen / BYTES_PER_CHAR;
size_t outLen = 0;
for ( size_t n = 0; n < inLen; n++ )
return srcLen * BYTES_PER_CHAR;
}
- wxUint32 *outBuff = wx_reinterpret_cast(wxUint32 *, dst);
+ wxUint32 *outBuff = reinterpret_cast<wxUint32 *>(dst);
size_t outLen = 0;
for ( const wchar_t * const srcEnd = src + srcLen; src < srcEnd; )
{
if ( srcLen == wxNO_LEN )
return wxCONV_FAILED;
- const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src);
+ const wxUint32 *inBuff = reinterpret_cast<const wxUint32 *>(src);
const size_t inLen = srcLen / BYTES_PER_CHAR;
size_t outLen = 0;
for ( size_t n = 0; n < inLen; n++, inBuff++ )
return srcLen*BYTES_PER_CHAR;
}
- wxUint32 *outBuff = wx_reinterpret_cast(wxUint32 *, dst);
+ wxUint32 *outBuff = reinterpret_cast<wxUint32 *>(dst);
size_t outLen = 0;
for ( const wchar_t * const srcEnd = src + srcLen; src < srcEnd; )
{
if ( dstLen < srcLen )
return wxCONV_FAILED;
- const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src);
+ const wxUint32 *inBuff = reinterpret_cast<const wxUint32 *>(src);
for ( size_t n = 0; n < srcLen; n++, inBuff++ )
{
*dst++ = wxUINT32_SWAP_ALWAYS(*inBuff);
if ( dstLen < srcLen )
return wxCONV_FAILED;
- wxUint32 *outBuff = wx_reinterpret_cast(wxUint32 *, dst);
+ wxUint32 *outBuff = reinterpret_cast<wxUint32 *>(dst);
for ( size_t n = 0; n < srcLen; n += BYTES_PER_CHAR, src++ )
{
*outBuff++ = wxUINT32_SWAP_ALWAYS(*src);
return wxEmptyString;
#if wxUSE_UTF8_LOCALE_ONLY
- return wxString(wx_reinterpret_cast(const char*, m_ptr));
+ return wxString(reinterpret_cast<const char*>(m_ptr));
#else
#if wxUSE_UNICODE_UTF8
if ( wxLocaleIsUtf8 )
- return wxString(wx_reinterpret_cast(const char*, m_ptr));
+ return wxString(reinterpret_cast<const char*>(m_ptr));
else
#endif
- return wxString(wx_reinterpret_cast(const wxChar*, m_ptr));
+ return wxString(reinterpret_cast<const wxChar*>(m_ptr));
#endif // !wxUSE_UTF8_LOCALE_ONLY
}
i != end;
++i )
{
- wxTopLevelWindow * const win = wx_static_cast(wxTopLevelWindow *, *i);
+ wxTopLevelWindow * const win = static_cast<wxTopLevelWindow *>(*i);
if ( win != this && win->IsShown() )
{
// there remains at least one other visible TLW, we can hide this
// then decide whether we should exit at all
for ( i = wxTopLevelWindows.begin(); i != end; ++i )
{
- wxTopLevelWindow * const win = wx_static_cast(wxTopLevelWindow *, *i);
+ wxTopLevelWindow * const win = static_cast<wxTopLevelWindow *>(*i);
if ( win->ShouldPreventAppExit() )
{
// there remains at least one important TLW, don't exit
for ( i = wxTopLevelWindows.begin(); i != end; ++i )
{
// don't close twice the windows which are already marked for deletion
- wxTopLevelWindow * const win = wx_static_cast(wxTopLevelWindow *, *i);
+ wxTopLevelWindow * const win = static_cast<wxTopLevelWindow *>(*i);
if ( !wxPendingDelete.Member(win) && !win->Close() )
{
// one of the windows refused to close, don't exit
wxASSERT_MSG( n >= 0 && n <= 0xff, "unexpected character value" );
- c = wx_static_cast(char, n);
+ c = static_cast<char>(n);
}
*p = c;
bool wxVariantDataWxObjectPtr::Write(wxString& str) const
{
- str.Printf(wxT("%s(%p)"), GetType().c_str(), wx_static_cast(void*, m_value));
+ str.Printf(wxT("%s(%p)"), GetType().c_str(), static_cast<void*>(m_value));
return true;
}
void wxWindowBase::CaptureMouse()
{
- wxLogTrace(_T("mousecapture"), _T("CaptureMouse(%p)"), wx_static_cast(void*, this));
+ wxLogTrace(_T("mousecapture"), _T("CaptureMouse(%p)"), static_cast<void*>(this));
wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive CaptureMouse call?") );
void wxWindowBase::ReleaseMouse()
{
- wxLogTrace(_T("mousecapture"), _T("ReleaseMouse(%p)"), wx_static_cast(void*, this));
+ wxLogTrace(_T("mousecapture"), _T("ReleaseMouse(%p)"), static_cast<void*>(this));
wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive ReleaseMouse call?") );
wxLogTrace(_T("mousecapture"),
(const wxChar *) _T("After ReleaseMouse() mouse is captured by %p"),
- wx_static_cast(void*, GetCapture()));
+ static_cast<void*>(GetCapture()));
}
static void DoNotifyWindowAboutCaptureLost(wxWindow *win)
row->GetChildren().clear();
wxPropChanger * const
- propChanger = wx_static_cast(wxPropChanger *, item->GetUserData());
+ propChanger = static_cast<wxPropChanger *>(item->GetUserData());
if ( propChanger )
{
// this deletes propChanger and so restores the old proportion
wxCHECK_MSG( wxStrstr(format, _T("%c")) == NULL, -1,
_T("incomplete vswscanf implementation doesn't allow %c") );
- return vsscanf(wx_static_cast(const char*, wxConvLibc.cWX2MB(ws)),
+ return vsscanf(static_cast<const char*>(wxConvLibc.cWX2MB(ws)),
wxConvLibc.cWX2MB(format), argptr);
}
#endif
int wxVsscanf(const wchar_t *str, const wchar_t *format, va_list ap)
{ return wxCRT_VsscanfW(str, format, ap); }
int wxVsscanf(const wxCharBuffer& str, const char *format, va_list ap)
- { return wxCRT_VsscanfA(wx_static_cast(const char*, str), format, ap); }
+ { return wxCRT_VsscanfA(static_cast<const char*>(str), format, ap); }
int wxVsscanf(const wxWCharBuffer& str, const wchar_t *format, va_list ap)
{ return wxCRT_VsscanfW(str, format, ap); }
int wxVsscanf(const wxString& str, const char *format, va_list ap)
- { return wxCRT_VsscanfA(wx_static_cast(const char*, str.mb_str()), format, ap); }
+ { return wxCRT_VsscanfA(static_cast<const char*>(str.mb_str()), format, ap); }
int wxVsscanf(const wxString& str, const wchar_t *format, va_list ap)
{ return wxCRT_VsscanfW(str.wc_str(), format, ap); }
int wxVsscanf(const wxCStrData& str, const char *format, va_list ap)
- { return wxCRT_VsscanfA(wx_static_cast(const char*, str.AsCharBuf()), format, ap); }
+ { return wxCRT_VsscanfA(static_cast<const char*>(str.AsCharBuf()), format, ap); }
int wxVsscanf(const wxCStrData& str, const wchar_t *format, va_list ap)
{ return wxCRT_VsscanfW(str.AsWCharBuf(), format, ap); }
#endif // HAVE_NO_VSSCANF
{
if ( !gs_cLocale )
{
- gs_cLocale = new wxXLocale(wx_static_cast(wxXLocaleCTag *, NULL));
+ gs_cLocale = new wxXLocale(static_cast<wxXLocaleCTag *>(NULL));
}
return *gs_cLocale;
Init();
m_allowSeeking = true;
wxFFileInputStream *ffile;
- ffile = wx_static_cast(wxFFileInputStream*, m_parent_i_stream);
+ ffile = static_cast<wxFFileInputStream*>(m_parent_i_stream);
wxZipEntryPtr_ entry;
if (ffile->Ok()) {
return false;
}
- return CopyEntry(zipEntry, wx_static_cast(wxZipInputStream&, stream));
+ return CopyEntry(zipEntry, static_cast<wxZipInputStream&>(stream));
}
bool wxZipOutputStream::CopyArchiveMetaData(wxZipInputStream& inputStream)
bool wxZipOutputStream::CopyArchiveMetaData(wxArchiveInputStream& stream)
{
- return CopyArchiveMetaData(wx_static_cast(wxZipInputStream&, stream));
+ return CopyArchiveMetaData(static_cast<wxZipInputStream&>(stream));
}
void wxZipOutputStream::SetLevel(int level)
#endif // wxUSE_LOG
wxEventLoop * const
- loop = wx_static_cast(wxEventLoop *, wxEventLoop::GetActive());
+ loop = static_cast<wxEventLoop *>(wxEventLoop::GetActive());
if ( loop )
loop->Yield();
// ----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxAnimation, wxAnimationBase)
-#define M_ANIMDATA wx_static_cast(wxAnimationDecoder*, m_refData)
+#define M_ANIMDATA static_cast<wxAnimationDecoder*>(m_refData)
wxSize wxAnimation::GetSize() const
{
wxSize wxGenericCalendarCtrl::DoGetBestSize() const
{
// calc the size of the calendar
- wx_const_cast(wxGenericCalendarCtrl *, this)->RecalcGeometry();
+ const_cast<wxGenericCalendarCtrl *>(this)->RecalcGeometry();
wxCoord width = 7*m_widthCol,
height = 7*m_heightRow + m_rowOffset;
for (i = 0; i < GetOwner()->GetColumnCount(); i++)
{
const wxDataViewColumn *c =
- wx_const_cast(wxDataViewCtrl*, GetOwner())->GetColumn( i );
+ const_cast<wxDataViewCtrl*>(GetOwner())->GetColumn( i );
if (!c->IsHidden())
width += c->GetWidth();
if ( !pcd )
return;
- const wxString& str = ((wx_static_cast(wxStringClientData *, pcd))->GetData());
+ const wxString& str = ((static_cast<wxStringClientData *>(pcd))->GetData());
m_list->SetWild( str );
m_filterIndex = filterindex;
if ( str.Left( 2 ) == wxT( "*." ) )
static int GetPageId(wxTabView *tabview, wxNotebookPage *page)
{
- return wx_static_cast(wxNotebookTabView*, tabview)->GetId(page);
+ return static_cast<wxNotebookTabView*>(tabview)->GetId(page);
}
// ----------------------------------------------------------------------------
wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxPaletteRefData(*wx_static_cast(const wxPaletteRefData *, data));
+ return new wxPaletteRefData(*static_cast<const wxPaletteRefData *>(data));
}
#endif // wxUSE_PALETTE
flags |= wxCONTROL_SELECTED;
if ( IsCurrent(n) )
flags |= wxCONTROL_CURRENT;
- if ( wxWindow::FindFocus() == wx_const_cast(wxVListBox*, this) )
+ if ( wxWindow::FindFocus() == const_cast<wxVListBox*>(this) )
flags |= wxCONTROL_FOCUSED;
wxRendererNative::Get().DrawItemSelectionRect(
- wx_const_cast(wxVListBox *, this), dc, rect, flags);
+ const_cast<wxVListBox *>(this), dc, rect, flags);
}
}
{
#if !wxUSE_UNICODE_UTF8
for ( size_t n = 0; n < m_count; n++ )
- free(wx_const_cast(gchar *, m_strings[n]));
+ free(const_cast<gchar *>(m_strings[n]));
#endif
delete [] m_strings;
//-----------------------------------------------------------------------------
-#define M_BMPDATA wx_static_cast(wxBitmapRefData*, m_refData)
+#define M_BMPDATA static_cast<wxBitmapRefData*>(m_refData)
IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject)
wxCHECK2_MSG(bits != NULL, return, wxT("invalid bitmap data"));
GdkBitmap* mask = NULL;
- SetPixmap(gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, wx_const_cast(char**, bits)));
+ SetPixmap(gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, const_cast<char**>(bits)));
if (M_BMPDATA->m_pixmap != NULL && mask != NULL)
{
wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const
{
- const wxBitmapRefData* oldRef = wx_static_cast(const wxBitmapRefData*, data);
+ const wxBitmapRefData* oldRef = static_cast<const wxBitmapRefData*>(data);
wxBitmapRefData* newRef = new wxBitmapRefData;
newRef->m_width = oldRef->m_width;
newRef->m_height = oldRef->m_height;
#if wxUSE_LIBHILDON
HildonColorSelector * const sel = HILDON_COLOR_SELECTOR(m_widget);
- hildon_color_selector_set_color(sel, wx_const_cast(GdkColor *, col));
+ hildon_color_selector_set_color(sel, const_cast<GdkColor *>(col));
#else // !wxUSE_LIBHILDON
GtkColorSelection *sel =
GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(m_widget)->colorsel);
//-----------------------------------------------------------------------------
-#define M_COLDATA wx_static_cast(wxColourRefData*, m_refData)
+#define M_COLDATA static_cast<wxColourRefData*>(m_refData)
// GDK's values are in 0..65535 range, ours are in 0..255
#define SHIFT 8
return false;
wxColourRefData* refData = M_COLDATA;
- wxColourRefData* that_refData = wx_static_cast(wxColourRefData*, col.m_refData);
+ wxColourRefData* that_refData = static_cast<wxColourRefData*>(col.m_refData);
return refData->m_red == that_refData->m_red &&
refData->m_green == that_refData->m_green &&
refData->m_blue == that_refData->m_blue &&
//-----------------------------------------------------------------------------
-#define M_CURSORDATA wx_static_cast(wxCursorRefData*, m_refData)
+#define M_CURSORDATA static_cast<wxCursorRefData*>(m_refData)
IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxGDIObject)
wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data));
+ return new wxCursorRefData(*static_cast<const wxCursorRefData *>(data));
}
//-----------------------------------------------------------------------------
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_STRING );
g_object_get_property( G_OBJECT(m_renderer), "text", &gvalue );
- wxString tmp = wxGTK_CONV_BACK_FONT( g_value_get_string( &gvalue ), wx_const_cast(wxDataViewTextRenderer*, this)->GetOwner()->GetOwner()->GetFont() );
+ wxString tmp = wxGTK_CONV_BACK_FONT( g_value_get_string( &gvalue ), const_cast<wxDataViewTextRenderer*>(this)->GetOwner()->GetOwner()->GetFont() );
g_value_unset( &gvalue );
value = tmp;
wxGDIRefData* wxFont::CloneGDIRefData(const wxGDIRefData* data) const
{
- return new wxFontRefData(*wx_static_cast(const wxFontRefData*, data));
+ return new wxFontRefData(*static_cast<const wxFontRefData*>(data));
}
const wxPalette& palette)
: m_createImplicitContext(true)
{
- m_sharedContext = wx_const_cast(wxGLContext *, shared);
+ m_sharedContext = const_cast<wxGLContext *>(shared);
Create(parent, id, pos, size, style, name, attribList, palette);
}
: m_createImplicitContext(true)
{
m_sharedContext = NULL;
- m_sharedContextOf = wx_const_cast(wxGLCanvas *, shared);
+ m_sharedContextOf = const_cast<wxGLCanvas *>(shared);
Create(parent, id, pos, size, style, name, attribList, palette);
}
void wxMDIClientWindow::AddChildGTK(wxWindowGTK* child)
{
- wxMDIChildFrame* child_frame = wx_static_cast(wxMDIChildFrame*, child);
+ wxMDIChildFrame* child_frame = static_cast<wxMDIChildFrame*>(child);
wxString s = child_frame->GetTitle();
if (s.IsNull()) s = _("MDI child");
child_frame->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data);
- wxMDIParentFrame* parent_frame = wx_static_cast(wxMDIParentFrame*, GetParent());
+ wxMDIParentFrame* parent_frame = static_cast<wxMDIParentFrame*>(GetParent());
parent_frame->m_justInserted = true;
}
GtkDisableEvents();
gtk_spin_button_update( GTK_SPIN_BUTTON(m_widget) );
- wx_const_cast(wxSpinCtrlGTKBase*, this)->m_value =
+ const_cast<wxSpinCtrlGTKBase*>(this)->m_value =
gtk_spin_button_get_value(GTK_SPIN_BUTTON(m_widget));
GtkEnableEvents();
bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase);
GSList* radioGroup;
switch ( tool->GetStyle() )
bool wxToolBar::DoDeleteTool(size_t /* pos */, wxToolBarToolBase* toolBase)
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase);
if (tool->GetStyle() == wxTOOL_STYLE_CONTROL)
{
void wxToolBar::DoEnableTool(wxToolBarToolBase *toolBase, bool enable)
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase);
if (tool->m_item)
gtk_widget_set_sensitive(GTK_WIDGET(tool->m_item), enable);
void wxToolBar::DoToggleTool( wxToolBarToolBase *toolBase, bool toggle )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase);
if (tool->m_item)
{
void wxToolBar::SetToolShortHelp( int id, const wxString& helpString )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
GdkInputCondition WXUNUSED(condition))
{
wxEndProcessData * const
- proc_data = wx_static_cast(wxEndProcessData *, data);
+ proc_data = static_cast<wxEndProcessData *>(data);
// child exited, end waiting
close(source);
{
wxWindowGTK *focus = gs_pendingFocus ? gs_pendingFocus : gs_currentFocus;
// the cast is necessary when we compile in wxUniversal mode
- return wx_static_cast(wxWindow*, focus);
+ return static_cast<wxWindow*>(focus);
}
void wxWindowGTK::AddChildGTK(wxWindowGTK* child)
if (m_parent)
m_parent->ScreenToClient(&org_x, &org_y);
- wx_const_cast(wxWindowGTK*, this)->m_x = org_x;
- wx_const_cast(wxWindowGTK*, this)->m_y = org_y;
+ const_cast<wxWindowGTK*>(this)->m_x = org_x;
+ const_cast<wxWindowGTK*>(this)->m_y = org_y;
}
}
wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data));
+ return new wxBitmapRefData(*static_cast<const wxBitmapRefData *>(data));
}
bool wxBitmap::Create( int width, int height, int depth )
void ** const data = &itemsData[0];
if ( HasClientObjectData() )
- Append(items, wx_reinterpret_cast(wxClientData **, data));
+ Append(items, reinterpret_cast<wxClientData **>(data));
else
Append(items, data);
}
wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data));
+ return new wxCursorRefData(*static_cast<const wxCursorRefData *>(data));
}
//-----------------------------------------------------------------------------
wxCHECK_MSG( srcDC, false, "source must be a window DC" );
// FIXME: this cast is not always valid, see the code using m_isMemDC
- wxMemoryDCImpl *memDC = wx_static_cast(wxMemoryDCImpl *, srcDC);
+ wxMemoryDCImpl *memDC = static_cast<wxMemoryDCImpl *>(srcDC);
bool use_bitmap_method = false;
bool is_mono = false;
wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data));
+ return new wxFontRefData(*static_cast<const wxFontRefData *>(data));
}
// ----------------------------------------------------------------------------
const wxPalette& palette)
: m_createImplicitContext(true)
{
- m_sharedContext = wx_const_cast(wxGLContext *, shared);
+ m_sharedContext = const_cast<wxGLContext *>(shared);
Create(parent, id, pos, size, style, name, attribList, palette);
}
const wxPalette& palette )
: m_createImplicitContext(true)
{
- m_sharedContextOf = wx_const_cast(wxGLCanvas *, shared);
+ m_sharedContextOf = const_cast<wxGLCanvas *>(shared);
Create(parent, id, pos, size, style, name, attribList, palette);
}
gdk_gc_unref( gc );
// Hack alert
- wx_static_cast(wxClientDCImpl *, dc.GetImpl())->m_window = pizza->bin_window;
+ static_cast<wxClientDCImpl *>(dc.GetImpl())->m_window = pizza->bin_window;
dc.SetTextForeground( *wxWHITE );
dc.DrawText( win->GetTitle(), 6, 3 );
}
gdk_gc_unref( gc );
// Hack alert
- wx_static_cast(wxClientDCImpl *, dc.GetImpl())->m_window = pizza->bin_window;
+ static_cast<wxClientDCImpl *>(dc.GetImpl())->m_window = pizza->bin_window;
dc.SetTextForeground( *wxWHITE );
dc.DrawText( win->GetTitle(), 6, 3 );
}
gs_objects.m_colTooltip = wxColor(c.red >> SHIFT, c.green >> SHIFT, c.blue >> SHIFT);
c = tooltips->tip_window->style->fg[GTK_STATE_NORMAL];
gs_objects.m_colTooltipText = wxColor(c.red >> SHIFT, c.green >> SHIFT, c.blue >> SHIFT);
- gtk_object_sink(wx_reinterpret_cast(GtkObject*, tooltips));
+ gtk_object_sink(reinterpret_cast<GtkObject*>(tooltips));
}
wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
GdkInputCondition WXUNUSED(condition) )
{
wxEndProcessData * const
- proc_data = wx_static_cast(wxEndProcessData *, data);
+ proc_data = static_cast<wxEndProcessData *>(data);
// child exited, end waiting
close(source);
wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data));
+ return new wxBitmapRefData(*static_cast<const wxBitmapRefData *>(data));
}
bool wxBitmap::Create(int width, int height, int depth)
wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data));
+ return new wxCursorRefData(*static_cast<const wxCursorRefData *>(data));
}
// Motif-specific: create/get a cursor for the current display
wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data));
+ return new wxFontRefData(*static_cast<const wxFontRefData *>(data));
}
// ----------------------------------------------------------------------------
int slen = str.length();
XTextExtents((XFontStruct*) pFontStruct,
- wx_const_cast(char*, (const char *)str.mb_str()), slen,
+ const_cast<char*>((const char *)str.mb_str()), slen,
&direction, &ascent2, &descent2, &overall);
if ( width )
argv[n] = NULL;
while (n-- > 0)
- argv[n] = wx_const_cast(wxChar*, (const char *)args[n].c_str());
+ argv[n] = const_cast<wxChar*>((const char *)args[n].c_str());
long result = wxExecute(argv, flags, process);
{
if ( m_ok == -1 )
{
- wxConsoleStderr * const self = wx_const_cast(wxConsoleStderr *, this);
+ wxConsoleStderr * const self = const_cast<wxConsoleStderr *>(this);
self->m_ok = self->DoInit();
// no need to call IsHistoryUnchanged() as we just initialized
wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *dataOrig) const
{
const wxBitmapRefData *
- data = wx_static_cast(const wxBitmapRefData *, dataOrig);
+ data = static_cast<const wxBitmapRefData *>(dataOrig);
if ( !data )
return NULL;
// wxBitmapRefData using its copy ctor but instead it modifies this
// bitmap itself and then returns its m_refData -- which works, of
// course (except in !wxUSE_WXDIB), but is completely illogical
- wxBitmap *self = wx_const_cast(wxBitmap *, this);
+ wxBitmap *self = const_cast<wxBitmap *>(this);
wxBitmapRefData *selfdata;
#if wxUSE_WXDIB
wxDIB dib((HBITMAP)(data->m_hBitmap));
self->CopyFromDIB(dib);
- selfdata = wx_static_cast(wxBitmapRefData *, m_refData);
+ selfdata = static_cast<wxBitmapRefData *>(m_refData);
selfdata->m_hasAlpha = data->m_hasAlpha;
}
else
wxSize wxButton::DoGetBestSize() const
{
- return wxMSWButton::ComputeBestSize(wx_const_cast(wxButton *, this));
+ return wxMSWButton::ComputeBestSize(const_cast<wxButton *>(this));
}
/* static */
case MCHT_CALENDARDAY:
if ( wd )
{
- *wd = wx_static_cast(wxDateTime::WeekDay, hti.st.wDayOfWeek);
+ *wd = static_cast<wxDateTime::WeekDay>(hti.st.wDayOfWeek);
}
return wxCAL_HITTEST_HEADER;
int wCheckbox, hCheckbox;
if ( !str.empty() )
{
- wxClientDC dc(wx_const_cast(wxCheckBox *, this));
+ wxClientDC dc(const_cast<wxCheckBox *>(this));
dc.SetFont(GetFont());
dc.GetMultiLineTextExtent(GetLabelText(str), &wCheckbox, &hCheckbox);
wCheckbox += s_checkSize + GetCharWidth();
{
CHOOSECOLOR *pCC = (CHOOSECOLOR *)lParam;
wxColourDialog * const
- dialog = wx_reinterpret_cast(wxColourDialog *, pCC->lCustData);
+ dialog = reinterpret_cast<wxColourDialog *>(pCC->lCustData);
const wxString title = dialog->GetTitle();
if ( !title.empty() )
wxSize wxDatePickerCtrl::DoGetBestSize() const
{
- wxClientDC dc(wx_const_cast(wxDatePickerCtrl *, this));
+ wxClientDC dc(const_cast<wxDatePickerCtrl *>(this));
// we can't use FormatDate() here as the CRT doesn't always use the same
// format as the date picker control
NULL, // no driver name as we use device name
deviceName.wx_str(),
NULL, // unused
- wx_static_cast(DEVMODE *, lockDevMode.Get())
+ static_cast<DEVMODE *>(lockDevMode.Get())
);
if ( !hDC )
wxLogLastError(_T("CreateDC(printer)"));
if ( pGuid )
{
wxDisplayFactoryDirectDraw * self =
- wx_static_cast(wxDisplayFactoryDirectDraw *, lpContext);
+ static_cast<wxDisplayFactoryDirectDraw *>(lpContext);
self->AddDisplay(*pGuid, hmon, driverName);
}
//else: we're called for the primary monitor, skip it
wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") );
wxDisplayInfoDirectDraw *
- info = wx_static_cast(wxDisplayInfoDirectDraw *, m_displays[n]);
+ info = static_cast<wxDisplayInfoDirectDraw *>(m_displays[n]);
if ( !info->m_pDD2 )
{
if ( (lpDDSurfaceDesc->dwFlags & FLAGS_REQUIRED) == FLAGS_REQUIRED )
{
wxDDVideoModesAdder * const vmodes =
- wx_static_cast(wxDDVideoModesAdder *, lpContext);
+ static_cast<wxDDVideoModesAdder *>(lpContext);
vmodes->Add(wxVideoMode(lpDDSurfaceDesc->dwWidth,
lpDDSurfaceDesc->dwHeight,
wxString ver;
if ( m_dll.IsLoaded() )
{
- wxChar *pc = wx_const_cast(wxChar *, (const wxChar*) filename.t_str());
+ wxChar *pc = const_cast<wxChar *>((const wxChar*) filename.t_str());
DWORD dummy;
DWORD sizeVerInfo = m_pfnGetFileVersionInfoSize(pc, &dummy);
wxEnhMetaFile *wxEnhMetaFileDC::Close()
{
wxEnhMetaFileDCImpl * const
- impl = wx_static_cast(wxEnhMetaFileDCImpl *, GetImpl());
+ impl = static_cast<wxEnhMetaFileDCImpl *>(GetImpl());
wxCHECK_MSG( impl, NULL, _T("no wxEnhMetaFileDC implementation") );
return impl->Close();
{
case WM_NOTIFY:
{
- OFNOTIFY *pNotifyCode = wx_reinterpret_cast(OFNOTIFY *, lParam);
+ OFNOTIFY *pNotifyCode = reinterpret_cast<OFNOTIFY *>(lParam);
if ( pNotifyCode->hdr.code == CDN_INITDONE )
{
- wx_reinterpret_cast(wxFileDialog *,
+ reinterpret_cast<wxFileDialog *>(
pNotifyCode->lpOFN->lCustData)
->MSWOnInitDone((WXHWND)hDlg);
}
WXHFONT GetHFONT(const wxFont *font) const
{
if ( !m_hFont )
- wx_const_cast(wxFontRefData *, this)->Alloc(font);
+ const_cast<wxFontRefData *>(this)->Alloc(font);
return (WXHFONT)m_hFont;
}
wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data));
+ return new wxFontRefData(*static_cast<const wxFontRefData *>(data));
}
bool wxFont::RealizeResource()
#include "wx/msw/private.h"
-#define M_GDIDATA wx_static_cast(wxGDIRefData*, m_refData)
+#define M_GDIDATA static_cast<wxGDIRefData*>(m_refData)
/*
void wxGDIObject::IncrementResourceUsage(void)
wxObjectRefData *wxIcon::CloneRefData(const wxObjectRefData *dataOrig) const
{
const wxIconRefData *
- data = wx_static_cast(const wxIconRefData *, dataOrig);
+ data = static_cast<const wxIconRefData *>(dataOrig);
if ( !data )
return NULL;
HWND hwndEdit = ListView_GetEditControl(GetHwnd());
if ( hwndEdit )
{
- wxListCtrl * const self = wx_const_cast(wxListCtrl *, this);
+ wxListCtrl * const self = const_cast<wxListCtrl *>(this);
if ( !m_textCtrl )
self->m_textCtrl = new wxTextCtrl;
bool wxAMMediaBackend::SetVolume(double dVolume)
{
// inverse the transformation above
- long lVolume = wx_static_cast(long, 2000*log10(dVolume + (1 - dVolume)*0.00001));
+ long lVolume = static_cast<long>(2000*log10(dVolume + (1 - dVolume)*0.00001));
HRESULT hr = GetAM()->put_Volume(lVolume);
if(FAILED(hr))
}
mii.cch = itemText.length();
- mii.dwTypeData = wx_const_cast(wxChar *, itemText.wx_str());
+ mii.dwTypeData = const_cast<wxChar *>(itemText.wx_str());
if (flags & MF_POPUP)
{
// item and this looks downright ugly
//
// so instead draw it ourselves in MSWOnDrawItem()
- mii.dwItemData = wx_reinterpret_cast(ULONG_PTR, pItem);
+ mii.dwItemData = reinterpret_cast<ULONG_PTR>(pItem);
if ( pItem->IsCheckable() )
{
mii.hbmpChecked =
info.fMask = MIIM_TYPE;
info.fType = MFT_STRING;
info.cch = m_title.length();
- info.dwTypeData = wx_const_cast(wxChar *, m_title.wx_str());
+ info.dwTypeData = const_cast<wxChar *>(m_title.wx_str());
if ( !SetMenuItemInfo(hMenu, 0, TRUE, & info) )
{
wxLogLastError(wxT("SetMenuItemInfo"));
if ( m_hMenu != 0 )
return m_hMenu;
- wxToolMenuBar * const bar = wx_static_cast(wxToolMenuBar *, GetToolBar());
+ wxToolMenuBar * const bar = static_cast<wxToolMenuBar *>(GetToolBar());
if ( !bar )
return NULL;
info.fMask = MIIM_TYPE;
info.fType = MFT_STRING;
info.cch = label.length();
- info.dwTypeData = wx_const_cast(wxChar *, label.wx_str());
+ info.dwTypeData = const_cast<wxChar *>(label.wx_str());
if ( !SetMenuItemInfo(GetHmenu(), id, TRUE, &info) )
{
wxLogLastError(wxT("SetMenuItemInfo"));
// generating WM_COMMAND messages with negative high word of wParam), so
// use the cast to ensure the id is in range
return m_subMenu ? wxPtrToUInt(m_subMenu->GetHMenu())
- : wx_static_cast(unsigned short, GetId());
+ : static_cast<unsigned short>(GetId());
}
// get item state
wxGDIRefData *wxMetafile::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxMetafileRefData(*wx_static_cast(const wxMetafileRefData *, data));
+ return new wxMetafileRefData(*static_cast<const wxMetafileRefData *>(data));
}
bool wxMetafile::SetClipboard(int width, int height)
if ( ::GetClassInfo(NULL, WC_TABCONTROL, &wc) )
{
gs_wndprocNotebook =
- wx_reinterpret_cast(WXFARPROC, wc.lpfnWndProc);
+ reinterpret_cast<WXFARPROC>(wc.lpfnWndProc);
wc.lpszClassName = wxT("_wx_SysTabCtl32");
wc.style &= ~(CS_HREDRAW | CS_VREDRAW);
wc.hInstance = wxGetInstance();
// hack: the third parameter is declared non-const in Wine's headers so
// cast away the const
const size_t realsz = ::HeapSize(::GetProcessHeap(), 0,
- wx_const_cast(void*, buffer));
+ const_cast<void*>(buffer));
if ( realsz == (size_t)-1 )
{
// note that HeapSize() does not set last error
wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxPaletteRefData(*wx_static_cast(const wxPaletteRefData *, data));
+ return new wxPaletteRefData(*static_cast<const wxPaletteRefData *>(data));
}
int wxPalette::GetColoursCount() const
// accessors and setters
// ---------------------
- wxColour& GetColour() const { return wx_const_cast(wxColour&, m_colour); }
+ wxColour& GetColour() const { return const_cast<wxColour&>(m_colour); }
int GetWidth() const { return m_width; }
wxPenStyle GetStyle() const { return m_style; }
wxPenJoin GetJoin() const { return m_join; }
wxPenCap GetCap() const { return m_cap; }
wxDash* GetDash() const { return m_dash; }
int GetDashCount() const { return m_nbDash; }
- wxBitmap* GetStipple() const { return wx_const_cast(wxBitmap *, &m_stipple); }
+ wxBitmap* GetStipple() const { return const_cast<wxBitmap *>(&m_stipple); }
void SetColour(const wxColour& col) { Free(); m_colour = col; }
void SetWidth(int width) { Free(); m_width = width; }
Free();
m_nbDash = nb_dashes;
- m_dash = wx_const_cast(wxDash *, dash);
+ m_dash = const_cast<wxDash *>(dash);
}
void SetJoin(wxPenJoin join) { Free(); m_join = join; }
WXHPEN wxPenRefData::GetHPEN() const
{
if ( !m_hPen )
- wx_const_cast(wxPenRefData *, this)->Alloc();
+ const_cast<wxPenRefData *>(this)->Alloc();
return (WXHPEN)m_hPen;
}
bool wxPen::operator==(const wxPen& pen) const
{
const wxPenRefData *
- penData = wx_static_cast(const wxPenRefData *, pen.m_refData);
+ penData = static_cast<const wxPenRefData *>(pen.m_refData);
// an invalid pen is only equal to another invalid pen
return m_refData ? penData && *M_PENDATA == *penData : !penData;
wxGDIRefData* wxPen::CloneGDIRefData(const wxGDIRefData* data) const
{
- return new wxPenRefData(*wx_static_cast(const wxPenRefData*, data));
+ return new wxPenRefData(*static_cast<const wxPenRefData*>(data));
}
void wxPen::SetColour(const wxColour& col)
wxWindowsPrintNativeData::~wxWindowsPrintNativeData()
{
if ( m_devMode )
- ::GlobalFree(wx_static_cast(HGLOBAL, m_devMode));
+ ::GlobalFree(static_cast<HGLOBAL>(m_devMode));
if ( m_devNames )
- ::GlobalFree(wx_static_cast(HGLOBAL, m_devNames));
+ ::GlobalFree(static_cast<HGLOBAL>(m_devNames));
}
bool wxWindowsPrintNativeData::IsOk() const
GlobalPtrLock lockDevMode(m_devMode);
- LPDEVMODE devMode = wx_static_cast(LPDEVMODE, lockDevMode.Get());
+ LPDEVMODE devMode = static_cast<LPDEVMODE>(lockDevMode.Get());
//// Orientation
if (devMode->dmFields & DM_ORIENTATION)
if ( m_devNames )
{
GlobalPtrLock lockDevNames(m_devNames);
- LPDEVNAMES lpDevNames = wx_static_cast(LPDEVNAMES, lockDevNames.Get());
+ LPDEVNAMES lpDevNames = static_cast<LPDEVNAMES>(lockDevNames.Get());
// TODO: Unicode-ification
bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
{
- HGLOBAL hDevMode = wx_static_cast(HGLOBAL, m_devMode);
+ HGLOBAL hDevMode = static_cast<HGLOBAL>(m_devMode);
if ( !m_devMode )
{
// Use PRINTDLG as a way of creating a DEVMODE object
if ( hDevMode )
{
GlobalPtrLock lockDevMode(hDevMode);
- DEVMODE * const devMode = wx_static_cast(DEVMODE *, lockDevMode.Get());
+ DEVMODE * const devMode = static_cast<DEVMODE *>(lockDevMode.Get());
//// Orientation
devMode->dmOrientation = (short)data.GetOrientation();
{
// NB: the cast is needed in the ANSI build, strangely enough
// dmDeviceName is BYTE[] and not char[] there
- wxStrncpy(wx_reinterpret_cast(wxChar *, devMode->dmDeviceName),
+ wxStrncpy(reinterpret_cast<wxChar *>(devMode->dmDeviceName),
name.wx_str(),
WXSIZEOF(devMode->dmDeviceName) - 1);
devMode->dmDeviceName[WXSIZEOF(devMode->dmDeviceName) - 1] = wxT('\0');
if ( m_devNames )
{
- ::GlobalFree(wx_static_cast(HGLOBAL, m_devNames));
+ ::GlobalFree(static_cast<HGLOBAL>(m_devNames));
}
// TODO: I hope it's OK to pass some empty strings to DEVNAMES.
if (pd->hDevNames)
GlobalFree(pd->hDevNames);
- pd->hDevMode = wx_static_cast(HGLOBAL, native_data->GetDevMode());
+ pd->hDevMode = static_cast<HGLOBAL>(native_data->GetDevMode());
native_data->SetDevMode(NULL);
// Shouldn't assert; we should be able to test Ok-ness at a higher level
//wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
- pd->hDevNames = wx_static_cast(HGLOBAL, native_data->GetDevNames());
+ pd->hDevNames = static_cast<HGLOBAL>(native_data->GetDevNames());
native_data->SetDevNames(NULL);
{
if (native_data->GetDevMode())
{
- ::GlobalFree(wx_static_cast(HGLOBAL, native_data->GetDevMode()));
+ ::GlobalFree(static_cast<HGLOBAL>(native_data->GetDevMode()));
}
native_data->SetDevMode(pd->hDevMode);
pd->hDevMode = NULL;
{
if (native_data->GetDevNames())
{
- ::GlobalFree(wx_static_cast(HGLOBAL, native_data->GetDevNames()));
+ ::GlobalFree(static_cast<HGLOBAL>(native_data->GetDevNames()));
}
native_data->SetDevNames(pd->hDevNames);
pd->hDevNames = NULL;
const wxSize& fullSize)
: wxDC(new PageFragmentDCImpl((wxMemoryDC*)this, printer, offset, fullSize))
{
- wx_static_cast(PageFragmentDCImpl*, m_pimpl)->DoSelect(bmp);
+ static_cast<PageFragmentDCImpl*>(m_pimpl)->DoSelect(bmp);
}
};
// write all the rest as comma-separated bytes
value.reserve(3*size + 10);
- const char * const p = wx_static_cast(const char *, data);
+ const char * const p = static_cast<const char *>(data);
for ( size_t n = 0; n < size; n++ )
{
// TODO: line wrapping: although not required by regedit, this makes
// dump all our values
long dummy;
wxString name;
- wxRegKey& self = wx_const_cast(wxRegKey&, *this);
+ wxRegKey& self = const_cast<wxRegKey&>(*this);
bool cont = self.GetFirstValue(name, dummy);
while ( cont )
{
BOOL CALLBACK
EnumSymbolsProc(PSYMBOL_INFO pSymInfo, ULONG WXUNUSED(SymSize), PVOID data)
{
- wxStackFrame *frame = wx_static_cast(wxStackFrame *, data);
+ wxStackFrame *frame = static_cast<wxStackFrame *>(data);
// we're only interested in parameters
if ( pSymInfo->Flags & IMAGEHLP_SYMBOL_INFO_PARAMETER )
wxSize wxStaticText::DoGetBestSize() const
{
- wxClientDC dc(wx_const_cast(wxStaticText *, this));
+ wxClientDC dc(const_cast<wxStaticText *>(this));
wxFont font(GetFont());
if (!font.Ok())
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
// dummy value used for m_dropTarget, different from any valid pointer value
// (which are all even under Windows) and NULL
static wxDropTarget *
- wxRICHTEXT_DEFAULT_DROPTARGET = wx_reinterpret_cast(wxDropTarget *, 1);
+ wxRICHTEXT_DEFAULT_DROPTARGET = reinterpret_cast<wxDropTarget *>(1);
#endif // wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT
memcpy(olestr, wcbuf, size);
- *rgelt++ = wx_static_cast(LPOLESTR, olestr);
+ *rgelt++ = static_cast<LPOLESTR>(olestr);
++(*pceltFetched);
}
NULL,
CLSCTX_INPROC_SERVER,
IID_IAutoComplete,
- wx_reinterpret_cast(void **, &pAutoComplete)
+ reinterpret_cast<void **>(&pAutoComplete)
);
if ( FAILED(hr) )
{
hr = pAutoComplete->QueryInterface
(
IID_IAutoComplete2,
- wx_reinterpret_cast(void **, &pAutoComplete2)
+ reinterpret_cast<void **>(&pAutoComplete2)
);
if ( SUCCEEDED(hr) )
{
wxSize wxToggleButton::DoGetBestSize() const
{
- return wxMSWButton::ComputeBestSize(wx_const_cast(wxToggleButton *, this));
+ return wxMSWButton::ComputeBestSize(const_cast<wxToggleButton *>(this));
}
void wxToggleButton::SetLabel(const wxString& label)
void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
wxZeroMemory(info);
info.dwOSVersionInfoSize = sizeof(info);
- if ( ::GetVersionEx(wx_reinterpret_cast(OSVERSIONINFO *, &info)) )
+ if ( ::GetVersionEx(reinterpret_cast<OSVERSIONINFO *>(&info)) )
{
switch ( info.wProductType )
{
wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const
{
- return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data));
+ return new wxBitmapRefData(*static_cast<const wxBitmapRefData *>(data));
}
// this function should be called from all wxBitmap ctors
wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data));
+ return new wxFontRefData(*static_cast<const wxFontRefData *>(data));
}
bool wxFont::RealizeResource()
wxGDIRefData *wxMetafile::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxMetafileRefData(*wx_static_cast(const wxMetafileRefData *, data));
+ return new wxMetafileRefData(*static_cast<const wxMetafileRefData *>(data));
}
bool wxMetafile::SetClipboard(int width, int height)
wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxPaletteRefData(*wx_static_cast(const wxPaletteRefData *, data));
+ return new wxPaletteRefData(*static_cast<const wxPaletteRefData *>(data));
}
int wxPalette::GetPixel( unsigned char cRed,
bool wxPen::operator==(const wxPen& pen) const
{
const wxPenRefData *
- penData = wx_static_cast(const wxPenRefData *, pen.m_refData);
+ penData = static_cast<const wxPenRefData *>(pen.m_refData);
// an invalid pen is only equal to another invalid pen
return m_refData ? penData && *M_PENDATA == *penData : !penData;
wxGDIRefData* wxPen::CloneGDIRefData(const wxGDIRefData* data) const
{
- return new wxPenRefData(*wx_static_cast(const wxPenRefData*, data));
+ return new wxPenRefData(*static_cast<const wxPenRefData*>(data));
}
void wxPen::SetColour( const wxColour& rColour )
{
if ( m_prefix.empty() )
{
- wxStandardPaths *self = wx_const_cast(wxStandardPaths *, this);
+ wxStandardPaths *self = const_cast<wxStandardPaths *>(this);
self->m_prefix = _T("/usr/local");
}
#endif // wxUSE_LOG
wxEventLoop * const
- loop = wx_static_cast(wxEventLoop *, wxEventLoop::GetActive());
+ loop = static_cast<wxEventLoop *>(wxEventLoop::GetActive());
if ( loop )
{
// process all pending events:
DECLARE_NO_ASSIGN_CLASS(wxCursorRefData)
};
-#define M_CURSORDATA wx_static_cast(wxCursorRefData*, m_refData)
+#define M_CURSORDATA static_cast<wxCursorRefData*>(m_refData)
#if wxOSX_USE_COCOA_OR_CARBON
wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data));
+ return new wxCursorRefData(*static_cast<const wxCursorRefData *>(data));
}
bool wxCursor::CreateFromXpm(const char* const* bits)
BeginAppModalStateForWindow(windowRef) ;
wxEventLoop * const
- loop = wx_static_cast(wxEventLoop *, wxEventLoop::GetActive());
+ loop = static_cast<wxEventLoop *>(wxEventLoop::GetActive());
wxASSERT_MSG( loop , wxT("No Event Loop in place") );
wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data));
+ return new wxFontRefData(*static_cast<const wxFontRefData *>(data));
}
void wxFont::SetPointSize(int pointSize)
aglSetInteger(m_glContext, AGL_BUFFER_NAME, &bufnummer);
//win.SetLastContext(m_glContext);
- wx_const_cast(wxGLCanvas&, win).SetViewport();
+ const_cast<wxGLCanvas&>(win).SetViewport();
if ( !aglSetDrawable(m_glContext, drawable) )
{
wxGDIRefData *wxIcon::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxIconRefData(*wx_static_cast(const wxIconRefData *, data));
+ return new wxIconRefData(*static_cast<const wxIconRefData *>(data));
}
WXHICON wxIcon::GetHICON() const
wxASSERT_MSG( dataItem, _T("could not obtain wxMacDataItem for row in MacSetColumnInfo. Is row a valid wxListCtrl row?") );
if (item)
{
- wxMacListCtrlItem* listItem = wx_static_cast(wxMacListCtrlItem*,dataItem);
+ wxMacListCtrlItem* listItem = static_cast<wxMacListCtrlItem *>(dataItem);
bool hasInfo = listItem->HasColumnInfo( column );
listItem->SetColumnInfo( column, item );
listItem->SetOrder(row);
// CS should this guard against dataItem = 0 ? , as item is not a pointer if (item) is not appropriate
//if (item)
{
- wxMacListCtrlItem* listItem =wx_static_cast(wxMacListCtrlItem*,dataItem);
+ wxMacListCtrlItem* listItem = static_cast<wxMacListCtrlItem *>(dataItem);
if (!listItem->HasColumnInfo( column ))
return;
{
CGPDFPageRef page = CGPDFDocumentGetPage( m_pdfDoc, 1 );
CGRect rect = CGPDFPageGetBoxRect ( page, kCGPDFMediaBox);
- m_width = wx_static_cast(int, rect.size.width);
- m_height = wx_static_cast(int, rect.size.height);
+ m_width = static_cast<int>(rect.size.width);
+ m_height = static_cast<int>(rect.size.height);
}
}
wxGDIRefData *wxMetaFile::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxMetafileRefData(*wx_static_cast(const wxMetafileRefData *, data));
+ return new wxMetafileRefData(*static_cast<const wxMetafileRefData *>(data));
}
WXHMETAFILE wxMetaFile::GetHMETAFILE() const
wxCFRef<CGDataProviderRef> provider(wxMacCGDataProviderCreateWithCFData(data));
QDPictRef pictRef = QDPictCreateWithProvider(provider);
CGRect rect = QDPictGetBounds(pictRef);
- m_refData = new wxMetafileRefData(wx_static_cast(int, rect.size.width),
- wx_static_cast(int, rect.size.height));
+ m_refData = new wxMetafileRefData(static_cast<int>(rect.size.width),
+ static_cast<int>(rect.size.height));
QDPictDrawToCGContext( ((wxMetafileRefData*) m_refData)->GetContext(), rect, pictRef );
CFRelease( data );
QDPictRelease( pictRef );
wxGDIRefData *wxRegion::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxRegionRefData(*wx_static_cast(const wxRegionRefData *, data));
+ return new wxRegionRefData(*static_cast<const wxRegionRefData *>(data));
}
//-----------------------------------------------------------------------------
{
CGRect box ;
HIShapeGetBounds( M_REGION , &box ) ;
- x = wx_static_cast(int, box.origin.x);
- y = wx_static_cast(int, box.origin.y);
- w = wx_static_cast(int, box.size.width);
- h = wx_static_cast(int, box.size.height);
+ x = static_cast<int>(box.origin.x);
+ y = static_cast<int>(box.origin.y);
+ w = static_cast<int>(box.size.width);
+ h = static_cast<int>(box.size.height);
return true;
}
static inline int wxConvertToTXN(int x)
{
- return wx_static_cast(int, x / 254.0 * 72 + 0.5);
+ return static_cast<int>(x / 254.0 * 72 + 0.5);
}
void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , long to )
void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
{
- wxToolBarTool *tool = wx_static_cast( wxToolBarTool*, toolBase );
+ wxToolBarTool *tool = static_cast< wxToolBarTool*>(toolBase );
if (tool == NULL)
return false;
bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolbase)
{
- wxToolBarTool* tool = wx_static_cast( wxToolBarTool*, toolbase );
+ wxToolBarTool* tool = static_cast< wxToolBarTool*>(toolbase );
wxToolBarToolsList::compatibility_iterator node;
for ( node = m_tools.GetFirst(); node; node = node->GetNext() )
{
const wxMacDataItem* rhs,
DataBrowserPropertyID sortProperty) const
{
- const wxMacDataItem* otherItem = wx_const_cast(wxMacDataItem*,rhs);
bool retval = false;
if ( sortProperty == kNumericOrderColumnId )
- retval = m_order < otherItem->m_order;
+ retval = m_order < rhs->m_order;
return retval;
}
thisWindow->GetCaret()->OnKillFocus();
#endif
- wxLogTrace(_T("Focus"), _T("focus lost(%p)"), wx_static_cast(void*, thisWindow));
+ wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast<void*>(thisWindow));
// remove this as soon as posting the synthesized event works properly
static bool inKillFocusEvent = false ;
{
// set focus
// panel wants to track the window which was the last to have focus in it
- wxLogTrace(_T("Focus"), _T("focus set(%p)"), wx_static_cast(void*, thisWindow));
+ wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast<void*>(thisWindow));
wxChildFocusEvent eventFocus((wxWindow*)thisWindow);
thisWindow->HandleWindowEvent(eventFocus);
if ( controlPart != kControlFocusNoPart )
{
targetFocusWindow = thisWindow;
- wxLogTrace(_T("Focus"), _T("focus to be set(%p)"), wx_static_cast(void*, thisWindow));
+ wxLogTrace(_T("Focus"), _T("focus to be set(%p)"), static_cast<void*>(thisWindow));
}
else
{
formerFocusWindow = thisWindow;
- wxLogTrace(_T("Focus"), _T("focus to be lost(%p)"), wx_static_cast(void*, thisWindow));
+ wxLogTrace(_T("Focus"), _T("focus to be lost(%p)"), static_cast<void*>(thisWindow));
}
ControlPartCode previousControlPart = 0;
thisWindow->GetCaret()->OnKillFocus();
#endif
- wxLogTrace(_T("Focus"), _T("focus lost(%p)"), wx_static_cast(void*, thisWindow));
+ wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast<void*>(thisWindow));
static bool inKillFocusEvent = false ;
else
{
// panel wants to track the window which was the last to have focus in it
- wxLogTrace(_T("Focus"), _T("focus set(%p)"), wx_static_cast(void*, thisWindow));
+ wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast<void*>(thisWindow));
wxChildFocusEvent eventFocus((wxWindow*)thisWindow);
thisWindow->HandleWindowEvent(eventFocus);
void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
{
- wxToolBarTool *tool = wx_static_cast( wxToolBarTool*, toolBase );
+ wxToolBarTool *tool = static_cast< wxToolBarTool*>(toolBase );
if (tool == NULL)
return false;
bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolbase)
{
- wxToolBarTool* tool = wx_static_cast( wxToolBarTool*, toolbase );
+ wxToolBarTool* tool = static_cast< wxToolBarTool*>(toolbase );
wxToolBarToolsList::compatibility_iterator node;
for ( node = m_tools.GetFirst(); node; node = node->GetNext() )
{
wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const
{
- return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data));
+ return new wxBitmapRefData(*static_cast<const wxBitmapRefData *>(data));
}
void * wxBitmap::GetRawAccess() const
const void* data,
void* info)
{
- GSocket * const socket = wx_static_cast(GSocket *, info);
+ GSocket * const socket = static_cast<GSocket *>(info);
MacGSocketData * const
- macdata = wx_static_cast(MacGSocketData *, socket->m_gui_dependent);
+ macdata = static_cast<MacGSocketData *>(socket->m_gui_dependent);
if ( !macdata )
return;
// may return NULL if we hadn't created the data for this socket yet
MacGSocketData *GetData(GSocket *socket) const
{
- return wx_static_cast(MacGSocketData *, socket->m_gui_dependent);
+ return static_cast<MacGSocketData *>(socket->m_gui_dependent);
}
// return the custom data pointer initializing it if it hadn't been done
if ( obj == NULL )
return wxNullBitmap ;
else if ( obj->IsKindOf(CLASSINFO(wxIcon)) )
- return wxBitmap( *(wx_static_cast(wxIcon*, obj)) ) ;
+ return wxBitmap( *(static_cast<wxIcon*>(obj)) ) ;
else
- return *(wx_static_cast(wxBitmap*, obj)) ;
+ return *(static_cast<wxBitmap*>(obj)) ;
}
// Get the icon
return wxNullIcon ;
}
else
- return *(wx_static_cast(wxIcon*, obj)) ;
+ return *(static_cast<wxIcon*>(obj)) ;
}
bool wxImageList::Replace( int index, const wxBitmap &bitmap )
wxObject *obj = (wxObject*)node->GetData();
if (obj->IsKindOf(CLASSINFO(wxIcon)))
{
- wxIcon *bm = wx_static_cast( wxIcon* , obj ) ;
+ wxIcon *bm = static_cast< wxIcon* >(obj ) ;
width = bm->GetWidth();
height = bm->GetHeight();
}
else
{
- wxBitmap *bm = wx_static_cast( wxBitmap* , obj ) ;
+ wxBitmap *bm = static_cast< wxBitmap* >(obj ) ;
width = bm->GetWidth();
height = bm->GetHeight();
}
wxObject *obj = (wxObject*)node->GetData();
if (obj->IsKindOf(CLASSINFO(wxIcon)))
{
- wxIcon *bm = wx_static_cast( wxIcon* , obj ) ;
+ wxIcon *bm = static_cast< wxIcon* >(obj ) ;
dc.DrawIcon( *bm , x, y );
}
else
{
- wxBitmap *bm = wx_static_cast( wxBitmap* , obj ) ;
+ wxBitmap *bm = static_cast< wxBitmap* >(obj ) ;
dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 );
}
wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxPaletteRefData(*wx_static_cast(const wxPaletteRefData *, data));
+ return new wxPaletteRefData(*static_cast<const wxPaletteRefData *>(data));
}
#endif // wxUSE_PALETTE
wxGDIRefData *wxPen::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxPenRefData(*wx_static_cast(const wxPenRefData *, data));
+ return new wxPenRefData(*static_cast<const wxPenRefData *>(data));
}
bool wxPen::operator==(const wxPen& pen) const
wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data));
+ return new wxFontRefData(*static_cast<const wxFontRefData *>(data));
}
bool wxFont::RealizeResource()
// argv[] must be NULL-terminated
argv[argc] = NULL;
- return wxEntry(wx_const_cast(int, argc), argv);
+ return wxEntry(const_cast<int>(argc), argv);
}
#endif // wxUSE_GUI
wxGDIRefData *wxPen::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxPenRefData(*wx_static_cast(const wxPenRefData *, data));
+ return new wxPenRefData(*static_cast<const wxPenRefData *>(data));
}
operator const XineramaScreenInfo *() const { return m_screens; }
- unsigned GetCount() const { return wx_static_cast(unsigned, m_num); }
+ unsigned GetCount() const { return static_cast<unsigned>(m_num); }
private:
XineramaScreenInfo *m_screens;
{
if ( m_prefix.empty() )
{
- wx_const_cast(wxStandardPaths *, this)->m_prefix = wxT("/sys$system");
+ const_cast<wxStandardPaths *>(this)->m_prefix = wxT("/sys$system");
}
return m_prefix;
{
if ( m_prefix.empty() )
{
- wxStandardPaths *pathPtr = wx_const_cast(wxStandardPaths *, this);
+ wxStandardPaths *pathPtr = const_cast<wxStandardPaths *>(this);
pathPtr->DetectPrefix();
}
wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data));
+ return new wxBitmapRefData(*static_cast<const wxBitmapRefData *>(data));
}
bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data));
+ return new wxCursorRefData(*static_cast<const wxCursorRefData *>(data));
}
WXCursor wxCursor::GetCursor() const
wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data));
+ return new wxFontRefData(*static_cast<const wxFontRefData *>(data));
}
// ----------------------------------------------------------------------------
int wxGLCanvas::GetColourIndex(const wxColour& col_)
{
- wxColour& col = wx_const_cast(wxColour&, col_);
+ wxColour& col = const_cast<wxColour&>(col_);
#ifdef __WXMOTIF__
col.AllocColour(GetXDisplay());
wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxPaletteRefData(*wx_static_cast(const wxPaletteRefData *, data));
+ return new wxPaletteRefData(*static_cast<const wxPaletteRefData *>(data));
}
int wxPalette::GetPixel(unsigned char WXUNUSED(red),