15af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke/* 25af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * Copyright (C) 2010 Apple Inc. All rights reserved. 35af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * 45af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * Redistribution and use in source and binary forms, with or without 55af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * modification, are permitted provided that the following conditions 65af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * are met: 75af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * 1. Redistributions of source code must retain the above copyright 85af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * notice, this list of conditions and the following disclaimer. 95af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * 2. Redistributions in binary form must reproduce the above copyright 105af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * notice, this list of conditions and the following disclaimer in the 115af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * documentation and/or other materials provided with the distribution. 125af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * 13545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 145af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 155af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 165af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 175af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 185af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 195af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 205af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 215af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 225af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 235af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke * THE POSSIBILITY OF SUCH DAMAGE. 245af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke */ 255af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 265af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke#ifndef MediaPlayerPrivateFullscreenWindow_h 275af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke#define MediaPlayerPrivateFullscreenWindow_h 285af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 292fc2651226baac27029e38c9d6ef883fa32084dbSteve Block#include <wtf/RefPtr.h> 302fc2651226baac27029e38c9d6ef883fa32084dbSteve Block 315af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke#if USE(ACCELERATED_COMPOSITING) 322fc2651226baac27029e38c9d6ef883fa32084dbSteve Block#include "CACFLayerTreeHostClient.h" 335af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke#endif 345af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 355af96e2c7b73ebc627c6894727826a7576d31758Leon Clarketypedef unsigned WPARAM; 365af96e2c7b73ebc627c6894727826a7576d31758Leon Clarketypedef long LPARAM; 375af96e2c7b73ebc627c6894727826a7576d31758Leon Clarketypedef struct HWND__* HWND; 385af96e2c7b73ebc627c6894727826a7576d31758Leon Clarketypedef _W64 long LONG_PTR; 395af96e2c7b73ebc627c6894727826a7576d31758Leon Clarketypedef LONG_PTR LRESULT; 405af96e2c7b73ebc627c6894727826a7576d31758Leon Clarketypedef unsigned int UINT; 415af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 425af96e2c7b73ebc627c6894727826a7576d31758Leon Clarkenamespace WebCore { 435af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 442fc2651226baac27029e38c9d6ef883fa32084dbSteve Block#if USE(ACCELERATED_COMPOSITING) 452fc2651226baac27029e38c9d6ef883fa32084dbSteve Blockclass CACFLayerTreeHost; 462fc2651226baac27029e38c9d6ef883fa32084dbSteve Blockclass PlatformCALayer; 472fc2651226baac27029e38c9d6ef883fa32084dbSteve Block#endif 482fc2651226baac27029e38c9d6ef883fa32084dbSteve Block 495af96e2c7b73ebc627c6894727826a7576d31758Leon Clarkeclass MediaPlayerPrivateFullscreenClient { 505af96e2c7b73ebc627c6894727826a7576d31758Leon Clarkepublic: 515af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke virtual LRESULT fullscreenClientWndProc(HWND, UINT message, WPARAM, LPARAM) = 0; 525af96e2c7b73ebc627c6894727826a7576d31758Leon Clarkeprotected: 535af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke virtual ~MediaPlayerPrivateFullscreenClient() {} 545af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke}; 555af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 565af96e2c7b73ebc627c6894727826a7576d31758Leon Clarkeclass MediaPlayerPrivateFullscreenWindow { 575af96e2c7b73ebc627c6894727826a7576d31758Leon Clarkepublic: 585af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke MediaPlayerPrivateFullscreenWindow(MediaPlayerPrivateFullscreenClient*); 595af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke ~MediaPlayerPrivateFullscreenWindow(); 605af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 615af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke void createWindow(HWND ownerWindow); 625af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 635af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke HWND hwnd() const { return m_hwnd; } 645af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 655af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke#if USE(ACCELERATED_COMPOSITING) 66cad810f21b803229eb11403f9209855525a25d57Steve Block PlatformCALayer* rootChildLayer() const { return m_rootChild.get(); } 67cad810f21b803229eb11403f9209855525a25d57Steve Block void setRootChildLayer(PassRefPtr<PlatformCALayer>); 685af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke#endif 695af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 705af96e2c7b73ebc627c6894727826a7576d31758Leon Clarkeprivate: 715af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke static LRESULT __stdcall staticWndProc(HWND, UINT message, WPARAM, LPARAM); 725af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke LRESULT wndProc(HWND, UINT message, WPARAM, LPARAM); 735af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 745af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke MediaPlayerPrivateFullscreenClient* m_client; 755af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke#if USE(ACCELERATED_COMPOSITING) 76ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdoch RefPtr<CACFLayerTreeHost> m_layerTreeHost; 77cad810f21b803229eb11403f9209855525a25d57Steve Block RefPtr<PlatformCALayer> m_rootChild; 785af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke#endif 795af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke HWND m_hwnd; 805af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke}; 815af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 825af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke} 835af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke 845af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke#endif 85