Add wxClientDC::CanBeUsedForDrawing()

This function can be used to check if drawing on wxClientDC actually
works. This has to be a run-time, rather than compile-time, check
because in wxGTK3 this depends on the backend being used: wxClientDC
only doesn't work with Wayland, but does work with X11 (and, less
importantly, Win32) backend(s).

Currently the wxWindow parameter of this function is not used but it
could be useful in the future and it will be simpler to allow not
specifying it (by defaulting it to nullptr) than to add it later, so it
seems better to have it.
This commit is contained in:
Vadim Zeitlin 2023-12-26 18:31:36 +01:00
parent aa14096ca9
commit 24fd54ed31
12 changed files with 80 additions and 6 deletions

View file

@ -64,6 +64,8 @@ class wxClientDCImpl: public wxGTKCairoDCImpl
public:
wxClientDCImpl(wxClientDC* owner, wxWindow* window);
static bool CanBeUsedForDrawing(const wxWindow* window);
wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
};
//-----------------------------------------------------------------------------