2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
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
10 //==========================================================================
12 * @file CicoSCWindowController.h
14 * @brief This file is definition of CicoSCWindowController class
16 //==========================================================================
17 #ifndef __CICO_SC_WINDOW_CONTROLLER_H__
18 #define __CICO_SC_WINDOW_CONTROLLER_H__
22 #include "ico_syc_private.h"
26 #include "CicoSCWlWinMgrIF.h"
28 #define ICO_SC_APPID_DEFAULT_ONS "org.tizen.ico.onscreen"
29 #define ICO_SC_LAYERID_SCREENBASE 1000
31 #define ICO_SC_WINCHK_TIMER_BASE 20 /* window check timer cycle(ms) */
32 #define ICO_SC_WINCHK_TIMER_BASE_L 50 /* window check timer slow cycle(ms)*/
33 #define ICO_SC_WINCHK_ANIMATION_TIME 20 /* window check timer cycle(ms) */
34 #define ICO_SC_WINCHK_CONTENTS_TIME 1000 /* window contents check time(ms) */
36 #define ICO_SC_WINCHK_CONTENTS_CHECK 101
37 #define ICO_SC_WINCHK_ANIMA_FADE 201
38 #define ICO_SC_WINCHK_ANIMA_SLIDETOTOP 211
39 #define ICO_SC_WINCHK_ANIMA_SLIDETOBUTTOM 212
40 #define ICO_SC_WINCHK_ANIMA_SLIDETOLEFT 213
41 #define ICO_SC_WINCHK_ANIMA_SLIDETORIGHT 214
43 #define ICO_SC_WINANIMA_SHOW 1
44 #define ICO_SC_WINANIMA_HIDE 2
46 #define ICO_SC_WINCONT_CHECK 1
47 #define ICO_SC_WINCONT_WAITFILE 2
49 #define ICO_SC_WINCHK_MAP_SURFACE_EVENT_MAP 1
50 #define ICO_SC_WINCHK_MAP_SURFACE_EVENT_UNMAP 2
51 #define ICO_SC_WINCHK_MAP_SURFACE_EVENT_CONTENTS 3
53 struct ico_sc_win_check_t {
54 struct ico_sc_win_check_t *next;
77 char path[ICO_SYC_MAX_LEN];
82 //==========================================================================
83 // Forward declaration
84 //==========================================================================
88 class CicoSCDisplayZone;
90 class CicoSCResourceManager;
92 //--------------------------------------------------------------------------
94 * @brief This class is controller of window
96 //--------------------------------------------------------------------------
97 class CicoSCWindowController : public CicoSCWlWinMgrIF
100 // get instance of CicoSCWindowController
101 static CicoSCWindowController* getInstance();
103 // default constructor
104 CicoSCWindowController();
107 virtual ~CicoSCWindowController();
111 void handleCommand(const CicoSCCommand * cmd);
114 void setResourceManager(CicoSCResourceManager *resMgr);
116 int show(int surfaceid,
117 const char *animation,
120 int hide(int surfaceid,
121 const char *animation,
124 int resize(int surfaceid,
127 const char *animation,
130 int move(int surfaceid,
134 const char *animation,
137 int setGeometry(int surfaceid,
144 const char *resizeAnimation,
145 int resizeAnimationTime,
146 const char *moveAnimation,
147 int moveAnimationTime);
149 int setGeometry(int surfaceid,
152 const char *resizeAnimation,
153 int resizeAnimationTime,
154 const char *moveAnimation,
155 int moveAnimationTime);
157 int raise(int surfaceid,
158 const char *animation,
161 int lower(int surfaceid, const char *animation, int animationTime);
163 int setWindowLayer(int surfaceid, int layerid);
165 int showLayer(int displayid, int layerid);
167 int hideLayer(int displayid, int layerid);
169 int active(int surfaceid, int target);
171 int setmapGet(int surfaceid, const char *filepath);
173 int mapSurface(int surfaceid, int framerate, const char *filepath);
175 int unmapSurface(int surfaceid);
177 int getDisplayedWindow(int zoneid);
179 int setAttributes(int surfaceid);
181 void initializeGeniviLMS(void);
183 static void wlGeniviLayerNotification(t_ilm_layer layer,
184 struct ilmLayerProperties *LayerProperties,
185 t_ilm_notification_mask mask);
187 virtual void activeCB(void *data,
191 virtual void mapSurfaceCB(int32_t event,
199 static void wlGeniviSurfaceNotification(t_ilm_surface surfaceid,
200 struct ilmSurfaceProperties *surfprop,
201 t_ilm_notification_mask mask);
203 virtual void updateSurfaceCB(uint32_t surfaceid,
204 struct ilmSurfaceProperties *surfprop);
206 virtual void destroySurfaceCB(uint32_t surfaceid);
208 virtual void updateWinnameCB(uint32_t surfaceid,
209 const char *winname);
211 virtual void outputGeometryCB(void *data,
212 struct wl_output *wl_output,
215 int32_t physical_width,
216 int32_t physical_height,
222 virtual void outputModeCB(void *data,
223 struct wl_output *wl_output,
229 virtual void createSurfaceCB(void *data,
230 struct ivi_controller *ivi_controller,
231 uint32_t id_surface);
233 const CicoSCWindow* findWindowObj(int32_t pid, uint32_t surfaceid) const;
235 const CicoSCResourceManager* getResourceManager(void) const;
238 // assignment operator
239 CicoSCWindowController& operator=(const CicoSCWindowController &object);
242 CicoSCWindowController(const CicoSCWindowController &object);
244 // find window object by surface id
245 CicoSCWindow* findWindow(int surfaceid);
247 // find layer object by display id and layer id
248 CicoSCLayer* findLayer(int displayid, int layerid);
250 // fine display zone by id
251 const CicoSCDisplayZone * findDisplayZone(int zoneid);
253 void raiselower(CicoSCWindow *window, bool raise);
255 int notifyResourceManager(int surfaceid,
258 const char *animation,
262 void windowCheckerRemove(uint32_t surfaceid);
264 void setWindowAnimation(CicoSCWindow *window, int show,
265 const char *animation, int time);
267 void resetWindowAnimation(CicoSCWindow *window);
269 void setWindowMap(CicoSCWindow *window, int framerate, const char *filepath);
271 void resetWindowMap(uint32_t surfaceid);
274 static Eina_Bool ico_SCWindowChecker(void *data);
278 static CicoSCWindowController *ms_myInstance;
280 // resource manager instance
281 CicoSCResourceManager *m_resMgr;
283 // window object list
284 map<unsigned int, CicoSCWindow*> m_windowList;
286 // display object list
287 vector<CicoSCDisplay*> m_displayList;
289 // total of physical display
290 unsigned int m_physicalDisplayTotal;
293 // window check timer
294 static struct ico_sc_win_check_t *win_check_timer;
295 static struct ico_sc_win_check_t *win_check_free;
297 #endif // __CICO_SC_WINDOW_CONTROLLER_H__
298 // vim:set expandtab ts=4 sw=4: