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
00101 #ifndef INC_CAMELEPS
00102 #define INC_CAMELEPS
00103
00104 #include "aw_eps.h"
00105
00106 #include "saveeps.h"
00107 #include "nodemold.h"
00108
00109
00110 class KernelBitmap;
00111 class OILBitmap;
00112 class NodeRegularShape;
00113 class CCAttrMap;
00114 class ColourContext;
00115
00116 typedef enum
00117 {
00118 PENDING_BITMAP_NONE,
00119 PENDING_BITMAP_FILL,
00120 PENDING_BITMAP_TRANSPFILL,
00121 PENDING_BITMAP_OBJECT,
00122 PENDING_BITMAP_POOLITEM,
00123 PENDING_BITMAP_OBJECT_FILL
00124 } PendingBitmap;
00125
00126 typedef enum
00127 {
00128 CAMEPS_FILL_LINEAR = 1,
00129 CAMEPS_FILL_ELLIPTICAL,
00130 CAMEPS_FILL_CIRCULAR,
00131 CAMEPS_FILL_CONICAL,
00132 CAMEPS_FILL_BITMAP,
00133 CAMEPS_FILL_FRACTAL,
00134 CAMEPS_FILL_NEWLINEAR,
00135 CAMEPS_FILL_NEWBITMAP
00136 } CamelotEPSFillType;
00137
00138
00139
00140 enum
00141 {
00142 EOTAG_FONTFLAGS = 1,
00143 EOTAG_BITMAPFLAGS,
00144 EOTAG_TEXTWRAPPED,
00145 EOTAG_FONTTYPE,
00146 EOTAG_GUIDELAYER,
00147 EOTAG_GUIDELINE,
00148 EOTAG_MOULDTHRESHOLD
00149 };
00150
00151
00152
00153 enum
00154 {
00155
00156 EPSC_caz = EPSC_aes + 1,
00157 EPSC_cax,
00158
00159
00160 EPSC_cxt,
00161
00162
00163 EPSC_cxe,
00164
00165
00166 EPSC_cxm,
00167
00168
00169 EPSC_cxmt,
00170
00171
00172 EPSC_cbm,
00173 EPSC_csbm,
00174 EPSC_cebm,
00175
00176
00177 EPSC_cx,
00178 EPSC_cX,
00179 EPSC_ck,
00180 EPSC_cK,
00181
00182
00183 EPSC_cst,
00184
00185
00186 EPSC_csah,
00187 EPSC_ceah,
00188
00189
00190 EPSC_cdp,
00191
00192
00193 EPSC_csbd,
00194 EPSC_cebd,
00195 EPSC_csbr,
00196 EPSC_cebr,
00197
00198
00199 EPSC_csrs,
00200 EPSC_crsp,
00201 EPSC_crstm,
00202 EPSC_crsp1,
00203 EPSC_crsp2,
00204 EPSC_cers,
00205
00206
00207 EPSC_csev,
00208 EPSC_ceev,
00209 EPSC_cspr,
00210 EPSC_cepr,
00211 EPSC_csmp,
00212 EPSC_cemp,
00213 EPSC_csso,
00214 EPSC_ceso,
00215 EPSC_csdo,
00216 EPSC_cedo,
00217
00218
00219 EPSC_ctf,
00220 EPSC_ctb,
00221 EPSC_cti,
00222 EPSC_cts,
00223 EPSC_ctp,
00224 EPSC_ctls,
00225
00226 EPSC_cso,
00227 EPSC_ceo,
00228 EPSC_cfft,
00229 EPSC_cftf,
00230 EPSC_cbot,
00231
00232
00233 EPSC_cpal,
00234
00235
00236 EPSC_glyr,
00237 EPSC_glne,
00238
00239 EPSC_cmth,
00240
00241 EPSC_cag,
00242
00243
00244 EPSC_cbti,
00245
00246
00247 EPSC_cameps_last
00248 };
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262 class CamelotEPSFilter : public ArtWorksEPSFilter
00263 {
00264 CC_DECLARE_DYNAMIC(CamelotEPSFilter);
00265
00266 public:
00267 CamelotEPSFilter();
00268 BOOL Init();
00269 BOOL IsDefaultDocRequired(const TCHAR* pcszPathName);
00270 BOOL PrepareToExport(CCLexFile*, Spread* pSpread);
00271 TCHAR* GetEPSCommand(EPSCommand Cmd);
00272 BOOL ExportBitmap(KernelBitmap&);
00273
00274
00275 virtual BOOL CanIncludePreviewBmp();
00276
00277 protected:
00278 virtual void LookUpToken();
00279 virtual BOOL ProcessToken();
00280 INT32 EPSHeaderIsOk(ADDR pFileHeader, UINT32 HeaderSize);
00281 BOOL PrepareToImport();
00282 void CleanUpAfterImport(BOOL Successful);
00283
00284 virtual BOOL GetExportOptions( );
00285
00286 PendingBitmap m_PendingBitmap;
00287 INT32 BitmapTransparencyIndex;
00288 virtual BOOL ReadBitmap();
00289 virtual void BitmapPoolAttach(KernelBitmap* pBitmap);
00290 KernelBitmap *pBitmap;
00291
00292 NodeRegularShape *pRegularShape;
00293 BOOL RegularShapeIsFilled;
00294 BOOL RegularShapeIsStroked;
00295
00296 struct _BitmapAttrs
00297 {
00298 DocCoord Coords[3];
00299
00300 DocColour StartCol;
00301 DocColour EndCol;
00302
00303 UINT32 TranspType;
00304 UINT32 Transp;
00305 UINT32 EndTransp;
00306
00307 } BitmapAttrs;
00308
00309
00310 BOOL ProcessBlend();
00311 BOOL ProcessBlender();
00312 BOOL StartBlend();
00313 BOOL StartBlender();
00314 BOOL EndBlend();
00315 BOOL EndBlender();
00316
00317
00318 BOOL ProcessRegularShape();
00319 BOOL ProcessRegularShapeParams();
00320
00321
00322 BOOL ProcessEnvelope();
00323 BOOL ProcessPerspective();
00324 BOOL StartMould(MouldSpace mSpace);
00325 BOOL EndMould();
00326 BOOL RemoveUnwantedAttributes(NodeMould* pNodeMould);
00327 void BuildSubtreeAttrMap(CCAttrMap *pAttribMap, Node* pNode);
00328 BOOL ProcessMould();
00329 BOOL ProcessMouldTokens();
00330 BOOL ProcessMouldShape();
00331 BOOL ProcessMouldSourceObjs();
00332 BOOL ProcessMouldDestinObjs();
00333 BOOL ProcessMouldThreshold();
00334 BOOL ReadSimplePath(Path* TempPath);
00335
00336 BOOL ProcessFontFlags();
00337 BOOL ProcessBitmapFlags();
00338 BOOL ProcessFontType();
00339 BOOL FindEndOfTag();
00340
00341
00342 BOOL ProcessGuideLayer();
00343 BOOL ProcessGuideline();
00344
00345
00346 static CommandMap CamelotCommands[];
00347 };
00348
00349 class EPSFontCache
00350 {
00351 public:
00352 EPSFontCache();
00353
00354 public:
00355 BOOL Valid;
00356 BOOL Complex;
00357 WORD Typeface;
00358 BOOL Bold;
00359 BOOL Italic;
00360 MILLIPOINT Size;
00361 FIXED16 a, b, c, d;
00362 };
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375 class CamelotEPSRenderRegion : public ArtWorksEPSRenderRegion
00376 {
00377 CC_DECLARE_DYNAMIC(CamelotEPSRenderRegion)
00378
00379 public:
00380 CamelotEPSRenderRegion(DocRect ClipRect, Matrix ConvertMatrix, FIXED16 ViewScale);
00381
00382 virtual ~CamelotEPSRenderRegion();
00383
00384
00385 void GetValidPathAttributes();
00386 void GetRenderRegionCaps(RRCaps* pCaps);
00387
00388 BOOL StartRender();
00389 BOOL StopRender();
00390
00391 void DrawPathToOutputDevice(Path *DrawPath, PathShape shapePath=PATHSHAPE_PATH);
00392 BOOL DrawTransformedBitmap(NodeBitmap *pNodeBitmap);
00393
00394
00395 virtual SlowJobResult DrawMaskedBitmap(const DocRect &Rect, KernelBitmap* pBitmap,
00396 MaskedRenderRegion* pMask, ProgressDisplay *Progress);
00397
00398 virtual BOOL RenderChar(WCHAR ch, Matrix* pMatrix);
00399
00400
00401 virtual BOOL NeedsPrintComponents ( void );
00402
00403
00404 virtual void ConditionalSuicide ( void );
00405
00406
00407 virtual BOOL WriteNewLine ( void );
00408
00409
00410 virtual void OutputStrokeColour ();
00411 virtual void OutputFillColour ();
00412
00413 virtual BOOL DrawParallelogramBitmap(DocCoord *Coords, OILBitmap *pBitmap, EFFECTTYPE Effect = EFFECT_RGB,
00414 DocColour *StartCol = NULL, DocColour *EndCol = NULL);
00415
00416 protected:
00417 virtual BOOL WriteEPSBoundingBox ( void );
00418 virtual BOOL WriteProlog(KernelDC*);
00419 virtual BOOL WriteSetup(KernelDC*);
00420 virtual BOOL WriteEPSTrailerComments ( void );
00421
00422 BOOL DrawClippedBitmap(Path *DrawPath);
00423
00424 BOOL SelectNewFont(WORD Typeface, BOOL Bold, BOOL Italic, MILLIPOINT Size);
00425 BOOL SelectNewFont(WORD Typeface, BOOL Bold, BOOL Italic, FIXED16 *abcd);
00426
00427
00428
00429 virtual BOOL OutputGradFillColours(DocColour* StartCol, DocColour* EndCol, ColourContext* pContext=NULL);
00430 BOOL GetCurrFillEffect(UINT32& EffectType);
00431
00432
00433 EPSFontCache FontInfo;
00434
00435
00436 void ColourSeparateScanline24(BYTE *DestBuffer, BYTE *SrcBuffer, INT32 PixelWidth);
00437
00438
00439
00440 BYTE *SepTables;
00441 };
00442
00443
00444
00445 #endif // INC_CAMELEPS
00446
00447