Commit graph

74568 commits

Author SHA1 Message Date
Vadim Zeitlin
a0ea27cccf Restrict check for obsolete macros to C++ code
Only check for the use of NULL in C++ code, not C, for example, where
it still can, and should, be used.

Also allow using "NULL" as part of a larger macro name (where it would
be followed by "_") or at the beginning/end of a string.
2023-04-17 18:33:16 +02:00
Vadim Zeitlin
83773cec9a Merge branch 'SampleIDs' of https://github.com/Blake-Madden/wxWidgets
Use wxID_HIGHEST instead of hard-coded numbers in samples.

See #23456.
2023-04-17 17:03:49 +02:00
Vadim Zeitlin
7824391f64 Merge branch 'use-std-containers'
Remove avoidable uses of legacy container classes by replacing them with
the standard containers.

See #23440.
2023-04-17 17:02:27 +02:00
Vadim Zeitlin
61da62a17d Merge branch 'always-use-stl'
Remove separate STL build mode, as we now always use STL.

See #23449.
2023-04-17 17:01:14 +02:00
Blake-Madden
62bb66fc3a
Update toolbar.cpp 2023-04-17 06:36:10 -04:00
Blake-Madden
d75cb381b7
Update xti.cpp 2023-04-17 06:35:30 -04:00
Vadim Zeitlin
889845fbc4 Add support for wxNO_IMPLICIT_WXSTRING_CONV_TO_PTR to wxString
This symbol is similar to the existing wxNO_IMPLICIT_WXSTRING_ENCODING
and can be defined when building the application (as opposed to when
building the library) to disable implicit wxString conversions to
pointer types, i.e. char*, wchat_t* and void*.

This makes the just added wxUSE_CHAR_CONV_IN_WXSTRING library build
option unnecessary, so remove it.
2023-04-16 01:16:56 +02:00
Vadim Zeitlin
4913857ef7 Define wxNO_UNSAFE_WXSTRING_CONV if wxUSE_UNSAFE_WXSTRING_CONV==0
This doesn't really change anything, but allows to simplify the tests,
as we can now check only for wxNO_UNSAFE_WXSTRING_CONV and this covers
both the case of the library compiled without support for the unsafe
conversions at all and the case when the conversions are disabled by
explicitly defining wxNO_UNSAFE_WXSTRING_CONV when building the
application.
2023-04-16 01:16:56 +02:00
Vadim Zeitlin
5119d35d3b Document that wxString::Clone() is obsolete
It's useless now that we never use ref-counted implementation any
longer.
2023-04-16 00:43:05 +02:00
Vadim Zeitlin
330303e078 Update wxString overview and documentation
Avoid overlap between the two pages.

Remove obsolete information.

Document wxNO_IMPLICIT_WXSTRING_ENCODING.

Don't mention wxUSE_STL any longer.
2023-04-15 20:34:24 +02:00
Vadim Zeitlin
35c35c235e Remove wxUSE_STL which is not really used any longer
wxString is always based on std::[w]string since 2c0c727f49 (Remove wx
own wxStringImpl implementation, 2022-11-16) and all containers use
standard containers by default too now -- and there is a separate
wxUSE_STD_CONTAINERS for this anyhow.

The only remaining use of wxUSE_STL was as the default value for
wxUSE_STD_STRING_CONV_IN_WXSTRING option, but it's not really needed
for this neither, and this option can just be set to 0 by default.

Also add wxUSE_CHAR_CONV_IN_WXSTRING which can now be set to 0 too to
disable all unwanted implicit conversions (even "safe" ones, to wide
strings, in addition to the unsafe ones to narrow strings that could be
already disabled with wxUSE_UNSAFE_WXSTRING_CONV) to allow people who
don't want to have any implicit conversions at all to do it.

Keep --enable-stl configure option for compatibility, but warn if it is
used to tell people that it is not needed any longer.
2023-04-15 17:22:09 +02:00
Vadim Zeitlin
d65eed50fa Replace some occurrences of wxUSE_STL with wxUSE_STD_CONTAINERS
The latter option will remain, while the former one won't be used at all
any longer soon, so prefer using the latter whenever possible.
2023-04-15 15:14:41 +01:00
Vadim Zeitlin
4c8bf1e9e7 Don't mention wxString::GetWriteBuf() in the documentation
This function doesn't exist any longer since 5e2da5a106 (Get rid of v2.8
code, 2022-08-01).

Remove documentation of this function and its UngetWriteBuf()
counterpart and don't refer to them in wxStringBuffer[Length]
documentation.
2023-04-15 15:08:37 +01:00
Vadim Zeitlin
dba9f1fbad Use std::list<> instead of wxDList in wxDocument
Get rid of the only occurrence of wxDList in wx sources and just use the
standard container directly instead.
2023-04-15 14:52:41 +01:00
Vadim Zeitlin
fb17a5ac38 Merge branch 'use-std-cont-1'
Set wxUSE_STD_CONTAINERS=1 by default.

See #23439.
2023-04-15 15:46:08 +02:00
Vadim Zeitlin
5e7b08f9ea Correct wxDC::GetContentScaleFactor() documentation
Document that it returns the same value as GetDPIScaleFactor() wxWindow
method and _not_ the wxWindow method with the same name.

This is very confusing, but there doesn't seem to be anything to be done
about it by now.

See #23441.
2023-04-13 15:07:32 +02:00
Vadim Zeitlin
030dd6d79b Document that applications are always DPI-aware with wxGTK
Also mention that fractional scaling is not currently supported under
this platform.

See #23441.
2023-04-13 14:57:16 +02:00
Vadim Zeitlin
71a64c25fa Merge branch 'im/choiceperf' of https://github.com/imciner2/wxWidgets
Improve performance of inserting many items in wxComboBox in wxGTK.

See #23443.
2023-04-12 19:33:11 +02:00
Vadim Zeitlin
6485e0200f Define __WXGTK20__ again for wxGTK 3 builds
This was accidentally broken in fb4f0b590c (Remove wxGTK1 port and GPE
support, 2022-10-16): even though the commit message explicitly said
that __WXGTK20__ was still defined, it actually wasn't any more.

Fix this now by just doing it always when using wxGTK. This allows to
drop WXGTK2 variable entirely, as it's not used any longer and we don't
need to set it.

Closes #23444.
2023-04-12 19:30:57 +02:00
Vadim Zeitlin
4f075139c3 Briefly describe the changes to private container classes
This is intentionally not very detailed, as we might find more container
classes to change in the future and listing all of the affected ones
here would require updating this list later.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
c292f5add6 Use std::list<> in wxD2DResourceManager
Replace a macro-based wx list with the standard container.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
35269541ec Remove unnecessary includes of wx/list.h
No real changes, just stop #including wx/list.h where it is not needed.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
a55e34570a Use thread-specific variable for current wxMessageDialog
Stop using a hash map indexed by the thread ID in wxMessageDialog code
to store the dialog being shown for the current thread and simply use a
thread-local variable to directly store the dialog pointer instead, as
this is much simpler.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
5a7f86e4e6 Use unordered_map<> in wxMSW wxWindow implementation
Replace wx hash map with the standard container.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
8c54dcb50f Remove ugly s_fileInfo macro from wxMSW wxFSVolume code
Don't redefine a variable as a macro, this was just horrible.

Also remove a (surely outdated by now, even if it ever was true) comment
about "Cygwin bug": using a wrapper function for a global is a good idea
anyhow as it imposes the correct initialization order, so we don't need
any bogus excuses for doing it.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
97f5cc6a0f Use unordered_map<> in wxMSW wxFSVolume implementation
Replace wx hash map with the standard container.

Also put local definitions inside an anonymous namespace.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
071cc3a91d Use unordered_map<> in wxMSW wxSpinCtrl implementation
Replace wx hash map with the standard container.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
c671d48c30 Use unordered_map<> in wxMSW wxTimer implementation
Replace wx hash map with the standard container.

Also put local definitions inside an anonymous namespace.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
a1baeda9a2 Use std::unordered_map<> for wxX11 global window maps
Replace wx hash map with the standard container.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
60f7708979 Use std::unordered_map<> for environment variables strings
Replace a wx hash map with the standard container.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
c304c57340 Use std::unordered_map<> in wxSTC code
Replace wx hash map with the standard container.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
00bea8ef96 Use std::unordered_map<> in wxOSX code
Replace wx hash maps with the standard container.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
d3dc49a63f Use std::unordered_map<> for the atoms in wxMSW DDE code
Replace wx hash map with the standard container.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
c3bd9df73e Use std::unordered_map<> for PaintDCInfos in wxMSW wxDC code
Replace wx hash map with the standard container.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
c2d3128b76 Use std::unordered_map<> for wxWindowGesturesMap
Replace wx hash map with the standard container.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
f1f9cda458 Use std::unordered_xxx in wxGrid
Make wxGridFixedIndicesSet a std::unordered_set and use unordered_map
for the other maps used by wxGrid.

Remove the initial buckets assignment, as it isn't really clear if it's
helpful.

Also remove the casts that are not needed now that we use a map with the
correct type for the keys and values.
2023-04-12 18:15:46 +01:00
Vadim Zeitlin
de9038dae0 Use std::unordered_map<> in wxDFB
Replace a wx hash map with the standard class.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
6ffe64a664 Use std::unordered_map<> in wxXPMDecoder implementation
Replace wx hash maps with the standard container.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
3de3a92a9c Use std::unordered_map<> in wxIdManager code
Replace a wx hash map with the standard container.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
7fb3ce78d4 Use std::unordered_xxx classes in wxWebRequestCURL code
Replace legacy wx hash set and hash map with the standard containers.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
e13dbd4278 Use std::unordered_map<> in wxMsgCatalog and related classes
Replace more occurrences of legacy wx hash maps with the standard class.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
c9e61ea8d3 Use std::unordered_map<> in wxCSConv implementation
Replace a legacy wx hash map class with the standard container.

Note that we need a special workaround for pre-C++14 compilers to use an
enum as a key of an unordered_map.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
443ec61b21 Use std::unordered_map<> in wxUILocale implementation
Replace legacy wxStringToStringHashMap with the standard class.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
aef968d5c4 Remove unnecessary includes of wx hash-related headers
No real changes, just stop #including wx/hash.h, hashmap.h and hashset.h
from the files where they are not needed at all.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
842514f532 Replace wxHashTable with std::unordered_set<> in wxImage code
Stop using the legacy class in wxImage::CountColours().
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
ee95fde059 Use std::unordered_map<> in wxPluginLibrary and wxPluginManager
Replace the old macro-based wx hash map with the standard class.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
1d3332674e Use std::unordered_map<> in wxArtProvider implementation
Use the standard container instead of wx hash maps.

No real changes.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
97f1521f26 Stop using wxList in wxOSX wxAcceleratorTable implementation
This is similar to the parent and grandparent commits.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
74af25c432 Stop using wxList in wxQt wxAcceleratorTable implementation
This is similar to the previous commit for the generic version.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
146ff109d2 Stop using wxList in generic wxAcceleratorTable implementation
Use a vector of objects instead.

Note that this implicitly fixes a bug in wxAccelRefData copy ctor which
copied pointers that were later deleted in the dtor, i.e. would end up
being deleted twice if this ctor were actually used.
2023-04-12 18:15:45 +01:00