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
14 #ifndef __CICO_HOME_SCREEN_H__
15 #define __CICO_HOME_SCREEN_H__
18 #include <libwebsockets.h>
22 #include "ico_syc_common.h"
23 #include "ico_syc_winctl.h"
27 #include "CicoHomeScreenCommon.h"
29 #include "CicoGKeyFileConfig.h"
30 #include "CicoHSMenuWindow.h"
31 #include "CicoHSBackWindow.h"
32 #include "CicoHSControlBarWindow.h"
33 #include "CicoHSSwipeTouch.h"
34 #include "CicoHSWindowController.h"
35 #include "CicoHSAppInfo.h"
37 #include "CicoSystemConfig.h"
38 #include "CicoHSLifeCycleController.h"
39 #include "CicoHSAppHistory.h"
40 #include "CicoHSAppHistoryExt.h"
42 /* display position and size */
43 #define ICO_HS_WINDOW_POS_X 0
44 #define ICO_HS_WINDOW_POS_Y 0
45 #define ICO_HS_STATUSBAR_WINDOW_HEIGHT 64
46 #define ICO_HS_MENU_WINDOW_POS_X ICO_HS_WINDOW_POS_X
47 #define ICO_HS_MENU_WINDOW_POS_Y ICO_HS_STATUSBAR_WINDOW_HEIGHT
48 #define ICO_HS_CONTROLBAR_WINDOW_POS_X ICO_HS_WINDOW_POS_X
49 #define ICO_HS_CONTROLBAR_WINDOW_HEIGHT 128
52 #define ICO_HS_MODE_MENU 0
53 #define ICO_HS_MODE_APPLICATION 1
56 #define ICO_HS_SHOW_HIDE_PATTERN_SLIDE 0
57 #define ICO_HS_SHOW_HIDE_PATTERN_FADE 1
59 #define ICO_HS_CONFIG_HOMESCREEN "homescreen"
60 #define ICO_HS_CONFIG_ONSCREEN "onscreen"
61 #define ICO_HS_CONFIG_SOUND "sound"
62 #define ICO_HS_CONFIG_SB "statusbar"
63 #define ICO_HS_CONFIG_ONS "onscreen"
64 #define ICO_HS_APPID_DEFAULT_SB "org.tizen.ico.statusbar" /* default statusbar appid */
65 #define ICO_HS_APPID_DEFAULT_ONS "org.tizen.ico.onscreen" /* default on screen appid */
67 #define ICO_HS_GROUP_SPECIAL "menu"
69 #define ICO_HS_APP_STATUS_ERR -1
71 #define ICO_HS_CHANGE_ZONE_MAX 10
77 ~CicoHomeScreen(void);
78 static CicoHomeScreen* getInstance(void);
79 int Initialize(int orientation,CicoGKeyFileConfig *config);
80 void InitializeAppHistory(void);
83 void CreateMenuWindow(void);
84 void DeleteMenuWindow(void);
85 void UpDateMenuWindow(void);
86 void CreateBackWindow(void);
87 void DeleteBackWindow(void);
88 void UpDateBackWindow(void);
89 void CreateControlBarWindow(void);
90 void DeleteControlBarWindow(void);
91 void CreateSwipeInputWindow(void);
92 void DeleteSwipeInputWindow(void);
93 char *GetHsPackageName(void);
94 char *GetSbPackageName(void);
95 char *GetOsPackageName(void);
96 void ShowHomeScreenLayer(void);
97 void ShowHomeScreenWindow(ico_syc_win_info_t *win_info);
98 void ShowStatusBarWindow(ico_syc_win_info_t *win_info);
99 void ShowApplicationWindow(ico_syc_win_info_t *win_info);
100 void RaiseApplicationWindow(const char *appid,int surface);
101 static void ChangeMode(int pattern);
102 static void ExecuteApp(const char *appid);
103 static void TerminateApp(const char *appid);
104 static bool GetAppStatus(const char *appid);
105 void ChangeActive(const char *appid, int surface);
106 static void ChangeZone(void);
107 void requestChangeZone(CicoHSAppInfo* appinfo);
108 static CicoHSAppInfo *GetAppInfo(const char *appid);
109 void SetMode(int mode);
111 int StartHomeScreen(int orientation);
112 void UpdateTile(const char *appid);
113 static void RenewAppInfoList(void);
115 void setActiveApp(const char* appid);
116 // update current active application information
117 void SetActiveAppInfo(const char *appid);
118 CicoHSAppInfo* GetActiveAppInfo(void);
120 // update current sub displaye applicatin information
121 void SetSubDisplayAppInfo(const char *appid);
122 CicoHSAppInfo* GetSubDisplayAppInfo(void);
123 const char* GetSubDisplayAppid(void);
124 // order of the start-up window
125 void startupCheckAdd(int pid, const std::string& appid,
126 bool bSubDisp = false);
127 void startupCheck(const char* appid);
128 void finishStartup(void);
129 void readStartupApp(std::vector<pairAppidSubd>& apps);
130 void requestHideAppid(const std::string& app);
131 void requestShowAppid(const std::string& app);
132 void requestActivationAppid(const std::string& app);
133 void controlRegulation(bool regStt=true);
134 static bool ActivationUpdate(void);
135 bool ActivationUpdate_i(void);
136 static void ShowApp(const std::string& app);
137 static void HideApp(const std::string& app);
138 static void MoveApp(const std::string& app, const std::string& zone);
140 int GetProcessWindow(const char *appid);
141 static void EventCallBack(ico_syc_ev_e event,const void* detail,void* user_data);
142 void ExecuteApp_i(const char *appid);
143 void TerminateApp_i(const char *appid);
144 void CreateAppInfoList(void);
145 ico_hs_window_info *GetWindowInfo(CicoHSAppInfo* appinfo,const char *window);
146 ico_hs_window_info *GetWindowInfo(CicoHSAppInfo* appinfo,int surface);
148 static void SetNightMode(void* data);
149 static void SetRegulation(void* data);
151 void ShowApp_i(const std::string& app);
152 void RenewAppInfoList_i(void);
154 /*application control(do not use now)*/
156 CicoHSAppInfo *apps_info[ICO_HS_MAX_APP_NUM];
157 // current active application information
158 CicoHSAppInfo *active_appinfo;
160 CicoHSAppInfo *hs_app_info;
161 CicoHSAppInfo *sb_app_info;
162 CicoHSAppInfo *os_app_info;
164 int full_width,full_height;
165 int menu_width,menu_height;
166 int bg_width,bg_height;
167 int ctl_bar_width,ctl_bar_height;
169 char hs_package_name[ICO_HS_MAX_PROCESS_NAME];
170 char sb_package_name[ICO_HS_MAX_PROCESS_NAME];
171 char os_package_name[ICO_HS_MAX_PROCESS_NAME];
173 CicoHSMenuWindow* menu_window;
174 CicoHSBackWindow* back_window;
175 CicoHSControlBarWindow* ctl_bar_window;
176 int num_swipe_input_windows;
177 CicoHSSwipeInputWindow* swipe_input_windows[ICO_HS_MAX_SWIPEWINDOWS];
181 CicoGKeyFileConfig *config;
182 /*my instance for callback*/
183 static CicoHomeScreen *hs_instance;
185 CicoHSLifeCycleController* life_cycle_controller;
186 CicoHSAppHistoryExt* m_appHis;
188 // current sub display appinfo
189 CicoHSAppInfo *sub_display_appinfo;
192 // swith trigger zone rotation list
193 const char* moveZoneName;
195 // move zone animation information
196 ico_syc_animation_t moveZoneAnimation;
200 CicoHomeScreen operator=(const CicoHomeScreen&);
201 CicoHomeScreen(const CicoHomeScreen&);
204 // vim:set expandtab ts=4 sw=4: