|
Public Member Functions |
| CMXImportFilter () |
BOOL | Init () |
| Declares a preference that allows you to clear memory in delete().
|
INT32 | HowCompatible (PathName &Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize) |
BOOL | DoImport (SelOperation *, CCLexFile *, Document *, BOOL AutoChosen=FALSE, ImportPosition *Pos=NULL, KernelBitmap **ppImportedBitmap=NULL, DocCoord *pPosTranslate=NULL, String_256 *=NULL) |
BOOL | DoExport (Operation *, CCLexFile *, PathName *, Document *, BOOL) |
virtual BOOL | IsDefaultDocRequired (const TCHAR *pcszPathName) |
| Works out if opening a file of this type requires a default document to be loaded. If the file format supplies the document then return FALSE otherwise return TRUE. An example would be opening a bitmap file. This has no document defined in the file format and so we need to laod the default document before importing the bitmap into this file. In this baseclass version return FALSE and hence assume that the filters that need to will override this function to return TRUE.
|
Matrix * | GetBaseMatrix (void) |
Matrix * | GetCurrentMatrix (void) |
void | SetMatrix (Matrix *pNewMatrix) |
void | SetClippingPath (Path *pClipper=NULL) |
Static Public Member Functions |
static BOOL | SkipToPreviewBitmap (CCLexFile *pFile) |
Protected Member Functions |
BOOL | ReadData (void *Out, char *Instructions) |
BOOL | ReadPointList (Path **ppPath) |
| converts a point list from the file into one of our paths it isn't transformed or anything
|
CMXImportColourList * | ReadColourList (void) |
| reads a nice colour list thing from the CMX file
|
BOOL | LocateRootLevelRIFFSection (DWORD Section) |
void | Seek (INT32 to) |
INT32 | Tell (void) |
BOOL | GotoSectionFromIndex (INT32 MasterIndexEntry, DWORD PredictedRIFFType, BOOL NonExistanceIsFormatError, BOOL *Found=NULL, INT32 *Size=NULL) |
BOOL | Stage1_ReadHeader (Spread *pSpread) |
BOOL | Stage2_ReadMasterIndex (void) |
BOOL | Stage3_ConvertDescriptionSections (void) |
BOOL | Stage4_ConvertPage (void) |
BOOL | Stage5_PlaceObjectsInTree (Spread *pSpread, SelOperation *pOp, ImportPosition *pPos) |
BOOL | ProcessCommand (INT32 *ProgressThingy=NULL) |
BOOL | Process_BeginPage (void) |
BOOL | Process_EndPage (void) |
BOOL | Process_BeginLayer (void) |
BOOL | Process_EndLayer (void) |
BOOL | Process_BeginGroup (void) |
BOOL | Process_EndGroup (void) |
BOOL | Process_EndSection (void) |
BOOL | Process_PolyCurve (void) |
BOOL | Process_PolyCurveContainer (cmxiPolyCurve &pc) |
BOOL | Process_Rectangle (void) |
BOOL | Process_AddGlobalTransform (void) |
BOOL | Process_SetGlobalTransform (void) |
BOOL | Process_RestoreLastGlobalTransform (void) |
BOOL | Process_DrawImage (void) |
BOOL | Process_DrawImage_Cropped (cmxiDrawImage &db) |
BOOL | Process_AddClippingRegion (void) |
BOOL | Process_RemoveLastClippingRegion (void) |
BOOL | Process_ClearClipping (void) |
BOOL | Process_BeginTextStream (void) |
BOOL | Process_TextFrame (void) |
BOOL | Process_Characters (void) |
BOOL | Process_CharInfo (void) |
BOOL | Process_BeginParagraph (void) |
BOOL | Process_EndParagraph (void) |
BOOL | Process_EndTextStream (void) |
BOOL | TransformNode (Node *pNode) |
BOOL | SetAttributesForNode (Node *pNode, void *pAttr, BOOL DeleteStuff=TRUE) |
BOOL | ClipNode (Node **pNode) |
BOOL | ApplyAttributesToNode (Node *pNode) |
BOOL | SetNoFill (Node *pNode) |
BOOL | SetNoStroke (Node *pNode) |
BOOL | SetAttributesFountain (Node *pNode, cmxiFillSpec *Fill) |
BOOL | SetAttributesLinearGrad (Node *pNode, cmxiFillSpec *GFill, DocRect &BBox, DocColour *StartColour, DocColour *EndColour) |
BOOL | SetAttributesConicalGrad (Node *pNode, cmxiFillSpec *GFill, DocRect &BBox, DocColour *StartColour, DocColour *EndColour) |
BOOL | SetAttributesRadialGrad (Node *pNode, cmxiFillSpec *GFill, DocRect &BBox, DocColour *StartColour, DocColour *EndColour, BOOL IsSquare=FALSE) |
BOOL | SetAttributesBitmapFill (Node *pNode, INT32 VectorReference, cmxiTiling *Tile) |
BOOL | SetAttributesTwoColourBitmapFill (Node *pNode, cmxiFillSpec *Fill) |
BOOL | GetCorelBBox (NodeRenderableBounded *pNode, DocRect *BBox) |
BOOL | GetTilingPoints (DocRect *BBox, cmxiTiling *Tile, DocCoord *StartPoint, DocCoord *EndPoint, DocCoord *EndPoint2) |
void | SetNonTextAttributeIgnore () |
void | SetNonTextAttributeNotIgnore () |
void | SetTextAttributeIgnore () |
void | SetTextAttributeNotIgnore () |
void | CleanUpAfterImport (void) |
void | AttributeApproximated (void) |
void | ClippingApproximated (void) |
void | ObjectApproximated (void) |
BOOL | ConvertColours (void) |
DocColour * | GetColourFromReference (INT32 Ref) |
BOOL | AddColoursToDocument (void) |
BOOL | ConvertPens (void) |
BOOL | ConvertOutlines (void) |
BOOL | ConvertLineStyles (void) |
BOOL | ConvertDotDashes (void) |
BOOL | ConvertArrowShapes (void) |
BOOL | ConvertArrowheads (void) |
BOOL | ReadEmbeddedFileIndex (void) |
BOOL | ReadProcedureIndex (void) |
BOOL | ReadBitmapIndex (void) |
BOOL | ConvertFonts (void) |
BOOL | ReadFontIndex (void) |
Private Member Functions |
| CC_DECLARE_DYNAMIC (CMXImportFilter) |
Private Attributes |
CCLexFile * | pFile |
BOOL | Is32Bit |
BOOL | CorelDraw7 |
INT32 | StartPosition |
CMXImportFilterDataSet * | Data |
Friends |
class | CMXImportRImage |
class | CMXImportBitmap |
|
Definition at line 417 of file cmxistut.cpp. 01007 : Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
01008 Created: 06/08/96
01009 Inputs: pointer to the structure to fill, instructions on what to fill it with
01010 Returns: success
01011 Purpose: fills the structure pointed to by Out according to the instructions
01012
01013 ********************************************************************************************/
01014
01015
01016 #define RDIN(type, name) type name; pFile->read(&name, sizeof(name));
01017 #define RDOUT(type, name) {*((type *)pOut) = name; pOut += sizeof(type);}
01018 #define RDSTORE(name) if(StoreNext) {StoreStack[StackLevel] = (INT32)name; \
01019 \
01020 StoreNext = FALSE;}
01021 #define SIMPLEREAD(instr, intype, outtype) case instr: \
01022 {RDIN(intype, data) RDOUT(outtype, data) \
01023 \
01024 RDSTORE(data) } break;
01025 #define READLENGTH(name) INT32 name; if(Is32Bit) {RDIN(SDWORD, data) name = data;} \
01026 else {RDIN(SWORD, data) name = data;}
01027 #define MAXSTACKLEVEL 16
01028 #define MAXTAGLEVEL 16
01029 #define STACKLEVELUP {ERROR2IF((StackLevel + 1) >= MAXSTACKLEVEL, FALSE, "stack level exceeded in CMXImportFilter::ReadData"); \
01030 StackLevel++; StoreStack[StackLevel] = StoreStack[StackLevel - 1]; \
01031 OutputMarkerStack[StackLevel] = OutputMarkerStack[StackLevel - 1]; \
01032 IfExecStack[StackLevel] = IfExecStack[StackLevel - 1]; \
01033 InputMarkerStack[StackLevel] = InputMarkerStack[StackLevel - 1];}
01034 #define STACKLEVELDOWN {ERROR2IF(StackLevel < 1, FALSE, "unmatched stack levels in CMXImportFilter::ReadData"); \
01035 StackLevel--;}
01036 #define STOREDVALUE (StoreStack[StackLevel])
01037 #define PARAM(n) (Instructions[n+1])
01038 #define OUTPUTMARKER (OutputMarkerStack[StackLevel])
01039 #define INPUTMARKER (InputMarkerStack[StackLevel])
01040
01041 BOOL CMXImportFilter::ReadData(void *Out, char *Instructions)
01042 {
01043 TRACEUSER( "Graeme", _T("readdata\n"));
01044 BYTE *pOut = (BYTE *)Out;
01045
01046 INT32 StackLevel = 0;
01047 INT32 StoreStack[MAXSTACKLEVEL];
01048 BYTE *OutputMarkerStack[MAXSTACKLEVEL];
01049 INT32 InputMarkerStack[MAXSTACKLEVEL];
01050 BOOL IfExecStack[MAXSTACKLEVEL];
01051 BOOL StoreNext = FALSE;
01052 BOOL ExecutionEnabled = TRUE;
01053 BOOL IfLevel = 0;
01054 INT32 TagEnds[MAXTAGLEVEL];
01055 INT32 TagLevel = 0;
01056 IfExecStack[0] = TRUE;
01057 INT32 Count = 0;
01058
01059
01060 while(TRUE)
01061 {
01062 TRACEUSER( "Graeme", _T("LOOP %d.\n"), Count++);
01063 TRACEUSER( "Claude", _T("Instruction %d\n"), *Instructions);
01064 TRACEUSER( "Graeme", _T("Instruction %d\n"), *Instructions);
01065 ERROR2IF(CMXIinfo::CommandLengths[*Instructions] == 0, FALSE, "Instruction code not defined in CMXImportFilter::ReadData()");
01066
01067
01068
01069 switch(*Instructions)
01070 {
01071 case CI_STOP:
01072 TRACEUSER( "Claude", _T("end readdata\n"));
01073 TRACEUSER( "Graeme", _T("end readdata\n"));
01074 ERROR3IF(StackLevel != 0, "unmatched stack levels");
01075 ERROR3IF(IfLevel != 0, "unmatched if levels");
01076 return TRUE;
01077 break;
01078
01079 case CI_IFSTOREDIS_VAL:
01080 {
01081
01082 IfExecStack[StackLevel] = ExecutionEnabled;
01083
01084 BOOL Test = FALSE;
01085 if(PARAM(0) == CI_IFTYPE_VALUE)
01086 {
01087 if(STOREDVALUE == PARAM(1))
01088 Test = TRUE;
01089 }
01090 else if(PARAM(0) == CI_IFTYPE_BITSET)
01091 {
01092 if((STOREDVALUE & PARAM(1)) != 0)
01093 Test = TRUE;
01094 }
01095 else if(PARAM(0) == CI_IFTYPE_BOOL)
01096 {
01097 BOOL Val = (STOREDVALUE == 0)?FALSE:TRUE;
01098 if(Val == PARAM(1))
01099 Test = TRUE;
01100 }
01101 if(!ExecutionEnabled)
01102 Test = FALSE;
01103
01104 ExecutionEnabled = Test;
01105
01106 IfLevel++;
01107 STACKLEVELUP
01108 }
01109 break;
01110
|
|
converts a point list from the file into one of our paths it isn't transformed or anything
- Author:
- Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
- Date:
- 06/08/96
- Parameters:
-
| pointer | to a pointer to return the new path in [INPUTS] |
- Returns:
- success
Definition at line 1126 of file cmxistut.cpp. 01128 {
01129 BOOL Val = (STOREDVALUE == 0)?FALSE:TRUE;
01130 if(Val == PARAM(1))
01131 Test = TRUE;
01132 }
01133 if(!IfExecStack[StackLevel])
01134 Test = FALSE;
01135
01136 ExecutionEnabled = Test;
01137
01138 STACKLEVELUP
01139 }
01140 break;
01141
01142 case CI_ENDIF:
01143 ERROR2IF(IfLevel <= 0, FALSE, "Can't end an if which didn't start");
01144 IfLevel--;
01145
01146 STACKLEVELDOWN
01147
01148 ExecutionEnabled = IfExecStack[StackLevel];
01149 break;
01150
01151 default:
01152 break;
01153 }
01154
01155
01156 if(ExecutionEnabled)
01157 {
01158 switch(*Instructions)
01159 {
01160
01161 SIMPLEREAD(CI_READBYTE, BYTE, INT32)
01162 SIMPLEREAD(CI_READINT16, SWORD, INT32)
01163 SIMPLEREAD(CI_READINT32, SDWORD, INT32)
01164 SIMPLEREAD(CI_READUINT16, WORD, UINT32)
01165 SIMPLEREAD(CI_READUINT32, DWORD, UINT32)
01166 SIMPLEREAD(CI_READREFERENCE, WORD, INT32)
01167 SIMPLEREAD(CI_READOFFSET, DWORD, UINT32)
01168 SIMPLEREAD(CI_READDOUBLE, double, double)
01169
01170 case CI_READLENGTH:
01171 {
01172 READLENGTH(len)
01173 RDOUT(INT32, len)
01174 RDSTORE(len)
01175 }
01176 break;
01177
01178 case CI_READCOORD:
01179 {
01180 READLENGTH(x)
01181 READLENGTH(y)
01182 DocCoord coord(x, y);
01183 RDOUT(DocCoord, coord)
01184 RDSTORE(x)
01185 }
01186 break;
01187
01188 case CI_READBBOX:
01189 {
01190 READLENGTH(x0)
01191 READLENGTH(y1)
01192 READLENGTH(x1)
01193 READLENGTH(y0)
01194 DocRect rect;
01195 if(x0 > x1)
01196 {
01197 INT32 t = x0;
01198 x0 = x1;
01199 x1 = t;
01200 }
01201 if(y0 > y1)
01202 {
01203 INT32 t = y0;
01204 y0 = y1;
01205 y1 = t;
01206 }
01207 rect.lo.x = x0; rect.lo.y = y0;
01208 rect.hi.x = x1; rect.hi.y = y1;
01209 RDOUT(DocRect, rect)
01210 RDSTORE(x0)
01211 }
01212 break;
01213
01214 case CI_READNATURALWORD:
01215 {
01216 UINT32 word;
01217 if(Is32Bit)
01218 {
01219 RDIN(DWORD, data)
01220 word = data;
01221 }
01222 else
01223 {
01224 RDIN(WORD, data)
01225 word = data;
01226 }
01227 RDOUT(UINT32, word)
01228 RDSTORE(word)
01229 }
01230 break;
01231
01232 case CI_READBOOLEAN:
01233 {
01234 RDIN(BYTE, data)
01235 BOOL flag = (data == 0)?FALSE:TRUE;
01236 RDOUT(BOOL, flag)
01237 RDSTORE(flag)
01238 }
01239 break;
01240
01241 case CI_READANGLE:
01242 {
01243 double Angle;
01244 if(Is32Bit)
01245 {
01246 RDIN(SDWORD, an)
01247 Angle = (an * 2 * PI) / 360000000.0;
01248 }
01249 else
01250 {
01251 RDIN(SWORD, an)
01252 Angle = (an * 2 * PI) / 3600.0;
01253 }
01254
01255 if(Angle < 0)
01256 {
01257 while(Angle < 0) Angle += (2*PI);
01258 }
01259 else if(Angle > (2*PI))
01260 {
01261 while(Angle > (2*PI)) Angle -= (2*PI);
01262 }
01263 RDOUT(double, Angle)
01264 RDSTORE(Angle)
01265 }
01266 break;
01267
01268 case CI_READRENDATTR:
01269
01270
01271
01272
01273 if(!ReadData(pOut, cmxiRenderAttrDesc))
01274 return FALSE;
01275 pOut += sizeof(cmxiRenderAttr);
01276 break;
01277
01278 case CI_READTILING:
|