1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _VCLCANVAS_SPRITEDEVICEHELPER_HXX
25 #define _VCLCANVAS_SPRITEDEVICEHELPER_HXX
26 
27 #include <com/sun/star/awt/Rectangle.hpp>
28 #include <com/sun/star/awt/XWindow2.hpp>
29 #include <com/sun/star/rendering/XGraphicDevice.hpp>
30 #include <com/sun/star/rendering/XBufferController.hpp>
31 
32 #include <vcl/outdev.hxx>
33 #include <vcl/window.hxx>
34 
35 #include "backbuffer.hxx"
36 #include "devicehelper.hxx"
37 
38 #include <boost/utility.hpp>
39 
40 
41 /* Definition of DeviceHelper class */
42 
43 namespace vclcanvas
44 {
45     class SpriteCanvas;
46     class SpriteCanvasHelper;
47 
48     class SpriteDeviceHelper : public DeviceHelper
49     {
50     public:
51         SpriteDeviceHelper();
52 
53         void init( const OutDevProviderSharedPtr& rOutDev );
54 
55         /// Dispose all internal references
56         void disposing();
57 
58         ::sal_Int32 createBuffers( ::sal_Int32 nBuffers );
59         void 		destroyBuffers(  );
60         ::sal_Bool  showBuffer( bool bWindowVisible, ::sal_Bool bUpdateAll );
61         ::sal_Bool  switchBuffer( bool bWindowVisible, ::sal_Bool bUpdateAll );
62 
63         ::com::sun::star::uno::Any isAccelerated() const;
64         ::com::sun::star::uno::Any getDeviceHandle() const;
65         ::com::sun::star::uno::Any getSurfaceHandle() const;
66 
67         void dumpScreenContent() const;
getBackBuffer() const68         BackBufferSharedPtr getBackBuffer() const { return mpBackBuffer; }
69 
70         void notifySizeUpdate( const ::com::sun::star::awt::Rectangle& rBounds );
71 
72     private:
73         /// This buffer holds the background content for all associated canvases
74         BackBufferSharedPtr     mpBackBuffer;
75     };
76 }
77 
78 #endif /* _VCLCANVAS_SPRITEDEVICEHELPER_HXX */
79