00001 // $Id: swftext.h 1282 2006-06-09 09:46:49Z alex $ 00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE 00003 ================================XARAHEADERSTART=========================== 00004 00005 Xara LX, a vector drawing and manipulation program. 00006 Copyright (C) 1993-2006 Xara Group Ltd. 00007 Copyright on certain contributions may be held in joint with their 00008 respective authors. See AUTHORS file for details. 00009 00010 LICENSE TO USE AND MODIFY SOFTWARE 00011 ---------------------------------- 00012 00013 This file is part of Xara LX. 00014 00015 Xara LX is free software; you can redistribute it and/or modify it 00016 under the terms of the GNU General Public License version 2 as published 00017 by the Free Software Foundation. 00018 00019 Xara LX and its component source files are distributed in the hope 00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the 00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00022 See the GNU General Public License for more details. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with Xara LX (see the file GPL in the root directory of the 00026 distribution); if not, write to the Free Software Foundation, Inc., 51 00027 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00028 00029 00030 ADDITIONAL RIGHTS 00031 ----------------- 00032 00033 Conditional upon your continuing compliance with the GNU General Public 00034 License described above, Xara Group Ltd grants to you certain additional 00035 rights. 00036 00037 The additional rights are to use, modify, and distribute the software 00038 together with the wxWidgets library, the wxXtra library, and the "CDraw" 00039 library and any other such library that any version of Xara LX relased 00040 by Xara Group Ltd requires in order to compile and execute, including 00041 the static linking of that library to XaraLX. In the case of the 00042 "CDraw" library, you may satisfy obligation under the GNU General Public 00043 License to provide source code by providing a binary copy of the library 00044 concerned and a copy of the license accompanying it. 00045 00046 Nothing in this section restricts any of the rights you have under 00047 the GNU General Public License. 00048 00049 00050 SCOPE OF LICENSE 00051 ---------------- 00052 00053 This license applies to this program (XaraLX) and its constituent source 00054 files only, and does not necessarily apply to other Xara products which may 00055 in part share the same code base, and are subject to their own licensing 00056 terms. 00057 00058 This license does not apply to files in the wxXtra directory, which 00059 are built into a separate library, and are subject to the wxWindows 00060 license contained within that directory in the file "WXXTRA-LICENSE". 00061 00062 This license does not apply to the binary libraries (if any) within 00063 the "libs" directory, which are subject to a separate license contained 00064 within that directory in the file "LIBS-LICENSE". 00065 00066 00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS 00068 ---------------------------------------------- 00069 00070 Subject to the terms of the GNU Public License (see above), you are 00071 free to do whatever you like with your modifications. However, you may 00072 (at your option) wish contribute them to Xara's source tree. You can 00073 find details of how to do this at: 00074 http://www.xaraxtreme.org/developers/ 00075 00076 Prior to contributing your modifications, you will need to complete our 00077 contributor agreement. This can be found at: 00078 http://www.xaraxtreme.org/developers/contribute/ 00079 00080 Please note that Xara will not accept modifications which modify any of 00081 the text between the start and end of this header (marked 00082 XARAHEADERSTART and XARAHEADEREND). 00083 00084 00085 MARKS 00086 ----- 00087 00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara 00089 designs are registered or unregistered trademarks, design-marks, and/or 00090 service marks of Xara Group Ltd. All rights in these marks are reserved. 00091 00092 00093 Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK. 00094 http://www.xara.com/ 00095 00096 =================================XARAHEADEREND============================ 00097 */ 00098 //#include "ccobject.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00099 #include "nodetext.h" 00100 #include "swfshape.h" // For FlashColour. 00101 //#include "fixst256.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00102 00103 #ifndef INC_FLASH_TEXT_RECORD 00104 #define INC_FLASH_TEXT_RECORD 00105 00106 #define FTR_STRING_SIZE 256 00107 00108 /******************************************************************************************** 00109 00110 > class FlashTextRecord : public CObject 00111 00112 Author: Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com> 00113 Created: 14/10/99 00114 Purpose: Maintains a record of the string being used. 00115 00116 ********************************************************************************************/ 00117 00118 class FlashTextRecord : public CCObject 00119 { 00120 public: 00121 // Constructor and destructor. 00122 FlashTextRecord ( void ); // Constructor. 00123 ~FlashTextRecord ( void ); // Destructor. 00124 00125 // Add and remove elements to a linked list. 00126 FlashTextRecord* AddElement ( void ); // Adds an element to the list. 00127 void DeleteLastElement ( void ); // Deletes the element mpLast. 00128 void DeleteNextElement ( void ); // Deletes the element mpNext. 00129 00130 // Data access functions. 00131 INT32* GetString ( void ); // Gets a pointer to mText. 00132 BOOL IsFull ( void ); // Is the string full? 00133 DocCoord GetPosition ( void ); // Gets the value of mPosition. 00134 DocRect GetBounds ( void ); // Gets the value of mBounds. 00135 INT32* GetAdvances ( void ); // Gets a pointer to mAdvances. 00136 WORD* GetSizes ( void ); // Gets mCharacterSize []. 00137 FlashColour* GetColours ( void ); // Gets mCharacterColour []. 00138 WORD* GetFontStyles ( void ); // Gets mCharacterStyle []. 00139 INT8* GetOffsets ( void ); // Gets mOffsets []. 00140 FIXED16 GetAspect ( void ); // Gets mAspectRatio. 00141 INT32 GetAscent ( void ); // Gets mAscent. 00142 INT32 GetCount ( void ); // Gets the number of characters. 00143 WORD GetTextID ( void ); // Gets the ID value for the text. 00144 FlashTextRecord* GetLast ( void ); // Gets mpLast. 00145 FlashTextRecord* GetNext ( void ); // Gets mpNext. 00146 00147 // Set value functions. 00148 INT32 AddChar ( TextChar *pTheLetter, // Appends TheLetter to mText. 00149 INT32 FlashCode ); 00150 void SetPosition ( DocCoord Point ); // Sets the value of mPosition. 00151 void SetBounds ( DocRect Bounds ); // Sets the value of mTextBounds. 00152 void SetAdvance ( INT32 Advance, // Sets the value of mAdvances at 00153 INT32 i ); // position i. ( mAdvances [i] ). 00154 void SetSize ( MILLIPOINT Size, // Sets mCharacterSize [i]. 00155 INT32 i ); 00156 void SetColour ( DocColour *Colour, // Sets mCharacterColour [i]. 00157 UINT32 *Alpha, 00158 INT32 i ); 00159 void SetStyle ( WORD Style, // Sets mCharacterStyle [i]. 00160 INT32 i ); 00161 void SetOffset ( INT32 Offset, // Sets mOffsets [i]. 00162 INT32 i ); 00163 void SetAspect ( FIXED16 AspectRatio ); // Sets mAspectRatio. 00164 void SetTextID ( WORD ID ); // Sets mTextID. 00165 void SetAscent ( INT32 Ascent ); // Sets mAscent. 00166 void SetLast ( FlashTextRecord *pLast ); // Sets the value of mpLast. 00167 void SetNext ( FlashTextRecord *pNext ); // Sets the value of mpNext. 00168 00169 // Matrix storage functions. 00170 INT32 GetSkewX ( void ); // Get mSkewX. 00171 INT32 GetSkewY ( void ); // Get mSkewY. 00172 INT32 GetScaleX ( void ); // Get mScaleX. 00173 INT32 GetScaleY ( void ); // Get mScaleY. 00174 00175 void SetSkewX ( INT32 Skew ); // Set mSkewX. 00176 void SetSkewY ( INT32 Skew ); // Set mSkewY. 00177 void SetScaleX ( INT32 Scale ); // Set mScaleX. 00178 void SetScaleY ( INT32 Scale ); // Set mScaleY. 00179 00180 private: 00181 // Member variables. 00182 DocCoord mPosition; // The position of the text. 00183 DocRect mTextBounds; // The text's bounding box. 00184 INT32 mText [FTR_STRING_SIZE]; // A string containing the text. 00185 INT32 mAdvances [FTR_STRING_SIZE]; // The advances for the text. 00186 WORD mCharacterSize [FTR_STRING_SIZE]; // The sizes of the characters. 00187 FlashColour mCharacterColour [FTR_STRING_SIZE]; // The colours of the characters. 00188 WORD mCharacterStyle [FTR_STRING_SIZE]; // The letter's font handles. 00189 INT8 mOffsets [FTR_STRING_SIZE]; // A record of the Y offsets. 00190 INT32 mCurrent; // The current element being used. 00191 FIXED16 mAspectRatio; // The aspect ratio of the font. 00192 INT32 mAscent; // The ascent value for the font. 00193 WORD mTextID; // The ID for PlaceObject. 00194 FlashTextRecord *mpLast; // Pointer to the previous node. 00195 FlashTextRecord *mpNext; // Pointer to the next node. 00196 INT32 mScaleX; // The sine of the rotation. 00197 INT32 mScaleY; // The cosine of the rotation. 00198 INT32 mSkewX; // First skew value. 00199 INT32 mSkewY; // Second skew value. 00200 }; 00201 00202 #endif