Instead of forwarding to these functions from wxDisplay implementation
in wxUSE_DISPLAY==0 case, make the functions themselves wrappers around
wxDisplay, which may, or not, depending on the platform, have a simpler
implementation in wxUSE_DISPLAY==0 case, but is always available in any
case.
As part of this change, only use src/osx/core/display.cpp in macOS
builds, not iOS ones and update the Xcode project accordingly too.
This cuts down on code duplication, especially in wxGTK, and facilitates
further additions to wxDisplay API.
Move declaration of wxOwnerDrawnBase::ms_defaultMargin to correct file.
Do not include headers when wxUSE_UIACTIONSIMULATOR is disabled.
Add guards for wxUSE_DRAG_AND_DROP.
Use a different wxFont constructor in printing sample, which is also available in WXQT.
Avoid a heap allocation on every wxDisplay creation by caching the
wxDisplayImpl objects once they're created.
Currently we never invalidate the cache, but we should add a way to do
it in the future.
This speeds up wxDisplay::GetGeometry() benchmark by a factor of 4.
This benchmark shows that wxGetDisplaySize() has only minimal overhead
compared to wxDisplaySize(), but wxDisplay().GetGeometry() is almost 3
times slower (under wxGTK).
Don't check for the index validity if it's 0, which is the most common
case, as index 0 is always valid and so we can avoid calling GetCount(),
which might have a non-trivial cost, completely.
Most of the methods of wxDisplay are always available, they just only
support primary display when wxUSE_DISPLAY==0, so there is no need to
check for wxUSE_DISPLAY before using them as they already contain the
only possible fallback anyhow and such checks are useless.
This incidentally closes#18115, due to removing "#if wxUSE_DISPLAY"
around wx/display.h inclusion.
Obey the LANGUAGE environment variable (if set), which is GNU
gettext's primary way of determining language preference. Apparently
ignored by wx until now, even though wx attempts to be a
reimplementation of GNU gettext.
The LANGUAGE variable may contain a list of preferred languages,
so use that list to find the best translation.
GNU gettext has supported multiple preferred languages since forever
(at least 15 years), and therefore it is odd that this wasn't already
implemented in 01f953efb2. Instead,
it was implied that Unix does not support such. (Even if GNU is not
Unix, nothing stops a wxWidgets app supporting such nevertheless.)
Closes https://github.com/wxWidgets/wxWidgets/pull/948
To reset the clipping there is necessary
to restore all CGContext settings so we need
to set them back to the previous values based
on the stored wxGraphicsContext attributes.
For compatibility with wxMSW and wxGTK rectangle
defining wxRegion needs to be in the canonical
form with (x,y) pointing to the top-left corner
and width and height >= 0.
This is more consistent with the other headers, which are safe to
include even when the corresponding feature is turned off.
Also remove the now redundant wxUSE_ENH_METAFILE checks in the source
code including this header.
See https://github.com/wxWidgets/wxWidgets/pull/951