1*91c99ff4SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*91c99ff4SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*91c99ff4SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*91c99ff4SAndrew Rist  * distributed with this work for additional information
6*91c99ff4SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*91c99ff4SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*91c99ff4SAndrew Rist  * "License"); you may not use this file except in compliance
9*91c99ff4SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*91c99ff4SAndrew Rist  *
11*91c99ff4SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*91c99ff4SAndrew Rist  *
13*91c99ff4SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*91c99ff4SAndrew Rist  * software distributed under the License is distributed on an
15*91c99ff4SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*91c99ff4SAndrew Rist  * KIND, either express or implied.  See the License for the
17*91c99ff4SAndrew Rist  * specific language governing permissions and limitations
18*91c99ff4SAndrew Rist  * under the License.
19*91c99ff4SAndrew Rist  *
20*91c99ff4SAndrew Rist  *************************************************************/
21*91c99ff4SAndrew Rist 
22*91c99ff4SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _DXCANVAS_RENDERMODULE_HXX
25cdf0e10cSrcweir #define _DXCANVAS_RENDERMODULE_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <basegfx/vector/b2ivector.hxx>
28cdf0e10cSrcweir #include <basegfx/range/b2irectangle.hxx>
29cdf0e10cSrcweir #include <canvas/rendering/irendermodule.hxx>
30cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
31cdf0e10cSrcweir #include "dx_winstuff.hxx"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir class Window;
34cdf0e10cSrcweir namespace basegfx
35cdf0e10cSrcweir {
36cdf0e10cSrcweir     class B2IRange;
37cdf0e10cSrcweir     class B2DVector;
38cdf0e10cSrcweir }
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace dxcanvas
41cdf0e10cSrcweir {
42cdf0e10cSrcweir     /// Specialization of IRenderModule for DirectX
43cdf0e10cSrcweir     struct IDXRenderModule : public canvas::IRenderModule
44cdf0e10cSrcweir     {
45cdf0e10cSrcweir 		/** Flip front- and backbuffer, update only given area
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 			Note: Both update area and offset are ignored for
48cdf0e10cSrcweir 			fullscreen canvas, that uses page flipping (cannot, by
49cdf0e10cSrcweir 			definition, do anything else there except displaying the
50cdf0e10cSrcweir 			full backbuffer instead of the front buffer)
51cdf0e10cSrcweir 
52cdf0e10cSrcweir             @param rUpdateArea
53cdf0e10cSrcweir             Area to copy from backbuffer to front
54cdf0e10cSrcweir 
55cdf0e10cSrcweir             @param rCurrWindowArea
56cdf0e10cSrcweir             Current area of VCL window (coordinates relative to VCL
57cdf0e10cSrcweir             HWND)
58cdf0e10cSrcweir          */
59cdf0e10cSrcweir         virtual bool flip( const ::basegfx::B2IRectangle& rUpdateArea,
60cdf0e10cSrcweir 						   const ::basegfx::B2IRectangle& rCurrWindowArea ) = 0;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir         /** Resize backbuffer area for this render module
63cdf0e10cSrcweir          */
64cdf0e10cSrcweir         virtual void resize( const ::basegfx::B2IRange& rect ) = 0;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir         /// Write a snapshot of the screen to disk
67cdf0e10cSrcweir         virtual void screenShot() = 0;
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 		virtual COMReference<surface_type>
70cdf0e10cSrcweir 			createSystemMemorySurface(
71cdf0e10cSrcweir 				const ::basegfx::B2IVector& rSize ) = 0;
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 		virtual void disposing() = 0;
74cdf0e10cSrcweir 		virtual HWND getHWND() const = 0;
75cdf0e10cSrcweir     };
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     typedef ::boost::shared_ptr< IDXRenderModule > IDXRenderModuleSharedPtr;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     /** Factory method, to create an IRenderModule instance for the
81cdf0e10cSrcweir         given VCL window instance
82cdf0e10cSrcweir      */
83cdf0e10cSrcweir     IDXRenderModuleSharedPtr createRenderModule( const ::Window& rParent );
84cdf0e10cSrcweir }
85cdf0e10cSrcweir 
86cdf0e10cSrcweir #endif
87