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 _DXCANVAS_RENDERMODULE_HXX
29 #define _DXCANVAS_RENDERMODULE_HXX
30 
31 #include <basegfx/vector/b2ivector.hxx>
32 #include <basegfx/range/b2irectangle.hxx>
33 #include <canvas/rendering/irendermodule.hxx>
34 #include <boost/shared_ptr.hpp>
35 #include "dx_winstuff.hxx"
36 
37 class Window;
38 namespace basegfx
39 {
40     class B2IRange;
41     class B2DVector;
42 }
43 
44 namespace dxcanvas
45 {
46     /// Specialization of IRenderModule for DirectX
47     struct IDXRenderModule : public canvas::IRenderModule
48     {
49 		/** Flip front- and backbuffer, update only given area
50 
51 			Note: Both update area and offset are ignored for
52 			fullscreen canvas, that uses page flipping (cannot, by
53 			definition, do anything else there except displaying the
54 			full backbuffer instead of the front buffer)
55 
56             @param rUpdateArea
57             Area to copy from backbuffer to front
58 
59             @param rCurrWindowArea
60             Current area of VCL window (coordinates relative to VCL
61             HWND)
62          */
63         virtual bool flip( const ::basegfx::B2IRectangle& rUpdateArea,
64 						   const ::basegfx::B2IRectangle& rCurrWindowArea ) = 0;
65 
66         /** Resize backbuffer area for this render module
67          */
68         virtual void resize( const ::basegfx::B2IRange& rect ) = 0;
69 
70         /// Write a snapshot of the screen to disk
71         virtual void screenShot() = 0;
72 
73 		virtual COMReference<surface_type>
74 			createSystemMemorySurface(
75 				const ::basegfx::B2IVector& rSize ) = 0;
76 
77 		virtual void disposing() = 0;
78 		virtual HWND getHWND() const = 0;
79     };
80 
81     typedef ::boost::shared_ptr< IDXRenderModule > IDXRenderModuleSharedPtr;
82 
83 
84     /** Factory method, to create an IRenderModule instance for the
85         given VCL window instance
86      */
87     IDXRenderModuleSharedPtr createRenderModule( const ::Window& rParent );
88 }
89 
90 #endif
91