4c8965ece46b34beaa594966bf66bb210a67dda1
[profile/ivi/layer-management.git] / LayerManagerPlugins / Renderers / Graphic / include / WindowSystems / BaseWindowSystem.h
1 /***************************************************************************
2  *
3  * Copyright 2010,2011 BMW Car IT GmbH
4  * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * 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, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ****************************************************************************/
20
21 #ifndef _BASEWINDOWSYSTEM_H_
22 #define _BASEWINDOWSYSTEM_H_
23
24 #include "Scene.h"
25
26 class BaseWindowSystem
27 {
28 public:
29     BaseWindowSystem(Scene* pScene, InputManager* pInputManager)
30
31     : m_pInputManager(pInputManager)
32     , m_pScene(pScene)
33     , m_damaged(false)
34     , m_forceComposition(false)
35     {
36     }
37
38     virtual ~BaseWindowSystem()
39     {
40     }
41
42     virtual bool start(int maxIterationDurationInMS) = 0;
43     virtual void stop() = 0;
44     virtual void allocatePlatformSurface(Surface *surface) = 0;
45     virtual void doScreenShot(std::string fileName, const uint screen_id) = 0;
46     virtual void doScreenShotOfLayer(std::string fileName, const uint id) = 0;
47     virtual void doScreenShotOfSurface(std::string fileName, const uint id, const uint layer_id) = 0;
48     virtual void finishFrame() { }
49
50 protected:
51     virtual void ClearDamage();
52     InputManager* m_pInputManager;
53
54 public:
55     Scene* m_pScene;
56     bool m_damaged;
57     bool m_forceComposition;
58 };
59
60 #endif /* _BASEWINDOWSYSTEM_H_ */