⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sm1doc.h

📁 著名的 helix realplayer 基于手机 symbian 系统的 播放器全套源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* ***** 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 _SM1DOC_H_
#define _SM1DOC_H_

#include "hxthread.h"
#include "baseobj.h"

class CSmil1Renderer;
class CSmil1Parser;
class CSmil1BasicRegion;
class CSmil1RootLayout;
class CHXHeader;
struct SMIL1PlayToAssoc;
struct SMIL1SourceInfo;
class CSmil1LayoutEvent;
class CSmil1ShowSiteEvent;
class CSmil1EventHook;
class CSmil1PassiveSiteWatcher;
class CResourceLoader;
class ProcessElementCallback;

#ifdef _WINDOWS
class CHXDIBits;
#endif

#if defined(_UNIX) && (!(defined(_BEOS))) && (!(defined(_MAC_UNIX)))
#include <X11/Xlib.h>
#include <X11/Xutil.h>

typedef ULONG32 COLORTYPE;


class XData
{
  public:
      XData()
      {
	  m_Pixmap = 0;
	  m_Display = 0;
      }

      ~XData()
      {
	  if (m_Pixmap != 0)
	  {
              XFreePixmap(m_Display, m_Pixmap);
	  }
      }

  public:
      HXBitmapInfoHeader m_backgroundBitmapInfoHeader;
      Pixmap m_Pixmap;
      Display* m_Display;
      Colormap m_colormap;
};
#endif    // _UNIX


class CSmil1DocumentRenderer:  public IHXSiteUser,
			       public IHXRendererAdviseSink,
			       public IHXGroupSink,
			       public IHXValues,
			       public CSmil1ElementHandler,
			       public IHXPassiveSiteWatcher,
                               public CHXBaseCountingObject
{
public:
    CSmil1DocumentRenderer	    (CSmil1Renderer* pParent,
				    IUnknown* pContext);
    virtual ~CSmil1DocumentRenderer  ();

    HX_RESULT close		    (CSmil1Renderer* pParent);
    HX_RESULT setDocument	    (const char* pFragment);
    HX_RESULT onPacket		    (IHXBuffer* pBuffer,
				    BOOL bIsFinal);

    HX_RESULT handleLButtonUp	    (const char* pID,
				    UINT16 uXPos,
				    UINT16 uYPos);

    HX_RESULT handleMouseMove	    (void* pWindow,
				    const char* pID,
				    UINT16 uXPos,
				    UINT16 uYPos);
    BOOL handleSetCursor	    ();

    HX_RESULT detachSite	    (IHXSite* pSite);

    double			    getResizeXScale()
				    {
					return m_dResizeXScale;
				    }
    double			    getResizeYScale()
				    {
					return m_dResizeYScale;
				    }

    HX_RESULT addShowEvents	    (const char* pRegionName,
				    IHXSite* pSite);

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

    /*
     * IHXSiteUser methods
     */
    STDMETHOD(AttachSite)	    (THIS_
				    IHXSite* pSite);
    STDMETHOD(DetachSite)	    (THIS);
    STDMETHOD(HandleEvent)	    (THIS_
				    HXxEvent* pEvent);
    STDMETHOD_(BOOL,NeedsWindowedSites)	(THIS);

    /*
     * IHXRendererAdviseSink methods
     */
    STDMETHOD(TrackDurationSet)		(THIS_
					UINT32 ulGroupIndex,
					UINT32 ulTrackIndex,
					UINT32 ulDuration,
					UINT32 ulDelay,
					BOOL   bIsLive);

    STDMETHOD(RepeatedTrackDurationSet)	(THIS_
					const char*  pID,
					UINT32 ulDuration,					
				        BOOL   bIsLive);

    STDMETHOD(RendererInitialized)	(THIS_
					IHXRenderer* pRend,
					IUnknown* pStream,
					IHXValues* pInfo);

    STDMETHOD(RendererClosed)		(THIS_
					IHXRenderer* pRend,
					IHXValues* pInfo);

    // /POST-RP8REV release IHXRendererAdviseSink method:
    STDMETHOD(TrackUpdated)             (THIS_ UINT32 ulGroupIndex, UINT32 ulTrackIndex,
                                               IHXValues* pValues);


    /*
     * IHXGroupSink methods
     */
    STDMETHOD(GroupAdded)		(THIS_
					UINT16		uGroupIndex,
					IHXGroup*	pGroup);

    STDMETHOD(GroupRemoved)		(THIS_
					UINT16		uGroupIndex,
					IHXGroup*	pGroup);

    STDMETHOD(AllGroupsRemoved)		(THIS);

    STDMETHOD(TrackAdded)		(THIS_
					UINT16		uGroupIndex,
					UINT16		uTrackIndex,
					IHXValues*	pTrack);

    STDMETHOD(TrackRemoved)		(THIS_
					UINT16		uGroupIndex,
					UINT16		uTrackIndex,
					IHXValues*	pTrack);

    STDMETHOD(TrackStarted)		(THIS_
					UINT16		uGroupIndex,
					UINT16		uTrackIndex,
					IHXValues*	pTrack);

    STDMETHOD(TrackStopped)		(THIS_
					UINT16		uGroupIndex,
					UINT16		uTrackIndex,
					IHXValues*	pTrack);

    STDMETHOD(CurrentGroupSet)		(THIS_
					UINT16		uGroupIndex,
					IHXGroup*	pGroup);

    /*
     * IHXValues methods
     */
    STDMETHOD(SetPropertyULONG32)	(THIS_
					const char*	 pPropertyName,
					ULONG32		 uPropertyValue);

    STDMETHOD(GetPropertyULONG32)	(THIS_
					const char*	 pPropertyName,
					REF(ULONG32)	 uPropertyValue);

    STDMETHOD(GetFirstPropertyULONG32)	(THIS_
					REF(const char*) pPropertyName,
					REF(ULONG32)	 uPropertyValue);

    STDMETHOD(GetNextPropertyULONG32)	(THIS_
					REF(const char*) pPropertyName,
					REF(ULONG32)	 uPropertyValue);

    STDMETHOD(SetPropertyBuffer)	(THIS_
					const char*	 pPropertyName,
					IHXBuffer*	 pPropertyValue);

    STDMETHOD(GetPropertyBuffer)	(THIS_
					const char*	 pPropertyName,
					REF(IHXBuffer*) pPropertyValue);

    STDMETHOD(GetFirstPropertyBuffer)	(THIS_
					REF(const char*) pPropertyName,
					REF(IHXBuffer*) pPropertyValue);

    STDMETHOD(GetNextPropertyBuffer)	(THIS_
					REF(const char*) pPropertyName,
					REF(IHXBuffer*) pPropertyValue);

    STDMETHOD(SetPropertyCString)	(THIS_
					const char*	 pPropertyName,
					IHXBuffer*	 pPropertyValue);

    STDMETHOD(GetPropertyCString)	(THIS_
					const char*	 pPropertyName,
					REF(IHXBuffer*) pPropertyValue);

    STDMETHOD(GetFirstPropertyCString)	(THIS_
					REF(const char*) pPropertyName,
					REF(IHXBuffer*) pPropertyValue);

    STDMETHOD(GetNextPropertyCString)	(THIS_
					REF(const char*) pPropertyName,
					REF(IHXBuffer*) pPropertyValue);

    /*
     *	IHXPassiveSiteWatcher methods
     */
    STDMETHOD(PositionChanged) (THIS_
				HXxPoint* /*IN*/ pPoint);

    STDMETHOD(SizeChanged) 	(THIS_
				HXxSize* /*IN*/ pSize);

    /*
     * CSmil1ElementHandler methods
     */
    HX_RESULT handleAddGroup		(CSmil1AddGroup* pAddGroup);
    HX_RESULT handleRegion		(CSmil1Region* pRegion);
    HX_RESULT handleRootLayout		(CSmil1RootLayout* pRootLayout);
    HX_RESULT handleSource		(CSmil1Source* pSource);
    HX_RESULT handleMeta		(CSmil1Meta* pMeta);
    HX_RESULT handleEndLayout		(CSmil1EndLayout* pSource);
    HX_RESULT handleRendererPreFetch	(CSmil1RendererPreFetch* pRend);
    HX_RESULT handleSourceUpdate	(CSmil1SourceUpdate* pUpdate);

    /*
     * CSmil1Parser methods
     */
    HX_RESULT onHeader			(IHXValues* pHeader);
    HX_RESULT onTimeSync		(UINT32 ulTimeValue);
    HX_RESULT onPreSeek			(UINT32 ulOldTime,
					UINT32 ulNewTime);
    HX_RESULT endStream			();

    HX_RESULT seekTo			(const char* pElementID);

    CSmil1BasicRegion* getRegion		(const char* pID);
    void resizeRegion			(const char* pRegionName,
					HXxSize* pNewSize);
    void repositionRegion		(const char* pRegionName,
					HXxPoint* pNewPosition);
    void setTopLevelSiteSize		();

    HX_RESULT HandleSurfaceUpdate	(HXxEvent* pEvent,
					IHXSite* pSite,
					HXxColor ulBGColor);

    HX_RESULT getErrorInfo		(REF(UINT32) ulErrorLine,
					 REF(UINT32) ulErrorColumn,
					 REF(IHXBuffer*) pErrorText);

    HX_RESULT		 GetElementProperties(UINT16		uGroupID, 
					      UINT16		uTrackID, 
					      REF(IHXValues*)	pProperties);

    HX_RESULT		 GetElementStatus(UINT16	    uGroupID,
					  UINT16	    uTrackID,
					  UINT32	    ulCurrentTime,
					  REF(IHXValues*)  pStatus);

    HX_RESULT		 AttachElementLayout(UINT16	    uGroupID,
					     UINT16	    uTrackID,
					     IHXRenderer*  pRenderer,
					     IHXStream*    pStream,
					     IHXValues*    pProps);
    HX_RESULT		 DetachElementLayout(IUnknown*	    pLSG);

    BOOL				m_bSiteChangingSize;
    BOOL				m_bNeedToAdjustSites;
    UINT32				m_ulNoRootLayoutHeight;
    UINT32				m_ulNoRootLayoutWidth;

    BOOL                                isRootLayoutWidthSet() const  { return m_bRootLayoutWidthSet;  }
    BOOL                                isRootLayoutHeightSet() const { return m_bRootLayoutHeightSet; }

    friend class CSmil1Renderer;

private:
    HX_RESULT addSiteForRenderer	(SMIL1PlayToAssoc* pPlayToAssoc,
					SMIL1SourceInfo* pSMIL1SourceInfo,
					IHXRenderer* pRenderer,
					BOOL bNoRegion);
    void setPlayToAssoc			(UINT16 uGroupIndex, 
					UINT16 uTrackIndex, 
					const char* pID,
					const char* pRepeatID, // /For SHAZAM
					const char* pPlayTo,
					const char* pRegionName);
    SMIL1PlayToAssoc* getPlayToAssoc	(UINT16 uGroupIndex, 
					UINT16 uTrackIndex);
    SMIL1PlayToAssoc* getPlayToAssoc	(const char* pName); 
    void removeAllPlayToAssoc		();
    void removeGroupsPlayToAssoc	(UINT16	uGroupIndex);
    void removeSourcemap		(SMIL1PlayToAssoc* pPlayToAssoc);
    HX_RESULT insertEvent		(CSmil1ShowSiteEvent* pEvent);
    CSmil1ShowSiteEvent* getShowHideEvent(IHXSite* pRegionSite,
					  IHXSite* pRendererSite,
                                          BOOL	    bShowEvent);
    HX_RESULT insertSiteInfo		(void* pInfo);
    void removeGroupEvents		(UINT16 uGroupIndex);
    void showSite			(IHXSite* pSite, 
					BOOL bShow);

⌨️ 快捷键说明

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