📄 sm1parse.h
字号:
STDMETHOD(HandleCharacterData) (IHXBuffer* /*IN*/ pBuffer,
UINT32 /*IN*/ ulLineNumber,
UINT32 /*IN*/ ulColumNumber);
STDMETHOD(HandleProcessingInstruction) (const char* /*IN*/ pTarget,
IHXValues* /*IN*/ pAttributes,
UINT32 /*IN*/ ulLineNumber,
UINT32 /*IN*/ ulColumNumber);
STDMETHOD(HandleUnparsedEntityDecl) (const char* /*IN*/ pEntityName,
const char* /*IN*/ pSystemID,
const char* /*IN*/ pPublicID,
const char* /*IN*/ pNotationName,
UINT32 /*IN*/ ulLineNumber,
UINT32 /*IN*/ ulColumNumber);
STDMETHOD(HandleNotationDecl) (const char* /*IN*/ pNotationName,
const char* /*IN*/ pSystemID,
const char* /*IN*/ pPublicID,
UINT32 /*IN*/ ulLineNumber,
UINT32 /*IN*/ ulColumNumber);
STDMETHOD(HandleComment) (const char* /*IN*/ pComment,
UINT32 /*IN*/ ulLineNumber,
UINT32 /*IN*/ ulColumNumber);
STDMETHOD(HandleUnparsedDoctypeDecl) (const char* /*IN*/ pName,
const char* /*IN*/ pSystemID,
const char* /*IN*/ pPublicID,
UINT32 /*IN*/ ulLineNumber,
UINT32 /*IN*/ ulColumNumber);
STDMETHOD(HandleDefault) (IHXBuffer* /*IN*/ pBuffer,
UINT32 /*IN*/ ulLineNumber,
UINT32 /*IN*/ ulColumNumber);
HX_RESULT ErrorInLastTag (HX_RESULT Error,
const char* pErrorString,
const char* pFrameString,
UINT32 ulLineNumber,
UINT32 ulLinePosition);
};
class CSmil1Parser
{
public:
CSmil1Parser (IUnknown* pContext);
~CSmil1Parser ();
HX_RESULT init (BOOL bStoreErrors = FALSE);
HX_RESULT parse (IHXBuffer* pBuffer,
BOOL bIsFinal);
HX_RESULT parse (const char* pSmilText);
HX_RESULT createElements ();
HX_RESULT durationResolved (const char* pID,
UINT32 ulDuration);
void insertTimelineElement (const char* pID,
UINT32 ulDelay);
void resetTimelineElementDuration (const char* pID,
UINT32 ulDuration);
void resetTimeline ();
UINT16 getFragmentGroup (const char* pFragment);
UINT32 getFragmentOffset (const char* pFragment,
BOOL& bFragFoundAndResolved);
HX_RESULT handleNextElement (CSmil1ElementHandler* pHandler);
SMIL1Node* findFirstNode (SMIL1NodeTag tag);
SMIL1Node* getFirstNodeChild (SMIL1Node* pNode);
CSmil1Element* findElement (const char* pID);
SMIL1Node* getNextNodeChild ();
void getPacketPending (UINT16 unStreamNumber);
HX_RESULT addGlobalNamespace (const char* pNamespace,
const char* pPrefix);
HX_RESULT storeNamespaces (SMIL1Node* pNode);
HX_RESULT addToNamespaceScope (SMIL1Node* pNode);
HX_RESULT removeFromNamespaceScope (SMIL1Node* pNode);
// note -- the pErr array returned has the same scope as the SMILParser
// object
HX_RESULT getErrors (CHXPtrArray** pErrs);
BOOL IsSMIL10FullyCompliant () {return
m_bSMIL10FullCompliance;}
UINT32 GetUniqueNumber() { return m_ulNextVar++; }
ElementWithinTag GetElementWithin(const char* pID);
void InitPersistent(UINT32 ulPersistentComponentID, ElementWithinTag elementWithinTag);
CHXStack* m_pNodeListStack;
SMIL1NodeList* m_pNodeList;
BOOL m_bTimestampsResolved;
UINT32 m_ulErrorLineNumber;
UINT32 m_ulErrorColumnNumber;
IHXBuffer* m_pErrorText;
CSmil1TimelineElementManager* m_pTimelineElementManager;
friend class CSmil1ParserResponse;
private:
void close ();
void initRequireTags ();
void getPreferences ();
HX_RESULT createHeadElements (SMIL1NodeList* pNodeList);
HX_RESULT createSeqWrapper (SMIL1NodeList* pNodeList);
HX_RESULT createBodyElements (SMIL1NodeList* pNodeList);
HX_RESULT assignGroupIndexes (SMIL1NodeList* pNodeList);
HX_RESULT assignGroupIndexOnPar (SMIL1Node* pNode,
UINT16 nGroup);
HX_RESULT assignGroupIndexOnSeq (SMIL1Node* pNode,
UINT16& nGroup);
HX_RESULT constructTimelineElements (SMIL1NodeList* pNodeList);
HX_RESULT setInitialDelays (SMIL1NodeList* pNodeList);
void setInitialDelay (SMIL1Node* pNode);
void setInitialDelayOnSeq (SMIL1Node* pNode);
HX_RESULT expandRepeatElements (SMIL1NodeList* pNodeList);
HX_RESULT printBodyElements (SMIL1NodeList* pNodeList);
HX_RESULT updateEventElements (SMIL1NodeList* pNodeList);
HX_RESULT insertElementByTimestamp (CSmil1Element* pElement);
HX_RESULT addGroup (SMIL1Node* pNode);
HX_RESULT insertGroups ();
HX_RESULT mapID (SMIL1Node* pNode, BOOL bOverWrite=FALSE);
HX_RESULT mapChildrenIDs (SMIL1NodeList* pNodeList, BOOL bOverWrite=FALSE);
HX_RESULT markRepeatReplica (SMIL1NodeList* pNodeList, RepeatTag repeatTag);
BOOL testAttributeFailed (SMIL1Node* pNode);
BOOL systemComponentFailed (IHXBuffer* pRequiredValue);
HX_RESULT markTestAttributeNodes (SMIL1NodeList* pNodeList);
HX_RESULT selectSwitchNodes (SMIL1Node* pNode);
BOOL hasParParent (SMIL1Node* pNode);
BOOL inSeq (SMIL1Node* pNode);
HX_RESULT createParent (SMIL1Node* pChildNode, SMIL1NodeTag tag,
SMIL1Node*& pParent, SMIL1Node*& pParentEnd);
SMIL1Node* getSyncParent (SMIL1Node* pNode);
void resolveTimestamps ();
void resolveTimestamps (SMIL1NodeList* pNodeList);
UINT32 getStartTime (SMIL1Node* pNode);
CSmil1Region* makeRegion (SMIL1Node* pNode);
CSmil1RootLayout* makeRootLayout (SMIL1Node* pNode);
CSmil1Meta* makeMeta (SMIL1Node* pNode);
CSmil1RendererPreFetch* makeRendererPreFetch (SMIL1Node* pNode);
CSmil1Source* makeSource (SMIL1Node* pNode);
CSmil1AAnchorElement* makeAAnchorElement (SMIL1Node* pNode);
CSmil1AnchorElement* makeAnchorElement (SMIL1Node* pNode);
CSmil1SeqElement* makeSeqElement (SMIL1Node* pNode);
CSmil1ParElement* makeParElement (SMIL1Node* pNode);
BOOL firstDependentChild (SMIL1Node* pNode);
SMIL1Node* findFirstNode (SMIL1NodeList* pNodelist,
SMIL1NodeTag tag);
SMIL1Node* getTimelineDescendent (SMIL1Node* pParentNode,
SMIL1Node* pSiblingNode);
SMIL1Node* getTimelineDescendent (SMIL1Node* pParentNode);
const char* assignID (const char* pPrefix);
HX_RESULT parseDuration (const char* pDuration,
CSmil1Element* pElement,
SMILSyncAttributeTag nTag);
HX_RESULT adjustDuration (CSmil1Element* pElement);
HX_RESULT parseClockValue (const char* pValue,
UINT32& ulClockValue);
HX_RESULT parseAnchorCoords (const char* pCoords,
CSmil1AnchorElement* pAnchor);
BOOL inLanguagePreference (const char* pLang);
BOOL isRelativeURL (const char* pURL);
UINT8 getColorElement (const char* pColorFragment,
int len);
HXxColor parseColor (const char* pColorString);
void handleXMLParserError (XMLError* pError);
void badAttributeError (SMIL1NodeTag tag,
const char* pNodeName,
UINT32 ulLineNumber,
BOOL bJustStore);
void initTagAttributes ();
void deleteTagAttributes ();
BOOL isLegalAttribute (SMIL1NodeTag tag,
const char* pAttrName);
SMIL1NodeTag getSyncTag (SMIL1Node* pNode);
HX_RESULT storeError (HX_RESULT errCode,
const char* pErrorString,
const char* pFrameString,
UINT32 ulLineNumber,
UINT32 ulLinePosition,
BOOL bXml = TRUE);
BOOL isMediaObject (SMIL1Node* pNode);
IUnknown* m_pContext;
IHXCommonClassFactory* m_pClassFactory;
IHXSystemRequired* m_pISystemRequired;
IHXXMLParser* m_pParser;
CSmil1ParserResponse* m_pResponse;
SMIL1Node* m_pCurNode;
CHXStack* m_pNodeDependencies;
SMIL1Node* m_pCurrentDependentNode;
CHXStack* m_pAnchorStack;
CSmil1AAnchorElement* m_pCurrentAnchor;
UINT32 m_ulCurEndTime;
CSmil1EndLayout* m_pEndLayout;
CHXSimpleList* m_pPacketQueue;
CHXSimpleList* m_pSourceUpdateList;
CHXMapLongToObj* m_pAddGroupMap;
CHXMapLongToObj* m_pTagAttributeMap;
CHXMapStringToOb* m_pIDMap;
CHXMapStringToOb* m_pRequireTagsMap;
CHXMapStringToOb* m_pActiveNamespaceMap;
CHXSimpleList* m_pNSConflictList;
char* m_pBasePath;
CHXSimpleList* m_pTrackHintList;
BOOL m_bIgnoreUnrecognizedElements;
BOOL m_bNoNamespaces;
BOOL m_bRNNamespace;
BOOL m_bSMILRootLayoutAlreadyFound;
//This flag is always FALSE until we enable it in a future
// release at which point we will initialize it to TRUE
// and only set it to FALSE when an author or server admin
// specifically specifies that he/she wants our old
// SMIL parser to handle the (presumably poorly-authored) file.
// NOTE: as of 1/20/2000, the code to allow authors to
// force the old parser to be used is not yet written.
// In addition, pncont/xmlparse.h/.cpp has a similar flag and
// the two need to be linked to the same value when that code
// gets written:
BOOL m_bSMIL10FullCompliance;
UINT32 m_ulBandwidthPreference;
UINT32 m_ulScreenHeightPreference;
UINT32 m_ulScreenWidthPreference;
UINT32 m_ulScreenDepthPreference;
BOOL m_bCaptionsPreference;
BOOL m_bContainsSource;
char* m_pOverdubOrCaptionPreference;
char* m_pEncoding;
CHXSimpleList* m_pLanguagePreferenceList;
BOOL m_bStoreErrors;
CHXPtrArray* m_pErrors;
UINT32 m_ulPersistentComponentID;
ElementWithinTag m_elementWithinTag;
char* m_pVarName;
UINT32 m_ulNextVar;
};
#endif /* _SM1PARSE_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -