mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Update wxWidgets to 3.1.0
From wxWidgets master 81570ae070b35c9d52de47b1f14897f3ff1a66c7. include/wx/defs.h -- __w64 warning disable patch by comex brought forward. include/wx/msw/window.h -- added GetContentScaleFactor() which was not implemented on Windows but is necessary for wxBitmap scaling on Mac OS X so it needs to work to avoid #ifdef-ing the code. src/gtk/window.cpp -- Modified DoSetClientSize() to direct call wxWindowGTK::DoSetSize() instead of using public wxWindowBase::SetSize() which now prevents derived classes (like wxAuiToolbar) intercepting the call and breaking it. This matches Windows which does NOT need to call DoSetSize internally. End result is this fixes Dolphin's debug tools toolbars on Linux. src/osx/window_osx.cpp -- Same fix as for GTK since it has the same issue. src/msw/radiobox.cpp -- Hacked to fix display in HiDPI (was clipping off end of text). Updated CMakeLists for Linux and Mac OS X. Small code changes to Dolphin to fix debug error boxes, deprecation warnings, and retain previous UI behavior on Windows.
This commit is contained in:
87
Externals/wxWidgets3/include/wx/arrstr.h
vendored
87
Externals/wxWidgets3/include/wx/arrstr.h
vendored
@ -14,19 +14,39 @@
|
||||
#include "wx/defs.h"
|
||||
#include "wx/string.h"
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
// these functions are only used in STL build now but we define them in any
|
||||
// case for compatibility with the existing code outside of the library which
|
||||
// could be using them
|
||||
inline int wxCMPFUNC_CONV wxStringSortAscending(wxString* s1, wxString* s2)
|
||||
inline int wxCMPFUNC_CONV wxStringSortAscending(const wxString& s1, const wxString& s2)
|
||||
{
|
||||
return s1->Cmp(*s2);
|
||||
return s1.Cmp(s2);
|
||||
}
|
||||
|
||||
inline int wxCMPFUNC_CONV wxStringSortDescending(wxString* s1, wxString* s2)
|
||||
inline int wxCMPFUNC_CONV wxStringSortDescending(const wxString& s1, const wxString& s2)
|
||||
{
|
||||
return wxStringSortAscending(s2, s1);
|
||||
}
|
||||
|
||||
// This comparison function ignores case when comparing strings differing not
|
||||
// in case only, i.e. this ensures that "Aa" comes before "AB", unlike with
|
||||
// wxStringSortAscending().
|
||||
inline int wxCMPFUNC_CONV
|
||||
wxDictionaryStringSortAscending(const wxString& s1, const wxString& s2)
|
||||
{
|
||||
const int cmp = s1.CmpNoCase(s2);
|
||||
return cmp ? cmp : s1.Cmp(s2);
|
||||
}
|
||||
|
||||
inline int wxCMPFUNC_CONV
|
||||
wxDictionaryStringSortDescending(const wxString& s1, const wxString& s2)
|
||||
{
|
||||
return wxDictionaryStringSortAscending(s2, s1);
|
||||
}
|
||||
|
||||
#if wxUSE_STD_CONTAINERS
|
||||
|
||||
#include "wx/dynarray.h"
|
||||
@ -38,9 +58,6 @@ _WX_DECLARE_BASEARRAY_2(_wxArraywxBaseArrayStringBase, wxBaseArrayStringBase,
|
||||
class WXDLLIMPEXP_BASE);
|
||||
WX_DEFINE_USER_EXPORTED_TYPEARRAY(wxString, wxArrayStringBase,
|
||||
wxBaseArrayStringBase, WXDLLIMPEXP_BASE);
|
||||
_WX_DEFINE_SORTED_TYPEARRAY_2(wxString, wxSortedArrayStringBase,
|
||||
wxBaseArrayStringBase, = wxStringSortAscending,
|
||||
class WXDLLIMPEXP_BASE, CMPFUNCwxString);
|
||||
|
||||
class WXDLLIMPEXP_BASE wxArrayString : public wxArrayStringBase
|
||||
{
|
||||
@ -68,6 +85,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
_WX_DEFINE_SORTED_TYPEARRAY_2(wxString, wxSortedArrayStringBase,
|
||||
wxBaseArrayStringBase, = wxStringSortAscending,
|
||||
class WXDLLIMPEXP_BASE, wxArrayString::CompareFunction);
|
||||
|
||||
class WXDLLIMPEXP_BASE wxSortedArrayString : public wxSortedArrayStringBase
|
||||
{
|
||||
public:
|
||||
@ -84,6 +105,9 @@ public:
|
||||
for ( size_t n = 0; n < src.size(); n++ )
|
||||
Add(src[n]);
|
||||
}
|
||||
wxEXPLICIT wxSortedArrayString(wxArrayString::CompareFunction compareFunction)
|
||||
: wxSortedArrayStringBase(compareFunction)
|
||||
{ }
|
||||
|
||||
int Index(const wxString& str, bool bCase = true, bool bFromEnd = false) const;
|
||||
|
||||
@ -101,21 +125,9 @@ private:
|
||||
|
||||
#else // if !wxUSE_STD_CONTAINERS
|
||||
|
||||
// this shouldn't be defined for compilers not supporting template methods or
|
||||
// without std::distance()
|
||||
//
|
||||
// FIXME-VC6: currently it's only not defined for VC6 in DLL build as it
|
||||
// doesn't export template methods from DLL correctly so even though
|
||||
// it compiles them fine, we get link errors when using wxArrayString
|
||||
#if !defined(__VISUALC6__) || !(defined(WXMAKINGDLL) || defined(WXUSINGDLL))
|
||||
#define wxHAS_VECTOR_TEMPLATE_ASSIGN
|
||||
#endif
|
||||
|
||||
#ifdef wxHAS_VECTOR_TEMPLATE_ASSIGN
|
||||
#include "wx/beforestd.h"
|
||||
#include <iterator>
|
||||
#include "wx/afterstd.h"
|
||||
#endif // wxHAS_VECTOR_TEMPLATE_ASSIGN
|
||||
#include "wx/beforestd.h"
|
||||
#include <iterator>
|
||||
#include "wx/afterstd.h"
|
||||
|
||||
class WXDLLIMPEXP_BASE wxArrayString
|
||||
{
|
||||
@ -159,7 +171,7 @@ public:
|
||||
void Clear();
|
||||
// preallocates memory for given number of items
|
||||
void Alloc(size_t nCount);
|
||||
// minimzes the memory usage (by freeing all extra memory)
|
||||
// minimizes the memory usage (by freeing all extra memory)
|
||||
void Shrink();
|
||||
|
||||
// simple accessors
|
||||
@ -295,7 +307,6 @@ public:
|
||||
{ Init(false); assign(first, last); }
|
||||
wxArrayString(size_type n, const_reference v) { Init(false); assign(n, v); }
|
||||
|
||||
#ifdef wxHAS_VECTOR_TEMPLATE_ASSIGN
|
||||
template <class Iterator>
|
||||
void assign(Iterator first, Iterator last)
|
||||
{
|
||||
@ -304,15 +315,6 @@ public:
|
||||
for(; first != last; ++first)
|
||||
push_back(*first);
|
||||
}
|
||||
#else // !wxHAS_VECTOR_TEMPLATE_ASSIGN
|
||||
void assign(const_iterator first, const_iterator last)
|
||||
{
|
||||
clear();
|
||||
reserve(last - first);
|
||||
for(; first != last; ++first)
|
||||
push_back(*first);
|
||||
}
|
||||
#endif // wxHAS_VECTOR_TEMPLATE_ASSIGN/!wxHAS_VECTOR_TEMPLATE_ASSIGN
|
||||
|
||||
void assign(size_type n, const_reference v)
|
||||
{ clear(); Add(v, n); }
|
||||
@ -363,8 +365,13 @@ protected:
|
||||
void Init(bool autoSort); // common part of all ctors
|
||||
void Copy(const wxArrayString& src); // copies the contents of another array
|
||||
|
||||
CompareFunction m_compareFunction; // set only from wxSortedArrayString
|
||||
|
||||
private:
|
||||
void Grow(size_t nIncrement = 0); // makes array bigger if needed
|
||||
// Allocate the new buffer big enough to hold m_nCount + nIncrement items and
|
||||
// return the pointer to the old buffer, which must be deleted by the caller
|
||||
// (if the old buffer is big enough, just return NULL).
|
||||
wxString *Grow(size_t nIncrement);
|
||||
|
||||
size_t m_nSize, // current size of the array
|
||||
m_nCount; // current number of elements
|
||||
@ -381,6 +388,10 @@ public:
|
||||
{ }
|
||||
wxSortedArrayString(const wxArrayString& array) : wxArrayString(true)
|
||||
{ Copy(array); }
|
||||
|
||||
wxEXPLICIT wxSortedArrayString(CompareFunction compareFunction)
|
||||
: wxArrayString(true)
|
||||
{ m_compareFunction = compareFunction; }
|
||||
};
|
||||
|
||||
#endif // !wxUSE_STD_CONTAINERS
|
||||
@ -467,6 +478,16 @@ public:
|
||||
m_data.ptr = strings;
|
||||
}
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
// construct an adapter from a vector of strings (of any type)
|
||||
template <class T>
|
||||
wxArrayStringsAdapter(const std::vector<T>& strings)
|
||||
: m_type(wxSTRING_POINTER), m_size(strings.size())
|
||||
{
|
||||
m_data.ptr = &strings[0];
|
||||
}
|
||||
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
|
||||
// construct an adapter from a single wxString
|
||||
wxArrayStringsAdapter(const wxString& s)
|
||||
: m_type(wxSTRING_POINTER), m_size(1)
|
||||
|
Reference in New Issue
Block a user