Add wxDisplay::GetStdPPIValue() and GetStdPPI()

Provide public way to access the default platform DPI, which was
previously a constant private to src/common/wincmn.cpp.
This commit is contained in:
Vadim Zeitlin
2020-08-06 23:54:48 +02:00
parent 2256dac384
commit 52b25211c8
3 changed files with 52 additions and 13 deletions

View File

@@ -143,6 +143,33 @@ public:
*/
wxSize GetPPI() const;
/**
Returns default display resolution for the current platform in pixels
per inch.
This function mostly used internally, use GetPPI() to get the actual
display resolution.
Currently the standard PPI is the same in both horizontal and vertical
directions on all platforms and its value is 96 everywhere except under
Apple devices (those running macOS, iOS, watchOS etc), where it is 72.
@see GetStdPPI()
@since 3.1.5
*/
static int GetStdPPIValue();
/**
Returns default display resolution for the current platform as wxSize.
This function is equivalent to constructing wxSize object with both
components set to GetStdPPIValue().
@since 3.1.5
*/
static wxSize GetStdPPI();
/**
Returns @true if the display is the primary display. The primary
display is the one whose index is 0.