At the time of cfe4a10995 (Add manually created MSVS 201x solutions
files for wxrc, 2019-01-07) MSVS 2022 wasn't released yet, but now it
does, so add a solution for it too.
While wxString::operator!() is a documented alternative to .empty() since
25 years, using it in just a handful of places in the codebase is not
consistent.
!str is arguably not very readable either, because std::string does not
have such an operator, and neither does e.g. Qt's QString. People would
generally except ! in the context of any kind of strings to check for null
pointer (char*), or an optional with a missing value (std::optional).
Each generated C++ file contains the global helper function `void
XRC_ADD_FILE(...)`, this results in a linker error when multiple of such
generated files are linked into a single executable.
Give this function internal linkage instead to prevent this error.
Closes#24744.
Avoiding performing the conversions from "const wxChar*" to wxString in
all places where XRC_ADD_FILE is used and doing it in just a single
function allows to significantly reduce both the compilation time and
the size of the generated machine code.
Also add a simple script allowing to generate the XRC file that can be
used to test this improvement.
Closes#24579.
Use std::unique_ptr<> instead of manually deleting the object and
std::vector<> instead of manually allocating and deleting the buffers.
No real changes.
In the original code:
```
s.Printf(wxFileNameFromPath(parOutput) + wxT("$%03i-") + name2, i);
```
if `wxFileNameFromPath(parOutput2)` or `name2` had contained `'%'`
(format specifiers), the results would have been bad.
These strings are now given as additional arguments to `Printf`
(corresponding to `"%s"` format specifiers), and the format string
argument itself is now constant.
Closes#24547.
Make the behaviour consistent on all platforms and disallow huge files
everywhere instead of only doing it on 32-bit platforms: in practice,
there should be never any need for the resource files of such size.
Closes#24546.
This code was added back in aac18ec71e (generate ctors with optional
parent parameters in C++ code (patch 1238355), 2006-05-06) but
apparently never worked, as it generated uncompilable code if it was
executed (see #24383) and doesn't seem to make any sense as the name of
the class defined in XRC can never be "wxMenu" or any other of the
already existing wx classes.
Revert this to simplify the code.
See #7433.
Closes#24422.
And get rid of SAMPLES_RPATH_FLAG and just use DYLIB_RPATH_FLAG, as it's
not at all sample-specific.
This notably allows running wxrc from the build tree without setting
LD_LIBRARY_PATH under Linux.
Closes#24384.
Include wx/hashmap.h in utils/ifacecheck/xmlparser.h itself instead of
relying in the including file to do it because ifacecheck.cpp did not.
Closes#24359.
No real changes, just rebake all the makefiles after the addition of
wxwin.extraLdflags, which results in an extra space even when these
flags are empty in webview-chromium branch.
This should have been done in f37401dde3 (Merge branch
'webview-chromium', 2024-01-19)
Having this line is not useful at all as it doesn't contain any
information and shouldn't be filled in the future as git-shortlog can
provide the information about people who changed the given file more
more reliably than consulting the comments in any case.
Keep the non-blank lines for historical purposes.
Add another manually created solution file, after adding the solutions
for MSVS 2017 and 2019 in cfe4a10995 (Add manually created MSVS 201x
solutions files for wxrc, 2019-01-07) to make it possible to build wxrc
with MSVS 2022 easily too.
Handle multiple semicolon-separated paths in <bitmap> elements which are
used to provide several versions of the same bitmap in different
resolutions.
This commit is best viewed ignoring whitespace-only changes.
Notably, give a clear error if an input file is not found and also check
that the temporary output file could have been written successfully.
Still continue handling the other files even if some of them couldn't be
found in order to give all errors at once if there is more than one
missing file.
It seems to be completely unnecessary, just use wxBaseArray<wxString>
directly.
Also remove some very old mention of wxArrayStringBase from ifacecheck
which is surely not needed any longer now (and probably wasn't since
quite some time already).
No real changes.
It could have been replaced with just wxPuts(), but using format
specifiers here instead of constructing the message by concatenating the
pieces makes the code more readable, so do this instead.
This avoids another warning about insecure format string use.
It might be unnecessary to define it on command line at all, as it's
done in wx/setup.h, but keep doing it for now.
However stop using a variable for this, as setting wxUSE_UNICODE to 0 is
not supported any longer.
This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.
Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.
And also use null in the assert messages.
Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.