Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update wx to r75363 to address a wx bug that was breaking netplay on …
…OS X.
  • Loading branch information
comex committed Dec 8, 2013
1 parent 9722be0 commit 1334d7f
Show file tree
Hide file tree
Showing 185 changed files with 2,030 additions and 5,165 deletions.
3 changes: 2 additions & 1 deletion Externals/wxWidgets3/CMakeLists.txt
@@ -1,4 +1,4 @@
# gtk, msw, osx and shared files as of r74856
# gtk, msw, osx and shared files as of r75363

set(SRCS_AUI
"src/aui/auibar.cpp"
Expand Down Expand Up @@ -906,6 +906,7 @@ add_definitions(-Wno-shadow)
add_definitions(-Wno-parentheses-equality)
add_definitions(-Wno-self-assign)
add_definitions(-Wno-null-conversion)
add_definitions(-Wno-sign-compare)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98")

enable_precompiled_headers(include/wx/wxprec.h src/common/dummy.cpp SRCS)
Expand Down
2 changes: 1 addition & 1 deletion Externals/wxWidgets3/build_wx.sh
@@ -1,6 +1,6 @@
#!/bin/bash

svn co -r 74856 http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets
svn co -r 75363 http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets
cd wxWidgets

case $OSTYPE in
Expand Down
4 changes: 3 additions & 1 deletion Externals/wxWidgets3/include/msvc/wx/setup.h
Expand Up @@ -148,6 +148,9 @@
#pragma comment(lib, wxWX_LIB_NAME("base", ""))

#ifndef wxNO_NET_LIB
#ifndef WXUSINGDLL
#pragma comment(lib, "wsock32")
#endif
#pragma comment(lib, wxBASE_LIB_NAME("net"))
#endif
#ifndef wxNO_XML_LIB
Expand Down Expand Up @@ -235,7 +238,6 @@
#pragma comment(lib, "uuid")
#pragma comment(lib, "rpcrt4")
#pragma comment(lib, "advapi32")
#pragma comment(lib, "wsock32")
#if wxUSE_URL_NATIVE
#pragma comment(lib, "wininet")
#endif
Expand Down
4 changes: 2 additions & 2 deletions Externals/wxWidgets3/include/wx/bitmap.h
Expand Up @@ -175,7 +175,7 @@ class WXDLLIMPEXP_CORE wxBitmapBase : public wxGDIObject,
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) = 0;
virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) = 0;
virtual bool CreateScaled(int w, int h, int d, double logicalScale)
{ return Create(w*logicalScale,h*logicalScale,d); }
{ return Create(wxRound(w*logicalScale), wxRound(h*logicalScale), d); }

virtual int GetHeight() const = 0;
virtual int GetWidth() const = 0;
Expand All @@ -189,7 +189,7 @@ class WXDLLIMPEXP_CORE wxBitmapBase : public wxGDIObject,
virtual double GetScaledWidth() const { return GetWidth() / GetScaleFactor(); }
virtual double GetScaledHeight() const { return GetHeight() / GetScaleFactor(); }
virtual wxSize GetScaledSize() const
{ return wxSize(GetScaledWidth(), GetScaledHeight()); }
{ return wxSize(wxRound(GetScaledWidth()), wxRound(GetScaledHeight())); }

#if wxUSE_IMAGE
virtual wxImage ConvertToImage() const = 0;
Expand Down
19 changes: 16 additions & 3 deletions Externals/wxWidgets3/include/wx/buffer.h
Expand Up @@ -268,9 +268,22 @@ class wxCharTypeBuffer : public wxScopedCharTypeBuffer<T>

wxCharTypeBuffer(size_t len)
{
this->m_data =
new Data((CharType *)malloc((len + 1)*sizeof(CharType)), len);
this->m_data->Get()[len] = (CharType)0;
CharType* const str = (CharType *)malloc((len + 1)*sizeof(CharType));
if ( str )
{
str[len] = (CharType)0;

// There is a potential memory leak here if new throws because it
// fails to allocate Data, we ought to use new(nothrow) here, but
// this might fail to compile under some platforms so until this
// can be fully tested, just live with this (rather unlikely, as
// Data is a small object) potential leak.
this->m_data = new Data(str, len);
}
else
{
this->m_data = this->GetNullData();
}
}

wxCharTypeBuffer(const wxCharTypeBuffer& src)
Expand Down
5 changes: 3 additions & 2 deletions Externals/wxWidgets3/include/wx/choicdlg.h
Expand Up @@ -11,11 +11,12 @@
#ifndef _WX_CHOICDLG_H_BASE_
#define _WX_CHOICDLG_H_BASE_

#include "wx/defs.h"

#if wxUSE_CHOICEDLG

#include "wx/generic/choicdgg.h"

#endif

#endif
// _WX_CHOICDLG_H_BASE_
#endif // _WX_CHOICDLG_H_BASE_
4 changes: 2 additions & 2 deletions Externals/wxWidgets3/include/wx/combo.h
Expand Up @@ -560,7 +560,7 @@ class WXDLLIMPEXP_CORE wxComboCtrlBase : public wxControl,
// just recalculate.
void CalculateAreas( int btnWidth = 0 );

// Standard textctrl positioning routine. Just give it platform-dependant
// Standard textctrl positioning routine. Just give it platform-dependent
// textctrl coordinate adjustment.
virtual void PositionTextCtrl( int textCtrlXAdjust = 0,
int textCtrlYAdjust = 0);
Expand Down Expand Up @@ -701,7 +701,7 @@ class WXDLLIMPEXP_CORE wxComboCtrlBase : public wxControl,
// area used by the button
wxSize m_btnSize;

// platform-dependant customization and other flags
// platform-dependent customization and other flags
wxUint32 m_iFlags;

// custom style for m_text
Expand Down
33 changes: 29 additions & 4 deletions Externals/wxWidgets3/include/wx/compiler.h
Expand Up @@ -19,7 +19,7 @@
/*
Notice that Intel compiler can be used as Microsoft Visual C++ add-on and
so we should define both __INTELC__ and __VISUALC__ for it.
*/
*/
#ifdef __INTEL_COMPILER
# define __INTELC__
#endif
Expand Down Expand Up @@ -135,15 +135,40 @@
#endif

/*
This macro can be used to check that the version of mingw32 compiler is
at least maj.min
This macro can be used to check that the version of mingw32 CRT is at least
maj.min
*/

/* Check for Mingw runtime version: */
#if defined(__MINGW32_MAJOR_VERSION) && defined(__MINGW32_MINOR_VERSION)
#ifdef __MINGW32__
/* Include the header defining __MINGW32_{MAJ,MIN}OR_VERSION */
#include <_mingw.h>

#define wxCHECK_MINGW32_VERSION( major, minor ) \
( ( ( __MINGW32_MAJOR_VERSION > (major) ) \
|| ( __MINGW32_MAJOR_VERSION == (major) && __MINGW32_MINOR_VERSION >= (minor) ) ) )

/*
MinGW-w64 project provides compilers for both Win32 and Win64 but only
defines the same __MINGW32__ symbol for the former as MinGW32 toolchain
which is quite different (notably doesn't provide many SDK headers that
MinGW-w64 does include). So we define a separate symbol which, unlike the
predefined __MINGW64__, can be used to detect this toolchain in both 32 and
64 bit builds.
And define __MINGW32_TOOLCHAIN__ for consistency and also because it's
convenient as we often want to have some workarounds only for the (old)
MinGW32 but not (newer) MinGW-w64, which still predefines __MINGW32__.
*/
# ifdef __MINGW64_VERSION_MAJOR
# ifndef __MINGW64_TOOLCHAIN__
# define __MINGW64_TOOLCHAIN__
# endif
# else
# ifndef __MINGW32_TOOLCHAIN__
# define __MINGW32_TOOLCHAIN__
# endif
# endif
#else
#define wxCHECK_MINGW32_VERSION( major, minor ) (0)
#endif
Expand Down
2 changes: 2 additions & 0 deletions Externals/wxWidgets3/include/wx/dataview.h
Expand Up @@ -972,6 +972,7 @@ class WXDLLIMPEXP_ADV wxDataViewListStore: public wxDataViewIndexListModel
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = 0 );
void DeleteItem( unsigned int pos );
void DeleteAllItems();
void ClearColumns();

unsigned int GetItemCount() const;

Expand Down Expand Up @@ -1040,6 +1041,7 @@ class WXDLLIMPEXP_ADV wxDataViewListCtrl: public wxDataViewCtrl
virtual bool PrependColumn( wxDataViewColumn *col );
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
virtual bool AppendColumn( wxDataViewColumn *col );
virtual bool ClearColumns();

wxDataViewColumn *AppendTextColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
Expand Down
15 changes: 13 additions & 2 deletions Externals/wxWidgets3/include/wx/defs.h
Expand Up @@ -310,8 +310,10 @@ typedef short int WXTYPE;
inline T wx_truncate_cast_impl(X x)
{
#pragma warning(push)
/* conversion from 'X' to 'T', possible loss of data */
/* conversion from 'size_t' to 'type', possible loss of data */
#pragma warning(disable: 4267)
/* conversion from 'type1' to 'type2', possible loss of data */
#pragma warning(disable: 4242)

return x;

Expand Down Expand Up @@ -951,6 +953,10 @@ typedef wxUint16 wxWord;
#define SIZEOF_LONG 4
#endif

#ifndef SIZEOF_LONG_LONG
#define SIZEOF_LONG_LONG 8
#endif

#ifndef SIZEOF_WCHAR_T
/* Windows uses UTF-16 */
#define SIZEOF_WCHAR_T 2
Expand Down Expand Up @@ -2287,8 +2293,13 @@ enum wxStandardID
wxID_OSX_HIDE = wxID_OSX_MENU_FIRST,
wxID_OSX_HIDEOTHERS,
wxID_OSX_SHOWALL,
#if wxABI_VERSION >= 30001
wxID_OSX_SERVICES,
wxID_OSX_MENU_LAST = wxID_OSX_SERVICES,
#else
wxID_OSX_MENU_LAST = wxID_OSX_SHOWALL,

#endif

/* IDs used by generic file dialog (13 consecutive starting from this value) */
wxID_FILEDLGG = 5900,

Expand Down
24 changes: 15 additions & 9 deletions Externals/wxWidgets3/include/wx/dialog.h
Expand Up @@ -13,6 +13,7 @@

#include "wx/toplevel.h"
#include "wx/containr.h"
#include "wx/sharedptr.h"

class WXDLLIMPEXP_FWD_CORE wxSizer;
class WXDLLIMPEXP_FWD_CORE wxStdDialogButtonSizer;
Expand Down Expand Up @@ -402,24 +403,29 @@ class wxWindowModalDialogEventFunctor
{
public:
wxWindowModalDialogEventFunctor(const Functor& f)
: m_f(f), m_wasCalled(false)
: m_f(new Functor(f))
{}

void operator()(wxWindowModalDialogEvent& event)
{
if ( m_wasCalled )
if ( m_f )
{
// We only want to call this handler once. Also, by deleting
// the functor here, its data (such as wxWindowPtr pointing to
// the dialog) are freed immediately after exiting this operator().
wxSharedPtr<Functor> functor(m_f);
m_f.reset();

(*functor)(event.GetReturnCode());
}
else // was already called once
{
event.Skip();
return;
}

m_wasCalled = true;
m_f(event.GetReturnCode());
}

private:
Functor m_f;
bool m_wasCalled;
wxSharedPtr<Functor> m_f;
};

template<typename Functor>
Expand All @@ -428,7 +434,7 @@ void wxDialogBase::ShowWindowModalThenDo(const Functor& onEndModal)
Bind(wxEVT_WINDOW_MODAL_DIALOG_CLOSED,
wxWindowModalDialogEventFunctor<Functor>(onEndModal));
ShowWindowModal();
};
}
#endif // wxHAS_EVENT_BIND

#endif
Expand Down
24 changes: 22 additions & 2 deletions Externals/wxWidgets3/include/wx/docview.h
Expand Up @@ -279,6 +279,9 @@ class WXDLLIMPEXP_CORE wxView: public wxEvtHandler
// destroyed
void SetDocChildFrame(wxDocChildFrameAnyBase *docChildFrame);

// get the associated frame, may be NULL during destruction
wxDocChildFrameAnyBase* GetDocChildFrame() const { return m_docChildFrame; }

protected:
// hook the document into event handlers chain here
virtual bool TryBefore(wxEvent& event);
Expand Down Expand Up @@ -597,9 +600,10 @@ class WXDLLIMPEXP_CORE wxDocChildFrameAnyBase
m_childDocument = NULL;
m_childView = NULL;
m_win = NULL;
m_lastEvent = NULL;
}

// full ctor equivalent to using the default one and Create(0
// full ctor equivalent to using the default one and Create()
wxDocChildFrameAnyBase(wxDocument *doc, wxView *view, wxWindow *win)
{
Create(doc, view, win);
Expand Down Expand Up @@ -638,6 +642,14 @@ class WXDLLIMPEXP_CORE wxDocChildFrameAnyBase

wxWindow *GetWindow() const { return m_win; }

// implementation only

// Check if this event had been just processed in this frame.
bool HasAlreadyProcessed(wxEvent& event) const
{
return m_lastEvent == &event;
}

protected:
// we're not a wxEvtHandler but we provide this wxEvtHandler-like function
// which is called from TryBefore() of the derived classes to give our view
Expand All @@ -656,6 +668,10 @@ class WXDLLIMPEXP_CORE wxDocChildFrameAnyBase
// allows us to avoid having any virtual functions in this class
wxWindow* m_win;

private:
// Pointer to the last processed event used to avoid sending the same event
// twice to wxDocManager, from here and from wxDocParentFrameAnyBase.
wxEvent* m_lastEvent;

wxDECLARE_NO_COPY_CLASS(wxDocChildFrameAnyBase);
};
Expand Down Expand Up @@ -894,7 +910,11 @@ class WXDLLIMPEXP_CORE wxDocParentFrameAny : public BaseFrame,
// hook the document manager into event handling chain here
virtual bool TryBefore(wxEvent& event)
{
return TryProcessEvent(event) || BaseFrame::TryBefore(event);
// It is important to send the event to the base class first as
// wxMDIParentFrame overrides its TryBefore() to send the menu events
// to the currently active child frame and the child must get them
// before our own TryProcessEvent() is executed, not afterwards.
return BaseFrame::TryBefore(event) || TryProcessEvent(event);
}

private:
Expand Down
8 changes: 5 additions & 3 deletions Externals/wxWidgets3/include/wx/dvrenderers.h
Expand Up @@ -163,9 +163,7 @@ class WXDLLIMPEXP_ADV wxDataViewRendererBase: public wxObject
virtual bool IsCustomRenderer() const { return false; }


protected:
// Called from {Cancel,Finish}Editing() to cleanup m_editorCtrl
void DestroyEditControl();
// Implementation only from now on.

// Return the alignment of this renderer if it's specified (i.e. has value
// different from the default wxDVR_DEFAULT_ALIGNMENT) or the alignment of
Expand All @@ -176,6 +174,10 @@ class WXDLLIMPEXP_ADV wxDataViewRendererBase: public wxObject
// wxDVR_DEFAULT_ALIGNMENT.
int GetEffectiveAlignment() const;

protected:
// Called from {Cancel,Finish}Editing() to cleanup m_editorCtrl
void DestroyEditControl();

wxString m_variantType;
wxDataViewColumn *m_owner;
wxWeakRef<wxWindow> m_editorCtrl;
Expand Down

0 comments on commit 1334d7f

Please sign in to comment.