Add wxDisplay::GetPPI() to use instead of wxGetDisplayPPI()

While this is not done for all the ports yet, the new API allows
returning different PPI values for different monitors, unlike the old
(and still existing, but implemented in terms of the new one) global
function.
This commit is contained in:
Vadim Zeitlin
2018-10-06 23:21:45 +02:00
parent e3e883bbd2
commit ded2894b78
24 changed files with 290 additions and 107 deletions

View File

@@ -44,6 +44,17 @@ inline int wxGetMainScreenDepth()
return DefaultDepth(dpy, DefaultScreen (dpy));
}
inline wxSize wxGetMainScreenSizeMM()
{
Display* const dpy = wxGetX11Display();
return wxSize
(
DisplayWidthMM(dpy, DefaultScreen(dpy)),
DisplayHeightMM(dpy, DefaultScreen(dpy))
);
}
class wxDisplayImplSingleX11 : public wxDisplayImplSingle
{
public:
@@ -65,6 +76,11 @@ public:
{
return wxGetMainScreenDepth();
}
virtual wxSize GetSizeMM() const wxOVERRIDE
{
return wxGetMainScreenSizeMM();
}
};
class wxDisplayFactorySingleX11 : public wxDisplayFactorySingle
@@ -143,6 +159,11 @@ 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;