Commit Graph

63541 Commits

Author SHA1 Message Date
Vadim Zeitlin
8cb84cd0f7 Add LexEDIFACT.cxx to wxscintilla library CMake sources
This file has been added after CMake branch split from master.
2017-12-09 23:56:12 +01:00
Vadim Zeitlin
f6c7e8f774 Don't use "-t" command line option when running tests
This option just lists the available tags now instead of running the
tests with timing information as before.
2017-12-09 22:00:34 +01:00
Vadim Zeitlin
82b92c6d8f Update CMake files after switch from CppUnit to Catch
Don't look for CppUnit library nor build it any longer, but just use the
Catch headers under 3rdparty/catch.
2017-12-09 18:33:12 +01:00
Vadim Zeitlin
d37f758ae9 Update the list of non-GUI test source files
streams/bstream.cpp was removed in the meanwhile while a new
strings/hexconv.cpp was added.
2017-12-09 18:25:33 +01:00
Vadim Zeitlin
bd6d22d890 Avoid trailing spaces in auto-generated build/cmake/setup.h.in
Tweak the sed command to ensure that "\1" in it refers only to the name
of the preprocessor symbol being defined, without all the spaces after
it.
2017-12-09 15:09:47 +01:00
Vadim Zeitlin
c66c9c5ae6 Merge branch 'build_cmake' of https://github.com/TcT2k/wxWidgets
Add CMake-based build system.

Merge the original branch without any changes except for resolving the
conflict due to moving the contents of .travis.yml to a separate file by
propagating the changes done in this file since then to the new script
and rerunning ./build/update-setup-h and ./build/cmake/update_files.py
to update the file lists changed in the meanwhile.

Closes https://github.com/wxWidgets/wxWidgets/pull/330
2017-12-09 15:09:47 +01:00
Vadim Zeitlin
22e14e7c7b Check for wxXLocale availability without using wxLocale
This extends the changes done 01cd702ee3
to another test case and so makes as much sense as the other commit.

It's still not clear what's really going on here as, somehow, this test
passed under AppVeyor before, which shouldn't have been happening if the
explanation in that commit message was correct. And it also doesn't
explain why did it suddenly fail after a completely unrelated change,
see https://ci.appveyor.com/project/wxWidgets/wxwidgets/build/2502/job/l24gc2j0j7h7huxl
2017-12-09 14:17:34 +01:00
Vadim Zeitlin
ddf3604545 Fix harmless warning in Base64 unit test
Avoid

warning C4245: 'initializing': conversion from 'int' to 'std::size_t', signed/unsigned mismatch

from MSVC with an explicit cast.
2017-12-09 14:15:37 +01:00
Vadim Zeitlin
f4af243e5c Enable wxUSE_GRAPHICS_CONTEXT for MinGW >= 4.8
It seems that MinGW-w32 started distributing GDI+ headers since this
version and MinGW-w64 might have supported them for even longer, but
it's difficult to test for the MinGW distribution used in this header,
as it is included before wx/msw/gccpriv.h which defines
__MINGW32_TOOLCHAIN__ and __MINGW64_TOOLCHAIN__ symbols and changing
this is tricky due to relative order of defining UNICODE and
wxUSE_UNICODE and including MinGW headers, which can only be included
once UNICODE is set properly.

But while the fully correct solution is difficult, just checking for the
compiler version should solve the problem in 99.99% of the cases in
practice as there should be vanishingly few people using MinGW-w64 with
gcc < 4.8 currently, so this simple solution is good enough.

Closes #17973.
2017-12-08 19:42:21 +01:00
pavelxdd
504c22a512 Fix wxURLDataObject comment and documentation for wxGTK
Fix a copy-and-pasto in the header and also mention that wxURLDataObject
derives from wxDataObjectComposite, and not wxTextDataObject, in wxGTK
too.

Also add a note about the exact base class being an implementation
detail.

Closes https://github.com/wxWidgets/wxWidgets/pull/624
2017-12-08 13:14:19 +01:00
Vadim Zeitlin
879876e047 Fix libtiff compilation with MinGW-w32 6.3
Avoid redefining snprintf as this breaks -Wformat-related macros in this
compiler stdio.h -- and is unnecessary anyhow.

Closes #17936.
2017-12-08 03:30:41 +01:00
Vadim Zeitlin
b8bc595546 Use zlib submodule with "wx_zlib_" prefix
This will allow projects to use static wxWidgets libraries and zlib
(either directly or indirectly, as can heppen e.g. via Boost.IOStreams)
at the same time without link conflicts.

See #15314.
2017-12-08 02:38:47 +01:00
Vadim Zeitlin
b0c4cb7131 Correct order of 3rd party libraries in wx-config output
A recent change fixing monolithic build broke the normal build when
using built-in libraries under Unix as -lwxzlib now came before -lwxpng
and so zlib symbols used by libpng were not found (in fact, they could
still be found in the system library which is usually available under
Unix, so the problem wasn't seen immediately, but it was still there).

See https://github.com/wxWidgets/wxWidgets/pull/621
2017-12-08 02:38:47 +01:00
Paul Cornett
db00ab9c02 Avoid gtk_show_uri() with GTK+3.9x 2017-12-07 10:51:57 -08:00
Vadim Zeitlin
23caf6fe00 Remove misleading comment from wxStaticBox::PaintBackground()
We do use wxStaticBox colour for painting its background (as can be seen
with test code from #18018, for example) under MSW, so don't say that we
don't.

Also, the reasons for not doing it mentioned in the comment are either
obsolete (wxGTK3 does do it too, unlike wxGTK2) or lost (the link to the
mailing list message doesn't work any longer and can't be recovered).

Closes #17913.
2017-12-07 18:49:59 +01:00
Paul Cornett
2f19014d71 Avoid deprecated GdkColor with GTK3 2017-12-06 22:08:25 -08:00
Vadim Zeitlin
f3f158403c Merge branch 'file-readall-len'
See https://github.com/wxWidgets/wxWidgets/pull/629
2017-12-06 16:42:58 +01:00
Vadim Zeitlin
38c67b68e3 Remove unnecessary "virtual" keywords from Cairo code
Several methods were virtual for no apparent reason, just don't make
them virtual unnecessarily.

No real changes.
2017-12-06 14:46:26 +01:00
Vadim Zeitlin
7ee73c9332 Slightly clean up font handling in wxGraphicsContext in wxGTK
Returning true/false from wxCairoFontData::Apply() to indicate whether
Pango should or not be used was not very clear, so prefer to test for
the font explicitly in the code calling Apply() and make Apply() itself
void, consistently with the method with the same name in the other
classes.

Also avoid calling it at all from GetTextExtent() when using Pango, this
is completely unnecessary as the text colour doesn't have any bearing on
its extents.

Also use static_cast and const_cast as appropriate instead of C-style
casts.
2017-12-06 14:41:21 +01:00
Vadim Zeitlin
436d27baf0 Use correct length for the string returned from wxFile::ReadAll()
This corrects f75387850b and just uses the
newly added assign() overload taking the buffer directly: as the buffer
already knows its length, this makes it unnecessary to pass it
separately.

Closes #16490.
2017-12-06 03:41:35 +01:00
Vadim Zeitlin
140d6fea88 Add wxString ctor from wxScopedCharBuffer and wxMBConv
This is more convenient and less error prone than using the existing
ctor taking char pointer and length as the buffer contains both.

Also add the corresponding assign() overload for consistency.

See #16490.
2017-12-06 03:41:25 +01:00
Vadim Zeitlin
6e678e3a85 Improve output of test failures for unprintable characters
Show non-printable characters when comparing strings more clearly if the
comparison fails, this is notably useful for strings containing NULs as
they were previously completely lost.
2017-12-06 03:23:26 +01:00
ARATA Mizuki
54dfc341ce Add a test for wxFile::ReadAll() with an embedded NUL
See #16490.
2017-12-06 03:10:27 +01:00
Pavel O
204bc3c887 Fix linking of wxscintilla in static monolithic build
wx-config didn't report -lwxscintilla for `wx-config --libs stc` in static
monolithic build.

Since stc is a part of monolithic lib, -lwxscintilla will be reported
for `wx-config --libs` now as well.
2017-12-05 23:02:47 +01:00
Paul Cornett
f75387850b Fix reading wide character data in wxFile::ReadAll()
See #16490
2017-12-05 11:29:38 -08:00
Paul Cornett
696a5ba3dd Fix for modified state not set after next change following a ChangeValue()
See #17540
2017-12-05 06:41:08 -08:00
Paul Cornett
f2106dcc3c Avoid overriding text control color in generic wxSearchCtrl
Although it's the same color the control already had, overriding it
can have unexpected consequences, such as overriding the text selection
colors with GTK3. Fixes invisible wxSearchCtrl selection with GTK3.
2017-12-04 09:23:47 -08:00
Paul Cornett
281ad86d8d Avoid permanently setting text hint color when using generic text entry hints
Multiple calls to SetHint() would cause the original color to be lost
See #17118
2017-12-04 09:18:10 -08:00
Tim Kosse
26f48c225e Fix crash when switching between monitors in wxOSX
It is possible for CGDisplayModeCopyPixelEncoding to return NULL, e.g.
during a switch between the built-in screen and an external monitor on a
Macbook. Check the return value to prevent a crash.

Closes #18015.
2017-12-04 15:11:16 +01:00
Paul Cornett
be37dd4862 Fix keyboard navigation for controls which are initially disabled
See #16806
2017-12-03 14:41:57 -08:00
Paul Cornett
d833667326 Update config.{guess,sub} 2017-12-03 14:31:12 -08:00
Paul Cornett
88b317f89e Avoid overwriting m_filterIndex initialization
There should be no need to set it again in Create()
See #17718
2017-12-03 10:19:03 -08:00
Paul Cornett
b8734109ff Fix ribbon page does not delete scroll buttons on destruction
See #17546
2017-12-03 10:08:01 -08:00
Paul Cornett
a671974bab Fix ribbon page layout wrong when scroll button is shown or hidden due to a scroll operation
See #17454
2017-12-03 10:04:23 -08:00
Paul Cornett
91d8082cc9 Fix ribbon page scroll button not shown on window restore
See #17453
2017-12-03 09:57:12 -08:00
Vadim Zeitlin
289fbcf5be Fix use of GDK_TOUCHPAD_GESTURE_MASK with GTK+ 3.14..3.16
Define GDK_TOUCHPAD_GESTURE_MASK ourselves if GTK+ headers don't define
it and don't use it during run-time if GTK+ version is less than 3.18,
in which it was added.
2017-12-02 21:29:09 +01:00
Vadim Zeitlin
3e0adbf541 Merge branch 'gesture-events'
Integrate GSoC 2017 work by Prashant Kumar implementing support for
gesture events.

Closes https://github.com/wxWidgets/wxWidgets/pull/551

Closes https://github.com/wxWidgets/wxWidgets/pull/565
2017-12-02 18:46:53 +01:00
Vadim Zeitlin
d83cd91d13 Merge branch 'tz-fixes'
Miscellaneous fixes for time zones and DST handling in wxDateTime.

This still leaves 2 big problems:

1. We have no support for using the correct time zone offset at the
   given date and always use the current time zone offset, which may,
   and often is, wrong.

2. Our code for converting to/from broken down representation doesn't
   handle DST at all, so support for DST is non-existent for the dates
   before 1970-01-01 or after 2038-01-01 (i.e. roughly outside of the
   32 bit time_t range).

See #10445 and the other tickets linked from there.
2017-12-02 16:28:05 +01:00
Vadim Zeitlin
2de4d9d296 Update to libtiff 4.0.9
No important changes, just switch to following the branch of the new
official upstream Git repository.
2017-12-02 16:26:38 +01:00
Vadim Zeitlin
36cc6ac1d2 Add a hack to work around DST problems in unit tests in BST
wxDateTime is still broken with respect to DST outside of the standard
time_t range, but make a special exception for the dates near Unix epoch
when using BST as not accounting for DST for them broke the unit tests
when run in this time zone.

Note that constructing the dates outside of the standard range is broken
too, so if this problem is ever fully fixed in GetTm(), it would need to
be fixed in Set() too, where the DST is not taken into account neither.
The problems in unit tests were due to using the (correctly behaving)
standard mktime() for 1970-01-01 but then using our (broken) GetTm() for
accessing them and could, in principle, be also worked around by not
using mktime() for this date, but it seems better to keep correct
behaviour at least for it, even if it's still broken for many earlier
dates.

See #15370.
2017-12-02 14:38:45 +01:00
Vadim Zeitlin
15a97924b6 Simplify wxDateTime ticks test by only using UTC times
Converting to another time zone and dealing with DST is completely
useless here, ticks values are always in UTC, so we can just use UTC
values from the beginning.
2017-12-02 14:38:45 +01:00
Vadim Zeitlin
179dced0e0 Include testdate.h before catch.hpp in unit tests
This ensures that dates are printed out correctly if comparing them
fails.

It might be better to avoid always including this header, but this is
the simplest solution.
2017-12-02 14:38:19 +01:00
Artur Wieczorek
d68bb24333 Fix rescaling images with wxIMAGE_QUALITY_BOX_AVERAGE
Current algorithm used to calculate the bounds of the boxes in the source
image to which the pixels in the target (rescaled) image are mapped to, has
flaws which cause a non-uniform distribution of the boxes in the source
image. And these miscalculations may result in the visible distortions
of the colours in the rescaled image.
New algorithm assures uniform distribution of the boxes in the source image
and thanks to the integer arithmetic is faster than currently used
and not prone to the problems with floating point representation.

Closes #18012.
2017-11-30 22:50:31 +01:00
Pavel O
390a3885ba Fix linking of third party system libs in static monolithic build
Include 3rd party libs in wx-config output even when using the system,
and not the built-in, versions of them for static monolithic build.

See https://github.com/wxWidgets/wxWidgets/pull/621
2017-11-30 21:58:06 +01:00
Vadim Zeitlin
0e65d91a38 Correctly detect DST in UK during 1969-1971 BST-only period
Take into account that from 1968-10-27 and until 1971-10-31 UK used BST
time instead of GMT, i.e. that DST was permanently on.

This fixes unit test failures in BST time zone for the dates around the
Unix epoch of 1970-01-01.

See #15370.
2017-11-30 21:44:38 +01:00
Vadim Zeitlin
ef372460be Recognize BST and GMT as time zones for UK
This doesn't really change anything yet, but is a prerequisite for
implementing better DST handling for the BST time zone.
2017-11-30 21:43:27 +01:00
Vadim Zeitlin
9655ca9e68 Close the gestures frame too in the event sample
Make "Exit" menu item really exit the sample again instead of just
closing the main window, but possibly leaving the gestures testing
window still open and thus not really exiting the program.

Also avoid creating more than one gesture window, use the existing one
if we had already opened it.
2017-11-30 21:40:24 +01:00
Vadim Zeitlin
fc9244614a Request GDK_TOUCHPAD_GESTURE_MASK events in wxGTK
This is apparently needed in order to get the gesture events.
2017-11-30 21:36:49 +01:00
Vadim Zeitlin
322144299d Use wxDateTime::TimeZone::IsLocal() in the unit test
No real changes, as this doesn't affect this test, but use the new
IsLocal() method instead of comparing the time zone offset with the time
zone, which doesn't work correctly for BST.
2017-11-30 17:53:52 +01:00
Vadim Zeitlin
d49784b0a2 Disable wxDateTime tests failing due to TZ offset changes
wxDateTime timezone-related methods always use the current timezone
offset, while other methods, using CRT, use correct value for the given
date, which may be different.

This discrepancy accounted for test failures in Europe/Minsk time zone
as Belarus has switched from UTC+2 to UTC+3 since 1999 date used in the
test.

It is impossible to really fix the problem easily, so just skip the test
in this case and also mention this bug in the documentation.

See #15370.
2017-11-30 17:44:41 +01:00