Fix warnings about inline {From,To}DIP() in wxGTK/Win32 build
Define these functions in the class declaration to avoid gcc warning about "redeclaring them without dllimport attribute after being referenced with dll linkage". This commit just moves the existing code around, no real changes. Closes https://github.com/wxWidgets/wxWidgets/pull/2400
This commit is contained in:
committed by
Vadim Zeitlin
parent
2d9c9d9689
commit
fcfe91b16d
@@ -49,6 +49,10 @@
|
|||||||
#define wxUSE_MENUS_NATIVE wxUSE_MENUS
|
#define wxUSE_MENUS_NATIVE wxUSE_MENUS
|
||||||
#endif // __WXUNIVERSAL__/!__WXUNIVERSAL__
|
#endif // __WXUNIVERSAL__/!__WXUNIVERSAL__
|
||||||
|
|
||||||
|
#if defined(__WXGTK3__) || defined(__WXMAC__)
|
||||||
|
#define wxHAVE_DPI_INDEPENDENT_PIXELS
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// forward declarations
|
// forward declarations
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -993,7 +997,14 @@ public:
|
|||||||
// horizontal and vertical directions, but this could, in principle,
|
// horizontal and vertical directions, but this could, in principle,
|
||||||
// change too, so prefer using the overloads taking wxPoint or wxSize.
|
// change too, so prefer using the overloads taking wxPoint or wxSize.
|
||||||
|
|
||||||
|
#ifdef wxHAVE_DPI_INDEPENDENT_PIXELS
|
||||||
|
static wxSize FromDIP(const wxSize& sz, const wxWindowBase* WXUNUSED(w))
|
||||||
|
{
|
||||||
|
return sz;
|
||||||
|
}
|
||||||
|
#else
|
||||||
static wxSize FromDIP(const wxSize& sz, const wxWindowBase* w);
|
static wxSize FromDIP(const wxSize& sz, const wxWindowBase* w);
|
||||||
|
#endif // wxHAVE_DPI_INDEPENDENT_PIXELS
|
||||||
static wxPoint FromDIP(const wxPoint& pt, const wxWindowBase* w)
|
static wxPoint FromDIP(const wxPoint& pt, const wxWindowBase* w)
|
||||||
{
|
{
|
||||||
const wxSize sz = FromDIP(wxSize(pt.x, pt.y), w);
|
const wxSize sz = FromDIP(wxSize(pt.x, pt.y), w);
|
||||||
@@ -1008,7 +1019,14 @@ public:
|
|||||||
wxPoint FromDIP(const wxPoint& pt) const { return FromDIP(pt, this); }
|
wxPoint FromDIP(const wxPoint& pt) const { return FromDIP(pt, this); }
|
||||||
int FromDIP(int d) const { return FromDIP(d, this); }
|
int FromDIP(int d) const { return FromDIP(d, this); }
|
||||||
|
|
||||||
|
#ifdef wxHAVE_DPI_INDEPENDENT_PIXELS
|
||||||
|
static wxSize ToDIP(const wxSize& sz, const wxWindowBase* WXUNUSED(w))
|
||||||
|
{
|
||||||
|
return sz;
|
||||||
|
}
|
||||||
|
#else
|
||||||
static wxSize ToDIP(const wxSize& sz, const wxWindowBase* w);
|
static wxSize ToDIP(const wxSize& sz, const wxWindowBase* w);
|
||||||
|
#endif // wxHAVE_DPI_INDEPENDENT_PIXELS
|
||||||
static wxPoint ToDIP(const wxPoint& pt, const wxWindowBase* w)
|
static wxPoint ToDIP(const wxPoint& pt, const wxWindowBase* w)
|
||||||
{
|
{
|
||||||
const wxSize sz = ToDIP(wxSize(pt.x, pt.y), w);
|
const wxSize sz = ToDIP(wxSize(pt.x, pt.y), w);
|
||||||
@@ -2017,9 +2035,6 @@ inline void wxWindowBase::SetInitialBestSize(const wxSize& size)
|
|||||||
#define wxWindowGTK wxWindow
|
#define wxWindowGTK wxWindow
|
||||||
#endif // wxUniv
|
#endif // wxUniv
|
||||||
#include "wx/gtk/window.h"
|
#include "wx/gtk/window.h"
|
||||||
#ifdef __WXGTK3__
|
|
||||||
#define wxHAVE_DPI_INDEPENDENT_PIXELS
|
|
||||||
#endif
|
|
||||||
#elif defined(__WXGTK__)
|
#elif defined(__WXGTK__)
|
||||||
#ifdef __WXUNIVERSAL__
|
#ifdef __WXUNIVERSAL__
|
||||||
#define wxWindowNative wxWindowGTK
|
#define wxWindowNative wxWindowGTK
|
||||||
@@ -2044,7 +2059,6 @@ inline void wxWindowBase::SetInitialBestSize(const wxSize& size)
|
|||||||
#define wxWindowMac wxWindow
|
#define wxWindowMac wxWindow
|
||||||
#endif // wxUniv
|
#endif // wxUniv
|
||||||
#include "wx/osx/window.h"
|
#include "wx/osx/window.h"
|
||||||
#define wxHAVE_DPI_INDEPENDENT_PIXELS
|
|
||||||
#elif defined(__WXQT__)
|
#elif defined(__WXQT__)
|
||||||
#ifdef __WXUNIVERSAL__
|
#ifdef __WXUNIVERSAL__
|
||||||
#define wxWindowNative wxWindowQt
|
#define wxWindowNative wxWindowQt
|
||||||
@@ -2074,27 +2088,6 @@ inline wxWindow *wxWindowBase::GetGrandParent() const
|
|||||||
return m_parent ? m_parent->GetParent() : NULL;
|
return m_parent ? m_parent->GetParent() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef wxHAVE_DPI_INDEPENDENT_PIXELS
|
|
||||||
|
|
||||||
// FromDIP() and ToDIP() become trivial in this case, so make them inline to
|
|
||||||
// avoid any overhead.
|
|
||||||
|
|
||||||
/* static */
|
|
||||||
inline wxSize
|
|
||||||
wxWindowBase::FromDIP(const wxSize& sz, const wxWindowBase* WXUNUSED(w))
|
|
||||||
{
|
|
||||||
return sz;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* static */
|
|
||||||
inline wxSize
|
|
||||||
wxWindowBase::ToDIP(const wxSize& sz, const wxWindowBase* WXUNUSED(w))
|
|
||||||
{
|
|
||||||
return sz;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // wxHAVE_DPI_INDEPENDENT_PIXELS
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// global functions
|
// global functions
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user