Commit Graph
1580 Commits
Author SHA1 Message Date
Lauri Nurmi fe18212385 Do not use !str for checking wxString emptiness
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).
2024-09-12 10:05:33 +03:00
Steffen Olszewski 3737245c51 Fix linking multiple wxrc-generated files together
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.
2024-08-01 14:15:46 +02:00
Maarten Bent f0cca189ff Rebake after GDI+ and msimg32 changes 2024-06-22 13:51:39 +02:00
DoctorNoobingstoneIPresume 2d3f89109f wxrc: Generate C++ code which is faster to compile and smaller
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.
2024-06-09 01:50:29 +02:00
Vadim Zeitlin 3c41a6876c Don't use manual memory management in wxrc
Use std::unique_ptr<> instead of manually deleting the object and
std::vector<> instead of manually allocating and deleting the buffers.

No real changes.
2024-05-23 01:59:32 +02:00
DoctorNoobingstoneIPresume a01c470ae1 Fix handling file names with "%" in their names in wxrc
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.
2024-05-23 01:55:34 +02:00
DoctorNoobingstoneIPresume e9b0bd5cc7 Limit size of resource files processed by wxrc to 4GiB
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.
2024-05-23 01:54:35 +02:00
Vadim Zeitlin c656afabfe Simplify wxrc code by removing broken support for multiple bases
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.
2024-03-22 17:44:00 +01:00
Vadim Zeitlin c45c1e5462 Use -rpath for utils too and not only samples
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.
2024-03-09 20:30:52 +01:00
DoctorNoobingstoneIPresume ccc64326fc Compilation fix for ifacecheck
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.
2024-02-29 03:26:19 +01:00
Vadim Zeitlin 9a27e206ce Rebake after adding 32-bit ARM support for MSVC
This should have been done in 99bc43cefe (Introduce minimal MSW ARM
support, 2024-01-15).

See #24222.
2024-02-24 20:50:38 +01:00
Vadim Zeitlin c14c652238 Rebake after wxWebViewChromium merge
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)
2024-02-24 20:46:51 +01:00
Blake-Madden 2c1cdf9c02 Fix typos and repeated words in comments and documentation
Closes #24085.
2023-11-30 02:21:34 +01:00
Vadim Zeitlin e43f913313 Remove all blank "Modified by:" lines from top comment blocks
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.
2023-10-22 01:22:48 +02:00
Vadim Zeitlin 45dc55b047 Merge branch 'wxrc-multi-bitmap'
Support multiple bitmaps in <bitmap> elements in wxrc.

See #23795.
2023-08-24 02:51:51 +02:00
Vadim Zeitlin 9e8ab658fe Add MSVS 2022 solution file for wxrc too
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.
2023-08-23 23:24:40 +02:00
Vadim Zeitlin ab88fecdc5 Add support for multi-resolution bitmaps to wxrc
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.
2023-08-23 18:03:03 +02:00
Vadim Zeitlin 13d8adb4e1 Improve error reporting for IO errors in wxrc
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.
2023-08-23 17:58:48 +02:00
Vadim Zeitlin ec4777bbbf Rebake after the previous commit
This just separates the automatically-generated changes from the manual
ones in the parent commit.
2023-07-29 18:13:29 +02:00
Vadim Zeitlin b692eaa112 Avoid missing initializer warnings in wxrc
Just suppress the warnings because adding all the missing initializers
would make the command line initialization less readable for no real
gain.
2023-07-03 20:55:18 +02:00
Vadim Zeitlin ae13d70ddc Merge branch 'use-std-hash'
Use std::unordered_foo instead of wx hash maps.

See #23462.
2023-04-18 14:38:12 +02:00
Vadim Zeitlin 22acc3f67d Use std::unordered_set<> in wxrc code
Replace a macro-based synonym with the standard container itself.

Also use range for loop for iteration over it.
2023-04-18 00:54:12 +02:00
Vadim Zeitlin d03fc649ab Generate code using nullptr instead of NULL in wxrc
There doesn't seem to be any reason to keep compatibility with C++98
here, so use nullptr for consistency.
2023-04-17 18:38:03 +02:00
Vadim Zeitlin ae2e0f41b5 Stop defining wxArrayStringBase in STL build
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.
2023-04-08 20:18:58 +02:00
Maarten Bent b0385e498c Rebake after bakefile changes 2023-02-14 22:52:26 +01:00
Vadim Zeitlin b7f24a65d8 Rebake after the copyright year update
This should have been part of f5daf28932 (Update copyright years to
2023, 2023-01-03).
2023-01-03 18:39:06 +01:00
Vadim Zeitlin d0af75e88d Merge branch 'use-template-for-vararg-funcs'
Use variadic templates for implementing the vararg functions.

See #22981.
2022-11-26 16:53:41 +01:00
Vadim Zeitlin 31fba462d2 Don't use wxPrintf() without format arguments
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.
2022-11-23 03:17:39 +01:00
PB af97f4a735 Regenerate utils makefiles
emulator and execmon were removed, so utils makefiles
must be regenerated from the updated bakefile.
2022-11-20 10:46:26 +01:00
PB 4a69f36f22 Remove application testing if samples don't crash
Hopefully, we will not need a specialized application testing
whether a sample crashes on start-up or not anymore.
2022-11-20 10:29:39 +01:00
PB 8eca0f0a3a Remove wxEmulator
The devices it was intended for are no longer used.
2022-11-20 10:25:45 +01:00
Vadim Zeitlin a588e9a20e Don't use non-existent template class name in a comment
Try to avoid confusing people looking at this comment by not referring
to a template class which doesn't exist any longer.

No real changes.
2022-10-28 21:17:15 +01:00
Vadim Zeitlin c78b0d652b Remove UNICODE build option, hardcode its value as 1
Also hardcode "u" suffix for the library names -- it doesn't make sense
any longer, but we need to keep it for compatibility.
2022-10-27 19:43:59 +02:00
Vadim Zeitlin 6e8290a9ce Stop defining _UNICODE in makefiles
This shouldn't be necessary any longer, so don't do it.
2022-10-27 19:43:30 +02:00
Vadim Zeitlin 5c49448c75 Remove bakefile UNICODE_DEFINE variable, always define _UNICODE
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.
2022-10-27 19:43:30 +02:00
Vadim Zeitlin 4f4c5fcfdf Use nullptr instead of NULL in the code and documentation
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.
2022-10-18 01:25:25 +02:00
Vadim Zeitlin 0ef1cdcc21 Remove support for wxMotif
This port hasn't been updated for ages and is not used by anybody any
longer, so remove its code to facilitate maintenance.

Also remove references to this port from the documentation and most of
the other places (VMS-specific descrip.vms files still check for it
because it's not clear how to update them all), including configure.

Regenerate the latter and rebake all makefiles.

Finally document that this port is not available any longer.
2022-10-16 16:39:56 +02:00
PB 88d526660f Replace wxOVERRIDE and wxNOEXCEPT with override and noexcept
Don't use deprecated macros in wxWidgets itself.
2022-10-15 18:10:45 +02:00
Vadim Zeitlin 1cf49f9909 Remove MSVS 2005 and 2008 project files
These compilers are not supported any longer.

Also disable their regeneration in Bakefiles.bkgen.
2022-10-11 00:02:29 +02:00
Tim Stahlhut c69ee439d9 Stop using wxWidgets 1.xx wxString compatibility functions
Replace them with std::string-like equivalents when possible (i.e.
replace Length() with length(), IsNull() with empty()) or, at least,
with wx 2 functions if not (e.g. Remove() with Truncate(), First() with
Find(), LowerCase() with MakeLower() etc).

Closes #22638.
2022-07-24 16:25:29 +02:00
Vadim Zeitlin af4ad43824 Rebake and rerun autoconf after the version update 2022-07-17 17:03:39 +02:00
Vadim Zeitlin 2a2308d5ed Update version to 3.2.0 and rebake and rerun autoconf
Update all make/project files to use 3.2.0.
2022-06-21 00:54:26 +02:00
Vadim Zeitlin 5d5591816d Update to bakefile 0.2.13 to fix DLL directory creation
Fix the bug introduced in ec0734f96f (Install DLLs in bindir, not
libdir, when using MSW toolchains, 2021-01-09): the directory where the
DLLs were installed wasn't created any more, resulting in errors if it
didn't exist.

Update to latest bakefile version adding the missing mkdir command to
fix this and also use a released bakefile version for the wx makefiles.

Regenerate configure to match the new version.

See #14601.
2022-04-23 23:11:31 +02:00
Vadim Zeitlin 19e3a47d98 Update version to 3.1.7 and rebake the makefiles
Make it possible to distinguish the latest master from 3.1.6 before
making any changes.

Closes #22282.
2022-04-07 17:40:13 +02:00
Vadim Zeitlin ee330d73a7 Rebake after the year change
The year is now included in the copyright string used in the makefiles
and so they need to be regenerated every time the year changes (which
happens surprisingly frequently).

It would be better to define a single variable with the year number to
avoid having to do this in the future.
2022-01-14 22:51:24 +01:00
Vadim Zeitlin 2f0bce2979 Replace old Trac links with GitHub ones
Also update a couple of links to SF.
2022-01-13 16:52:58 +01:00
Vadim Zeitlin 559ea66e55 Use DPI aware manifests for MSVS 2022 too 2021-12-18 13:22:59 +01:00
Vadim Zeitlin e4ff06ebdd Also remove mentions of amd64_dpi_aware_pmv2.manifest from the manually maintained MSVS projects 2021-12-17 22:00:42 +01:00
Vadim Zeitlin 5d6b2f6704 Rebake after parent commit changes 2021-12-17 21:29:49 +01:00
Simon Rozman e3535d6481 Mark MSVS *.vcxproj.filters files as using CR LF as well
For consistency with *.vcxproj and *.sln and for making
check_mixed_eol.sh happy.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-24 12:13:12 +01:00