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 INCLUDED_CANVAS_ISURFACE_HXX 29 #define INCLUDED_CANVAS_ISURFACE_HXX 30 31 #include <sal/types.h> 32 33 #include <boost/shared_ptr.hpp> 34 35 36 namespace basegfx 37 { 38 class B2IRange; 39 class B2IPoint; 40 class B2IVector; 41 } 42 43 namespace canvas 44 { 45 struct IColorBuffer; 46 47 struct ISurface 48 { 49 virtual ~ISurface() {} 50 51 /** Select texture behind this interface to be the current one 52 for primitive output. 53 */ 54 virtual bool selectTexture() = 0; 55 56 /** Tells wether the surface is valid or not 57 */ 58 virtual bool isValid() = 0; 59 60 /** Update surface content from given IColorBuffer 61 62 This method updates the given subarea of the surface from 63 the given color buffer bits. 64 65 @param rDestPos 66 Position in the surface, where the subset update should 67 have its left, top edge 68 69 @param rSourceRect 70 Size and position of the rectangular subset update in the 71 source color buffer 72 73 @param rSource 74 Source bits to use for the update 75 76 @return true, if the update was successful 77 */ 78 virtual bool update( const ::basegfx::B2IPoint& rDestPos, 79 const ::basegfx::B2IRange& rSourceRect, 80 IColorBuffer& rSource ) = 0; 81 82 virtual ::basegfx::B2IVector getSize() = 0; 83 }; 84 85 typedef ::boost::shared_ptr< ISurface > ISurfaceSharedPtr; 86 } 87 88 #endif /* INCLUDED_CANVAS_ISURFACE_HXX */ 89