Changeset 89617 in webkit


Ignore:
Timestamp:
Jun 23, 2011 2:42:52 PM (13 years ago)
Author:
alexis.menard@openbossa.org
Message:

2011-06-23 Alexis Menard <alexis.menard@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.menard@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):
Location:
trunk/Source
Files:
2 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89613 r89617  
     12011-06-23  Alexis Menard  <alexis.menard@openbossa.org>
     2
     3        Reviewed by Eric Carlson.
     4
     5        [Qt] Implement fullscreen support on Mac with the QuickTime backend.
     6        https://bugs.webkit.org/show_bug.cgi?id=61728
     7
     8        Implement fullscreen support for Qt when using the QuickTime backend.
     9        We mostly use what is already done for the Mac port.
     10
     11        * DerivedSources.pro: We use the mac files and they have <WebCore/x> type
     12        of includes. We need to generate those headers.
     13        * WebCore.pro:
     14        * platform/mac/WebVideoFullscreenController.h:
     15        * platform/mac/WebVideoFullscreenController.mm:
     16        * platform/mac/WebVideoFullscreenHUDWindowController.h:
     17        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
     18        * platform/qt/WebCoreSystemInterface.h:
     19        * platform/qt/WebCoreSystemInterface.mm:
     20
    1212011-06-23  Darin Adler  <darin@apple.com>
    222
  • trunk/Source/WebCore/DerivedSources.pro

    r78566 r89617  
    2828}
    2929
     30contains(DEFINES, USE_QTKIT=1) {
     31    SRC_ROOT_DIR = $$replace(PWD, /Source/WebCore, "")
     32    fwheader_generator.commands = perl $${SRC_ROOT_DIR}/Source/WebKit2/Scripts/generate-forwarding-headers.pl $${SRC_ROOT_DIR}/Source/WebKit2 ../include mac
     33    fwheader_generator.depends  = $${SRC_ROOT_DIR}/Source/WebKit2/Scripts/generate-forwarding-headers.pl
     34    generated_files.depends     += fwheader_generator
     35    QMAKE_EXTRA_TARGETS         += fwheader_generator
     36}
     37
    3038include(CodeGenerators.pri)
  • trunk/Source/WebCore/WebCore.pro

    r89587 r89617  
    29982998
    29992999    contains(DEFINES, USE_QTKIT=1) {
     3000        INCLUDEPATH += \
     3001            $$SOURCE_DIR/../WebKitLibraries/
     3002
    30003003        HEADERS += \
    30013004            platform/graphics/mac/MediaPlayerPrivateQTKit.h \
     
    30033006            platform/qt/WebCoreSystemInterface.h \
    30043007            platform/mac/BlockExceptions.h \
    3005             platform/mac/WebCoreObjCExtras.h
     3008            platform/mac/WebCoreObjCExtras.h \
     3009            platform/mac/WebVideoFullscreenController.h \
     3010            platform/mac/WebVideoFullscreenHUDWindowController.h \
     3011            platform/mac/WebWindowAnimation.h
     3012
    30063013        SOURCES += \
     3014            platform/graphics/cg/IntRectCG.cpp \
     3015            platform/graphics/cg/FloatSizeCG.cpp \
     3016            platform/cf/SharedBufferCF.cpp \
     3017            platform/cf/KURLCFNet.cpp
     3018
     3019         OBJECTIVE_SOURCES += \
     3020            platform/qt/WebCoreSystemInterface.mm \
     3021            platform/mac/BlockExceptions.mm \
     3022            platform/mac/WebCoreObjCExtras.mm \
    30073023            platform/graphics/mac/MediaPlayerPrivateQTKit.mm \
    30083024            platform/mac/SharedBufferMac.mm \
     
    30113027            platform/graphics/mac/FloatSizeMac.mm \
    30123028            platform/graphics/mac/IntRectMac.mm \
    3013             platform/graphics/cg/IntRectCG.cpp \
    3014             platform/graphics/cg/FloatSizeCG.cpp \
    3015             platform/cf/SharedBufferCF.cpp \
    3016             platform/cf/KURLCFNet.cpp \
    3017             platform/qt/WebCoreSystemInterface.mm \
    3018             platform/mac/BlockExceptions.mm \
    3019             platform/mac/WebCoreObjCExtras.mm
     3029            platform/mac/WebVideoFullscreenController.mm \
     3030            platform/mac/WebVideoFullscreenHUDWindowController.mm \
     3031            platform/mac/WebWindowAnimation.mm
    30203032
    30213033        DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
  • trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.h

    r89271 r89617  
    2626#if ENABLE(VIDEO)
    2727
     28#import <Cocoa/Cocoa.h>
    2829#import <wtf/RefPtr.h>
    2930
  • trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm

    r89292 r89617  
    3232#import "WebVideoFullscreenHUDWindowController.h"
    3333#import "WebWindowAnimation.h"
    34 #import <HIToolbox/MacApplication.h>
     34#import <Carbon/Carbon.h>
    3535#import <IOKit/pwr_mgt/IOPMLib.h>
    36 #import <OSServices/Power.h>
    3736#import <QTKit/QTKit.h>
    3837#import <WebCore/HTMLMediaElement.h>
  • trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.h

    r89271 r89617  
    2525
    2626#if ENABLE(VIDEO)
     27
     28#import <Cocoa/Cocoa.h>
    2729
    2830namespace WebCore {
  • trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.mm

    r89387 r89617  
    3131#import "FloatConversion.h"
    3232#import "WebCoreSystemInterface.h"
    33 #import <JavaScriptCore/RetainPtr.h>
    34 #import <JavaScriptCore/UnusedParam.h>
    3533#import <WebCore/HTMLMediaElement.h>
     34#import <wtf/RetainPtr.h>
     35#import <wtf/UnusedParam.h>
    3636
    3737using namespace WebCore;
  • trunk/Source/WebCore/platform/qt/WebCoreSystemInterface.h

    r87405 r89617  
    3939#ifdef __OBJC__
    4040@class NSArray;
     41@class NSControl;
    4142@class NSString;
    4243@class NSURL;
     44@class NSView;
     45@class NSWindow;
    4346@class QTMovie;
    4447@class QTMovieView;
    4548#else
    4649class NSArray;
     50class NSControl;
    4751class NSString;
    4852class NSURL;
     53class NSView;
     54class NSWindow;
    4955class QTMovie;
    5056class QTMovieView;
     
    5460
    5561// In alphabetical order.
     62extern NSView *(*wkCreateMediaUIBackgroundView)(void);
     63extern NSControl *(*wkCreateMediaUIControl)(int);
    5664extern unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
    5765extern int (*wkQTMovieDataRate)(QTMovie*);
     
    6977extern void (*wkQTClearMediaDownloadCacheForSite)(NSString *site);
    7078extern void (*wkQTClearMediaDownloadCache)();
     79extern void (*wkWindowSetAlpha)(NSWindow *, float);
     80extern void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
    7181
    7282}
  • trunk/Source/WebCore/platform/qt/WebCoreSystemInterface.mm

    r87405 r89617  
    2828#import <Foundation/Foundation.h>
    2929
     30NSView *(*wkCreateMediaUIBackgroundView)(void);
     31NSControl *(*wkCreateMediaUIControl)(int);
    3032unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
    3133int (*wkQTMovieDataRate)(QTMovie*);
     
    4345void (*wkQTClearMediaDownloadCacheForSite)(NSString *site);
    4446void (*wkQTClearMediaDownloadCache)();
     47void (*wkWindowSetAlpha)(NSWindow *, float);
     48void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
    4549
  • trunk/Source/WebKit/qt/ChangeLog

    r89582 r89617  
     12011-06-23  Alexis Menard  <alexis.menard@openbossa.org>
     2
     3        Reviewed by Eric Carlson.
     4
     5        [Qt] Implement fullscreen support on Mac with the QuickTime backend.
     6        https://bugs.webkit.org/show_bug.cgi?id=61728
     7
     8        Implement fullscreen support for Qt when using the QuickTime backend.
     9        We mostly use what is already done for the Mac port.
     10
     11        * QtWebKit.pro:
     12        * WebCoreSupport/ChromeClientQt.cpp:
     13        (WebCore::ChromeClientQt::ChromeClientQt):
     14        (WebCore::ChromeClientQt::~ChromeClientQt):
     15        * WebCoreSupport/ChromeClientQt.h:
     16        * WebCoreSupport/FullScreenVideoQt.cpp:
     17        (WebCore::FullScreenVideoQt::FullScreenVideoQt):
     18        (WebCore::FullScreenVideoQt::~FullScreenVideoQt):
     19        (WebCore::FullScreenVideoQt::enterFullScreenForNode):
     20        (WebCore::FullScreenVideoQt::exitFullScreenForNode):
     21        (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback):
     22        (WebCore::FullScreenVideoQt::isValid):
     23        * WebCoreSupport/FullScreenVideoQt.h:
     24        * WebCoreSupport/QTKitFullScreenVideoHandler.h: Added.
     25        * WebCoreSupport/QTKitFullScreenVideoHandler.mm: Added.
     26        (QTKitFullScreenVideoHandler::QTKitFullScreenVideoHandler):
     27        (QTKitFullScreenVideoHandler::~QTKitFullScreenVideoHandler):
     28        (QTKitFullScreenVideoHandler::enterFullScreen):
     29        (QTKitFullScreenVideoHandler::exitFullScreen):
     30        * WebCoreSupport/WebSystemInterface.mm:
     31        (InitWebCoreSystemInterface):
     32
    1332011-06-23  Yael Aharon  <yael.aharon@nokia.com>
    234
  • trunk/Source/WebKit/qt/QtWebKit.pro

    r89574 r89617  
    226226    }
    227227
    228     contains(DEFINES, USE_GSTREAMER=1) | contains(MOBILITY_CONFIG, multimedia) {
     228    contains(DEFINES, USE_QTKIT=1) | contains(DEFINES, USE_GSTREAMER=1) | contains(MOBILITY_CONFIG, multimedia) {
    229229        HEADERS += $$PWD/WebCoreSupport/FullScreenVideoQt.h
    230230        SOURCES += $$PWD/WebCoreSupport/FullScreenVideoQt.cpp
     
    232232
    233233    contains(DEFINES, USE_QTKIT=1) {
    234         INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/qt/
    235         INCLUDEPATH += $$SOURCE_DIR/../WebKitLibraries/
     234        INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/qt/ \
     235                       $$SOURCE_DIR/WebCore/platform/mac/ \
     236                       $$SOURCE_DIR/../WebKitLibraries/
     237
    236238        DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
    237         HEADERS += $$PWD/WebCoreSupport/WebSystemInterface.h
    238         SOURCES += $$PWD/WebCoreSupport/WebSystemInterface.mm
     239
     240        HEADERS += $$PWD/WebCoreSupport/WebSystemInterface.h \
     241                   $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.h
     242
     243        OBJECTIVE_SOURCES += $$PWD/WebCoreSupport/WebSystemInterface.mm \
     244                   $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.mm
     245
     246        LIBS+= -framework Security -framework IOKit
    239247        # We can know the Mac OS version by using the Darwin major version
    240248        DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
    241249        DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
    242250        equals(DARWIN_MAJOR_VERSION, "10") {
    243             LIBS+= $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a -framework Security
     251            LIBS+= $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
    244252        } else {
    245253            equals(DARWIN_MAJOR_VERSION, "9") {
    246                 LIBS+= $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.a -framework Security
     254                LIBS+= $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.a
    247255            }
    248256        }
  • trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r89430 r89617  
    7979#include <wtf/OwnPtr.h>
    8080
    81 #if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
     81#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
    8282#include "FullScreenVideoQt.h"
    8383#include "HTMLMediaElement.h"
     
    9696    : m_webPage(webPage)
    9797    , m_eventLoop(0)
    98 #if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
     98#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
    9999    , m_fullScreenVideo(0)
    100100#endif
     
    108108        m_eventLoop->exit();
    109109
    110 #if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
     110#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
    111111    delete m_fullScreenVideo;
    112112#endif
     
    672672#endif
    673673
    674 #if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
     674#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
    675675FullScreenVideoQt* ChromeClientQt::fullScreenVideo()
    676676{
  • trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h

    r89216 r89617  
    168168#endif
    169169 
    170 #if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
     170#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
    171171    virtual bool supportsFullscreenForNode(const Node*);
    172172    virtual void enterFullscreenForNode(Node*);
     
    210210    QEventLoop* m_eventLoop;
    211211
    212 #if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA))
     212#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))
    213213    FullScreenVideoQt* m_fullScreenVideo;
    214214#endif
  • trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp

    r87312 r89617  
    3434#include "GStreamerGWorld.h"
    3535#include "PlatformVideoWindowPrivate.h"
     36#endif
     37
     38#if USE(QTKIT)
     39#include "QTKitFullScreenVideoHandler.h"
    3640#endif
    3741
     
    148152    m_FullScreenVideoHandlerGStreamer = new GStreamerFullScreenVideoHandler;
    149153#endif
     154
     155#if USE(QTKIT)
     156    m_FullScreenVideoHandlerQTKit = new QTKitFullScreenVideoHandler;
     157#endif
    150158}
    151159
     
    157165#if USE(GSTREAMER)
    158166    delete m_FullScreenVideoHandlerGStreamer;
     167#endif
     168#if USE(QTKIT)
     169    delete m_FullScreenVideoHandlerQTKit;
    159170#endif
    160171}
     
    186197    m_FullScreenVideoHandlerGStreamer->enterFullScreen();
    187198#endif
     199
     200#if USE(QTKIT)
     201    m_FullScreenVideoHandlerQTKit->enterFullScreen(m_videoElement);
     202#endif
    188203}
    189204
     
    212227    m_FullScreenVideoHandlerGStreamer->exitFullScreen();
    213228#endif
     229
     230#if USE(QTKIT)
     231    m_FullScreenVideoHandlerQTKit->exitFullScreen();
     232#endif
     233
    214234}
    215235
     
    233253#if USE(QT_MULTIMEDIA)
    234254    return m_FullScreenVideoHandler ? m_FullScreenVideoHandler->requiresFullScreenForVideoPlayback() : false;
    235 #endif
    236 #if USE(GSTREAMER)
    237     return false;
    238255#else
    239256    return false;
     
    248265#if USE(GSTREAMER)
    249266    return m_FullScreenVideoHandlerGStreamer;
     267#elif USE(QTKIT)
     268    return m_FullScreenVideoHandlerQTKit;
    250269#else
    251270    return 0;
  • trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h

    r86550 r89617  
    3838#if USE(QT_MULTIMEDIA)
    3939class MediaPlayerPrivateQt;
     40#endif
     41#if USE(QTKIT)
     42class QTKitFullScreenVideoHandler;
    4043#endif
    4144
     
    110113    GStreamerFullScreenVideoHandler* m_FullScreenVideoHandlerGStreamer;
    111114#endif
     115#if USE(QTKIT)
     116    QTKitFullScreenVideoHandler* m_FullScreenVideoHandlerQTKit;
     117#endif
    112118};
    113119
  • trunk/Source/WebKit/qt/WebCoreSupport/WebSystemInterface.mm

    r87405 r89617  
    5858    INIT(QTClearMediaDownloadCacheForSite);
    5959    INIT(QTClearMediaDownloadCache);
     60    INIT(CreateMediaUIBackgroundView);
     61    INIT(CreateMediaUIControl);
     62    INIT(WindowSetAlpha);
     63    INIT(WindowSetScaledFrame);
    6064
    6165    didInit = true;
Note: See TracChangeset for help on using the changeset viewer.