3gppttrenderer.h
来自「symbian 下的helix player源代码」· C头文件 代码 · 共 361 行 · 第 1/2 页
H
361 行
/* ***** BEGIN LICENSE BLOCK *****
* Version: RCSL 1.0/RPSL 1.0
*
* Portions Copyright (c) 1995-2003 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 _3GPPTTRENDERER_H_
#define _3GPPTTRENDERER_H_
/************************************************************************
*
* Defines:
*/
// /These are special-case font names that can be used in a FontTable entry:
#define FONT_FAMILY_SERIF_STR "Serif"
#define FONT_FAMILY_SANS_SERIF_STR "Sans-Serif"
#define FONT_FAMILY_MONOSPACE_STR "Monospace"
#define MAX_3GPPTT_URL_LEN (sizeof(UINT8))
// /These are for drawing; it's possible that we want to set (1,0) (i.e.,
// something other than (0,0) as the starting point for drawing text:
#define INITIAL_CURSOR_X 0
#define INITIAL_CURSOR_Y 0
#if defined(_WINDOWS) // / -----vvvvvvvvvvvvvvvvvvvvvvvvvv-----
#define USE_DIB_SECTION 1
#endif // /_WINDOWS _____^^^^^^^^^^^^^^^^^^^^^^^^^^_____
#if defined(_SYMBIAN) // / -----vvvvvvvvvvvvvvvvvvvvvvvvvv-----
#define HX_3GPPTT_DEFAULT_bits_PER_PIXEL 12 /* RGB444 native*/
#if defined(HELIX_3GPPTT_SUPPORTS_TRANSPARENCY) && (HX_3GPPTT_DEFAULT_bits_PER_PIXEL == 12)
#error this bit depth wont work with ARGB, dimwit
#endif // /HELIX_3GPPTT_SUPPORTS_TRANSPARENCY
#else // / not _SYMBIAN ------------------------------------
#define HX_3GPPTT_DEFAULT_bits_PER_PIXEL 32
#endif // /end else of if _SYMBIAN _____^^^^^^^^^^^^^^^^^^^^^^^^^^_____
#if defined(_WINDOWS) // / -----vvvvvvvvvvvvvvvvvvvvvvvvvv-----
#define HX_3GPPTT_FIXED_PITCH FIXED_PITCH
#define HX_3GPPTT_DEFAULT_PITCH DEFAULT_PITCH
#define HX_3GPPTT_FF_DONTCARE FF_DONTCARE
#define HX_3GPPTT_FF_SANSSERIF_PROPORTIONAL_PITCH FF_SWISS
#define HX_3GPPTT_FF_SERIF_PROPORTIONAL_PITCH FF_ROMAN
#define HX_3GPPTT_JUSTIFY_LEFT DT_LEFT
#define HX_3GPPTT_JUSTIFY_HCENTER DT_CENTER
#define HX_3GPPTT_JUSTIFY_RIGHT DT_RIGHT
#define HX_3GPPTT_JUSTIFY_TOP DT_TOP
#define HX_3GPPTT_JUSTIFY_VCENTER DT_VCENTER
#define HX_3GPPTT_JUSTIFY_BOTTOM DT_BOTTOM
#define HX_3GPPTT_INITIAL_TEXTFORMAT DT_NOCLIP
#else // / not _WINDOWS ------------------------------------
#define HX_3GPPTT_DEFAULT_PITCH 0x0
#define HX_3GPPTT_FF_DONTCARE 0x0
#define HX_3GPPTT_FIXED_PITCH 0x1
#define HX_3GPPTT_FF_SANSSERIF_PROPORTIONAL_PITCH 0x0
#define HX_3GPPTT_FF_SERIF_PROPORTIONAL_PITCH 0x2
#define HX_3GPPTT_JUSTIFY_LEFT 0x1
#define HX_3GPPTT_JUSTIFY_HCENTER 0x4
#define HX_3GPPTT_JUSTIFY_RIGHT 0x2
#define HX_3GPPTT_JUSTIFY_TOP 0x10
#define HX_3GPPTT_JUSTIFY_VCENTER 0x40
#define HX_3GPPTT_JUSTIFY_BOTTOM 0x20
#define HX_3GPPTT_INITIAL_TEXTFORMAT 0x0
#endif // /else of if _WINDOWS. _____^^^^^^^^^^^^^^^^^^^^^^^^^^_____
/****************************************************************************
*
* C3GPPTimedTextRenderer Class
*
* 3GPPTimedText implementation of a basic renderer.
*/
class C3GPPTimedTextRenderer : public IHXPlugin
, public IHXRenderer
, public IHXSiteUser
, public CHXBaseCountingObject
{
public:
/****** Public Class Methods ******************************************/
C3GPPTimedTextRenderer();
// /Clears out and deletes contents of m_pTextContainerList:
void ClearTextContainerLists(BOOL bDeleteListPtrWhenCleared);
BOOL OnMouseMove(INT16 fwKeys, INT16 xPos, INT16 yPos);
HX_RESULT HandleClick(INT16 fwKeys, INT16 xPos, INT16 yPos);
HX_RESULT UpdateDisplay(UINT32 ulTime);
HX_RESULT Draw(IHXVideoSurface *pVideoSurface);
HX_RESULT SetFont(const C3GPPTextSampleEntry* pCurTextSampleEntry,
UINT16 uiFontID_override,
const char* pCurFontFaceString,
BOOL bIsBolded,
BOOL bIsItalicized,
BOOL bIsUnderlined,
BOOL bIsStruckThrough,
UINT32 ulScaledHeight
#if defined(_WINDOWS) // / -----vvvvvvvvvvvvvvvvvvvvvvvvvv-----
, DWORD fdwCharSet
#endif // /_WINDOWS _____^^^^^^^^^^^^^^^^^^^^^^^^^^_____
);
UINT32 SetJustificationFlags(const C3GPPTextSampleEntry* pCurTextSampleEntry);
HX_RESULT FillRectangle(UINT32 ulRectColorARGB);
#if defined(_WINDOWS) // / -----vvvvvvvvvvvvvvvvvvvvvvvvvv-----
HX_RESULT ConvertToOSRenderableChars(const C3GPPTextContainer* pTextCont,
/*OUT*/ DWORD& fdwCharSet,
/*OUT*/ char*& pszNativeString,
/*OUT*/ INT32& lNativeStringLen);
HX_RESULT GetAppropriateCharset(wchar_t* pUTF16String,
INT32 lLenUTF16StrInWideChars,
/*OUT*/ DWORD& fdwCharSet, /*OUT*/UINT32& ulCodePage);
#endif // /_WINDOWS _____^^^^^^^^^^^^^^^^^^^^^^^^^^_____
C3GPPTextHyperTextBox* findActiveHyperlinkAtXY(
INT16 xPos, INT16 yPos);
UINT32 GetPacketContentTime(IHXPacket* pPacket);
HX_RESULT HandleNewText(IHXPacket* pNewPacket,
LISTPOSITION& plistPosOfFirstTxtCntnr);
// /(Only) call this when new packet arrives:
HX_RESULT SetPriorPacketTCsEndTimes();
HX_RESULT InsertInRedrawListInTemporalOrder(
const C3GPPTextContainer* pTextContainer);
HX_RESULT RemoveFromRedrawList(const C3GPPTextContainer* pTextContainer);
/************************************************************************
* IHXRenderer Interface Methods ref: hxrendr.h
*/
STDMETHOD(StartStream) (THIS_ IHXStream* pStream, IHXPlayer* pPlayer);
STDMETHOD(EndStream ) (THIS);
STDMETHOD(OnHeader ) (THIS_ IHXValues* pStreamHeaderObj);
STDMETHOD(OnPacket ) (THIS_ IHXPacket* pPacket, INT32 timeOffset);
STDMETHOD(OnTimeSync) (THIS_ UINT32 currentPlayBackTime);
STDMETHOD(OnPreSeek ) (THIS_ UINT32 timeBefore, UINT32 timeAfter);
STDMETHOD(OnPostSeek) (THIS_ UINT32 timeBefore, UINT32 timeAfter);
STDMETHOD(OnPause ) (THIS_ UINT32 timeBeforePause);
STDMETHOD(OnBegin ) (THIS_ UINT32 timeAfterBegin);
STDMETHOD(OnBuffering) (THIS_ UINT32 reason, UINT16 percentComplete);
STDMETHOD(GetRendererInfo)
(THIS_
REF(const char**) pStreamMimeTypes,
REF(UINT32) initialGranularity
);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?