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