📄 txtwindw.h
字号:
/* ***** BEGIN LICENSE BLOCK ***** * Source last modified: $Id: txtwindw.h,v 1.1.2.2 2004/07/09 01:50:15 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 ***** *////////////////////////////////////////////////////////////////////////////////// TXTWINDW.H//// TextWindow class declaration.//// A class TextWindow object holds the location, size, background color,// ...etc for the space on the screen where the text is to be rendered.//////#if !defined(_TXTWINDW_HPP_)#define _TXTWINDW_HPP_class Dict;#include "hxwintyp.h" //for struct HXxWindow.#if defined(_WINDOWS)#include <windows.h>#elif defined(_MACINTOSH)#ifndef _MAC_MACHO#include <qdoffscreen.h>#endif#endif#if defined(_UNIX) && !defined(_MAC_UNIX)#include "hxmap.h"#endif#if defined(_WINDOWS)#if !defined(_WIN16) //XXXXXEH- OK in WIN16, too? MS doc says no...#define USE_DIB_SECTION#endif#endif#define MIN_SCROLLRATE (-8192L)#define MAX_SCROLLRATE (8192L)#define MIN_CRAWLRATE (-8192L)#define MAX_CRAWLRATE (8192L)#define MIN_WINDOWWIDTH 4#define MIN_WINDOWHEIGHT 4/* TextWindow::type possible values: */#define TYPE_UNSPECIFIED 0x00000000 /*invalid type.*/#define TYPE_GENERIC 0x00000001 /*has no scroll/crawl.*/#define TYPE_TICKERTAPE 0x00000002 /*has a set crawlrate.*/#define TYPE_SCROLLINGNEWS 0x00000003 /*vertical scrollbar.*/#define TYPE_TELEPROMPTER 0x00000004 /*variable scrollrate.*/#define TYPE_MARQUEE 0x00000005 /*has a set crawlrate.*//* Miscl invalid vals that signal that default must be dynamically chosen; * e.g., one type RealText window may default to black background while * another may default to white, so in creating a TextWindow object, invalid * vals must be used so that, when a RealText window type is specified, the * other textWindow values not specified can be defaulted appropriately: */#define WINDOW_DIMENSION_UNSPECIFIED (-1L)#define BGCOLOR_NAME_UNSPECIFIED ""#define BGCOLOR_NAME_LEN_UNSPECIFIED 0L#define BGCOLOR_RGB_UNSPECIFIED BAD_RGB_COLOR #define SCROLLRATE_UNSPECIFIED (MAX_SCROLLRATE+1) #define CRAWLRATE_UNSPECIFIED (MAX_CRAWLRATE+1) #define DOLOOP_UNSPECIFIED (-1L)#define SCROLLTYPE_UNSPECIFIED 0xFFFFFFFF/* TextWindow::scrollType possible values. Note that they can be combined * with each other for hybrid types: */#define SCROLLTYPE_NOSCROLL 0x00000000#define SCROLLTYPE_VSCROLLBAR 0x00000001#define SCROLLTYPE_HSCROLLBAR 0x00000002#define SCROLLTYPE_TELEPROMPTER 0x00000004#define SCROLLTYPE_SETRATE 0x00000008/* Other TextWindow defualts: */#define DEFAULT_BORDERSIZE 1L/* Defaults to aspect ratio of movies, i.e., 16:9 ratio: */#define DEFAULT_WINDOWWIDTH 320L#define DEFAULT_WINDOWHEIGHT 180L#define DEFAULT_WINDOWWIDTH_GENERIC DEFAULT_WINDOWWIDTH#define DEFAULT_WINDOWHEIGHT_GENERIC DEFAULT_WINDOWHEIGHT#define DEFAULT_WINDOWWIDTH_SCROLLINGNEWS DEFAULT_WINDOWWIDTH#define DEFAULT_WINDOWHEIGHT_SCROLLINGNEWS DEFAULT_WINDOWHEIGHT#define DEFAULT_WINDOWWIDTH_TICKERTAPE 500L#define DEFAULT_WINDOWHEIGHT_TICKERTAPE 30L#define DEFAULT_WINDOWWIDTH_TELEPROMPTER DEFAULT_WINDOWWIDTH#define DEFAULT_WINDOWHEIGHT_TELEPROMPTER DEFAULT_WINDOWHEIGHT#define DEFAULT_WINDOWWIDTH_MARQUEE DEFAULT_WINDOWWIDTH_TICKERTAPE#define DEFAULT_WINDOWHEIGHT_MARQUEE DEFAULT_WINDOWHEIGHT_TICKERTAPE#define DEFAULT_IS_LIVE_SOURCE FALSE#define DEFAULT_WINDOWUPPERLEFTX 0L#define DEFAULT_WINDOWUPPERLEFTY 0L#define DEFAULT_BGCOLOR_RGB 0x00FFFFFF /*white*/#define DEFAULT_BGCOLOR_RGB_GENERIC DEFAULT_BGCOLOR_RGB#define DEFAULT_BGCOLOR_RGB_SCROLLINGNEWS DEFAULT_BGCOLOR_RGB#define DEFAULT_BGCOLOR_RGB_TICKERTAPE 0x00000000 /*black*/#define DEFAULT_BGCOLOR_RGB_TELEPROMPTER DEFAULT_BGCOLOR_RGB#define DEFAULT_BGCOLOR_RGB_MARQUEE DEFAULT_BGCOLOR_RGB#define DEFAULT_SCROLLRATE 0L /*pixels per second*/#define DEFAULT_CRAWLRATE 0L /*pixels per second*/#define DEFAULT_SCROLLRATE_GENERIC DEFAULT_SCROLLRATE#define DEFAULT_CRAWLRATE_GENERIC DEFAULT_CRAWLRATE#define DEFAULT_SCROLLRATE_SCROLLINGNEWS 10L /*pixels per second*/#define DEFAULT_CRAWLRATE_SCROLLINGNEWS 0L /*pixels per second*/#define DEFAULT_SCROLLRATE_TICKERTAPE 0L /*pixels per second*/#define DEFAULT_CRAWLRATE_TICKERTAPE 20L /*pixels per second*/#define DEFAULT_SCROLLRATE_TELEPROMPTER 0L#define DEFAULT_CRAWLRATE_TELEPROMPTER 0L#define DEFAULT_SCROLLRATE_MARQUEE DEFAULT_SCROLLRATE_TICKERTAPE#define DEFAULT_CRAWLRATE_MARQUEE DEFAULT_CRAWLRATE_TICKERTAPE#define DEFAULT_TYPE TYPE_GENERIC#define DEFAULT_SCROLLTYPE SCROLLTYPE_NOSCROLL#define DEFAULT_SCROLLTYPE_GENERIC DEFAULT_SCROLLTYPE#define DEFAULT_SCROLLTYPE_SCROLLINGNEWS SCROLLTYPE_VSCROLLBAR#define DEFAULT_SCROLLTYPE_TICKERTAPE SCROLLTYPE_SETRATE#define DEFAULT_SCROLLTYPE_TELEPROMPTER SCROLLTYPE_NOSCROLL#define DEFAULT_SCROLLTYPE_MARQUEE DEFAULT_SCROLLTYPE_TICKERTAPE#define DEFAULT_DOLOOP FALSE#define DEFAULT_DOLOOP_GENERIC DEFAULT_DOLOOP#define DEFAULT_DOLOOP_SCROLLINGNEWS FALSE#define DEFAULT_DOLOOP_TICKERTAPE TRUE#define DEFAULT_DOLOOP_TELEPROMPTER FALSE#define DEFAULT_DOLOOP_MARQUEE TRUE#define DEFAULT_DONT_IGNORE_EXTRA_SPACES TRUE#define DEFAULT_DO_UNDERLINE_HYPERLINKS TRUE#define DEFAULT_USE_WORDWRAP TRUE#define DEFAULT_EXPAND_TABS TRUE /* for plain text only*/#define DEFAULT_LINKCOLOR 0x000000FF /* blue */#define DEFAULT_FONT_WEIGHT 400 /* The following is the amount of blank pixels to add in x if a <BR> is * seen in a crawl-only (i.e., scrollRate==0 and crawlRate!=0) window: */#define BREAK_WIDTH_IN_PIXELS 10L#define MIN_LINE_BREAK_SIZE 5L#define DEFAULT_LINE_BREAK_SIZE 16L/* This is the X-offset that each Lower-text-Tickertape item is from the * preceding upper-text item: */#define TICKER_GOINGLOWERITEM_SPACING 10L/* This is the X-offset that each Upper-text-Tickertape item is from the * preceding lower-text item: */#define TICKER_GOINGUPPERITEM_SPACING 20L/* This is the Y-offset that Tickertape LowerText is from Tickertape * UpperText: */#define TICKERLOWERTEXT_YOFFSET 10L /*in pixels.*/#define INVALID_LONG32 0x80000001 /* ==-2147483647 */typedef enum{ kHAlignLeft, kHAlignCenter, kHAlignRight, kHAlignInvalid} textHorizAlign;typedef enum{ kVAlignTop, kVAlignCenter, kVAlignBottom, kVAlignInvalid} textVertAlign;////////////////////////////////////////////////////////////////////////////////// TextWindowBase class. This class contains all the junk needed by// both the text renderer and the text file format plugins;// class TextWindow, below, is what the renderer uses and TextWindowFF,// further below, is what the file format uses. Each of these inherits// class TextWindowBase://class TextWindowBase : public TextAttributeStacks, public TextContainerList{ public: TextWindowBase(); ~TextWindowBase(); TextLineList* m_pTLList; //This exists to keep track of where in the rtx file the </FONT> tags // are and what they "pop" to (i.e., what font attributes the text that // follows the </FONT> tag has). TextLineList* m_pFontUndoTagList; void reset(); LONG32 getScrollRate() { return m_scrollRate; } LONG32 getCrawlRate() { return m_crawlRate; } BOOL setScrollRate(LONG32 sr); BOOL setScrollRate(_CHAR* pBuf, ULONG32 bufLen); BOOL setCrawlRate(LONG32 cr); BOOL setCrawlRate(_CHAR* pBuf, ULONG32 bufLen); BOOL isLooping() { return m_loop; } void loop(BOOL doLoop) { m_loop = doLoop; } BOOL setLoop(_CHAR* pBuf, ULONG32 bufLen); BOOL DontIgnoreExtraSpaces() { return m_bDontIgnoreExtraSpaces; } BOOL IgnoreExtraSpaces() { return !m_bDontIgnoreExtraSpaces; } BOOL SetExtraSpacesHandling(_CHAR* pBuf, ULONG32 bufLen); ULONG32 getNumBreakTagsEncountered() { return m_numBreakTagsEncountered;} void incrementNumBreakTagsEncountered() { m_numBreakTagsEncountered++; } void clearNumBreakTagsEncountered() { m_numBreakTagsEncountered = 0L; } //Takes "WINDOW [someString]" in headerTagBuf and parses the // <WINDOW ..> tag values out of "[someString]" and places those // values in the TextWindow. Is in file "TW_Parse.cpp": BOOL parseHeaderTag(_CHAR* pHeaderTagBuf, ULONG32 headerTagBufLen, ULONG32 ulRTFileFormatMarkupParsingMajorVersion, ULONG32 ulRTFileFormatMarkupParsingMinorVersion);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -