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 _VCLCANVAS_SPRITEDEVICEHELPER_HXX
29 #define _VCLCANVAS_SPRITEDEVICEHELPER_HXX
30 
31 #include <com/sun/star/awt/Rectangle.hpp>
32 #include <com/sun/star/awt/XWindow2.hpp>
33 #include <com/sun/star/rendering/XGraphicDevice.hpp>
34 #include <com/sun/star/rendering/XBufferController.hpp>
35 
36 #include <vcl/outdev.hxx>
37 #include <vcl/window.hxx>
38 
39 #include "backbuffer.hxx"
40 #include "devicehelper.hxx"
41 
42 #include <boost/utility.hpp>
43 
44 
45 /* Definition of DeviceHelper class */
46 
47 namespace vclcanvas
48 {
49     class SpriteCanvas;
50     class SpriteCanvasHelper;
51 
52     class SpriteDeviceHelper : public DeviceHelper
53     {
54     public:
55         SpriteDeviceHelper();
56 
57         void init( const OutDevProviderSharedPtr& rOutDev );
58 
59         /// Dispose all internal references
60         void disposing();
61 
62         ::sal_Int32 createBuffers( ::sal_Int32 nBuffers );
63         void 		destroyBuffers(  );
64         ::sal_Bool  showBuffer( bool bWindowVisible, ::sal_Bool bUpdateAll );
65         ::sal_Bool  switchBuffer( bool bWindowVisible, ::sal_Bool bUpdateAll );
66 
67         ::com::sun::star::uno::Any isAccelerated() const;
68         ::com::sun::star::uno::Any getDeviceHandle() const;
69         ::com::sun::star::uno::Any getSurfaceHandle() const;
70 
71         void dumpScreenContent() const;
72         BackBufferSharedPtr getBackBuffer() const { return mpBackBuffer; }
73 
74         void notifySizeUpdate( const ::com::sun::star::awt::Rectangle& rBounds );
75 
76     private:
77         /// This buffer holds the background content for all associated canvases
78         BackBufferSharedPtr     mpBackBuffer;
79     };
80 }
81 
82 #endif /* _VCLCANVAS_SPRITEDEVICEHELPER_HXX */
83