Use wx prefix for global names

This commit is contained in:
Paul Cornett
2017-10-01 10:03:48 -07:00
parent 63a8a852f9
commit 37e29d3451
6 changed files with 36 additions and 36 deletions

View File

@@ -62,10 +62,10 @@ public:
virtual void ShowHidden(bool show) = 0; virtual void ShowHidden(bool show) = 0;
}; };
void GenerateFilterChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd ); void wxGenerateFilterChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd );
void GenerateFolderChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd ); void wxGenerateFolderChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd );
void GenerateSelectionChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd ); void wxGenerateSelectionChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd );
void GenerateFileActivatedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd, const wxString& filename = wxEmptyString ); void wxGenerateFileActivatedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd, const wxString& filename = wxEmptyString );
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) #if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#define wxFileCtrl wxGtkFileCtrl #define wxFileCtrl wxGtkFileCtrl

View File

@@ -277,7 +277,7 @@ static long GetTruncatedJDN(wxDateTime::wxDateTime_t day,
// this function is a wrapper around strftime(3) adding error checking // this function is a wrapper around strftime(3) adding error checking
// NOTE: not static because used by datetimefmt.cpp // NOTE: not static because used by datetimefmt.cpp
wxString CallStrftime(const wxString& format, const tm* tm) wxString wxCallStrftime(const wxString& format, const tm* tm)
{ {
wxChar buf[4096]; wxChar buf[4096];
// Create temp wxString here to work around mingw/cygwin bug 1046059 // Create temp wxString here to work around mingw/cygwin bug 1046059
@@ -330,7 +330,7 @@ static void ReplaceDefaultYearMonthWithCurrent(int *year,
// fill the struct tm with default values // fill the struct tm with default values
// NOTE: not static because used by datetimefmt.cpp // NOTE: not static because used by datetimefmt.cpp
void InitTm(struct tm& tm) void wxInitTm(struct tm& tm)
{ {
// struct tm may have etxra fields (undocumented and with unportable // struct tm may have etxra fields (undocumented and with unportable
// names) which, nevertheless, must be set to 0 // names) which, nevertheless, must be set to 0
@@ -749,10 +749,10 @@ wxString wxDateTime::GetMonthName(wxDateTime::Month month,
// notice that we must set all the fields to avoid confusing libc (GNU one // notice that we must set all the fields to avoid confusing libc (GNU one
// gets confused to a crash if we don't do this) // gets confused to a crash if we don't do this)
tm tm; tm tm;
InitTm(tm); wxInitTm(tm);
tm.tm_mon = month; tm.tm_mon = month;
return CallStrftime(flags == Name_Abbr ? wxT("%b") : wxT("%B"), &tm); return wxCallStrftime(flags == Name_Abbr ? wxS("%b") : wxS("%B"), &tm);
#else // !wxHAS_STRFTIME #else // !wxHAS_STRFTIME
return GetEnglishMonthName(month, flags); return GetEnglishMonthName(month, flags);
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME #endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
@@ -788,7 +788,7 @@ wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
// after adding wday to it below we still have a valid date, e.g. don't // after adding wday to it below we still have a valid date, e.g. don't
// take 28 here!) // take 28 here!)
tm tm; tm tm;
InitTm(tm); wxInitTm(tm);
tm.tm_mday = 21; tm.tm_mday = 21;
tm.tm_mon = Nov; tm.tm_mon = Nov;
tm.tm_year = 99; tm.tm_year = 99;
@@ -800,7 +800,7 @@ wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
(void)mktime(&tm); (void)mktime(&tm);
// ... and call strftime() // ... and call strftime()
return CallStrftime(flags == Name_Abbr ? wxT("%a") : wxT("%A"), &tm); return wxCallStrftime(flags == Name_Abbr ? wxS("%a") : wxS("%A"), &tm);
#else // !wxHAS_STRFTIME #else // !wxHAS_STRFTIME
return GetEnglishWeekDayName(wday, flags); return GetEnglishWeekDayName(wday, flags);
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME #endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
@@ -810,7 +810,7 @@ wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
void wxDateTime::GetAmPmStrings(wxString *am, wxString *pm) void wxDateTime::GetAmPmStrings(wxString *am, wxString *pm)
{ {
tm tm; tm tm;
InitTm(tm); wxInitTm(tm);
wxChar buffer[64]; wxChar buffer[64];
// @Note: Do not call 'CallStrftime' here! CallStrftime checks the return code // @Note: Do not call 'CallStrftime' here! CallStrftime checks the return code
// and causes an assertion failed if the buffer is to small (which is good) - OR - // and causes an assertion failed if the buffer is to small (which is good) - OR -
@@ -854,7 +854,7 @@ wxDateTime::Country wxDateTime::GetCountry()
struct tm tmstruct; struct tm tmstruct;
struct tm *tm = wxLocaltime_r(&t, &tmstruct); struct tm *tm = wxLocaltime_r(&t, &tmstruct);
wxString tz = CallStrftime(wxT("%Z"), tm); wxString tz = wxCallStrftime(wxS("%Z"), tm);
if ( tz == wxT("WET") || tz == wxT("WEST") ) if ( tz == wxT("WET") || tz == wxT("WEST") )
{ {
ms_country = UK; ms_country = UK;
@@ -1364,7 +1364,7 @@ wxDateTime wxDateTime::GetDateOnly() const
wxDateTime& wxDateTime::SetFromDOS(unsigned long ddt) wxDateTime& wxDateTime::SetFromDOS(unsigned long ddt)
{ {
struct tm tm; struct tm tm;
InitTm(tm); wxInitTm(tm);
long year = ddt & 0xFE000000; long year = ddt & 0xFE000000;
year >>= 25; year >>= 25;

View File

@@ -64,9 +64,9 @@
// helpers shared between datetime.cpp and datetimefmt.cpp // helpers shared between datetime.cpp and datetimefmt.cpp
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
extern void InitTm(struct tm& tm); extern void wxInitTm(struct tm& tm);
extern wxString CallStrftime(const wxString& format, const tm* tm); extern wxString wxCallStrftime(const wxString& format, const tm* tm);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// constants (see also datetime.cpp) // constants (see also datetime.cpp)
@@ -402,7 +402,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const
if ( tm ) if ( tm )
{ {
return CallStrftime(format, tm); return wxCallStrftime(format, tm);
} }
} }
//else: use generic code below //else: use generic code below
@@ -566,7 +566,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const
// corresponding to Feb 29 of a non leap year (which // corresponding to Feb 29 of a non leap year (which
// may happen if yearReal was leap and year is not) // may happen if yearReal was leap and year is not)
struct tm tmAdjusted; struct tm tmAdjusted;
InitTm(tmAdjusted); wxInitTm(tmAdjusted);
tmAdjusted.tm_hour = tm.hour; tmAdjusted.tm_hour = tm.hour;
tmAdjusted.tm_min = tm.min; tmAdjusted.tm_min = tm.min;
tmAdjusted.tm_sec = tm.sec; tmAdjusted.tm_sec = tm.sec;
@@ -576,7 +576,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const
tmAdjusted.tm_mon = tm.mon; tmAdjusted.tm_mon = tm.mon;
tmAdjusted.tm_year = year - 1900; tmAdjusted.tm_year = year - 1900;
tmAdjusted.tm_isdst = 0; // no DST, already adjusted tmAdjusted.tm_isdst = 0; // no DST, already adjusted
wxString str = CallStrftime(*p == wxT('c') ? wxT("%c") wxString str = wxCallStrftime(*p == wxT('c') ? wxT("%c")
: wxT("%x"), : wxT("%x"),
&tmAdjusted); &tmAdjusted);
@@ -650,7 +650,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const
case wxT('p'): // AM or PM string case wxT('p'): // AM or PM string
#ifdef wxHAS_STRFTIME #ifdef wxHAS_STRFTIME
res += CallStrftime(wxT("%p"), &tmTimeOnly); res += wxCallStrftime(wxS("%p"), &tmTimeOnly);
#else // !wxHAS_STRFTIME #else // !wxHAS_STRFTIME
res += (tmTimeOnly.tm_hour > 12) ? wxT("pm") : wxT("am"); res += (tmTimeOnly.tm_hour > 12) ? wxT("pm") : wxT("am");
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME #endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
@@ -678,7 +678,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const
case wxT('X'): // locale default time representation case wxT('X'): // locale default time representation
// just use strftime() to format the time for us // just use strftime() to format the time for us
#ifdef wxHAS_STRFTIME #ifdef wxHAS_STRFTIME
res += CallStrftime(wxT("%X"), &tmTimeOnly); res += wxCallStrftime(wxS("%X"), &tmTimeOnly);
#else // !wxHAS_STRFTIME #else // !wxHAS_STRFTIME
res += wxString::Format(wxT("%02d:%02d:%02d"),tm.hour, tm.min, tm.sec); res += wxString::Format(wxT("%02d:%02d:%02d"),tm.hour, tm.min, tm.sec);
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME #endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
@@ -722,7 +722,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const
case wxT('Z'): // timezone name case wxT('Z'): // timezone name
#ifdef wxHAS_STRFTIME #ifdef wxHAS_STRFTIME
res += CallStrftime(wxT("%Z"), &tmTimeOnly); res += wxCallStrftime(wxS("%Z"), &tmTimeOnly);
#endif #endif
break; break;

View File

@@ -33,7 +33,7 @@ wxIMPLEMENT_DYNAMIC_CLASS( wxFileCtrlEvent, wxCommandEvent );
// some helper functions // some helper functions
void GenerateFilterChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd ) void wxGenerateFilterChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd )
{ {
wxFileCtrlEvent event( wxEVT_FILECTRL_FILTERCHANGED, wnd, wnd->GetId() ); wxFileCtrlEvent event( wxEVT_FILECTRL_FILTERCHANGED, wnd, wnd->GetId() );
@@ -42,7 +42,7 @@ void GenerateFilterChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd )
wnd->GetEventHandler()->ProcessEvent( event ); wnd->GetEventHandler()->ProcessEvent( event );
} }
void GenerateFolderChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd ) void wxGenerateFolderChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd )
{ {
wxFileCtrlEvent event( wxEVT_FILECTRL_FOLDERCHANGED, wnd, wnd->GetId() ); wxFileCtrlEvent event( wxEVT_FILECTRL_FOLDERCHANGED, wnd, wnd->GetId() );
@@ -51,7 +51,7 @@ void GenerateFolderChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd )
wnd->GetEventHandler()->ProcessEvent( event ); wnd->GetEventHandler()->ProcessEvent( event );
} }
void GenerateSelectionChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd) void wxGenerateSelectionChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd)
{ {
wxFileCtrlEvent event( wxEVT_FILECTRL_SELECTIONCHANGED, wnd, wnd->GetId() ); wxFileCtrlEvent event( wxEVT_FILECTRL_SELECTIONCHANGED, wnd, wnd->GetId() );
event.SetDirectory( fileCtrl->GetDirectory() ); event.SetDirectory( fileCtrl->GetDirectory() );
@@ -63,7 +63,7 @@ void GenerateSelectionChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd)
wnd->GetEventHandler()->ProcessEvent( event ); wnd->GetEventHandler()->ProcessEvent( event );
} }
void GenerateFileActivatedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd, const wxString& filename ) void wxGenerateFileActivatedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd, const wxString& filename )
{ {
wxFileCtrlEvent event( wxEVT_FILECTRL_FILEACTIVATED, wnd, wnd->GetId() ); wxFileCtrlEvent event( wxEVT_FILECTRL_FILEACTIVATED, wnd, wnd->GetId() );
event.SetDirectory( fileCtrl->GetDirectory() ); event.SetDirectory( fileCtrl->GetDirectory() );

View File

@@ -1187,7 +1187,7 @@ void wxGenericFileCtrl::DoSetFilterIndex( int filterindex )
m_filterExtension.clear(); m_filterExtension.clear();
} }
GenerateFilterChangedEvent( this, this ); wxGenerateFilterChangedEvent( this, this );
} }
void wxGenericFileCtrl::SetWildcard( const wxString& wildCard ) void wxGenericFileCtrl::SetWildcard( const wxString& wildCard )
@@ -1301,7 +1301,7 @@ void wxGenericFileCtrl::OnSelected( wxListEvent &event )
} }
if ( !m_noSelChgEvent ) if ( !m_noSelChgEvent )
GenerateSelectionChangedEvent( this, this ); wxGenerateSelectionChangedEvent( this, this );
m_ignoreChanges = false; m_ignoreChanges = false;
m_inSelected = false; m_inSelected = false;
@@ -1331,7 +1331,7 @@ void wxGenericFileCtrl::HandleAction( const wxString &fn )
m_ignoreChanges = true; m_ignoreChanges = true;
m_list->GoToParentDir(); m_list->GoToParentDir();
GenerateFolderChangedEvent( this, this ); wxGenerateFolderChangedEvent( this, this );
UpdateControls(); UpdateControls();
m_ignoreChanges = false; m_ignoreChanges = false;
@@ -1344,7 +1344,7 @@ void wxGenericFileCtrl::HandleAction( const wxString &fn )
m_ignoreChanges = true; m_ignoreChanges = true;
m_list->GoToHomeDir(); m_list->GoToHomeDir();
GenerateFolderChangedEvent( this, this ); wxGenerateFolderChangedEvent( this, this );
UpdateControls(); UpdateControls();
m_ignoreChanges = false; m_ignoreChanges = false;
@@ -1387,7 +1387,7 @@ void wxGenericFileCtrl::HandleAction( const wxString &fn )
m_list->GoToDir( filename ); m_list->GoToDir( filename );
UpdateControls(); UpdateControls();
GenerateFolderChangedEvent( this, this ); wxGenerateFolderChangedEvent( this, this );
m_ignoreChanges = false; m_ignoreChanges = false;
return; return;
@@ -1409,11 +1409,11 @@ void wxGenericFileCtrl::HandleAction( const wxString &fn )
if ( !( m_style & wxFC_OPEN ) || !wxFileExists( filename ) ) if ( !( m_style & wxFC_OPEN ) || !wxFileExists( filename ) )
{ {
filename = wxFileDialogBase::AppendExtension( filename, m_filterExtension ); filename = wxFileDialogBase::AppendExtension( filename, m_filterExtension );
GenerateFileActivatedEvent( this, this, wxFileName( filename ).GetFullName() ); wxGenerateFileActivatedEvent( this, this, wxFileName( filename ).GetFullName() );
return; return;
} }
GenerateFileActivatedEvent( this, this ); wxGenerateFileActivatedEvent( this, this );
} }
bool wxGenericFileCtrl::SetPath( const wxString& path ) bool wxGenericFileCtrl::SetPath( const wxString& path )

View File

@@ -241,7 +241,7 @@ extern "C"
static void static void
gtkfilechooserwidget_file_activated_callback( GtkWidget *WXUNUSED( widget ), wxGtkFileCtrl *fileCtrl ) gtkfilechooserwidget_file_activated_callback( GtkWidget *WXUNUSED( widget ), wxGtkFileCtrl *fileCtrl )
{ {
GenerateFileActivatedEvent( fileCtrl, fileCtrl ); wxGenerateFileActivatedEvent( fileCtrl, fileCtrl );
} }
} }
@@ -262,7 +262,7 @@ extern "C"
} }
if ( !fileCtrl->m_checkNextSelEvent ) if ( !fileCtrl->m_checkNextSelEvent )
GenerateSelectionChangedEvent( fileCtrl, fileCtrl ); wxGenerateSelectionChangedEvent( fileCtrl, fileCtrl );
} }
} }
@@ -277,7 +277,7 @@ extern "C"
} }
else else
{ {
GenerateFolderChangedEvent( fileCtrl, fileCtrl ); wxGenerateFolderChangedEvent( fileCtrl, fileCtrl );
} }
fileCtrl->m_checkNextSelEvent = true; fileCtrl->m_checkNextSelEvent = true;
@@ -294,7 +294,7 @@ extern "C"
fileCtrl->HasFilterChoice() && fileCtrl->HasFilterChoice() &&
!fileCtrl->GTKShouldIgnoreNextFilterEvent() ) !fileCtrl->GTKShouldIgnoreNextFilterEvent() )
{ {
GenerateFilterChangedEvent( fileCtrl, fileCtrl ); wxGenerateFilterChangedEvent( fileCtrl, fileCtrl );
} }
} }
} }