Commit Graph

65027 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
9619950721 Use wxOVERRIDE for wxDisplay-related classes in wxQt
No real changes.
2018-09-30 00:38:27 +02:00
Vadim Zeitlin
9f37d91498 Fix wrong comment before wxDisplayFactorySingle::CreateDisplay()
This method is not static.
2018-09-30 00:38:26 +02:00
Vadim Zeitlin
77e33d9e1b Micro optimization in wxDisplay ctor
Don't check for the index validity if it's 0, which is the most common
case, as index 0 is always valid and so we can avoid calling GetCount(),
which might have a non-trivial cost, completely.
2018-09-30 00:38:26 +02:00
Vadim Zeitlin
141d7b826d Fix weird indentation in X11 display code
No real changes.
2018-09-30 00:38:26 +02:00
Vadim Zeitlin
587a510028 Remove unnecessary wxUSE_DISPLAY preprocessor checks
Most of the methods of wxDisplay are always available, they just only
support primary display when wxUSE_DISPLAY==0, so there is no need to
check for wxUSE_DISPLAY before using them as they already contain the
only possible fallback anyhow and such checks are useless.

This incidentally closes #18115, due to removing "#if wxUSE_DISPLAY"
around wx/display.h inclusion.
2018-09-30 00:38:26 +02:00
Vadim Zeitlin
bac28b95cd Move wx/display_impl.h to wx/private/display.h
This shows more clearly that this header is private to wxWidgets and
can't be included by user code.

No real changes.
2018-09-30 00:38:26 +02:00
Vadim Zeitlin
6db5b54fc7 Fix wxHTML benchmarks compilation
wx/crt.h must be included to use wxSscanf().
2018-09-30 00:32:21 +02:00
Vadim Zeitlin
21a5314c52 Another graphics benchmark compilation fix for non-MSW
Use GraphicsRenderer name for the enum in all ports.

See 573cb961cb
2018-09-30 00:31:41 +02:00
Vadim Zeitlin
a8ac1e3240 Graphics benchmark compilation fix under Unix
Only use wxMSW-specific wxBitmap::UseAlpha() when using this port.

See 7ddb522ec2
2018-09-30 00:30:53 +02:00
Lauri Nurmi
829f181ccd Get preferred UI languages from the LANGUAGE variable on *nix
Obey the LANGUAGE environment variable (if set), which is GNU
gettext's primary way of determining language preference. Apparently
ignored by wx until now, even though wx attempts to be a
reimplementation of GNU gettext.

The LANGUAGE variable may contain a list of preferred languages,
so use that list to find the best translation.

GNU gettext has supported multiple preferred languages since forever
(at least 15 years), and therefore it is odd that this wasn't already
implemented in 01f953efb2. Instead,
it was implied that Unix does not support such. (Even if GNU is not
Unix, nothing stops a wxWidgets app supporting such nevertheless.)

Closes https://github.com/wxWidgets/wxWidgets/pull/948
2018-09-29 18:14:20 +02:00
Vadim Zeitlin
ec5aacd270 Define canonical email address for Blake Eryx 2018-09-29 17:16:45 +02:00
Blake Eryx
b70ed2d8c8 Remove more wxT() macros from samples
Also use wxString instead of wxChar* strings.

Closes https://github.com/wxWidgets/wxWidgets/pull/950
2018-09-29 17:16:12 +02:00
Vadim Zeitlin
480047ee9a Merge branch 'pgchoices-wxstring'
Make it more convenient to use wxPGChoices with wxString arrays.
2018-09-29 17:13:50 +02:00
Vadim Zeitlin
96ecfd8c77 Provide wxPGChoices ctor, Add(), Set() overloads taking wxStrings
Allow passing an array of wxStrings in addition to an array of wxChar*
strings.
2018-09-29 17:13:00 +02:00
Vadim Zeitlin
b624064659 Call Add(), not Set(), from wxPGChoices ctors
There is no need to call Free() on a newly constructed object and Set()
is just Free() followed by Add().

No real changes.
2018-09-29 17:01:17 +02:00
Vadim Zeitlin
d2e072db3c Don't use unclear ValArrItem typedef in wxPGChoices documentation
All the other methods use just "long", so use it in Add() documentation
as well instead of the rather cryptic ValArrItem.
2018-09-29 16:59:32 +02:00
Vadim Zeitlin
8bb5cb1d6e Improve wxPGChoices::Set() documentation too
Refer to Add() and use @overload rather than duplicating the
description.
2018-09-29 16:57:10 +02:00
Vadim Zeitlin
378f62bd08 Improve documentation of wxPGChoices ctor and Add() methods
Mention that the "labels" array must be NULL-terminated and that
"values" must have at least as many items, if they're provided at all.
2018-09-29 16:55:16 +02:00
Artur Wieczorek
f96c37eacc Preserve wxGraphicsContext settings while resetting the clipping
To reset the clipping there is necessary
to restore all CGContext settings so we need
to set them back to the previous values based
on the stored wxGraphicsContext attributes.
2018-09-27 22:57:41 +02:00
Artur Wieczorek
875c095e87 Normalize wxRegion rectangle if it has a negative size
For compatibility with wxMSW and wxGTK rectangle
defining wxRegion needs to be in the canonical
form with (x,y) pointing to the top-left corner
and width and height >= 0.
2018-09-27 22:57:05 +02:00
Stefan Csomor
3b1551a714 Fixing builds with Xcode 2018-09-27 14:46:33 +02:00
Vadim Zeitlin
713a7ab895 Move wxUSE_ENH_METAFILE check inside wx/msw/enhmeta.h itself
This is more consistent with the other headers, which are safe to
include even when the corresponding feature is turned off.

Also remove the now redundant wxUSE_ENH_METAFILE checks in the source
code including this header.

See https://github.com/wxWidgets/wxWidgets/pull/951
2018-09-26 14:47:45 +02:00
imReker
2ed7ed6f39 Fix wxMSW build error when wxUSE_ENH_METAFILE=0
Don't include wx/msw/enhmeta.h when wxUSE_ENH_METAFILE is set to 0.

Closes https://github.com/wxWidgets/wxWidgets/pull/951
2018-09-26 14:43:54 +02:00
Stefan Csomor
bc2c58bd39 fixing include statement 2018-09-25 16:47:51 +02:00
Stefan Csomor
494581c542 macOS wxStaticBitmap missing commit 2018-09-25 15:59:50 +02:00
Stefan Csomor
d44974789c docs update for macOS static bitmap 2018-09-25 15:29:39 +02:00
Stefan Csomor
19c4d8cf3e macOS, iOS native implementation for wxStaticBitmap
templated native images are not drawing correctly using the low-level drawing calls, therefore use the native Image Views
2018-09-25 15:22:56 +02:00
Stefan Csomor
13a96c586f macOS bitmap change info 2018-09-25 15:20:37 +02:00