Commit Graph

64952 Commits

Author SHA1 Message Date
Vadim Zeitlin
e834585cf7 Remove wxDisplaySize() implementation from wxGTK1
This is now implemented in common code, in terms of wxDisplay.
2018-10-06 15:24:13 +02:00
Vadim Zeitlin
1614f7337d Mention that wxDisplaySize() shouldn't be used in the new code
Prefer to use wxDisplay::GetGeometry() which works for any display, not
just the primary one.
2018-10-06 14:11:12 +02:00
Vadim Zeitlin
613c686d73 Merge branch 'no-use-display'
Fix build for wxUSE_DISPLAY==0 and further simplify wxGTK display code.

See https://github.com/wxWidgets/wxWidgets/pull/961
2018-10-05 18:54:45 +02:00
Vadim Zeitlin
103881abee Merge branch 'virt-direction'
Don't extend wxScrolledWindow virtual size beyond its physical size in
non-scrollable direction.

See #18235.
2018-10-05 18:53:38 +02:00
Vadim Zeitlin
86ba770cd0 Rename helper display function to use wx naming convention
Don't pretend to be a GDK function, even if it's only a thin wrapper for
a GDK macro.
2018-10-05 18:52:30 +02:00
Stefan Csomor
162ea7b1ef bringing back old style macOS icons loading
see https://github.com/wxWidgets/wxWidgets/pull/925
2018-10-05 15:01:24 +02:00
Vadim Zeitlin
5e6e7aa769 Separate GTK+ 4 wxDisplay implementation from previous versions
This makes the code more readable, even though it almost doubles its
size -- but the corresponding reduction in the number of preprocessor
checks is still worth it.
2018-10-04 23:01:27 +02:00
Vadim Zeitlin
e0ba727dec Extract X11 functions used by wxGTK in a separate header
This makes src/unix/displayx11.cpp almost readable as it's not littered
by "#ifndef __WXGTK20__" checks everywhere any more -- instead this file
is just not compiled as part of wxGTK2 at all any longer (it is still
included in wxGTK1 as well as wxX11 itself and wxMotif).

wxGTK code also can just include the new wx/unix/private/displayx11.h
instead of having to declare all the X11 functions it uses manually.

There should be no changes in behaviour, this is just a clean up.
2018-10-04 17:07:11 +02:00
Vadim Zeitlin
c38a8f960e Fix wxGTK build with wxUSE_DISPLAY==0
Add the missing "new" keyword.
2018-10-04 16:39:40 +02:00
Vadim Zeitlin
de840d1813 Document that wxDisplay::GetName() is only non-empty under MSW
"Not available on all platforms" was an understatement: the string
returned by this function is only non-empty under MSW.
2018-10-04 16:38:10 +02:00
Vadim Zeitlin
9cc1424b84 Return empty string from wxDisplayImpl::GetName() by default
Simplify the code by not making this function pure virtual as all the
ports except MSW had to override it just to return an empty string.

Instead, just return empty string by default as it's not critical to
force the derived classes to override this function.
2018-10-04 16:37:12 +02:00
Vadim Zeitlin
f704c40207 Don't use wxDisplayFactorySingleX11 in wxGTK if wxUSE_DISPLAY==0
wxDisplay::CreateFactory() shouldn't be defined in this file when
building wxGTK, whether wxUSE_DISPLAY==1 or 0.
2018-10-04 16:31:55 +02:00
Vadim Zeitlin
f4c7a31414 Merge branch 'qt-ownerdrawn-fix' of https://github.com/MaartenBent/wxWidgets
See https://github.com/wxWidgets/wxWidgets/pull/957
2018-10-03 14:44:10 +02:00
Tobias Taschner
dd9ef9e588 Select latest Windows 10 SDK when building with MSVS 2017
Unfortunately Visual Studio 2017 defaults to Windows SDK 8.1
which is not installed with it. This workaround automatically
targets the latest Windows 10 SDK when building.

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

Closes #18078.
2018-10-03 14:43:39 +02:00
Vadim Zeitlin
180fb2f35b Restrict scrolled window virtual area in non-scrollable direction
If a wxScrolledWindow is only scrollable in one direction, its virtual
size should only extend beyond the actual size of the window in this
direction, as any contents not fitting the window wouldn't be visible
anyhow.
2018-10-03 01:19:57 +02:00
Vadim Zeitlin
20466d045f Slightly simply wxScrollHelperBase::ScrollLayout()
No real changes, just use wxPoint and wxSize instead of intermediate int
variables.
2018-10-03 01:12:47 +02:00
Maarten Bent
32d32f8172 Revert "Fix missing wxOwnerDrawn functions in WXQT wxMenuItem"
This reverts commit 4e23b3e7f4.
wxOwnerDrawn is only used with wxMSW toolkit.
2018-10-01 21:47:33 +02:00
Maarten Bent
519d8fec8a Disable wxUSE_OWNER_DRAWN when using WXQT with CMake 2018-10-01 21:43:19 +02:00
Vadim Zeitlin
c0e7bd33bc Don't duplicate src/osx/cocoa/stdpaths.mm in wxiOS files list
This file is already included in BASE_OSX_SHARED_SRC, which is part of
wxiOS sources, so there is no need to repeat it in OSX_IPHONE_SRC as
well.

This fixes warnings about ignoring duplicate rules in the makefile
in command line builds.
2018-10-01 14:02:48 +02:00
Blake Eryx
4fb39beae1 Remove all wxS() macros from samples
The use of wxS() is an optimization which can be used to avoid an
implicit conversion from narrow to wide strings, but such optimizations
are not really needed in the samples and just make their code less
readable, so remove them.

Closes https://github.com/wxWidgets/wxWidgets/pull/956
2018-10-01 13:55:42 +02:00
Vadim Zeitlin
761f9f74fc Merge branch 'simplify-display'
Centralize all display-related code in wxDisplay class and avoid
duplicating or reimplementing it in wxDisplaySize() and
wxClientDisplayRect() functions.

See https://github.com/wxWidgets/wxWidgets/pull/955
2018-10-01 13:52:07 +02:00
Stefan Csomor
00197d0c75 removing the menu from the public API of wxChoice on osx
on iOS pickers are having data sources that are not implemented using a menu, therefore the implementation API had to be changed
2018-10-01 08:28:41 +02:00
Stefan Csomor
ca6cae20e8 Adding more osx types as opaque public types 2018-10-01 08:12:03 +02:00
Stefan Csomor
c2ab36a2da add implicit conversion to NSArray* 2018-10-01 08:10:13 +02:00
Stefan Csomor
ef48d7f184 set wxOSX_USE_ICONREF to 0 if not defined 2018-10-01 07:21:49 +02:00
Vadim Zeitlin
2370c77a3e Merge branch 'qt-appveyor' of https://github.com/MaartenBent/wxWidgets
Build wxQt on Appveyor and fix several problems in wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/949
2018-09-30 23:09:49 +02:00
Vadim Zeitlin
0263ebfaca Remove duplicate wx/wxprec.h inclusion from wxiOSX code
No real changes, just remove an unnecessary #include.
2018-09-30 23:08:43 +02:00
Vadim Zeitlin
ddc88b74b6 Remove unnecessary DLL export declarations for private classes
wxDisplayFactory and wxDisplayImpl don't have to be exported from the
wxWidgets shared libraries and, in fact, shouldn't be.
2018-09-30 23:08:43 +02:00
Vadim Zeitlin
c2162792cf Implement wxDisplaySize() and wxClientDisplayRect() via wxDisplay
Instead of forwarding to these functions from wxDisplay implementation
in wxUSE_DISPLAY==0 case, make the functions themselves wrappers around
wxDisplay, which may, or not, depending on the platform, have a simpler
implementation in wxUSE_DISPLAY==0 case, but is always available in any
case.

As part of this change, only use src/osx/core/display.cpp in macOS
builds, not iOS ones and update the Xcode project accordingly too.

This cuts down on code duplication, especially in wxGTK, and facilitates
further additions to wxDisplay API.
2018-09-30 23:07:45 +02:00
Maarten Bent
fa19acacbe Improve WXGTK build on Windows with CMake 2018-09-30 19:49:54 +02:00
Maarten Bent
f7d1f46144 Build WXQT toolkit with AppVeyor 2018-09-30 17:23:58 +02:00
Maarten Bent
bf823e0419 Check if AppVeyor should abort before cloning the repo 2018-09-30 17:23:58 +02:00
Maarten Bent
7f0d7ef520 Fix several build errors in WXQT
Move declaration of wxOwnerDrawnBase::ms_defaultMargin to correct file.
Do not include headers when wxUSE_UIACTIONSIMULATOR is disabled.
Add guards for wxUSE_DRAG_AND_DROP.
Use a different wxFont constructor in printing sample, which is also available in WXQT.
2018-09-30 17:23:58 +02:00
Maarten Bent
4e23b3e7f4 Fix missing wxOwnerDrawn functions in WXQT wxMenuItem 2018-09-30 17:23:58 +02:00
Maarten Bent
bb82470640 Fix missing gl functions in WXQT 2018-09-30 17:23:58 +02:00
Maarten Bent
487a3854a3 Fix building stc library with WXQT
When using MSVC compiler, wxUSE_GRAPHICS_DIRECT2D is automatically enabled in setup.h.
But it is only available with WXMSW toolkit, not WXGTK or WXQT.
2018-09-30 17:23:58 +02:00
Maarten Bent
8f017509f6 Remove wxConsoleEventLoop from WXQT
The console event loop in the wxBase library is GUI toolkit independent.
2018-09-30 17:23:58 +02:00
Maarten Bent
f5b4d707b8 Do not use variable-length array in WXQT wxRegion
This is not supported by MSVC compiler.
2018-09-30 17:23:58 +02:00
Maarten Bent
1dfe088b4d Support WXQT in CMake 2018-09-30 17:23:57 +02:00
Maarten Bent
4c06c43f26 Include some Windows specific files in WXQT toolkit
Similar as with WXGTK toolkit on Windows.
2018-09-30 17:23:57 +02:00
Maarten Bent
40d57a33de Remove remnants of OS/2 from build system 2018-09-30 17:23:57 +02:00
Maarten Bent
959b677786 Remove non-existing WXQT headers from build system 2018-09-30 17:23:57 +02:00
Vadim Zeitlin
c98d504b6d Implement wxDisplay::GetClientArea() for wxQt too
This is as simple as implementing GetGeometry(), so just do it.
2018-09-30 17:07:14 +02:00
Vadim Zeitlin
771e01cc73 Remove unnecessary trivial wxDisplayFactoryQt default ctor
No real changes, just remove useless lines.
2018-09-30 17:03:22 +02:00
Vadim Zeitlin
6883cd4b96 Fix harmless variable shadowing warning in the display sample
Use different names to avoid warning C4456 given by MSVC 14.
2018-09-30 15:37:46 +02:00
Vadim Zeitlin
58a1ee1633 Show the result of wxDisplay::IsPrimary() in the sample too
Just add a quick test of this function.
2018-09-30 15:36:40 +02:00
Vadim Zeitlin
1d40b629a2 Remove the unused msw.display.directdraw system option
This should have been part of 16e4586527
which removed the code this option pertained to.

See #12387.
2018-09-30 15:30:53 +02:00
Vadim Zeitlin
990c8bfd73 Cache wxDisplayImpl object for faster access
Avoid a heap allocation on every wxDisplay creation by caching the
wxDisplayImpl objects once they're created.

Currently we never invalidate the cache, but we should add a way to do
it in the future.

This speeds up wxDisplay::GetGeometry() benchmark by a factor of 4.
2018-09-30 00:53:59 +02:00
Vadim Zeitlin
d6793893c0 Add a simple benchmark of wxDisplaySize() and related functions
This benchmark shows that wxGetDisplaySize() has only minimal overhead
compared to wxDisplaySize(), but wxDisplay().GetGeometry() is almost 3
times slower (under wxGTK).
2018-09-30 00:38:27 +02:00
Vadim Zeitlin
b4aaa10032 Fix wx/display.h compilation when it's the first included header
Include wx/defs.h to ensure that wxUSE_DISPLAY is defined before it is
checked for.
2018-09-30 00:38:27 +02:00