This reverts commit 3d51977acf because
it's incompatible with the library names created by CMake when building
CEF directly, and not via wx CMake files.
Use "hidden friend" idiom instead and define these operators as friend
functions inside the corresponding class scope, so that they're only
found using ADL and, in particular, don't appear as candidates when
looking for any operator.
In practice, this significantly reduces the error messages given if some
operator (e.g. "==") is applied to a type not defined it, as the
compiler doesn't need to consider converting this type to wxPoint,
wxRealPoint, wxRect, wxSize etc, nor to complain about failing to do it.
Unary minus of wxPoint and multiplication with double are implemented
but undocumented. Many of operators that use integers types other
than int remain undocumented though.
The arithmetic operators for wxPoint and wxRealPoint are quite
repetitive and were made by copy-paste from the wxSize operators.
Because of that, some of the names are a bit misleading which this
commit changes. The changes are:
1. replace s/sz with p/pt for point variables (likely 's' comes from
copied code used for wxSize variables)
2. replace 'i' with 'f' for floating point types (likely 'i' comes
from copied code used for integer types)
3. replace 'factor' with 'divisor' for division operations (factors
are the multiplication operands, not division)
We need to do it when using XWayland for the same reasons as we had to
do it in the EGL version when using either XWayland or Wayland directly:
without this, we can block for up to 1 second in glXSwapBuffers() if the
window is hidden, see #23512.
Closes#24163.
Closes#24165.
Do this for consistency with wxSize which already had this operator/()
overload and operator*() in these classes which was already overloaded
for double.
Closes#24185.
Closes#24187.
These have been unused since e95354ec54 (added UTF-16/32-[LB]E conversions; got
rid of wxCharacterSet and simplified and fixed some bugs in remaining code, 2003-09-22)
This can be useful for the existing applications switching to using
XDG-compliant config files location as they can just call this function
on startup to keep using the existing file.
Sometimes it's useful to have some code used only if wxConfig is defined
as wxRegConfig or only if it is defined as wxFileConfig and testing for
these symbols is more clear than testing for the platform (and more
correct, considering that setting wxUSE_CONFIG_NATIVE to 0 may result in
wxFileConfig being used even under Windows).
If saving wxConfig to the file in wxAppConsoleBase::CleanUp() failed,
wxLog messages were logged into a wxLogGui target which was recreated
because wxTheApp is still non-null when CleanUp() is called. However it
is destroyed soon afterwards and showing messages from wxLogGui without
wxTheApp leads to crashes, at least in wxGTK.
To avoid this, we could set wxTheApp to null before calling CleanUp(),
but it's not clear if there is no cleanup code (or something called from
it) which doesn't rely on wxTheApp existence, so instead just flush, and
reset, the log target after calling CleanUp() but before destroying the
application object.
This fixes the crash which could be easily reproduced simply by making
the file used by wxFileConfig not-writeable under Linux.
Use the correct types instead of wxSize which was erroneously used
there ever since a5664fd6ef (Increase interoperability between wxPoint
and wxRealPoint introducing constructors which convert between the two
classes., 2010-06-09).
Closes#23804.
For some completely mysterious reason we don't get the expected mouse
click events when running under AppVeyor, something might be covering
the window and stealing the clicks for itself there.
As there doesn't seem to be anything to do about it, just skip the test
in this case.
Closes#24082.
No real changes, just add a function ensuring that the tab is shown.
It's not really clear why the existing code sometimes calls
MakeTabVisible() after SetActivePage() and sometimes doesn't, and
perhaps it should actually always do it, in which case this function
could be merged with SetActivePage() to do everything at once, but for
now keep the changes minimal.
Previously this was only done when removing the global (i.e. per
notebook) current page, but not when removing the page which was current
in this tab control without being globally current, and this resulted in
not showing the newly shown page correctly.
Fix this by explicitly updating the tab control in this case.
Closes#24063.
Using this style allows to tell wxFileConfig to use XDG-compliant
location for the user configuration file, even when not using XDG file
layout for wxStandardPaths, which can be convenient when modifying the
existing application using wxStandardPaths for other files locations
too.
And using it in combination with wxCONFIG_USE_SUBDIR allows to put the
config file in a XDG-compliant subdirectory, which wasn't easily
possible at all before.
It doesn't make sense to call this function and ignore its return value,
but it may happen accidentally as it might seem that it modifies its
parameter.
This allows using GetUserDir(Dir_Config) to retrieve XDG-compliant
location of the configuration files, independently of the file layout
used by the global wxStandardPaths object.
Recommend using this directory instead of GetUserDataDir() for multiple
configuration files under Unix.
The 1KB buffer used before was really too small and should have been
increased to at least 4KB, but increase it to 16KB as it should do no
harm neither.
This parameter wasn't used for anything as it specified the encoding of
the data contents in memory and not the encoding of the XML file as
might be believed, so it only created unnecessary confusion.
See #24167.