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