basesite.h

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

H
1,182
字号
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: basesite.h,v 1.6.34.3 2004/07/09 01:58: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 _BASESITE_H_
#define _BASESITE_H_

#include "hxslist.h"
#include "chxpckts.h"
#include "hxwin.h"
#include "hxwintyp.h"
#include "hxsite2.h"
#include "hxvctrl.h"
#include "hxcomm.h"
#include "hxengin.h"
#include "region.h"
#include "sitetran.h"
#include "coloracc.h"

class   CHXBaseSite;
class   CBaseSurface;
class   CBaseRootSurface;
class   CHXSiteStatusText;
class   BaseSiteCallback;
class   ScrollSiteCallback;
class   HXMutex;
class   HXThread;

/*
 *  reasons to schedule call backs.
 */

#define REPAINT    0
#define CLIP       1
#define MOUSE      2  
#define REDRAW_ALL 3
#define MOVE       4

#if defined(_UNIX) || defined(_MACINTOSH)
#  define HX_SHOW_WINDOW 1
#  define HX_HIDE_WINDOW 2
#endif

#if defined(_WINDOWS)
#  define HX_SHOW_WINDOW SW_SHOW
#  define HX_HIDE_WINDOW SW_HIDE
#endif

//Defines for sensitivity.
#define SENSITIVITY_NOT_SET     -3
#define SENSITIVITY_OPAQUE      -2
#define SENSITIVITY_TRANSPARENT -1


/****************************************************************************
 * 
 *  Class:
 *
 *      NonDelegatingUnknown
 *
 *  Purpose:
 *
 *      Same signature as IUnknown, allows an object to implement 
 *      aggregation.
 *
 */
class SiteNonDelegatingUnknown
{
  public:
    /*
     * DelegatingUnknown methods
     */
    STDMETHOD(SiteNonDelegatingQueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE;
    STDMETHOD_(ULONG32,SiteNonDelegatingAddRef) (THIS) PURE;
    STDMETHOD_(ULONG32,SiteNonDelegatingRelease) (THIS) PURE;
};

/****************************************************************************
 * 
 *  Class:
 *
 *      CHXBaseSite
 *
 *  Purpose:
 *
 *      Implementation for IHXSite objects which are associated with
 *      platform specific window objects on Microsoft Windows and X-Windows.
 *
 */
class CHXBaseSite : 
public SiteNonDelegatingUnknown,
 public IHXSite2,
 public IHXSiteTreeNavigation,
 public IHXSiteWindowed,
 public IHXSiteWindowless,
 public IHXCallback,
 public IHXStatusMessage,
 public IHXSiteFullScreen,
 public IHXVideoControl,
 public IHXInterruptSafe,
 public IHXSiteTransition,
 public IHXSiteComposition,
 public IHXKeyBoardFocus,
 public IHXDrawFocus,
 public IHXSubRectSite
{
  public:
    
    static CHXBaseSite* CreateSite( IUnknown* pContext,
                                    IUnknown* pUnkOuter = NULL,
                                    INT32 lZorder = 0);
    static BOOL             zm_bInFullScreenTest;
    ColorFuncAccess*        zm_pColorAcc;
    static CHXSimpleList    zm_YUVSiteList;

    LONG32                 m_lRefCount;
    IUnknown*              m_pUnkOuter;
    CHXHeader*             m_pValues;
    CHXMapPtrToPtr         m_ChildrenMap;
    CHXSimpleList          m_ChildrenInZOrder;
    CHXSimpleList          m_PassiveSiteWatchers;
    IHXSiteUser*          m_pUser;
    CHXBaseSite*           m_pParentSite;
    CHXBaseSite*           m_pTopLevelSite;
    CHXBaseSite*           m_pFocusSite;
    CBaseSurface*          m_pVideoSurface;
    CHXSiteStatusText*     m_pStatusText;
    UINT32                 m_nStatusTextExpireTime;
    BaseSiteCallback*      m_pCallback;
    ScrollSiteCallback*    m_pScrollSiteCallback;
    IHXCommonClassFactory*m_pCCF;
    IHXSiteWatcher*       m_pWatcher;
    IUnknown*              m_pContext;
    HXxSize                m_size;
    HXMutex*              m_pMutex;
    HXxPoint               m_position;
    HXxPoint               m_positionOrig;
    HXxPoint               m_CreateWindowPos;
    HXxPoint               m_topleft;
    INT32                  m_lZOrder;
    BOOL                   m_bIsVisible;
    LONG32                 m_lBltEntryCount;
    BOOL                   m_bInDestructor;
    BOOL                   m_bIsChildWindow;
    BOOL                   m_bRecomputeClipScheduled;
    BOOL                   m_bForceRedrawNeeded;
    BOOL                   m_bRepaintScheduled;
    BOOL                   m_bInFullScreen;
    BOOL                   m_bSettingDisplayMode;
    BOOL                   m_bDisableForceRedraw;
    BOOL                   m_bProcessRepaint;
    BOOL                   m_bWasTopMost;
    BOOL                   m_bModeSharpness;
    BOOL                   m_bAboutToBlt;
    CBaseRootSurface*      m_pRootSurface;
    HXREGION*                m_pDirtyRegion;
    BOOL                   m_bSetCaptureOn;
    IHXSiteUser*          m_pCaptureUser;
    IHXSiteUser*          m_pLastUser;
    CHXBaseSite*           m_pMouseInSite;
    CallbackHandle         m_CallbackHandle;
    CallbackHandle         m_ScrollSiteCallbackHandle;
    IHXScheduler*         m_pScheduler;
    HXxPoint               m_windowPosition;
    HXxSize                m_windowSize;
    HXxPoint               m_screenOffset;
    BOOL                   m_bDoNotGenerateWMPPaint;
    UINT32                 m_nLastMoveTime;
    BOOL                   m_bAttachWindowPending;
    BOOL                   m_bDetachWndMsgPending;
    UINT16                 m_nOldBitsPerPixel;
    UINT16                 m_nOldHorzRes;
    UINT16                 m_nOldVertRes;
    float                  m_fSharpness;
    float                  m_fHue;
    float                  m_fSaturation;
    float                  m_fContrast;
    float                  m_fBrightness;
    INT32                  m_XSliderPos;   
    INT32                  m_YSliderPos;   
    INT32                  m_XSliderRange;
    INT32                  m_YSliderRange;
    CHXSimpleList          m_PendingTaskList;
    TransitionType         m_fpTransitionEffect;
    HXxWindow              m_TopLevelWindow;
    HXxWindow*             m_pWindow;
    HXxRect                m_rectOldClientRect;
    HXREGION*                m_Region;
    HXREGION*                m_RegionForMouse;
    HXREGION*                m_RegionWithoutChildren;
    INT32                  m_nDelayFillBorders;
    INT32                  m_nTransitionState;
    BOOL                   m_bTransitionReversed;
    BOOL                   m_bTransitionTranIn;
    INT32                  m_nTransitionVertRepeat;
    INT32                  m_nTransitionHorzRepeat;
    INT32                  m_nTransitionBorderWidth;
    tranLines              m_TransitionBorderLines;
    ULONG32                m_ulTransitionBorderColor;
    ULONG32                m_ulTransitionFadeColor;
    BOOL                   m_bTransitionBlendBorder;
    BOOL                   m_bTransitionCoordinated;
    BOOL                   m_bTransitionCoordTranIsParentClip;
    BOOL                   m_bRegionIsValid;
    BOOL                   m_bWindowCreatedByCreate;
    BOOL                   m_bCalledComputeClipFromTransition;
    INT32                  m_nEventSensitivity;
    CHXMapPtrToPtr         m_upgradeMap;
    BOOL                   m_bScheduleUpgrade;
    CHXSimpleList          m_ListOfRealVideoSites;
    BOOL                   m_bVideoUnderTransition;
    BOOL                   m_bInForceRedraw;
    BOOL                   m_bSiteRefresh;
    BOOL                   m_bTestWindowing;
    INT32                  m_nWindowColor;
    BOOL                   m_bPostageStamp;
    BOOL                   m_bBltHasBeenCalled;
    HXxRect                m_UpdateBltStatsRect;
    BOOL                   m_bScrollingSite;
   
    // IHXKeyBoardFocus
    IHXSiteUser*          m_pKeyBoardFocusUser;

    // IHXDrawFocus
    enum
        {
            DRAW_RECT           = 1, 
            DRAW_ELLIPSE        = 1<<1, 
            DRAW_POLYGON        = 1<<2
        };
    
    typedef struct _FocusRect_t
    {
        union
        {
            HXxRect rcFocus;
            
            struct
            {
                HXxPoint* pFocusPoints;
                UINT32    ulFocusPoints;
            } polygon;
        };
        
        UINT32     ulShape;
        UINT32     ulLineStyle;
        UINT32     ulLineWidth;
      
        UINT8      red, green, blue;
        UINT8      red2, green2, blue2;

        IHXBuffer *pCustomPattern;
        UINT32     ulCustomEntries;

        BOOL       bRectActive;
        BOOL       bSecondaryColors;
        
    } tFocusRect;
    
    tFocusRect             m_rcFocusRect;
   
    typedef enum 
    {
        ONMOVEWINDOW = 0
        , ONUPDATEWINDOW
        , ONSHOWWINDOW
        , ONSETWINDOWPOS
        , ONSETWINDOWREGION
        , ONSETXSLIDER
        , ONSETYSLIDER
        , ONSETFOCUS
        , ONSETSIZE
        , ONSETPOSITION
    } PendingTaskType;

    struct PendingTask
    {
        PendingTask( PendingTaskType uTaskType,
                     CHXBaseSite*    pThis,
                     void*           ulArg1 = 0,
                     void*           ulArg2 = 0,
                     void*           ulArg3 = 0,
                     void*           ulArg4 = 0,
                     void*           ulArg5 = 0,
                     void*           ulArg6 = 0,
                     void*           ulArg7 = 0
                     )
            {
                m_pThis    = pThis;
                m_TaskType = uTaskType;
                m_ulArg1   = ulArg1;
                m_ulArg2   = ulArg2;
                m_ulArg3   = ulArg3;
                m_ulArg4   = ulArg4;
                m_ulArg5   = ulArg5;
                m_ulArg6   = ulArg6;
                m_ulArg7   = ulArg7;
            };
      
        PendingTaskType m_TaskType;
        CHXBaseSite*    m_pThis;
        void*           m_ulArg1;
        void*           m_ulArg2;
        void*           m_ulArg3;
        void*           m_ulArg4;
        void*           m_ulArg5;
        void*           m_ulArg6;
        void*           m_ulArg7;
    };


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

    /*
     * IHXSiteWindowless
     */
    STDMETHOD(EventOccurred)(THIS_ HXxEvent* /*IN*/ pEvent);
    STDMETHOD_(HXxWindow*,GetParentWindow)(THIS);

    /*
     * IHXSiteWindowed
     */

    STDMETHOD(AttachWindow) (THIS_ HXxWindow* /*IN*/ pWindow);
    STDMETHOD(DetachWindow) (THIS);
    STDMETHOD(Create) (THIS_ void* ParentWindow, UINT32 style);
    STDMETHOD(Destroy) (THIS);
    STDMETHOD_(HXxWindow*,GetWindow)(THIS);

    /*
     * IHXSite methods
     */

    STDMETHOD(AttachUser) (THIS_ IHXSiteUser*   /*IN*/  pUser);
    STDMETHOD(DetachUser) (THIS);
    STDMETHOD(GetUser) (THIS_ REF(IHXSiteUser*) /*OUT*/ pUser);
    STDMETHOD(CreateChild) (THIS_ REF(IHXSite*)  /*OUT*/ pChildSite);

⌨️ 快捷键说明

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