1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX 29 #define _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX 30 31 #include <svx/sdr/overlay/overlaymanager.hxx> 32 #include <basegfx/range/b2irange.hxx> 33 #include <vcl/virdev.hxx> 34 35 ////////////////////////////////////////////////////////////////////////////// 36 // predeclarations 37 38 class VirtualDevice; 39 40 ////////////////////////////////////////////////////////////////////////////// 41 42 namespace sdr 43 { 44 namespace overlay 45 { 46 class OverlayManagerBuffered : public OverlayManager 47 { 48 protected: 49 // The VirtualDevice for draw window content buffering, this 50 // is the view content without overlay 51 VirtualDevice maBufferDevice; 52 53 // #i73602# The VirtualDevice for OverlayPaint buffering. This 54 // is an extra device to avoid flickering of overlay paints 55 VirtualDevice maOutputBufferDevice; 56 57 // Timer for buffering 58 Timer maBufferTimer; 59 60 // Range for buffering (in pixel to be independent from mapMode) 61 basegfx::B2IRange maBufferRememberedRangePixel; 62 63 // bitfield 64 // Flag to decide if PreRendering shall be used for overlay refreshes. 65 // Default is false. 66 unsigned mbRefreshWithPreRendering : 1; 67 68 // link for timer 69 DECL_LINK(ImpBufferTimerHandler, AutoTimer*); 70 71 // Internal methods for buffering 72 void ImpPrepareBufferDevice(); 73 void ImpRestoreBackground() const ; 74 void ImpRestoreBackground(const Region& rRegionPixel) const; 75 void ImpSaveBackground(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L); 76 77 public: 78 // when handing over another OverlayManager at construction, the OverlayObjects 79 // will be taken over from it. The new one will have added all OverlayObjects 80 // while the handed over one will have none 81 OverlayManagerBuffered( 82 OutputDevice& rOutputDevice, 83 OverlayManager* pOldOverlayManager = 0, 84 bool bRefreshWithPreRendering = false); 85 virtual ~OverlayManagerBuffered(); 86 87 // complete redraw 88 virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L) const; 89 90 // flush. Do buffered updates. 91 virtual void flush(); 92 93 // #i68597# part of content gets copied, react on it 94 virtual void copyArea(const Point& rDestPt, const Point& rSrcPt, const Size& rSrcSize); 95 96 // restore part of background. Implemented form buffered versions only. 97 virtual void restoreBackground(const Region& rRegion) const; 98 99 // invalidate the given range at local OutputDevice 100 virtual void invalidateRange(const basegfx::B2DRange& rRange); 101 102 // access to RefreshWithPreRendering Flag 103 bool DoRefreshWithPreRendering() const { return mbRefreshWithPreRendering; } 104 void SetRefreshWithPreRendering(bool bNew); 105 }; 106 } // end of namespace overlay 107 } // end of namespace sdr 108 109 ////////////////////////////////////////////////////////////////////////////// 110 111 #endif //_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX 112 113 // eof 114