InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDrawMgr.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Jack Kirstein
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //
23 // Purpose of Interface:
24 // This serves as a bottleneck interface for all drawing, both display and printing.
25 // For more information, see the DrawMgr paper
26 //
27 //========================================================================================
28 
29 #ifndef __IDrawMgr__
30 #define __IDrawMgr__
31 
32 #include "GraphicsID.h"
33 #include "PMRect.h"
34 #include "PMMatrix.h"
35 #include "UIDList.h"
36 #include "HitTestDragConstants.h"
37 #include "IShape.h"
38 
39 class IGraphicsContext;
40 class DrawInterrupter;
41 class DrawFilter;
42 class ICallback;
44 
45 #include "DVAForwardDeclarations.h"
46 
52 class IDrawMgr: public IPMUnknown
53 {
54  public:
58  enum {kDefaultIID = IID_IDRAWMGR};
59 
65  virtual void BeginInterruptableDraw(DrawInterrupter* interruptChecker = nil) = 0;
66 
69  virtual void EndInterruptableDraw() = 0;
70 
76  virtual void EnableInterruptableDraw(bool16 enable = kTrue) = 0;
77 
81  virtual void DisableInterruptableDraw() = 0;
82 
88  virtual bool16 IsDrawingInterruptable() = 0;
89 
94  virtual void Abort() = 0;
95 
102  virtual bool16 DrawAtOnce(IGraphicsContext* gc, const UIDRef& thing, int32 flags) = 0; //perhaps name DrawNow
103 
118  virtual bool16 DrawIncrementallyUsingDrawbot(
119  IGraphicsContext * gc,
120  const UIDRef & thing,
121  int32 flags,
122  IDVPlatformOffscreen * srcOffscreen,
123  dvaui::drawbot::Drawbot * dstDrawbot,
124  SysRect updateBounds,
125  int32 tickCount) = 0;
126 
134  virtual void BeginCullToViewRect(const PMRect& r) = 0;
142  virtual void BeginCullToViewRegion(const SysRgn& rgn) = 0;
143 
147  virtual bool16 EndLatestViewSpaceCulling() = 0;
148 
153  virtual SysRgn GetViewCullRegion() const = 0;
154 
155 
156 
157  virtual uint32 GetSpreadFilterCount() const = 0;
158 
164  virtual uint32 BeginFilterToSpreadRect( const PMRect& r, const PMMatrix& m = PMMatrix(1.,0.,0.,1.,0.,0.), const PMMatrix& rest = PMMatrix(0.,0.,0.,0.,0.,0.)) = 0;
167  virtual uint32 EndFilterToSpreadRect( PMRect* r = nil, PMMatrix* m = nil, PMMatrix* rest = nil) = 0;
171  struct FilterInfo
172  {
173  FilterInfo( const PMRect& r, const PMMatrix& m, const PMMatrix& rest) : fFilterRect(r), fFilterMatrix(m), fRestMatrix(rest) {}
174  PMRect fFilterRect;
175  PMMatrix fFilterMatrix;
176  PMMatrix fRestMatrix;
177  };
178  virtual FilterInfo GetNthSpreadFilter( uint32 which) const = 0;
179 
182  virtual bool16 IsDrawAborted() = 0;
183 
186  virtual bool16 IsDrawClipped( IPMUnknown *thing, const PMMatrix* pb2view) = 0; //IGraphicsContext* gc) = 0;
187 
194  virtual bool16 BeginShape(IPMUnknown *theShape) = 0;
195 
202  virtual void EndShape(IPMUnknown *theShape) = 0;
203 
209  virtual void FlushOffscreenIfNecessary() = 0;
210 
215  virtual void Disable (UID item, bool16 disable) = 0;
216 
220  virtual bool16 IsItemDisabled (UID item) const = 0;
221 
227  virtual bool16 WasDrawAborted() const = 0;
228 
231  virtual void ClearAborted() = 0;
232 
233 
243  virtual void IterateDrawOrder_ (const PMMatrix *xform, const UIDRef &thing, ICallback *callbackInfo, int32 flags) = 0;
244 
245  void IterateDrawOrder( const UIDRef &thing, ICallback *callbackInfo, int32 flags)
246  {
247  PMMatrix identity;
248  IterateDrawOrder_( &identity, thing, callbackInfo, flags);
249  }
250 
258  virtual bool16 DisableClippingOrFiltering() = 0;
259 
264  virtual void EnableClippingOrFiltering() = 0;
265 
271  {
272  public:
274  fDrawMgr(drawMgr),
275  fWasEnabled(drawMgr && drawMgr->DisableClippingOrFiltering())
276  { }
277 
279  {
280  if (fWasEnabled)
281  fDrawMgr->EnableClippingOrFiltering();
282  }
283 
284  private:
285  IDrawMgr* fDrawMgr;
286  const bool16 fWasEnabled;
287  };
288 
289 };
290 #endif