5491c272de3ca81c82f61d265c11c36200848f1d
[profile/ivi/layer-management.git] / LayerManagerPlugins / Renderers / Graphic / include / PlatformSurfaces / XPlatformSurface.h
1 /***************************************************************************
2  *
3  * Copyright 2010,2011 BMW Car IT GmbH
4  *
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  ****************************************************************************/
19
20 #ifndef _XPLATFORMSURFACE_H_
21 #define _XPLATFORMSURFACE_H_
22
23 #include "PlatformSurface.h"
24 #include "Surface.h"
25 #include "X11/X.h"
26
27 class XPlatformSurface: public PlatformSurface
28 {
29 public:
30     XPlatformSurface(Surface* surface)
31     : PlatformSurface(surface)
32     , isMapped(false)
33     , pixmap(0)
34     , texture(0)
35     , m_isReadyForRendering(false)
36     {
37     }
38
39     ~XPlatformSurface()
40     {
41     }
42     
43     bool enableRendering()
44     {
45         m_isReadyForRendering = true;
46         return m_isReadyForRendering;
47     }
48
49     bool disableRendering()
50     {
51         m_isReadyForRendering = false;
52         return m_isReadyForRendering;
53     }
54
55     bool isReadyForRendering()
56     {
57         return true;        
58         /*return m_isReadyForRendering;*/
59     }
60     // TODO: private/protected
61     bool isMapped;
62     Pixmap pixmap;
63     uint texture;
64     bool m_isReadyForRendering;    
65 };
66
67 #endif /* _XPLATFORMSURFACE_H_ */