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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user