📄 sm1rendr.h
字号:
/* ***** BEGIN LICENSE BLOCK *****
* Version: RCSL 1.0/RPSL 1.0
*
* Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved.
*
* The contents of this file, and the files included with this file, are
* subject to the current version of the RealNetworks Public Source License
* Version 1.0 (the "RPSL") available at
* http://www.helixcommunity.org/content/rpsl unless you have licensed
* the file under the RealNetworks Community Source License Version 1.0
* (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
* in which case the RCSL will apply. You may also obtain the license terms
* directly from RealNetworks. You may not use this file except in
* compliance with the RPSL or, if you have a valid RCSL with RealNetworks
* applicable to this file, the RCSL. Please see the applicable RPSL or
* RCSL for the rights, obligations and limitations governing use of the
* contents of the file.
*
* This file is part of the Helix DNA Technology. RealNetworks is the
* developer of the Original Code and owns the copyrights in the portions
* it created.
*
* This file, and the files included with this file, is distributed and made
* available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
*
* Technology Compatibility Kit Test Suite(s) Location:
* http://www.helixcommunity.org/content/tck
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** */
#ifndef _SM1RENDR_H_
#define _SM1RENDR_H_
#include "hxwintyp.h"
#include "hxwin.h"
#include "baseobj.h"
#define STREAM_MAJOR_VERSION 0
#define STREAM_MINOR_VERSION 0
#define CONTENT_MAJOR_VERSION 0
#define CONTENT_MINOR_VERSION 0
class CSmilPacketParser;
class CSmil1SiteSupplier;
class CHXSimpleList;
class CSmil1DocumentRenderer;
class CSmilDocumentPacket;
/////////////////////////////////////////////////////////////////////////////
//
// Class:
//
// CSmil1Renderer
//
// Purpose:
//
// SMIL implementation of a basic renderer.
//
class CSmil1Renderer : public IHXPlugin
, public IHXRenderer
, public IHXStatistics
, public IHXPersistentRenderer
, public CHXBaseCountingObject
{
private:
LONG32 m_lRefCount;
IUnknown* m_pContext;
IHXStream* m_pStream;
IHXPlayer* m_pPlayer;
IHXClientEngine* m_pEngine;
IUnknown* m_pClientContext;
ULONG32 m_ulLastTime;
UINT32 m_ulGranularity;
UINT16 m_uLayoutRule;
UINT16 m_uSourceRule;
CHXString m_urlPrefix;
CHXString m_urlRoot;
char* m_pURLFragment;
CSmilPacketParser* m_pPacketParser;
CSmil1DocumentRenderer* m_pSmilDocRenderer;
CHXString m_smilDocument;
UINT32 m_ulTotalSMILPackets;
IHXCommonClassFactory* m_pCommonClassFactory;
HX_RESULT m_lastOnPacketResult;
#if defined(HELIX_FEATURE_SMIL2)
// /All of the following are needed for handling SMIL 2+ streams:
CSmilRenderer* m_pNextGenSmilRenderer;
BOOL m_bIsHigherVersionSmilStreamFromOldSMIL1FF;
IHXValues* m_pHeader;
IHXBuffer* m_pDefaultNamespace;
BOOL m_bCSmil1StartStreamHasBeenCalled;
BOOL m_bCSmil1EndStreamHasBeenCalled;
BOOL m_bCSmil1GetDisplayTypeHasBeenCalled;
BOOL m_bCSmil1InitializeStatisticsHasBeenCalled;
BOOL m_bCSmil1InitPersistenHasBeenCalled;
BOOL m_bCSmil1GetElementPropertiesHasBeenCalled;
BOOL m_bCSmil1RemoveLayoutSiteGroupHasBeenCalled;
UINT32 m_ulRegistryID;
UINT16 m_uGroupID;
UINT16 m_uTrackID;
#endif /* defined(HELIX_FEATURE_SMIL2). */
UINT32 m_ulPersistentComponentID;
UINT16 m_uPersistentGroupID;
UINT16 m_uPersistentTrackID;
IHXPersistentRenderer* m_pPersistentParent;
// /End "...handling SMIL 2+ streams".
BOOL m_bUseNestedMeta;
UINT32 m_ulPersistentVersion;
PersistentType m_persistentType;
IHXPersistentComponentManager* m_pPersistentComponentManager;
static const char* const zm_pName;
static const char* const zm_pDescription;
static const char* const zm_pCopyright;
static const char* const zm_pMoreInfoURL;
static const char* const zm_pStreamMimeTypes[];
~CSmil1Renderer ();
PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME
HX_RESULT handleSMILDocumentPacket
(CSmilDocumentPacket* pPacket);
HX_RESULT getErrorString (SMILErrorTag tag,
CHXString& str);
HX_RESULT findValidDefaultNamespace(IHXBuffer* pStartOfFile);
HX_RESULT findSmilTagAndVersion (IHXBuffer* pFileChunk);
HX_RESULT setUpNextGenSmilRenderer ();
friend class CSmil1DocumentRenderer;
#ifdef _WINDOWS
HDC m_hDC;
#endif
public:
CSmil1Renderer ();
// CSmil1Renderer methods
static HX_RESULT STDAPICALLTYPE CanUnload2(void);
static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
IHXCommonClassFactory* getFactory ()
{ return m_pCommonClassFactory; }
IHXClientEngine* getClientEngine ()
{ return m_pEngine; }
IUnknown* getClientContext ()
{ return m_pClientContext; }
IHXPlayer* getPlayer ()
{ return m_pPlayer; }
CHXString& getURLPrefix ()
{ return m_urlPrefix; }
CHXString& getURLRoot ()
{ return m_urlRoot; }
UINT32 getGranularity ()
{ return m_ulGranularity; }
HX_RESULT HandleAddLayoutSiteGroup (IUnknown* pLSG);
HX_RESULT HandleRemoveLayoutSiteGroup (IUnknown* pLSG);
HX_RESULT HandleAttachElementLayout(IUnknown* pLSG, IHXValues* pProps);
void generatePreFix (void);
#if defined(HELIX_FEATURE_SMIL2)
BOOL isHigherVersionSmilStreamFromOldSMIL1FF() {
return m_bIsHigherVersionSmilStreamFromOldSMIL1FF;}
#endif /* defined(HELIX_FEATURE_SMIL2). */
// *** IHXPlugin methods ***
/************************************************************************
* Method:
* IHXPlugin::GetPluginInfo
* Purpose:
* Returns the basic information about this plugin. Including:
*
* bLoadMultiple whether or not this plugin DLL can be loaded
* multiple times. All File Formats must set
* this value to TRUE.
* pDescription which is used in about UIs (can be NULL)
* pCopyright which is used in about UIs (can be NULL)
* pMoreInfoURL which is used in about UIs (can be NULL)
*/
STDMETHOD(GetPluginInfo) (THIS_
REF(BOOL) /*OUT*/ bLoadMultiple,
REF(const char*) /*OUT*/ pDescription,
REF(const char*) /*OUT*/ pCopyright,
REF(const char*) /*OUT*/ pMoreInfoURL,
REF(ULONG32) /*OUT*/ ulVersionNumber
);
/************************************************************************
* Method:
* IHXPlugin::InitPlugin
* Purpose:
* Initializes the plugin for use. This interface must always be
* called before any other method is called. This is primarily needed
* so that the plugin can have access to the context for creation of
* IHXBuffers and IMalloc.
*/
STDMETHOD(InitPlugin) (THIS_
IUnknown* /*IN*/ pContext);
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -