[xiph-commits] r16787 - in trunk/oggdsf/src/lib/plugin/AxPlayer: . Res
cristianadam at svn.xiph.org
cristianadam at svn.xiph.org
Thu Jan 14 20:13:36 PST 2010
Author: cristianadam
Date: 2010-01-14 20:13:36 -0800 (Thu, 14 Jan 2010)
New Revision: 16787
Added:
trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.cpp
trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.h
trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.rgs
trunk/oggdsf/src/lib/plugin/AxPlayer/test.html
trunk/oggdsf/src/lib/plugin/AxPlayer/test_pre_ie8.html
Removed:
trunk/oggdsf/src/lib/plugin/AxPlayer/Resource.h
Modified:
trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.cpp
trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.idl
trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.vcproj
trunk/oggdsf/src/lib/plugin/AxPlayer/Res/AxPlayer.rc
trunk/oggdsf/src/lib/plugin/AxPlayer/dllmain.cpp
trunk/oggdsf/src/lib/plugin/AxPlayer/stdafx.h
Log:
Now the AxPlayer can display a Gray rectangle where the <video> tag should be.
Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.cpp 2010-01-15 02:40:38 UTC (rev 16786)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.cpp 2010-01-15 04:13:36 UTC (rev 16787)
@@ -6,7 +6,14 @@
#include "AxPlayer_i.h"
#include "dllmain.h"
#include "dlldatax.h"
+#include <MsHtmHst.h>
+namespace
+{
+ // Conform with http://wiki.whatwg.org/wiki/FAQ#What_is_the_namespace_declaration.3F
+ const wchar_t* HTML5NS = L"http://www.w3.org/1999/xhtml";
+}
+
// Used to determine whether the DLL can be unloaded by OLE
STDAPI DllCanUnloadNow(void)
{
@@ -40,6 +47,18 @@
return hr;
hr = PrxDllRegisterServer();
#endif
+
+ // Microsoft has IERegisterXMLNS function in <MsHtmHst.h> but
+ // didn't bother to give also a library
+ HMODULE mshtml = (HMODULE)::LoadLibrary(L"mshtml.dll");
+
+ IEREGISTERXMLNSFN* ieRegisterXmlsNs = (IEREGISTERXMLNSFN*)::GetProcAddress(mshtml, "IERegisterXMLNS");
+
+ if (ieRegisterXmlsNs != 0)
+ {
+ (*ieRegisterXmlsNs)(HTML5NS, CLSID_VideoTagBehavior, TRUE);
+ }
+
return hr;
}
@@ -89,5 +108,3 @@
return hr;
}
-
-
Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.idl
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.idl 2010-01-15 02:40:38 UTC (rev 16786)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.idl 2010-01-15 04:13:36 UTC (rev 16787)
@@ -8,6 +8,16 @@
import "ocidl.idl";
[
+ object,
+ uuid(8DEA6524-F708-46AE-9D20-2C8CA0BCF075),
+ dual,
+ nonextensible,
+ helpstring("IVideoTagBehavior Interface"),
+ pointer_default(unique)
+]
+interface IVideoTagBehavior : IDispatch{
+};
+[
uuid(4856ADA6-564F-41B8-ACAA-E98ABD004A84),
version(1.0),
helpstring("AxPlayer 1.0 Type Library")
@@ -15,4 +25,22 @@
library AxPlayerLib
{
importlib("stdole2.tlb");
+ [
+ uuid(35E1EB3E-98C3-40FC-9E52-5A7FF0AC394F),
+ helpstring("_IVideoTagBehaviorEvents Interface")
+ ]
+ dispinterface _IVideoTagBehaviorEvents
+ {
+ properties:
+ methods:
+ };
+ [
+ uuid(7CC95AE6-C1FA-40CC-AB17-3E91DA2F77CA),
+ helpstring("HTML5 <video> and <audio> implementation.")
+ ]
+ coclass VideoTagBehavior
+ {
+ [default] interface IVideoTagBehavior;
+ [default, source] dispinterface _IVideoTagBehaviorEvents;
+ };
};
Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.vcproj
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.vcproj 2010-01-15 02:40:38 UTC (rev 16786)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/AxPlayer.vcproj 2010-01-15 04:13:36 UTC (rev 16787)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1250"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9,00"
+ Version="9.00"
Name="AxPlayer"
ProjectGUID="{C2C1F096-2541-4B13-A57E-52F2368A0E36}"
RootNamespace="AxPlayer"
@@ -56,8 +56,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories=""Generated Files""
- PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL"
+ AdditionalIncludeDirectories=""Generated Files";res;..\..\helper\"
+ PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -145,8 +145,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories=""Generated Files""
- PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL"
+ AdditionalIncludeDirectories=""Generated Files";res;..\..\helper\common\"
+ PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -234,8 +234,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories=""Generated Files""
- PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL"
+ AdditionalIncludeDirectories=""Generated Files";res;..\..\helper\common\"
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_MERGE_PROXYSTUB"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
@@ -323,8 +323,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories=""Generated Files""
- PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL"
+ AdditionalIncludeDirectories=""Generated Files";res;..\..\helper\common\"
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_MERGE_PROXYSTUB"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
@@ -512,6 +512,10 @@
/>
</FileConfiguration>
</File>
+ <File
+ RelativePath=".\VideoTagBehavior.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Header Files"
@@ -519,6 +523,10 @@
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
+ RelativePath=".\_IVideoTagBehaviorEvents_CP.h"
+ >
+ </File>
+ <File
RelativePath=".\dlldatax.h"
>
</File>
@@ -527,7 +535,7 @@
>
</File>
<File
- RelativePath=".\Resource.h"
+ RelativePath=".\Res\resource.h"
>
</File>
<File
@@ -538,6 +546,10 @@
RelativePath=".\targetver.h"
>
</File>
+ <File
+ RelativePath=".\VideoTagBehavior.h"
+ >
+ </File>
</Filter>
<Filter
Name="Resource Files"
@@ -552,6 +564,10 @@
RelativePath=".\Res\AxPlayer.rgs"
>
</File>
+ <File
+ RelativePath=".\VideoTagBehavior.rgs"
+ >
+ </File>
</Filter>
<Filter
Name="Generated Files"
Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/Res/AxPlayer.rc
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/Res/AxPlayer.rc 2010-01-15 02:40:38 UTC (rev 16786)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/Res/AxPlayer.rc 2010-01-15 04:13:36 UTC (rev 16787)
@@ -1,4 +1,4 @@
-//Microsoft Visual C++ generated resource script.
+// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
@@ -15,30 +15,36 @@
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-LANGUAGE 9, 1
-#pragma code_page(1250)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
- "#ifndef APSTUDIO_INVOKED\r\n"
+ "#ifndef APSTUDIO_INVOKED\r\n"
"#include ""targetver.h""\r\n"
"#endif\r\n"
"#include ""winres.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"1 TYPELIB ""AxPlayer.tlb""\r\n"
"\0"
@@ -46,7 +52,7 @@
#endif // APSTUDIO_INVOKED
-#ifndef _MAC
+
/////////////////////////////////////////////////////////////////////////////
//
// Version
@@ -77,39 +83,63 @@
VALUE "OriginalFilename", "AxPlayer.dll"
VALUE "ProductName", "TODO: <Product name>"
VALUE "ProductVersion", "1.0.0.1"
- VALUE "OLESelfRegister", ""
END
END
BLOCK "VarFileInfo"
BEGIN
- VALUE "Translation", 0x0409, 1252
+ VALUE "Translation", 0x409, 1252
END
END
-#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
+// REGISTRY
+//
+
+IDR_AXPLAYER REGISTRY "AxPlayer.rgs"
+
+/////////////////////////////////////////////////////////////////////////////
+//
// String Table
//
-STRINGTABLE
+STRINGTABLE
BEGIN
- IDS_PROJNAME "AxPlayer"
+ IDS_PROJNAME "AxPlayer"
END
-IDR_AXPLAYER REGISTRY "AxPlayer.rgs"
-////////////////////////////////////////////////////////////////////////////
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
-#endif
+/////////////////////////////////////////////////////////////////////////////
+// English (Ireland) resources
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENI)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_EIRE
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// REGISTRY
+//
+
+IDR_VIDEOTAGBEHAVIOR REGISTRY "VideoTagBehavior.rgs"
+#endif // English (Ireland) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
1 TYPELIB "AxPlayer.tlb"
+
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
Deleted: trunk/oggdsf/src/lib/plugin/AxPlayer/Resource.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/Resource.h 2010-01-15 02:40:38 UTC (rev 16786)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/Resource.h 2010-01-15 04:13:36 UTC (rev 16787)
@@ -1,18 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by AxPlayer.rc
-//
-
-#define IDS_PROJNAME 100
-#define IDR_AXPLAYER 101
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 201
-#define _APS_NEXT_COMMAND_VALUE 32768
-#define _APS_NEXT_CONTROL_VALUE 201
-#define _APS_NEXT_SYMED_VALUE 102
-#endif
-#endif
Added: trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.cpp (rev 0)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.cpp 2010-01-15 04:13:36 UTC (rev 16787)
@@ -0,0 +1,204 @@
+// VideoTagBehavior.cpp : Implementation of VideoTagBehavior
+
+#include "stdafx.h"
+#include "VideoTagBehavior.h"
+#include "common/util.h"
+
+// VideoTagBehavior
+namespace {
+ const wchar_t* VIDEO_TAG = L"VIDEO";
+}
+
+VideoTagBehavior::VideoTagBehavior() :
+m_width(320),
+m_height(240)
+{
+ LOG(logDEBUG) << this << ": " << __FUNCTIONW__;
+}
+
+HRESULT __stdcall VideoTagBehavior::Init(IElementBehaviorSite* pBehaviorSite)
+{
+ HRESULT hr = S_OK;
+
+ m_site = pBehaviorSite;
+ hr = m_site->QueryInterface(&m_omSite);
+ hr = m_site->QueryInterface(&m_paintSite);
+
+ LOG(logDEBUG) << __FUNCTIONW__;
+
+ return hr;
+}
+
+HRESULT __stdcall VideoTagBehavior::Notify(LONG lEvent, VARIANT* pVar)
+{
+ LOG(logDEBUG) << __FUNCTIONW__ << " lEvent: " << lEvent << ", pVar: " << ToString((CComVariant)pVar);
+
+ switch (lEvent)
+ {
+ case BEHAVIOREVENT_CONTENTREADY:
+ // End tag of element has been parsed (we can get at attributes)
+ break;
+ case BEHAVIOREVENT_DOCUMENTREADY:
+ // HTML document has been parsed (we can get at the document object model)
+ {
+ HRESULT hr = m_site->GetElement(&m_element);
+
+ CComPtr<IHTMLStyle> style;
+ m_element->get_style(&style);
+
+ style->put_pixelWidth(m_width);
+ style->put_pixelHeight(m_height);
+
+ if (m_paintSite)
+ {
+ m_paintSite->InvalidateRect(0);
+ }
+ }
+
+ break;
+ }
+ return S_OK;
+}
+
+HRESULT __stdcall VideoTagBehavior::Detach()
+{
+ return S_OK;
+}
+
+HRESULT __stdcall VideoTagBehavior::FindBehavior(BSTR bstrBehavior, BSTR bstrBehaviorUrl,
+ IElementBehaviorSite* pSite, IElementBehavior** ppBehavior)
+{
+ LOG(logDEBUG) << __FUNCTIONW__ << " bstrBehavior: " << bstrBehavior;
+
+ if (bstrBehavior == 0)
+ {
+ return E_POINTER;
+ }
+
+ HRESULT hr = E_FAIL;
+
+ if (wcsicmp(bstrBehavior, VIDEO_TAG) == 0)
+ {
+ CComObject<VideoTagBehavior>* behavior;
+ hr = CComObject<VideoTagBehavior>::CreateInstance(&behavior);
+
+ if (FAILED(hr))
+ {
+ return hr;
+ }
+
+ hr = behavior->QueryInterface(IID_IElementBehavior, (void**)ppBehavior);
+ }
+
+ return hr;
+}
+
+HRESULT __stdcall VideoTagBehavior::Create(IElementNamespace * pNamespace)
+{
+ CComBSTR tag = VIDEO_TAG;
+ pNamespace->AddTag(tag, 0);
+
+ LOG(logDEBUG) << this << ": " << __FUNCTIONW__;
+
+ return S_OK;
+}
+
+HRESULT __stdcall VideoTagBehavior::Resolve(BSTR bstrNamespace, BSTR bstrTagName, BSTR bstrAttrs,
+ IElementNamespace* pNamespace)
+{
+ return S_OK;
+}
+
+HRESULT VideoTagBehavior::FinalConstruct()
+{
+ util::ConfigureLogSettings();
+
+ return S_OK;
+}
+
+void VideoTagBehavior::FinalRelease()
+{
+
+}
+
+HRESULT __stdcall VideoTagBehavior::GetLayoutInfo(LONG *pLayoutInfo)
+{
+ LOG(logDEBUG) << __FUNCTIONW__;
+ *pLayoutInfo = BEHAVIORLAYOUTINFO_FULLDELEGATION;
+
+ return S_OK;
+}
+
+HRESULT __stdcall VideoTagBehavior::GetPosition(LONG flags, POINT *pTopLeft)
+{
+ LOG(logDEBUG) << __FUNCTIONW__ << ", "
+ << "flags: " << flags << ", "
+ << "pTopLeft: " << pTopLeft->x << ", " << pTopLeft->y;
+
+ return S_OK;
+}
+
+HRESULT __stdcall VideoTagBehavior::GetSize(LONG flags, SIZE sizeContent, POINT *pTranslateBy, POINT *pTopLeft, SIZE *pSize)
+{
+ LOG(logDEBUG) << __FUNCTIONW__ << ", "
+ << "flags: " << flags << ", "
+ << "sizeContent: " << sizeContent.cx << ", " << sizeContent.cy << ", "
+ << "pTopLeft: " << pTopLeft->x << ", " << pTopLeft->y << ", "
+ << "pSize: " << pSize->cx << ", " << pSize->cy;
+
+ pSize->cx = m_width;
+ pSize->cy = m_height;
+
+ return S_OK;
+}
+
+HRESULT __stdcall VideoTagBehavior::MapSize(SIZE *pSizeIn, RECT *pRectOut)
+{
+ LOG(logDEBUG) << __FUNCTIONW__ << ", "
+ << "pSizeIn: " << pSizeIn->cx << ", " << pSizeIn->cy << ", "
+ << "pRectOut: " << pRectOut->left << ", " << pRectOut->top << " - "
+ << pRectOut->right << ", " << pRectOut->bottom;
+
+ return S_OK;
+}
+
+HRESULT __stdcall VideoTagBehavior::GetPainterInfo(HTML_PAINTER_INFO *pInfo)
+{
+ pInfo->lFlags =
+ HTMLPAINTER_NOSAVEDC |
+ HTMLPAINTER_SUPPORTS_XFORM;
+
+ pInfo->lZOrder = HTMLPAINT_ZORDER_REPLACE_ALL;
+
+ memset(&pInfo->iidDrawObject, 0, sizeof(IID));
+
+ pInfo->rcExpand.left = 0;
+ pInfo->rcExpand.top = 0;
+ pInfo->rcExpand.right = 0;
+ pInfo->rcExpand.bottom = 0;
+
+ return S_OK;
+}
+
+HRESULT __stdcall VideoTagBehavior::Draw(RECT rcBounds, RECT rcUpdate, LONG lDrawFlags, HDC hdc, LPVOID pvDrawObject)
+{
+ CRect rect(rcBounds.left, rcBounds.top,
+ rcBounds.left + m_width, rcBounds.top + m_height);
+
+ FillRect(hdc, &rect, (HBRUSH)GetStockObject(GRAY_BRUSH));
+
+ return S_OK;
+}
+
+HRESULT __stdcall VideoTagBehavior::HitTestPoint(POINT pt, BOOL *pbHit, LONG *plPartID)
+{
+ return S_OK;
+}
+
+HRESULT __stdcall VideoTagBehavior::OnResize(SIZE pt)
+{
+ LOG(logDEBUG) << __FUNCTIONW__ << ", "
+ << "size: " << pt.cx << ", " << pt.cy;
+
+ return S_OK;
+}
Added: trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.h (rev 0)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.h 2010-01-15 04:13:36 UTC (rev 16787)
@@ -0,0 +1,103 @@
+// VideoTagBehavior.h : Declaration of the VideoTagBehavior
+
+#pragma once
+#include "resource.h" // main symbols
+
+#include "Generated Files\AxPlayer_i.h"
+#include "_IVideoTagBehaviorEvents_CP.h"
+
+
+#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
+#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
+#endif
+
+
+
+// VideoTagBehavior
+
+class ATL_NO_VTABLE VideoTagBehavior :
+ public CComObjectRootEx<CComSingleThreadModel>,
+ public CComCoClass<VideoTagBehavior, &CLSID_VideoTagBehavior>,
+ public IConnectionPointContainerImpl<VideoTagBehavior>,
+ public CProxy_IVideoTagBehaviorEvents<VideoTagBehavior>,
+ public IObjectSafetyImpl<VideoTagBehavior, INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA>,
+ public IObjectWithSiteImpl<VideoTagBehavior>,
+ public IDispatchImpl<IVideoTagBehavior, &IID_IVideoTagBehavior, &LIBID_AxPlayerLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
+ public IElementBehavior,
+ public IElementBehaviorFactory,
+ public IElementBehaviorLayout,
+ public IElementNamespaceFactory,
+ public IElementNamespaceFactoryCallback,
+ public IHTMLPainter
+{
+public:
+ VideoTagBehavior();
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_VIDEOTAGBEHAVIOR)
+
+ DECLARE_NOT_AGGREGATABLE(VideoTagBehavior)
+
+ BEGIN_COM_MAP(VideoTagBehavior)
+ COM_INTERFACE_ENTRY(IVideoTagBehavior)
+ COM_INTERFACE_ENTRY(IDispatch)
+ COM_INTERFACE_ENTRY(IConnectionPointContainer)
+ COM_INTERFACE_ENTRY(IObjectSafety)
+ COM_INTERFACE_ENTRY(IObjectWithSite)
+ COM_INTERFACE_ENTRY(IElementBehavior)
+ COM_INTERFACE_ENTRY(IElementBehaviorFactory)
+ COM_INTERFACE_ENTRY(IElementBehaviorLayout)
+ COM_INTERFACE_ENTRY(IElementNamespaceFactory)
+ COM_INTERFACE_ENTRY(IElementNamespaceFactoryCallback)
+ COM_INTERFACE_ENTRY(IHTMLPainter)
+ END_COM_MAP()
+
+ BEGIN_CONNECTION_POINT_MAP(VideoTagBehavior)
+ CONNECTION_POINT_ENTRY(__uuidof(_IVideoTagBehaviorEvents))
+ END_CONNECTION_POINT_MAP()
+
+ DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+ HRESULT FinalConstruct();
+
+ void FinalRelease();
+
+ // IElementBehavior
+ HRESULT __stdcall Init(IElementBehaviorSite* pBehaviorSite);
+ HRESULT __stdcall Notify(LONG lEvent, VARIANT* pVar);
+ HRESULT __stdcall Detach();
+
+ // IElementBehaviorFactory
+ HRESULT __stdcall FindBehavior(BSTR bstrBehavior, BSTR bstrBehaviorUrl,
+ IElementBehaviorSite* pSite, IElementBehavior** ppBehavior);
+
+ // IElementBehaviorLayout
+ HRESULT __stdcall GetLayoutInfo(LONG *pLayoutInfo);
+ HRESULT __stdcall GetPosition(LONG flags, POINT *pTopLeft);
+ HRESULT __stdcall GetSize(LONG flags, SIZE sizeContent, POINT *pTranslateBy, POINT *pTopLeft, SIZE *pSize);
+ HRESULT __stdcall MapSize(SIZE *pSizeIn, RECT *pRectOut);
+
+ // IElementNamespaceFactory
+ HRESULT __stdcall Create(IElementNamespace * pNamespace);
+
+ // IElementNamespaceFactoryCallback
+ HRESULT __stdcall Resolve(BSTR bstrNamespace, BSTR bstrTagName, BSTR bstrAttrs,
+ IElementNamespace* pNamespace);
+
+ // IHTMLPainter
+ HRESULT __stdcall GetPainterInfo(HTML_PAINTER_INFO *pInfo);
+ HRESULT __stdcall Draw(RECT rcBounds, RECT rcUpdate, LONG lDrawFlags, HDC hdc, LPVOID pvDrawObject);
+ HRESULT __stdcall HitTestPoint(POINT pt, BOOL *pbHit, LONG *plPartID);
+ HRESULT __stdcall OnResize(SIZE pt);
+
+private:
+
+ CComPtr<IElementBehaviorSite> m_site;
+ CComPtr<IElementBehaviorSiteOM2> m_omSite;
+ CComPtr<IHTMLPaintSite> m_paintSite;
+ CComPtr<IHTMLElement> m_element;
+
+ int m_width;
+ int m_height;
+};
+
+OBJECT_ENTRY_AUTO(__uuidof(VideoTagBehavior), VideoTagBehavior)
Added: trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.rgs
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.rgs (rev 0)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.rgs 2010-01-15 04:13:36 UTC (rev 16787)
@@ -0,0 +1,26 @@
+HKCR
+{
+ AxPlayer.VideoTagBehavior.1 = s 'VideoTagBehavior Class'
+ {
+ CLSID = s '{7CC95AE6-C1FA-40CC-AB17-3E91DA2F77CA}'
+ }
+ AxPlayer.VideoTagBehavior = s 'VideoTagBehavior Class'
+ {
+ CLSID = s '{7CC95AE6-C1FA-40CC-AB17-3E91DA2F77CA}'
+ CurVer = s 'AxPlayer.VideoTagBehavior.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {7CC95AE6-C1FA-40CC-AB17-3E91DA2F77CA} = s 'VideoTagBehavior Class'
+ {
+ ProgID = s 'AxPlayer.VideoTagBehavior.1'
+ VersionIndependentProgID = s 'AxPlayer.VideoTagBehavior'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ 'TypeLib' = s '{4856ADA6-564F-41B8-ACAA-E98ABD004A84}'
+ }
+ }
+}
Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/dllmain.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/dllmain.cpp 2010-01-15 02:40:38 UTC (rev 16786)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/dllmain.cpp 2010-01-15 04:13:36 UTC (rev 16787)
@@ -6,8 +6,11 @@
#include "dllmain.h"
#include "dlldatax.h"
+#include "common/util.h"
+
CAxPlayerModule _AtlModule;
+
// DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
@@ -15,6 +18,7 @@
if (!PrxDllMain(hInstance, dwReason, lpReserved))
return FALSE;
#endif
- hInstance;
+ util::GetHModule() = (HMODULE)hInstance;
+
return _AtlModule.DllMain(dwReason, lpReserved);
}
Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/stdafx.h 2010-01-15 02:40:38 UTC (rev 16786)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/stdafx.h 2010-01-15 04:13:36 UTC (rev 16787)
@@ -19,5 +19,11 @@
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
+#include <atltypes.h>
+#include <atlstr.h>
using namespace ATL;
+
+#include <msxml.h>
+
+#include "common/Log.h"
Added: trunk/oggdsf/src/lib/plugin/AxPlayer/test.html
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/test.html (rev 0)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/test.html 2010-01-15 04:13:36 UTC (rev 16787)
@@ -0,0 +1,14 @@
+<html>
+<body>
+
+<p>This is a header </p>
+
+<video src="http://videos.mozilla.org/firefox/3.5/meet/meet.ogv"
+ xmlns="http://www.w3.org/1999/xhtml">
+ <p>your browser cannot handle video tag.</p>
+</video>
+
+<p>This is a footer </p>
+
+</body>
+</html>
Added: trunk/oggdsf/src/lib/plugin/AxPlayer/test_pre_ie8.html
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/test_pre_ie8.html (rev 0)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/test_pre_ie8.html 2010-01-15 04:13:36 UTC (rev 16787)
@@ -0,0 +1,17 @@
+<html xmlns:html5>
+<head>
+ <object id="videoFactory" classid="clsid:7cc95ae6-c1fa-40cc-ab17-3e91da2f77ca"></object>
+ <?import namespace="html5" implementation="#videoFactory"?>
+</head>
+<body>
+
+<p>This is a header </p>
+
+<html5:video src="http://videos.mozilla.org/firefox/3.5/meet/meet.ogv">
+<p>your browser cannot handle video tag</p>
+</html5:video>
+
+<p>This is a footer </p>
+
+</body>
+</html>
More information about the commits
mailing list