1*c45d927aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*c45d927aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*c45d927aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*c45d927aSAndrew Rist * distributed with this work for additional information 6*c45d927aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*c45d927aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*c45d927aSAndrew Rist * "License"); you may not use this file except in compliance 9*c45d927aSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*c45d927aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*c45d927aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*c45d927aSAndrew Rist * software distributed under the License is distributed on an 15*c45d927aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*c45d927aSAndrew Rist * KIND, either express or implied. See the License for the 17*c45d927aSAndrew Rist * specific language governing permissions and limitations 18*c45d927aSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*c45d927aSAndrew Rist *************************************************************/ 21*c45d927aSAndrew Rist 22*c45d927aSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SD_SLIDESORTER_VIEW_LAYERED_DEVICE_HXX 25cdf0e10cSrcweir #define SD_SLIDESORTER_VIEW_LAYERED_DEVICE_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "view/SlsILayerPainter.hxx" 28cdf0e10cSrcweir #include "SlideSorter.hxx" 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include <tools/gen.hxx> 31cdf0e10cSrcweir #include <vcl/region.hxx> 32cdf0e10cSrcweir #include <vcl/virdev.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <boost/noncopyable.hpp> 35cdf0e10cSrcweir #include <boost/scoped_ptr.hpp> 36cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 37cdf0e10cSrcweir #include <boost/enable_shared_from_this.hpp> 38cdf0e10cSrcweir #include <vector> 39cdf0e10cSrcweir 40cdf0e10cSrcweir class Window; 41cdf0e10cSrcweir 42cdf0e10cSrcweir namespace sd { namespace slidesorter { namespace view { 43cdf0e10cSrcweir 44cdf0e10cSrcweir /** A simple wrapper around an OutputDevice that provides support for 45cdf0e10cSrcweir independent layers and buffering. 46cdf0e10cSrcweir Each layer may contain any number of painters. 47cdf0e10cSrcweir */ 48cdf0e10cSrcweir class LayeredDevice 49cdf0e10cSrcweir : public ::boost::enable_shared_from_this<LayeredDevice> 50cdf0e10cSrcweir 51cdf0e10cSrcweir { 52cdf0e10cSrcweir public: 53cdf0e10cSrcweir LayeredDevice (const SharedSdWindow& rpTargetWindow); 54cdf0e10cSrcweir ~LayeredDevice (void); 55cdf0e10cSrcweir 56cdf0e10cSrcweir void Invalidate ( 57cdf0e10cSrcweir const Rectangle& rInvalidationBox, 58cdf0e10cSrcweir const sal_Int32 nLayer); 59cdf0e10cSrcweir void InvalidateAllLayers ( 60cdf0e10cSrcweir const Rectangle& rInvalidationBox); 61cdf0e10cSrcweir void InvalidateAllLayers ( 62cdf0e10cSrcweir const Region& rInvalidationRegion); 63cdf0e10cSrcweir 64cdf0e10cSrcweir void RegisterPainter ( 65cdf0e10cSrcweir const SharedILayerPainter& rPainter, 66cdf0e10cSrcweir const sal_Int32 nLayer); 67cdf0e10cSrcweir 68cdf0e10cSrcweir void RemovePainter ( 69cdf0e10cSrcweir const SharedILayerPainter& rPainter, 70cdf0e10cSrcweir const sal_Int32 nLayer); 71cdf0e10cSrcweir 72cdf0e10cSrcweir bool HasPainter (const sal_Int32 nLayer); 73cdf0e10cSrcweir 74cdf0e10cSrcweir bool HandleMapModeChange (void); 75cdf0e10cSrcweir void Repaint (const Region& rRepaintRegion); 76cdf0e10cSrcweir 77cdf0e10cSrcweir void Resize (void); 78cdf0e10cSrcweir 79cdf0e10cSrcweir void Dispose (void); 80cdf0e10cSrcweir 81cdf0e10cSrcweir private: 82cdf0e10cSrcweir SharedSdWindow mpTargetWindow; 83cdf0e10cSrcweir class LayerContainer; 84cdf0e10cSrcweir ::boost::scoped_ptr<LayerContainer> mpLayers; 85cdf0e10cSrcweir ::boost::scoped_ptr<VirtualDevice> mpBackBuffer; 86cdf0e10cSrcweir MapMode maSavedMapMode; 87cdf0e10cSrcweir 88cdf0e10cSrcweir void RepaintRectangle (const Rectangle& rRepaintRectangle); 89cdf0e10cSrcweir }; 90cdf0e10cSrcweir 91cdf0e10cSrcweir 92cdf0e10cSrcweir 93cdf0e10cSrcweir } } } // end of namespace ::sd::slidesorter::view 94cdf0e10cSrcweir 95cdf0e10cSrcweir #endif 96