Title: [89617] trunk/Source
Revision
89617
Author
alexis.men...@openbossa.org
Date
2011-06-23 14:42:52 -0700 (Thu, 23 Jun 2011)

Log Message

2011-06-23  Alexis Menard  <alexis.men...@openbossa.org>

        Reviewed by Eric Carlson.

        [Qt] Implement fullscreen support on Mac with the QuickTime backend.
        https://bugs.webkit.org/show_bug.cgi?id=61728

        Implement fullscreen support for Qt when using the QuickTime backend.
        We mostly use what is already done for the Mac port.

        * DerivedSources.pro: We use the mac files and they have <WebCore/x> type
        of includes. We need to generate those headers.
        * WebCore.pro:
        * platform/mac/WebVideoFullscreenController.h:
        * platform/mac/WebVideoFullscreenController.mm:
        * platform/mac/WebVideoFullscreenHUDWindowController.h:
        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
        * platform/qt/WebCoreSystemInterface.h:
        * platform/qt/WebCoreSystemInterface.mm:
2011-06-23  Alexis Menard  <alexis.men...@openbossa.org>

        Reviewed by Eric Carlson.

        [Qt] Implement fullscreen support on Mac with the QuickTime backend.
        https://bugs.webkit.org/show_bug.cgi?id=61728

        Implement fullscreen support for Qt when using the QuickTime backend.
        We mostly use what is already done for the Mac port.

        * QtWebKit.pro:
        * WebCoreSupport/ChromeClientQt.cpp:
        (WebCore::ChromeClientQt::ChromeClientQt):
        (WebCore::ChromeClientQt::~ChromeClientQt):
        * WebCoreSupport/ChromeClientQt.h:
        * WebCoreSupport/FullScreenVideoQt.cpp:
        (WebCore::FullScreenVideoQt::FullScreenVideoQt):
        (WebCore::FullScreenVideoQt::~FullScreenVideoQt):
        (WebCore::FullScreenVideoQt::enterFullScreenForNode):
        (WebCore::FullScreenVideoQt::exitFullScreenForNode):
        (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback):
        (WebCore::FullScreenVideoQt::isValid):
        * WebCoreSupport/FullScreenVideoQt.h:
        * WebCoreSupport/QTKitFullScreenVideoHandler.h: Added.
        * WebCoreSupport/QTKitFullScreenVideoHandler.mm: Added.
        (QTKitFullScreenVideoHandler::QTKitFullScreenVideoHandler):
        (QTKitFullScreenVideoHandler::~QTKitFullScreenVideoHandler):
        (QTKitFullScreenVideoHandler::enterFullScreen):
        (QTKitFullScreenVideoHandler::exitFullScreen):
        * WebCoreSupport/WebSystemInterface.mm:
        (InitWebCoreSystemInterface):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89616 => 89617)


--- trunk/Source/WebCore/ChangeLog	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebCore/ChangeLog	2011-06-23 21:42:52 UTC (rev 89617)
@@ -1,3 +1,23 @@
+2011-06-23  Alexis Menard  <alexis.men...@openbossa.org>
+
+        Reviewed by Eric Carlson.
+
+        [Qt] Implement fullscreen support on Mac with the QuickTime backend.
+        https://bugs.webkit.org/show_bug.cgi?id=61728
+
+        Implement fullscreen support for Qt when using the QuickTime backend.
+        We mostly use what is already done for the Mac port.
+
+        * DerivedSources.pro: We use the mac files and they have <WebCore/x> type
+        of includes. We need to generate those headers.
+        * WebCore.pro:
+        * platform/mac/WebVideoFullscreenController.h:
+        * platform/mac/WebVideoFullscreenController.mm:
+        * platform/mac/WebVideoFullscreenHUDWindowController.h:
+        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
+        * platform/qt/WebCoreSystemInterface.h:
+        * platform/qt/WebCoreSystemInterface.mm:
+
 2011-06-23  Darin Adler  <da...@apple.com>
 
         Reviewed by Ryosuke Niwa.

Modified: trunk/Source/WebCore/DerivedSources.pro (89616 => 89617)


--- trunk/Source/WebCore/DerivedSources.pro	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebCore/DerivedSources.pro	2011-06-23 21:42:52 UTC (rev 89617)
@@ -27,4 +27,12 @@
     return(true)
 }
 
+contains(DEFINES, USE_QTKIT=1) {
+    SRC_ROOT_DIR = $$replace(PWD, /Source/WebCore, "")
+    fwheader_generator.commands = perl $${SRC_ROOT_DIR}/Source/WebKit2/Scripts/generate-forwarding-headers.pl $${SRC_ROOT_DIR}/Source/WebKit2 ../include mac
+    fwheader_generator.depends  = $${SRC_ROOT_DIR}/Source/WebKit2/Scripts/generate-forwarding-headers.pl
+    generated_files.depends     += fwheader_generator
+    QMAKE_EXTRA_TARGETS         += fwheader_generator
+}
+
 include(CodeGenerators.pri)

Modified: trunk/Source/WebCore/WebCore.pro (89616 => 89617)


--- trunk/Source/WebCore/WebCore.pro	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebCore/WebCore.pro	2011-06-23 21:42:52 UTC (rev 89617)
@@ -2997,26 +2997,38 @@
     }
 
     contains(DEFINES, USE_QTKIT=1) {
+        INCLUDEPATH += \
+            $$SOURCE_DIR/../WebKitLibraries/
+
         HEADERS += \
             platform/graphics/mac/MediaPlayerPrivateQTKit.h \
             platform/mac/WebCoreObjCExtras.h \
             platform/qt/WebCoreSystemInterface.h \
             platform/mac/BlockExceptions.h \
-            platform/mac/WebCoreObjCExtras.h
+            platform/mac/WebCoreObjCExtras.h \
+            platform/mac/WebVideoFullscreenController.h \
+            platform/mac/WebVideoFullscreenHUDWindowController.h \
+            platform/mac/WebWindowAnimation.h
+
         SOURCES += \
+            platform/graphics/cg/IntRectCG.cpp \
+            platform/graphics/cg/FloatSizeCG.cpp \
+            platform/cf/SharedBufferCF.cpp \
+            platform/cf/KURLCFNet.cpp
+
+         OBJECTIVE_SOURCES += \
+            platform/qt/WebCoreSystemInterface.mm \
+            platform/mac/BlockExceptions.mm \
+            platform/mac/WebCoreObjCExtras.mm \
             platform/graphics/mac/MediaPlayerPrivateQTKit.mm \
             platform/mac/SharedBufferMac.mm \
             platform/mac/KURLMac.mm \
             platform/text/mac/StringMac.mm \
             platform/graphics/mac/FloatSizeMac.mm \
             platform/graphics/mac/IntRectMac.mm \
-            platform/graphics/cg/IntRectCG.cpp \
-            platform/graphics/cg/FloatSizeCG.cpp \
-            platform/cf/SharedBufferCF.cpp \
-            platform/cf/KURLCFNet.cpp \
-            platform/qt/WebCoreSystemInterface.mm \
-            platform/mac/BlockExceptions.mm \
-            platform/mac/WebCoreObjCExtras.mm
+            platform/mac/WebVideoFullscreenController.mm \
+            platform/mac/WebVideoFullscreenHUDWindowController.mm \
+            platform/mac/WebWindowAnimation.mm
 
         DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 

Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.h (89616 => 89617)


--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.h	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.h	2011-06-23 21:42:52 UTC (rev 89617)
@@ -25,6 +25,7 @@
 
 #if ENABLE(VIDEO)
 
+#import <Cocoa/Cocoa.h>
 #import <wtf/RefPtr.h>
 
 namespace WebCore {

Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm (89616 => 89617)


--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm	2011-06-23 21:42:52 UTC (rev 89617)
@@ -31,9 +31,8 @@
 
 #import "WebVideoFullscreenHUDWindowController.h"
 #import "WebWindowAnimation.h"
-#import <HIToolbox/MacApplication.h>
+#import <Carbon/Carbon.h>
 #import <IOKit/pwr_mgt/IOPMLib.h>
-#import <OSServices/Power.h>
 #import <QTKit/QTKit.h>
 #import <WebCore/HTMLMediaElement.h>
 #import <WebCore/SoftLinking.h>

Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.h (89616 => 89617)


--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.h	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.h	2011-06-23 21:42:52 UTC (rev 89617)
@@ -25,6 +25,8 @@
 
 #if ENABLE(VIDEO)
 
+#import <Cocoa/Cocoa.h>
+
 namespace WebCore {
     class HTMLMediaElement;
 }

Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.mm (89616 => 89617)


--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.mm	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.mm	2011-06-23 21:42:52 UTC (rev 89617)
@@ -30,9 +30,9 @@
 
 #import "FloatConversion.h"
 #import "WebCoreSystemInterface.h"
-#import <_javascript_Core/RetainPtr.h>
-#import <_javascript_Core/UnusedParam.h>
 #import <WebCore/HTMLMediaElement.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/UnusedParam.h>
 
 using namespace WebCore;
 using namespace std;

Modified: trunk/Source/WebCore/platform/qt/WebCoreSystemInterface.h (89616 => 89617)


--- trunk/Source/WebCore/platform/qt/WebCoreSystemInterface.h	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebCore/platform/qt/WebCoreSystemInterface.h	2011-06-23 21:42:52 UTC (rev 89617)
@@ -38,14 +38,20 @@
 
 #ifdef __OBJC__
 @class NSArray;
+@class NSControl;
 @class NSString;
 @class NSURL;
+@class NSView;
+@class NSWindow;
 @class QTMovie;
 @class QTMovieView;
 #else
 class NSArray;
+class NSControl;
 class NSString;
 class NSURL;
+class NSView;
+class NSWindow;
 class QTMovie;
 class QTMovieView;
 #endif
@@ -53,6 +59,8 @@
 extern "C" {
 
 // In alphabetical order.
+extern NSView *(*wkCreateMediaUIBackgroundView)(void);
+extern NSControl *(*wkCreateMediaUIControl)(int);
 extern unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
 extern int (*wkQTMovieDataRate)(QTMovie*);
 extern void (*wkQTMovieDisableComponent)(uint32_t[5]);
@@ -68,6 +76,8 @@
 extern NSArray *(*wkQTGetSitesInMediaDownloadCache)();
 extern void (*wkQTClearMediaDownloadCacheForSite)(NSString *site);
 extern void (*wkQTClearMediaDownloadCache)();
+extern void (*wkWindowSetAlpha)(NSWindow *, float);
+extern void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
 
 }
 

Modified: trunk/Source/WebCore/platform/qt/WebCoreSystemInterface.mm (89616 => 89617)


--- trunk/Source/WebCore/platform/qt/WebCoreSystemInterface.mm	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebCore/platform/qt/WebCoreSystemInterface.mm	2011-06-23 21:42:52 UTC (rev 89617)
@@ -27,6 +27,8 @@
 #import "WebCoreSystemInterface.h"
 #import <Foundation/Foundation.h>
 
+NSView *(*wkCreateMediaUIBackgroundView)(void);
+NSControl *(*wkCreateMediaUIControl)(int);
 unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
 int (*wkQTMovieDataRate)(QTMovie*);
 void (*wkQTMovieDisableComponent)(uint32_t[5]);
@@ -42,4 +44,6 @@
 NSArray *(*wkQTGetSitesInMediaDownloadCache)();
 void (*wkQTClearMediaDownloadCacheForSite)(NSString *site);
 void (*wkQTClearMediaDownloadCache)();
+void (*wkWindowSetAlpha)(NSWindow *, float);
+void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
 

Modified: trunk/Source/WebKit/qt/ChangeLog (89616 => 89617)


--- trunk/Source/WebKit/qt/ChangeLog	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebKit/qt/ChangeLog	2011-06-23 21:42:52 UTC (rev 89617)
@@ -1,3 +1,35 @@
+2011-06-23  Alexis Menard  <alexis.men...@openbossa.org>
+
+        Reviewed by Eric Carlson.
+
+        [Qt] Implement fullscreen support on Mac with the QuickTime backend.
+        https://bugs.webkit.org/show_bug.cgi?id=61728
+
+        Implement fullscreen support for Qt when using the QuickTime backend.
+        We mostly use what is already done for the Mac port.
+
+        * QtWebKit.pro:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::ChromeClientQt):
+        (WebCore::ChromeClientQt::~ChromeClientQt):
+        * WebCoreSupport/ChromeClientQt.h:
+        * WebCoreSupport/FullScreenVideoQt.cpp:
+        (WebCore::FullScreenVideoQt::FullScreenVideoQt):
+        (WebCore::FullScreenVideoQt::~FullScreenVideoQt):
+        (WebCore::FullScreenVideoQt::enterFullScreenForNode):
+        (WebCore::FullScreenVideoQt::exitFullScreenForNode):
+        (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback):
+        (WebCore::FullScreenVideoQt::isValid):
+        * WebCoreSupport/FullScreenVideoQt.h:
+        * WebCoreSupport/QTKitFullScreenVideoHandler.h: Added.
+        * WebCoreSupport/QTKitFullScreenVideoHandler.mm: Added.
+        (QTKitFullScreenVideoHandler::QTKitFullScreenVideoHandler):
+        (QTKitFullScreenVideoHandler::~QTKitFullScreenVideoHandler):
+        (QTKitFullScreenVideoHandler::enterFullScreen):
+        (QTKitFullScreenVideoHandler::exitFullScreen):
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2011-06-23  Yael Aharon  <yael.aha...@nokia.com>
 
         Reviewed by Andreas Kling.

Modified: trunk/Source/WebKit/qt/QtWebKit.pro (89616 => 89617)


--- trunk/Source/WebKit/qt/QtWebKit.pro	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebKit/qt/QtWebKit.pro	2011-06-23 21:42:52 UTC (rev 89617)
@@ -225,25 +225,33 @@
         SOURCES += $$PWD/WebCoreSupport/FullScreenVideoWidget.cpp
     }
 
-    contains(DEFINES, USE_GSTREAMER=1) | contains(MOBILITY_CONFIG, multimedia) {
+    contains(DEFINES, USE_QTKIT=1) | contains(DEFINES, USE_GSTREAMER=1) | contains(MOBILITY_CONFIG, multimedia) {
         HEADERS += $$PWD/WebCoreSupport/FullScreenVideoQt.h
         SOURCES += $$PWD/WebCoreSupport/FullScreenVideoQt.cpp
     }
 
     contains(DEFINES, USE_QTKIT=1) {
-        INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/qt/
-        INCLUDEPATH += $$SOURCE_DIR/../WebKitLibraries/
+        INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/qt/ \
+                       $$SOURCE_DIR/WebCore/platform/mac/ \
+                       $$SOURCE_DIR/../WebKitLibraries/
+
         DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
-        HEADERS += $$PWD/WebCoreSupport/WebSystemInterface.h
-        SOURCES += $$PWD/WebCoreSupport/WebSystemInterface.mm
+
+        HEADERS += $$PWD/WebCoreSupport/WebSystemInterface.h \
+                   $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.h
+
+        OBJECTIVE_SOURCES += $$PWD/WebCoreSupport/WebSystemInterface.mm \
+                   $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.mm
+
+        LIBS+= -framework Security -framework IOKit
         # We can know the Mac OS version by using the Darwin major version
         DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
         DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
         equals(DARWIN_MAJOR_VERSION, "10") {
-            LIBS+= $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a -framework Security
+            LIBS+= $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
         } else {
             equals(DARWIN_MAJOR_VERSION, "9") {
-                LIBS+= $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.a -framework Security
+                LIBS+= $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.a
             }
         }
     }

Modified: trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp (89616 => 89617)


--- trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp	2011-06-23 21:42:52 UTC (rev 89617)
@@ -78,7 +78,7 @@
 #include <qtooltip.h>
 #include <wtf/OwnPtr.h>
 
-#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
+#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
 #include "FullScreenVideoQt.h"
 #include "HTMLMediaElement.h"
 #include "HTMLNames.h"
@@ -95,7 +95,7 @@
 ChromeClientQt::ChromeClientQt(QWebPage* webPage)
     : m_webPage(webPage)
     , m_eventLoop(0)
-#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
+#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
     , m_fullScreenVideo(0)
 #endif
 {
@@ -107,7 +107,7 @@
     if (m_eventLoop)
         m_eventLoop->exit();
 
-#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
+#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
     delete m_fullScreenVideo;
 #endif
 }
@@ -671,7 +671,7 @@
 }
 #endif
 
-#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
+#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
 FullScreenVideoQt* ChromeClientQt::fullScreenVideo()
 {
     if (!m_fullScreenVideo)

Modified: trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h (89616 => 89617)


--- trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h	2011-06-23 21:42:52 UTC (rev 89617)
@@ -167,7 +167,7 @@
     virtual void needTouchEvents(bool) { }
 #endif
  
-#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
+#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
     virtual bool supportsFullscreenForNode(const Node*);
     virtual void enterFullscreenForNode(Node*);
     virtual void exitFullscreenForNode(Node*);
@@ -209,7 +209,7 @@
     bool menuBarVisible;
     QEventLoop* m_eventLoop;
 
-#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
+#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
     FullScreenVideoQt* m_fullScreenVideo;
 #endif
 

Modified: trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp (89616 => 89617)


--- trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp	2011-06-23 21:42:52 UTC (rev 89617)
@@ -35,6 +35,10 @@
 #include "PlatformVideoWindowPrivate.h"
 #endif
 
+#if USE(QTKIT)
+#include "QTKitFullScreenVideoHandler.h"
+#endif
+
 #if USE(QT_MULTIMEDIA)
 #include <QGraphicsVideoItem>
 #include <QMediaPlayer>
@@ -147,6 +151,10 @@
 #if USE(GSTREAMER)
     m_FullScreenVideoHandlerGStreamer = new GStreamerFullScreenVideoHandler;
 #endif
+
+#if USE(QTKIT)
+    m_FullScreenVideoHandlerQTKit = new QTKitFullScreenVideoHandler;
+#endif
 }
 
 FullScreenVideoQt::~FullScreenVideoQt()
@@ -157,6 +165,9 @@
 #if USE(GSTREAMER)
     delete m_FullScreenVideoHandlerGStreamer;
 #endif
+#if USE(QTKIT)
+    delete m_FullScreenVideoHandlerQTKit;
+#endif
 }
 
 void FullScreenVideoQt::enterFullScreenForNode(Node* node)
@@ -185,6 +196,10 @@
     m_FullScreenVideoHandlerGStreamer->setVideoElement(m_videoElement);
     m_FullScreenVideoHandlerGStreamer->enterFullScreen();
 #endif
+
+#if USE(QTKIT)
+    m_FullScreenVideoHandlerQTKit->enterFullScreen(m_videoElement);
+#endif
 }
 
 void FullScreenVideoQt::exitFullScreenForNode(Node* node)
@@ -211,6 +226,11 @@
 #if USE(GSTREAMER)
     m_FullScreenVideoHandlerGStreamer->exitFullScreen();
 #endif
+
+#if USE(QTKIT)
+    m_FullScreenVideoHandlerQTKit->exitFullScreen();
+#endif
+
 }
 
 void FullScreenVideoQt::aboutToClose()
@@ -232,9 +252,6 @@
 {
 #if USE(QT_MULTIMEDIA)
     return m_FullScreenVideoHandler ? m_FullScreenVideoHandler->requiresFullScreenForVideoPlayback() : false;
-#endif
-#if USE(GSTREAMER)
-    return false;
 #else
     return false;
 #endif
@@ -247,6 +264,8 @@
 #endif
 #if USE(GSTREAMER)
     return m_FullScreenVideoHandlerGStreamer;
+#elif USE(QTKIT)
+    return m_FullScreenVideoHandlerQTKit;
 #else
     return 0;
 #endif

Modified: trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h (89616 => 89617)


--- trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h	2011-06-23 21:42:52 UTC (rev 89617)
@@ -38,6 +38,9 @@
 #if USE(QT_MULTIMEDIA)
 class MediaPlayerPrivateQt;
 #endif
+#if USE(QTKIT)
+class QTKitFullScreenVideoHandler;
+#endif
 
 // We do not use ENABLE or USE because moc does not expand these macros.
 #if defined(WTF_USE_GSTREAMER) && WTF_USE_GSTREAMER
@@ -109,6 +112,9 @@
 #if USE(GSTREAMER)
     GStreamerFullScreenVideoHandler* m_FullScreenVideoHandlerGStreamer;
 #endif
+#if USE(QTKIT)
+    QTKitFullScreenVideoHandler* m_FullScreenVideoHandlerQTKit;
+#endif
 };
 
 }

Added: trunk/Source/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.h (0 => 89617)


--- trunk/Source/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.h	                        (rev 0)
+++ trunk/Source/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.h	2011-06-23 21:42:52 UTC (rev 89617)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef QTKitFullScreenVideoHandler_h
+#define QTKitFullScreenVideoHandler_h
+
+#include <OwnPtr.h>
+
+namespace WebCore {
+
+class HTMLVideoElement;
+
+class QTKitFullScreenVideoHandler {
+    class QTKitFullScreenVideoHandlerPrivate;
+public:
+    QTKitFullScreenVideoHandler();
+    ~QTKitFullScreenVideoHandler();
+    void enterFullScreen(HTMLVideoElement*);
+    void exitFullScreen();
+
+private:
+    OwnPtr<QTKitFullScreenVideoHandlerPrivate> privateData;
+};
+
+}
+
+#endif // QTKitFullScreenVideoHandler_h

Added: trunk/Source/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.mm (0 => 89617)


--- trunk/Source/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.mm	                        (rev 0)
+++ trunk/Source/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.mm	2011-06-23 21:42:52 UTC (rev 89617)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+
+#include "QTKitFullScreenVideoHandler.h"
+
+#import <Cocoa/Cocoa.h>
+
+#include "HTMLVideoElement.h"
+#include "WebVideoFullscreenController.h"
+
+using namespace WebCore;
+
+class QTKitFullScreenVideoHandler::QTKitFullScreenVideoHandlerPrivate {
+public :
+    WebVideoFullscreenController* m_FullScreenController;
+};
+
+QTKitFullScreenVideoHandler::QTKitFullScreenVideoHandler()
+    : privateData (adoptPtr(new QTKitFullScreenVideoHandlerPrivate))
+{
+    privateData->m_FullScreenController = nil;
+}
+
+QTKitFullScreenVideoHandler::~QTKitFullScreenVideoHandler()
+{
+    exitFullScreen();
+}
+
+void QTKitFullScreenVideoHandler::enterFullScreen(HTMLVideoElement* videoElement)
+{
+    if (privateData->m_FullScreenController) {
+        // First exit fullscreen for the old mediaElement.
+        exitFullScreen();
+        ASSERT(!privateData->m_FullScreenController);
+    }
+    if (!privateData->m_FullScreenController) {
+        privateData->m_FullScreenController = [[WebVideoFullscreenController alloc] init];
+        [privateData->m_FullScreenController setMediaElement:videoElement];
+        NSScreen* currentScreen = [NSScreen mainScreen];
+        [privateData->m_FullScreenController enterFullscreen:currentScreen];
+    }
+}
+
+void QTKitFullScreenVideoHandler::exitFullScreen()
+{
+    [privateData->m_FullScreenController exitFullscreen];
+    [privateData->m_FullScreenController release];
+    privateData->m_FullScreenController = nil;
+}

Modified: trunk/Source/WebKit/qt/WebCoreSupport/WebSystemInterface.mm (89616 => 89617)


--- trunk/Source/WebKit/qt/WebCoreSupport/WebSystemInterface.mm	2011-06-23 21:41:35 UTC (rev 89616)
+++ trunk/Source/WebKit/qt/WebCoreSupport/WebSystemInterface.mm	2011-06-23 21:42:52 UTC (rev 89617)
@@ -57,6 +57,10 @@
     INIT(QTGetSitesInMediaDownloadCache);
     INIT(QTClearMediaDownloadCacheForSite);
     INIT(QTClearMediaDownloadCache);
+    INIT(CreateMediaUIBackgroundView);
+    INIT(CreateMediaUIControl);
+    INIT(WindowSetAlpha);
+    INIT(WindowSetScaledFrame);
 
     didInit = true;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to