mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Upgrade WX to r74856, mainly to support @2x.
This commit is contained in:
52
Externals/wxWidgets3/include/wx/gdicmn.h
vendored
52
Externals/wxWidgets3/include/wx/gdicmn.h
vendored
@ -4,7 +4,6 @@
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: gdicmn.h 70789 2012-03-04 00:28:58Z VZ $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@ -174,7 +173,7 @@ enum wxStockCursor
|
||||
wxIcon *icon = new wxIcon(sample_xpm); // On wxGTK/Linux
|
||||
*/
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#ifdef __WINDOWS__
|
||||
// Load from a resource
|
||||
#define wxICON(X) wxIcon(wxT(#X))
|
||||
#elif defined(__WXPM__)
|
||||
@ -204,7 +203,7 @@ enum wxStockCursor
|
||||
under Unix bitmaps live in XPMs and under Windows they're in ressources.
|
||||
*/
|
||||
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
#if defined(__WINDOWS__) || defined(__WXPM__)
|
||||
#define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_BMP_RESOURCE)
|
||||
#elif defined(__WXGTK__) || \
|
||||
defined(__WXMOTIF__) || \
|
||||
@ -218,6 +217,28 @@ enum wxStockCursor
|
||||
#define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
|
||||
#endif // platform
|
||||
|
||||
// Macro for creating wxBitmap from in-memory PNG data.
|
||||
//
|
||||
// It reads PNG data from name_png static byte arrays that can be created using
|
||||
// e.g. misc/scripts/png2c.py.
|
||||
//
|
||||
// This macro exists mostly as a helper for wxBITMAP_PNG() below but also
|
||||
// because it's slightly more convenient to use than NewFromPNGData() directly.
|
||||
#define wxBITMAP_PNG_FROM_DATA(name) \
|
||||
wxBitmap::NewFromPNGData(name##_png, WXSIZEOF(name##_png))
|
||||
|
||||
// Similar to wxBITMAP but used for the bitmaps in PNG format.
|
||||
//
|
||||
// Under Windows they should be embedded into the resource file using RT_RCDATA
|
||||
// resource type and under OS X the PNG file with the specified name must be
|
||||
// available in the resource subdirectory of the bundle. Elsewhere, this is
|
||||
// exactly the same thing as wxBITMAP_PNG_FROM_DATA() described above.
|
||||
#if defined(__WINDOWS__) || defined(__WXOSX__)
|
||||
#define wxBITMAP_PNG(name) wxBitmap(wxS(#name), wxBITMAP_TYPE_PNG_RESOURCE)
|
||||
#else
|
||||
#define wxBITMAP_PNG(name) wxBITMAP_PNG_FROM_DATA(name)
|
||||
#endif
|
||||
|
||||
// ===========================================================================
|
||||
// classes
|
||||
// ===========================================================================
|
||||
@ -255,6 +276,13 @@ public:
|
||||
{ if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; }
|
||||
void DecTo(const wxSize& sz)
|
||||
{ if ( sz.x < x ) x = sz.x; if ( sz.y < y ) y = sz.y; }
|
||||
void DecToIfSpecified(const wxSize& sz)
|
||||
{
|
||||
if ( sz.x != wxDefaultCoord && sz.x < x )
|
||||
x = sz.x;
|
||||
if ( sz.y != wxDefaultCoord && sz.y < y )
|
||||
y = sz.y;
|
||||
}
|
||||
|
||||
void IncBy(int dx, int dy) { x += dx; y += dy; }
|
||||
void IncBy(const wxPoint& pt);
|
||||
@ -352,27 +380,27 @@ inline wxSize operator/(const wxSize& s, long i)
|
||||
|
||||
inline wxSize operator*(const wxSize& s, long i)
|
||||
{
|
||||
return wxSize(s.x * i, s.y * i);
|
||||
return wxSize(int(s.x * i), int(s.y * i));
|
||||
}
|
||||
|
||||
inline wxSize operator*(long i, const wxSize& s)
|
||||
{
|
||||
return wxSize(s.x * i, s.y * i);
|
||||
return wxSize(int(s.x * i), int(s.y * i));
|
||||
}
|
||||
|
||||
inline wxSize operator/(const wxSize& s, unsigned long i)
|
||||
{
|
||||
return wxSize(s.x / i, s.y / i);
|
||||
return wxSize(int(s.x / i), int(s.y / i));
|
||||
}
|
||||
|
||||
inline wxSize operator*(const wxSize& s, unsigned long i)
|
||||
{
|
||||
return wxSize(s.x * i, s.y * i);
|
||||
return wxSize(int(s.x * i), int(s.y * i));
|
||||
}
|
||||
|
||||
inline wxSize operator*(unsigned long i, const wxSize& s)
|
||||
{
|
||||
return wxSize(s.x * i, s.y * i);
|
||||
return wxSize(int(s.x * i), int(s.y * i));
|
||||
}
|
||||
|
||||
inline wxSize operator*(const wxSize& s, double i)
|
||||
@ -626,12 +654,12 @@ inline wxPoint operator/(const wxPoint& s, long i)
|
||||
|
||||
inline wxPoint operator*(const wxPoint& s, long i)
|
||||
{
|
||||
return wxPoint(s.x * i, s.y * i);
|
||||
return wxPoint(int(s.x * i), int(s.y * i));
|
||||
}
|
||||
|
||||
inline wxPoint operator*(long i, const wxPoint& s)
|
||||
{
|
||||
return wxPoint(s.x * i, s.y * i);
|
||||
return wxPoint(int(s.x * i), int(s.y * i));
|
||||
}
|
||||
|
||||
inline wxPoint operator/(const wxPoint& s, unsigned long i)
|
||||
@ -641,12 +669,12 @@ inline wxPoint operator/(const wxPoint& s, unsigned long i)
|
||||
|
||||
inline wxPoint operator*(const wxPoint& s, unsigned long i)
|
||||
{
|
||||
return wxPoint(s.x * i, s.y * i);
|
||||
return wxPoint(int(s.x * i), int(s.y * i));
|
||||
}
|
||||
|
||||
inline wxPoint operator*(unsigned long i, const wxPoint& s)
|
||||
{
|
||||
return wxPoint(s.x * i, s.y * i);
|
||||
return wxPoint(int(s.x * i), int(s.y * i));
|
||||
}
|
||||
|
||||
inline wxPoint operator*(const wxPoint& s, double i)
|
||||
|
Reference in New Issue
Block a user