1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _DXCANVAS_RENDERMODULE_HXX
29*cdf0e10cSrcweir #define _DXCANVAS_RENDERMODULE_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <basegfx/vector/b2ivector.hxx>
32*cdf0e10cSrcweir #include <basegfx/range/b2irectangle.hxx>
33*cdf0e10cSrcweir #include <canvas/rendering/irendermodule.hxx>
34*cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
35*cdf0e10cSrcweir #include "dx_winstuff.hxx"
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir class Window;
38*cdf0e10cSrcweir namespace basegfx
39*cdf0e10cSrcweir {
40*cdf0e10cSrcweir     class B2IRange;
41*cdf0e10cSrcweir     class B2DVector;
42*cdf0e10cSrcweir }
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir namespace dxcanvas
45*cdf0e10cSrcweir {
46*cdf0e10cSrcweir     /// Specialization of IRenderModule for DirectX
47*cdf0e10cSrcweir     struct IDXRenderModule : public canvas::IRenderModule
48*cdf0e10cSrcweir     {
49*cdf0e10cSrcweir 		/** Flip front- and backbuffer, update only given area
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir 			Note: Both update area and offset are ignored for
52*cdf0e10cSrcweir 			fullscreen canvas, that uses page flipping (cannot, by
53*cdf0e10cSrcweir 			definition, do anything else there except displaying the
54*cdf0e10cSrcweir 			full backbuffer instead of the front buffer)
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir             @param rUpdateArea
57*cdf0e10cSrcweir             Area to copy from backbuffer to front
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir             @param rCurrWindowArea
60*cdf0e10cSrcweir             Current area of VCL window (coordinates relative to VCL
61*cdf0e10cSrcweir             HWND)
62*cdf0e10cSrcweir          */
63*cdf0e10cSrcweir         virtual bool flip( const ::basegfx::B2IRectangle& rUpdateArea,
64*cdf0e10cSrcweir 						   const ::basegfx::B2IRectangle& rCurrWindowArea ) = 0;
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir         /** Resize backbuffer area for this render module
67*cdf0e10cSrcweir          */
68*cdf0e10cSrcweir         virtual void resize( const ::basegfx::B2IRange& rect ) = 0;
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir         /// Write a snapshot of the screen to disk
71*cdf0e10cSrcweir         virtual void screenShot() = 0;
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir 		virtual COMReference<surface_type>
74*cdf0e10cSrcweir 			createSystemMemorySurface(
75*cdf0e10cSrcweir 				const ::basegfx::B2IVector& rSize ) = 0;
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir 		virtual void disposing() = 0;
78*cdf0e10cSrcweir 		virtual HWND getHWND() const = 0;
79*cdf0e10cSrcweir     };
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     typedef ::boost::shared_ptr< IDXRenderModule > IDXRenderModuleSharedPtr;
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir     /** Factory method, to create an IRenderModule instance for the
85*cdf0e10cSrcweir         given VCL window instance
86*cdf0e10cSrcweir      */
87*cdf0e10cSrcweir     IDXRenderModuleSharedPtr createRenderModule( const ::Window& rParent );
88*cdf0e10cSrcweir }
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir #endif
91