summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-09-07 09:55:37 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-09-07 09:55:37 (GMT)
commitf27ed1a26d0b68594f13f79be4806b40e489ce14 (patch)
tree1c58a8a813c9f398a36098b6517eadbe2f47498c /src
parent1cac9a68bab207cab3fd3790baec4569a0acd385 (diff)
parent6b7330ee075a62138f005492a6448059106554af (diff)
downloadQt-f27ed1a26d0b68594f13f79be4806b40e489ce14.zip
Qt-f27ed1a26d0b68594f13f79be4806b40e489ce14.tar.gz
Qt-f27ed1a26d0b68594f13f79be4806b40e489ce14.tar.bz2
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt into 4.6
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/bytecode/Instruction.h1
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.cpp2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp33
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h1
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/parser/NodeConstructors.h17
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/parser/ParserArena.cpp18
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp57
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObject.h1
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/PropertyNameArray.h1
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Protect.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp8
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.cpp6
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h5
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/HashSet.h10
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/MainThread.h4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h29
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/RefPtrHashMap.h106
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/TypeTraits.h40
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h23
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/npapi.h3
-rw-r--r--src/3rdparty/webkit/WebCore/dom/ExceptionCode.h2
-rw-r--r--src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.h2
-rw-r--r--src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/editing/EditorInsertAction.h2
-rw-r--r--src/3rdparty/webkit/WebCore/editing/markup.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.h2
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLParser.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/loader/DocumentLoader.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/loader/FrameLoader.h2
-rw-r--r--src/3rdparty/webkit/WebCore/loader/FrameLoaderTypes.h2
-rw-r--r--src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheGroup.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/loader/archive/ArchiveFactory.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/loader/archive/ArchiveResource.cpp6
-rw-r--r--src/3rdparty/webkit/WebCore/loader/icon/IconDatabase.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/page/DOMWindow.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/page/animation/AnimationBase.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/PlatformKeyboardEvent.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/ScrollTypes.h4
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/BitmapImage.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/image-decoders/ImageDecoder.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/ProtectionSpace.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/ResourceHandleClient.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/ResourceRequestBase.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/text/StringImpl.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/text/TextCodec.h2
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/PluginQuirkSet.h2
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/npapi.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayer.h2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderScrollbar.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderTextFragment.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/svg/SVGElement.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/workers/Worker.cpp2
-rw-r--r--src/corelib/arch/qatomic_windows.h49
-rw-r--r--src/corelib/arch/x86_64/qatomic_sun.s40
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp10
-rw-r--r--src/corelib/kernel/qobject.cpp14
-rw-r--r--src/gui/effects/qgraphicseffect.cpp1
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp36
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp6
-rw-r--r--src/gui/graphicsview/qgraphicswidget_p.cpp164
-rw-r--r--src/gui/itemviews/qlistview.cpp4
-rw-r--r--src/gui/kernel/qevent.cpp4
-rw-r--r--src/gui/kernel/qsizepolicy.h12
-rw-r--r--src/gui/kernel/qx11embed_x11.cpp8
-rw-r--r--src/gui/painting/qdrawhelper.cpp11
-rw-r--r--src/gui/painting/qpaintbuffer.cpp101
-rw-r--r--src/gui/painting/qpaintbuffer_p.h8
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h12
-rw-r--r--src/gui/painting/qpainter.cpp68
-rw-r--r--src/gui/painting/qprinter.cpp17
-rw-r--r--src/gui/painting/qprinter.h2
-rw-r--r--src/gui/painting/qrasterizer_p.h6
-rw-r--r--src/gui/styles/qcommonstyle.cpp1
-rw-r--r--src/gui/styles/qmacstyle_mac.mm1
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp11
-rw-r--r--src/gui/text/qcssparser.cpp2
-rw-r--r--src/gui/text/qtextdocument.cpp8
-rw-r--r--src/gui/text/qtextengine.cpp33
-rw-r--r--src/gui/widgets/qdatetimeedit_p.h2
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp1
-rw-r--r--src/network/kernel/qhostinfo_p.h5
-rw-r--r--src/network/socket/qabstractsocket.cpp4
-rw-r--r--src/network/socket/qabstractsocket_p.h2
-rw-r--r--src/opengl/opengl.pro2
-rw-r--r--src/opengl/qgl.cpp82
-rw-r--r--src/opengl/qgl.h8
-rw-r--r--src/opengl/qgl_p.h21
-rw-r--r--src/opengl/qglframebufferobject.cpp37
-rw-r--r--src/opengl/qglframebufferobject.h6
-rw-r--r--src/opengl/qglpixmapfilter.cpp2
-rw-r--r--src/opengl/qgraphicsshadereffect.cpp18
-rw-r--r--src/opengl/qgraphicsshadereffect_p.h (renamed from src/opengl/qgraphicsshadereffect.h)17
-rw-r--r--src/opengl/qpixmapdata_gl.cpp4
-rw-r--r--src/opengl/qwindowsurface_gl.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp4
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp17
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.h1
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp63
-rw-r--r--src/plugins/graphicssystems/trace/qgraphicssystem_trace.cpp60
-rw-r--r--src/script/api/qscriptengineagent.cpp4
-rw-r--r--src/script/bridge/qscriptqobject.cpp2
-rw-r--r--src/sql/drivers/db2/qsql_db2.cpp5
-rw-r--r--src/svg/qsvghandler.cpp23
-rw-r--r--src/testlib/qtestmouse.h8
111 files changed, 1000 insertions, 488 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/Instruction.h b/src/3rdparty/webkit/JavaScriptCore/bytecode/Instruction.h
index eeeac6f..594c4dd 100644
--- a/src/3rdparty/webkit/JavaScriptCore/bytecode/Instruction.h
+++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/Instruction.h
@@ -32,6 +32,7 @@
#include "MacroAssembler.h"
#include "Opcode.h"
#include "Structure.h"
+#include "StructureChain.h"
#include <wtf/VectorTraits.h>
#define POLYMORPHIC_LIST_CACHE_SIZE 8
diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index ce5518f..711beb4 100644
--- a/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -521,7 +521,7 @@ PassRefPtr<LabelScope> BytecodeGenerator::newLabelScope(LabelScope::Type type, c
m_labelScopes.removeLast();
// Allocate new label scope.
- LabelScope scope(type, name, scopeDepth(), newLabel(), type == LabelScope::Loop ? newLabel() : PassRefPtr<Label>()); // Only loops have continue targets.
+ LabelScope scope(type, name, scopeDepth(), newLabel(), type == LabelScope::Loop ? newLabel() : PassRefPtr<Label>(0)); // Only loops have continue targets.
m_labelScopes.append(scope);
return &m_labelScopes.last();
}
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.cpp
index 06ddefc..29a13ca 100644
--- a/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.cpp
@@ -34,7 +34,7 @@ namespace JSC {
RegisterFile::~RegisterFile()
{
#if HAVE(MMAP)
- munmap(m_buffer, ((m_max - m_start) + m_maxGlobals) * sizeof(Register));
+ munmap(reinterpret_cast<char*>(m_buffer), ((m_max - m_start) + m_maxGlobals) * sizeof(Register));
#elif HAVE(VIRTUALALLOC)
VirtualFree(m_buffer, 0, MEM_RELEASE);
#else
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h b/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h
index 5a34d11..14e189e 100644
--- a/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h
+++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/RegisterFile.h
@@ -105,7 +105,7 @@ namespace JSC {
ReturnValueRegister = -4,
ArgumentCount = -3,
Callee = -2,
- OptionalCalleeArguments = -1,
+ OptionalCalleeArguments = -1
};
enum { ProgramCodeThisRegister = -CallFrameHeaderSize - 1 };
@@ -174,7 +174,7 @@ namespace JSC {
size_t bufferLength = (capacity + maxGlobals) * sizeof(Register);
#if HAVE(MMAP)
- m_buffer = static_cast<Register*>(mmap(0, bufferLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, VM_TAG_FOR_REGISTERFILE_MEMORY, 0));
+ m_buffer = reinterpret_cast<Register*>(mmap(0, bufferLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, VM_TAG_FOR_REGISTERFILE_MEMORY, 0));
if (m_buffer == MAP_FAILED) {
#if PLATFORM(WINCE)
fprintf(stderr, "Could not allocate register file: %d\n", GetLastError());
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
index 4a33e67..dab6682 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
@@ -285,6 +285,10 @@ void JIT::emit_op_tear_off_arguments(Instruction*)
void JIT::emit_op_ret(Instruction* currentInstruction)
{
+#ifdef QT_BUILD_SCRIPT_LIB
+ JITStubCall stubCall(this, JITStubs::cti_op_debug_return);
+ stubCall.call();
+#endif
// We could JIT generate the deref, only calling out to C when the refcount hits zero.
if (m_codeBlock->needsFullScopeChain())
JITStubCall(this, JITStubs::cti_op_ret_scopeChain).call();
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
index f0d3b84..1d39ba4 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
@@ -73,6 +73,19 @@ namespace JSC {
#define SYMBOL_STRING(name) #name
#endif
+#if PLATFORM(DARWIN)
+ // Mach-O platform
+#define HIDE_SYMBOL(name) ".private_extern _" #name
+#elif PLATFORM(AIX)
+ // IBM's own file format
+#define HIDE_SYMBOL(name) ".lglobl " #name
+#elif PLATFORM(LINUX) || PLATFORM(FREEBSD) || PLATFORM(OPENBSD) || PLATFORM(SOLARIS) || (PLATFORM(HPUX) && PLATFORM(IA64)) || PLATFORM(SYMBIAN) || PLATFORM(NETBSD)
+ // ELF platform
+#define HIDE_SYMBOL(name) ".hidden " #name
+#else
+#define HIDE_SYMBOL(name)
+#endif
+
#if COMPILER(GCC) && PLATFORM(X86)
// These ASSERTs remind you that, if you change the layout of JITStackFrame, you
@@ -83,6 +96,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, savedEBX) == 0x1c, JITStackFrame_s
asm volatile (
".globl " SYMBOL_STRING(ctiTrampoline) "\n"
+HIDE_SYMBOL(ctiTrampoline) "\n"
SYMBOL_STRING(ctiTrampoline) ":" "\n"
"pushl %ebp" "\n"
"movl %esp, %ebp" "\n"
@@ -103,6 +117,7 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n"
asm volatile (
".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
+HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
#if !USE(JIT_STUB_ARGUMENT_VA_LIST)
"movl %esp, %ecx" "\n"
@@ -118,6 +133,7 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
asm volatile (
".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
+HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
"addl $0x1c, %esp" "\n"
"popl %ebx" "\n"
@@ -141,6 +157,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, savedRBX) == 0x48, JITStackFrame_s
asm volatile (
".globl " SYMBOL_STRING(ctiTrampoline) "\n"
+HIDE_SYMBOL(ctiTrampoline) "\n"
SYMBOL_STRING(ctiTrampoline) ":" "\n"
"pushq %rbp" "\n"
"movq %rsp, %rbp" "\n"
@@ -167,6 +184,7 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n"
asm volatile (
".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
+HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
"movq %rsp, %rdi" "\n"
"call " SYMBOL_STRING(cti_vm_throw) "\n"
@@ -182,6 +200,7 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
asm volatile (
".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
+HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
"addq $0x48, %rsp" "\n"
"popq %rbx" "\n"
@@ -203,6 +222,7 @@ asm volatile (
".text" "\n"
".align 2" "\n"
".globl " SYMBOL_STRING(ctiTrampoline) "\n"
+HIDE_SYMBOL(ctiTrampoline) "\n"
".thumb" "\n"
".thumb_func " SYMBOL_STRING(ctiTrampoline) "\n"
SYMBOL_STRING(ctiTrampoline) ":" "\n"
@@ -229,6 +249,7 @@ asm volatile (
".text" "\n"
".align 2" "\n"
".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
+HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
".thumb" "\n"
".thumb_func " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
@@ -246,6 +267,7 @@ asm volatile (
".text" "\n"
".align 2" "\n"
".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
+HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
".thumb" "\n"
".thumb_func " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
@@ -591,6 +613,7 @@ namespace JITStubs {
".text" "\n" \
".align 2" "\n" \
".globl " SYMBOL_STRING(cti_##op) "\n" \
+ HIDE_SYMBOL(cti_##op) "\n" \
".thumb" "\n" \
".thumb_func " SYMBOL_STRING(cti_##op) "\n" \
SYMBOL_STRING(cti_##op) ":" "\n" \
@@ -2727,6 +2750,16 @@ DEFINE_STUB_FUNCTION(void, op_debug_catch)
debugger->exceptionCatch(DebuggerCallFrame(callFrame), callFrame->codeBlock()->ownerNode()->sourceID());
}
}
+
+DEFINE_STUB_FUNCTION(void, op_debug_return)
+{
+ STUB_INIT_STACK_FRAME(stackFrame);
+ CallFrame* callFrame = stackFrame.callFrame;
+ if (JSC::Debugger* debugger = callFrame->lexicalGlobalObject()->debugger() ) {
+ debugger->functionExit(JSValue(), callFrame->codeBlock()->ownerNode()->sourceID());
+ }
+}
+
#endif
DEFINE_STUB_FUNCTION(EncodedJSValue, vm_throw)
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
index 60bf64a..325c3fd 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h
@@ -223,6 +223,7 @@ namespace JITStubs { extern "C" {
void JIT_STUB cti_op_debug(STUB_ARGS_DECLARATION);
#ifdef QT_BUILD_SCRIPT_LIB
void JIT_STUB cti_op_debug_catch(STUB_ARGS_DECLARATION);
+ void JIT_STUB cti_op_debug_return(STUB_ARGS_DECLARATION);
#endif
void JIT_STUB cti_op_end(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_jmp_scopes(STUB_ARGS_DECLARATION);
diff --git a/src/3rdparty/webkit/JavaScriptCore/parser/NodeConstructors.h b/src/3rdparty/webkit/JavaScriptCore/parser/NodeConstructors.h
index c256190..a4374d3 100644
--- a/src/3rdparty/webkit/JavaScriptCore/parser/NodeConstructors.h
+++ b/src/3rdparty/webkit/JavaScriptCore/parser/NodeConstructors.h
@@ -27,23 +27,6 @@
namespace JSC {
- inline void* ParserArenaDeletable::operator new(size_t size, JSGlobalData* globalData)
- {
- ParserArenaDeletable* deletable = static_cast<ParserArenaDeletable*>(fastMalloc(size));
- globalData->parser->arena().deleteWithArena(deletable);
- return deletable;
- }
-
- inline void* ParserArenaDeletable::operator new(size_t size)
- {
- return fastMalloc(size);
- }
-
- inline void ParserArenaDeletable::operator delete(void* p)
- {
- fastFree(p);
- }
-
inline ParserArenaRefCounted::ParserArenaRefCounted(JSGlobalData* globalData)
{
globalData->parser->arena().derefWithArena(adoptRef(this));
diff --git a/src/3rdparty/webkit/JavaScriptCore/parser/ParserArena.cpp b/src/3rdparty/webkit/JavaScriptCore/parser/ParserArena.cpp
index 2617506..78c5196 100644
--- a/src/3rdparty/webkit/JavaScriptCore/parser/ParserArena.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/parser/ParserArena.cpp
@@ -24,6 +24,7 @@
*/
#include "config.h"
+#include "Parser.h"
#include "ParserArena.h"
#include "Nodes.h"
@@ -57,4 +58,21 @@ void ParserArena::reset()
m_refCountedObjects.shrink(0);
}
+void* ParserArenaDeletable::operator new(size_t size, JSGlobalData* globalData)
+{
+ ParserArenaDeletable* deletable = static_cast<ParserArenaDeletable*>(fastMalloc(size));
+ globalData->parser->arena().deleteWithArena(deletable);
+ return deletable;
+}
+
+void* ParserArenaDeletable::operator new(size_t size)
+{
+ return fastMalloc(size);
+}
+
+void ParserArenaDeletable::operator delete(void* p)
+{
+ fastFree(p);
+}
+
}
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp
index dddd83d..1268d3d 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp
@@ -506,6 +506,49 @@ static void* getStackBase(void* previousFrame)
}
}
#endif
+#if PLATFORM(HPUX)
+struct hpux_get_stack_base_data
+{
+ pthread_t thread;
+ _pthread_stack_info info;
+};
+
+static void *hpux_get_stack_base_internal(void *d)
+{
+ hpux_get_stack_base_data *data = static_cast<hpux_get_stack_base_data *>(d);
+
+ // _pthread_stack_info_np requires the target thread to be suspended
+ // in order to get information about it
+ pthread_suspend(data->thread);
+
+ // _pthread_stack_info_np returns an errno code in case of failure
+ // or zero on success
+ if (_pthread_stack_info_np(data->thread, &data->info)) {
+ // failed
+ return 0;
+ }
+
+ pthread_continue(data->thread);
+ return data;
+}
+
+static void *hpux_get_stack_base()
+{
+ hpux_get_stack_base_data data;
+ data.thread = pthread_self();
+
+ // We cannot get the stack information for the current thread
+ // So we start a new thread to get that information and return it to us
+ pthread_t other;
+ pthread_create(&other, 0, hpux_get_stack_base_internal, &data);
+
+ void *result;
+ pthread_join(other, &result);
+ if (result)
+ return data.info.stk_stack_base;
+ return 0;
+}
+#endif
static inline void* currentThreadStackBase()
{
@@ -532,10 +575,24 @@ static inline void* currentThreadStackBase()
: "=r" (pTib)
);
return static_cast<void*>(pTib->StackBase);
+#elif PLATFORM(HPUX)
+ return hpux_get_stack_base();
#elif PLATFORM(SOLARIS)
stack_t s;
thr_stksegment(&s);
return s.ss_sp;
+#elif PLATFORM(AIX)
+ pthread_t thread = pthread_self();
+ struct __pthrdsinfo threadinfo;
+ char regbuf[256];
+ int regbufsize = sizeof regbuf;
+
+ if (pthread_getthrds_np(&thread, PTHRDSINFO_QUERY_ALL,
+ &threadinfo, sizeof threadinfo,
+ &regbuf, &regbufsize) == 0)
+ return threadinfo.__pi_stackaddr;
+
+ return 0;
#elif PLATFORM(OPENBSD)
pthread_t thread = pthread_self();
stack_t stack;
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObject.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObject.h
index dc11fee..98e9b68 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObject.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObject.h
@@ -27,6 +27,7 @@
#include "NativeFunctionWrapper.h"
#include "NumberPrototype.h"
#include "StringPrototype.h"
+#include "StructureChain.h"
#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/PropertyNameArray.h b/src/3rdparty/webkit/JavaScriptCore/runtime/PropertyNameArray.h
index b4382f4..67ee9c8 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/PropertyNameArray.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/PropertyNameArray.h
@@ -24,6 +24,7 @@
#include "CallFrame.h"
#include "Identifier.h"
#include "Structure.h"
+#include "StructureChain.h"
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Protect.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Protect.h
index 224164d..6e7984c 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Protect.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Protect.h
@@ -98,7 +98,7 @@ namespace JSC {
JSValue get() const { return m_value; }
operator JSValue() const { return m_value; }
- JSValue operator->() const { return m_value; }
+ //JSValue operator->() const { return m_value; }
operator bool() const { return m_value; }
bool operator!() const { return !m_value; }
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp
index 9f6b0c3..38c086e 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp
@@ -160,7 +160,7 @@ Structure::~Structure()
m_previous->m_transitions.singleTransition = 0;
} else {
ASSERT(m_previous->m_transitions.table->contains(make_pair(m_nameInPrevious.get(), make_pair(m_attributesInPrevious, m_specificValueInPrevious))));
- m_previous->m_transitions.table->remove(make_pair(m_nameInPrevious.get(), make_pair(m_attributesInPrevious, m_specificValueInPrevious)));
+ m_previous->m_transitions.table->remove(make_pair<RefPtr<UString::Rep>, std::pair<unsigned,JSCell*> >(m_nameInPrevious.get(), make_pair(m_attributesInPrevious, m_specificValueInPrevious)));
}
}
@@ -394,7 +394,7 @@ PassRefPtr<Structure> Structure::addPropertyTransitionToExistingStructure(Struct
return existingTransition;
}
} else {
- if (Structure* existingTransition = structure->m_transitions.table->get(make_pair(propertyName.ustring().rep(), make_pair(attributes, specificValue)))) {
+ if (Structure* existingTransition = structure->m_transitions.table->get(make_pair<RefPtr<UString::Rep>, std::pair<unsigned, JSCell*> >(propertyName.ustring().rep(), make_pair(attributes, specificValue)))) {
ASSERT(existingTransition->m_offset != noOffset);
offset = existingTransition->m_offset;
return existingTransition;
@@ -459,9 +459,9 @@ PassRefPtr<Structure> Structure::addPropertyTransition(Structure* structure, con
structure->m_usingSingleTransitionSlot = false;
StructureTransitionTable* transitionTable = new StructureTransitionTable;
structure->m_transitions.table = transitionTable;
- transitionTable->add(make_pair(existingTransition->m_nameInPrevious.get(), make_pair(existingTransition->m_attributesInPrevious, existingTransition->m_specificValueInPrevious)), existingTransition);
+ transitionTable->add(make_pair<RefPtr<UString::Rep>, std::pair<unsigned, JSCell*> >(existingTransition->m_nameInPrevious.get(), make_pair(existingTransition->m_attributesInPrevious, existingTransition->m_specificValueInPrevious)), existingTransition);
}
- structure->m_transitions.table->add(make_pair(propertyName.ustring().rep(), make_pair(attributes, specificValue)), transition.get());
+ structure->m_transitions.table->add(make_pair<RefPtr<UString::Rep>, std::pair<unsigned, JSCell*> >(propertyName.ustring().rep(), make_pair(attributes, specificValue)), transition.get());
return transition.release();
}
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
index 0de03a3..dcd4e50 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
@@ -30,7 +30,6 @@
#include "JSType.h"
#include "JSValue.h"
#include "PropertyMapHashTable.h"
-#include "StructureChain.h"
#include "StructureTransitionTable.h"
#include "TypeInfo.h"
#include "UString.h"
@@ -47,6 +46,7 @@ namespace JSC {
class PropertyNameArray;
class PropertyNameArrayData;
+ class StructureChain;
class Structure : public RefCounted<Structure> {
public:
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.cpp
index 85049b1..acebc86 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "StructureChain.h"
+#include "Structure.h"
#include "JSObject.h"
#include "Structure.h"
@@ -46,6 +47,11 @@ StructureChain::StructureChain(Structure* head)
m_vector[i] = 0;
}
+PassRefPtr<StructureChain> StructureChain::create(Structure* head)
+{
+ return adoptRef(new StructureChain(head));
+}
+
bool StructureChain::isCacheable() const
{
uint32_t i = 0;
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.h b/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.h
index c48749d..5990e17 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/StructureChain.h
@@ -37,7 +37,7 @@ namespace JSC {
class StructureChain : public RefCounted<StructureChain> {
public:
- static PassRefPtr<StructureChain> create(Structure* head) { return adoptRef(new StructureChain(head)); }
+ static PassRefPtr<StructureChain> create(Structure* head);
RefPtr<Structure>* head() { return m_vector.get(); }
bool isCacheable() const;
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h b/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h
index 3de5ee6..8ff9170 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/HashMap.h
@@ -178,7 +178,10 @@ namespace WTF {
HashMap<T, U, V, W, X>::inlineAdd(const KeyType& key, const MappedType& mapped)
{
typedef HashMapTranslator<ValueType, ValueTraits, HashFunctions> TranslatorType;
- return m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped);
+ pair<typename HashTableType::iterator, bool> p = m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped);
+ typename HashMap<T, U, V, W, X>::iterator temp = p.first;
+ return make_pair<typename HashMap<T, U, V, W, X>::iterator, bool>(temp, p.second);
+// return m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped);
}
template<typename T, typename U, typename V, typename W, typename X>
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/HashSet.h b/src/3rdparty/webkit/JavaScriptCore/wtf/HashSet.h
index 990670d..ec809e5 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/HashSet.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/HashSet.h
@@ -204,7 +204,12 @@ namespace WTF {
template<typename T, typename U, typename V>
pair<typename HashSet<T, U, V>::iterator, bool> HashSet<T, U, V>::add(const ValueType& value)
{
- return m_impl.add(value);
+ pair<typename HashTable<T, T, IdentityExtractor<T>, U, V, V>::iterator, bool> p = m_impl.add(value);
+ typename HashSet<T, U, V>::iterator temp = p.first;
+ pair<typename HashSet<T, U, V>::iterator, bool> p2 = make_pair<typename HashSet<T, U, V>::iterator, bool>(temp, p.second);
+ // p2.first = p.first;
+ // p2.second = p.second;
+ return p2;
}
template<typename Value, typename HashFunctions, typename Traits>
@@ -213,7 +218,8 @@ namespace WTF {
HashSet<Value, HashFunctions, Traits>::add(const T& value)
{
typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;
- return m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
+ pair<typename HashTableType::iterator, bool> p = m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
+ return make_pair<iterator, bool>(p.first, p.second);
}
template<typename T, typename U, typename V>
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/MainThread.h b/src/3rdparty/webkit/JavaScriptCore/wtf/MainThread.h
index 01ce804..b8305b5 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/MainThread.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/MainThread.h
@@ -34,7 +34,9 @@ namespace WTF {
class Mutex;
-typedef void MainThreadFunction(void*);
+extern "C" {
+ typedef void MainThreadFunction(void*);
+}
void callOnMainThread(MainThreadFunction*, void* context);
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h b/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h
index 12291cc..070b76c 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h
@@ -41,7 +41,7 @@ namespace WTF {
enum MessageQueueWaitResult {
MessageQueueTerminated, // Queue was destroyed while waiting for message.
MessageQueueTimeout, // Timeout was specified and it expired.
- MessageQueueMessageReceived, // A message was successfully received and returned.
+ MessageQueueMessageReceived // A message was successfully received and returned.
};
template<typename DataType>
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
index e531a63..fa37d55 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
@@ -106,6 +106,9 @@
/* regardless of operating environment */
#if defined(hpux) || defined(__hpux)
#define WTF_PLATFORM_HPUX 1
+#ifndef MAP_ANON
+#define MAP_ANON MAP_ANONYMOUS
+#endif
#endif
#if defined (__SYMBIAN32__)
@@ -301,6 +304,30 @@
#define WTF_PLATFORM_BIG_ENDIAN 1
#endif
+/* PLATFORM(HPPA) */
+/* a.k.a. PA-RISC */
+#if defined(__hppa) || defined(__hppa__)
+#define WTF_PLATFORM_HPPA 1
+#define WTF_PLATFORM_BIG_ENDIAN 1
+#endif
+
+/* PLATFORM(IA64) */
+/* a.k.a. Itanium Processor Family, IPF */
+#if defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+#define WTF_PLATFORM_IA64 1
+
+/* Itanium can be both big- and little-endian
+ we need to determine at compile time which one it is.
+ - HP's aCC compiler only compiles big-endian (so HP-UXi is always big-endian)
+ - GCC defines __BIG_ENDIAN__ for us (default on HP-UX)
+ - Linux is usually little-endian
+ - I've never seen AIX or Windows on IA-64, but they should be little-endian too
+*/
+#if defined(__BIG_ENDIAN__) || defined(__HP_aCC)
+# define WTF_PLATFORM_BIG_ENDIAN 1
+#endif
+#endif
+
/* PLATFORM(WINCE) && PLATFORM(QT)
We can not determine the endianess at compile time. For
Qt for Windows CE the endianess is specified in the
@@ -474,7 +501,7 @@
#endif
#if !PLATFORM(WIN_OS) && !PLATFORM(SOLARIS) && !PLATFORM(QNX) \
- && !PLATFORM(SYMBIAN) && !COMPILER(RVCT)
+ && !PLATFORM(SYMBIAN) && !COMPILER(RVCT) && !PLATFORM(AIX) && !PLATFORM(HPUX)
#define HAVE_TM_GMTOFF 1
#define HAVE_TM_ZONE 1
#define HAVE_TIMEGM 1
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/RefPtrHashMap.h b/src/3rdparty/webkit/JavaScriptCore/wtf/RefPtrHashMap.h
index 1cbebb4..b3ccd3a 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/RefPtrHashMap.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/RefPtrHashMap.h
@@ -42,7 +42,7 @@ namespace WTF {
};
template<typename T, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg>
- class HashMap<RefPtr<T>, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg> {
+ class RefPtrHashMap {
private:
typedef KeyTraitsArg KeyTraits;
typedef MappedTraitsArg MappedTraits;
@@ -67,7 +67,7 @@ namespace WTF {
typedef HashTableIteratorAdapter<HashTableType, ValueType> iterator;
typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterator;
- void swap(HashMap&);
+ void swap(RefPtrHashMap&);
int size() const;
int capacity() const;
@@ -115,109 +115,123 @@ namespace WTF {
HashTableType m_impl;
};
+ template<typename T, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg>
+ class HashMap<RefPtr<T>, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg> :
+ public RefPtrHashMap<T, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>
+ {
+ };
template<typename T, typename U, typename V, typename W, typename X>
- inline void HashMap<RefPtr<T>, U, V, W, X>::swap(HashMap& other)
+ inline void RefPtrHashMap<T, U, V, W, X>::swap(RefPtrHashMap& other)
{
m_impl.swap(other.m_impl);
}
template<typename T, typename U, typename V, typename W, typename X>
- inline int HashMap<RefPtr<T>, U, V, W, X>::size() const
+ inline int RefPtrHashMap<T, U, V, W, X>::size() const
{
return m_impl.size();
}
template<typename T, typename U, typename V, typename W, typename X>
- inline int HashMap<RefPtr<T>, U, V, W, X>::capacity() const
+ inline int RefPtrHashMap<T, U, V, W, X>::capacity() const
{
return m_impl.capacity();
}
template<typename T, typename U, typename V, typename W, typename X>
- inline bool HashMap<RefPtr<T>, U, V, W, X>::isEmpty() const
+ inline bool RefPtrHashMap<T, U, V, W, X>::isEmpty() const
{
return m_impl.isEmpty();
}
template<typename T, typename U, typename V, typename W, typename X>
- inline typename HashMap<RefPtr<T>, U, V, W, X>::iterator HashMap<RefPtr<T>, U, V, W, X>::begin()
+ inline typename RefPtrHashMap<T, U, V, W, X>::iterator RefPtrHashMap<T, U, V, W, X>::begin()
{
return m_impl.begin();
}
template<typename T, typename U, typename V, typename W, typename X>
- inline typename HashMap<RefPtr<T>, U, V, W, X>::iterator HashMap<RefPtr<T>, U, V, W, X>::end()
+ inline typename RefPtrHashMap<T, U, V, W, X>::iterator RefPtrHashMap<T, U, V, W, X>::end()
{
return m_impl.end();
}
template<typename T, typename U, typename V, typename W, typename X>
- inline typename HashMap<RefPtr<T>, U, V, W, X>::const_iterator HashMap<RefPtr<T>, U, V, W, X>::begin() const
+ inline typename RefPtrHashMap<T, U, V, W, X>::const_iterator RefPtrHashMap<T, U, V, W, X>::begin() const
{
return m_impl.begin();
}
template<typename T, typename U, typename V, typename W, typename X>
- inline typename HashMap<RefPtr<T>, U, V, W, X>::const_iterator HashMap<RefPtr<T>, U, V, W, X>::end() const
+ inline typename RefPtrHashMap<T, U, V, W, X>::const_iterator RefPtrHashMap<T, U, V, W, X>::end() const
{
return m_impl.end();
}
template<typename T, typename U, typename V, typename W, typename X>
- inline typename HashMap<RefPtr<T>, U, V, W, X>::iterator HashMap<RefPtr<T>, U, V, W, X>::find(const KeyType& key)
+ inline typename RefPtrHashMap<T, U, V, W, X>::iterator RefPtrHashMap<T, U, V, W, X>::find(const KeyType& key)
{
return m_impl.find(key);
}
template<typename T, typename U, typename V, typename W, typename X>
- inline typename HashMap<RefPtr<T>, U, V, W, X>::iterator HashMap<RefPtr<T>, U, V, W, X>::find(RawKeyType key)
+ inline typename RefPtrHashMap<T, U, V, W, X>::iterator RefPtrHashMap<T, U, V, W, X>::find(RawKeyType key)
{
return m_impl.template find<RawKeyType, RawKeyTranslator>(key);
}
template<typename T, typename U, typename V, typename W, typename X>
- inline typename HashMap<RefPtr<T>, U, V, W, X>::const_iterator HashMap<RefPtr<T>, U, V, W, X>::find(const KeyType& key) const
+ inline typename RefPtrHashMap<T, U, V, W, X>::const_iterator RefPtrHashMap<T, U, V, W, X>::find(const KeyType& key) const
{
return m_impl.find(key);
}
template<typename T, typename U, typename V, typename W, typename X>
- inline typename HashMap<RefPtr<T>, U, V, W, X>::const_iterator HashMap<RefPtr<T>, U, V, W, X>::find(RawKeyType key) const
+ inline typename RefPtrHashMap<T, U, V, W, X>::const_iterator RefPtrHashMap<T, U, V, W, X>::find(RawKeyType key) const
{
return m_impl.template find<RawKeyType, RawKeyTranslator>(key);
}
template<typename T, typename U, typename V, typename W, typename X>
- inline bool HashMap<RefPtr<T>, U, V, W, X>::contains(const KeyType& key) const
+ inline bool RefPtrHashMap<T, U, V, W, X>::contains(const KeyType& key) const
{
return m_impl.contains(key);
}
template<typename T, typename U, typename V, typename W, typename X>
- inline bool HashMap<RefPtr<T>, U, V, W, X>::contains(RawKeyType key) const
+ inline bool RefPtrHashMap<T, U, V, W, X>::contains(RawKeyType key) const
{
return m_impl.template contains<RawKeyType, RawKeyTranslator>(key);
}
template<typename T, typename U, typename V, typename W, typename X>
- inline pair<typename HashMap<RefPtr<T>, U, V, W, X>::iterator, bool>
- HashMap<RefPtr<T>, U, V, W, X>::inlineAdd(const KeyType& key, const MappedType& mapped)
+ inline pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
+ RefPtrHashMap<T, U, V, W, X>::inlineAdd(const KeyType& key, const MappedType& mapped)
{
typedef HashMapTranslator<ValueType, ValueTraits, HashFunctions> TranslatorType;
- return m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped);
+ pair<typename HashTableType::iterator, bool> p = m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped);
+// typename RefPtrHashMap<T, U, V, W, X>::iterator temp = p.first;
+ return make_pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>(
+ typename RefPtrHashMap<T, U, V, W, X>::iterator(p.first), p.second);
+
+// return m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped);
}
template<typename T, typename U, typename V, typename W, typename X>
- inline pair<typename HashMap<RefPtr<T>, U, V, W, X>::iterator, bool>
- HashMap<RefPtr<T>, U, V, W, X>::inlineAdd(RawKeyType key, const MappedType& mapped)
+ inline pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
+ RefPtrHashMap<T, U, V, W, X>::inlineAdd(RawKeyType key, const MappedType& mapped)
{
- return m_impl.template add<RawKeyType, MappedType, RawKeyTranslator>(key, mapped);
+ pair<typename HashTableType::iterator, bool> p = m_impl.template add<RawKeyType, MappedType, RawKeyTranslator>(key, mapped);
+ return make_pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>(
+ typename RefPtrHashMap<T, U, V, W, X>::iterator(p.first), p.second);
+
+ // return m_impl.template add<RawKeyType, MappedType, RawKeyTranslator>(key, mapped);
}
template<typename T, typename U, typename V, typename W, typename X>
- pair<typename HashMap<RefPtr<T>, U, V, W, X>::iterator, bool>
- HashMap<RefPtr<T>, U, V, W, X>::set(const KeyType& key, const MappedType& mapped)
+ pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
+ RefPtrHashMap<T, U, V, W, X>::set(const KeyType& key, const MappedType& mapped)
{
pair<iterator, bool> result = inlineAdd(key, mapped);
if (!result.second) {
@@ -228,8 +242,8 @@ namespace WTF {
}
template<typename T, typename U, typename V, typename W, typename X>
- pair<typename HashMap<RefPtr<T>, U, V, W, X>::iterator, bool>
- HashMap<RefPtr<T>, U, V, W, X>::set(RawKeyType key, const MappedType& mapped)
+ pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
+ RefPtrHashMap<T, U, V, W, X>::set(RawKeyType key, const MappedType& mapped)
{
pair<iterator, bool> result = inlineAdd(key, mapped);
if (!result.second) {
@@ -240,22 +254,22 @@ namespace WTF {
}
template<typename T, typename U, typename V, typename W, typename X>
- pair<typename HashMap<RefPtr<T>, U, V, W, X>::iterator, bool>
- HashMap<RefPtr<T>, U, V, W, X>::add(const KeyType& key, const MappedType& mapped)
+ pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
+ RefPtrHashMap<T, U, V, W, X>::add(const KeyType& key, const MappedType& mapped)
{
return inlineAdd(key, mapped);
}
template<typename T, typename U, typename V, typename W, typename X>
- pair<typename HashMap<RefPtr<T>, U, V, W, X>::iterator, bool>
- HashMap<RefPtr<T>, U, V, W, X>::add(RawKeyType key, const MappedType& mapped)
+ pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
+ RefPtrHashMap<T, U, V, W, X>::add(RawKeyType key, const MappedType& mapped)
{
return inlineAdd(key, mapped);
}
template<typename T, typename U, typename V, typename W, typename MappedTraits>
- typename HashMap<RefPtr<T>, U, V, W, MappedTraits>::MappedType
- HashMap<RefPtr<T>, U, V, W, MappedTraits>::get(const KeyType& key) const
+ typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType
+ RefPtrHashMap<T, U, V, W, MappedTraits>::get(const KeyType& key) const
{
ValueType* entry = const_cast<HashTableType&>(m_impl).lookup(key);
if (!entry)
@@ -264,8 +278,8 @@ namespace WTF {
}
template<typename T, typename U, typename V, typename W, typename MappedTraits>
- typename HashMap<RefPtr<T>, U, V, W, MappedTraits>::MappedType
- inline HashMap<RefPtr<T>, U, V, W, MappedTraits>::inlineGet(RawKeyType key) const
+ typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType
+ inline RefPtrHashMap<T, U, V, W, MappedTraits>::inlineGet(RawKeyType key) const
{
ValueType* entry = const_cast<HashTableType&>(m_impl).template lookup<RawKeyType, RawKeyTranslator>(key);
if (!entry)
@@ -274,14 +288,14 @@ namespace WTF {
}
template<typename T, typename U, typename V, typename W, typename MappedTraits>
- typename HashMap<RefPtr<T>, U, V, W, MappedTraits>::MappedType
- HashMap<RefPtr<T>, U, V, W, MappedTraits>::get(RawKeyType key) const
+ typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType
+ RefPtrHashMap<T, U, V, W, MappedTraits>::get(RawKeyType key) const
{
return inlineGet(key);
}
template<typename T, typename U, typename V, typename W, typename X>
- inline void HashMap<RefPtr<T>, U, V, W, X>::remove(iterator it)
+ inline void RefPtrHashMap<T, U, V, W, X>::remove(iterator it)
{
if (it.m_impl == m_impl.end())
return;
@@ -290,45 +304,45 @@ namespace WTF {
}
template<typename T, typename U, typename V, typename W, typename X>
- inline void HashMap<RefPtr<T>, U, V, W, X>::remove(const KeyType& key)
+ inline void RefPtrHashMap<T, U, V, W, X>::remove(const KeyType& key)
{
remove(find(key));
}
template<typename T, typename U, typename V, typename W, typename X>
- inline void HashMap<RefPtr<T>, U, V, W, X>::remove(RawKeyType key)
+ inline void RefPtrHashMap<T, U, V, W, X>::remove(RawKeyType key)
{
remove(find(key));
}
template<typename T, typename U, typename V, typename W, typename X>
- inline void HashMap<RefPtr<T>, U, V, W, X>::clear()
+ inline void RefPtrHashMap<T, U, V, W, X>::clear()
{
m_impl.clear();
}
template<typename T, typename U, typename V, typename W, typename MappedTraits>
- typename HashMap<RefPtr<T>, U, V, W, MappedTraits>::MappedType
- HashMap<RefPtr<T>, U, V, W, MappedTraits>::take(const KeyType& key)
+ typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType
+ RefPtrHashMap<T, U, V, W, MappedTraits>::take(const KeyType& key)
{
// This can probably be made more efficient to avoid ref/deref churn.
iterator it = find(key);
if (it == end())
return MappedTraits::emptyValue();
- typename HashMap<RefPtr<T>, U, V, W, MappedTraits>::MappedType result = it->second;
+ typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType result = it->second;
remove(it);
return result;
}
template<typename T, typename U, typename V, typename W, typename MappedTraits>
- typename HashMap<RefPtr<T>, U, V, W, MappedTraits>::MappedType
- HashMap<RefPtr<T>, U, V, W, MappedTraits>::take(RawKeyType key)
+ typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType
+ RefPtrHashMap<T, U, V, W, MappedTraits>::take(RawKeyType key)
{
// This can probably be made more efficient to avoid ref/deref churn.
iterator it = find(key);
if (it == end())
return MappedTraits::emptyValue();
- typename HashMap<RefPtr<T>, U, V, W, MappedTraits>::MappedType result = it->second;
+ typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType result = it->second;
remove(it);
return result;
}
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/TypeTraits.h b/src/3rdparty/webkit/JavaScriptCore/wtf/TypeTraits.h
index 6ce6a3e..56659a8 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/TypeTraits.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/TypeTraits.h
@@ -70,30 +70,30 @@ namespace WTF {
template <> struct IsPod<long double> { static const bool value = true; };
template <typename P> struct IsPod<P*> { static const bool value = true; };
- template<typename T> class IsConvertibleToInteger {
- // Avoid "possible loss of data" warning when using Microsoft's C++ compiler
- // by not converting int's to doubles.
- template<bool performCheck, typename U> class IsConvertibleToDouble;
- template<typename U> class IsConvertibleToDouble<false, U> {
- public:
- static const bool value = false;
- };
+ // Avoid "possible loss of data" warning when using Microsoft's C++ compiler
+ // by not converting int's to doubles.
+ template<bool performCheck, typename U> class CheckedIsConvertibleToDouble;
+ template<typename U> class CheckedIsConvertibleToDouble<false, U> {
+ public:
+ static const bool value = false;
+ };
- template<typename U> class IsConvertibleToDouble<true, U> {
- typedef char YesType;
- struct NoType {
- char padding[8];
- };
-
- static YesType floatCheck(long double);
- static NoType floatCheck(...);
- static T& t;
- public:
- static const bool value = sizeof(floatCheck(t)) == sizeof(YesType);
+ template<typename U> class CheckedIsConvertibleToDouble<true, U> {
+ typedef char YesType;
+ struct NoType {
+ char padding[8];
};
+ static YesType floatCheck(long double);
+ static NoType floatCheck(...);
+ static U& t;
+ public:
+ static const bool value = sizeof(floatCheck(t)) == sizeof(YesType);
+ };
+
+ template<typename T> class IsConvertibleToInteger {
public:
- static const bool value = IsInteger<T>::value || IsConvertibleToDouble<!IsInteger<T>::value, T>::value;
+ static const bool value = IsInteger<T>::value || CheckedIsConvertibleToDouble<!IsInteger<T>::value, T>::value;
};
template <typename T, typename U> struct IsSameType {
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h
index e3cb718..7decc4a 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Vector.h
@@ -67,10 +67,11 @@ namespace WTF {
template <size_t size, size_t> struct AlignedBuffer
{
AlignedBufferChar oversizebuffer[size + 64];
- AlignedBufferChar *buffer;
- inline AlignedBuffer() : buffer(oversizebuffer)
+ AlignedBufferChar *buffer()
{
- buffer += 64 - (reinterpret_cast<size_t>(buffer) & 0x3f);
+ AlignedBufferChar *ptr = oversizebuffer;
+ ptr += 64 - (reinterpret_cast<size_t>(ptr) & 0x3f);
+ return ptr;
}
};
#endif
@@ -128,7 +129,7 @@ namespace WTF {
template<typename T>
struct VectorMover<false, T>
{
- static void move(const T* src, const T* srcEnd, T* dst)
+ static void move(T* src, const T* srcEnd, T* dst)
{
while (src != srcEnd) {
new (dst) T(*src);
@@ -137,7 +138,7 @@ namespace WTF {
++src;
}
}
- static void moveOverlapping(const T* src, const T* srcEnd, T* dst)
+ static void moveOverlapping(T* src, const T* srcEnd, T* dst)
{
if (src > dst)
move(src, srcEnd, dst);
@@ -156,11 +157,11 @@ namespace WTF {
template<typename T>
struct VectorMover<true, T>
{
- static void move(const T* src, const T* srcEnd, T* dst)
+ static void move(T* src, const T* srcEnd, T* dst)
{
memcpy(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
}
- static void moveOverlapping(const T* src, const T* srcEnd, T* dst)
+ static void moveOverlapping(T* src, const T* srcEnd, T* dst)
{
memmove(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
}
@@ -253,12 +254,12 @@ namespace WTF {
VectorInitializer<VectorTraits<T>::needsInitialization, VectorTraits<T>::canInitializeWithMemset, T>::initialize(begin, end);
}
- static void move(const T* src, const T* srcEnd, T* dst)
+ static void move(T* src, const T* srcEnd, T* dst)
{
VectorMover<VectorTraits<T>::canMoveWithMemcpy, T>::move(src, srcEnd, dst);
}
- static void moveOverlapping(const T* src, const T* srcEnd, T* dst)
+ static void moveOverlapping(T* src, const T* srcEnd, T* dst)
{
VectorMover<VectorTraits<T>::canMoveWithMemcpy, T>::moveOverlapping(src, srcEnd, dst);
}
@@ -440,7 +441,11 @@ namespace WTF {
using Base::m_capacity;
static const size_t m_inlineBufferSize = inlineCapacity * sizeof(T);
+ #ifdef WTF_ALIGNED
T* inlineBuffer() { return reinterpret_cast<T*>(m_inlineBuffer.buffer); }
+ #else
+ T* inlineBuffer() { return reinterpret_cast<T*>(m_inlineBuffer.buffer()); }
+ #endif
AlignedBuffer<m_inlineBufferSize, WTF_ALIGN_OF(T)> m_inlineBuffer;
};
diff --git a/src/3rdparty/webkit/WebCore/bridge/npapi.h b/src/3rdparty/webkit/WebCore/bridge/npapi.h
index 07fed86..2ff657e 100644
--- a/src/3rdparty/webkit/WebCore/bridge/npapi.h
+++ b/src/3rdparty/webkit/WebCore/bridge/npapi.h
@@ -350,9 +350,10 @@ typedef enum {
NPPVpluginWantsAllNetworkStreams = 18,
/* Checks to see if the plug-in would like the browser to load the "src" attribute. */
- NPPVpluginCancelSrcStream = 20,
+ NPPVpluginCancelSrcStream = 20
#ifdef XP_MACOSX
+ ,
/* Used for negotiating drawing models */
NPPVpluginDrawingModel = 1000,
/* Used for negotiating event models */
diff --git a/src/3rdparty/webkit/WebCore/dom/ExceptionCode.h b/src/3rdparty/webkit/WebCore/dom/ExceptionCode.h
index 58b18e2..08bffa6 100644
--- a/src/3rdparty/webkit/WebCore/dom/ExceptionCode.h
+++ b/src/3rdparty/webkit/WebCore/dom/ExceptionCode.h
@@ -57,7 +57,7 @@ namespace WebCore {
NETWORK_ERR = 19,
ABORT_ERR = 20,
URL_MISMATCH_ERR = 21,
- QUOTA_EXCEEDED_ERR = 22,
+ QUOTA_EXCEEDED_ERR = 22
};
enum ExceptionType {
diff --git a/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.h b/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.h
index 3f8febc..f95f0045 100644
--- a/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.h
+++ b/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.h
@@ -45,7 +45,7 @@ namespace WebCore {
enum MessageDestination {
InspectorControllerDestination,
- ConsoleDestination,
+ ConsoleDestination
};
class ScriptExecutionContext {
diff --git a/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp b/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp
index 9737e92..dcb3326 100644
--- a/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp
+++ b/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp
@@ -795,7 +795,7 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap
// FIXME: This is an inefficient way to preserve style on nodes in the paragraph to move. It
// shouldn't matter though, since moved paragraphs will usually be quite small.
- RefPtr<DocumentFragment> fragment = startOfParagraphToMove != endOfParagraphToMove ? createFragmentFromMarkup(document(), createMarkup(range.get(), 0, DoNotAnnotateForInterchange, true), "") : 0;
+ RefPtr<DocumentFragment> fragment = startOfParagraphToMove != endOfParagraphToMove ? createFragmentFromMarkup(document(), createMarkup(range.get(), 0, DoNotAnnotateForInterchange, true), "") : PassRefPtr<DocumentFragment>(0);
// A non-empty paragraph's style is moved when we copy and move it. We don't move
// anything if we're given an empty paragraph, but an empty paragraph can have style
diff --git a/src/3rdparty/webkit/WebCore/editing/EditorInsertAction.h b/src/3rdparty/webkit/WebCore/editing/EditorInsertAction.h
index 5b732dc..b8b137d 100644
--- a/src/3rdparty/webkit/WebCore/editing/EditorInsertAction.h
+++ b/src/3rdparty/webkit/WebCore/editing/EditorInsertAction.h
@@ -32,7 +32,7 @@ namespace WebCore {
enum EditorInsertAction {
EditorInsertActionTyped,
EditorInsertActionPasted,
- EditorInsertActionDropped,
+ EditorInsertActionDropped
};
} // namespace
diff --git a/src/3rdparty/webkit/WebCore/editing/markup.cpp b/src/3rdparty/webkit/WebCore/editing/markup.cpp
index 6b6d326..1c737a0 100644
--- a/src/3rdparty/webkit/WebCore/editing/markup.cpp
+++ b/src/3rdparty/webkit/WebCore/editing/markup.cpp
@@ -970,7 +970,7 @@ String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc
Node* body = enclosingNodeWithTag(Position(commonAncestor, 0), bodyTag);
// FIXME: Do this for all fully selected blocks, not just the body.
Node* fullySelectedRoot = body && *VisibleSelection::selectionFromContentsOfNode(body).toNormalizedRange() == *updatedRange ? body : 0;
- RefPtr<CSSMutableStyleDeclaration> fullySelectedRootStyle = fullySelectedRoot ? styleFromMatchedRulesAndInlineDecl(fullySelectedRoot) : 0;
+ RefPtr<CSSMutableStyleDeclaration> fullySelectedRootStyle = fullySelectedRoot ? styleFromMatchedRulesAndInlineDecl(fullySelectedRoot) : PassRefPtr<CSSMutableStyleDeclaration>(0);
if (annotate && fullySelectedRoot) {
if (shouldIncludeWrapperForFullySelectedRoot(fullySelectedRoot, fullySelectedRootStyle.get()))
specialCommonAncestor = fullySelectedRoot;
diff --git a/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.h b/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.h
index cc3627d..fdd854c 100644
--- a/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.h
+++ b/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.h
@@ -275,7 +275,7 @@ enum CSSPropertyID {
CSSPropertyGlyphOrientationVertical = 1268,
CSSPropertyKerning = 1269,
CSSPropertyTextAnchor = 1270,
- CSSPropertyWritingMode = 1271,
+ CSSPropertyWritingMode = 1271
};
const int firstCSSProperty = 1001;
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLParser.cpp b/src/3rdparty/webkit/WebCore/html/HTMLParser.cpp
index 722f4e2..928a1bf 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLParser.cpp
+++ b/src/3rdparty/webkit/WebCore/html/HTMLParser.cpp
@@ -137,7 +137,7 @@ HTMLParser::HTMLParser(HTMLDocument* doc, bool reportErrors)
, m_reportErrors(reportErrors)
, m_handlingResidualStyleAcrossBlocks(false)
, m_inStrayTableContent(0)
- , m_parserQuirks(m_document->page() ? m_document->page()->chrome()->client()->createHTMLParserQuirks() : 0)
+ , m_parserQuirks(m_document->page() ? m_document->page()->chrome()->client()->createHTMLParserQuirks() : PassOwnPtr<HTMLParserQuirks>(0))
{
}
@@ -155,7 +155,7 @@ HTMLParser::HTMLParser(DocumentFragment* frag)
, m_reportErrors(false)
, m_handlingResidualStyleAcrossBlocks(false)
, m_inStrayTableContent(0)
- , m_parserQuirks(m_document->page() ? m_document->page()->chrome()->client()->createHTMLParserQuirks() : 0)
+ , m_parserQuirks(m_document->page() ? m_document->page()->chrome()->client()->createHTMLParserQuirks() : PassOwnPtr<HTMLParserQuirks>(0))
{
if (frag)
frag->ref();
diff --git a/src/3rdparty/webkit/WebCore/loader/DocumentLoader.cpp b/src/3rdparty/webkit/WebCore/loader/DocumentLoader.cpp
index 87cb725..812d17b 100644
--- a/src/3rdparty/webkit/WebCore/loader/DocumentLoader.cpp
+++ b/src/3rdparty/webkit/WebCore/loader/DocumentLoader.cpp
@@ -519,7 +519,7 @@ ArchiveResource* DocumentLoader::archiveResourceForURL(const KURL& url) const
PassRefPtr<Archive> DocumentLoader::popArchiveForSubframe(const String& frameName)
{
- return m_archiveResourceCollection ? m_archiveResourceCollection->popSubframeArchive(frameName) : 0;
+ return m_archiveResourceCollection ? m_archiveResourceCollection->popSubframeArchive(frameName) : PassRefPtr<Archive>(0);
}
void DocumentLoader::clearArchiveResources()
diff --git a/src/3rdparty/webkit/WebCore/loader/FrameLoader.h b/src/3rdparty/webkit/WebCore/loader/FrameLoader.h
index 58bf2c0..c41e491 100644
--- a/src/3rdparty/webkit/WebCore/loader/FrameLoader.h
+++ b/src/3rdparty/webkit/WebCore/loader/FrameLoader.h
@@ -355,7 +355,7 @@ namespace WebCore {
enum LocalLoadPolicy {
AllowLocalLoadsForAll, // No restriction on local loads.
AllowLocalLoadsForLocalAndSubstituteData,
- AllowLocalLoadsForLocalOnly,
+ AllowLocalLoadsForLocalOnly
};
static void setLocalLoadPolicy(LocalLoadPolicy);
static bool restrictAccessToLocal();
diff --git a/src/3rdparty/webkit/WebCore/loader/FrameLoaderTypes.h b/src/3rdparty/webkit/WebCore/loader/FrameLoaderTypes.h
index c264b47..b3823ba 100644
--- a/src/3rdparty/webkit/WebCore/loader/FrameLoaderTypes.h
+++ b/src/3rdparty/webkit/WebCore/loader/FrameLoaderTypes.h
@@ -42,7 +42,7 @@ namespace WebCore {
enum PolicyAction {
PolicyUse,
PolicyDownload,
- PolicyIgnore,
+ PolicyIgnore
};
enum FrameLoadType {
diff --git a/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheGroup.cpp b/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheGroup.cpp
index dc73353..fd6a8b4 100644
--- a/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheGroup.cpp
+++ b/src/3rdparty/webkit/WebCore/loader/appcache/ApplicationCacheGroup.cpp
@@ -772,7 +772,7 @@ void ApplicationCacheGroup::checkIfLoadIsComplete()
ASSERT(cacheStorage().isMaximumSizeReached() && m_calledReachedMaxAppCacheSize);
}
- RefPtr<ApplicationCache> oldNewestCache = (m_newestCache == m_cacheBeingUpdated) ? 0 : m_newestCache;
+ RefPtr<ApplicationCache> oldNewestCache = (m_newestCache == m_cacheBeingUpdated) ? RefPtr<ApplicationCache>(0) : m_newestCache;
setNewestCache(m_cacheBeingUpdated.release());
if (cacheStorage().storeNewestCache(this)) {
diff --git a/src/3rdparty/webkit/WebCore/loader/archive/ArchiveFactory.cpp b/src/3rdparty/webkit/WebCore/loader/archive/ArchiveFactory.cpp
index 1322dbb..753c3c3 100644
--- a/src/3rdparty/webkit/WebCore/loader/archive/ArchiveFactory.cpp
+++ b/src/3rdparty/webkit/WebCore/loader/archive/ArchiveFactory.cpp
@@ -75,7 +75,7 @@ bool ArchiveFactory::isArchiveMimeType(const String& mimeType)
PassRefPtr<Archive> ArchiveFactory::create(SharedBuffer* data, const String& mimeType)
{
RawDataCreationFunction* function = archiveMIMETypes().get(mimeType);
- return function ? function(data) : 0;
+ return function ? function(data) : PassRefPtr<Archive>(0);
}
void ArchiveFactory::registerKnownArchiveMIMETypes()
diff --git a/src/3rdparty/webkit/WebCore/loader/archive/ArchiveResource.cpp b/src/3rdparty/webkit/WebCore/loader/archive/ArchiveResource.cpp
index 691f66a..b6317da 100644
--- a/src/3rdparty/webkit/WebCore/loader/archive/ArchiveResource.cpp
+++ b/src/3rdparty/webkit/WebCore/loader/archive/ArchiveResource.cpp
@@ -35,17 +35,17 @@ namespace WebCore {
PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const ResourceResponse& response)
{
- return data ? adoptRef(new ArchiveResource(data, url, response)) : 0;
+ return data ? adoptRef(new ArchiveResource(data, url, response)) : PassRefPtr<ArchiveResource>(0);
}
PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName)
{
- return data ? adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName)) : 0;
+ return data ? adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName)) : PassRefPtr<ArchiveResource>(0);
}
PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& resourceResponse)
{
- return data ? adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName, resourceResponse)) : 0;
+ return data ? adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName, resourceResponse)) : PassRefPtr<ArchiveResource>(0);
}
ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const ResourceResponse& response)
diff --git a/src/3rdparty/webkit/WebCore/loader/icon/IconDatabase.cpp b/src/3rdparty/webkit/WebCore/loader/icon/IconDatabase.cpp
index b78291d..7201661 100644
--- a/src/3rdparty/webkit/WebCore/loader/icon/IconDatabase.cpp
+++ b/src/3rdparty/webkit/WebCore/loader/icon/IconDatabase.cpp
@@ -511,7 +511,7 @@ void IconDatabase::setIconDataForIconURL(PassRefPtr<SharedBuffer> dataOriginal,
if (!isOpen() || iconURLOriginal.isEmpty())
return;
- RefPtr<SharedBuffer> data = dataOriginal ? dataOriginal->copy() : 0;
+ RefPtr<SharedBuffer> data = dataOriginal ? dataOriginal->copy() : PassRefPtr<SharedBuffer>(0);
String iconURL = iconURLOriginal.copy();
Vector<String> pageURLs;
diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp b/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp
index e8f9004..c54aab2 100644
--- a/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp
+++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp
@@ -582,7 +582,7 @@ Storage* DOMWindow::localStorage() const
return 0;
StorageNamespace* localStorage = page->group().localStorage();
- RefPtr<StorageArea> storageArea = localStorage ? localStorage->storageArea(document->securityOrigin()) : 0;
+ RefPtr<StorageArea> storageArea = localStorage ? localStorage->storageArea(document->securityOrigin()) : PassRefPtr<StorageArea>(0);
if (storageArea) {
page->inspectorController()->didUseDOMStorage(storageArea.get(), true, m_frame);
m_localStorage = Storage::create(m_frame, storageArea.release());
diff --git a/src/3rdparty/webkit/WebCore/page/animation/AnimationBase.cpp b/src/3rdparty/webkit/WebCore/page/animation/AnimationBase.cpp
index dad763c..8769a59 100644
--- a/src/3rdparty/webkit/WebCore/page/animation/AnimationBase.cpp
+++ b/src/3rdparty/webkit/WebCore/page/animation/AnimationBase.cpp
@@ -144,7 +144,7 @@ static inline TransformOperations blendFunc(const AnimationBase* anim, const Tra
for (unsigned i = 0; i < size; i++) {
RefPtr<TransformOperation> fromOp = (i < fromSize) ? from.operations()[i].get() : 0;
RefPtr<TransformOperation> toOp = (i < toSize) ? to.operations()[i].get() : 0;
- RefPtr<TransformOperation> blendedOp = toOp ? toOp->blend(fromOp.get(), progress) : (fromOp ? fromOp->blend(0, progress, true) : 0);
+ RefPtr<TransformOperation> blendedOp = toOp ? toOp->blend(fromOp.get(), progress) : (fromOp ? fromOp->blend(0, progress, true) : PassRefPtr<TransformOperation>(0));
if (blendedOp)
result.operations().append(blendedOp);
else {
diff --git a/src/3rdparty/webkit/WebCore/platform/PlatformKeyboardEvent.h b/src/3rdparty/webkit/WebCore/platform/PlatformKeyboardEvent.h
index 4a6bc9e..d9701b7 100644
--- a/src/3rdparty/webkit/WebCore/platform/PlatformKeyboardEvent.h
+++ b/src/3rdparty/webkit/WebCore/platform/PlatformKeyboardEvent.h
@@ -81,7 +81,7 @@ namespace WebCore {
AltKey = 1 << 0,
CtrlKey = 1 << 1,
MetaKey = 1 << 2,
- ShiftKey = 1 << 3,
+ ShiftKey = 1 << 3
};
Type type() const { return m_type; }
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollTypes.h b/src/3rdparty/webkit/WebCore/platform/ScrollTypes.h
index eba9055..b0df470 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollTypes.h
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollTypes.h
@@ -53,7 +53,7 @@ namespace WebCore {
enum ScrollbarControlStateMask {
ActiveScrollbarState = 1,
EnabledScrollbarState = 1 << 1,
- PressedScrollbarState = 1 << 2,
+ PressedScrollbarState = 1 << 2
};
enum ScrollbarPart {
@@ -67,7 +67,7 @@ namespace WebCore {
ForwardButtonEndPart = 1 << 6,
ScrollbarBGPart = 1 << 7,
TrackBGPart = 1 << 8,
- AllParts = 0xffffffff,
+ AllParts = 0xffffffff
};
enum ScrollbarButtonsPlacement {
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/BitmapImage.h b/src/3rdparty/webkit/WebCore/platform/graphics/BitmapImage.h
index 8b770a1..a3a0493 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/BitmapImage.h
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/BitmapImage.h
@@ -150,7 +150,7 @@ protected:
enum RepetitionCountStatus {
Unknown, // We haven't checked the source's repetition count.
Uncertain, // We have a repetition count, but it might be wrong (some GIFs have a count after the image data, and will report "loop once" until all data has been decoded).
- Certain, // The repetition count is known to be correct.
+ Certain // The repetition count is known to be correct.
};
BitmapImage(NativeImagePtr, ImageObserver* = 0);
diff --git a/src/3rdparty/webkit/WebCore/platform/image-decoders/ImageDecoder.h b/src/3rdparty/webkit/WebCore/platform/image-decoders/ImageDecoder.h
index 9c2a9d7..494e2bb 100644
--- a/src/3rdparty/webkit/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/src/3rdparty/webkit/WebCore/platform/image-decoders/ImageDecoder.h
@@ -52,7 +52,7 @@ namespace WebCore {
DisposeNotSpecified, // Leave frame in framebuffer
DisposeKeep, // Leave frame in framebuffer
DisposeOverwriteBgcolor, // Clear frame to transparent
- DisposeOverwritePrevious, // Clear frame to previous framebuffer contents
+ DisposeOverwritePrevious // Clear frame to previous framebuffer contents
};
#if PLATFORM(SKIA)
typedef uint32_t PixelData;
diff --git a/src/3rdparty/webkit/WebCore/platform/network/ProtectionSpace.h b/src/3rdparty/webkit/WebCore/platform/network/ProtectionSpace.h
index 9a73cff..b7d4574 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/ProtectionSpace.h
+++ b/src/3rdparty/webkit/WebCore/platform/network/ProtectionSpace.h
@@ -46,7 +46,7 @@ enum ProtectionSpaceAuthenticationScheme {
ProtectionSpaceAuthenticationSchemeHTTPDigest = 3,
ProtectionSpaceAuthenticationSchemeHTMLForm = 4,
ProtectionSpaceAuthenticationSchemeNTLM = 5,
- ProtectionSpaceAuthenticationSchemeNegotiate = 6,
+ ProtectionSpaceAuthenticationSchemeNegotiate = 6
};
class ProtectionSpace {
diff --git a/src/3rdparty/webkit/WebCore/platform/network/ResourceHandleClient.h b/src/3rdparty/webkit/WebCore/platform/network/ResourceHandleClient.h
index c99be54..b8a8cbb 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/ResourceHandleClient.h
+++ b/src/3rdparty/webkit/WebCore/platform/network/ResourceHandleClient.h
@@ -56,7 +56,7 @@ namespace WebCore {
enum CacheStoragePolicy {
StorageAllowed,
StorageAllowedInMemoryOnly,
- StorageNotAllowed,
+ StorageNotAllowed
};
class ResourceHandleClient {
diff --git a/src/3rdparty/webkit/WebCore/platform/network/ResourceRequestBase.h b/src/3rdparty/webkit/WebCore/platform/network/ResourceRequestBase.h
index 2d87d6e..740ebed 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/ResourceRequestBase.h
+++ b/src/3rdparty/webkit/WebCore/platform/network/ResourceRequestBase.h
@@ -41,7 +41,7 @@ namespace WebCore {
UseProtocolCachePolicy, // normal load
ReloadIgnoringCacheData, // reload
ReturnCacheDataElseLoad, // back/forward or encoding change - allow stale data
- ReturnCacheDataDontLoad, // results of a post - allow stale data and only use cache
+ ReturnCacheDataDontLoad // results of a post - allow stale data and only use cache
};
const int unspecifiedTimeoutInterval = INT_MAX;
diff --git a/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h b/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h
index 38439ed..4325925 100644
--- a/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h
+++ b/src/3rdparty/webkit/WebCore/platform/text/StringImpl.h
@@ -199,7 +199,7 @@ private:
enum StringImplFlags {
HasTerminatingNullCharacter,
- InTable,
+ InTable
};
unsigned m_length;
diff --git a/src/3rdparty/webkit/WebCore/platform/text/TextCodec.h b/src/3rdparty/webkit/WebCore/platform/text/TextCodec.h
index 3c74165..36d7c6e 100644
--- a/src/3rdparty/webkit/WebCore/platform/text/TextCodec.h
+++ b/src/3rdparty/webkit/WebCore/platform/text/TextCodec.h
@@ -51,7 +51,7 @@ namespace WebCore {
// Encodes the character as en entity as above, but escaped
// non-alphanumeric characters. This is used in URLs.
// For example, U+6DE would be "%26%231758%3B".
- URLEncodedEntitiesForUnencodables,
+ URLEncodedEntitiesForUnencodables
};
typedef char UnencodableReplacementArray[32];
diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginQuirkSet.h b/src/3rdparty/webkit/WebCore/plugins/PluginQuirkSet.h
index b652c6e..8183050 100644
--- a/src/3rdparty/webkit/WebCore/plugins/PluginQuirkSet.h
+++ b/src/3rdparty/webkit/WebCore/plugins/PluginQuirkSet.h
@@ -45,7 +45,7 @@ namespace WebCore {
PluginQuirkDontClipToZeroRectWhenScrolling = 1 << 9,
PluginQuirkDontSetNullWindowHandleOnDestroy = 1 << 10,
PluginQuirkDontAllowMultipleInstances = 1 << 11,
- PluginQuirkRequiresGtkToolKit = 1 << 12,
+ PluginQuirkRequiresGtkToolKit = 1 << 12
};
class PluginQuirkSet {
diff --git a/src/3rdparty/webkit/WebCore/plugins/npapi.cpp b/src/3rdparty/webkit/WebCore/plugins/npapi.cpp
index 4135b64..d275a39 100644
--- a/src/3rdparty/webkit/WebCore/plugins/npapi.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/npapi.cpp
@@ -171,7 +171,9 @@ void NPN_PopPopupsEnabledState(NPP instance)
pluginViewForInstance(instance)->popPopupsEnabledState();
}
+extern "C" {
void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData)
{
PluginMainThreadScheduler::scheduler().scheduleCall(instance, func, userData);
}
+}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
index 4b6d291..d92746b 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
@@ -3211,7 +3211,7 @@ void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle*)
void RenderLayer::updateScrollCornerStyle()
{
RenderObject* actualRenderer = renderer()->node() ? renderer()->node()->shadowAncestorNode()->renderer() : renderer();
- RefPtr<RenderStyle> corner = renderer()->hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(SCROLLBAR_CORNER, actualRenderer->style()) : 0;
+ RefPtr<RenderStyle> corner = renderer()->hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(SCROLLBAR_CORNER, actualRenderer->style()) : PassRefPtr<RenderStyle>(0);
if (corner) {
if (!m_scrollCorner) {
m_scrollCorner = new (renderer()->renderArena()) RenderScrollbarPart(renderer()->document());
@@ -3227,7 +3227,7 @@ void RenderLayer::updateScrollCornerStyle()
void RenderLayer::updateResizerStyle()
{
RenderObject* actualRenderer = renderer()->node() ? renderer()->node()->shadowAncestorNode()->renderer() : renderer();
- RefPtr<RenderStyle> resizer = renderer()->hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(RESIZER, actualRenderer->style()) : 0;
+ RefPtr<RenderStyle> resizer = renderer()->hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(RESIZER, actualRenderer->style()) : PassRefPtr<RenderStyle>(0);
if (resizer) {
if (!m_resizer) {
m_resizer = new (renderer()->renderArena()) RenderScrollbarPart(renderer()->document());
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
index 1772c66..541002f 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
@@ -298,7 +298,7 @@ public:
enum UpdateLayerPositionsFlag {
DoFullRepaint = 1,
CheckForRepaint = 1 << 1,
- UpdateCompositingLayers = 1 << 2,
+ UpdateCompositingLayers = 1 << 2
};
typedef unsigned UpdateLayerPositionsFlags;
void updateLayerPositions(UpdateLayerPositionsFlags = DoFullRepaint | UpdateCompositingLayers);
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderScrollbar.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderScrollbar.cpp
index db24a06..32cea92 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderScrollbar.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderScrollbar.cpp
@@ -183,7 +183,7 @@ void RenderScrollbar::updateScrollbarPart(ScrollbarPart partType, bool destroy)
if (partType == NoPart)
return;
- RefPtr<RenderStyle> partStyle = !destroy ? getScrollbarPseudoStyle(partType, pseudoForScrollbarPart(partType)) : 0;
+ RefPtr<RenderStyle> partStyle = !destroy ? getScrollbarPseudoStyle(partType, pseudoForScrollbarPart(partType)) : PassRefPtr<RenderStyle>(0);
bool needRenderer = !destroy && partStyle && partStyle->display() != NONE && partStyle->visibility() == VISIBLE;
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTextFragment.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderTextFragment.cpp
index 7da9e5a..1d8fca6 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderTextFragment.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderTextFragment.cpp
@@ -28,7 +28,7 @@
namespace WebCore {
RenderTextFragment::RenderTextFragment(Node* node, StringImpl* str, int startOffset, int length)
- : RenderText(node, str ? str->substring(startOffset, length) : 0)
+ : RenderText(node, str ? str->substring(startOffset, length) : PassRefPtr<StringImpl>(0))
, m_start(startOffset)
, m_end(length)
, m_firstLetter(0)
diff --git a/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp b/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp
index 3a7d3d4..a04b095 100644
--- a/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp
+++ b/src/3rdparty/webkit/WebCore/svg/SVGElement.cpp
@@ -214,7 +214,7 @@ void SVGElement::sendSVGLoadEventIfPossible(bool sendParentLoadEvents)
event->setTarget(currentTarget);
currentTarget->dispatchGenericEvent(event.release());
}
- currentTarget = (parent && parent->isSVGElement()) ? static_pointer_cast<SVGElement>(parent) : 0;
+ currentTarget = (parent && parent->isSVGElement()) ? static_pointer_cast<SVGElement>(parent) : RefPtr<SVGElement>(0);
}
}
diff --git a/src/3rdparty/webkit/WebCore/workers/Worker.cpp b/src/3rdparty/webkit/WebCore/workers/Worker.cpp
index 866687f..22c7d71 100644
--- a/src/3rdparty/webkit/WebCore/workers/Worker.cpp
+++ b/src/3rdparty/webkit/WebCore/workers/Worker.cpp
@@ -74,7 +74,7 @@ void Worker::postMessage(const String& message, ExceptionCode& ec)
void Worker::postMessage(const String& message, MessagePort* messagePort, ExceptionCode& ec)
{
// Disentangle the port in preparation for sending it to the remote context.
- OwnPtr<MessagePortChannel> channel = messagePort ? messagePort->disentangle(ec) : 0;
+ OwnPtr<MessagePortChannel> channel = messagePort ? messagePort->disentangle(ec) : PassOwnPtr<MessagePortChannel>(0);
if (ec)
return;
m_contextProxy->postMessageToWorkerContext(message, channel.release());
diff --git a/src/corelib/arch/qatomic_windows.h b/src/corelib/arch/qatomic_windows.h
index 6082d0b..07b0b25 100644
--- a/src/corelib/arch/qatomic_windows.h
+++ b/src/corelib/arch/qatomic_windows.h
@@ -102,9 +102,14 @@
#define QT_INTERLOCKED_CONCAT(prefix, suffix) \
QT_INTERLOCKED_CONCAT_I(prefix, suffix)
-// MSVC intrinsics prefix function names with an underscore
+// MSVC intrinsics prefix function names with an underscore. Also, if platform
+// SDK headers have been included, the Interlocked names may be defined as
+// macros.
+// To avoid double underscores, we paste the prefix with Interlocked first and
+// then the remainder of the function name.
#define QT_INTERLOCKED_FUNCTION(name) \
- QT_INTERLOCKED_CONCAT(QT_INTERLOCKED_PREFIX, name)
+ QT_INTERLOCKED_CONCAT( \
+ QT_INTERLOCKED_CONCAT(QT_INTERLOCKED_PREFIX, Interlocked), name)
#ifdef QT_INTERLOCKED_NO_VOLATILE
# define QT_INTERLOCKED_VOLATILE
@@ -127,16 +132,16 @@
extern "C" {
- long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( InterlockedIncrement )(long QT_INTERLOCKED_VOLATILE *);
- long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( InterlockedDecrement )(long QT_INTERLOCKED_VOLATILE *);
- long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( InterlockedCompareExchange )(long QT_INTERLOCKED_VOLATILE *, long, long);
- long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( InterlockedExchange )(long QT_INTERLOCKED_VOLATILE *, long);
- long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( InterlockedExchangeAdd )(long QT_INTERLOCKED_VOLATILE *, long);
+ long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( Increment )(long QT_INTERLOCKED_VOLATILE *);
+ long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( Decrement )(long QT_INTERLOCKED_VOLATILE *);
+ long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( CompareExchange )(long QT_INTERLOCKED_VOLATILE *, long, long);
+ long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( Exchange )(long QT_INTERLOCKED_VOLATILE *, long);
+ long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( ExchangeAdd )(long QT_INTERLOCKED_VOLATILE *, long);
# if !defined(Q_OS_WINCE) && !defined(__i386__) && !defined(_M_IX86)
- void * QT_INTERLOCKED_FUNCTION( InterlockedCompareExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *, void *);
- void * QT_INTERLOCKED_FUNCTION( InterlockedExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *);
- __int64 QT_INTERLOCKED_FUNCTION( InterlockedExchangeAdd64 )(__int64 QT_INTERLOCKED_VOLATILE *, __int64);
+ void * QT_INTERLOCKED_FUNCTION( CompareExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *, void *);
+ void * QT_INTERLOCKED_FUNCTION( ExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *);
+ __int64 QT_INTERLOCKED_FUNCTION( ExchangeAdd64 )(__int64 QT_INTERLOCKED_VOLATILE *, __int64);
# endif
}
@@ -156,7 +161,7 @@ extern "C" {
# pragma intrinsic (_InterlockedCompareExchange)
# pragma intrinsic (_InterlockedExchangeAdd)
-# ifndef _M_IX86
+# if !defined(Q_OS_WINCE) && !defined(_M_IX86)
# pragma intrinsic (_InterlockedCompareExchangePointer)
# pragma intrinsic (_InterlockedExchangePointer)
# pragma intrinsic (_InterlockedExchangeAdd64)
@@ -168,26 +173,26 @@ extern "C" {
// Interlocked* replacement macros
#define QT_INTERLOCKED_INCREMENT(value) \
- QT_INTERLOCKED_FUNCTION(InterlockedIncrement)( \
+ QT_INTERLOCKED_FUNCTION( Increment )( \
QT_INTERLOCKED_REMOVE_VOLATILE( value ) )
#define QT_INTERLOCKED_DECREMENT(value) \
- QT_INTERLOCKED_FUNCTION(InterlockedDecrement)( \
+ QT_INTERLOCKED_FUNCTION( Decrement )( \
QT_INTERLOCKED_REMOVE_VOLATILE( value ) )
#define QT_INTERLOCKED_COMPARE_EXCHANGE(value, newValue, expectedValue) \
- QT_INTERLOCKED_FUNCTION(InterlockedCompareExchange)( \
+ QT_INTERLOCKED_FUNCTION( CompareExchange )( \
QT_INTERLOCKED_REMOVE_VOLATILE( value ), \
newValue, \
expectedValue )
#define QT_INTERLOCKED_EXCHANGE(value, newValue) \
- QT_INTERLOCKED_FUNCTION(InterlockedExchange)( \
+ QT_INTERLOCKED_FUNCTION( Exchange )( \
QT_INTERLOCKED_REMOVE_VOLATILE( value ), \
newValue )
#define QT_INTERLOCKED_EXCHANGE_ADD(value, valueToAdd) \
- QT_INTERLOCKED_FUNCTION(InterlockedExchangeAdd)( \
+ QT_INTERLOCKED_FUNCTION( ExchangeAdd )( \
QT_INTERLOCKED_REMOVE_VOLATILE( value ), \
valueToAdd )
@@ -195,36 +200,36 @@ extern "C" {
# define QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(value, newValue, expectedValue) \
reinterpret_cast<void *>( \
- QT_INTERLOCKED_FUNCTION(InterlockedCompareExchange)( \
+ QT_INTERLOCKED_FUNCTION( CompareExchange )( \
QT_INTERLOCKED_REMOVE_VOLATILE( value ## _integral ), \
(long)( newValue ), \
(long)( expectedValue ) ))
# define QT_INTERLOCKED_EXCHANGE_POINTER(value, newValue) \
- QT_INTERLOCKED_FUNCTION(InterlockedExchange)( \
+ QT_INTERLOCKED_FUNCTION( Exchange )( \
QT_INTERLOCKED_REMOVE_VOLATILE( value ## _integral ), \
(quintptr)( newValue ) )
# define QT_INTERLOCKED_EXCHANGE_ADD_POINTER(value, valueToAdd) \
- QT_INTERLOCKED_FUNCTION(InterlockedExchangeAdd)( \
+ QT_INTERLOCKED_FUNCTION( ExchangeAdd )( \
QT_INTERLOCKED_REMOVE_VOLATILE( value ## _integral ), \
valueToAdd )
#else // !defined(Q_OS_WINCE) && !defined(__i386__) && !defined(_M_IX86)
# define QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(value, newValue, expectedValue) \
- QT_INTERLOCKED_FUNCTION(InterlockedCompareExchangePointer)( \
+ QT_INTERLOCKED_FUNCTION( CompareExchangePointer )( \
reinterpret_cast<void * QT_INTERLOCKED_VOLATILE *>( QT_INTERLOCKED_REMOVE_VOLATILE( value ) ), \
newValue, \
expectedValue )
# define QT_INTERLOCKED_EXCHANGE_POINTER(value, newValue) \
- QT_INTERLOCKED_FUNCTION(InterlockedExchangePointer)( \
+ QT_INTERLOCKED_FUNCTION( ExchangePointer )( \
reinterpret_cast<void * QT_INTERLOCKED_VOLATILE *>( QT_INTERLOCKED_REMOVE_VOLATILE( value ) ), \
newValue )
# define QT_INTERLOCKED_EXCHANGE_ADD_POINTER(value, valueToAdd) \
- QT_INTERLOCKED_FUNCTION(InterlockedExchangeAdd64)( \
+ QT_INTERLOCKED_FUNCTION( ExchangeAdd64 )( \
QT_INTERLOCKED_REMOVE_VOLATILE( value ## _integral ), \
valueToAdd )
diff --git a/src/corelib/arch/x86_64/qatomic_sun.s b/src/corelib/arch/x86_64/qatomic_sun.s
index 4517fe4..37969e6 100644
--- a/src/corelib/arch/x86_64/qatomic_sun.s
+++ b/src/corelib/arch/x86_64/qatomic_sun.s
@@ -1,43 +1,3 @@
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!!
-!! Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-!! Contact: Nokia Corporation (qt-info@nokia.com)
-!!
-!! This file is part of the QtGui module of the Qt Toolkit.
-!!
-!! $QT_BEGIN_LICENSE:LGPL$
-!! No Commercial Usage
-!! This file contains pre-release code and may not be distributed.
-!! You may use this file in accordance with the terms and conditions
-!! contained in the Technology Preview License Agreement accompanying
-!! this package.
-!!
-!! GNU Lesser General Public License Usage
-!! Alternatively, this file may be used under the terms of the GNU Lesser
-!! General Public License version 2.1 as published by the Free Software
-!! Foundation and appearing in the file LICENSE.LGPL included in the
-!! packaging of this file. Please review the following information to
-!! ensure the GNU Lesser General Public License version 2.1 requirements
-!! will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-!!
-!! In addition, as a special exception, Nokia gives you certain
-!! additional rights. These rights are described in the Nokia Qt LGPL
-!! Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this
-!! package.
-!!
-!! If you have questions regarding the use of this file, please contact
-!! Nokia at qt-info@nokia.com.
-!!
-!!
-!!
-!!
-!!
-!!
-!!
-!!
-!! $QT_END_LICENSE$
-!!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.code64
.globl q_atomic_increment
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index b7934db..9c308a3 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -331,7 +331,7 @@ public:
WinTimerVec timerVec;
WinTimerDict timerDict;
void registerTimer(WinTimerInfo *t);
- void unregisterTimer(WinTimerInfo *t);
+ void unregisterTimer(WinTimerInfo *t, bool closingDown = false);
void sendTimerEvent(int timerId);
// socket notifiers
@@ -557,10 +557,10 @@ void QEventDispatcherWin32Private::registerTimer(WinTimerInfo *t)
qErrnoWarning("QEventDispatcherWin32::registerTimer: Failed to create a timer");
}
-void QEventDispatcherWin32Private::unregisterTimer(WinTimerInfo *t)
+void QEventDispatcherWin32Private::unregisterTimer(WinTimerInfo *t, bool closingDown)
{
// mark timer as unused
- if (!QObjectPrivate::get(t->obj)->inThreadChangeEvent)
+ if (!QObjectPrivate::get(t->obj)->inThreadChangeEvent && !closingDown)
QAbstractEventDispatcherPrivate::releaseTimerId(t->timerId);
if (t->interval == 0) {
@@ -1019,8 +1019,8 @@ void QEventDispatcherWin32::closingDown()
unregisterSocketNotifier((*(d->sn_except.begin()))->obj);
// clean up any timers
- while (!d->timerDict.isEmpty())
- unregisterTimer((*(d->timerDict.begin()))->timerId);
+ for (int i = 0; i < d->timerVec.count(); ++i)
+ d->unregisterTimer(d->timerVec.at(i), true);
}
bool QEventDispatcherWin32::event(QEvent *e)
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index c0c97b8..e93c6ee 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3965,11 +3965,19 @@ QDebug operator<<(QDebug dbg, const QObject *o) {
\relates QObject
This macro registers one or several \l{QFlags}{flags types} to the
- meta-object system.
+ meta-object system. It is typically used in a class definition to declare
+ that values of a given enum can be used as flags and combined using the
+ bitwise OR operator.
- Example:
+ For example, in QLibrary, the \l{QLibrary::LoadHints}{LoadHints} flag is
+ declared in the following way:
+
+ \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 39a
+
+ The declaration of the flags themselves is performed in the public section
+ of the QLibrary class itself, using the \l Q_DECLARE_FLAGS() macro:
- \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 39
+ \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 39b
\note This macro takes care of registering individual flag values
with the meta-object system, so it is unnecessary to use Q_ENUMS()
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index 6629a6d..dd64ced 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -67,7 +67,6 @@
\o QGraphicsOpacityEffect - renders the item with an opacity
\o QGraphicsPixelizeEffect - pixelizes the item with any pixel size
\o QGraphicsGrayscaleEffect - renders the item in shades of gray
- \o QGraphicsShaderEffect - renders the item with a pixel shader fragment
\endlist
\img graphicseffect-effects.png
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index b7c2e26..eae3e63 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -303,13 +303,17 @@
drop shadow effects and for decoration objects that follow the parent
item's geometry without drawing on top of it.
- \value ItemUsesExtendedStyleOption The item makes use of either the
- exposedRect or matrix member of the QStyleOptionGraphicsItem. Implementers
- of QGraphicsItem subclasses should set that flag if this data is required.
- By default, the exposedRect is initialized to the item's boundingRect and
- the matrix is untransformed. Enable this flag for more fine-grained values.
- Use QStyleOptionGraphicsItem::levelOfDetailFromTransform() for a more
- fine-grained value.
+ \value ItemUsesExtendedStyleOption The item makes use of either
+ \l{QStyleOptionGraphicsItem::}{exposedRect} or
+ \l{QStyleOptionGraphicsItem::}{matrix} in QStyleOptionGraphicsItem. By default,
+ the \l{QStyleOptionGraphicsItem::}{exposedRect} is initialized to the item's
+ boundingRect() and the \l{QStyleOptionGraphicsItem::}{matrix} is untransformed.
+ You can enable this flag for the style options to be set up with more
+ fine-grained values.
+ Note that QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag
+ and always initialized to 1. Use
+ QStyleOptionGraphicsItem::levelOfDetailFromTransform() if you need a higher
+ value.
\value ItemHasNoContents The item does not paint anything (i.e., calling
paint() on the item has no effect). You should set this flag on items that
@@ -4766,7 +4770,7 @@ void QGraphicsItemPrivate::updateCachedClipPathFromSetPosHelper(const QPointF &n
{
Q_ASSERT(inSetPosHelper);
- if (!(ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren))
+ if (inDestructor || !(ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren))
return; // Not clipped by any ancestor.
// Find closest clip ancestor and transform.
@@ -4776,15 +4780,19 @@ void QGraphicsItemPrivate::updateCachedClipPathFromSetPosHelper(const QPointF &n
if (transformData)
thisToParentTransform = transformData->computedFullTransform(&thisToParentTransform);
QGraphicsItem *clipParent = parent;
- while (clipParent && !(clipParent->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape)) {
+ while (clipParent && !clipParent->d_ptr->inDestructor && !(clipParent->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape)) {
thisToParentTransform *= clipParent->d_ptr->transformToParent();
clipParent = clipParent->d_ptr->parent;
}
- // thisToParentTransform is now the same as q->itemTransform(clipParent), except
- // that the new position (which is not yet set on the item) is taken into account.
- Q_ASSERT(clipParent);
- Q_ASSERT(clipParent->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape);
+ // Ensure no parents are currently being deleted. This can only
+ // happen if the item is moved by a dying ancestor.
+ QGraphicsItem *p = clipParent;
+ while (p) {
+ if (p->d_ptr->inDestructor)
+ return;
+ p = p->d_ptr->parent;
+ }
// From here everything is calculated in clip parent's coordinates.
const QRectF parentBoundingRect(clipParent->boundingRect());
@@ -6846,6 +6854,8 @@ void QGraphicsItem::removeFromIndex()
*/
void QGraphicsItem::prepareGeometryChange()
{
+ if (d_ptr->inDestructor)
+ return;
if (d_ptr->scene) {
d_ptr->scene->d_func()->dirtyGrowingItemsBoundingRect = true;
d_ptr->geometryChanged = 1;
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index afabf49..d0f3b99 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -687,11 +687,13 @@ QSizeF QGraphicsWidget::sizeHint(Qt::SizeHint which, const QSizeF &constraint) c
Q_D(const QGraphicsWidget);
QSizeF sh;
if (d->layout) {
- sh = d->layout->effectiveSizeHint(which, constraint);
+ QSizeF marginSize(0,0);
if (d->margins) {
- sh += QSizeF(d->margins[d->Left] + d->margins[d->Right],
+ marginSize = QSizeF(d->margins[d->Left] + d->margins[d->Right],
d->margins[d->Top] + d->margins[d->Bottom]);
}
+ sh = d->layout->effectiveSizeHint(which, constraint - marginSize);
+ sh += marginSize;
} else {
switch (which) {
case Qt::MinimumSize:
diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp
index 787bbb1..bf826a9 100644
--- a/src/gui/graphicsview/qgraphicswidget_p.cpp
+++ b/src/gui/graphicsview/qgraphicswidget_p.cpp
@@ -393,49 +393,162 @@ void QGraphicsWidgetPrivate::windowFrameMousePressEvent(QGraphicsSceneMouseEvent
event->setAccepted(windowData->grabbedSection != Qt::NoSection);
}
+/*!
+ Used to calculate the
+ Precondition:
+ \a widget should support either hfw or wfh
+
+ If \a heightForWidth is set to false, this function will query the width for height
+ instead. \a width will then be interpreted as height, \a minh and \a maxh will be interpreted
+ as minimum width and maximum width.
+ */
+static qreal minimumHeightForWidth(qreal width, qreal minh, qreal maxh,
+ const QGraphicsWidget *widget,
+ bool heightForWidth = true)
+{
+ qreal minimumHeightForWidth = -1;
+ const QSizePolicy sp = widget->layout() ? widget->layout()->sizePolicy() : widget->sizePolicy();
+ const bool hasHFW = sp.hasHeightForWidth();
+ if (hasHFW == heightForWidth) {
+ minimumHeightForWidth = hasHFW
+ ? widget->effectiveSizeHint(Qt::MinimumSize, QSizeF(width, -1)).height()
+ : widget->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, width)).width(); //"width" is here height!
+ } else {
+ // widthForHeight
+ const qreal constraint = width;
+ while (maxh - minh > 0.1) {
+ qreal middle = minh + (maxh - minh)/2;
+ // ### really bad, if we are a widget with a layout it will call
+ // layout->effectiveSizeHint(Qt::MiniumumSize), which again will call
+ // sizeHint three times because of how the cache works
+ qreal hfw = hasHFW
+ ? widget->effectiveSizeHint(Qt::MinimumSize, QSizeF(middle, -1)).height()
+ : widget->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, middle)).width();
+ if (hfw > constraint) {
+ minh = middle;
+ } else if (hfw <= constraint) {
+ maxh = middle;
+ }
+ }
+ minimumHeightForWidth = maxh;
+ }
+ return minimumHeightForWidth;
+}
+
+static qreal minimumWidthForHeight(qreal height, qreal minw, qreal maxw,
+ const QGraphicsWidget *widget)
+{
+ return minimumHeightForWidth(height, minw, maxw, widget, false);
+}
+
+static QSizeF closestAcceptableSize(const QSizeF &proposed,
+ const QGraphicsWidget *widget)
+{
+ const QSizeF current = widget->size();
+
+ qreal minw = proposed.width();
+ qreal maxw = current.width();
+ qreal minh = proposed.height();
+ qreal maxh = current.height();
+
+ qreal middlew = maxw;
+ qreal middleh = maxh;
+ qreal min_hfw;
+ min_hfw = minimumHeightForWidth(maxw, minh, maxh, widget);
+
+ do {
+ if (maxw - minw < 0.1) {
+ // we still havent found anything, cut off binary search
+ minw = maxw;
+ minh = maxh;
+ }
+ middlew = minw + (maxw - minw)/2.0;
+ middleh = minh + (maxh - minh)/2.0;
+
+ min_hfw = minimumHeightForWidth(middlew, minh, maxh, widget);
+
+ if (min_hfw > middleh) {
+ minw = middlew;
+ minh = middleh;
+ } else if (min_hfw <= middleh) {
+ maxw = middlew;
+ maxh = middleh;
+ }
+ } while (maxw != minw);
+
+ min_hfw = minimumHeightForWidth(middlew, minh, maxh, widget);
+
+ QSizeF result;
+ if (min_hfw < maxh) {
+ result = QSizeF(middlew, min_hfw);
+ } else {
+ // Needed because of the cut-off we do above.
+ result = QSizeF(minimumWidthForHeight(maxh, proposed.width(), current.width(), widget), maxh);
+ }
+ return result;
+}
+
static void _q_boundGeometryToSizeConstraints(const QRectF &startGeometry,
QRectF *rect, Qt::WindowFrameSection section,
- const QSizeF &min, const QSizeF &max)
+ const QSizeF &min, const QSizeF &max,
+ const QGraphicsWidget *widget)
{
- int height;
- int width;
+ const QRectF proposedRect = *rect;
+ qreal width = qBound(min.width(), proposedRect.width(), max.width());
+ qreal height = qBound(min.height(), proposedRect.height(), max.height());
+
+ QSizePolicy sp = widget->sizePolicy();
+ if (const QGraphicsLayout *l = widget->layout()) {
+ sp = l->sizePolicy();
+ }
+ const bool hasHFW = sp.hasHeightForWidth(); // || sp.hasWidthForHeight();
+
+ const bool widthChanged = proposedRect.width() < widget->size().width();
+ const bool heightChanged = proposedRect.height() < widget->size().height();
+
+ if (hasHFW) {
+ if (widthChanged || heightChanged) {
+ const qreal minh = min.height();
+ const qreal maxh = max.height();
+ const qreal proposedHFW = minimumHeightForWidth(width, minh, maxh, widget);
+ if (proposedHFW > proposedRect.height()) {
+ QSizeF effectiveSize = closestAcceptableSize(QSizeF(width, height), widget);
+ width = effectiveSize.width();
+ height = effectiveSize.height();
+ }
+ }
+ }
+
switch (section) {
case Qt::LeftSection:
- width = qRound(qBound(min.width(), rect->width(), max.width()));
- rect->setRect(startGeometry.right() - width, startGeometry.top(),
- width, startGeometry.height());
+ rect->setRect(startGeometry.right() - qRound(width), startGeometry.top(),
+ qRound(width), startGeometry.height());
break;
case Qt::TopLeftSection:
- width = qRound(qBound(min.width(), rect->width(), max.width()));
- height = qRound(qBound(min.height(), rect->height(), max.height()));
- rect->setRect(startGeometry.right() - width, startGeometry.bottom() - height,
- width, height);
+ rect->setRect(startGeometry.right() - qRound(width), startGeometry.bottom() - qRound(height),
+ qRound(width), qRound(height));
break;
case Qt::TopSection:
- height = qRound(qBound(min.height(), rect->height(), max.height()));
- rect->setRect(startGeometry.left(), startGeometry.bottom() - height,
- startGeometry.width(), height);
+ rect->setRect(startGeometry.left(), startGeometry.bottom() - qRound(height),
+ startGeometry.width(), qRound(height));
break;
case Qt::TopRightSection:
- height = qRound(qBound(min.height(), rect->height(), max.height()));
- rect->setTop(rect->bottom() - height);
- rect->setWidth(qBound(min.width(), rect->width(), max.width()));
+ rect->setTop(rect->bottom() - qRound(height));
+ rect->setWidth(qRound(width));
break;
case Qt::RightSection:
- rect->setWidth(qBound(min.width(), rect->width(), max.width()));
+ rect->setWidth(qRound(width));
break;
case Qt::BottomRightSection:
- rect->setWidth(qBound(min.width(), rect->width(), max.width()));
- rect->setHeight(qBound(min.height(), rect->height(), max.height()));
+ rect->setWidth(qRound(width));
+ rect->setHeight(qRound(height));
break;
case Qt::BottomSection:
- rect->setHeight(qBound(min.height(), rect->height(), max.height()));
+ rect->setHeight(qRound(height));
break;
case Qt::BottomLeftSection:
- height = qRound(qBound(min.height(), rect->height(), max.height()));
- width = qRound(qBound(min.width(), rect->width(), max.width()));
- rect->setRect(startGeometry.right() - width, startGeometry.top(),
- width, height);
+ rect->setRect(startGeometry.right() - qRound(width), startGeometry.top(),
+ qRound(width), qRound(height));
break;
default:
break;
@@ -506,7 +619,8 @@ void QGraphicsWidgetPrivate::windowFrameMouseMoveEvent(QGraphicsSceneMouseEvent
_q_boundGeometryToSizeConstraints(windowData->startGeometry, &newGeometry,
windowData->grabbedSection,
q->effectiveSizeHint(Qt::MinimumSize),
- q->effectiveSizeHint(Qt::MaximumSize));
+ q->effectiveSizeHint(Qt::MaximumSize),
+ q);
q->setGeometry(newGeometry);
}
}
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index fc801ad..5b5cfa1 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -1804,12 +1804,12 @@ QItemSelection QListViewPrivate::selection(const QRect &rect) const
void QCommonListViewBase::appendHiddenRow(int row)
{
- dd->hiddenRows.append(dd->model->index(row, 0));
+ dd->hiddenRows.append(dd->model->index(row, 0, qq->rootIndex()));
}
void QCommonListViewBase::removeHiddenRow(int row)
{
- dd->hiddenRows.remove(dd->hiddenRows.indexOf(dd->model->index(row, 0)));
+ dd->hiddenRows.remove(dd->hiddenRows.indexOf(dd->model->index(row, 0, qq->rootIndex())));
}
void QCommonListViewBase::updateHorizontalScrollBar(const QSize &step)
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index a61b6fa..0b282bc 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3648,13 +3648,13 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
\i As mentioned above, enabling touch events means multiple widgets can be receiving touch
events simultaneously. Combined with the default QWidget::event() handling for QTouchEvents,
this gives you great flexibility in designing multi-touch user interfaces. Be aware of the
- implications. For example, is is possible that the user is moving a QSlider with one finger and
+ implications. For example, it is possible that the user is moving a QSlider with one finger and
pressing a QPushButton with another. The signals emitted by these widgets will be
interleaved.
\i Recursion into the event loop using one of the exec() methods (e.g., QDialog::exec() or
QMenu::exec()) in a QTouchEvent event handler is not supported. Since there are multiple event
- recipients, unexpected recursion may cause problems, including but not limited to lost events
+ recipients, recursion may cause problems, including but not limited to lost events
and unexpected infinite recursion.
\i QTouchEvents are not affected by a \l{QWidget::grabMouse()}{mouse grab} or an
diff --git a/src/gui/kernel/qsizepolicy.h b/src/gui/kernel/qsizepolicy.h
index 4261dda..eb13788 100644
--- a/src/gui/kernel/qsizepolicy.h
+++ b/src/gui/kernel/qsizepolicy.h
@@ -64,6 +64,7 @@ private:
VMask = HMask << HSize,
CTShift = 9,
CTSize = 5,
+ WFHShift = CTShift + CTSize,
CTMask = ((0x1 << CTSize) - 1) << CTShift,
UnusedShift = CTShift + CTSize,
UnusedSize = 2
@@ -199,6 +200,17 @@ private:
QSizePolicy(int i) : data(i) { }
quint32 data;
+/* use bit flags instead, keep it here for improved readability for now
+ quint32 horzPolicy : 4;
+ quint32 vertPolicy : 4;
+ quint32 hfw : 1;
+ quint32 ctype : 5;
+ quint32 wfh : 1;
+ quint32 padding : 1; // we cannot use the highest bit
+ quint32 horStretch : 8;
+ quint32 verStretch : 8;
+*/
+
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes)
diff --git a/src/gui/kernel/qx11embed_x11.cpp b/src/gui/kernel/qx11embed_x11.cpp
index 8e2eb1e..3140af9 100644
--- a/src/gui/kernel/qx11embed_x11.cpp
+++ b/src/gui/kernel/qx11embed_x11.cpp
@@ -123,8 +123,8 @@ QT_BEGIN_NAMESPACE
emitted.
There are XEmbed widgets available for KDE and GTK+. The GTK+
- equivalent of QX11EmbedWidget is GtkPlug. The KDE widget is called
- QXEmbed.
+ equivalent of QX11EmbedWidget is GtkPlug. The corresponding KDE 3
+ widget is called QXEmbed.
\sa QX11EmbedContainer, {XEmbed Specification}
*/
@@ -177,8 +177,8 @@ QT_BEGIN_NAMESPACE
features such as window activation and focus handling are then
lost.
- The GTK+ equivalent of QX11EmbedContainer is GtkSocket. The KDE
- widget is called QXEmbed.
+ The GTK+ equivalent of QX11EmbedContainer is GtkSocket. The
+ corresponding KDE 3 widget is called QXEmbed.
\sa QX11EmbedWidget, {XEmbed Specification}
*/
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index ab192c5..e9b1bd3 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -4953,15 +4953,18 @@ Q_STATIC_TEMPLATE_FUNCTION void blendTiled(int count, const QSpan *spans, void *
if (modeSource && coverage == 255) {
// Copy the first texture block
- length = image_width;
+ length = qMin(image_width,length);
+ int tx = x;
while (length) {
int l = qMin(image_width - sx, length);
if (buffer_size < l)
l = buffer_size;
- DST *dest = ((DST*)data->rasterBuffer->scanLine(spans->y)) + x;
+ DST *dest = ((DST*)data->rasterBuffer->scanLine(spans->y)) + tx;
const SRC *src = (SRC*)data->texture.scanLine(sy) + sx;
+
qt_memconvert<DST, SRC>(dest, src, l);
length -= l;
+ tx += l;
sx = 0;
}
@@ -4971,8 +4974,8 @@ Q_STATIC_TEMPLATE_FUNCTION void blendTiled(int count, const QSpan *spans, void *
// We are dealing with one block of data
// - More likely to fit in the cache
// - can use memcpy
- int copy_image_width = image_width;
- length = spans->len - image_width;
+ int copy_image_width = qMin(image_width, int(spans->len));
+ length = spans->len - copy_image_width;
DST *src = ((DST*)data->rasterBuffer->scanLine(spans->y)) + x;
DST *dest = src + copy_image_width;
while (copy_image_width < length) {
diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp
index 04ddd7d..4d8b8c9 100644
--- a/src/gui/painting/qpaintbuffer.cpp
+++ b/src/gui/painting/qpaintbuffer.cpp
@@ -239,7 +239,7 @@ bool QPaintBuffer::isEmpty() const
-void QPaintBuffer::draw(QPainter *painter) const
+void QPaintBuffer::draw(QPainter *painter, int frame) const
{
#ifdef QPAINTBUFFER_DEBUG_DRAW
qDebug() << "QPaintBuffer::draw() --------------------------------";
@@ -270,10 +270,10 @@ void QPaintBuffer::draw(QPainter *painter) const
? (QPaintEngineEx *) painter->paintEngine() : 0;
if (xengine) {
QPaintEngineExReplayer player;
- player.draw(*this, painter);
+ player.draw(*this, painter, frame);
} else {
QPainterReplayer player;
- player.draw(*this, painter);
+ player.draw(*this, painter, frame);
}
#ifdef QPAINTBUFFER_DEBUG_DRAW
@@ -1035,17 +1035,31 @@ void QPainterReplayer::setupTransform(QPainter *_painter)
painter->setTransform(m_world_matrix);
}
-void QPainterReplayer::draw(const QPaintBuffer &buffer, QPainter *_painter)
+void QPainterReplayer::draw(const QPaintBuffer &buffer, QPainter *_painter, int frame)
{
d = buffer.d_ptr;
setupTransform(_painter);
- for (int cmdIndex=0; cmdIndex<d->commands.size(); ++cmdIndex) {
+ int frameStart = (frame == 0) ? 0 : d->frames.at(frame-1);
+ int frameEnd = (frame == d->frames.size()) ? d->commands.size() : d->frames.at(frame);
+
+ for (int cmdIndex=frameStart; cmdIndex<frameEnd; ++cmdIndex) {
const QPaintBufferCommand &cmd = d->commands.at(cmdIndex);
process(cmd);
}
}
+void QPaintBuffer::beginNewFrame()
+{
+ if (!d_ptr->commands.isEmpty())
+ d_ptr->frames << d_ptr->commands.size();
+}
+
+int QPaintBuffer::numFrames() const
+{
+ return d_ptr->frames.size() + 1;
+}
+
void QPainterReplayer::process(const QPaintBufferCommand &cmd)
{
switch (cmd.id) {
@@ -1721,24 +1735,99 @@ QDataStream &operator>>(QDataStream &stream, QPaintBufferCommand &command)
return stream;
}
+struct QPaintBufferCacheEntry
+{
+ QVariant::Type type;
+ quint64 cacheKey;
+};
+Q_DECLARE_METATYPE(QPaintBufferCacheEntry);
+
+QDataStream &operator<<(QDataStream &stream, const QPaintBufferCacheEntry &entry)
+{
+ return stream << entry.type << entry.cacheKey;
+}
+
+QDataStream &operator>>(QDataStream &stream, QPaintBufferCacheEntry &entry)
+{
+ return stream >> entry.type >> entry.cacheKey;
+}
+
+static int qRegisterPaintBufferMetaTypes()
+{
+ qRegisterMetaType<QPaintBufferCacheEntry>();
+ qRegisterMetaTypeStreamOperators<QPaintBufferCacheEntry>("QPaintBufferCacheEntry");
+
+ return 0; // something
+}
+
+Q_CONSTRUCTOR_FUNCTION(qRegisterPaintBufferMetaTypes)
+
QDataStream &operator<<(QDataStream &stream, const QPaintBuffer &buffer)
{
+ QHash<qint64, QPixmap> pixmaps;
+ QHash<qint64, QImage> images;
+
+ QVector<QVariant> variants = buffer.d_ptr->variants;
+ for (int i = 0; i < variants.size(); ++i) {
+ const QVariant &v = variants.at(i);
+ if (v.type() == QVariant::Image) {
+ const QImage image(v.value<QImage>());
+ images[image.cacheKey()] = image;
+
+ QPaintBufferCacheEntry entry;
+ entry.type = QVariant::Image;
+ entry.cacheKey = image.cacheKey();
+ variants[i] = QVariant::fromValue(entry);
+ } else if (v.type() == QVariant::Pixmap) {
+ const QPixmap pixmap(v.value<QPixmap>());
+ pixmaps[pixmap.cacheKey()] = pixmap;
+
+ QPaintBufferCacheEntry entry;
+ entry.type = QVariant::Pixmap;
+ entry.cacheKey = pixmap.cacheKey();
+ variants[i] = QVariant::fromValue(entry);
+ }
+ }
+
+ stream << pixmaps;
+ stream << images;
+
stream << buffer.d_ptr->ints;
stream << buffer.d_ptr->floats;
- stream << buffer.d_ptr->variants;
+ stream << variants;
stream << buffer.d_ptr->commands;
stream << buffer.d_ptr->boundingRect;
+ stream << buffer.d_ptr->frames;
return stream;
}
QDataStream &operator>>(QDataStream &stream, QPaintBuffer &buffer)
{
+ QHash<qint64, QPixmap> pixmaps;
+ QHash<qint64, QImage> images;
+
+ stream >> pixmaps;
+ stream >> images;
+
stream >> buffer.d_ptr->ints;
stream >> buffer.d_ptr->floats;
stream >> buffer.d_ptr->variants;
stream >> buffer.d_ptr->commands;
stream >> buffer.d_ptr->boundingRect;
+ stream >> buffer.d_ptr->frames;
+
+ QVector<QVariant> &variants = buffer.d_ptr->variants;
+ for (int i = 0; i < variants.size(); ++i) {
+ const QVariant &v = variants.at(i);
+ if (v.canConvert<QPaintBufferCacheEntry>()) {
+ QPaintBufferCacheEntry entry = v.value<QPaintBufferCacheEntry>();
+ if (entry.type == QVariant::Image)
+ variants[i] = QVariant(images.value(entry.cacheKey));
+ else
+ variants[i] = QVariant(pixmaps.value(entry.cacheKey));
+ }
+ }
return stream;
}
diff --git a/src/gui/painting/qpaintbuffer_p.h b/src/gui/painting/qpaintbuffer_p.h
index b360279..2cb1d7c 100644
--- a/src/gui/painting/qpaintbuffer_p.h
+++ b/src/gui/painting/qpaintbuffer_p.h
@@ -71,7 +71,10 @@ public:
bool isEmpty() const;
- void draw(QPainter *painter) const;
+ void beginNewFrame();
+ int numFrames() const;
+
+ void draw(QPainter *painter, int frame = 0) const;
void setBoundingRect(const QRectF &rect);
QRectF boundingRect() const;
@@ -270,6 +273,7 @@ public:
QVector<QVariant> variants;
QVector<QPaintBufferCommand> commands;
+ QList<int> frames;
QPaintBufferEngine *engine;
QRectF boundingRect;
@@ -306,7 +310,7 @@ public:
void setupTransform(QPainter *painter);
void process(const QPaintBufferCommand &cmd);
- void draw(const QPaintBuffer &buffer, QPainter *painter);
+ void draw(const QPaintBuffer &buffer, QPainter *painter, int frame);
protected:
QPaintBufferPrivate *d;
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index c31a087..b13fb62 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -373,7 +373,11 @@ public:
};
-class Q_GUI_EXPORT QClipData {
+class
+#ifdef Q_WS_QWS
+Q_GUI_EXPORT
+#endif
+QClipData {
public:
QClipData(int height);
~QClipData();
@@ -480,7 +484,11 @@ private:
/*******************************************************************************
* QRasterBuffer
*/
-class Q_GUI_EXPORT QRasterBuffer
+class
+#ifdef Q_WS_QWS
+Q_GUI_EXPORT
+#endif
+QRasterBuffer
{
public:
QRasterBuffer() : m_width(0), m_height(0), m_buffer(0) { init(); }
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index a6bea76..263e53e 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -7545,10 +7545,9 @@ void qt_format_text(const QFont &fnt, const QRectF &_r,
if (!painter)
tf |= Qt::TextDontPrint;
- int maxUnderlines = 0;
+ uint maxUnderlines = 0;
int numUnderlines = 0;
- int underlinePositionStack[32];
- int *underlinePositions = underlinePositionStack;
+ QVarLengthArray<int, 32> underlinePositions(1);
QFontMetricsF fm(fnt);
QString text = str;
@@ -7557,54 +7556,46 @@ start_lengthVariant:
bool hasMoreLengthVariants = false;
// compatible behaviour to the old implementation. Replace
// tabs by spaces
- QChar *chr = text.data() + offset;
- QChar *end = text.data() + text.length();
bool has_tab = false;
- while (chr != end) {
- if (*chr == QLatin1Char('\r') || (singleline && *chr == QLatin1Char('\n'))) {
- *chr = QLatin1Char(' ');
- } else if (*chr == QLatin1Char('\n')) {
- *chr = QChar::LineSeparator;
- } else if (*chr == QLatin1Char('&')) {
+ int old_offset = offset;
+ for (; offset < text.length(); offset++) {
+ QChar chr = text.at(offset);
+ if (chr == QLatin1Char('\r') || (singleline && chr == QLatin1Char('\n'))) {
+ text[offset] = QLatin1Char(' ');
+ } else if (chr == QLatin1Char('\n')) {
+ text[offset] = QChar::LineSeparator;
+ } else if (chr == QLatin1Char('&')) {
++maxUnderlines;
- } else if (*chr == QLatin1Char('\t')) {
+ } else if (chr == QLatin1Char('\t')) {
+ if (!expandtabs) {
+ text[offset] = QLatin1Char(' ');
+ } else if (!tabarraylen && !tabstops) {
+ tabstops = qRound(fm.width(QLatin1Char('x'))*8);
+ }
has_tab = true;
- } else if (*chr == QChar(ushort(0x9c))) {
+ } else if (chr == QChar(ushort(0x9c))) {
// string with multiple length variants
- end = chr;
hasMoreLengthVariants = true;
break;
}
- ++chr;
- }
- if (has_tab) {
- if (!expandtabs) {
- chr = text.data() + offset;
- while (chr != end) {
- if (*chr == QLatin1Char('\t'))
- *chr = QLatin1Char(' ');
- ++chr;
- }
- } else if (!tabarraylen && !tabstops) {
- tabstops = qRound(fm.width(QLatin1Char('x'))*8);
- }
}
- QChar *cout = end;
- if (hidemnmemonic || showmnemonic) {
- if (maxUnderlines > 32)
- underlinePositions = new int[maxUnderlines];
- cout = text.data() + offset;
+ int length = offset - old_offset;
+ if ((hidemnmemonic || showmnemonic) && maxUnderlines > 0) {
+ underlinePositions.resize(maxUnderlines + 1);
+
+ QChar *cout = text.data() + old_offset;
QChar *cin = cout;
- int l = end - cout;
+ int l = length;
while (l) {
if (*cin == QLatin1Char('&')) {
++cin;
+ --length;
--l;
if (!l)
break;
if (*cin != QLatin1Char('&') && !hidemnmemonic)
- underlinePositions[numUnderlines++] = cout - text.unicode();
+ underlinePositions[numUnderlines++] = cout - text.data() - old_offset;
}
*cout = *cin;
++cout;
@@ -7621,7 +7612,7 @@ start_lengthVariant:
qreal height = 0;
qreal width = 0;
- QString finalText = text.mid(offset, cout - (text.data() + offset));
+ QString finalText = text.mid(old_offset, length);
QStackTextEngine engine(finalText, fnt);
if (option) {
engine.option = *option;
@@ -7640,7 +7631,7 @@ start_lengthVariant:
engine.forceJustification = true;
QTextLayout textLayout(&engine);
textLayout.setCacheEnabled(true);
- textLayout.engine()->underlinePositions = underlinePositions;
+ textLayout.engine()->underlinePositions = underlinePositions.data();
if (finalText.isEmpty()) {
height = fm.height();
@@ -7709,7 +7700,7 @@ start_lengthVariant:
QRectF bounds = QRectF(r.x() + xoff, r.y() + yoff, width, height);
if (hasMoreLengthVariants && !(tf & Qt::TextLongestVariant) && !r.contains(bounds)) {
- offset = end - text.data() + 1;
+ offset++;
goto start_lengthVariant;
}
if (brect)
@@ -7738,9 +7729,6 @@ start_lengthVariant:
painter->restore();
}
}
-
- if (underlinePositions != underlinePositionStack)
- delete [] underlinePositions;
}
/*!
diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp
index 882e6bc..882f994 100644
--- a/src/gui/painting/qprinter.cpp
+++ b/src/gui/painting/qprinter.cpp
@@ -1286,6 +1286,23 @@ int QPrinter::numCopies() const
/*!
+ Returns the number of copies that will be printed. The default
+ value is 1.
+
+ This function always returns the actual value specified in the print
+ dialog or using setNumCopies().
+
+ \sa setNumCopies(), numCopies();
+*/
+int QPrinter::actualNumCopies() const
+{
+ Q_D(const QPrinter);
+ return qt_printerRealNumCopies(d->paintEngine);
+}
+
+
+
+/*!
Sets the number of copies to be printed to \a numCopies.
The printer driver reads this setting and prints the specified
diff --git a/src/gui/painting/qprinter.h b/src/gui/painting/qprinter.h
index 46419f4..16f2182 100644
--- a/src/gui/painting/qprinter.h
+++ b/src/gui/painting/qprinter.h
@@ -197,6 +197,8 @@ public:
void setNumCopies(int);
int numCopies() const;
+ int actualNumCopies() const;
+
void setPaperSource(PaperSource);
PaperSource paperSource() const;
diff --git a/src/gui/painting/qrasterizer_p.h b/src/gui/painting/qrasterizer_p.h
index 4cfdbbf..059d772 100644
--- a/src/gui/painting/qrasterizer_p.h
+++ b/src/gui/painting/qrasterizer_p.h
@@ -65,7 +65,11 @@ struct QSpanData;
class QRasterBuffer;
class QRasterizerPrivate;
-class Q_GUI_EXPORT QRasterizer
+class
+#ifdef Q_WS_QWS
+Q_GUI_EXPORT
+#endif
+QRasterizer
{
public:
QRasterizer();
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 41f9ec0..7fefb19 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -1882,7 +1882,6 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
break;
case CE_TabBarTabLabel:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
- // ### consider merging this with SE_TabBarTabText
QStyleOptionTabV3 tabV2(*tab);
QRect tr = tabV2.rect;
bool verticalTabs = tabV2.shape == QTabBar::RoundedEast
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index ef1818d..e7ef51a 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -1951,6 +1951,7 @@ void QMacStyle::polish(QWidget* w)
w->setWindowOpacity(QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5 ? 0.985 : 0.94);
if (!w->testAttribute(Qt::WA_SetPalette)) {
QPixmap px(64, 64);
+ px.fill(Qt::white);
HIThemeMenuDrawInfo mtinfo;
mtinfo.version = qt_mac_hitheme_version;
mtinfo.menuType = kThemeMenuTypePopUp;
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index cead2ac..3d8dec6 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -3948,7 +3948,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
QFont oldFont = p->font();
if (subRule.hasFont)
p->setFont(subRule.font);
- if (subRule.hasBox()) {
+ if (subRule.hasBox() || !subRule.hasNativeBorder()) {
tabCopy.rect = ce == CE_TabBarTabShape ? subRule.borderRect(r)
: subRule.contentsRect(r);
QWindowsStyle::drawControl(ce, &tabCopy, p, w);
@@ -5702,6 +5702,15 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
}
break;
}
+ case SE_TabBarTabText:
+ case SE_TabBarTabLeftButton:
+ case SE_TabBarTabRightButton: {
+ QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab);
+ if (subRule.hasBox() || !subRule.hasNativeBorder()) {
+ return ParentStyle::subElementRect(se, opt, w);
+ }
+ break;
+ }
#endif // QT_NO_TABBAR
case SE_DockWidgetCloseButton:
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index f252444..a38f276 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -1171,7 +1171,7 @@ static void parseShorthandFontProperty(const QVector<Value> &values, QFont *font
{
font->setStyle(QFont::StyleNormal);
font->setWeight(QFont::Normal);
- *fontSizeAdjustment = 0;
+ *fontSizeAdjustment = -255;
int i = 0;
while (i < values.count()) {
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 1bdaceb..e565d0a 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -2521,13 +2521,15 @@ void QTextHtmlExporter::emitBlock(const QTextBlock &block)
default: html += QLatin1String("<ul"); // ### should not happen
}
+ html += QLatin1String(" style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;");
+
if (format.hasProperty(QTextFormat::ListIndent)) {
- html += QLatin1String(" style=\"-qt-list-indent: ");
+ html += QLatin1String(" -qt-list-indent: ");
html += QString::number(format.indent());
- html += QLatin1String(";\"");
+ html += QLatin1Char(';');
}
- html += QLatin1Char('>');
+ html += QLatin1String("\">");
}
html += QLatin1String("<li");
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 2b84c6c..ba9145e 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2245,6 +2245,28 @@ void QTextEngine::indexAdditionalFormats()
}
}
+/* These two helper functions are used to determine whether we need to insert a ZWJ character
+ between the text that gets truncated and the ellipsis. This is important to get
+ correctly shaped results for arabic text.
+*/
+static bool nextCharJoins(const QString &string, int pos)
+{
+ while (pos < string.length() && string.at(pos).category() == QChar::Mark_NonSpacing)
+ ++pos;
+ if (pos == string.length())
+ return false;
+ return string.at(pos).joining() != QChar::OtherJoining;
+}
+
+static bool prevCharJoins(const QString &string, int pos)
+{
+ while (pos > 0 && string.at(pos - 1).category() == QChar::Mark_NonSpacing)
+ --pos;
+ if (pos == 0)
+ return false;
+ return (string.at(pos - 1).joining() == QChar::Dual || string.at(pos - 1).joining() == QChar::Center);
+}
+
QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int flags) const
{
// qDebug() << "elidedText; available width" << width.toReal() << "text width:" << this->width(0, layoutData->string.length()).toReal();
@@ -2345,6 +2367,9 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int
} while (nextBreak < layoutData->string.length()
&& currentWidth < availableWidth);
+ if (nextCharJoins(layoutData->string, pos))
+ ellipsisText.prepend(QChar(0x200d) /* ZWJ */);
+
return layoutData->string.left(pos) + ellipsisText;
} else if (mode == Qt::ElideLeft) {
QFixed currentWidth;
@@ -2362,6 +2387,9 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int
} while (nextBreak > 0
&& currentWidth < availableWidth);
+ if (prevCharJoins(layoutData->string, pos))
+ ellipsisText.append(QChar(0x200d) /* ZWJ */);
+
return ellipsisText + layoutData->string.mid(pos);
} else if (mode == Qt::ElideMiddle) {
QFixed leftWidth;
@@ -2391,6 +2419,11 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int
&& nextRightBreak > 0
&& leftWidth + rightWidth < availableWidth);
+ if (nextCharJoins(layoutData->string, leftPos))
+ ellipsisText.prepend(QChar(0x200d) /* ZWJ */);
+ if (prevCharJoins(layoutData->string, rightPos))
+ ellipsisText.append(QChar(0x200d) /* ZWJ */);
+
return layoutData->string.left(leftPos) + ellipsisText + layoutData->string.mid(rightPos);
}
diff --git a/src/gui/widgets/qdatetimeedit_p.h b/src/gui/widgets/qdatetimeedit_p.h
index 7e1c24d..689b508 100644
--- a/src/gui/widgets/qdatetimeedit_p.h
+++ b/src/gui/widgets/qdatetimeedit_p.h
@@ -89,7 +89,7 @@ public:
QDateTime validateAndInterpret(QString &input, int &, QValidator::State &state,
bool fixup = false) const;
void clearSection(int index);
- virtual QString displayText() const { return edit->displayText(); } // this is from QDateTimeParser
+ virtual QString displayText() const { return edit->text(); } // this is from QDateTimeParser
int absoluteIndex(QDateTimeEdit::Section s, int index) const;
int absoluteIndex(const SectionNode &s) const;
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index bc01e82..2b2504f 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -306,6 +306,7 @@ static QByteArray proxyAuthenticationKey(const QNetworkProxy &proxy, const QStri
case QNetworkProxy::FtpCachingProxy:
key.setScheme(QLatin1String("proxy-ftp"));
+ break;
case QNetworkProxy::DefaultProxy:
case QNetworkProxy::NoProxy:
diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h
index 000de07..ee741aa 100644
--- a/src/network/kernel/qhostinfo_p.h
+++ b/src/network/kernel/qhostinfo_p.h
@@ -47,7 +47,7 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of the QLibrary class. This header file may change from
+// of the QHostInfo class. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
@@ -180,7 +180,8 @@ class QHostInfoPrivate
public:
inline QHostInfoPrivate()
: err(QHostInfo::NoError),
- errorStr(QLatin1String(QT_TRANSLATE_NOOP("QHostInfo", "Unknown error")))
+ errorStr(QLatin1String(QT_TRANSLATE_NOOP("QHostInfo", "Unknown error"))),
+ lookupId(0)
{
}
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index b85a9d2..98740ba 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -453,6 +453,9 @@ QAbstractSocketPrivate::QAbstractSocketPrivate()
peerPort(0),
socketEngine(0),
cachedSocketDescriptor(-1),
+#ifdef Q_OS_LINUX
+ addToBytesAvailable(0),
+#endif
readBufferMaxSize(0),
readBuffer(QABSTRACTSOCKET_BUFFERSIZE),
writeBuffer(QABSTRACTSOCKET_BUFFERSIZE),
@@ -461,6 +464,7 @@ QAbstractSocketPrivate::QAbstractSocketPrivate()
connectTimer(0),
connectTimeElapsed(0),
hostLookupId(-1),
+ socketType(QAbstractSocket::UnknownSocketType),
state(QAbstractSocket::UnconnectedState),
socketError(QAbstractSocket::UnknownSocketError)
{
diff --git a/src/network/socket/qabstractsocket_p.h b/src/network/socket/qabstractsocket_p.h
index 3e292f9..49605c5 100644
--- a/src/network/socket/qabstractsocket_p.h
+++ b/src/network/socket/qabstractsocket_p.h
@@ -47,7 +47,7 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of the QLibrary class. This header file may change from
+// of the QAbstractSocket class. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 458aa7e..560d31f 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -38,7 +38,7 @@ SOURCES += qgl.cpp \
!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl) {
HEADERS += qglshaderprogram.h \
qglpixmapfilter_p.h \
- qgraphicsshadereffect.h \
+ qgraphicsshadereffect_p.h \
qgraphicssystem_gl_p.h \
qwindowsurface_gl_p.h \
qpixmapdata_gl_p.h \
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index dde4eba..9e0c5f8 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -207,9 +207,10 @@ QGLSignalProxy *QGLSignalProxy::instance()
\i \link setSampleBuffers() Multisample buffers.\endlink
\endlist
- You can also specify preferred bit depths for the depth buffer,
- alpha buffer, accumulation buffer and the stencil buffer with the
- functions: setDepthBufferSize(), setAlphaBufferSize(),
+ You can also specify preferred bit depths for the color buffer,
+ depth buffer, alpha buffer, accumulation buffer and the stencil
+ buffer with the functions: setRedBufferSize(), setGreenBufferSize(),
+ setBlueBufferSize(), setDepthBufferSize(), setAlphaBufferSize(),
setAccumBufferSize() and setStencilBufferSize().
Note that even if you specify that you prefer a 32 bit depth
@@ -293,19 +294,20 @@ static inline GLint qgluProject(GLdouble objx, GLdouble objy, GLdouble objz,
}
/*!
- Constructs a QGLFormat object with the factory default settings:
+ Constructs a QGLFormat object with the following default settings:
\list
\i \link setDoubleBuffer() Double buffer:\endlink Enabled.
\i \link setDepth() Depth buffer:\endlink Enabled.
\i \link setRgba() RGBA:\endlink Enabled (i.e., color index disabled).
\i \link setAlpha() Alpha channel:\endlink Disabled.
\i \link setAccum() Accumulator buffer:\endlink Disabled.
- \i \link setStencil() Stencil buffer:\endlink Disabled.
+ \i \link setStencil() Stencil buffer:\endlink Enabled.
\i \link setStereo() Stereo:\endlink Disabled.
\i \link setDirectRendering() Direct rendering:\endlink Enabled.
\i \link setOverlay() Overlay:\endlink Disabled.
\i \link setPlane() Plane:\endlink 0 (i.e., normal plane).
- \i \link setSampleBuffers() Multisample buffers:\endlink Disabled.
+ \i \link setSampleBuffers() Multisample buffers:\endlink Enabled on
+ OpenGL/ES 2.0, disabled on other platforms.
\endlist
*/
@@ -316,26 +318,26 @@ QGLFormat::QGLFormat()
/*!
- Creates a QGLFormat object that is a copy of the current \link
- defaultFormat() application default format\endlink.
+ Creates a QGLFormat object that is a copy of the current
+ defaultFormat().
- If \a options is not 0, this copy is modified by these format
- options. The \a options parameter should be \c FormatOption values
- OR'ed together.
+ If \a options is not 0, the default format is modified by the
+ specified format options. The \a options parameter should be
+ QGL::FormatOption values OR'ed together.
This constructor makes it easy to specify a certain desired format
in classes derived from QGLWidget, for example:
\snippet doc/src/snippets/code/src_opengl_qgl.cpp 3
- Note that there are \c FormatOption values to turn format settings
- both on and off, e.g. \c DepthBuffer and \c NoDepthBuffer,
- \c DirectRendering and \c IndirectRendering, etc.
+ Note that there are QGL::FormatOption values to turn format settings
+ both on and off, e.g. QGL::DepthBuffer and QGL::NoDepthBuffer,
+ QGL::DirectRendering and QGL::IndirectRendering, etc.
The \a plane parameter defaults to 0 and is the plane which this
format should be associated with. Not all OpenGL implementations
supports overlay/underlay rendering planes.
- \sa defaultFormat(), setOption()
+ \sa defaultFormat(), setOption(), setPlane()
*/
QGLFormat::QGLFormat(QGL::FormatOptions options, int plane)
@@ -349,13 +351,26 @@ QGLFormat::QGLFormat(QGL::FormatOptions options, int plane)
}
/*!
+ \internal
+*/
+void QGLFormat::detach()
+{
+ if (d->ref != 1) {
+ QGLFormatPrivate *newd = new QGLFormatPrivate(d);
+ if (!d->ref.deref())
+ delete d;
+ d = newd;
+ }
+}
+
+/*!
Constructs a copy of \a other.
*/
QGLFormat::QGLFormat(const QGLFormat &other)
{
- d = new QGLFormatPrivate;
- *d = *other.d;
+ d = other.d;
+ d->ref.ref();
}
/*!
@@ -364,7 +379,12 @@ QGLFormat::QGLFormat(const QGLFormat &other)
QGLFormat &QGLFormat::operator=(const QGLFormat &other)
{
- *d = *other.d;
+ if (d != other.d) {
+ other.d->ref.ref();
+ if (!d->ref.deref())
+ delete d;
+ d = other.d;
+ }
return *this;
}
@@ -373,7 +393,8 @@ QGLFormat &QGLFormat::operator=(const QGLFormat &other)
*/
QGLFormat::~QGLFormat()
{
- delete d;
+ if (!d->ref.deref())
+ delete d;
}
/*!
@@ -649,6 +670,7 @@ int QGLFormat::samples() const
*/
void QGLFormat::setSamples(int numSamples)
{
+ detach();
if (numSamples < 0) {
qWarning("QGLFormat::setSamples: Cannot have negative number of samples per pixel %d", numSamples);
return;
@@ -676,6 +698,7 @@ void QGLFormat::setSamples(int numSamples)
*/
void QGLFormat::setSwapInterval(int interval)
{
+ detach();
d->swapInterval = interval;
}
@@ -721,7 +744,7 @@ void QGLFormat::setOverlay(bool enable)
is 0, which means the normal plane. The default for overlay
formats is 1, which is the first overlay plane.
- \sa setPlane()
+ \sa setPlane(), defaultOverlayFormat()
*/
int QGLFormat::plane() const
{
@@ -743,6 +766,7 @@ int QGLFormat::plane() const
*/
void QGLFormat::setPlane(int plane)
{
+ detach();
d->pln = plane;
}
@@ -754,6 +778,7 @@ void QGLFormat::setPlane(int plane)
void QGLFormat::setOption(QGL::FormatOptions opt)
{
+ detach();
if (opt & 0xffff)
d->opts |= opt;
else
@@ -783,6 +808,7 @@ bool QGLFormat::testOption(QGL::FormatOptions opt) const
*/
void QGLFormat::setDepthBufferSize(int size)
{
+ detach();
if (size < 0) {
qWarning("QGLFormat::setDepthBufferSize: Cannot set negative depth buffer size %d", size);
return;
@@ -809,6 +835,7 @@ int QGLFormat::depthBufferSize() const
*/
void QGLFormat::setRedBufferSize(int size)
{
+ detach();
if (size < 0) {
qWarning("QGLFormat::setRedBufferSize: Cannot set negative red buffer size %d", size);
return;
@@ -837,6 +864,7 @@ int QGLFormat::redBufferSize() const
*/
void QGLFormat::setGreenBufferSize(int size)
{
+ detach();
if (size < 0) {
qWarning("QGLFormat::setGreenBufferSize: Cannot set negative green buffer size %d", size);
return;
@@ -865,6 +893,7 @@ int QGLFormat::greenBufferSize() const
*/
void QGLFormat::setBlueBufferSize(int size)
{
+ detach();
if (size < 0) {
qWarning("QGLFormat::setBlueBufferSize: Cannot set negative blue buffer size %d", size);
return;
@@ -892,6 +921,7 @@ int QGLFormat::blueBufferSize() const
*/
void QGLFormat::setAlphaBufferSize(int size)
{
+ detach();
if (size < 0) {
qWarning("QGLFormat::setAlphaBufferSize: Cannot set negative alpha buffer size %d", size);
return;
@@ -918,6 +948,7 @@ int QGLFormat::alphaBufferSize() const
*/
void QGLFormat::setAccumBufferSize(int size)
{
+ detach();
if (size < 0) {
qWarning("QGLFormat::setAccumBufferSize: Cannot set negative accumulate buffer size %d", size);
return;
@@ -942,6 +973,7 @@ int QGLFormat::accumBufferSize() const
*/
void QGLFormat::setStencilBufferSize(int size)
{
+ detach();
if (size < 0) {
qWarning("QGLFormat::setStencilBufferSize: Cannot set negative stencil buffer size %d", size);
return;
@@ -1195,7 +1227,7 @@ void QGLFormat::setDefaultFormat(const QGLFormat &f)
/*!
Returns the default QGLFormat for overlay contexts.
- The factory default overlay format is:
+ The default overlay format is:
\list
\i \link setDoubleBuffer() Double buffer:\endlink Disabled.
\i \link setDepth() Depth buffer:\endlink Disabled.
@@ -1206,6 +1238,7 @@ void QGLFormat::setDefaultFormat(const QGLFormat &f)
\i \link setStereo() Stereo:\endlink Disabled.
\i \link setDirectRendering() Direct rendering:\endlink Enabled.
\i \link setOverlay() Overlay:\endlink Disabled.
+ \i \link setSampleBuffers() Multisample buffers:\endlink Disabled.
\i \link setPlane() Plane:\endlink 1 (i.e., first overlay plane).
\endlist
@@ -1256,7 +1289,12 @@ bool operator==(const QGLFormat& a, const QGLFormat& b)
{
return (int) a.d->opts == (int) b.d->opts && a.d->pln == b.d->pln && a.d->alphaSize == b.d->alphaSize
&& a.d->accumSize == b.d->accumSize && a.d->stencilSize == b.d->stencilSize
- && a.d->depthSize == b.d->depthSize;
+ && a.d->depthSize == b.d->depthSize
+ && a.d->redSize == b.d->redSize
+ && a.d->greenSize == b.d->greenSize
+ && a.d->blueSize == b.d->blueSize
+ && a.d->numSamples == b.d->numSamples
+ && a.d->swapInterval == b.d->swapInterval;
}
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index 1d9f623..0d72469 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -255,6 +255,8 @@ public:
private:
QGLFormatPrivate *d;
+ void detach();
+
friend Q_OPENGL_EXPORT bool operator==(const QGLFormat&, const QGLFormat&);
friend Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&);
};
@@ -277,7 +279,6 @@ public:
bool isSharing() const;
void reset();
- // ### Qt 5: make format() return a const ref instead
QGLFormat format() const;
QGLFormat requestedFormat() const;
void setFormat(const QGLFormat& format);
@@ -403,10 +404,6 @@ private:
#endif
friend class QGLFramebufferObject;
friend class QGLFramebufferObjectPrivate;
-#ifdef Q_WS_WIN
- friend bool qt_resolve_GLSL_functions(QGLContext *ctx);
- friend bool qt_createGLSLProgram(QGLContext *ctx, GLuint &program, const char *shader_src, GLuint &shader);
-#endif
private:
Q_DISABLE_COPY(QGLContext)
};
@@ -447,7 +444,6 @@ public:
bool doubleBuffer() const;
void swapBuffers();
- // ### Qt 5: make format() return a const ref instead
QGLFormat format() const;
void setFormat(const QGLFormat& format);
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 72ec35e..d4b7597 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -59,6 +59,7 @@
#include "QtCore/qthread.h"
#include "QtCore/qthreadstorage.h"
#include "QtCore/qhash.h"
+#include "QtCore/qatomic.h"
#include "private/qwidget_p.h"
#include "qcache.h"
@@ -127,7 +128,9 @@ QT_END_INCLUDE_NAMESPACE
class QGLFormatPrivate
{
public:
- QGLFormatPrivate() {
+ QGLFormatPrivate()
+ : ref(1)
+ {
opts = QGL::DoubleBuffer | QGL::DepthBuffer | QGL::Rgba | QGL::DirectRendering | QGL::StencilBuffer;
#if defined(QT_OPENGL_ES_2)
opts |= QGL::SampleBuffers;
@@ -137,6 +140,22 @@ public:
numSamples = -1;
swapInterval = -1;
}
+ QGLFormatPrivate(const QGLFormatPrivate *other)
+ : ref(1),
+ opts(other->opts),
+ pln(other->pln),
+ depthSize(other->depthSize),
+ accumSize(other->accumSize),
+ stencilSize(other->stencilSize),
+ redSize(other->redSize),
+ greenSize(other->greenSize),
+ blueSize(other->blueSize),
+ alphaSize(other->alphaSize),
+ numSamples(other->numSamples),
+ swapInterval(other->swapInterval)
+ {
+ }
+ QAtomicInt ref;
QGL::FormatOptions opts;
int pln;
int depthSize;
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index a03e627..94e3930 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -97,7 +97,7 @@ public:
\i \link setSamples() Number of samples per pixels.\endlink
\i \link setAttachment() Depth and/or stencil attachments.\endlink
\i \link setTextureTarget() Texture target.\endlink
- \i \link setInternalFormat() Internal format.\endlink
+ \i \link setInternalTextureFormat() Internal texture format.\endlink
\endlist
Note that the desired attachments or number of samples per pixels might not
@@ -115,7 +115,7 @@ public:
By default the format specifies a non-multisample framebuffer object with no
attachments, texture target \c GL_TEXTURE_2D, and internal format \c GL_RGBA8.
- \sa samples(), attachment(), target(), internalFormat()
+ \sa samples(), attachment(), target(), internalTextureFormat()
*/
#ifndef QT_OPENGL_ES
@@ -234,23 +234,24 @@ GLenum QGLFramebufferObjectFormat::textureTarget() const
}
/*!
- Sets the internal format of a framebuffer object's texture or multisample
- framebuffer object's color buffer to \a internalFormat.
+ Sets the internal format of a framebuffer object's texture or
+ multisample framebuffer object's color buffer to
+ \a internalTextureFormat.
- \sa internalFormat()
+ \sa internalTextureFormat()
*/
-void QGLFramebufferObjectFormat::setInternalFormat(GLenum internalFormat)
+void QGLFramebufferObjectFormat::setInternalTextureFormat(GLenum internalTextureFormat)
{
- d->internal_format = internalFormat;
+ d->internal_format = internalTextureFormat;
}
/*!
Returns the internal format of a framebuffer object's texture or
multisample framebuffer object's color buffer.
- \sa setInternalFormat()
+ \sa setInternalTextureFormat()
*/
-GLenum QGLFramebufferObjectFormat::internalFormat() const
+GLenum QGLFramebufferObjectFormat::internalTextureFormat() const
{
return d->internal_format;
}
@@ -263,16 +264,16 @@ void QGLFramebufferObjectFormat::setTextureTarget(QMacCompatGLenum target)
}
/*! \internal */
-void QGLFramebufferObjectFormat::setInternalFormat(QMacCompatGLenum internalFormat)
+void QGLFramebufferObjectFormat::setInternalTextureFormat(QMacCompatGLenum internalTextureFormat)
{
- d->internal_format = internalFormat;
+ d->internal_format = internalTextureFormat;
}
#endif
class QGLFramebufferObjectPrivate
{
public:
- QGLFramebufferObjectPrivate() : depth_stencil_buffer(0), valid(false), bound(false), ctx(0), previous_fbo(0), engine(0) {}
+ QGLFramebufferObjectPrivate() : depth_stencil_buffer(0), valid(false), ctx(0), previous_fbo(0), engine(0) {}
~QGLFramebufferObjectPrivate() {}
void init(const QSize& sz, QGLFramebufferObject::Attachment attachment,
@@ -286,7 +287,6 @@ public:
QSize size;
QGLFramebufferObjectFormat format;
uint valid : 1;
- uint bound : 1;
QGLFramebufferObject::Attachment fbo_attachment;
QGLContext *ctx; // for Windows extension ptrs
GLuint previous_fbo;
@@ -479,7 +479,7 @@ void QGLFramebufferObjectPrivate::init(const QSize &sz, QGLFramebufferObject::At
format.setTextureTarget(target);
format.setSamples(int(samples));
format.setAttachment(fbo_attachment);
- format.setInternalFormat(internal_format);
+ format.setInternalTextureFormat(internal_format);
}
/*!
@@ -636,7 +636,7 @@ QGLFramebufferObject::QGLFramebufferObject(const QSize &size, const QGLFramebuff
: d_ptr(new QGLFramebufferObjectPrivate)
{
Q_D(QGLFramebufferObject);
- d->init(size, format.attachment(), format.textureTarget(), format.internalFormat(), format.samples());
+ d->init(size, format.attachment(), format.textureTarget(), format.internalTextureFormat(), format.samples());
}
/*! \overload
@@ -649,7 +649,7 @@ QGLFramebufferObject::QGLFramebufferObject(int width, int height, const QGLFrame
: d_ptr(new QGLFramebufferObjectPrivate)
{
Q_D(QGLFramebufferObject);
- d->init(QSize(width, height), format.attachment(), format.textureTarget(), format.internalFormat(), format.samples());
+ d->init(QSize(width, height), format.attachment(), format.textureTarget(), format.internalTextureFormat(), format.samples());
}
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
@@ -791,7 +791,7 @@ bool QGLFramebufferObject::bind()
Q_D(QGLFramebufferObject);
QGL_FUNC_CONTEXT;
glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->fbo);
- d->bound = d->valid = d->checkFramebufferStatus();
+ d->valid = d->checkFramebufferStatus();
const QGLContext *context = QGLContext::currentContext();
if (d->valid && context) {
// Save the previous setting to automatically restore in release().
@@ -822,7 +822,6 @@ bool QGLFramebufferObject::release()
return false;
Q_D(QGLFramebufferObject);
QGL_FUNC_CONTEXT;
- d->bound = false;
const QGLContext *context = QGLContext::currentContext();
if (context) {
@@ -1101,7 +1100,7 @@ QGLFramebufferObject::Attachment QGLFramebufferObject::attachment() const
bool QGLFramebufferObject::isBound() const
{
Q_D(const QGLFramebufferObject);
- return d->bound;
+ return d->ctx->d_ptr->current_fbo == d->fbo;
}
/*!
diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h
index ad14e50..ec1ae7d 100644
--- a/src/opengl/qglframebufferobject.h
+++ b/src/opengl/qglframebufferobject.h
@@ -151,12 +151,12 @@ public:
void setTextureTarget(GLenum target);
GLenum textureTarget() const;
- void setInternalFormat(GLenum internalFormat);
- GLenum internalFormat() const;
+ void setInternalTextureFormat(GLenum internalTextureFormat);
+ GLenum internalTextureFormat() const;
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
void setTextureTarget(QMacCompatGLenum target);
- void setInternalFormat(QMacCompatGLenum internalFormat);
+ void setInternalTextureFormat(QMacCompatGLenum internalTextureFormat);
#endif
private:
diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp
index 56e5baa..68db9c0 100644
--- a/src/opengl/qglpixmapfilter.cpp
+++ b/src/opengl/qglpixmapfilter.cpp
@@ -324,7 +324,7 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const
filter->setSource(generateBlurShader(radius(), quality() == Qt::SmoothTransformation));
QGLFramebufferObjectFormat format;
- format.setInternalFormat(GLenum(src.hasAlphaChannel() ? GL_RGBA : GL_RGB));
+ format.setInternalTextureFormat(GLenum(src.hasAlphaChannel() ? GL_RGBA : GL_RGB));
QGLFramebufferObject *fbo = qgl_fbo_pool()->acquire(src.size(), format);
if (!fbo)
diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp
index f1558d1..f733109 100644
--- a/src/opengl/qgraphicsshadereffect.cpp
+++ b/src/opengl/qgraphicsshadereffect.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qgraphicsshadereffect.h"
+#include "qgraphicsshadereffect_p.h"
#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
#include "qglshaderprogram.h"
#include "gl2paintengineex/qglcustomshaderstage_p.h"
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
-/*!
+/*#
\class QGraphicsShaderEffect
\brief The QGraphicsShaderEffect class is the base class for creating
custom GLSL shader effects in a QGraphicsScene.
@@ -175,7 +175,7 @@ public:
#endif
};
-/*!
+/*#
Constructs a shader effect and attaches it to \a parent.
*/
QGraphicsShaderEffect::QGraphicsShaderEffect(QObject *parent)
@@ -183,7 +183,7 @@ QGraphicsShaderEffect::QGraphicsShaderEffect(QObject *parent)
{
}
-/*!
+/*#
Destroys this shader effect.
*/
QGraphicsShaderEffect::~QGraphicsShaderEffect()
@@ -194,7 +194,7 @@ QGraphicsShaderEffect::~QGraphicsShaderEffect()
#endif
}
-/*!
+/*#
Returns the source code for the pixel shader fragment for
this shader effect. The default is a shader that copies
its incoming pixmap directly to the output with no effect
@@ -208,7 +208,7 @@ QByteArray QGraphicsShaderEffect::pixelShaderFragment() const
return d->pixelShaderFragment;
}
-/*!
+/*#
Sets the source code for the pixel shader fragment for
this shader effect to \a code.
@@ -238,7 +238,7 @@ void QGraphicsShaderEffect::setPixelShaderFragment(const QByteArray& code)
}
}
-/*!
+/*#
\reimp
*/
void QGraphicsShaderEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
@@ -277,7 +277,7 @@ void QGraphicsShaderEffect::draw(QPainter *painter, QGraphicsEffectSource *sourc
#endif
}
-/*!
+/*#
Sets the custom uniform variables on this shader effect to
be dirty. The setUniforms() function will be called the next
time the shader program corresponding to this effect is used.
@@ -296,7 +296,7 @@ void QGraphicsShaderEffect::setUniformsDirty()
#endif
}
-/*!
+/*#
Sets custom uniform variables on the current GL context when
\a program is about to be used by the paint engine.
diff --git a/src/opengl/qgraphicsshadereffect.h b/src/opengl/qgraphicsshadereffect_p.h
index a186074..a313846 100644
--- a/src/opengl/qgraphicsshadereffect.h
+++ b/src/opengl/qgraphicsshadereffect_p.h
@@ -39,8 +39,19 @@
**
****************************************************************************/
-#ifndef QGRAPHICSSHADEREFFECT_H
-#define QGRAPHICSSHADEREFFECT_H
+#ifndef QGRAPHICSSHADEREFFECT_P_H
+#define QGRAPHICSSHADEREFFECT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <QtGui/qgraphicseffect.h>
@@ -80,4 +91,4 @@ QT_END_NAMESPACE
QT_END_HEADER
-#endif // QGRAPHICSSHADEREFFECT_H
+#endif // QGRAPHICSSHADEREFFECT_P_H
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index b6f5012..d63d2ad 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -84,7 +84,7 @@ QGLFramebufferObject *QGLFramebufferObjectPool::acquire(const QSize &requestSize
if (format.samples() == requestFormat.samples()
&& format.attachment() == requestFormat.attachment()
&& format.textureTarget() == requestFormat.textureTarget()
- && format.internalFormat() == requestFormat.internalFormat())
+ && format.internalTextureFormat() == requestFormat.internalTextureFormat())
{
// choose the fbo with a matching format and the closest size
if (!candidate || areaDiff(requestSize, candidate) > areaDiff(requestSize, fbo))
@@ -467,7 +467,7 @@ QPaintEngine* QGLPixmapData::paintEngine() const
QGLFramebufferObjectFormat format;
format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
format.setSamples(4);
- format.setInternalFormat(GLenum(m_hasAlpha ? GL_RGBA : GL_RGB));
+ format.setInternalTextureFormat(GLenum(m_hasAlpha ? GL_RGBA : GL_RGB));
m_renderFbo = qgl_fbo_pool()->acquire(size(), format);
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index f974938..a85b9ae 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -569,7 +569,7 @@ void QGLWindowSurface::updateGeometry()
QGLFramebufferObjectFormat format;
format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
- format.setInternalFormat(GLenum(GL_RGBA));
+ format.setInternalTextureFormat(GLenum(GL_RGBA));
format.setTextureTarget(target);
if (QGLExtensions::glExtensions & QGLExtensions::FramebufferBlit)
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 6535d65..2630348 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -925,12 +925,12 @@ void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints)
void QDirectFBPaintEnginePrivate::prepareForBlit(bool alpha)
{
- quint32 blittingFlags = alpha ? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX;
+ DFBSurfaceBlittingFlags blittingFlags = alpha ? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX;
if (opacity != 255) {
blittingFlags |= DSBLIT_BLEND_COLORALPHA;
}
surface->SetColor(surface, 0xff, 0xff, 0xff, opacity);
- surface->SetBlittingFlags(surface, DFBSurfaceBlittingFlags(blittingFlags));
+ surface->SetBlittingFlags(surface, blittingFlags);
}
static inline uint ALPHA_MUL(uint x, uint a)
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 211e8a5..84a74c9 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -79,6 +79,7 @@ public:
IDirectFBScreen *dfbScreen;
#ifdef QT_NO_DIRECTFB_WM
IDirectFBSurface *primarySurface;
+ QColor backgroundColor;
#endif
#ifndef QT_NO_DIRECTFB_LAYER
IDirectFBDisplayLayer *dfbLayer;
@@ -94,7 +95,6 @@ public:
#if defined QT_DIRECTFB_IMAGEPROVIDER && defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
IDirectFBImageProvider *imageProvider;
#endif
- QColor backgroundColor;
IDirectFBSurface *cursorSurface;
qint64 cursorImageKey;
@@ -1277,10 +1277,9 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive))
printDirectFBInfo(d_ptr->dfb, surface);
#endif
-#ifndef QT_NO_DIRECTFB_WM
+#ifdef QT_DIRECTFB_WM
surface->Release(surface);
-#endif
-
+#else
QRegExp backgroundColorRegExp(QLatin1String("bgcolor=?(.+)"));
backgroundColorRegExp.setCaseSensitivity(Qt::CaseInsensitive);
if (displayArgs.indexOf(backgroundColorRegExp) != -1) {
@@ -1288,6 +1287,11 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
}
if (!d_ptr->backgroundColor.isValid())
d_ptr->backgroundColor = Qt::green;
+ d_ptr->primarySurface->Clear(d_ptr->primarySurface, d_ptr->backgroundColor.red(),
+ d_ptr->backgroundColor.green(), d_ptr->backgroundColor.blue(),
+ d_ptr->backgroundColor.alpha());
+ d_ptr->primarySurface->Flip(d_ptr->primarySurface, 0, d_ptr->flipFlags);
+#endif
return true;
}
@@ -1568,11 +1572,6 @@ void QDirectFBScreen::solidFill(const QColor &color, const QRegion &region)
#endif
}
-void QDirectFBScreen::erase(const QRegion &region)
-{
- solidFill(d_ptr->backgroundColor, region);
-}
-
QImage::Format QDirectFBScreen::alphaPixmapFormat() const
{
return d_ptr->alphaPixmapFormat;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
index 0ce7a53..46d06ef 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
@@ -215,7 +215,6 @@ public:
void flipSurface(IDirectFBSurface *surface, DFBSurfaceFlipFlags flipFlags,
const QRegion &region, const QPoint &offset);
void releaseDFBSurface(IDirectFBSurface *surface);
- void erase(const QRegion &region);
using QScreen::depth;
static int depth(DFBSurfacePixelFormat format);
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index 61cfec51..b1ffe69 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -43,6 +43,7 @@
#include "qdirectfbscreen.h"
#include "qdirectfbpaintengine.h"
+#include <private/qwidget_p.h>
#include <qwidget.h>
#include <qwindowsystem_qws.h>
#include <qpaintdevice.h>
@@ -247,10 +248,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect)
updateFormat();
QWSWindowSurface::setGeometry(rect);
-#ifdef QT_NO_DIRECTFB_WM
- if (oldRect.isEmpty())
- screen->exposeRegion(screen->region(), 0);
-#endif
}
QByteArray QDirectFBWindowSurface::permanentState() const
@@ -319,48 +316,48 @@ inline bool isWidgetOpaque(const QWidget *w)
return false;
}
-
-void QDirectFBWindowSurface::flush(QWidget *, const QRegion &region,
+void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion &region,
const QPoint &offset)
{
- // hw: make sure opacity information is updated before compositing
- if (QWidget *win = window()) {
+ QWidget *win = window();
+ if (!win)
+ return;
- const bool opaque = isWidgetOpaque(win);
- if (opaque != isOpaque()) {
- SurfaceFlags flags = surfaceFlags();
- if (opaque) {
- flags |= Opaque;
- } else {
- flags &= ~Opaque;
- }
- setSurfaceFlags(flags);
+ QWExtra *extra = qt_widget_private(widget)->extraData();
+ if (extra && extra->proxyWidget)
+ return;
+
+ // hw: make sure opacity information is updated before compositing
+ const bool opaque = isWidgetOpaque(win);
+ if (opaque != isOpaque()) {
+ SurfaceFlags flags = surfaceFlags();
+ if (opaque) {
+ flags |= Opaque;
+ } else {
+ flags &= ~Opaque;
}
+ setSurfaceFlags(flags);
+ }
#ifndef QT_NO_DIRECTFB_WM
- const quint8 winOpacity = quint8(win->windowOpacity() * 255);
- quint8 opacity;
+ const quint8 winOpacity = quint8(win->windowOpacity() * 255);
+ quint8 opacity;
- if (dfbWindow) {
- dfbWindow->GetOpacity(dfbWindow, &opacity);
- if (winOpacity != opacity)
- dfbWindow->SetOpacity(dfbWindow, winOpacity);
- }
-#endif
+ if (dfbWindow) {
+ dfbWindow->GetOpacity(dfbWindow, &opacity);
+ if (winOpacity != opacity)
+ dfbWindow->SetOpacity(dfbWindow, winOpacity);
}
+#endif
const QRect windowGeometry = QDirectFBWindowSurface::geometry();
#ifdef QT_NO_DIRECTFB_WM
if (mode == Offscreen) {
- QRegion r = region;
- r.translate(offset + windowGeometry.topLeft());
- screen->exposeRegion(r, 0);
- } else {
- screen->flipSurface(dfbSurface, flipFlags, region, offset);
- }
-#else
- screen->flipSurface(dfbSurface, flipFlags, region, offset);
+ screen->exposeRegion(region.translated(offset + geometry().topLeft()), 0);
+
+ } else
#endif
+ screen->flipSurface(dfbSurface, flipFlags, region, offset);
#ifdef QT_DIRECTFB_TIMING
enum { Secs = 3 };
diff --git a/src/plugins/graphicssystems/trace/qgraphicssystem_trace.cpp b/src/plugins/graphicssystems/trace/qgraphicssystem_trace.cpp
index 36a8df1..bbb6536 100644
--- a/src/plugins/graphicssystems/trace/qgraphicssystem_trace.cpp
+++ b/src/plugins/graphicssystems/trace/qgraphicssystem_trace.cpp
@@ -57,30 +57,35 @@ public:
~QTraceWindowSurface();
QPaintDevice *paintDevice();
+ void beginPaint(const QRegion &rgn);
void endPaint(const QRegion &rgn);
+ bool scroll(const QRegion &area, int dx, int dy);
+
private:
QPaintBuffer *buffer;
+ QList<QRegion> updates;
- QFile *outputFile;
- QDataStream *out;
-
- int frameId;
+ qulonglong winId;
};
QTraceWindowSurface::QTraceWindowSurface(QWidget *widget)
: QRasterWindowSurface(widget)
, buffer(0)
- , outputFile(0)
- , out(0)
- , frameId(0)
+ , winId(0)
{
}
QTraceWindowSurface::~QTraceWindowSurface()
{
- delete out;
- delete outputFile;
+ if (buffer) {
+ QFile outputFile(QString(QLatin1String("qtgraphics-%0.trace")).arg(winId));
+ if (outputFile.open(QIODevice::WriteOnly)) {
+ QDataStream out(&outputFile);
+ out << *buffer << updates;
+ }
+ delete buffer;
+ }
}
QPaintDevice *QTraceWindowSurface::paintDevice()
@@ -92,28 +97,33 @@ QPaintDevice *QTraceWindowSurface::paintDevice()
return buffer;
}
-void QTraceWindowSurface::endPaint(const QRegion &rgn)
+void QTraceWindowSurface::beginPaint(const QRegion &rgn)
{
- if (!out) {
- outputFile = new QFile(QString(QLatin1String("qtgraphics-%0.trace")).arg((qulonglong)window()->winId()));
- if (outputFile->open(QIODevice::WriteOnly))
- out = new QDataStream(outputFile);
- }
+ // ensure paint buffer is created
+ paintDevice();
+ buffer->beginNewFrame();
+
+ QRasterWindowSurface::beginPaint(rgn);
+}
+void QTraceWindowSurface::endPaint(const QRegion &rgn)
+{
QPainter p(QRasterWindowSurface::paintDevice());
- buffer->draw(&p);
+ buffer->draw(&p, buffer->numFrames()-1);
p.end();
- if (out) {
- *out << frameId++;
- *out << (qulonglong)window()->winId();
- *out << geometry();
- *out << rgn;
- *out << *buffer;
- }
+ winId = (qulonglong)window()->winId();
+
+ updates << rgn;
- delete buffer;
- buffer = 0;
+ QRasterWindowSurface::endPaint(rgn);
+}
+
+bool QTraceWindowSurface::scroll(const QRegion &, int, int)
+{
+ // TODO: scrolling should also be streamed and replayed
+ // to test scrolling performance
+ return false;
}
QTraceGraphicsSystem::QTraceGraphicsSystem()
diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index 333a415..13bc6a6 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -146,11 +146,7 @@ void QScriptEngineAgentPrivate::returnEvent(const JSC::DebuggerCallFrame& frame,
{
Q_UNUSED(frame);
Q_UNUSED(lineno);
-#if ENABLE(JIT)
- functionExit(JSC::JSValue(), sourceID);
-#else
Q_UNUSED(sourceID);
-#endif
}
void QScriptEngineAgentPrivate::exceptionThrow(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, bool hasHandler)
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index bd5d161..ecfb060 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -610,7 +610,7 @@ static JSC::JSValue callQtMethod(JSC::ExecState *exec, QMetaMethod::MethodType c
if (i < (int)scriptArgs.size())
actual = engine->scriptValueFromJSCValue(scriptArgs.at(i));
else
- actual = QScriptValue::QScriptValue(QScriptValue::UndefinedValue);
+ actual = QScriptValue(QScriptValue::UndefinedValue);
QScriptMetaType argType = mtd.argumentType(i);
int tid = -1;
QVariant v;
diff --git a/src/sql/drivers/db2/qsql_db2.cpp b/src/sql/drivers/db2/qsql_db2.cpp
index 6187e6b..7bbe122 100644
--- a/src/sql/drivers/db2/qsql_db2.cpp
+++ b/src/sql/drivers/db2/qsql_db2.cpp
@@ -908,8 +908,9 @@ bool QDB2Result::fetchFirst()
SQL_FETCH_FIRST,
0);
if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) {
- setLastError(qMakeError(QCoreApplication::translate("QDB2Result", "Unable to fetch first"),
- QSqlError::StatementError, d));
+ if(r!= SQL_NO_DATA)
+ setLastError(qMakeError(QCoreApplication::translate("QDB2Result", "Unable to fetch first"),
+ QSqlError::StatementError, d));
return false;
}
setAt(0);
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index e2c3d92..35b8595 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -810,24 +810,27 @@ static bool resolveColor(const QStringRef &colorStr, QColor &color, QSvgHandler
case 'r':
{
- // starts with "rgb("
- if (colorStrTr == QLatin1String("rgb(")) {
+ // starts with "rgb(", ends with ")" and consists of at least 7 characters "rgb(,,)"
+ if (colorStrTr.length() >= 7 && colorStrTr.at(colorStrTr.length() - 1) == QLatin1Char(')')
+ && QStringRef(colorStrTr.string(), colorStrTr.position(), 4) == QLatin1String("rgb(")) {
const QChar *s = colorStrTr.constData() + 4;
QVector<qreal> compo = parseNumbersList(s);
//1 means that it failed after reaching non-parsable
//character which is going to be "%"
if (compo.size() == 1) {
- const QChar *s = colorStrTr.constData() + 4;
+ s = colorStrTr.constData() + 4;
compo = parsePercentageList(s);
- compo[0] *= (qreal)2.55;
- compo[1] *= (qreal)2.55;
- compo[2] *= (qreal)2.55;
+ for (int i = 0; i < compo.size(); ++i)
+ compo[i] *= (qreal)2.55;
}
- color = QColor(int(compo[0]),
- int(compo[1]),
- int(compo[2]));
- return true;
+ if (compo.size() == 3) {
+ color = QColor(int(compo[0]),
+ int(compo[1]),
+ int(compo[2]));
+ return true;
+ }
+ return false;
}
}
break;
diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h
index 9d23c8b..1ab7401 100644
--- a/src/testlib/qtestmouse.h
+++ b/src/testlib/qtestmouse.h
@@ -113,8 +113,12 @@ namespace QTest
QTEST_ASSERT(false);
}
QSpontaneKeyEvent::setSpontaneous(&me);
- if (!qApp->notify(widget, &me))
- QTest::qWarn("Mouse event not accepted by receiving widget");
+ if (!qApp->notify(widget, &me)) {
+ static const char *mouseActionNames[] =
+ { "MousePress", "MouseRelease", "MouseClick", "MouseDClick", "MouseMove" };
+ QString warning = QString::fromLatin1("Mouse event \"%1\" not accepted by receiving widget");
+ QTest::qWarn(warning.arg(QString::fromLatin1(mouseActionNames[static_cast<int>(action)])).toAscii().data());
+ }
}