Remove unused wxDisplayImpl::GetSizeMM()
This is not needed any longer after the changes of the last commit. Note that the (still existent) public wxGetDisplaySizeMM() didn't use this function, but used PPI instead.
This commit is contained in:
@@ -119,9 +119,6 @@ public:
|
|||||||
// but can be also overridden directly, as is done in wxMSW
|
// but can be also overridden directly, as is done in wxMSW
|
||||||
virtual wxSize GetPPI() const { return wxDisplay::GetStdPPI()*GetScaleFactor(); }
|
virtual wxSize GetPPI() const { return wxDisplay::GetStdPPI()*GetScaleFactor(); }
|
||||||
|
|
||||||
// return the physical size of the display or (0, 0) if unknown
|
|
||||||
virtual wxSize GetSizeMM() const { return wxSize(0, 0); }
|
|
||||||
|
|
||||||
// return the name (may be empty)
|
// return the name (may be empty)
|
||||||
virtual wxString GetName() const { return wxString(); }
|
virtual wxString GetName() const { return wxString(); }
|
||||||
|
|
||||||
|
@@ -50,7 +50,6 @@ public:
|
|||||||
virtual wxRect GetClientArea() const wxOVERRIDE;
|
virtual wxRect GetClientArea() const wxOVERRIDE;
|
||||||
virtual int GetDepth() const wxOVERRIDE;
|
virtual int GetDepth() const wxOVERRIDE;
|
||||||
virtual double GetScaleFactor() const wxOVERRIDE;
|
virtual double GetScaleFactor() const wxOVERRIDE;
|
||||||
virtual wxSize GetSizeMM() const wxOVERRIDE;
|
|
||||||
|
|
||||||
#if wxUSE_DISPLAY
|
#if wxUSE_DISPLAY
|
||||||
virtual bool IsPrimary() const wxOVERRIDE;
|
virtual bool IsPrimary() const wxOVERRIDE;
|
||||||
@@ -151,15 +150,6 @@ double wxDisplayImplGTK::GetScaleFactor() const
|
|||||||
return gdk_monitor_get_scale_factor(m_monitor);
|
return gdk_monitor_get_scale_factor(m_monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize wxDisplayImplGTK::GetSizeMM() const
|
|
||||||
{
|
|
||||||
return wxSize
|
|
||||||
(
|
|
||||||
gdk_monitor_get_width_mm(m_monitor),
|
|
||||||
gdk_monitor_get_height_mm(m_monitor)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if wxUSE_DISPLAY
|
#if wxUSE_DISPLAY
|
||||||
bool wxDisplayImplGTK::IsPrimary() const
|
bool wxDisplayImplGTK::IsPrimary() const
|
||||||
{
|
{
|
||||||
@@ -255,7 +245,6 @@ public:
|
|||||||
#if GTK_CHECK_VERSION(3,10,0)
|
#if GTK_CHECK_VERSION(3,10,0)
|
||||||
virtual double GetScaleFactor() const wxOVERRIDE;
|
virtual double GetScaleFactor() const wxOVERRIDE;
|
||||||
#endif // GTK+ 3.10
|
#endif // GTK+ 3.10
|
||||||
virtual wxSize GetSizeMM() const wxOVERRIDE;
|
|
||||||
|
|
||||||
#if wxUSE_DISPLAY
|
#if wxUSE_DISPLAY
|
||||||
virtual bool IsPrimary() const wxOVERRIDE;
|
virtual bool IsPrimary() const wxOVERRIDE;
|
||||||
@@ -351,39 +340,6 @@ double wxDisplayImplGTK::GetScaleFactor() const
|
|||||||
}
|
}
|
||||||
#endif // GTK+ 3.10
|
#endif // GTK+ 3.10
|
||||||
|
|
||||||
wxSize wxDisplayImplGTK::GetSizeMM() const
|
|
||||||
{
|
|
||||||
wxSize sizeMM;
|
|
||||||
#if GTK_CHECK_VERSION(2,14,0)
|
|
||||||
if ( wx_is_at_least_gtk2(14) )
|
|
||||||
{
|
|
||||||
// Take care not to return (-1, -1) from here, the caller expects us to
|
|
||||||
// return (0, 0) if we can't retrieve this information.
|
|
||||||
int rc = gdk_screen_get_monitor_width_mm(m_screen, m_index);
|
|
||||||
if ( rc != -1 )
|
|
||||||
sizeMM.x = rc;
|
|
||||||
|
|
||||||
rc = gdk_screen_get_monitor_height_mm(m_screen, m_index);
|
|
||||||
if ( rc != -1 )
|
|
||||||
sizeMM.y = rc;
|
|
||||||
}
|
|
||||||
#endif // GTK+ 2.14
|
|
||||||
|
|
||||||
// When we have only a single display, we can use global GTK+ functions.
|
|
||||||
// Note that at least in some configurations, these functions return valid
|
|
||||||
// values when gdk_screen_get_monitor_xxx_mm() only return -1, so it's
|
|
||||||
// always worth falling back on them, but we can't do it when using
|
|
||||||
// multiple displays because they combine the sizes of all displays in this
|
|
||||||
// case, which would result in a completely wrong value.
|
|
||||||
if ( !(sizeMM.x && sizeMM.y) && gdk_screen_get_n_monitors(m_screen) == 1 )
|
|
||||||
{
|
|
||||||
sizeMM.x = gdk_screen_width_mm();
|
|
||||||
sizeMM.y = gdk_screen_height_mm();
|
|
||||||
}
|
|
||||||
|
|
||||||
return sizeMM;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if wxUSE_DISPLAY
|
#if wxUSE_DISPLAY
|
||||||
bool wxDisplayImplGTK::IsPrimary() const
|
bool wxDisplayImplGTK::IsPrimary() const
|
||||||
{
|
{
|
||||||
|
@@ -67,13 +67,6 @@ public:
|
|||||||
{
|
{
|
||||||
return wxGetHDCDepth(ScreenHDC());
|
return wxGetHDCDepth(ScreenHDC());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual wxSize GetSizeMM() const wxOVERRIDE
|
|
||||||
{
|
|
||||||
ScreenHDC dc;
|
|
||||||
|
|
||||||
return wxSize(::GetDeviceCaps(dc, HORZSIZE), ::GetDeviceCaps(dc, VERTSIZE));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class wxDisplayFactorySingleMSW : public wxDisplayFactorySingle
|
class wxDisplayFactorySingleMSW : public wxDisplayFactorySingle
|
||||||
|
@@ -85,12 +85,6 @@ int wxGetDisplayDepth(CGDirectDisplayID id)
|
|||||||
return theDepth;
|
return theDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize wxGetDisplaySizeMM(CGDirectDisplayID id)
|
|
||||||
{
|
|
||||||
const CGSize size = CGDisplayScreenSize(id);
|
|
||||||
return wxSize(wxRound(size.width), wxRound(size.height));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
#if wxUSE_DISPLAY
|
#if wxUSE_DISPLAY
|
||||||
@@ -113,7 +107,6 @@ public:
|
|||||||
virtual wxRect GetGeometry() const wxOVERRIDE;
|
virtual wxRect GetGeometry() const wxOVERRIDE;
|
||||||
virtual wxRect GetClientArea() const wxOVERRIDE;
|
virtual wxRect GetClientArea() const wxOVERRIDE;
|
||||||
virtual int GetDepth() const wxOVERRIDE;
|
virtual int GetDepth() const wxOVERRIDE;
|
||||||
virtual wxSize GetSizeMM() const wxOVERRIDE;
|
|
||||||
virtual double GetScaleFactor() const wxOVERRIDE;
|
virtual double GetScaleFactor() const wxOVERRIDE;
|
||||||
|
|
||||||
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
|
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
|
||||||
@@ -312,11 +305,6 @@ int wxDisplayImplMacOSX::GetDepth() const
|
|||||||
return wxGetDisplayDepth(m_id);
|
return wxGetDisplayDepth(m_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize wxDisplayImplMacOSX::GetSizeMM() const
|
|
||||||
{
|
|
||||||
return wxGetDisplaySizeMM(m_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
double wxDisplayImplMacOSX::GetScaleFactor() const
|
double wxDisplayImplMacOSX::GetScaleFactor() const
|
||||||
{
|
{
|
||||||
return wxGetScaleFactor(m_id);
|
return wxGetScaleFactor(m_id);
|
||||||
@@ -437,11 +425,6 @@ public:
|
|||||||
{
|
{
|
||||||
return wxGetDisplayDepth(CGMainDisplayID());
|
return wxGetDisplayDepth(CGMainDisplayID());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual wxSize GetSizeMM() const wxOVERRIDE
|
|
||||||
{
|
|
||||||
return wxGetDisplaySizeMM(CGMainDisplayID());
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class wxDisplayFactorySingleMacOSX : public wxDisplayFactorySingle
|
class wxDisplayFactorySingleMacOSX : public wxDisplayFactorySingle
|
||||||
|
@@ -22,7 +22,6 @@ public:
|
|||||||
virtual wxRect GetGeometry() const wxOVERRIDE;
|
virtual wxRect GetGeometry() const wxOVERRIDE;
|
||||||
virtual wxRect GetClientArea() const wxOVERRIDE;
|
virtual wxRect GetClientArea() const wxOVERRIDE;
|
||||||
virtual int GetDepth() const wxOVERRIDE;
|
virtual int GetDepth() const wxOVERRIDE;
|
||||||
virtual wxSize GetSizeMM() const wxOVERRIDE;
|
|
||||||
|
|
||||||
#if wxUSE_DISPLAY
|
#if wxUSE_DISPLAY
|
||||||
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
|
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
|
||||||
@@ -51,13 +50,6 @@ int wxDisplayImplQt::GetDepth() const
|
|||||||
return IsPrimary() ? QApplication::desktop()->depth() : 0;
|
return IsPrimary() ? QApplication::desktop()->depth() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize wxDisplayImplQt::GetSizeMM() const
|
|
||||||
{
|
|
||||||
return IsPrimary() ? wxSize(QApplication::desktop()->widthMM(),
|
|
||||||
QApplication::desktop()->heightMM())
|
|
||||||
: wxSize(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if wxUSE_DISPLAY
|
#if wxUSE_DISPLAY
|
||||||
wxArrayVideoModes wxDisplayImplQt::GetModes(const wxVideoMode& WXUNUSED(mode)) const
|
wxArrayVideoModes wxDisplayImplQt::GetModes(const wxVideoMode& WXUNUSED(mode)) const
|
||||||
{
|
{
|
||||||
|
@@ -76,11 +76,6 @@ public:
|
|||||||
{
|
{
|
||||||
return wxGetMainScreenDepth();
|
return wxGetMainScreenDepth();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual wxSize GetSizeMM() const wxOVERRIDE
|
|
||||||
{
|
|
||||||
return wxGetMainScreenSizeMM();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class wxDisplayFactorySingleX11 : public wxDisplayFactorySingle
|
class wxDisplayFactorySingleX11 : public wxDisplayFactorySingle
|
||||||
@@ -159,11 +154,6 @@ public:
|
|||||||
|
|
||||||
return wxGetMainScreenDepth();
|
return wxGetMainScreenDepth();
|
||||||
}
|
}
|
||||||
virtual wxSize GetSizeMM() const wxOVERRIDE
|
|
||||||
{
|
|
||||||
// TODO: how to get physical size or resolution of the other monitors?
|
|
||||||
return IsPrimary() ? wxGetMainScreenSizeMM() : wxSize(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
|
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
|
||||||
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE;
|
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE;
|
||||||
|
Reference in New Issue
Block a user