Tag 2.9.1 release.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/WX_2_9_1@65014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
68
build/tools/git-make-release
Executable file
68
build/tools/git-make-release
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This is the script used by VZ to make wxWidgets releases. It is unofficial
|
||||
# because it must be ran from git-svn repository and not the official svn one
|
||||
# and relies on having a recent Perl installation. But it has the advantage of
|
||||
# being very simple because git knows which files should be included in the
|
||||
# distribution and we don't need to maintain the list of them ourselves but we
|
||||
# also don't run the risk of including anything unwanted.
|
||||
#
|
||||
# Another prerequisite for using it is to create the list of files to be
|
||||
# converted to DOS EOLs for Windows distribution, it must exist in the parent
|
||||
# directory and be called eol-native. This can be done using the companion
|
||||
# svn-find-native-eols.pl script. And will only need to be redone when
|
||||
# svn:eol-style property changes for any files (most likely because it will be
|
||||
# set for a newly added file).
|
||||
#
|
||||
# To summarize, here are the steps to create the release:
|
||||
#
|
||||
# % cd $svn
|
||||
# % $git/build/tools/svn-find-native-eols.pl > $git/../eol-native
|
||||
# % cd $git
|
||||
# % git svn tag WX_x_y_z
|
||||
# % ./build/tools/git-make-release x.y.z
|
||||
# % ... upload ../wxWidgets-x.y.z.{7z,tar.bz2,zip} ...
|
||||
#
|
||||
# If anything is wrong and some minor fixes are required, only the last two
|
||||
# steps (tagging and git-make-release) must be repeated.
|
||||
|
||||
version=$1
|
||||
if [ -z "$version" ]; then
|
||||
echo "Must specify the distribution version." >2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
prefix=wxWidgets-$version
|
||||
destdir=$(dirname $(readlink -f $0))/../../../$prefix
|
||||
|
||||
cleanup() {
|
||||
rm -rf $destdir
|
||||
}
|
||||
|
||||
trap cleanup INT TERM EXIT
|
||||
|
||||
cleanup
|
||||
|
||||
git archive --prefix=$prefix/ HEAD | (cd ..; tar x)
|
||||
cd ..
|
||||
mv $prefix/include/wx/msw/setup0.h $prefix/include/wx/msw/setup.h
|
||||
|
||||
tar cjf $prefix.tar.bz2 $prefix
|
||||
|
||||
cd $prefix
|
||||
set +x
|
||||
for f in `cat ../eol-native`; do
|
||||
if [ $f == "include/wx/msw/setup0.h" ]; then
|
||||
# we renamed this file above so adjust
|
||||
f="include/wx/msw/setup.h"
|
||||
fi
|
||||
unix2dos $f
|
||||
done
|
||||
set -x
|
||||
|
||||
zip -q -r ../$prefix.zip .
|
||||
|
||||
7z a ../$prefix.7z . >/dev/null
|
32
build/tools/svn-find-native-eols.pl
Normal file
32
build/tools/svn-find-native-eols.pl
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# This script must be ran from svn checkout and will produce the list of all
|
||||
# files using native svn:eol-style on output. It's used as a helper for
|
||||
# distribution creation as this is also the list of files which need to have
|
||||
# their line endings converted for the use on the platform other than the
|
||||
# current one.
|
||||
#
|
||||
# Notice that the script requires Perl 5.10 (which could be easily avoided but
|
||||
# as this is for my personal use mostly so far, I didn't bother) and Perl svn
|
||||
# bindings.
|
||||
use 5.10.0;
|
||||
use strict;
|
||||
use warnings;
|
||||
use SVN::Client;
|
||||
|
||||
my $ctx = SVN::Client->new
|
||||
or die "Failed to create svn context, do you have svn auth stored?\n";
|
||||
|
||||
# For testing purposes a single parameter may be specified to restrict the list
|
||||
# of files with native EOLs to just this directory (recursively) or even a
|
||||
# single file. In normal use no parameters should be given.
|
||||
my $path = $ARGV[0] // '';
|
||||
my $props = $ctx->proplist($path, undef, 1)
|
||||
or die "Failed to list properties for $path.\n";
|
||||
|
||||
foreach my $prop (@$props) {
|
||||
my $eol = ${$prop->prop_hash()}{'svn:eol-style'};
|
||||
if ( defined $eol && ($eol eq 'native') ) {
|
||||
say $prop->node_name();
|
||||
}
|
||||
}
|
107
docs/readme.txt
107
docs/readme.txt
@@ -1,50 +1,72 @@
|
||||
wxWidgets 2.9.x
|
||||
---------------------------------------------------------
|
||||
wxWidgets 2.9.1 Release Notes
|
||||
=============================
|
||||
|
||||
Welcome to wxWidgets, a cross-platform C++ framework for
|
||||
writing advanced GUI applications using native controls
|
||||
where possible.
|
||||
Welcome to the latest release of wxWidgets, a cross-platform C++
|
||||
framework for writing advanced GUI applications using native
|
||||
controls where possible.
|
||||
|
||||
In addition to common and advanced GUI facilities such as
|
||||
frames, scrolling windows, toolbars, tree controls, icons,
|
||||
device contexts, printing, splitter windows and so on, there
|
||||
are wrappers for common file operations, and facilities for
|
||||
writing TCP/IP applications, thread handling, and more.
|
||||
In addition to common and advanced GUI facilities such as frames,
|
||||
scrolling windows, toolbars, tree controls, icons, device contexts,
|
||||
printing, splitter windows and so on, there are wrappers for common
|
||||
file operations, and facilities for writing TCP/IP applications,
|
||||
thread handling, and more.
|
||||
|
||||
A detailed reference manual including in-depth overviews for various
|
||||
topics is supplied in various formats and can be accessed online at
|
||||
http://docs.wxwidgets.org/
|
||||
|
||||
|
||||
Note about naming: while 2.9.1 is called a "development" release,
|
||||
this only means that API is not guaranteed to remain unchanged in
|
||||
the subsequent 2.9.x releases, unlike in the stable 2.8.x branch. We
|
||||
believe the current version is stable and suitable for use in
|
||||
production environment.
|
||||
|
||||
Where certain features are not available on a platform, such
|
||||
as MDI under Unix and OS X, they are emulated.
|
||||
|
||||
A detailed reference manual including in-depth overviews for
|
||||
various topics is supplied in various formats and can be
|
||||
accessed online.
|
||||
|
||||
Changes in this release
|
||||
-----------------------
|
||||
|
||||
Please see changes.txt and "Changes since 2.8" in the manual
|
||||
for details.
|
||||
This release contains several years worth of improvements compared
|
||||
to 2.8 version. Notably, Unicode support has been completely
|
||||
overhauled and made much easier to use. Debugging support, including
|
||||
when using a release build of the library, was much improved making
|
||||
it less likely that you use the library incorrectly. Many new GUI
|
||||
and base classes have been added or improved.
|
||||
|
||||
Please see the file docs/changes.txt for more details and make sure
|
||||
to read the section "Incompatible changes since 2.8" if you upgrade
|
||||
from a previous wxWidgets release.
|
||||
|
||||
This release introduces many important changes and we are looking
|
||||
forward to your feedback about them. In particular please let us
|
||||
know about any regressions compared to the previous versions (see
|
||||
the section "Bug reporting" below) so that we could fix them before
|
||||
3.0 release.
|
||||
|
||||
|
||||
Platforms supported
|
||||
-------------------
|
||||
|
||||
wxWidgets currently supports the following platforms:
|
||||
wxWidgets currently supports the following primary platforms:
|
||||
|
||||
- Windows 95/98/ME, NT, 2000, XP, Vista, Pocket PC/Mobile, Smartphone
|
||||
- Most Unix variants using the GTK+ 2 toolkit (version 2.4 or newer)
|
||||
- MacOS OS X (10.4 or newer) using Carbon and some Cocao mix-in
|
||||
- Windows 95/98/ME, NT, 2000, XP, Vista, 7
|
||||
- Most Unix variants using the GTK+ toolkit (version 2.4 or newer)
|
||||
- Mac OS X (10.4 or newer) using either Carbon or Cocoa
|
||||
|
||||
There is some support for the followig platforms:
|
||||
There is some support for the following platforms:
|
||||
|
||||
- Most Unix variants with X11
|
||||
- Most Unix variants with Motif/Lesstif
|
||||
- Most Unix variants with GTK+ 1.2
|
||||
- MacOS 10.x using the Cocoa API
|
||||
- OS/2
|
||||
- PalmOS
|
||||
- Windows CE (Pocket PC)
|
||||
|
||||
Most popular C++ compilers are supported; see the install.txt
|
||||
file for each platform (available via docs/html/index.htm) for details.
|
||||
See also http://www.wxwidgets.org/platform.htm.
|
||||
file for each platform (available via docs/html/index.htm) and
|
||||
http://wiki.wxwidgets.org/Supported_Platforms for the most up to
|
||||
date status.
|
||||
|
||||
|
||||
Files
|
||||
-----
|
||||
@@ -52,22 +74,15 @@ Files
|
||||
The distribution is available in archive formats appropriate to the
|
||||
target system. See the download pages for details.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
wxWidgets needs to be compiled before you can test out the samples
|
||||
or write your own applications. For installation information, please
|
||||
see the install.txt file in the individual directories:
|
||||
see the install.txt file in the docs subdirectory appropriate for
|
||||
the platform you use.
|
||||
|
||||
docs/msw
|
||||
docs/gtk
|
||||
docs/motif
|
||||
docs/osx
|
||||
docs/cocoa
|
||||
docs/x11
|
||||
docs/mgl
|
||||
docs/os2
|
||||
docs/palmos
|
||||
|
||||
Licence information
|
||||
-------------------
|
||||
@@ -86,7 +101,7 @@ to those writing GPL'ed applications. In summary, the licence is
|
||||
LGPL plus a clause allowing unrestricted distribution of
|
||||
application binaries. To answer a FAQ, you don't have to
|
||||
distribute any source if you wish to write commercial
|
||||
applications using wxWidgets.
|
||||
applications using wxWidgets.
|
||||
|
||||
However, if you distribute wxGTK or wxMotif (with Lesstif)
|
||||
version of your application, don't forget that it is linked
|
||||
@@ -97,7 +112,7 @@ against LGPL glibc as well. Please read carefully LGPL, section
|
||||
applications linked against LGPL library. Basically you should
|
||||
link dynamically and include source code of LGPL libraries with
|
||||
your product (unless it is already present in user's system -
|
||||
like glibc usually is).
|
||||
like glibc usually is).
|
||||
|
||||
If you use TIFF image handler, please see src/tiff/COPYRIGHT
|
||||
for libtiff licence details.
|
||||
@@ -113,14 +128,18 @@ file for Henry Spencer's regular expression library copyright.
|
||||
|
||||
If you use wxXML classes or XRC, see src/expat/COPYING for licence details.
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
See docs/html/index.htm for an HTML index of the major documents.
|
||||
wxWidgets documentation is available online at
|
||||
http://docs.wxwidgets.org/2.9.1/ and can also be downloaded in HTML
|
||||
format. To generate documentation in other formats (PDF, CHM, ...)
|
||||
please use the scripts in docs/doxygen directory.
|
||||
|
||||
See docs/changes.txt for a summary of changes to wxWidgets.
|
||||
|
||||
See docs/tech for an archive of technical notes.
|
||||
Bug reporting
|
||||
-------------
|
||||
|
||||
The wxWidgets bug tracker can be browsed at:
|
||||
|
||||
@@ -135,10 +154,6 @@ it. We also give much higher priority to bug reports with patches
|
||||
fixing the problems so this ensures that your report will be
|
||||
addressed sooner.
|
||||
|
||||
The Windows HTML Help files are located in docs/htmlhelp.
|
||||
The Windows Help files are located in docs/winhelp.
|
||||
The PDF help files are located in docs/pdf.
|
||||
The HTB (wxWidgets HTML Help) files are located in docs/htb.
|
||||
|
||||
Further information
|
||||
-------------------
|
||||
@@ -158,5 +173,5 @@ web site.
|
||||
|
||||
Have fun!
|
||||
|
||||
The wxWidgets Team, January 2007
|
||||
The wxWidgets Team, July 2010
|
||||
|
||||
|
@@ -3253,11 +3253,19 @@ protected:
|
||||
// validators.
|
||||
virtual bool TryBefore(wxEvent& event);
|
||||
|
||||
// this one is not a hook but just a helper which looks up the handler in
|
||||
// this object itself called from ProcessEventLocally() and normally
|
||||
// shouldn't be called directly as doing it would ignore any chained event
|
||||
// handlers
|
||||
bool TryHere(wxEvent& event);
|
||||
// This one is not a hook but just a helper which looks up the handler in
|
||||
// this object itself.
|
||||
//
|
||||
// It is called from ProcessEventLocally() and normally shouldn't be called
|
||||
// directly as doing it would ignore any chained event handlers
|
||||
bool TryHereOnly(wxEvent& event);
|
||||
|
||||
// Another helper which simply calls pre-processing hook and then tries to
|
||||
// handle the event at this handler level.
|
||||
bool TryBeforeAndHere(wxEvent& event)
|
||||
{
|
||||
return TryBefore(event) || TryHereOnly(event);
|
||||
}
|
||||
|
||||
// this one is called after failing to find the event handle in our own
|
||||
// table to give a chance to the other windows to process it
|
||||
|
@@ -2546,6 +2546,9 @@ void wxAuiManager::Update()
|
||||
style |= wxRESIZE_BORDER;
|
||||
p.frame->SetWindowStyleFlag(style);
|
||||
|
||||
if (p.frame->GetLabel() != p.caption)
|
||||
p.frame->SetLabel(p.caption);
|
||||
|
||||
if (p.frame->IsShown() != p.IsShown())
|
||||
p.frame->Show(p.IsShown());
|
||||
}
|
||||
|
@@ -1379,7 +1379,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
|
||||
// Short circuit the event processing logic if we're requested to process
|
||||
// this event in this handler only, see DoTryChain() for more details.
|
||||
if ( event.ShouldProcessOnlyIn(this) )
|
||||
return TryHere(event);
|
||||
return TryBeforeAndHere(event);
|
||||
|
||||
|
||||
// Try to process the event in this handler itself.
|
||||
@@ -1406,23 +1406,11 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
|
||||
|
||||
bool wxEvtHandler::ProcessEventLocally(wxEvent& event)
|
||||
{
|
||||
// First try the hooks which should be called before our own handlers
|
||||
if ( TryBefore(event) )
|
||||
return true;
|
||||
|
||||
// Then try this handler itself, notice that we should not call
|
||||
// ProcessEvent() on this one as we're already called from it, which
|
||||
// explains why we do it here and not in DoTryChain()
|
||||
if ( TryHere(event) )
|
||||
return true;
|
||||
|
||||
// Finally try the event handlers chained to this one,
|
||||
if ( DoTryChain(event) )
|
||||
return true;
|
||||
|
||||
// And return false to indicate that we didn't find any handler at this
|
||||
// level.
|
||||
return false;
|
||||
// Try the hooks which should be called before our own handlers and this
|
||||
// handler itself first. Notice that we should not call ProcessEvent() on
|
||||
// this one as we're already called from it, which explains why we do it
|
||||
// here and not in DoTryChain()
|
||||
return TryBeforeAndHere(event) || DoTryChain(event);
|
||||
}
|
||||
|
||||
bool wxEvtHandler::DoTryChain(wxEvent& event)
|
||||
@@ -1434,7 +1422,7 @@ bool wxEvtHandler::DoTryChain(wxEvent& event)
|
||||
// ProcessEvent() from which we were called or will be done by it when
|
||||
// we return.
|
||||
//
|
||||
// However we must call ProcessEvent() and not TryHere() because the
|
||||
// However we must call ProcessEvent() and not TryHereOnly() because the
|
||||
// existing code (including some in wxWidgets itself) expects the
|
||||
// overridden ProcessEvent() in its custom event handlers pushed on a
|
||||
// window to be called.
|
||||
@@ -1478,7 +1466,7 @@ bool wxEvtHandler::DoTryChain(wxEvent& event)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxEvtHandler::TryHere(wxEvent& event)
|
||||
bool wxEvtHandler::TryHereOnly(wxEvent& event)
|
||||
{
|
||||
// If the event handler is disabled it doesn't process any events
|
||||
if ( !GetEvtHandlerEnabled() )
|
||||
|
@@ -822,6 +822,37 @@ struct wxGtkIMData
|
||||
}
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
// Send wxEVT_CHAR_HOOK event to the parent of the window and if it wasn't
|
||||
// processed, send wxEVT_CHAR to the window itself. Return true if either of
|
||||
// them was handled.
|
||||
bool
|
||||
SendCharHookAndCharEvents(const wxKeyEvent& event, wxWindow *win)
|
||||
{
|
||||
// wxEVT_CHAR_HOOK must be sent to the top level parent window to allow it
|
||||
// to handle key events in all of its children.
|
||||
wxWindow * const parent = wxGetTopLevelParent(win);
|
||||
if ( parent )
|
||||
{
|
||||
// We need to make a copy of the event object because it is
|
||||
// modified while it's handled, notably its WasProcessed() flag
|
||||
// is set after it had been processed once.
|
||||
wxKeyEvent eventCharHook(event);
|
||||
eventCharHook.SetEventType(wxEVT_CHAR_HOOK);
|
||||
if ( parent->HandleWindowEvent(eventCharHook) )
|
||||
return true;
|
||||
}
|
||||
|
||||
// As above, make a copy of the event first.
|
||||
wxKeyEvent eventChar(event);
|
||||
eventChar.SetEventType(wxEVT_CHAR);
|
||||
return win->HandleWindowEvent(eventChar);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
extern "C" {
|
||||
static gboolean
|
||||
gtk_window_key_press_callback( GtkWidget *WXUNUSED(widget),
|
||||
@@ -938,21 +969,7 @@ gtk_window_key_press_callback( GtkWidget *WXUNUSED(widget),
|
||||
#endif
|
||||
}
|
||||
|
||||
// Implement OnCharHook by checking ancestor top level windows
|
||||
wxWindow *parent = win;
|
||||
while (parent && !parent->IsTopLevel())
|
||||
parent = parent->GetParent();
|
||||
if (parent)
|
||||
{
|
||||
event.SetEventType( wxEVT_CHAR_HOOK );
|
||||
ret = parent->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
event.SetEventType(wxEVT_CHAR);
|
||||
ret = win->HandleWindowEvent( event );
|
||||
}
|
||||
ret = SendCharHookAndCharEvents(event, win);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -984,13 +1001,6 @@ gtk_wxwindow_commit_cb (GtkIMContext * WXUNUSED(context),
|
||||
if( data.empty() )
|
||||
return;
|
||||
|
||||
bool ret = false;
|
||||
|
||||
// Implement OnCharHook by checking ancestor top level windows
|
||||
wxWindow *parent = window;
|
||||
while (parent && !parent->IsTopLevel())
|
||||
parent = parent->GetParent();
|
||||
|
||||
for( wxString::const_iterator pstr = data.begin(); pstr != data.end(); ++pstr )
|
||||
{
|
||||
#if wxUSE_UNICODE
|
||||
@@ -1018,17 +1028,7 @@ gtk_wxwindow_commit_cb (GtkIMContext * WXUNUSED(context),
|
||||
#endif
|
||||
}
|
||||
|
||||
if (parent)
|
||||
{
|
||||
event.SetEventType( wxEVT_CHAR_HOOK );
|
||||
ret = parent->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
event.SetEventType(wxEVT_CHAR);
|
||||
ret = window->HandleWindowEvent( event );
|
||||
}
|
||||
SendCharHookAndCharEvents(event, window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2716,9 +2716,14 @@ LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM w
|
||||
// trace all messages: useful for the debugging but noticeably slows down
|
||||
// the code so don't do it by default
|
||||
#if wxDEBUG_LEVEL >= 2
|
||||
// notice that we cast wParam and lParam to long to avoid mismatch with
|
||||
// format specifiers in 64 bit builds where they are both int64 quantities
|
||||
//
|
||||
// casting like this loses information, of course, but it shouldn't matter
|
||||
// much for this diagnostic code and it keeps the code simple
|
||||
wxLogTrace("winmsg",
|
||||
wxT("Processing %s(hWnd=%p, wParam=%08lx, lParam=%08lx)"),
|
||||
wxGetMessageName(message), hWnd, (long)wParam, lParam);
|
||||
wxGetMessageName(message), hWnd, (long)wParam, (long)lParam);
|
||||
#endif // wxDEBUG_LEVEL >= 2
|
||||
|
||||
wxWindowMSW *wnd = wxFindWinFromHandle(hWnd);
|
||||
|
@@ -1077,9 +1077,42 @@ bool wxWidgetCocoaImpl::isFlipped(WXWidget WXUNUSED(slf), void *WXUNUSED(_cmd))
|
||||
|
||||
void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd))
|
||||
{
|
||||
// preparing the update region
|
||||
|
||||
wxRegion updateRgn;
|
||||
const NSRect *rects;
|
||||
NSInteger count;
|
||||
|
||||
[slf getRectsBeingDrawn:&rects count:&count];
|
||||
for ( int i = 0 ; i < count ; ++i )
|
||||
{
|
||||
updateRgn.Union(wxFromNSRect(slf, rects[i]));
|
||||
}
|
||||
|
||||
wxWindow* wxpeer = GetWXPeer();
|
||||
|
||||
if ( wxpeer->MacGetLeftBorderSize() != 0 || wxpeer->MacGetTopBorderSize() != 0 )
|
||||
{
|
||||
// as this update region is in native window locals we must adapt it to wx window local
|
||||
updateRgn.Offset( wxpeer->MacGetLeftBorderSize() , wxpeer->MacGetTopBorderSize() );
|
||||
}
|
||||
|
||||
if ( wxpeer->MacGetTopLevelWindow()->GetWindowStyle() & wxFRAME_SHAPED )
|
||||
{
|
||||
int xoffset = 0, yoffset = 0;
|
||||
wxRegion rgn = wxpeer->MacGetTopLevelWindow()->GetShape();
|
||||
wxpeer->MacRootWindowToWindow( &xoffset, &yoffset );
|
||||
rgn.Offset( xoffset, yoffset );
|
||||
updateRgn.Intersect(rgn);
|
||||
}
|
||||
|
||||
wxpeer->GetUpdateRegion() = updateRgn;
|
||||
|
||||
// setting up the drawing context
|
||||
|
||||
CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
|
||||
CGContextSaveGState( context );
|
||||
|
||||
|
||||
#if OSX_DEBUG_DRAWING
|
||||
CGContextBeginPath( context );
|
||||
CGContextMoveToPoint(context, 0, 0);
|
||||
@@ -1094,34 +1127,13 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd))
|
||||
CGContextClosePath( context );
|
||||
CGContextStrokePath(context);
|
||||
#endif
|
||||
|
||||
|
||||
if ( !m_isFlipped )
|
||||
{
|
||||
CGContextTranslateCTM( context, 0, [m_osxView bounds].size.height );
|
||||
CGContextScaleCTM( context, 1, -1 );
|
||||
}
|
||||
|
||||
wxRegion updateRgn;
|
||||
const NSRect *rects;
|
||||
NSInteger count;
|
||||
|
||||
[slf getRectsBeingDrawn:&rects count:&count];
|
||||
for ( int i = 0 ; i < count ; ++i )
|
||||
{
|
||||
updateRgn.Union(wxFromNSRect(slf, rects[i]));
|
||||
}
|
||||
|
||||
wxWindow* wxpeer = GetWXPeer();
|
||||
if ( wxpeer->MacGetTopLevelWindow()->GetWindowStyle() & wxFRAME_SHAPED )
|
||||
{
|
||||
int xoffset = 0, yoffset = 0;
|
||||
wxRegion rgn = wxpeer->MacGetTopLevelWindow()->GetShape();
|
||||
wxpeer->MacRootWindowToWindow( &xoffset, &yoffset );
|
||||
rgn.Offset( xoffset, yoffset );
|
||||
updateRgn.Intersect(rgn);
|
||||
}
|
||||
|
||||
wxpeer->GetUpdateRegion() = updateRgn;
|
||||
wxpeer->MacSetCGContextRef( context );
|
||||
|
||||
bool handled = wxpeer->MacDoRedraw( 0 );
|
||||
|
@@ -196,14 +196,30 @@ void VarArgTestCase::ArgsValidation()
|
||||
wxString::Format("a string(%s,%s), ptr %p, int %i",
|
||||
wxString(), "foo", "char* as pointer", 1);
|
||||
|
||||
#if !wxCHECK_VISUALC_VERSION(8)
|
||||
// Microsoft has helpfully disabled support for "%n" in their CRT by
|
||||
// default starting from VC8 and somehow even calling
|
||||
// _set_printf_count_output() doesn't help here, so just disable this test
|
||||
// for it.
|
||||
// _set_printf_count_output() doesn't help here, so don't use "%n" at all
|
||||
// with it.
|
||||
#if wxCHECK_VISUALC_VERSION(8)
|
||||
#define wxNO_PRINTF_PERCENT_N
|
||||
#endif // VC8+
|
||||
|
||||
// Similarly, many modern Linux distributions ship with g++ that uses
|
||||
// -D_FORTIFY_SOURCE=2 flag by default and this option prevents "%n" from
|
||||
// being used in a string outside of read-only memory, meaning that it
|
||||
// can't be used in wxString to which we (may, depending on build options)
|
||||
// assign it, so also disable testing of "%n" in this case lest we die with
|
||||
// an abort inside vswprintf().
|
||||
#if defined(_FORTIFY_SOURCE)
|
||||
#if _FORTIFY_SOURCE >= 2
|
||||
#define wxNO_PRINTF_PERCENT_N
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef wxNO_PRINTF_PERCENT_N
|
||||
wxString::Format("foo%i%n", 42, &written);
|
||||
CPPUNIT_ASSERT_EQUAL( 5, written );
|
||||
#endif // VC8+
|
||||
#endif
|
||||
|
||||
// but these are not:
|
||||
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%i: too many arguments", 42, 1, 2, 3) );
|
||||
@@ -212,6 +228,8 @@ void VarArgTestCase::ArgsValidation()
|
||||
|
||||
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%d", ptr) );
|
||||
|
||||
// we don't check wxNO_PRINTF_PERCENT_N here as these expressions should
|
||||
// result in an assert in our code before the CRT functions are even called
|
||||
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("foo%i%n", &written) );
|
||||
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("foo%n", ptr) );
|
||||
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("foo%i%n", 42, &swritten) );
|
||||
|
Reference in New Issue
Block a user