|
List Info
Thread: CR: Flash Guest Player AX: allow full screen in windowed mode
|
|
| CR: Flash Guest Player AX: allow full
screen in windowed mode |
  United States |
2007-10-15 19:31:00 |
Synopsis: Full screen does not work in windowed mode, on
windows,
since the handle was not being passed to the Flash Guest
Player for
reparenting.
Overview: Use the new interfaces IHXPassiveSiteWatcher2,
which will
send messages after full screen enter/exit, and
IHXSiteWatcher2,
which sends messages before full screen enter exit. After
full screen
is entered, the guest player will retrieve the full screen
window
handle and reparent. Before exit the control will be
reparented back
to the original window. We need to do this before the full
screen
window has been destroyed, otherwise the control will
crash.
Branch: HEAD, 310atlas
Files:
video/sitelib/basesite.cpp
- call IHXSiteWatcher2 to let the sites know when we are
about to
enter and exit full screen.
datatype/flash/flashhost/platform/win32/flash_guest_player_a
x.cpp
datatype/flash/flashhost/pub/platform/win32/flash_guest_play
er_ax.h
- added IHXSiteWatcher2 interface, changed
IHXPassiveSiteWatcher to
IHXPassiveSiteWatcher2,
so that the guest player can receive messages before and
after
entering and exiting full screen.
- added m_hwndParentNormal to save the value of the normal
sized
window, for reparenting after full screen switch.
- modified AddRemovePassiveSiteWatcher to use the parent
site so
that it can receive the watcher messages.
Diff:
Index: basesite.cpp
============================================================
=======
RCS file: /cvsroot/video/sitelib/basesite.cpp,v
retrieving revision 1.48.2.2
diff -w -u -5 -r1.48.2.2 basesite.cpp
--- basesite.cpp 12 Oct 2007 19:09:43 -0000 1.48.2.2
+++ basesite.cpp 16 Oct 2007 00:04:48 -0000
 -3414,10
+3414,17 
if (m_bInFullScreen)
{
return HXR_UNEXPECTED;
}
+ // Let the sites know we are entering full screen
before we are
in full screen
+ HXBOOL bAllow=TRUE;
+ if (m_pWatcher2)
+ {
+ ret = m_pWatcher2->EnteringFullScreen(bAllow);
+ }
+
_TLSLock();
m_bSyncFullScreen = FALSE;
ret = _EnterFullScreenExt(pWindow, pValues);
_TLSUnlock();
return ret;
 -3440,10
+3447,17 
if (!m_bInFullScreen)
{
return HXR_UNEXPECTED;
}
+ // Let the sites know we are exiting full screen before
destruction of the full screen window
+ HXBOOL bAllow=TRUE;
+ if (m_pWatcher2)
+ {
+ ret = m_pWatcher2->ExitingFullScreen(bAllow);
+ }
+
_TLSLock();
ret = _ExitFullScreenExt();
_TLSUnlock();
return ret;
}
Index: platform/win32/flash_guest_player_ax.cpp
============================================================
=======
RCS file:
/cvsroot/datatype/flash/flashhost/platform/win32/flash_guest
_player_ax.cpp,v
retrieving revision 1.21.2.6
diff -w -u -5 -r1.21.2.6 flash_guest_player_ax.cpp
--- platform/win32/flash_guest_player_ax.cpp 9 Oct 2007
00:03:21 -0000 1.21.2.6
+++ platform/win32/flash_guest_player_ax.cpp 15 Oct 2007
23:39:40 -0000
 -134,10
+134,11 
, m_lFlashVersion(0)
, m_bGotInvalidateRect(FALSE)
, m_pOffscreenBuffer(NULL)
, m_hTempWindow(NULL)
, m_hwndParent(NULL)
+ , m_hwndParentNormal(NULL)
, m_hdc(0)
, m_hdcmem(0)
, m_hBitmap(0)
, m_pDIBits(0)
, m_ulDIBitsSize(0)
 -167,11
+168,12 
{
{ GET_IIDHANDLE(IID_IUnknown),
(IUnknown*)
(IHXGuestPlayer*) this},
{
GET_IIDHANDLE(IID_IHXGuestPlayer),
(IHXGuestPlayer*)
this},
{
GET_IIDHANDLE(IID_IHXSiteUser), (IHXSiteUser*)
this},
{
GET_IIDHANDLE(IID_IHXExternalInterface),
(IHXExternalInterface*)
this},
- {
GET_IIDHANDLE(IID_IHXPassiveSiteWatcher),
(IHXPassiveSiteWatcher*) this},
+ {
GET_IIDHANDLE(IID_IHXPassiveSiteWatcher2),
(IHXPassiveSiteWatcher2*) this},
+ {
GET_IIDHANDLE(IID_IHXSiteWatcher2), (IHXSiteWatcher2*)
this},
{
GET_IIDHANDLE(IID_IDispatch), (IDispatch*)
this},
{
GET_IIDHANDLE(IID_IOleClientSite),
(IOleClientSite*)
this},
{ GET_IIDHANDLE(IID_IOleInPlaceSiteWindowless),
(IOleInPlaceSiteWindowless*) this},
{
GET_IIDHANDLE(IID_IOleInPlaceSite),
(IOleInPlaceSite*)
this},
{
GET_IIDHANDLE(IID_IOleInPlaceSiteEx),
(IOleInPlaceSiteEx*)
this},
 -1014,11
+1016,16 
STDMETHODIMP CFlashGuestPlayerAX::AttachSite(IHXSite*
pSite)
{
HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::AttachSite()");
HX_RESULT retVal = HXR_INCOMPLETE; // make sure the
base calls
AttachWindow on us
- if (pSite)
+ if (m_pSite)
+ {
+ // This must be the parent site trying to attach itself.
+ retVal = HXR_UNEXPECTED;
+ }
+ else if (pSite)
{
// Try QI'ing for IHXSiteWindowless
HXxWindow* pWindow = NULL;
IHXSiteWindowless* pSiteWindowless = NULL;
retVal =
pSite->QueryInterface(IID_IHXSiteWindowless,
(void**) &pSiteWindowless);
 -1299,36
+1306,110 
CFlashGuestPlayerAX::AddRemovePassiveSiteWatcher(IHXSite*
pSite, HXBOOL bAdd)
{
HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::AddRemovePassiveSiteWatcher(pSite
=%p,bAdd=%lu)",
pSite, bAdd);
if (pSite)
{
+ IHXSite* pParentSite=NULL;
+ if (SUCCEEDED(GetRootSite(pSite, pParentSite)) &&
pParentSite)
+ {
// QI for IHXSite2
IHXSite2* pSite2 = NULL;
- HX_RESULT rv =
pSite->QueryInterface(IID_IHXSite2, (void**)
&pSite2);
+ HX_RESULT rv =
pParentSite->QueryInterface(IID_IHXSite2,
(void**) &pSite2);
if (SUCCEEDED(rv))
{
- // Get our own IHXPassiveSiteWatcher interface
- IHXPassiveSiteWatcher* pWatcher = NULL;
- rv = QueryInterface(IID_IHXPassiveSiteWatcher,
(void**)
&pWatcher);
+ // Get our own IHXPassiveSiteWatcher2 interface
+ IHXPassiveSiteWatcher2* pPassiveSiteWatcher2 = NULL;
+ rv = QueryInterface(IID_IHXPassiveSiteWatcher2, (void**)
&pPassiveSiteWatcher2);
if (SUCCEEDED(rv))
{
// Are we adding or removing?
if (bAdd)
{
// Add ourselves as a passive site
watcher
-
pSite2->AddPassiveSiteWatcher(pWatcher);
+ pSite2->AddPassiveSiteWatcher(pPassiveSiteWatcher2);
}
else
{
// Remove ourselves as a passive site
watcher
-
pSite2->RemovePassiveSiteWatcher(pWatcher);
+ pSite2->RemovePassiveSiteWatcher(pPassiveSiteWatcher2
);
}
}
- HX_RELEASE(pWatcher);
+ HX_RELEASE(pPassiveSiteWatcher2);
}
HX_RELEASE(pSite2);
+
+ // Get our own IHXSiteWatcher2 interface
+ IHXSiteWatcher2* pSiteWatcher2 = NULL;
+ rv = QueryInterface(IID_IHXSiteWatcher2, (void**)
&pSiteWatcher2);
+ if (SUCCEEDED(rv))
+ {
+ // Are we adding or removing?
+ if (bAdd)
+ {
+ // Add ourselves as a site watcher
+ pParentSite->AttachWatcher(pSiteWatcher2);
+ }
+ else
+ {
+ if (m_pSite == pSite)
+ {
+ // Make sure we don't create an infinite loop
+ HX_RELEASE(m_pSite);
+ }
+ // Remove ourselves as a site watcher
+ pParentSite->DetachWatcher();
+ }
+ }
+ HX_RELEASE(pSiteWatcher2);
+ }
+ }
+}
+
+HX_RESULT
+CFlashGuestPlayerAX::GetRootSite(IHXSite* pSite,
REF(IHXSite*) rpParentSite)
+{
+ HX_RESULT retVal = HXR_FAIL;
+
+ HXBOOL bRootFound=FALSE;
+ HXBOOL bFirstParent=TRUE;
+ IHXSite* pCurSite=pSite;
+ pCurSite->AddRef();
+
+ rpParentSite = pSite;
+ HX_ADDREF(rpParentSite);
+
+ while (!bRootFound)
+ {
+ // Get the parent
+ IHXSiteTreeNavigation* pSiteTreeNavigation = NULL;
+ retVal =
pCurSite->QueryInterface(IID_IHXSiteTreeNavigation,
(void**) &pSiteTreeNavigation);
+ if (SUCCEEDED(retVal))
+ {
+ IHXSite* pParentSite=NULL;
+ retVal =
pSiteTreeNavigation->GetParentSite(pParentSite);
+ if (SUCCEEDED(retVal))
+ {
+ HX_RELEASE(rpParentSite);
+ rpParentSite = pParentSite;
+ HX_ADDREF(rpParentSite);
+ }
+ else
+ {
+ bRootFound = TRUE;
+ }
+ HX_RELEASE(pCurSite); // release previous
parent
+ pCurSite = pParentSite;
+ HX_RELEASE(pSiteTreeNavigation);
+ }
+ else
+ {
+ bRootFound = TRUE;
+ }
}
+ HX_RELEASE(pCurSite);
+
+ return HXR_OK;
}
HXBOOL
CFlashGuestPlayerAX::IsFlashPlayerControlAvailable()
{
 -2215,16
+2296,16 
}
}
#if defined(_DEBUG)
else if (!strcmp(strInvokeName, "HXDebug"))
{
- HXLOGL4(HXLOG_FPHR,
"CHXFlashGuestPlayerAX::HandleFlashMessage
HXDebug (%s)", (const char*) strInvokeArgs);
+ HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::HandleFlashMessage
HXDebug (%s)", (const char*) strInvokeArgs);
}
#endif
else if (!strcmp(strInvokeName, "HXError"))
{
- HXLOGL4(HXLOG_FPHR,
"CHXFlashGuestPlayerAX::HandleFlashMessage
HXError (%s)", (const char*) strInvokeArgs);
+ HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::HandleFlashMessage
HXError (%s)", (const char*) strInvokeArgs);
}
else if (!strcmp(strInvokeName,
"HXPosition"))
{
if (!strInvokeArgs.IsEmpty())
{
 -2733,5
+2814,85 
HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::GetPlaybackTime()
time=%ld", rulTime);
return retVal;
}
+//
+// IHXPassiveSiteWatcher2::FullScreenEntered
+//
+STDMETHODIMP
+CFlashGuestPlayerAX::FullScreenEntered(HX_RESULT status)
+{
+ HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::FullScreenEntered()
status=0x%08x", status);
+ if (SUCCEEDED(status) && !m_bWindowless
&& m_pSite)
+ {
+ // Get the full screen window
+ // Try QI'ing for IHXSiteWindowless
+ HXxWindow* pWindow = NULL;
+ IHXSiteWindowless* pSiteWindowless = NULL;
+ HX_RESULT retVal =
m_pSite->QueryInterface(IID_IHXSiteWindowless,
(void**) &pSiteWindowless);
+ if (SUCCEEDED(retVal))
+ {
+ pWindow = pSiteWindowless->GetParentWindow();
+ }
+ HX_RELEASE(pSiteWindowless);
+ if (pWindow && ((HWND) pWindow->window) !=
m_hwndParent)
+ {
+ // Save the normal sized window handle for when we
exit full screen
+ m_hwndParentNormal = m_hwndParent;
+ m_hwndParent = (HWND) pWindow->window;
+ m_wndView.SetParent(m_hwndParent);
+ }
+ }
+ return HXR_OK;
+}
+
+//
+// IHXPassiveSiteWatcher2::ExitFullScreen
+//
+STDMETHODIMP
+CFlashGuestPlayerAX::FullScreenExited(HX_RESULT status)
+{
+ HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::FullScreenExited()
status=0x%08x", status);
+ return HXR_OK;
+}
+
+//
+// IHXSiteWatcher2::EnteringFullScreen
+//
+STDMETHODIMP
+CFlashGuestPlayerAX::EnteringFullScreen(HXBOOL&
bAllow)
+{
+ HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::EnteringFullScreen()");
+ bAllow = TRUE;
+ return HXR_OK;
+}
+
+//
+// IHXSiteWatcher2::ExitingFullScreen
+//
+STDMETHODIMP
+CFlashGuestPlayerAX::ExitingFullScreen(HXBOOL& bAllow)
+{
+ HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::ExitingFullScreen()");
+ if (m_hwndParentNormal && !m_bWindowless
&& m_pSite)
+ {
+ // Reparent back to the normal window
+ m_hwndParent = m_hwndParentNormal;
+ m_hwndParentNormal = NULL;
+ m_wndView.SetParent(m_hwndParent);
+ }
+ bAllow = TRUE;
+ return HXR_OK;
+}
+
+STDMETHODIMP
+CFlashGuestPlayerAX::ChangingPosition(HXxPoint posOld,
REF(HXxPoint) posNew)
+{
+ return HXR_OK;
+}
+
+STDMETHODIMP
+CFlashGuestPlayerAX::ChangingSize(HXxSize sizeOld,
REF(HXxSize) sizeNew)
+{
+ return HXR_OK;
+}
Index: pub/platform/win32/flash_guest_player_ax.h
============================================================
=======
RCS file:
/cvsroot/datatype/flash/flashhost/pub/platform/win32/flash_g
uest_player_ax.h,v
retrieving revision 1.10.2.5
diff -w -u -5 -r1.10.2.5 flash_guest_player_ax.h
--- pub/platform/win32/flash_guest_player_ax.h 9 Oct 2007
00:03:22
-0000 1.10.2.5
+++ pub/platform/win32/flash_guest_player_ax.h 13 Oct 2007
01:00:00 -0000
 -78,11
+78,12 
struct IHXFileObject;
class CHXXMLFlash;
class CFlashGuestPlayerAX : public CFlashGuestPlayer
, public IHXSiteUser
- , public IHXPassiveSiteWatcher
+ , public IHXPassiveSiteWatcher2
+ , public IHXSiteWatcher2
, public
ShockwaveFlashObjects::_IShockwaveFlashEvents
, public IOleClientSite
, public IOleInPlaceSiteWindowless
, public IOleInPlaceFrame
, public IStorage
 -126,13
+127,21 
STDMETHOD(AttachSite) (THIS_ IHXSite*
pSite);
STDMETHOD(DetachSite) (THIS);
STDMETHOD(HandleEvent) (THIS_ HXxEvent*
pEvent);
STDMETHOD_(HXBOOL,NeedsWindowedSites) (THIS);
- // IHXPassiveSiteWatcher methods
+ // IHXPassiveSiteWatcher2 methods
STDMETHOD(PositionChanged) (THIS_ HXxPoint* pPoint);
STDMETHOD(SizeChanged) (THIS_ HXxSize* pSize);
+ STDMETHOD(FullScreenEntered) (THIS_ HX_RESULT status);
+ STDMETHOD(FullScreenExited) (THIS_ HX_RESULT status);
+
+ // IHXSiteWatcher2 methods
+ STDMETHOD(EnteringFullScreen) (THIS_ HXBOOL&
bAllow);
+ STDMETHOD(ExitingFullScreen) (THIS_ HXBOOL&
bAllow);
+ STDMETHOD(ChangingPosition) (THIS_ HXxPoint posOld,
REF(HXxPoint) posNew);
+ STDMETHOD(ChangingSize) (THIS_ HXxSize sizeOld,
REF(HXxSize) sizeNew);
// IHXExternalInterface methods
STDMETHOD(CallExternalFunction) (THIS_ IHXBuffer*
pFunction);
// IDispatch methods
 -253,18
+262,19 
private:
HX_RESULT CreateFlashControl();
HWND CreateTempWindow();
void DestroyTempWindow();
HX_RESULT LoadMovie();
void AddRemovePassiveSiteWatcher(IHXSite*
pSite, HXBOOL bAdd);
HX_RESULT SetWindowSizeAndPosition();
void CreateOffscreenBitmap(UINT32 ulWidth, UINT32
ulHeight);
HXBOOL CopyBitmapToOffscreenBuffer(RECT* pRect, HXBOOL
bErase);
HXBOOL SurfaceUpdate(IHXVideoSurface* pVideoSurface);
HXBOOL FireEvent(const char* target);
HX_RESULT CallActionScript(CHXString strInvokeXML);
HXBOOL HandleFlashMessage(const char* pFunction);
+ HX_RESULT GetRootSite(IHXSite* pSite, REF(IHXSite*)
rpParentSite);
// Methods called from the event handler
void OnReadyStateChange(long newState);
void OnProgress( long percentDone );
void FSCommand(const char* strCmd, const char*
strArg);
 -283,10
+293,11 
}
wchar_t* m_pwszURL;
HWND m_hTempWindow;
HWND m_hwndParent;
+ HWND m_hwndParentNormal;
static const char* const m_pszTmpWindowClassName;
ShockwaveFlashObjects::IShockwaveFlash*
m_pFlashPlayer;
CAxWindow m_wndView;
IConnectionPoint *m_lpConnectionPoint;
_______________________________________________
Video-dev mailing list
Video-dev helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/video
-dev
|
|
| RE: Flash Guest Player AX: allow full
screen in windowed mode |
  United States |
2007-10-16 08:11:45 |
These changes look good.
If possible, please wait until I check in
my flash guest player changes before you check
this in. Since you have reviewed my guest player
changes, I will be checking them in this morning.
Eric
=============================================
Eric Hyche (ehyche real.com)
Technical Lead
RealNetworks, Inc.
> -----Original Message-----
> From: Christina Dunn [mailto:cdunn real.com]
> Sent: Monday, October 15, 2007 8:31 PM
> To: datatype-dev helixcommunity.org; video-dev helixcommunity.org
> Cc: Henry Ping; ehyche real.com
> Subject: CR: Flash Guest Player AX: allow full screen
in windowed mode
>
> Synopsis: Full screen does not work in windowed mode,
on windows,
> since the handle was not being passed to the Flash
Guest Player for
> reparenting.
>
> Overview: Use the new interfaces
IHXPassiveSiteWatcher2, which will
> send messages after full screen enter/exit, and
IHXSiteWatcher2,
> which sends messages before full screen enter exit.
After full screen
> is entered, the guest player will retrieve the full
screen window
> handle and reparent. Before exit the control will be
reparented back
> to the original window. We need to do this before the
full screen
> window has been destroyed, otherwise the control will
crash.
>
> Branch: HEAD, 310atlas
>
> Files:
> video/sitelib/basesite.cpp
> - call IHXSiteWatcher2 to let the sites know when we
> are about to
> enter and exit full screen.
>
datatype/flash/flashhost/platform/win32/flash_guest_player_a
x.cpp
>
datatype/flash/flashhost/pub/platform/win32/flash_guest_play
er_ax.h
> - added IHXSiteWatcher2 interface, changed
> IHXPassiveSiteWatcher to
> IHXPassiveSiteWatcher2,
> so that the guest player can receive messages
> before and after
> entering and exiting full screen.
> - added m_hwndParentNormal to save the value of the
> normal sized
> window, for reparenting after full screen switch.
> - modified AddRemovePassiveSiteWatcher to use the
> parent site so
> that it can receive the watcher messages.
>
> Diff:
> Index: basesite.cpp
>
============================================================
=======
> RCS file: /cvsroot/video/sitelib/basesite.cpp,v
> retrieving revision 1.48.2.2
> diff -w -u -5 -r1.48.2.2 basesite.cpp
> --- basesite.cpp 12 Oct 2007 19:09:43 -0000 1.48.2.2
> +++ basesite.cpp 16 Oct 2007 00:04:48 -0000
>  -3414,10 +3414,17 
> if (m_bInFullScreen)
> {
> return HXR_UNEXPECTED;
> }
>
> + // Let the sites know we are entering full screen
before we are
> in full screen
> + HXBOOL bAllow=TRUE;
> + if (m_pWatcher2)
> + {
> + ret = m_pWatcher2->EnteringFullScreen(bAllow);
> + }
> +
> _TLSLock();
> m_bSyncFullScreen = FALSE;
> ret = _EnterFullScreenExt(pWindow, pValues);
> _TLSUnlock();
> return ret;
>  -3440,10 +3447,17 
> if (!m_bInFullScreen)
> {
> return HXR_UNEXPECTED;
> }
>
> + // Let the sites know we are exiting full screen
before
> destruction of the full screen window
> + HXBOOL bAllow=TRUE;
> + if (m_pWatcher2)
> + {
> + ret = m_pWatcher2->ExitingFullScreen(bAllow);
> + }
> +
> _TLSLock();
> ret = _ExitFullScreenExt();
> _TLSUnlock();
> return ret;
> }
> Index: platform/win32/flash_guest_player_ax.cpp
>
============================================================
=======
> RCS file:
>
/cvsroot/datatype/flash/flashhost/platform/win32/flash_guest
_p
> layer_ax.cpp,v
> retrieving revision 1.21.2.6
> diff -w -u -5 -r1.21.2.6 flash_guest_player_ax.cpp
> --- platform/win32/flash_guest_player_ax.cpp 9 Oct 2007
> 00:03:21 -0000 1.21.2.6
> +++ platform/win32/flash_guest_player_ax.cpp 15 Oct
2007
> 23:39:40 -0000
>  -134,10 +134,11 
> , m_lFlashVersion(0)
> , m_bGotInvalidateRect(FALSE)
> , m_pOffscreenBuffer(NULL)
> , m_hTempWindow(NULL)
> , m_hwndParent(NULL)
> + , m_hwndParentNormal(NULL)
> , m_hdc(0)
> , m_hdcmem(0)
> , m_hBitmap(0)
> , m_pDIBits(0)
> , m_ulDIBitsSize(0)
>  -167,11 +168,12 
> {
> { GET_IIDHANDLE(IID_IUnknown),
(IUnknown*)
> (IHXGuestPlayer*) this},
> {
> GET_IIDHANDLE(IID_IHXGuestPlayer),
(IHXGuestPlayer*)
> this},
> {
> GET_IIDHANDLE(IID_IHXSiteUser),
(IHXSiteUser*)
> this},
> {
> GET_IIDHANDLE(IID_IHXExternalInterface),
(IHXExternalInterface*)
> this},
> - {
> GET_IIDHANDLE(IID_IHXPassiveSiteWatcher),
> (IHXPassiveSiteWatcher*) this},
> + {
> GET_IIDHANDLE(IID_IHXPassiveSiteWatcher2),
> (IHXPassiveSiteWatcher2*) this},
> + { GET_IIDHANDLE(IID_IHXSiteWatcher2),
> (IHXSiteWatcher2*) this},
> {
> GET_IIDHANDLE(IID_IDispatch),
(IDispatch*)
> this},
> {
> GET_IIDHANDLE(IID_IOleClientSite),
(IOleClientSite*)
> this},
> {
GET_IIDHANDLE(IID_IOleInPlaceSiteWindowless),
> (IOleInPlaceSiteWindowless*) this},
> {
> GET_IIDHANDLE(IID_IOleInPlaceSite),
(IOleInPlaceSite*)
> this},
> {
> GET_IIDHANDLE(IID_IOleInPlaceSiteEx),
(IOleInPlaceSiteEx*)
> this},
>  -1014,11 +1016,16 
> STDMETHODIMP CFlashGuestPlayerAX::AttachSite(IHXSite*
pSite)
> {
> HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::AttachSite()");
> HX_RESULT retVal = HXR_INCOMPLETE; // make sure
the base calls
> AttachWindow on us
>
> - if (pSite)
> + if (m_pSite)
> + {
> + // This must be the parent site trying to attach
itself.
> + retVal = HXR_UNEXPECTED;
> + }
> + else if (pSite)
> {
> // Try QI'ing for IHXSiteWindowless
> HXxWindow* pWindow = NULL;
> IHXSiteWindowless* pSiteWindowless = NULL;
> retVal =
pSite->QueryInterface(IID_IHXSiteWindowless,
> (void**) &pSiteWindowless);
>  -1299,36 +1306,110 
>
CFlashGuestPlayerAX::AddRemovePassiveSiteWatcher(IHXSite*
> pSite, HXBOOL bAdd)
> {
> HXLOGL4(HXLOG_FPHR,
>
"CFlashGuestPlayerAX::AddRemovePassiveSiteWatcher(pSite
=%p,bAd
> d=%lu)",
> pSite, bAdd);
> if (pSite)
> {
> + IHXSite* pParentSite=NULL;
> + if (SUCCEEDED(GetRootSite(pSite, pParentSite))
&& pParentSite)
> + {
> // QI for IHXSite2
> IHXSite2* pSite2 = NULL;
> - HX_RESULT rv =
pSite->QueryInterface(IID_IHXSite2,
> (void**) &pSite2);
> + HX_RESULT rv =
pParentSite->QueryInterface(IID_IHXSite2,
> (void**) &pSite2);
> if (SUCCEEDED(rv))
> {
> - // Get our own IHXPassiveSiteWatcher
interface
> - IHXPassiveSiteWatcher* pWatcher = NULL;
> - rv =
QueryInterface(IID_IHXPassiveSiteWatcher, (void**)
> &pWatcher);
> + // Get our own IHXPassiveSiteWatcher2 interface
> + IHXPassiveSiteWatcher2* pPassiveSiteWatcher2 =
NULL;
> + rv = QueryInterface(IID_IHXPassiveSiteWatcher2,
> (void**)
> &pPassiveSiteWatcher2);
> if (SUCCEEDED(rv))
> {
> // Are we adding or removing?
> if (bAdd)
> {
> // Add ourselves as a passive
site watcher
> -
pSite2->AddPassiveSiteWatcher(pWatcher);
> +
>
pSite2->AddPassiveSiteWatcher(pPassiveSiteWatcher2);
> }
> else
> {
> // Remove ourselves as a passive
site watcher
> -
pSite2->RemovePassiveSiteWatcher(pWatcher);
> +
>
pSite2->RemovePassiveSiteWatcher(pPassiveSiteWatcher2);
> }
> }
> - HX_RELEASE(pWatcher);
> + HX_RELEASE(pPassiveSiteWatcher2);
> }
> HX_RELEASE(pSite2);
> +
> + // Get our own IHXSiteWatcher2 interface
> + IHXSiteWatcher2* pSiteWatcher2 = NULL;
> + rv = QueryInterface(IID_IHXSiteWatcher2, (void**)
> &pSiteWatcher2);
> + if (SUCCEEDED(rv))
> + {
> + // Are we adding or removing?
> + if (bAdd)
> + {
> + // Add ourselves as a site watcher
> + pParentSite->AttachWatcher(pSiteWatcher2);
> + }
> + else
> + {
> + if (m_pSite == pSite)
> + {
> + // Make sure we don't create an infinite loop
> + HX_RELEASE(m_pSite);
> + }
> + // Remove ourselves as a site watcher
> + pParentSite->DetachWatcher();
> + }
> + }
> + HX_RELEASE(pSiteWatcher2);
> + }
> + }
> +}
> +
> +HX_RESULT
> +CFlashGuestPlayerAX::GetRootSite(IHXSite* pSite,
> REF(IHXSite*) rpParentSite)
> +{
> + HX_RESULT retVal = HXR_FAIL;
> +
> + HXBOOL bRootFound=FALSE;
> + HXBOOL bFirstParent=TRUE;
> + IHXSite* pCurSite=pSite;
> + pCurSite->AddRef();
> +
> + rpParentSite = pSite;
> + HX_ADDREF(rpParentSite);
> +
> + while (!bRootFound)
> + {
> + // Get the parent
> + IHXSiteTreeNavigation* pSiteTreeNavigation =
NULL;
> + retVal =
pCurSite->QueryInterface(IID_IHXSiteTreeNavigation,
> (void**) &pSiteTreeNavigation);
> + if (SUCCEEDED(retVal))
> + {
> + IHXSite* pParentSite=NULL;
> + retVal =
pSiteTreeNavigation->GetParentSite(pParentSite);
> + if (SUCCEEDED(retVal))
> + {
> + HX_RELEASE(rpParentSite);
> + rpParentSite = pParentSite;
> + HX_ADDREF(rpParentSite);
> + }
> + else
> + {
> + bRootFound = TRUE;
> + }
> + HX_RELEASE(pCurSite); // release previous
parent
> + pCurSite = pParentSite;
> + HX_RELEASE(pSiteTreeNavigation);
> + }
> + else
> + {
> + bRootFound = TRUE;
> + }
> }
> + HX_RELEASE(pCurSite);
> +
> + return HXR_OK;
> }
>
> HXBOOL
> CFlashGuestPlayerAX::IsFlashPlayerControlAvailable()
> {
>  -2215,16 +2296,16 
> }
> }
> #if defined(_DEBUG)
> else if (!strcmp(strInvokeName,
"HXDebug"))
> {
> - HXLOGL4(HXLOG_FPHR,
> "CHXFlashGuestPlayerAX::HandleFlashMessage
> HXDebug (%s)", (const char*) strInvokeArgs);
> + HXLOGL4(HXLOG_FPHR,
> "CFlashGuestPlayerAX::HandleFlashMessage
> HXDebug (%s)", (const char*) strInvokeArgs);
> }
> #endif
> else if (!strcmp(strInvokeName,
"HXError"))
> {
> - HXLOGL4(HXLOG_FPHR,
> "CHXFlashGuestPlayerAX::HandleFlashMessage
> HXError (%s)", (const char*) strInvokeArgs);
> + HXLOGL4(HXLOG_FPHR,
> "CFlashGuestPlayerAX::HandleFlashMessage
> HXError (%s)", (const char*) strInvokeArgs);
> }
> else if (!strcmp(strInvokeName,
"HXPosition"))
> {
> if (!strInvokeArgs.IsEmpty())
> {
>  -2733,5 +2814,85 
> HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::GetPlaybackTime()
> time=%ld", rulTime);
>
> return retVal;
> }
>
> +//
> +// IHXPassiveSiteWatcher2::FullScreenEntered
> +//
> +STDMETHODIMP
> +CFlashGuestPlayerAX::FullScreenEntered(HX_RESULT
status)
> +{
> + HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::FullScreenEntered()
> status=0x%08x", status);
> + if (SUCCEEDED(status) && !m_bWindowless
&& m_pSite)
> + {
> + // Get the full screen window
> + // Try QI'ing for IHXSiteWindowless
> + HXxWindow* pWindow = NULL;
> + IHXSiteWindowless* pSiteWindowless = NULL;
> + HX_RESULT retVal =
> m_pSite->QueryInterface(IID_IHXSiteWindowless,
> (void**) &pSiteWindowless);
> + if (SUCCEEDED(retVal))
> + {
> + pWindow = pSiteWindowless->GetParentWindow();
> + }
> + HX_RELEASE(pSiteWindowless);
> + if (pWindow && ((HWND) pWindow->window) !=
m_hwndParent)
> + {
> + // Save the normal sized window handle for when
we
> exit full screen
> + m_hwndParentNormal = m_hwndParent;
> + m_hwndParent = (HWND) pWindow->window;
> + m_wndView.SetParent(m_hwndParent);
> + }
> + }
> + return HXR_OK;
> +}
> +
> +//
> +// IHXPassiveSiteWatcher2::ExitFullScreen
> +//
> +STDMETHODIMP
> +CFlashGuestPlayerAX::FullScreenExited(HX_RESULT
status)
> +{
> + HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::FullScreenExited()
> status=0x%08x", status);
> + return HXR_OK;
> +}
> +
> +//
> +// IHXSiteWatcher2::EnteringFullScreen
> +//
> +STDMETHODIMP
> +CFlashGuestPlayerAX::EnteringFullScreen(HXBOOL&
bAllow)
> +{
> + HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::EnteringFullScreen()");
> + bAllow = TRUE;
> + return HXR_OK;
> +}
> +
> +//
> +// IHXSiteWatcher2::ExitingFullScreen
> +//
> +STDMETHODIMP
> +CFlashGuestPlayerAX::ExitingFullScreen(HXBOOL&
bAllow)
> +{
> + HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::ExitingFullScreen()");
> + if (m_hwndParentNormal && !m_bWindowless
&& m_pSite)
> + {
> + // Reparent back to the normal window
> + m_hwndParent = m_hwndParentNormal;
> + m_hwndParentNormal = NULL;
> + m_wndView.SetParent(m_hwndParent);
> + }
> + bAllow = TRUE;
> + return HXR_OK;
> +}
> +
> +STDMETHODIMP
> +CFlashGuestPlayerAX::ChangingPosition(HXxPoint posOld,
> REF(HXxPoint) posNew)
> +{
> + return HXR_OK;
> +}
> +
> +STDMETHODIMP
> +CFlashGuestPlayerAX::ChangingSize(HXxSize sizeOld,
> REF(HXxSize) sizeNew)
> +{
> + return HXR_OK;
> +}
> Index: pub/platform/win32/flash_guest_player_ax.h
>
============================================================
=======
> RCS file:
>
/cvsroot/datatype/flash/flashhost/pub/platform/win32/flash_g
ue
> st_player_ax.h,v
> retrieving revision 1.10.2.5
> diff -w -u -5 -r1.10.2.5 flash_guest_player_ax.h
> --- pub/platform/win32/flash_guest_player_ax.h 9 Oct
> 2007 00:03:22
> -0000 1.10.2.5
> +++ pub/platform/win32/flash_guest_player_ax.h 13 Oct
> 2007 01:00:00 -0000
>  -78,11 +78,12 
> struct IHXFileObject;
> class CHXXMLFlash;
>
> class CFlashGuestPlayerAX : public CFlashGuestPlayer
> , public IHXSiteUser
> - , public
IHXPassiveSiteWatcher
> + , public
IHXPassiveSiteWatcher2
> + , public IHXSiteWatcher2
> , public
> ShockwaveFlashObjects::_IShockwaveFlashEvents
> , public IOleClientSite
> , public IOleInPlaceSiteWindowless
> , public IOleInPlaceFrame
> , public IStorage
>  -126,13 +127,21 
> STDMETHOD(AttachSite) (THIS_
IHXSite* pSite);
> STDMETHOD(DetachSite) (THIS);
> STDMETHOD(HandleEvent) (THIS_
HXxEvent* pEvent);
> STDMETHOD_(HXBOOL,NeedsWindowedSites) (THIS);
>
> - // IHXPassiveSiteWatcher methods
> + // IHXPassiveSiteWatcher2 methods
> STDMETHOD(PositionChanged) (THIS_ HXxPoint*
pPoint);
> STDMETHOD(SizeChanged) (THIS_ HXxSize*
pSize);
> + STDMETHOD(FullScreenEntered) (THIS_ HX_RESULT
status);
> + STDMETHOD(FullScreenExited) (THIS_ HX_RESULT
status);
> +
> + // IHXSiteWatcher2 methods
> + STDMETHOD(EnteringFullScreen) (THIS_ HXBOOL&
bAllow);
> + STDMETHOD(ExitingFullScreen) (THIS_ HXBOOL&
bAllow);
> + STDMETHOD(ChangingPosition) (THIS_ HXxPoint
posOld,
> REF(HXxPoint) posNew);
> + STDMETHOD(ChangingSize) (THIS_ HXxSize sizeOld,
> REF(HXxSize) sizeNew);
>
> // IHXExternalInterface methods
> STDMETHOD(CallExternalFunction) (THIS_ IHXBuffer*
pFunction);
>
> // IDispatch methods
>  -253,18 +262,19 
> private:
> HX_RESULT CreateFlashControl();
> HWND CreateTempWindow();
> void DestroyTempWindow();
> HX_RESULT LoadMovie();
> void AddRemovePassiveSiteWatcher(IHXSite*
pSite,
> HXBOOL bAdd);
> HX_RESULT SetWindowSizeAndPosition();
> void CreateOffscreenBitmap(UINT32 ulWidth, UINT32
ulHeight);
> HXBOOL CopyBitmapToOffscreenBuffer(RECT* pRect,
HXBOOL bErase);
> HXBOOL SurfaceUpdate(IHXVideoSurface*
pVideoSurface);
> HXBOOL FireEvent(const char* target);
> HX_RESULT CallActionScript(CHXString
strInvokeXML);
> HXBOOL HandleFlashMessage(const char*
pFunction);
> + HX_RESULT GetRootSite(IHXSite* pSite,
> REF(IHXSite*) rpParentSite);
>
> // Methods called from the event handler
> void OnReadyStateChange(long newState);
> void OnProgress( long percentDone );
> void FSCommand(const char* strCmd, const char*
strArg);
>  -283,10 +293,11 
> }
>
> wchar_t* m_pwszURL;
> HWND m_hTempWindow;
> HWND m_hwndParent;
> + HWND m_hwndParentNormal;
> static const char* const
m_pszTmpWindowClassName;
>
> ShockwaveFlashObjects::IShockwaveFlash*
m_pFlashPlayer;
> CAxWindow m_wndView;
> IConnectionPoint *m_lpConnectionPoint;
>
>
_______________________________________________
Video-dev mailing list
Video-dev helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/video
-dev
|
|
| CN: Flash Guest Player AX: allow full
screen in windowed mode |
  United States |
2007-10-17 16:42:33 |
Thanks, checked into HEAD and 310atlas.
--christina
At 06:11 AM 10/16/2007, Eric Hyche wrote:
>These changes look good.
>
>If possible, please wait until I check in
>my flash guest player changes before you check
>this in. Since you have reviewed my guest player
>changes, I will be checking them in this morning.
>
>Eric
>
>=============================================
>Eric Hyche (ehyche real.com)
>Technical Lead
>RealNetworks, Inc.
>
> > -----Original Message-----
> > From: Christina Dunn [mailto:cdunn real.com]
> > Sent: Monday, October 15, 2007 8:31 PM
> > To: datatype-dev helixcommunity.org;
video-dev helixcommunity.org
> > Cc: Henry Ping; ehyche real.com
> > Subject: CR: Flash Guest Player AX: allow full
screen in windowed mode
> >
> > Synopsis: Full screen does not work in windowed
mode, on windows,
> > since the handle was not being passed to the Flash
Guest Player for
> > reparenting.
> >
> > Overview: Use the new interfaces
IHXPassiveSiteWatcher2, which will
> > send messages after full screen enter/exit, and
IHXSiteWatcher2,
> > which sends messages before full screen enter
exit. After full screen
> > is entered, the guest player will retrieve the
full screen window
> > handle and reparent. Before exit the control will
be reparented back
> > to the original window. We need to do this before
the full screen
> > window has been destroyed, otherwise the control
will crash.
> >
> > Branch: HEAD, 310atlas
> >
> > Files:
> > video/sitelib/basesite.cpp
> > - call IHXSiteWatcher2 to let the sites know
when we
> > are about to
> > enter and exit full screen.
> >
datatype/flash/flashhost/platform/win32/flash_guest_player_a
x.cpp
> >
datatype/flash/flashhost/pub/platform/win32/flash_guest_play
er_ax.h
> > - added IHXSiteWatcher2 interface, changed
> > IHXPassiveSiteWatcher to
> > IHXPassiveSiteWatcher2,
> > so that the guest player can receive
messages
> > before and after
> > entering and exiting full screen.
> > - added m_hwndParentNormal to save the value
of the
> > normal sized
> > window, for reparenting after full screen switch.
> > - modified AddRemovePassiveSiteWatcher to
use the
> > parent site so
> > that it can receive the watcher messages.
> >
> > Diff:
> > Index: basesite.cpp
> >
============================================================
=======
> > RCS file: /cvsroot/video/sitelib/basesite.cpp,v
> > retrieving revision 1.48.2.2
> > diff -w -u -5 -r1.48.2.2 basesite.cpp
> > --- basesite.cpp 12 Oct 2007 19:09:43 -0000
1.48.2.2
> > +++ basesite.cpp 16 Oct 2007 00:04:48 -0000
> >  -3414,10 +3414,17 
> > if (m_bInFullScreen)
> > {
> > return HXR_UNEXPECTED;
> > }
> >
> > + // Let the sites know we are entering full
screen before we are
> > in full screen
> > + HXBOOL bAllow=TRUE;
> > + if (m_pWatcher2)
> > + {
> > + ret =
m_pWatcher2->EnteringFullScreen(bAllow);
> > + }
> > +
> > _TLSLock();
> > m_bSyncFullScreen = FALSE;
> > ret = _EnterFullScreenExt(pWindow,
pValues);
> > _TLSUnlock();
> > return ret;
> >  -3440,10 +3447,17 
> > if (!m_bInFullScreen)
> > {
> > return HXR_UNEXPECTED;
> > }
> >
> > + // Let the sites know we are exiting full
screen before
> > destruction of the full screen window
> > + HXBOOL bAllow=TRUE;
> > + if (m_pWatcher2)
> > + {
> > + ret =
m_pWatcher2->ExitingFullScreen(bAllow);
> > + }
> > +
> > _TLSLock();
> > ret = _ExitFullScreenExt();
> > _TLSUnlock();
> > return ret;
> > }
> > Index: platform/win32/flash_guest_player_ax.cpp
> >
============================================================
=======
> > RCS file:
> >
/cvsroot/datatype/flash/flashhost/platform/win32/flash_guest
_p
> > layer_ax.cpp,v
> > retrieving revision 1.21.2.6
> > diff -w -u -5 -r1.21.2.6
flash_guest_player_ax.cpp
> > --- platform/win32/flash_guest_player_ax.cpp 9
Oct 2007
> > 00:03:21 -0000 1.21.2.6
> > +++ platform/win32/flash_guest_player_ax.cpp 15
Oct 2007
> > 23:39:40 -0000
> >  -134,10 +134,11 
> > , m_lFlashVersion(0)
> > , m_bGotInvalidateRect(FALSE)
> > , m_pOffscreenBuffer(NULL)
> > , m_hTempWindow(NULL)
> > , m_hwndParent(NULL)
> > + , m_hwndParentNormal(NULL)
> > , m_hdc(0)
> > , m_hdcmem(0)
> > , m_hBitmap(0)
> > , m_pDIBits(0)
> > , m_ulDIBitsSize(0)
> >  -167,11 +168,12 
> > {
> > { GET_IIDHANDLE(IID_IUnknown),
(IUnknown*)
> > (IHXGuestPlayer*) this},
> > {
> > GET_IIDHANDLE(IID_IHXGuestPlayer),
(IHXGuestPlayer*)
> > this},
> > {
> > GET_IIDHANDLE(IID_IHXSiteUser),
(IHXSiteUser*)
> > this},
> > {
> > GET_IIDHANDLE(IID_IHXExternalInterface),
(IHXExternalInterface*)
> > this},
> > - {
> > GET_IIDHANDLE(IID_IHXPassiveSiteWatcher),
> > (IHXPassiveSiteWatcher*) this},
> > + {
> > GET_IIDHANDLE(IID_IHXPassiveSiteWatcher2),
> > (IHXPassiveSiteWatcher2*) this},
> > + { GET_IIDHANDLE(IID_IHXSiteWatcher2),
> > (IHXSiteWatcher2*) this},
> > {
> > GET_IIDHANDLE(IID_IDispatch),
(IDispatch*)
> > this},
> > {
> > GET_IIDHANDLE(IID_IOleClientSite),
(IOleClientSite*)
> > this},
> > {
GET_IIDHANDLE(IID_IOleInPlaceSiteWindowless),
> > (IOleInPlaceSiteWindowless*) this},
> > {
> > GET_IIDHANDLE(IID_IOleInPlaceSite),
(IOleInPlaceSite*)
> > this},
> > {
> > GET_IIDHANDLE(IID_IOleInPlaceSiteEx),
(IOleInPlaceSiteEx*)
> > this},
> >  -1014,11 +1016,16 
> > STDMETHODIMP
CFlashGuestPlayerAX::AttachSite(IHXSite* pSite)
> > {
> > HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::AttachSite()");
> > HX_RESULT retVal = HXR_INCOMPLETE; // make
sure the base calls
> > AttachWindow on us
> >
> > - if (pSite)
> > + if (m_pSite)
> > + {
> > + // This must be the parent site trying to
attach itself.
> > + retVal = HXR_UNEXPECTED;
> > + }
> > + else if (pSite)
> > {
> > // Try QI'ing for IHXSiteWindowless
> > HXxWindow* pWindow =
NULL;
> > IHXSiteWindowless* pSiteWindowless =
NULL;
> > retVal =
pSite->QueryInterface(IID_IHXSiteWindowless,
> > (void**) &pSiteWindowless);
> >  -1299,36 +1306,110 
> >
CFlashGuestPlayerAX::AddRemovePassiveSiteWatcher(IHXSite*
> > pSite, HXBOOL bAdd)
> > {
> > HXLOGL4(HXLOG_FPHR,
> >
"CFlashGuestPlayerAX::AddRemovePassiveSiteWatcher(pSite
=%p,bAd
> > d=%lu)",
> > pSite, bAdd);
> > if (pSite)
> > {
> > + IHXSite* pParentSite=NULL;
> > + if (SUCCEEDED(GetRootSite(pSite,
pParentSite)) && pParentSite)
> > + {
> > // QI for IHXSite2
> > IHXSite2* pSite2 = NULL;
> > - HX_RESULT rv =
pSite->QueryInterface(IID_IHXSite2,
> > (void**) &pSite2);
> > + HX_RESULT rv =
pParentSite->QueryInterface(IID_IHXSite2,
> > (void**) &pSite2);
> > if (SUCCEEDED(rv))
> > {
> > - // Get our own IHXPassiveSiteWatcher
interface
> > - IHXPassiveSiteWatcher* pWatcher =
NULL;
> > - rv =
QueryInterface(IID_IHXPassiveSiteWatcher, (void**)
> > &pWatcher);
> > + // Get our own
IHXPassiveSiteWatcher2 interface
> > + IHXPassiveSiteWatcher2*
pPassiveSiteWatcher2 = NULL;
> > + rv =
QueryInterface(IID_IHXPassiveSiteWatcher2,
> > (void**)
> > &pPassiveSiteWatcher2);
> > if (SUCCEEDED(rv))
> > {
> > // Are we adding or removing?
> > if (bAdd)
> > {
> > // Add ourselves as a
passive site watcher
> > -
pSite2->AddPassiveSiteWatcher(pWatcher);
> > +
> >
pSite2->AddPassiveSiteWatcher(pPassiveSiteWatcher2);
> > }
> > else
> > {
> > // Remove ourselves as a
passive site watcher
> > -
pSite2->RemovePassiveSiteWatcher(pWatcher);
> > +
> >
pSite2->RemovePassiveSiteWatcher(pPassiveSiteWatcher2);
> > }
> > }
> > - HX_RELEASE(pWatcher);
> > + HX_RELEASE(pPassiveSiteWatcher2);
> > }
> > HX_RELEASE(pSite2);
> > +
> > + // Get our own IHXSiteWatcher2
interface
> > + IHXSiteWatcher2* pSiteWatcher2 = NULL;
> > + rv = QueryInterface(IID_IHXSiteWatcher2,
(void**)
> > &pSiteWatcher2);
> > + if (SUCCEEDED(rv))
> > + {
> > + // Are we adding or removing?
> > + if (bAdd)
> > + {
> > + // Add ourselves as a site
watcher
> > +
pParentSite->AttachWatcher(pSiteWatcher2);
> > + }
> > + else
> > + {
> > + if (m_pSite == pSite)
> > + {
> > + // Make sure we don't create
an infinite loop
> > + HX_RELEASE(m_pSite);
> > + }
> > + // Remove ourselves as a site
watcher
> > +
pParentSite->DetachWatcher();
> > + }
> > + }
> > + HX_RELEASE(pSiteWatcher2);
> > + }
> > + }
> > +}
> > +
> > +HX_RESULT
> > +CFlashGuestPlayerAX::GetRootSite(IHXSite* pSite,
> > REF(IHXSite*) rpParentSite)
> > +{
> > + HX_RESULT retVal = HXR_FAIL;
> > +
> > + HXBOOL bRootFound=FALSE;
> > + HXBOOL bFirstParent=TRUE;
> > + IHXSite* pCurSite=pSite;
> > + pCurSite->AddRef();
> > +
> > + rpParentSite = pSite;
> > + HX_ADDREF(rpParentSite);
> > +
> > + while (!bRootFound)
> > + {
> > + // Get the parent
> > + IHXSiteTreeNavigation*
pSiteTreeNavigation = NULL;
> > + retVal =
pCurSite->QueryInterface(IID_IHXSiteTreeNavigation,
> > (void**) &pSiteTreeNavigation);
> > + if (SUCCEEDED(retVal))
> > + {
> > + IHXSite* pParentSite=NULL;
> > + retVal =
pSiteTreeNavigation->GetParentSite(pParentSite);
> > + if (SUCCEEDED(retVal))
> > + {
> > + HX_RELEASE(rpParentSite);
> > + rpParentSite = pParentSite;
> > + HX_ADDREF(rpParentSite);
> > + }
> > + else
> > + {
> > + bRootFound = TRUE;
> > + }
> > + HX_RELEASE(pCurSite); // release
previous parent
> > + pCurSite = pParentSite;
> > + HX_RELEASE(pSiteTreeNavigation);
> > + }
> > + else
> > + {
> > + bRootFound = TRUE;
> > + }
> > }
> > + HX_RELEASE(pCurSite);
> > +
> > + return HXR_OK;
> > }
> >
> > HXBOOL
> >
CFlashGuestPlayerAX::IsFlashPlayerControlAvailable()
> > {
> >  -2215,16 +2296,16 
> > }
> > }
> > #if defined(_DEBUG)
> > else if (!strcmp(strInvokeName,
"HXDebug"))
> > {
> > - HXLOGL4(HXLOG_FPHR,
> > "CHXFlashGuestPlayerAX::HandleFlashMessage
> > HXDebug (%s)", (const char*) strInvokeArgs);
> > + HXLOGL4(HXLOG_FPHR,
> > "CFlashGuestPlayerAX::HandleFlashMessage
> > HXDebug (%s)", (const char*) strInvokeArgs);
> > }
> > #endif
> > else if (!strcmp(strInvokeName,
"HXError"))
> > {
> > - HXLOGL4(HXLOG_FPHR,
> > "CHXFlashGuestPlayerAX::HandleFlashMessage
> > HXError (%s)", (const char*) strInvokeArgs);
> > + HXLOGL4(HXLOG_FPHR,
> > "CFlashGuestPlayerAX::HandleFlashMessage
> > HXError (%s)", (const char*) strInvokeArgs);
> > }
> > else if (!strcmp(strInvokeName,
"HXPosition"))
> > {
> > if (!strInvokeArgs.IsEmpty())
> > {
> >  -2733,5 +2814,85 
> > HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::GetPlaybackTime()
> > time=%ld", rulTime);
> >
> > return retVal;
> > }
> >
> > +//
> > +// IHXPassiveSiteWatcher2::FullScreenEntered
> > +//
> > +STDMETHODIMP
> > +CFlashGuestPlayerAX::FullScreenEntered(HX_RESULT
status)
> > +{
> > + HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::FullScreenEntered()
> > status=0x%08x", status);
> > + if (SUCCEEDED(status) &&
!m_bWindowless && m_pSite)
> > + {
> > + // Get the full screen window
> > + // Try QI'ing for IHXSiteWindowless
> > + HXxWindow* pWindow = NULL;
> > + IHXSiteWindowless* pSiteWindowless = NULL;
> > + HX_RESULT retVal =
> > m_pSite->QueryInterface(IID_IHXSiteWindowless,
> > (void**) &pSiteWindowless);
> > + if (SUCCEEDED(retVal))
> > + {
> > + pWindow =
pSiteWindowless->GetParentWindow();
> > + }
> > + HX_RELEASE(pSiteWindowless);
> > + if (pWindow && ((HWND)
pWindow->window) != m_hwndParent)
> > + {
> > + // Save the normal sized window handle
for when we
> > exit full screen
> > + m_hwndParentNormal = m_hwndParent;
> > + m_hwndParent = (HWND)
pWindow->window;
> > + m_wndView.SetParent(m_hwndParent);
> > + }
> > + }
> > + return HXR_OK;
> > +}
> > +
> > +//
> > +// IHXPassiveSiteWatcher2::ExitFullScreen
> > +//
> > +STDMETHODIMP
> > +CFlashGuestPlayerAX::FullScreenExited(HX_RESULT
status)
> > +{
> > + HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::FullScreenExited()
> > status=0x%08x", status);
> > + return HXR_OK;
> > +}
> > +
> > +//
> > +// IHXSiteWatcher2::EnteringFullScreen
> > +//
> > +STDMETHODIMP
> >
+CFlashGuestPlayerAX::EnteringFullScreen(HXBOOL&
bAllow)
> > +{
> > + HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::EnteringFullScreen()");
> > + bAllow = TRUE;
> > + return HXR_OK;
> > +}
> > +
> > +//
> > +// IHXSiteWatcher2::ExitingFullScreen
> > +//
> > +STDMETHODIMP
> >
+CFlashGuestPlayerAX::ExitingFullScreen(HXBOOL& bAllow)
> > +{
> > + HXLOGL4(HXLOG_FPHR,
"CFlashGuestPlayerAX::ExitingFullScreen()");
> > + if (m_hwndParentNormal &&
!m_bWindowless && m_pSite)
> > + {
> > + // Reparent back to the normal window
> > + m_hwndParent = m_hwndParentNormal;
> > + m_hwndParentNormal = NULL;
> > + m_wndView.SetParent(m_hwndParent);
> > + }
> > + bAllow = TRUE;
> > + return HXR_OK;
> > +}
> > +
> > +STDMETHODIMP
> > +CFlashGuestPlayerAX::ChangingPosition(HXxPoint
posOld,
> > REF(HXxPoint) posNew)
> > +{
> > + return HXR_OK;
> > +}
> > +
> > +STDMETHODIMP
> > +CFlashGuestPlayerAX::ChangingSize(HXxSize
sizeOld,
> > REF(HXxSize) sizeNew)
> > +{
> > + return HXR_OK;
> > +}
> > Index: pub/platform/win32/flash_guest_player_ax.h
> >
============================================================
=======
> > RCS file:
> >
/cvsroot/datatype/flash/flashhost/pub/platform/win32/flash_g
ue
> > st_player_ax.h,v
> > retrieving revision 1.10.2.5
> > diff -w -u -5 -r1.10.2.5 flash_guest_player_ax.h
> > --- pub/platform/win32/flash_guest_player_ax.h
9 Oct
> > 2007 00:03:22
> > -0000 1.10.2.5
> > +++ pub/platform/win32/flash_guest_player_ax.h
13 Oct
> > 2007 01:00:00 -0000
> >  -78,11 +78,12 
> > struct IHXFileObject;
> > class CHXXMLFlash;
> >
> > class CFlashGuestPlayerAX : public
CFlashGuestPlayer
> > , public IHXSiteUser
> > - , public
IHXPassiveSiteWatcher
> > + , public
IHXPassiveSiteWatcher2
> > + , public
IHXSiteWatcher2
> > , public
> > ShockwaveFlashObjects::_IShockwaveFlashEvents
> > , public IOleClientSite
> > , public
IOleInPlaceSiteWindowless
> > , public IOleInPlaceFrame
> > , public IStorage
> >  -126,13 +127,21 
> > STDMETHOD(AttachSite) (THIS_
IHXSite* pSite);
> > STDMETHOD(DetachSite) (THIS);
> > STDMETHOD(HandleEvent) (THIS_
HXxEvent* pEvent);
> > STDMETHOD_(HXBOOL,NeedsWindowedSites)
(THIS);
> >
> > - // IHXPassiveSiteWatcher methods
> > + // IHXPassiveSiteWatcher2 methods
> > STDMETHOD(PositionChanged) (THIS_ HXxPoint*
pPoint);
> > STDMETHOD(SizeChanged) (THIS_ HXxSize*
pSize);
> > + STDMETHOD(FullScreenEntered) (THIS_ HX_RESULT
status);
> > + STDMETHOD(FullScreenExited) (THIS_ HX_RESULT
status);
> > +
> > + // IHXSiteWatcher2 methods
> > + STDMETHOD(EnteringFullScreen) (THIS_
HXBOOL& bAllow);
> > + STDMETHOD(ExitingFullScreen) (THIS_
HXBOOL& bAllow);
> > + STDMETHOD(ChangingPosition) (THIS_
HXxPoint posOld,
> > REF(HXxPoint) posNew);
> > + STDMETHOD(ChangingSize) (THIS_ HXxSize
sizeOld,
> > REF(HXxSize) sizeNew);
> >
> > // IHXExternalInterface methods
> > STDMETHOD(CallExternalFunction) (THIS_
IHXBuffer* pFunction);
> >
> > // IDispatch methods
> >  -253,18 +262,19 
> > private:
> > HX_RESULT CreateFlashControl();
> > HWND CreateTempWindow();
> > void DestroyTempWindow();
> > HX_RESULT LoadMovie();
> > void
AddRemovePassiveSiteWatcher(IHXSite* pSite,
> > HXBOOL bAdd);
> > HX_RESULT SetWindowSizeAndPosition();
> > void CreateOffscreenBitmap(UINT32
ulWidth, UINT32 ulHeight);
> > HXBOOL CopyBitmapToOffscreenBuffer(RECT*
pRect, HXBOOL bErase);
> > HXBOOL SurfaceUpdate(IHXVideoSurface*
pVideoSurface);
> > HXBOOL FireEvent(const char* target);
> > HX_RESULT CallActionScript(CHXString
strInvokeXML);
> > HXBOOL HandleFlashMessage(const char*
pFunction);
> > + HX_RESULT GetRootSite(IHXSite* pSite,
> > REF(IHXSite*) rpParentSite);
> >
> > // Methods called from the event handler
> > void OnReadyStateChange(long newState);
> > void OnProgress( long percentDone );
> > void FSCommand(const char* strCmd, const
char* strArg);
> >  -283,10 +293,11 
> > }
> >
> > wchar_t* m_pwszURL;
> > HWND m_hTempWindow;
> > HWND m_hwndParent;
> > + HWND m_hwndParentNormal;
> > static const char* const
m_pszTmpWindowClassName;
> >
> > ShockwaveFlashObjects::IShockwaveFlash*
m_pFlashPlayer;
> > CAxWindow m_wndView;
> > IConnectionPoint
*m_lpConnectionPoint;
> >
> >
_______________________________________________
Video-dev mailing list
Video-dev helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/video
-dev
|
|
[1-3]
|
|