From 434faa39e63cb82d80f5a74a47434b799640adee Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 14 Aug 2020 15:25:13 +0200 Subject: [PATCH] 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. --- include/wx/private/display.h | 3 --- src/gtk/display.cpp | 44 ------------------------------------ src/msw/display.cpp | 7 ------ src/osx/core/display.cpp | 17 -------------- src/qt/display.cpp | 8 ------- src/unix/displayx11.cpp | 10 -------- 6 files changed, 89 deletions(-) diff --git a/include/wx/private/display.h b/include/wx/private/display.h index 55ece769ed..b45bfed6c9 100644 --- a/include/wx/private/display.h +++ b/include/wx/private/display.h @@ -119,9 +119,6 @@ public: // but can be also overridden directly, as is done in wxMSW 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) virtual wxString GetName() const { return wxString(); } diff --git a/src/gtk/display.cpp b/src/gtk/display.cpp index 6bacd94456..783912a2c7 100644 --- a/src/gtk/display.cpp +++ b/src/gtk/display.cpp @@ -50,7 +50,6 @@ public: virtual wxRect GetClientArea() const wxOVERRIDE; virtual int GetDepth() const wxOVERRIDE; virtual double GetScaleFactor() const wxOVERRIDE; - virtual wxSize GetSizeMM() const wxOVERRIDE; #if wxUSE_DISPLAY virtual bool IsPrimary() const wxOVERRIDE; @@ -151,15 +150,6 @@ double wxDisplayImplGTK::GetScaleFactor() const 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 bool wxDisplayImplGTK::IsPrimary() const { @@ -255,7 +245,6 @@ public: #if GTK_CHECK_VERSION(3,10,0) virtual double GetScaleFactor() const wxOVERRIDE; #endif // GTK+ 3.10 - virtual wxSize GetSizeMM() const wxOVERRIDE; #if wxUSE_DISPLAY virtual bool IsPrimary() const wxOVERRIDE; @@ -351,39 +340,6 @@ double wxDisplayImplGTK::GetScaleFactor() const } #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 bool wxDisplayImplGTK::IsPrimary() const { diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 73ff8dd754..bc40019045 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -67,13 +67,6 @@ public: { return wxGetHDCDepth(ScreenHDC()); } - - virtual wxSize GetSizeMM() const wxOVERRIDE - { - ScreenHDC dc; - - return wxSize(::GetDeviceCaps(dc, HORZSIZE), ::GetDeviceCaps(dc, VERTSIZE)); - } }; class wxDisplayFactorySingleMSW : public wxDisplayFactorySingle diff --git a/src/osx/core/display.cpp b/src/osx/core/display.cpp index 48e76b003c..0a0296259b 100644 --- a/src/osx/core/display.cpp +++ b/src/osx/core/display.cpp @@ -85,12 +85,6 @@ int wxGetDisplayDepth(CGDirectDisplayID id) return theDepth; } -wxSize wxGetDisplaySizeMM(CGDirectDisplayID id) -{ - const CGSize size = CGDisplayScreenSize(id); - return wxSize(wxRound(size.width), wxRound(size.height)); -} - } // anonymous namespace #if wxUSE_DISPLAY @@ -113,7 +107,6 @@ public: virtual wxRect GetGeometry() const wxOVERRIDE; virtual wxRect GetClientArea() const wxOVERRIDE; virtual int GetDepth() const wxOVERRIDE; - virtual wxSize GetSizeMM() const wxOVERRIDE; virtual double GetScaleFactor() const wxOVERRIDE; virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE; @@ -312,11 +305,6 @@ int wxDisplayImplMacOSX::GetDepth() const return wxGetDisplayDepth(m_id); } -wxSize wxDisplayImplMacOSX::GetSizeMM() const -{ - return wxGetDisplaySizeMM(m_id); -} - double wxDisplayImplMacOSX::GetScaleFactor() const { return wxGetScaleFactor(m_id); @@ -437,11 +425,6 @@ public: { return wxGetDisplayDepth(CGMainDisplayID()); } - - virtual wxSize GetSizeMM() const wxOVERRIDE - { - return wxGetDisplaySizeMM(CGMainDisplayID()); - } }; class wxDisplayFactorySingleMacOSX : public wxDisplayFactorySingle diff --git a/src/qt/display.cpp b/src/qt/display.cpp index 18eb47e286..6d3de3ac2e 100644 --- a/src/qt/display.cpp +++ b/src/qt/display.cpp @@ -22,7 +22,6 @@ public: virtual wxRect GetGeometry() const wxOVERRIDE; virtual wxRect GetClientArea() const wxOVERRIDE; virtual int GetDepth() const wxOVERRIDE; - virtual wxSize GetSizeMM() const wxOVERRIDE; #if wxUSE_DISPLAY virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE; @@ -51,13 +50,6 @@ int wxDisplayImplQt::GetDepth() const 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 wxArrayVideoModes wxDisplayImplQt::GetModes(const wxVideoMode& WXUNUSED(mode)) const { diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index e2e67970c0..14f6d6e416 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -76,11 +76,6 @@ public: { return wxGetMainScreenDepth(); } - - virtual wxSize GetSizeMM() const wxOVERRIDE - { - return wxGetMainScreenSizeMM(); - } }; class wxDisplayFactorySingleX11 : public wxDisplayFactorySingle @@ -159,11 +154,6 @@ public: 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 wxVideoMode GetCurrentMode() const wxOVERRIDE;