Merge branch 'travis-toolkits' of https://github.com/MaartenBent/wxWidgets
Test all the 2nd (and even 3rd) tier ports on Travis CI too: run builds using wxX11, wxQt, wxDFB and even wxMotif. See https://github.com/wxWidgets/wxWidgets/pull/922
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/apptrait.h"
|
||||
#include "wx/thread.h"
|
||||
#include "wx/private/fdiodispatcher.h"
|
||||
#include "wx/dfb/private.h"
|
||||
@@ -215,3 +216,8 @@ void wxGUIEventLoop::DoYieldFor(long eventsToProcess)
|
||||
|
||||
wxEventLoopBase::DoYieldFor(eventsToProcess);
|
||||
}
|
||||
|
||||
wxEventLoopSourcesManagerBase* wxGUIAppTraits::GetEventLoopSourcesManager()
|
||||
{
|
||||
return wxAppTraits::GetEventLoopSourcesManager();
|
||||
}
|
||||
|
||||
@@ -38,6 +38,13 @@ typedef wxFontMgrFontRefData wxFontRefData;
|
||||
// wxFont
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxFont::wxFont(const wxString& nativeFontInfoString)
|
||||
{
|
||||
wxNativeFontInfo info;
|
||||
if ( info.FromString(nativeFontInfoString) )
|
||||
(void)Create(info);
|
||||
}
|
||||
|
||||
bool wxFont::Create(const wxNativeFontInfo& info)
|
||||
{
|
||||
m_refData = new wxFontRefData(info.pointSize,
|
||||
|
||||
@@ -74,6 +74,12 @@ wxRegion::wxRegion(const wxRect& r)
|
||||
m_refData = new wxRegionRefData(r);
|
||||
}
|
||||
|
||||
wxRegion::wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle)
|
||||
{
|
||||
#warning "implement this"
|
||||
m_refData = NULL;
|
||||
}
|
||||
|
||||
wxRegion::~wxRegion()
|
||||
{
|
||||
// m_refData unrefed in ~wxObject
|
||||
|
||||
@@ -312,6 +312,13 @@ void wxWindowDFB::DoReleaseMouse()
|
||||
return (wxWindow*)gs_mouseCapture;
|
||||
}
|
||||
|
||||
wxMouseState wxGetMouseState()
|
||||
{
|
||||
#warning "implement this"
|
||||
wxMouseState ms;
|
||||
return ms;
|
||||
}
|
||||
|
||||
bool wxWindowDFB::SetCursor(const wxCursor& cursor)
|
||||
{
|
||||
if ( !wxWindowBase::SetCursor(cursor) )
|
||||
|
||||
@@ -213,6 +213,13 @@ wxFont::wxFont(const wxNativeFontInfo& info)
|
||||
(void)Create(info.GetXFontName());
|
||||
}
|
||||
|
||||
wxFont::wxFont(const wxString& nativeFontInfoString)
|
||||
{
|
||||
wxNativeFontInfo info;
|
||||
if ( info.FromString(nativeFontInfoString) )
|
||||
(void)Create(info.GetXFontName());
|
||||
}
|
||||
|
||||
wxFont::wxFont(const wxFontInfo& info)
|
||||
{
|
||||
m_refData = new wxFontRefData(info);
|
||||
|
||||
@@ -20,6 +20,26 @@
|
||||
#include "wx/qt/private/utils.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
|
||||
// Older versions of QT don't define all the QFont::Weight enum values, so just
|
||||
// do it ourselves here for all case instead.
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|
||||
#define wxQFontEnumOrInt(a, b) a
|
||||
#else
|
||||
#define wxQFontEnumOrInt(a, b) b
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
wxQFont_Thin = wxQFontEnumOrInt( QFont::Thin, 0 ),
|
||||
wxQFont_ExtraLight = wxQFontEnumOrInt( QFont::ExtraLight, 12 ),
|
||||
wxQFont_Light = QFont::Light,
|
||||
wxQFont_Normal = QFont::Normal,
|
||||
wxQFont_Medium = wxQFontEnumOrInt( QFont::Medium, 57 ),
|
||||
wxQFont_DemiBold = QFont::DemiBold,
|
||||
wxQFont_Bold = QFont::Bold,
|
||||
wxQFont_ExtraBold = wxQFontEnumOrInt( QFont::ExtraBold, 81 ),
|
||||
wxQFont_Black = QFont::Black
|
||||
};
|
||||
|
||||
static QFont::StyleHint ConvertFontFamily(wxFontFamily family)
|
||||
{
|
||||
@@ -70,34 +90,34 @@ static bool TryToMap(int& x, int fromMin, int fromMax, int toMin, int toMax)
|
||||
|
||||
static int ConvertFontWeight(int w)
|
||||
{
|
||||
// Note that QFont::Thin is 0, so we can't have anything lighter than it.
|
||||
// Note that wxQFont_Thin is 0, so we can't have anything lighter than it.
|
||||
if ( TryToMap(w, wxFONTWEIGHT_INVALID, wxFONTWEIGHT_THIN,
|
||||
QFont::Thin, QFont::Thin) ||
|
||||
wxQFont_Thin, wxQFont_Thin) ||
|
||||
TryToMap(w, wxFONTWEIGHT_THIN, wxFONTWEIGHT_EXTRALIGHT,
|
||||
QFont::Thin, QFont::ExtraLight) ||
|
||||
wxQFont_Thin, wxQFont_ExtraLight) ||
|
||||
TryToMap(w, wxFONTWEIGHT_EXTRALIGHT, wxFONTWEIGHT_LIGHT,
|
||||
QFont::ExtraLight, QFont::Light) ||
|
||||
wxQFont_ExtraLight, wxQFont_Light) ||
|
||||
TryToMap(w, wxFONTWEIGHT_LIGHT, wxFONTWEIGHT_NORMAL,
|
||||
QFont::Light, QFont::Normal) ||
|
||||
wxQFont_Light, wxQFont_Normal) ||
|
||||
TryToMap(w, wxFONTWEIGHT_NORMAL, wxFONTWEIGHT_MEDIUM,
|
||||
QFont::Normal, QFont::Medium) ||
|
||||
wxQFont_Normal, wxQFont_Medium) ||
|
||||
TryToMap(w, wxFONTWEIGHT_MEDIUM, wxFONTWEIGHT_SEMIBOLD,
|
||||
QFont::Medium, QFont::DemiBold) ||
|
||||
wxQFont_Medium, wxQFont_DemiBold) ||
|
||||
TryToMap(w, wxFONTWEIGHT_SEMIBOLD, wxFONTWEIGHT_BOLD,
|
||||
QFont::DemiBold, QFont::Bold) ||
|
||||
wxQFont_DemiBold, wxQFont_Bold) ||
|
||||
TryToMap(w, wxFONTWEIGHT_BOLD, wxFONTWEIGHT_EXTRABOLD,
|
||||
QFont::Bold, QFont::ExtraBold) ||
|
||||
wxQFont_Bold, wxQFont_ExtraBold) ||
|
||||
TryToMap(w, wxFONTWEIGHT_EXTRABOLD, wxFONTWEIGHT_HEAVY,
|
||||
QFont::ExtraBold, QFont::Black) ||
|
||||
wxQFont_ExtraBold, wxQFont_Black) ||
|
||||
TryToMap(w, wxFONTWEIGHT_HEAVY, wxFONTWEIGHT_EXTRAHEAVY,
|
||||
QFont::Black, 99) )
|
||||
wxQFont_Black, 99) )
|
||||
{
|
||||
return w;
|
||||
}
|
||||
|
||||
wxFAIL_MSG("invalid wxFont weight");
|
||||
|
||||
return QFont::Normal;
|
||||
return wxQFont_Normal;
|
||||
}
|
||||
|
||||
class wxFontRefData: public wxGDIRefData
|
||||
@@ -354,27 +374,27 @@ int wxNativeFontInfo::GetNumericWeight() const
|
||||
{
|
||||
int w = m_qtFont.weight();
|
||||
|
||||
// Special case of QFont::Thin == 0.
|
||||
if ( w == QFont::Thin )
|
||||
// Special case of wxQFont_Thin == 0.
|
||||
if ( w == wxQFont_Thin )
|
||||
return wxFONTWEIGHT_THIN;
|
||||
|
||||
if ( TryToMap(w, QFont::Thin, QFont::ExtraLight,
|
||||
if ( TryToMap(w, wxQFont_Thin, wxQFont_ExtraLight,
|
||||
wxFONTWEIGHT_THIN, wxFONTWEIGHT_EXTRALIGHT) ||
|
||||
TryToMap(w, QFont::ExtraLight, QFont::Light,
|
||||
TryToMap(w, wxQFont_ExtraLight, wxQFont_Light,
|
||||
wxFONTWEIGHT_EXTRALIGHT, wxFONTWEIGHT_LIGHT) ||
|
||||
TryToMap(w, QFont::Light, QFont::Normal,
|
||||
TryToMap(w, wxQFont_Light, wxQFont_Normal,
|
||||
wxFONTWEIGHT_LIGHT, wxFONTWEIGHT_NORMAL) ||
|
||||
TryToMap(w, QFont::Normal, QFont::Medium,
|
||||
TryToMap(w, wxQFont_Normal, wxQFont_Medium,
|
||||
wxFONTWEIGHT_NORMAL, wxFONTWEIGHT_MEDIUM) ||
|
||||
TryToMap(w, QFont::Medium, QFont::DemiBold,
|
||||
TryToMap(w, wxQFont_Medium, wxQFont_DemiBold,
|
||||
wxFONTWEIGHT_MEDIUM, wxFONTWEIGHT_SEMIBOLD) ||
|
||||
TryToMap(w, QFont::DemiBold, QFont::Bold,
|
||||
TryToMap(w, wxQFont_DemiBold, wxQFont_Bold,
|
||||
wxFONTWEIGHT_SEMIBOLD, wxFONTWEIGHT_BOLD) ||
|
||||
TryToMap(w, QFont::Bold, QFont::ExtraBold,
|
||||
TryToMap(w, wxQFont_Bold, wxQFont_ExtraBold,
|
||||
wxFONTWEIGHT_BOLD, wxFONTWEIGHT_EXTRABOLD) ||
|
||||
TryToMap(w, QFont::ExtraBold, QFont::Black,
|
||||
TryToMap(w, wxQFont_ExtraBold, wxQFont_Black,
|
||||
wxFONTWEIGHT_EXTRABOLD, wxFONTWEIGHT_HEAVY) ||
|
||||
TryToMap(w, QFont::Black, 99,
|
||||
TryToMap(w, wxQFont_Black, 99,
|
||||
wxFONTWEIGHT_HEAVY, wxFONTWEIGHT_EXTRAHEAVY) )
|
||||
{
|
||||
return w;
|
||||
|
||||
@@ -31,9 +31,9 @@ using namespace QTest;
|
||||
|
||||
// Apparently {mouse,key}Event() functions signature has changed from QWidget
|
||||
// to QWindow at some time during Qt5, but we don't know when exactly. We do
|
||||
// know that they take QWindow for 5.3 and, presumably, later versions (but not
|
||||
// know that they take QWindow for 5.2 and, presumably, later versions (but not
|
||||
// for whichever version this code was originally written for).
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
|
||||
inline QWindow* argForEvents(QWidget* w) { return w->windowHandle(); }
|
||||
#else
|
||||
inline QWidget* argForEvents(QWidget* w) { return w; }
|
||||
|
||||
Reference in New Issue
Block a user