Branch libreoffice-5-0-4
[LibreOffice.git] / include / svtools / grfmgr.hxx
blob089b69d08ba99bf86313235f2dc30aa5ea4c9cea
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVTOOLS_GRFMGR_HXX
21 #define INCLUDED_SVTOOLS_GRFMGR_HXX
23 #include <vcl/graph.hxx>
24 #include <svtools/svtdllapi.h>
25 #include <o3tl/typed_flags_set.hxx>
27 enum class GraphicManagerDrawFlags
29 CACHED = 0x01,
30 SMOOTHSCALE = 0x02,
31 USE_DRAWMODE_SETTINGS = 0x04,
32 SUBSTITUTE = 0x08,
33 NO_SUBSTITUTE = 0x10,
34 STANDARD = (CACHED|SMOOTHSCALE),
36 namespace o3tl
38 template<> struct typed_flags<GraphicManagerDrawFlags> : is_typed_flags<GraphicManagerDrawFlags, 0x1f> {};
41 // AutoSwap defines
43 #define GRFMGR_AUTOSWAPSTREAM_LINK nullptr
44 #define GRFMGR_AUTOSWAPSTREAM_LOADED reinterpret_cast<SvStream*>(sal_IntPtr(-3))
45 #define GRFMGR_AUTOSWAPSTREAM_TEMP reinterpret_cast<SvStream*>(sal_IntPtr(-2))
46 #define GRFMGR_AUTOSWAPSTREAM_NONE reinterpret_cast<SvStream*>(sal_IntPtr(-1))
48 // Adjustment defines
49 enum class GraphicAdjustmentFlags
51 NONE = 0x00,
52 DRAWMODE = 0x01,
53 COLORS = 0x02,
54 MIRROR = 0x04,
55 ROTATE = 0x08,
56 TRANSPARENCY = 0x10,
57 ALL = 0x1f,
59 namespace o3tl
61 template<> struct typed_flags<GraphicAdjustmentFlags> : is_typed_flags<GraphicAdjustmentFlags, 0x1f> {};
64 enum GraphicDrawMode
66 GRAPHICDRAWMODE_STANDARD = 0,
67 GRAPHICDRAWMODE_GREYS = 1,
68 GRAPHICDRAWMODE_MONO = 2,
69 GRAPHICDRAWMODE_WATERMARK = 3
72 class GraphicManager;
73 class SvStream;
74 class BitmapWriteAccess;
75 class GraphicCache;
76 class VirtualDevice;
77 struct GrfSimpleCacheObj;
78 struct ImplTileInfo;
80 class SVT_DLLPUBLIC GraphicAttr
82 private:
84 double mfGamma;
85 BmpMirrorFlags mnMirrFlags;
86 long mnLeftCrop;
87 long mnTopCrop;
88 long mnRightCrop;
89 long mnBottomCrop;
90 sal_uInt16 mnRotate10;
91 short mnContPercent;
92 short mnLumPercent;
93 short mnRPercent;
94 short mnGPercent;
95 short mnBPercent;
96 bool mbInvert;
97 sal_uInt8 mcTransparency;
98 GraphicDrawMode meDrawMode;
100 public:
102 GraphicAttr();
103 ~GraphicAttr();
105 bool operator==( const GraphicAttr& rAttr ) const;
106 bool operator!=( const GraphicAttr& rAttr ) const { return !( *this == rAttr ); }
108 void SetDrawMode( GraphicDrawMode eDrawMode ) { meDrawMode = eDrawMode; }
109 GraphicDrawMode GetDrawMode() const { return meDrawMode; }
111 void SetMirrorFlags( BmpMirrorFlags nMirrFlags ) { mnMirrFlags = nMirrFlags; }
112 BmpMirrorFlags GetMirrorFlags() const { return mnMirrFlags; }
114 void SetCrop( long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM )
116 mnLeftCrop = nLeft_100TH_MM; mnTopCrop = nTop_100TH_MM;
117 mnRightCrop = nRight_100TH_MM; mnBottomCrop = nBottom_100TH_MM;
119 long GetLeftCrop() const { return mnLeftCrop; }
120 long GetTopCrop() const { return mnTopCrop; }
121 long GetRightCrop() const { return mnRightCrop; }
122 long GetBottomCrop() const { return mnBottomCrop; }
124 void SetRotation( sal_uInt16 nRotate10 ) { mnRotate10 = nRotate10; }
125 sal_uInt16 GetRotation() const { return mnRotate10; }
127 void SetLuminance( short nLuminancePercent ) { mnLumPercent = nLuminancePercent; }
128 short GetLuminance() const { return mnLumPercent; }
130 void SetContrast( short nContrastPercent ) { mnContPercent = nContrastPercent; }
131 short GetContrast() const { return mnContPercent; }
133 void SetChannelR( short nChannelRPercent ) { mnRPercent = nChannelRPercent; }
134 short GetChannelR() const { return mnRPercent; }
136 void SetChannelG( short nChannelGPercent ) { mnGPercent = nChannelGPercent; }
137 short GetChannelG() const { return mnGPercent; }
139 void SetChannelB( short nChannelBPercent ) { mnBPercent = nChannelBPercent; }
140 short GetChannelB() const { return mnBPercent; }
142 void SetGamma( double fGamma ) { mfGamma = fGamma; }
143 double GetGamma() const { return mfGamma; }
145 void SetInvert( bool bInvert ) { mbInvert = bInvert; }
146 bool IsInvert() const { return mbInvert; }
148 void SetTransparency( sal_uInt8 cTransparency ) { mcTransparency = cTransparency; }
149 sal_uInt8 GetTransparency() const { return mcTransparency; }
151 bool IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); }
152 bool IsMirrored() const { return mnMirrFlags != BmpMirrorFlags::NONE; }
153 bool IsCropped() const
155 return( mnLeftCrop != 0 || mnTopCrop != 0 ||
156 mnRightCrop != 0 || mnBottomCrop != 0 );
158 bool IsRotated() const { return( ( mnRotate10 % 3600 ) != 0 ); }
159 bool IsTransparent() const { return( mcTransparency > 0 ); }
160 bool IsAdjusted() const
162 return( mnLumPercent != 0 || mnContPercent != 0 || mnRPercent != 0 ||
163 mnGPercent != 0 || mnBPercent != 0 || mfGamma != 1.0 || mbInvert );
166 friend SvStream& WriteGraphicAttr( SvStream& rOStm, const GraphicAttr& rAttr );
167 friend SvStream& ReadGraphicAttr( SvStream& rIStm, GraphicAttr& rAttr );
170 class SVT_DLLPUBLIC GraphicObject : public SvDataCopyStream
172 friend class GraphicManager;
173 friend class SdrGrafObj;
175 private:
177 static GraphicManager* mpGlobalMgr;
179 Graphic maGraphic;
180 GraphicAttr maAttr;
181 Size maPrefSize;
182 MapMode maPrefMapMode;
183 sal_uLong mnSizeBytes;
184 GraphicType meType;
185 GraphicManager* mpMgr;
186 OUString maLink;
187 Link<>* mpSwapStreamHdl;
188 OUString maUserData;
189 Timer* mpSwapOutTimer;
190 GrfSimpleCacheObj* mpSimpleCache;
191 sal_uLong mnAnimationLoopCount;
193 // a unique increasing ID to be able to say which data change is older
194 sal_uLong mnDataChangeTimeStamp;
196 bool mbAutoSwapped : 1;
197 bool mbTransparent : 1;
198 bool mbAnimated : 1;
199 bool mbEPS : 1;
200 bool mbIsInSwapIn : 1;
201 bool mbIsInSwapOut : 1;
202 bool mbAlpha : 1;
204 void SVT_DLLPRIVATE ImplConstruct();
205 void SVT_DLLPRIVATE ImplAssignGraphicData();
206 void SVT_DLLPRIVATE ImplSetGraphicManager(
207 const GraphicManager* pMgr,
208 const OString* pID = NULL,
209 const GraphicObject* pCopyObj = NULL
211 void SVT_DLLPRIVATE ImplAutoSwapIn();
212 bool SVT_DLLPRIVATE ImplIsAutoSwapped() const { return mbAutoSwapped; }
213 bool SVT_DLLPRIVATE ImplGetCropParams(
214 OutputDevice* pOut,
215 Point& rPt,
216 Size& rSz,
217 const GraphicAttr* pAttr,
218 tools::PolyPolygon& rClipPolyPoly,
219 bool& bRectClipRegion
220 ) const;
222 /** Render a given number of tiles in an optimized way
224 This method recursively subdivides the tile rendering problem
225 in smaller parts, i.e. rendering output size x with few tiles
226 of size y, which in turn are generated from the original
227 bitmap in a recursive fashion. The subdivision size can be
228 controlled by the exponent argument, which specifies the
229 minimal number of smaller tiles used in one recursion
230 step. The resulting tile size is given as the integer number
231 of repetitions of the original bitmap along x and y. As the
232 exponent need not necessarily divide these numbers without
233 remainder, the repetition counts are effectively converted to
234 base-exponent numbers, where each place denotes the number of
235 times the corresponding tile size is rendered.
237 @param rVDev
238 Virtual device to render everything into
240 @param nExponent
241 Number of repetitions per subdivision step, _must_ be greater than 1
243 @param nNumTilesX
244 Number of original tiles to generate in x direction
246 @param nNumTilesY
247 Number of original tiles to generate in y direction
249 @param rTileSizePixel
250 Size in pixel of the original tile bitmap to render it in
252 @param pAttr
253 Graphic attributes to be used for rendering
255 @param nFlags
256 Graphic flags to be used for rendering
258 @param rCurrPos
259 Current output point for this recursion level (should start with (0,0))
261 @return true, if everything was successfully rendered.
263 bool SVT_DLLPRIVATE ImplRenderTempTile(
264 VirtualDevice& rVDev,
265 int nExponent,
266 int nNumTilesX,
267 int nNumTilesY,
268 const Size& rTileSizePixel,
269 const GraphicAttr* pAttr,
270 GraphicManagerDrawFlags nFlags
273 /// internally called by ImplRenderTempTile()
274 bool SVT_DLLPRIVATE ImplRenderTileRecursive(
275 VirtualDevice& rVDev,
276 int nExponent,
277 int nMSBFactor,
278 int nNumOrigTilesX,
279 int nNumOrigTilesY,
280 int nRemainderTilesX,
281 int nRemainderTilesY,
282 const Size& rTileSizePixel,
283 const GraphicAttr* pAttr,
284 GraphicManagerDrawFlags nFlags,
285 ImplTileInfo& rTileInfo
288 bool SVT_DLLPRIVATE ImplDrawTiled(
289 OutputDevice* pOut,
290 const Rectangle& rArea,
291 const Size& rSizePixel,
292 const Size& rOffset,
293 const GraphicAttr* pAttr,
294 GraphicManagerDrawFlags nFlags,
295 int nTileCacheSize1D
298 bool SVT_DLLPRIVATE ImplDrawTiled(
299 OutputDevice& rOut,
300 const Point& rPos,
301 int nNumTilesX,
302 int nNumTilesY,
303 const Size& rTileSize,
304 const GraphicAttr* pAttr,
305 GraphicManagerDrawFlags nFlags
308 void SVT_DLLPRIVATE ImplTransformBitmap(
309 BitmapEx& rBmpEx,
310 const GraphicAttr& rAttr,
311 const Size& rCropLeftTop,
312 const Size& rCropRightBottom,
313 const Rectangle& rCropRect,
314 const Size& rDstSize,
315 bool bEnlarge
316 ) const;
318 DECL_LINK_TYPED( ImplAutoSwapOutHdl, Timer*, void );
320 // restart SwapOut timer; this is like touching in a cache to reset to the full timeout value
321 void SVT_DLLPRIVATE restartSwapOutTimer() const;
323 // Handle evtl. needed AfterDataChanges, needs to be called when new
324 // graphic data is swapped in/added to the GraphicManager
325 void SVT_DLLPRIVATE ImplAfterDataChange();
326 protected:
328 void GraphicManagerDestroyed();
329 SvStream* GetSwapStream() const;
330 void SetSwapState();
332 virtual void Load( SvStream& ) SAL_OVERRIDE;
333 virtual void Save( SvStream& ) SAL_OVERRIDE;
334 virtual void Assign( const SvDataCopyStream& ) SAL_OVERRIDE;
336 public:
338 TYPEINFO_OVERRIDE();
340 GraphicObject( const GraphicManager* pMgr = NULL );
341 GraphicObject( const Graphic& rGraphic, const GraphicManager* pMgr = NULL );
342 GraphicObject( const GraphicObject& rCacheObj, const GraphicManager* pMgr = NULL );
343 explicit GraphicObject( const OString& rUniqueID, const GraphicManager* pMgr = NULL );
344 virtual ~GraphicObject();
346 GraphicObject& operator=( const GraphicObject& rCacheObj );
347 bool operator==( const GraphicObject& rCacheObj ) const;
348 bool operator!=( const GraphicObject& rCacheObj ) const { return !( *this == rCacheObj ); }
350 bool HasSwapStreamHdl() const { return( mpSwapStreamHdl != NULL && mpSwapStreamHdl->IsSet() ); }
351 void SetSwapStreamHdl();
352 void SetSwapStreamHdl(const Link<>& rHdl);
353 sal_uLong GetSwapOutTimeout() const { return( mpSwapOutTimer ? mpSwapOutTimer->GetTimeout() : 0 ); }
355 void FireSwapInRequest();
356 void FireSwapOutRequest();
358 GraphicManager& GetGraphicManager() const { return *mpMgr; }
360 bool IsCached(
361 OutputDevice* pOut,
362 const Point& rPt,
363 const Size& rSz,
364 const GraphicAttr* pAttr = NULL,
365 GraphicManagerDrawFlags nFlags = GraphicManagerDrawFlags::STANDARD
366 ) const;
368 const Graphic& GetGraphic() const;
369 void SetGraphic( const Graphic& rGraphic, const GraphicObject* pCopyObj = 0);
370 void SetGraphic( const Graphic& rGraphic, const OUString& rLink );
372 /** Get graphic transformed according to given attributes
374 This method returns a Graphic transformed, cropped and scaled
375 to the given parameters, ready to be rendered to printer or
376 display. The returned graphic has the same visual appearance
377 as if it had been drawn via GraphicObject::Draw() to a
378 specific output device.
380 @param rDestSize
381 Desired output size in logical coordinates. The mapmode to
382 interpret these logical coordinates in is given by the second
383 parameter, rDestMap.
385 @param rDestMap
386 Mapmode the output should be interpreted in. This is used to
387 interpret rDestSize, to set the appropriate PrefMapMode on the
388 returned Graphic, and to deal correctly with metafile graphics.
390 @param rAttr
391 Graphic attributes used to transform the graphic. This
392 includes cropping, rotation, mirroring, and various color
393 adjustment parameters.
395 @return the readily transformed Graphic
397 Graphic GetTransformedGraphic(
398 const Size& rDestSize,
399 const MapMode& rDestMap,
400 const GraphicAttr& rAttr
401 ) const;
402 Graphic GetTransformedGraphic( const GraphicAttr* pAttr = NULL ) const; // TODO: Change to Impl
404 void SetAttr( const GraphicAttr& rAttr );
405 const GraphicAttr& GetAttr() const { return maAttr; }
407 bool HasLink() const { return !maLink.isEmpty(); }
408 void SetLink();
409 void SetLink( const OUString& rLink );
410 OUString GetLink() const { return maLink; }
412 bool HasUserData() const { return !maUserData.isEmpty(); }
413 void SetUserData();
414 void SetUserData( const OUString& rUserData );
415 OUString GetUserData() const { return maUserData; }
417 OString GetUniqueID() const;
419 GraphicType GetType() const { return meType; }
420 const Size& GetPrefSize() const { return maPrefSize; }
421 const MapMode& GetPrefMapMode() const { return maPrefMapMode; }
422 sal_uLong GetSizeBytes() const { return mnSizeBytes; }
423 bool IsTransparent() const { return mbTransparent; }
424 bool IsAlpha() const { return mbAlpha; }
425 bool IsAnimated() const { return mbAnimated; }
426 bool IsEPS() const { return mbEPS; }
428 Link<> GetAnimationNotifyHdl() const { return GetGraphic().GetAnimationNotifyHdl(); }
430 bool SwapOut();
431 bool SwapOut( SvStream* pOStm );
432 bool SwapIn();
434 bool IsInSwapIn() const { return mbIsInSwapIn; }
435 bool IsInSwapOut() const { return mbIsInSwapOut; }
436 bool IsSwappedOut() const { return( mbAutoSwapped || maGraphic.IsSwapOut() ); }
438 bool Draw(
439 OutputDevice* pOut,
440 const Point& rPt,
441 const Size& rSz,
442 const GraphicAttr* pAttr = NULL,
443 GraphicManagerDrawFlags nFlags = GraphicManagerDrawFlags::STANDARD
446 /** Draw the graphic repeatedly into the given output rectangle
448 @param pOut
449 OutputDevice where the rendering should take place
451 @param rArea
452 The output area that is filled with tiled instances of this graphic
454 @param rSize
455 The actual size of a single tile
457 @param rOffset
458 Offset from the left, top position of rArea, where to start
459 the tiling. The upper left corner of the graphic tilings will
460 virtually start at this position. Concretely, only that many
461 tiles are drawn to completely fill the given output area.
463 @param pAttr
464 Optional GraphicAttr
466 @param nFlags
467 Optional rendering flags
469 @param nTileCacheSize1D
470 Optional dimension of the generated cache tiles. The pOut sees
471 a number of tile draws, which have approximately
472 nTileCacheSize1D times nTileCacheSize1D bitmap sizes if the
473 tile bitmap is smaller. Otherwise, the tile is drawn as
474 is. This is useful if e.g. you want only a few, very large
475 bitmap drawings appear on the outdev.
477 @return sal_True, if drawing completed successfully
479 bool DrawTiled(
480 OutputDevice* pOut,
481 const Rectangle& rArea,
482 const Size& rSize,
483 const Size& rOffset,
484 const GraphicAttr* pAttr = NULL,
485 GraphicManagerDrawFlags nFlags = GraphicManagerDrawFlags::STANDARD,
486 int nTileCacheSize1D=128
489 bool StartAnimation(
490 OutputDevice* pOut,
491 const Point& rPt,
492 const Size& rSz,
493 long nExtraData = 0L,
494 const GraphicAttr* pAttr = NULL,
495 GraphicManagerDrawFlags nFlags = GraphicManagerDrawFlags::STANDARD,
496 OutputDevice* pFirstFrameOutDev = NULL
499 void StopAnimation( OutputDevice* pOut = NULL, long nExtraData = 0L );
501 friend SvStream& WriteGraphicObject( SvStream& rOStm, const GraphicObject& rGraphicObj );
502 friend SvStream& ReadGraphicObject( SvStream& rIStm, GraphicObject& rGraphicObj );
504 static GraphicObject CreateGraphicObjectFromURL( const OUString &rURL );
505 // will inspect an object ( e.g. a control ) for any 'ImageURL'
506 // properties and return these in a vector. Note: this implementation
507 // will cater for XNameContainer objects and deepinspect any containees
508 // if they exist
509 static void InspectForGraphicObjectImageURL( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIf, std::vector< OUString >& rvEmbedImgUrls );
511 // create CropScaling information
512 // fWidth, fHeight: object size
513 // f*Crop: crop values relative to original bitmap size
514 basegfx::B2DVector calculateCropScaling(
515 double fWidth,
516 double fHeight,
517 double fLeftCrop,
518 double fTopCrop,
519 double fRightCrop,
520 double fBottomCrop) const;
522 // read access
523 sal_uLong GetDataChangeTimeStamp() const { return mnDataChangeTimeStamp; }
526 typedef ::std::vector< GraphicObject* > GraphicObjectList_impl;
528 class SVT_DLLPUBLIC GraphicManager
530 friend class GraphicObject;
531 friend class GraphicDisplayCacheEntry;
533 private:
535 GraphicObjectList_impl maObjList;
536 sal_uLong mnUsedSize; // currently used memory footprint of all swapped in graphics
537 GraphicCache* mpCache;
539 GraphicManager( const GraphicManager& ) {}
540 GraphicManager& operator=( const GraphicManager& ) { return *this; }
542 bool SVT_DLLPRIVATE ImplDraw(
543 OutputDevice* pOut,
544 const Point& rPt,
545 const Size& rSz,
546 GraphicObject& rObj,
547 const GraphicAttr& rAttr,
548 const GraphicManagerDrawFlags nFlags,
549 bool& rCached
552 static bool SVT_DLLPRIVATE ImplCreateOutput(
553 OutputDevice* pOut,
554 const Point& rPt,
555 const Size& rSz,
556 const BitmapEx& rBmpEx,
557 const GraphicAttr& rAttr,
558 const GraphicManagerDrawFlags nFlags,
559 BitmapEx* pBmpEx = NULL
561 static bool SVT_DLLPRIVATE ImplCreateOutput(
562 OutputDevice* pOut,
563 const Point& rPt,
564 const Size& rSz,
565 const GDIMetaFile& rMtf,
566 const GraphicAttr& rAttr,
567 const GraphicManagerDrawFlags nFlags,
568 GDIMetaFile& rOutMtf,
569 BitmapEx& rOutBmpEx
572 static void SVT_DLLPRIVATE ImplAdjust(
573 BitmapEx& rBmpEx,
574 const GraphicAttr& rAttr,
575 GraphicAdjustmentFlags nAdjustmentFlags
577 static void SVT_DLLPRIVATE ImplAdjust(
578 GDIMetaFile& rMtf,
579 const GraphicAttr& rAttr,
580 GraphicAdjustmentFlags nAdjustmentFlags
582 static void SVT_DLLPRIVATE ImplAdjust(
583 Animation& rAnimation,
584 const GraphicAttr& rAttr,
585 GraphicAdjustmentFlags nAdjustmentFlags
588 static void SVT_DLLPRIVATE ImplDraw(
589 OutputDevice* pOut,
590 const Point& rPt,
591 const Size& rSz,
592 const GDIMetaFile& rMtf,
593 const GraphicAttr& rAttr
596 // Only used by GraphicObject's Ctor's and Dtor's
597 void SVT_DLLPRIVATE ImplRegisterObj(
598 const GraphicObject& rObj,
599 Graphic& rSubstitute,
600 const OString* pID = NULL,
601 const GraphicObject* pCopyObj = NULL
603 void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj );
604 inline bool SVT_DLLPRIVATE ImplHasObjects() const { return !maObjList.empty(); }
606 // Only used in swap case by GraphicObject
607 void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj );
608 void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj );
610 OString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const;
612 // This method allows to check memory footprint for all currently swapped in GraphicObjects on this GraphicManager
613 // which are based on Bitmaps. This is needed on 32Bit systems and only does something on those systems. The problem
614 // to solve is that normally the SwapOut is timer-driven, but even with short timer settings there are situations
615 // where this does not trigger - or in other words: A maximum limitation for GraphicManagers was not in place before.
616 // For 32Bit systems this leads to situations where graphics will be missing. This method will actively swap out
617 // the longest swapped in graphics until a maximum memory boundary (derived from user settings in tools/options/memory)
618 // is no longer exceeded
619 void SVT_DLLPRIVATE ImplCheckSizeOfSwappedInGraphics(const GraphicObject* pGraphicToIgnore);
620 public:
622 GraphicManager( sal_uLong nCacheSize = 10000000UL, sal_uLong nMaxObjCacheSize = 2400000UL );
623 ~GraphicManager();
625 void SetMaxCacheSize( sal_uLong nNewCacheSize );
626 sal_uLong GetMaxCacheSize() const;
628 void SetMaxObjCacheSize(
629 sal_uLong nNewMaxObjSize,
630 bool bDestroyGreaterCached = false
633 void SetCacheTimeout( sal_uLong nTimeoutSeconds );
635 bool IsInCache(
636 OutputDevice* pOut,
637 const Point& rPt,
638 const Size& rSz,
639 const GraphicObject& rObj,
640 const GraphicAttr& rAttr
641 ) const;
643 bool DrawObj(
644 OutputDevice* pOut,
645 const Point& rPt,
646 const Size& rSz,
647 GraphicObject& rObj,
648 const GraphicAttr& rAttr,
649 const GraphicManagerDrawFlags nFlags,
650 bool& rCached
654 #endif // INCLUDED_SVTOOLS_GRFMGR_HXX
656 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */