LCOV - code coverage report
Current view: top level - libreoffice/svx/inc/svx/sdr/overlay - overlaymanagerbuffered.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 1 100.0 %
Date: 2012-12-27 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : #ifndef _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
      21             : #define _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
      22             : 
      23             : #include <svx/sdr/overlay/overlaymanager.hxx>
      24             : #include <basegfx/range/b2irange.hxx>
      25             : #include <vcl/virdev.hxx>
      26             : 
      27             : //////////////////////////////////////////////////////////////////////////////
      28             : 
      29             : namespace sdr
      30             : {
      31             :     namespace overlay
      32             :     {
      33             :         class OverlayManagerBuffered : public OverlayManager
      34             :         {
      35             :         protected:
      36             :             // The VirtualDevice for draw window content buffering, this
      37             :             // is the view content without overlay
      38             :             VirtualDevice                           maBufferDevice;
      39             : 
      40             :             // #i73602# The VirtualDevice for OverlayPaint buffering. This
      41             :             // is an extra device to avoid flickering of overlay paints
      42             :             VirtualDevice                           maOutputBufferDevice;
      43             : 
      44             :             // Timer for buffering
      45             :             Timer                                   maBufferTimer;
      46             : 
      47             :             // Range for buffering (in pixel to be independent from mapMode)
      48             :             basegfx::B2IRange                       maBufferRememberedRangePixel;
      49             : 
      50             :             // bitfield
      51             :             // Flag to decide if PreRendering shall be used for overlay refreshes.
      52             :             // Default is false.
      53             :             unsigned                                mbRefreshWithPreRendering : 1;
      54             : 
      55             :             // link for timer
      56             :             DECL_LINK(ImpBufferTimerHandler, AutoTimer*);
      57             : 
      58             :             // Internal methods for buffering
      59             :             void ImpPrepareBufferDevice();
      60             :             void ImpRestoreBackground() const ;
      61             :             void ImpRestoreBackground(const Region& rRegionPixel) const;
      62             :             void ImpSaveBackground(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L);
      63             : 
      64             :             // when handing over another OverlayManager at construction, the OverlayObjects
      65             :             // will be taken over from it. The new one will have added all OverlayObjects
      66             :             // while the handed over one will have none
      67             :             OverlayManagerBuffered(
      68             :                 OutputDevice& rOutputDevice,
      69             :                 OverlayManager* pOldOverlayManager,
      70             :                 bool bRefreshWithPreRendering);
      71             :             virtual ~OverlayManagerBuffered();
      72             : 
      73             :         public:
      74             :             static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice,
      75             :                 OverlayManager* pOldOverlayManager = 0, bool bRefreshWithPreRendering = false);
      76             : 
      77             :             // complete redraw
      78             :             virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L) const;
      79             : 
      80             :             // flush. Do buffered updates.
      81             :             virtual void flush();
      82             : 
      83             :             // #i68597# part of content gets copied, react on it
      84             :             virtual void copyArea(const Point& rDestPt, const Point& rSrcPt, const Size& rSrcSize);
      85             : 
      86             :             // restore part of background. Implemented form buffered versions only.
      87             :             virtual void restoreBackground(const Region& rRegion) const;
      88             : 
      89             :             // invalidate the given range at local OutputDevice
      90             :             virtual void invalidateRange(const basegfx::B2DRange& rRange);
      91             : 
      92             :             // access to RefreshWithPreRendering Flag
      93           3 :             bool DoRefreshWithPreRendering() const { return mbRefreshWithPreRendering; }
      94             :         };
      95             :     } // end of namespace overlay
      96             : } // end of namespace sdr
      97             : 
      98             : //////////////////////////////////////////////////////////////////////////////
      99             : 
     100             : #endif //_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
     101             : 
     102             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10