From e0314fa999e58a057604cdbd4bd6fdfe5248d75e Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 14 Apr 2010 15:32:12 +0300 Subject: WINSCW compile fix for WebCore WINSCW fails to parse function pointer name if it is not introduced before use. Reviewed-by: Miikka Heikkinen --- src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h b/src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h index 8eb55c1..2ad437b 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h +++ b/src/3rdparty/webkit/WebCore/bindings/js/JSDOMGlobalObject.h @@ -70,6 +70,9 @@ namespace WebCore { virtual const JSC::ClassInfo* classInfo() const { return &s_info; } static const JSC::ClassInfo s_info; + private: + static void destroyJSDOMGlobalObjectData(void*); + protected: struct JSDOMGlobalObjectData : public JSC::JSGlobalObject::JSGlobalObjectData { JSDOMGlobalObjectData(DOMWrapperWorld* world, Destructor destructor = destroyJSDOMGlobalObjectData) @@ -89,8 +92,6 @@ namespace WebCore { }; private: - static void destroyJSDOMGlobalObjectData(void*); - JSDOMGlobalObjectData* d() const { return static_cast(JSC::JSVariableObject::d); } }; -- cgit v0.12 From c16ca6d08d7e3e7a0972aa1975a72882559edb26 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Fri, 16 Apr 2010 13:53:08 +0300 Subject: WINSCW compile fix for HashMap WINSCW with templates function declarations and definitions will have to use same names for variables or you get 'undefined identifier' Reviewed-by: Miikka Heikkinen --- src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h b/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h index 09094d1..4631055 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h @@ -88,9 +88,9 @@ namespace WTF { // must have the following function members: // static unsigned hash(const T&); // static bool equal(const ValueType&, const T&); - template iterator find(const T&); - template const_iterator find(const T&) const; - template bool contains(const T&) const; + template iterator find(const TYPE&); + template const_iterator find(const TYPE&) const; + template bool contains(const TYPE&) const; // An alternate version of add() that finds the object by hashing and comparing // with some other type, to avoid the cost of type conversion if the object is already @@ -98,7 +98,7 @@ namespace WTF { // static unsigned hash(const T&); // static bool equal(const ValueType&, const T&); // static translate(ValueType&, const T&, unsigned hashCode); - template pair add(const T&, const MappedType&); + template pair add(const TYPE&, const MappedType&); void checkConsistency() const; -- cgit v0.12 From 07aa94196e5ab6827099c683c0be96edbc62e6c0 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 19 Apr 2010 18:36:56 +0300 Subject: WINSCW boolean fix for XPATH WINSCW cannot determine boolean type unless it is explicitly defined. This fix needs to be re-applied always when files are regenerated. Reviewed-by: Simon Hausmann --- src/3rdparty/webkit/WebCore/xml/XPathValue.cpp | 5 +++++ src/3rdparty/webkit/WebCore/xml/XPathValue.h | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp b/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp index 29e211e..f5acb38 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XPathValue.cpp @@ -68,7 +68,12 @@ NodeSet& Value::modifiableNodeSet() return m_data->m_nodeSet; } +#if COMPILER(WINSCW) +// FIXME --nl-- Symbian WINSCW compiler complains with 'ambiguous access to overloaded function' (double, unsigned long, unsigned int) +unsigned int Value::toBoolean() const +#else bool Value::toBoolean() const +#endif { switch (m_type) { case NodeSetValue: diff --git a/src/3rdparty/webkit/WebCore/xml/XPathValue.h b/src/3rdparty/webkit/WebCore/xml/XPathValue.h index a0cd24d..bd44c91 100644 --- a/src/3rdparty/webkit/WebCore/xml/XPathValue.h +++ b/src/3rdparty/webkit/WebCore/xml/XPathValue.h @@ -66,8 +66,11 @@ namespace WebCore { Value(Node* value) : m_type(NodeSetValue), m_bool(false), m_number(0), m_data(ValueData::create()) { m_data->m_nodeSet.append(value); } // This is needed to safely implement constructing from bool - with normal function overloading, any pointer type would match. +#if COMPILER(WINSCW) + Value(bool); +#else template Value(T); - +#endif static const struct AdoptTag {} adopt; Value(NodeSet& value, const AdoptTag&) : m_type(NodeSetValue), m_bool(false), m_number(0), m_data(ValueData::create()) { value.swap(m_data->m_nodeSet); } @@ -80,7 +83,12 @@ namespace WebCore { const NodeSet& toNodeSet() const; NodeSet& modifiableNodeSet(); +#if COMPILER(WINSCW) + // FIXME --nl-- Symbian WINSCW compiler complains with 'ambiguous access to overloaded function' (double, unsigned long, unsigned int) + unsigned int toBoolean() const; +#else bool toBoolean() const; +#endif double toNumber() const; String toString() const; @@ -90,8 +98,9 @@ namespace WebCore { double m_number; RefPtr m_data; }; - +#if !COMPILER(WINSCW) template<> +#endif inline Value::Value(bool value) : m_type(BooleanValue) , m_bool(value) -- cgit v0.12 From 0d1739197015a651b88d710c9c961eb0f20278f9 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 19 Apr 2010 18:40:08 +0300 Subject: WINSCW compiler fix, too eager to solve inlines WINSCW tries immediately solve inlines causing forward declared classes to be used before they are defined. Reviewed-by: Simon Hausmann --- src/3rdparty/webkit/WebCore/svg/SVGAnimatedPropertySynchronizer.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/svg/SVGAnimatedPropertySynchronizer.h b/src/3rdparty/webkit/WebCore/svg/SVGAnimatedPropertySynchronizer.h index ddd0493..695b71e 100644 --- a/src/3rdparty/webkit/WebCore/svg/SVGAnimatedPropertySynchronizer.h +++ b/src/3rdparty/webkit/WebCore/svg/SVGAnimatedPropertySynchronizer.h @@ -41,13 +41,15 @@ struct GetOwnerElementForType : public Noncopyable { template struct GetOwnerElementForType : public Noncopyable { - static SVGElement* ownerElement(OwnerType* type) + static SVGElement* ownerElement(OwnerType* type); +}; +template +SVGElement* GetOwnerElementForType::ownerElement(OwnerType* type) { SVGElement* context = type->contextElement(); ASSERT(context); return context; } -}; // IsDerivedFromSVGElement implementation template -- cgit v0.12 From cc26a3ec5c6bfde206c7354f87bebd36b70e1205 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 19 Apr 2010 18:45:41 +0300 Subject: Remove overloaded placement new operators WINSCW and Sun OS build fix. placement new is already defined in NonCopyable, no need for overloading. Reviewed-by: Simon Hausmann --- src/3rdparty/webkit/JavaScriptCore/runtime/UStringImpl.h | 1 - src/3rdparty/webkit/WebCore/platform/text/StringImpl.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UStringImpl.h b/src/3rdparty/webkit/JavaScriptCore/runtime/UStringImpl.h index 4dccb25..065443a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/UStringImpl.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UStringImpl.h @@ -58,7 +58,6 @@ protected: }; using Noncopyable::operator new; - void* operator new(size_t, void* inPlace) { return inPlace; } // For SmallStringStorage, which allocates an array and uses an in-place new. UStringOrRopeImpl() { } diff --git a/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h b/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h index 81cd149..9a62cba 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h +++ b/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h @@ -249,7 +249,6 @@ public: private: using Noncopyable::operator new; - void* operator new(size_t, void* inPlace) { ASSERT(inPlace); return inPlace; } static PassRefPtr createStrippingNullCharactersSlowCase(const UChar*, unsigned length); -- cgit v0.12 From 803c20871ca3d8fee85ffaca358474cc0a084962 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 19 Apr 2010 10:52:11 +0200 Subject: QtWebKit: Remove translatable strings from tests/hybridPixmap. Reviewed-by: TrustMe --- src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui index 4f2b3b8..ae5e0b5 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui +++ b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui @@ -11,7 +11,7 @@ - Widget + Widget @@ -28,7 +28,7 @@ - + @@ -47,21 +47,21 @@ - Image from Qt to HTML + Image from Qt to HTML - Pixmap from Qt to HTML + Pixmap from Qt to HTML - + -- cgit v0.12 From 594f81c553d52901209c079e2887fb13990ecba4 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 19 Apr 2010 16:26:35 +0200 Subject: QtWebKit: Fixes compilation on MSVC 64 This patch should be overwritten by the next import of QtWebKit trunk Reviewed-by: TrustMe --- src/3rdparty/webkit/WebCore/platform/text/TextStream.cpp | 2 +- src/3rdparty/webkit/WebCore/platform/text/TextStream.h | 2 +- src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/platform/text/TextStream.cpp b/src/3rdparty/webkit/WebCore/platform/text/TextStream.cpp index baaa8b9..ab73891 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/TextStream.cpp +++ b/src/3rdparty/webkit/WebCore/platform/text/TextStream.cpp @@ -108,7 +108,7 @@ String TextStream::release() return String::adopt(m_text); } -#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && CPU(X86_64) && COMPILER(MSVC) TextStream& TextStream::operator<<(__int64 i) { char buffer[printBufferSize]; diff --git a/src/3rdparty/webkit/WebCore/platform/text/TextStream.h b/src/3rdparty/webkit/WebCore/platform/text/TextStream.h index dfaa048..1225505 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/TextStream.h +++ b/src/3rdparty/webkit/WebCore/platform/text/TextStream.h @@ -45,7 +45,7 @@ public: TextStream& operator<<(const char*); TextStream& operator<<(void*); TextStream& operator<<(const String&); -#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && CPU(X86_64) && COMPILER(MSVC) TextStream& operator<<(unsigned __int64); TextStream& operator<<(__int64); #endif diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp index 01e425f..9d869ab 100644 --- a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp @@ -140,7 +140,7 @@ static BYTE* endPaint; typedef HDC (WINAPI *PtrBeginPaint)(HWND, PAINTSTRUCT*); typedef BOOL (WINAPI *PtrEndPaint)(HWND, const PAINTSTRUCT*); -#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && CPU(X86_64) && COMPILER(MSVC) extern "C" HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint); extern "C" BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint); #endif @@ -978,7 +978,7 @@ bool PluginView::platformStart() // Calling SetWindowLongPtrA here makes the window proc ASCII, which is required by at least // the Shockwave Director plug-in. -#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && CPU(X86_64) && COMPILER(MSVC) ::SetWindowLongPtrA(platformPluginWidget(), GWLP_WNDPROC, (LONG_PTR)DefWindowProcA); #elif OS(WINCE) ::SetWindowLong(platformPluginWidget(), GWL_WNDPROC, (LONG)DefWindowProc); -- cgit v0.12 From 11dad6b10cbf4f3727e03669cfa04a623f1b6308 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 21 Apr 2010 10:00:32 +0200 Subject: Default (Parentless) QMenuBar actions do not work (without autotest) This bug is a bit nasty. The problem is that Cocoa is trying to be smart behind our back, and enable/disable menu items depending on the menu item targets. But in Qt, we have a different policy that Cocoa on when a menu bar should be disabled or not. E.g. we allow a modal dialog to access the application menu bar if it is the only window on screen. This patch will work around cocoa being smart by setting the menu item targets dynamically, depending on the modal state of Qt. Setting it to nil will make the items enabled when there is a modal dialog on screen, and setting it to the menu loader will enable it when there is _no_ window on screen at all. Task-number: QTBUG-9209 Reviewed-by: prasanth --- src/gui/widgets/qmenu_mac.mm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 6a0eb53..7645c23 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -665,6 +665,7 @@ void qt_mac_set_modal_state_helper_recursive(OSMenuRef menu, OSMenuRef merge, bo } } #else + bool modalWindowOnScreen = qApp->activeModalWidget() != 0; for (NSMenuItem *item in [menu itemArray]) { OSMenuRef submenu = [item submenu]; if (submenu != merge) { @@ -674,10 +675,20 @@ void qt_mac_set_modal_state_helper_recursive(OSMenuRef menu, OSMenuRef merge, bo // The item should follow what the QAction has. if ([item tag]) { QAction *action = reinterpret_cast([item tag]); - syncNSMenuItemEnabled(item, action->isEnabled()); - } else { - syncNSMenuItemEnabled(item, YES); - } + syncNSMenuItemEnabled(item, action->isEnabled()); + } else { + syncNSMenuItemEnabled(item, YES); + } + // We sneak in some extra code here to handle a menu problem: + // If there is no window on screen, we cannot set 'nil' as + // menu item target, because then cocoa will disable the item + // (guess it assumes that there will be no first responder to + // catch the trigger anyway?) OTOH, If we have a modal window, + // then setting the menu loader as target will make cocoa not + // deliver the trigger because the loader is then seen as modally + // shaddowed). So either way there are shortcomings. Instead, we + // decide the target as late as possible: + [item setTarget:modalWindowOnScreen ? nil : getMenuLoader()]; } else { syncNSMenuItemEnabled(item, NO); } -- cgit v0.12 From fcba9ea8c646f1f3ed7e8b8c75bb841f9116ee7d Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 21 Apr 2010 12:47:29 +0200 Subject: Cocoa: cocoa sometimes show a hidden window If we tell the only window in an app to hide, deactivate the app, and then activate it again, the window will show on screen (and be unresponsive). The reason is that cocoa still sees the window as the main window (and I cannot find a way to tell cocoa otherwise). This patch works around the problem by hiding the window again if it becomes main while being hidden. Reviewed-by: msorvig --- src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index ec00915..e94d247 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -101,6 +101,17 @@ QT_END_NAMESPACE return !(isPopup || isToolTip || isTool); } +- (void)becomeMainWindow +{ + [super becomeMainWindow]; + // Cocoa sometimes tell a hidden window to become the + // main window (and as such, show it). This can e.g + // happend when the application gets activated. If + // this is the case, we tell it to hide again: + if (![self isVisible]) + [self orderOut:self]; +} + - (void)toggleToolbarShown:(id)sender { macSendToolbarChangeEvent([self QT_MANGLE_NAMESPACE(qt_qwidget)]); -- cgit v0.12