0.9.21 release -- It changes so that the layer controlling function of GENIVI may...
[profile/ivi/ico-uxf-homescreen.git] / lib / system-controller / CicoSCWindowController.h
1 /*
2  * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9
10 //==========================================================================
11 /**
12  *  @file   CicoSCWindowController.h
13  *
14  *  @brief  This file is definition of CicoSCWindowController class
15  */
16 //==========================================================================
17 #ifndef __CICO_SC_WINDOW_CONTROLLER_H__
18 #define __CICO_SC_WINDOW_CONTROLLER_H__
19
20 #include <vector>
21 #include <map>
22
23 using namespace std;
24
25 #include "CicoSCWlWinMgrIF.h"
26
27 //==========================================================================
28 //  Forward declaration
29 //==========================================================================
30 class CicoSCCommand;
31 class CicoSCDisplay;
32 class CicoSCLayer;
33 class CicoSCDisplayZone;
34 class CicoSCWindow;
35 class CicoSCResourceManager;
36
37 //--------------------------------------------------------------------------
38 /**
39  *  @brief  This class is controller of window
40  */
41 //--------------------------------------------------------------------------
42 class CicoSCWindowController : public CicoSCWlWinMgrIF
43 {
44 public:
45     // get instance of CicoSCWindowController
46     static CicoSCWindowController* getInstance();
47
48     // default constructor
49     CicoSCWindowController();
50
51     // copy constructor
52     virtual ~CicoSCWindowController();
53
54     int initDB(void);
55
56     void handleCommand(const CicoSCCommand * cmd);
57
58     //
59     void setResourceManager(CicoSCResourceManager *resMgr);
60
61     int show(int         surfaceid,
62              const char  *animation,
63              int         animationTime);
64
65     int hide(int         surfaceid,
66              const char  *animation,
67              int         animationTime);
68
69     int resize(int        surfaceid,
70                int        w,
71                int        h,
72                const char *animation,
73                int        animationTime);
74
75     int move(int        surfaceid,
76              int        nodeid,
77              int        x,
78              int        y,
79              const char *animation,
80              int        animationTime);
81
82     int setGeometry(int        surfaceid,
83                     int        nodeid,
84                     int        layerid,
85                     int        x,
86                     int        y,
87                     int        w,
88                     int        h,
89                     const char *resizeAnimation,
90                     int        resizeAnimationTime,
91                     const char *moveAnimation,
92                     int        moveAnimationTime);
93
94     int setGeometry(int        surfaceid,
95                     const char *zone,
96                     int        layerid,
97                     const char *resizeAnimation,
98                     int        resizeAnimationTime,
99                     const char *moveAnimation,
100                     int        moveAnimationTime);
101
102     int raise(int surfaceid,
103              const char  *animation,
104              int         animationTime);
105
106     int lower(int surfaceid, const char *animation, int animationTime);
107
108     int setWindowLayer(int surfaceid, int layerid);
109
110     int showLayer(int displayid, int layerid);
111
112     int hideLayer(int displayid, int layerid);
113
114     int active(int surfaceid, int target);
115
116     int setmapGet(int surfaceid, const char *filepath);
117
118     int mapSurface(int surfaceid, int framerate, const char *filepath);
119
120     int unmapSurface(int surfaceid);
121
122     int getDisplayedWindow(int zoneid);
123
124     int setAttributes(int surfaceid);
125
126     static void initializeGeniviNotifications(void);
127
128     static void wlGeniviLayerNotification(t_ilm_layer layer,
129                                           struct ilmLayerProperties *LayerProperties,
130                                           t_ilm_notification_mask mask);
131
132     static void wlGeniviSurfaceNotification(t_ilm_surface surface,
133                                             struct ilmSurfaceProperties *SurfaceProperties,
134                                             t_ilm_notification_mask mask);
135     //
136     virtual void activeCB(void *data,
137                           struct ico_window_mgr *ico_window_mgr,
138                           uint32_t surfaceid,
139                           int32_t select);
140
141     virtual void mapSurfaceCB(void *data,
142                               struct ico_window_mgr *ico_window_mgr,
143                               int32_t event,
144                               uint32_t surfaceid,
145                               uint32_t type,
146                               int32_t width,
147                               int32_t height,
148                               int32_t stride,
149                               uint32_t format);
150
151     virtual void outputGeometryCB(void *data,
152                                   struct wl_output *wl_output,
153                                   int32_t x,
154                                   int32_t y,
155                                   int32_t physical_width,
156                                   int32_t physical_height,
157                                   int32_t subpixel,
158                                   const char *make,
159                                   const char *model,
160                                   int32_t transform);
161
162     virtual void outputModeCB(void *data,
163                               struct wl_output *wl_output,
164                               uint32_t flags,
165                               int32_t width,
166                               int32_t height,
167                               int32_t refresh);
168
169     virtual void createSurfaceCB(void           *data,
170                                  struct ivi_controller *ivi_controller,
171                                  uint32_t id_surface);
172
173 private:
174     // assignment operator
175     CicoSCWindowController& operator=(const CicoSCWindowController &object);
176
177     // copy constructor
178     CicoSCWindowController(const CicoSCWindowController &object);
179
180     // find window object by surface id
181     CicoSCWindow* findWindow(int surfaceid);
182
183     // find layer object by display id and layer id
184     CicoSCLayer* findLayer(int displayid, int layerid);
185
186     // fine display zone by id
187     const CicoSCDisplayZone * findDisplayZone(int zoneid);
188
189     int notifyResourceManager(int        surfaceid,
190                               const char *zone,
191                               int        layerid,
192                               const char *animation,
193                               int        animationTime);
194
195 private:
196     /// my instance
197     static CicoSCWindowController *ms_myInstance;
198
199     // resource manager instance
200     CicoSCResourceManager *m_resMgr;
201
202     // window object list
203     map<unsigned int, CicoSCWindow*> m_windowList;
204
205     // display object list
206     vector<CicoSCDisplay*> m_displayList;
207
208     // total of physical display
209     unsigned int m_physicalDisplayTotal;
210 };
211 #endif  // __CICO_SC_WINDOW_CONTROLLER_H__
212 // vim:set expandtab ts=4 sw=4: