Branch libreoffice-5-0-4
[LibreOffice.git] / canvas / source / directx / dx_rendermodule.hxx
blob6a61a64b09dc218d1e9dce19568a106ffadc14a4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_CANVAS_SOURCE_DIRECTX_DX_RENDERMODULE_HXX
21 #define INCLUDED_CANVAS_SOURCE_DIRECTX_DX_RENDERMODULE_HXX
23 #include <basegfx/vector/b2ivector.hxx>
24 #include <basegfx/range/b2irectangle.hxx>
25 #include <canvas/rendering/irendermodule.hxx>
26 #include <boost/shared_ptr.hpp>
27 #include "dx_winstuff.hxx"
29 namespace vcl { class Window; }
30 namespace basegfx
32 class B2IRange;
35 namespace dxcanvas
37 /// Specialization of IRenderModule for DirectX
38 struct IDXRenderModule : public canvas::IRenderModule
40 /** Flip front- and backbuffer, update only given area
42 Note: Both update area and offset are ignored for
43 fullscreen canvas, that uses page flipping (cannot, by
44 definition, do anything else there except displaying the
45 full backbuffer instead of the front buffer)
47 @param rUpdateArea
48 Area to copy from backbuffer to front
50 @param rCurrWindowArea
51 Current area of VCL window (coordinates relative to VCL
52 HWND)
54 virtual bool flip( const ::basegfx::B2IRectangle& rUpdateArea,
55 const ::basegfx::B2IRectangle& rCurrWindowArea ) = 0;
57 /** Resize backbuffer area for this render module
59 virtual void resize( const ::basegfx::B2IRange& rect ) = 0;
61 /// Write a snapshot of the screen to disk
62 virtual void screenShot() = 0;
64 virtual COMReference<surface_type>
65 createSystemMemorySurface(
66 const ::basegfx::B2IVector& rSize ) = 0;
68 virtual void disposing() = 0;
69 virtual HWND getHWND() const = 0;
72 typedef ::boost::shared_ptr< IDXRenderModule > IDXRenderModuleSharedPtr;
75 /** Factory method, to create an IRenderModule instance for the
76 given VCL window instance
78 IDXRenderModuleSharedPtr createRenderModule( const vcl::Window& rParent );
81 #endif
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */