📄 basesite.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 _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 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);
STDMETHOD(DestroyChild) (THIS_ IHXSite* /*IN*/ pChildSite);
STDMETHOD(AttachWatcher) (THIS_ IHXSiteWatcher* /*IN*/ pWatcher);
STDMETHOD(DetachWatcher) (THIS);
STDMETHOD(SetPosition) (THIS_ HXxPoint position);
STDMETHOD(GetPosition) (THIS_ REF(HXxPoint) position);
STDMETHOD(SetSize) (THIS_ HXxSize size);
STDMETHOD(GetSize) (THIS_ REF(HXxSize) size);
STDMETHOD(DamageRect) (THIS_ HXxRect rect);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -