smlparse.h

来自「symbian 下的helix player源代码」· C头文件 代码 · 共 831 行 · 第 1/3 页

H
831
字号
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: smlparse.h,v 1.6.12.1 2004/07/09 01:57:56 hubbe Exp $
 * 
 * Portions Copyright (c) 1995-2004 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 (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (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.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * 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 _SMLPARSE_H_
#define _SMLPARSE_H_

#define MAX_PENDING_CHECK_CALLDEPTH 20

/* <body dur="20s">[no sources]</body> is valid; we need to handle it: */
#define DEFAULT_DUR_IF_NO_SOURCES_SCHEDULED   SMILTIME_INVALID

// forward declarations
typedef _INTERFACE IHXSystemRequired     IHXSystemRequired;
typedef _INTERFACE IHXBuffer             IHXBuffer;
typedef _INTERFACE IHXValues             IHXValues;
typedef _INTERFACE IHXXMLParserResponse  IHXXMLParserResponse;
typedef _INTERFACE IHXCommonClassFactory IHXCommonClassFactory;
typedef _INTERFACE IHXXMLParser          IHXXMLParser;
typedef void*                             LISTPOSITION;
class CHXString;
class SMILNodeList;
class CSmilElement;
class CHXSimpleList;
class ErrorNotifier;
class CSmilParser;
class CSmilElementHandler;
class SmilTimeValue;
class CHXPtrArray;
class CSmilAnchorElement;
class CHXStack;
class CSmilRegion;
class CSmilRegPoint;
#if defined(HELIX_FEATURE_SMIL2_MULTIWINDOWLAYOUT)
class CSmilViewport;
#endif /* #if defined(HELIX_FEATURE_SMIL2_MULTIWINDOWLAYOUT) */
class CSmilTransition;
class CSmilRootLayout;
class CSmilMeta;
class CSmilMetadata;
class CSmilRendererPreFetch;
class CSmilSource;
class CSmilPriorityClassElement;
class CSmilAAnchorElement;
class CSmilSeqElement;
class CSmilParElement;
class CSmilExclElement;
class CSmilAnimateElement;
class CSmilParamElement;
class CSmilCustomTest;
class XMLError;
class CHXMapLongToObj;
class CHXMapStringToOb;
#if defined(HELIX_FEATURE_SMIL2_VALIDATION)
class CRNBinaryMap;
#endif /* #if defined(HELIX_FEATURE_SMIL2_VALIDATION) */
class CNamespaceInfo;
class CSmilBodyElement;
class CSmilTimelineElementManager;

/* // /XXXEH- we can't do the following until the core starts notifying
// us every time a repeated track begins:
//#define XXXEH_REPEAT_VALUE_TIMING_SHOULD_BE_EVENT_BASED
*/


#define NUM_SUPPORTED_SMIL_2_0_MODULE_NAMESPACES   55


class SMILNamespace
{
public:
    SMILNamespace(SMILNamespace* pNS);
    SMILNamespace(const char* name, IHXBuffer* pVal);
    virtual ~SMILNamespace();

    char*       m_name;
    IHXBuffer* m_pValue;
};

class SMILNode
{
public:
    SMILNode();
    virtual ~SMILNode();
#if defined(XXXEH_REPEAT_VALUE_TIMING_SHOULD_BE_EVENT_BASED)
    SMILNode(const SMILNode&, BOOL bKeepId=FALSE, CSmilParser* pParser = NULL);
#else
    SMILNode(const SMILNode&, BOOL bKeepId=FALSE, CSmilParser* pParser = NULL,
             UINT32 ulRepeatNum=0);
#endif

    SMILNode* getFirstChild();
    SMILNode* getNextChild();

    CHXString      m_repeatid;
    CHXString      m_id;
    CHXString      m_name;
    UINT32         m_num;    
    SMILNodeTag    m_tag;
    SMILNode*      m_pParent;
    SMILNode*      m_pDependency;
    SMILNodeList*  m_pNodeList;
    IHXValues*    m_pValues;
    CSmilElement*  m_pElement;
    UINT16         m_nGroup;
    RepeatTag      m_repeatTag;
    CHXString      m_trackHint;
    UINT32         m_ulTagStartLine;
    UINT32         m_ulTagStartColumn;
    UINT16         m_nPrefetchTrackNum;
    double         m_fPartialPlayFactor;
    UINT32         m_ulRepeatDur;
    CHXSimpleList* m_pNamespaceList;
    SMIL2Element   m_eElement;
    // ONLY HX_BITFIELD MEMBERS SHOULD GO BELOW THIS LINE!
    // ALL OTHER MEMBER TYPES SHOULD GO ABOVE THIS LINE!
    HX_BITFIELD    m_bLastInGroup : 1;
    HX_BITFIELD    m_bDelete : 1;
    HX_BITFIELD    m_bSkipContent : 1;
    HX_BITFIELD    m_bRepeatHandled : 1;
    HX_BITFIELD    m_bIsSeqWrapperForRepeatElement : 1;
    HX_BITFIELD    m_bIsOuterWrapperTimeContainer : 1;
    HX_BITFIELD    m_bBeginHandledByWrapperParent : 1;
    HX_BITFIELD    m_bEndHandledByWrapperParent : 1;
    HX_BITFIELD    m_bMinHandledByWrapperParent : 1;
    HX_BITFIELD    m_bMaxHandledByWrapperParent : 1;
    HX_BITFIELD    m_bNeedToResolveRepeatDurVSRepeatCount : 1;
    HX_BITFIELD    m_bCloseNode : 1;
    HX_BITFIELD    m_bNamespacedElement : 1;
private:
    LISTPOSITION   m_curPosition;
};

class SMILNodeList: public CHXSimpleList
{
public:
    SMILNodeList();
    virtual ~SMILNodeList();

    SMILNodeList* copy(SMILNode* pParent, BOOL bKeepId = FALSE, CSmilParser* pParser = NULL);

    SMILNode* m_pParentNode;
};

class CNamespaceInfo
{
public:
    CNamespaceInfo();
    ~CNamespaceInfo();

    char*              m_pszPrefix;
    char*              m_pszURL;
    SupportedNamespace m_eNamespace;
    // ONLY HX_BITFIELD MEMBERS SHOULD GO BELOW THIS LINE!
    // ALL OTHER MEMBER TYPES SHOULD GO ABOVE THIS LINE!
    HX_BITFIELD        m_bImplemented : 1;
};


class CSmilParserResponse : public IHXXMLParserResponse,
                            public ErrorNotifier
{
public:
    CSmilParserResponse(CSmilParser* pParser);
    virtual ~CSmilParserResponse();

    // IUnknown methods
    STDMETHOD(QueryInterface)    (THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32, AddRef)  (THIS);
    STDMETHOD_(ULONG32, Release) (THIS);

    // IHXXMLParserResponse methods
    STDMETHOD(HandleStartElement)          (THIS_ const char* pName,
                                                  IHXValues* pAttributes,
                                                  UINT32      ulLineNumber,
                                                  UINT32      ulColumNumber);
    STDMETHOD(HandleEndElement)            (THIS_ const char* pName,
                                                  UINT32      ulLineNumber,
                                                  UINT32      ulColumNumber);
    STDMETHOD(HandleCharacterData)         (THIS_ IHXBuffer* pBuffer,
                                                  UINT32      ulLineNumber,
                                                  UINT32      ulColumNumber);
    STDMETHOD(HandleProcessingInstruction) (THIS_ const char* pTarget,
                                                  IHXValues* pAttributes,
                                                  UINT32      ulLineNumber,
                                                  UINT32      ulColumNumber);
    STDMETHOD(HandleUnparsedEntityDecl)    (THIS_ const char* pEntityName,
                                                  const char* pSystemID,
                                                  const char* pPublicID,
                                                  const char* pNotationName,
                                                  UINT32      ulLineNumber,
                                                  UINT32      ulColumNumber);
    STDMETHOD(HandleNotationDecl)          (THIS_ const char* pNotationName,
                                                  const char* pSystemID,
                                                  const char* pPublicID,
                                                  UINT32      ulLineNumber,
                                                  UINT32      ulColumNumber);
    STDMETHOD(HandleComment)               (THIS_ const char* pComment,
                                                  UINT32      ulLineNumber,
                                                  UINT32      ulColumNumber);
    STDMETHOD(HandleUnparsedDoctypeDecl)   (THIS_ const char* pName, 
                                                  const char* pSystemID,
                                                  const char* pPublicID, 
                                                  UINT32      ulLineNumber,
                                                  UINT32      ulColumNumber);
    STDMETHOD(HandleDefault)               (THIS_ IHXBuffer* pBuffer,
                                                  UINT32      ulLineNumber,
                                                  UINT32      ulColumNumber);

    // ErrorNotifer methods
    HX_RESULT ErrorInLastTag(HX_RESULT   Error,
                             const char* pErrorString,
                             const char* pFrameString,
                             UINT32      ulLineNumber,
                             UINT32      ulLinePosition);
private:
    CSmilParser* m_pParser;
    INT32        m_lRefCount;
    SMILNode*    m_pCurrentNode;
};

struct ExternalEventInfo
{
    CHXString       m_EventBaseID;
    CHXString       m_PrefixedEventName;
    CHXString       m_EventName;
    CNamespaceInfo* m_pInfo;
};

class CSmilParser
{

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?