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_SPREAD
00102 #define INC_SPREAD
00103
00104 #include "npaper.h"
00105 #include "convert.h"
00106 #include "dibconv.h"
00107 #include "paldefs.h"
00108 #include "animparams.h"
00109
00110 class NodeGrid;
00111
00112
00113
00114
00115
00116
00117
00118 #define NEW_PASTEBOARD 0
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134 class Layer;
00135 class Page;
00136 class View;
00137
00138 class Spread: public NodeRenderablePaper
00139 {
00140 CC_DECLARE_DYNAMIC( Spread )
00141
00142 public:
00143 Spread();
00144
00145 Spread(Node* ContextNode,
00146 AttachNodeDirection Direction,
00147 const DocRect& PasteRect,
00148 MILLIPOINT BleedOffset = 0,
00149 BOOL Locked=FALSE,
00150 BOOL Mangled=FALSE,
00151 BOOL Marked=FALSE,
00152 BOOL Selected=FALSE
00153 );
00154
00155
00156 public:
00157 virtual DocRect GetBoundingRect(BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE);
00158 DocRect GetDrawingSize() const;
00159
00160 String Describe(BOOL Plural, BOOL Verbose);
00161
00162 Spread* FindNextSpread();
00163 Spread* FindPreviousSpread();
00164
00165 Page* FindFirstPageInSpread() const;
00166 Page* FindLastPageInSpread() const;
00167
00168 Document* FindParentDocument();
00169
00170 Chapter* FindParentChapter();
00171
00172 Layer* FindActiveLayer();
00173 Layer* FindFirstLayer() const;
00174 Layer* FindLastLayer() const;
00175 Layer* FindFirstGuideLayer() const;
00176 Layer* FindFirstPageBackgroundLayer() const;
00177 Layer* FindFirstFrameLayer() const;
00178 Layer* FindLastFrameLayer() const;
00179
00180 DimScale* GetPtrDimScale();
00181
00182 MILLIPOINT GetBleedOffset() const;
00183 BOOL SetBleedOffset(MILLIPOINT Bleed);
00184
00185 BOOL GetShowDropShadow() const;
00186 BOOL SetShowDropShadow(BOOL NewState);
00187
00188 virtual BOOL IsSpread() const;
00189 virtual SubtreeRenderState RenderSubtree(RenderRegion* pRender, Node** ppNextNode = NULL, BOOL bClip = TRUE);
00190 BOOL NeedsToExport(RenderRegion *pRender, BOOL VisibleLayersOnly = FALSE, BOOL CheckSelected = FALSE);
00191
00192 void Render(RenderRegion* pRender);
00193
00194 #ifdef _DEBUG
00195 void ShowDebugTreeDetails() const;
00196 #endif
00197
00198 virtual UINT32 GetNodeSize() const;
00199
00200 virtual void GetDebugDetails(StringBase* Str);
00201
00202
00203
00204 virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00205 virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
00206 virtual BOOL WriteBeginChildRecordsWeb(BaseCamelotFilter* pFilter);
00207 virtual BOOL WriteBeginChildRecordsNative(BaseCamelotFilter* pFilter);
00208 virtual BOOL WriteEndChildRecordsWeb(BaseCamelotFilter* pFilter);
00209 virtual BOOL WriteEndChildRecordsNative(BaseCamelotFilter* pFilter);
00210
00211 protected:
00212
00213 virtual BOOL WriteSpreadInformation(BaseCamelotFilter* pFilter);
00214 virtual BOOL WriteSpreadScaling(BaseCamelotFilter* pFilter);
00215
00216
00217 public:
00218 DocCoord GetUserOrigin();
00219 void SetUserOrigin(DocCoord origin) { UserOrigin=origin; }
00220
00221 void SpreadCoordToDocCoord(DocCoord *pSpreadCoord) const;
00222 void SpreadCoordToDocCoord(DocRect *pSpreadCoord) const;
00223 void DocCoordToSpreadCoord(DocCoord *pDocCoord) const;
00224 void DocCoordToSpreadCoord(DocRect *pDocCoord) const;
00225
00226
00227 BOOL SpreadCoordToPagesCoord(DocCoord *pPagesCoord, DocCoord SpreadCoord);
00228 BOOL PagesCoordToSpreadCoord(DocCoord *pSpreadCoord, DocCoord PagesCoord);
00229
00230
00231
00232 BOOL GetPagesRect(DocRect* pPagesRect);
00233
00234 BOOL TextToSpreadCoord(DocCoord* pDocCoord, StringBase* pxText, StringBase* pyText);
00235 BOOL SpreadCoordToText(String_256* pxText, String_256* pyText, DocCoord DocCoord,
00236 BOOL xUnitSpecifier=TRUE, BOOL yUnitSpecifier=TRUE, INT32 dp=-1);
00237
00238 BOOL GetDecimalPlacesForPixelResolution(View *pView, INT32* dp);
00239
00240
00241 public:
00242 NodeGrid* FindFirstDefaultGridInSpread();
00243
00244 public:
00245 BOOL CreateDefaultPageAndGrid(BOOL CreateGrid = TRUE);
00246
00247 public:
00248 DocRect GetPageBounds() const;
00249 DocRect GetPageVisibleBounds() const;
00250
00251 BOOL GetPageSize(MILLIPOINT *Width, MILLIPOINT *Height,
00252 MILLIPOINT *Margin, MILLIPOINT *Bleed,
00253 BOOL *Dps, BOOL *ShowDropShadow);
00254
00255
00256 BOOL SetPageSize(const MILLIPOINT Width, const MILLIPOINT Height,
00257 const MILLIPOINT Margin, const MILLIPOINT Bleed,
00258 const BOOL Dps, const BOOL ShowDropShadow);
00259
00260
00261
00262
00263 protected:
00264 #if NEW_PASTEBOARD
00265 BOOL AdjustAllPages(const MILLIPOINT Width, const MILLIPOINT Height,
00266 const MILLIPOINT Margin, const BOOL Dps);
00267
00268
00269
00270 #else
00271 BOOL SetSizeOfAllPages(const MILLIPOINT Width, const MILLIPOINT Height,
00272 const MILLIPOINT Margin, const BOOL Dps);
00273
00274
00275
00276
00277 BOOL AlignPasteboards(const DocRect NewPasteRect, const MILLIPOINT Margin);
00278
00279
00280 #endif
00281
00282
00283 public:
00284 DocRect GetWidePasteboard(View *pView);
00285
00286
00287
00288 DocCoord GetSpreadCoordOrigin(BOOL Pixelise = TRUE, View *pView = NULL) const;
00289
00290
00291
00292 void SetSpreadCoordOrigin(DocCoord NewOrigin);
00293
00294
00295
00296
00297 DocCoord GetMaxPasteboardSize(void);
00298
00299
00300 BOOL ExpandPasteboardToInclude(DocRect IncludeRect);
00301
00302
00303
00304 void AdjustPasteboards(void);
00305
00306
00307
00308
00309
00310 virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00311
00312 protected:
00313 virtual void SetInitialPasteboardRect(const DocRect& PasteRect);
00314
00315
00316 virtual BOOL PostImport();
00317
00318
00319
00320 protected:
00321 void RenderPasteboard(RenderRegion* pRender);
00322 void RenderBleedArea(RenderRegion* pRender);
00323 virtual Node* SimpleCopy();
00324 void CopyNodeContents(Spread* NodeCopy);
00325 void RenderDropShadows(RenderRegion* pRender);
00326
00327
00328 protected:
00329 MILLIPOINT BleedOffset;
00330 BOOL ShowDropShadow;
00331 BOOL RalphDontShowPaper;
00332 DocCoord SpreadOrigin;
00333 DocCoord UserOrigin;
00334 AnimPropertiesParam m_AnimPropertiesParam;
00335
00336
00337
00338
00339
00340
00341
00342
00343 public:
00344
00345
00346 BOOL SetSpreadAnimPropertiesParam(const DWORD &Loop, const DWORD &GlobalDelay, const DITHER &Dither,
00347 const WEB_PALETTE &WebPalette, const PALETTE_COLOURS &ColoursPalette,
00348 const DWORD &NumColsInPalette, const BOOL& UseSystemColours,
00349 const BOOL& IsBackgroundTransparent);
00350
00351
00352
00353 BOOL GetSpreadAnimPropertiesParam(DWORD *Loop, DWORD *GlobalDelay, DITHER *Dither,
00354 WEB_PALETTE *WebPalette, PALETTE_COLOURS* ColoursPalette,
00355 DWORD* NumColsInPalette, BOOL* UseSystemColours,
00356 BOOL* pIsBgTransparent);
00357
00358 AnimPropertiesParam& GetSpreadAnimPropertiesParam();
00359 void SetSpreadAnimPropertiesParam(const AnimPropertiesParam& Param);
00360 void SetAnimationDelay(const DWORD GlobalDelay);
00361 void SetAnimationLoop(const DWORD &Loop);
00362
00363 void SetAnimationColours(const DITHER& Dither, const WEB_PALETTE& WebPalette,
00364 const PALETTE_COLOURS& ColoursPalette, const DWORD& NumColsInPalette,
00365 const BOOL& IsBackgroundTransparent);
00366 void GetAnimationColours(DITHER * pDither, WEB_PALETTE * pWebPalette,
00367 PALETTE_COLOURS * pColoursPalette, DWORD * pNumColsInPalette,
00368 BOOL * pIsBackgroundTransparent);
00369
00370 virtual BOOL WriteSpreadAnimProperties(BaseCamelotFilter* pFilter);
00371
00372
00373 DocRect GetAnimationBoundingRect();
00374 void SetAnimationBoundingRect(const DocRect& BoundingRect);
00375
00376
00377 Quality GetAnimationQuality();
00378 void SetAnimationQuality(const Quality& NewQuality);
00379
00380
00381
00382 private:
00383 DimScale SpreadDimScale;
00384 };
00385
00386 #endif