00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #ifndef INC_CXFREC
00101 #define INC_CXFREC
00102
00103 #include "doccoord.h"
00104 #include "cxfdefs.h"
00105
00106 class DocCoord;
00107 class Matrix;
00108 class Path;
00109 class BaseCamelotFilter;
00110 class CCPanose;
00111 class CCLexFile;
00112
00113 class FTTypeList;
00114
00115
00116
00117 #define CXF_RECORD_CHUNK 256
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 class CXaraFileRecord : public CCObject
00130 {
00131
00132 CC_DECLARE_DYNAMIC(CXaraFileRecord);
00133
00134 public:
00135 CXaraFileRecord(UINT32 Tag,INT32 Size = -1);
00136 virtual ~CXaraFileRecord();
00137
00138 void DumpTypes(void);
00139 void WriteAsText(CCLexFile* pFile);
00140
00141 virtual CXaraFileRecord* GetCopy();
00142
00143 virtual BOOL Init(BOOL ZeroMemBlock = FALSE);
00144 virtual BOOL Reinit(UINT32 ThisTag,INT32 Size);
00145
00146 virtual BOOL WriteBYTE(BYTE b);
00147 virtual BOOL WriteUINT32(UINT32 n);
00148 virtual BOOL WriteINT32(INT32 n);
00149 virtual BOOL WriteReference(INT32 n);
00150 virtual BOOL WriteUINT16(UINT16 n);
00151 virtual BOOL WriteINT16(INT16 n);
00152 virtual BOOL WriteBuffer(BYTE* pBuf,size_t BufSize);
00153 virtual BOOL WriteFLOAT(FLOAT f);
00154 virtual BOOL WriteDOUBLE(double d);
00155 virtual BOOL WriteFIXED16(FIXED16 n);
00156 virtual BOOL WriteANGLE(ANGLE a);
00157 virtual BOOL WriteWCHAR(WCHAR w);
00158 virtual BOOL WriteWCHARs(const WCHAR* pw, UINT32 Count);
00159
00160 virtual BOOL WriteCoord(const DocCoord& Coord);
00161 virtual BOOL WriteCoordTrans(const DocCoord& Coord,INT32 dx,INT32 dy);
00162 virtual BOOL WriteCoordInterleaved(const DocCoord& Coord);
00163 virtual BOOL WriteCoordTransInterleaved(const DocCoord& Coord,INT32 dx,INT32 dy);
00164 virtual BOOL WritePath(Path* pPath);
00165 virtual BOOL WritePathRelative(Path* pPath);
00166 virtual BOOL WritePathTrans(Path* pPath,INT32 dx,INT32 dy);
00167 virtual BOOL WritePathRelativeTrans(Path* pPath,INT32 dx,INT32 dy);
00168 virtual BOOL WriteXOrd(INT32 XOrdinate);
00169 virtual BOOL WriteYOrd(INT32 YOrdinate);
00170 virtual BOOL WriteCCPanose(const CCPanose &MyCCPanose);
00171
00172 virtual BOOL WriteASCII(const TCHAR* pStr);
00173 virtual BOOL WriteUnicode(const TCHAR* pStr);
00174 PORTNOTE("other","WriteBSTR removed - Windows concept")
00175 #ifndef EXCLUDE_FROM_XARALX
00176 virtual BOOL WriteBSTR(_bstr_t bstr);
00177 #endif
00178 virtual BOOL WriteUTF16STR(const StringVar& pvstr);
00179
00180 virtual BOOL WriteMatrix(const Matrix & m);
00181 virtual BOOL WriteMatrixTrans(const Matrix & m,INT32 dx,INT32 dy);
00182
00183 virtual UINT32 GetTag() { return Tag; }
00184 virtual UINT32 GetSize();
00185 virtual BYTE* GetBuffer() { return (BYTE*)pBuffer; }
00186
00187 virtual FTTypeList* GetTypeList(void) { return(m_pTypeList); };
00188
00189 virtual INT32 GetRecordNumber();
00190 virtual void SetRecordNumber(UINT32 n);
00191
00192 virtual BOOL IsDataSectionFull() { return (!(SizeIsKnown && CurrentPos < KnownSize)); }
00193
00194 virtual void ResetReadPos();
00195
00196 virtual BOOL ReadBYTE(BYTE* pb);
00197 virtual BOOL ReadBYTEtoBOOL(BOOL* pb);
00198 virtual BOOL ReadBYTEnoError(BYTE* pb);
00199 virtual BOOL ReadUINT32(UINT32* pn);
00200 virtual BOOL ReadINT32(INT32* pn);
00201 virtual BOOL ReadINT32noError(INT32* pn);
00202 virtual BOOL ReadUINT16(UINT16* pn);
00203 virtual BOOL ReadINT16(INT16* pn);
00204 virtual BOOL ReadBuffer(BYTE* pBuf,UINT32 BufSize);
00205 virtual BOOL ReadBuffernoError(BYTE* pBuf,UINT32 BufSize);
00206 virtual BOOL ReadFLOAT(FLOAT* pf);
00207 virtual BOOL ReadDOUBLE(double* pd);
00208 virtual BOOL ReadDOUBLEnoError(double* pd);
00209 virtual BOOL ReadFIXED16(FIXED16 *pn);
00210 virtual BOOL ReadANGLE(ANGLE *pa);
00211 virtual BOOL ReadWCHAR(WCHAR *pw);
00212
00213 virtual BOOL ReadCoord(DocCoord* pCoord);
00214 virtual BOOL ReadCoordTrans(DocCoord* pCoord,INT32 dx,INT32 dy);
00215 virtual BOOL ReadCoordInterleaved(DocCoord* pCoord);
00216 virtual BOOL ReadCoordTransInterleaved(DocCoord* pCoord,INT32 dx,INT32 dy);
00217 virtual BOOL ReadPath(Path* pPath);
00218 virtual BOOL ReadPathRelative(Path* pPath);
00219 virtual BOOL ReadPathTrans(Path* pPath,INT32 dx,INT32 dy);
00220 virtual BOOL ReadPathRelativeTrans(Path* pPath,INT32 dx,INT32 dy);
00221 virtual BOOL ReadXOrd(INT32* pXOrdinate);
00222 virtual BOOL ReadYOrd(INT32* pYOrdinate);
00223 virtual BOOL ReadCCPanose(CCPanose *pPanose);
00224
00225 virtual BOOL ReadUnicode(StringBase* pStr);
00226 virtual BOOL ReadUnicode(TCHAR* pStr,UINT32 MaxChars);
00227 virtual BOOL ReadASCII(TCHAR* pStr,UINT32 MaxChars);
00228 #if defined(_UNICODE)
00229 virtual BOOL ReadASCII( char *pStr, UINT32 MaxChars );
00230 #endif
00231 PORTNOTE("other","WriteBSTR removed - Windows concept")
00232 #ifndef EXCLUDE_FROM_XARALX
00233 virtual BOOL ReadBSTR(_bstr_t* bstr, UINT32 MaxChars);
00234 #endif
00235 virtual BOOL ReadUTF16STR(StringVar* pvstr, UINT32 MaxChars);
00236
00237 virtual BOOL ReadMatrix(Matrix *pMatrix);
00238 virtual BOOL ReadMatrixTrans(Matrix *pMatrix,INT32 dx,INT32 dy);
00239
00240 private:
00241 void SetUpVars(UINT32 ThisTag,INT32 Size);
00242
00243 void FreeBuffer();
00244 BOOL AllocBuffer(INT32 Size);
00245 BOOL ExtendBuffer(INT32 Size);
00246
00247 BOOL Initialised;
00248
00249 UINT32 Tag;
00250 UINT32 BufferSize;
00251 UINT32 KnownSize;
00252 BOOL SizeIsKnown;
00253 INT32 RecordNumber;
00254
00255 void* pBuffer;
00256 UINT32 CurrentPos;
00257 BOOL Overflow;
00258
00259 FTTypeList* m_pTypeList;
00260 };
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273 class CamelotFileRecord : public CXaraFileRecord
00274 {
00275
00276 CC_DECLARE_DYNAMIC(CamelotFileRecord);
00277
00278 public:
00279 CamelotFileRecord(BaseCamelotFilter* pFilter,UINT32 Tag,INT32 Size = -1);
00280 ~CamelotFileRecord();
00281
00282 #if !defined(EXCLUDE_FROM_XARLIB)
00283
00284 virtual BOOL WriteCoord(const DocCoord& Coord);
00285 virtual BOOL WriteCoordInterleaved(const DocCoord& Coord);
00286 virtual BOOL WritePath(Path* pPath);
00287 virtual BOOL WritePathRelative(Path* pPath);
00288 virtual BOOL WriteMatrix(const Matrix & m);
00289 virtual BOOL WriteXOrd(INT32 XOrdinate);
00290 virtual BOOL WriteYOrd(INT32 YOrdinate);
00291
00292
00293 virtual BOOL ReadCoord(DocCoord* pCoord);
00294 virtual BOOL ReadCoordInterleaved(DocCoord* pCoord);
00295 virtual BOOL ReadPath(Path* pPath);
00296 virtual BOOL ReadPathRelative(Path* pPath);
00297 virtual BOOL ReadMatrix(Matrix *pMatrix);
00298 virtual BOOL ReadXOrd(INT32* pXOrdinate);
00299 virtual BOOL ReadYOrd(INT32* pYOrdinate);
00300
00301 private:
00302 DocCoord CoordOrigin;
00303 #endif // EXCLUDE_FROM_XARLIB
00304 };
00305
00306 #endif // INC_CXFREC