From 58e229f282cd6d3da7e7c56d18e95d23b569abc9 Mon Sep 17 00:00:00 2001 From: Masayuki Sasaki Date: Thu, 26 Dec 2013 14:05:40 +0900 Subject: [PATCH] bug fix: TIVI-1997, TIVI-2161, An action is inaccurate when the menu of HomeScreen is multi-touched. And revise: add manifest file for SMACK label setting. Change-Id: Ie0f68281105ba1a6b77f28a985ebed05095860a3 Signed-off-by: Masayuki Sasaki --- configure.ac | 4 +- .../lib/systemd/user/ico-system-controller.service | 2 +- data/share/packages/org.tizen.ico.homescreen.xml | 2 +- data/share/packages/org.tizen.ico.statusbar.xml | 2 +- .../packages/org.tizen.ico.system-controller.xml | 2 +- ico-uxf-homescreen.manifest | 8 + include/ico_syc_msg_cmd_def.h | 10 +- include/ico_syc_type.h | 2 +- lib/Makefile.am | 1 + lib/apps-framework/ico_syc_winctl.c | 2 + .../CicoSCAilItems.cpp => common/CicoAilItems.cpp} | 84 +- .../CicoSCAilItems.h => common/CicoAilItems.h} | 19 +- .../CicoSCAulItems.cpp => common/CicoAulItems.cpp} | 69 +- .../CicoSCAulItems.h => common/CicoAulItems.h} | 33 +- .../CicoSCCommonDef.h => common/CicoCommonDef.h} | 29 +- .../CicoSCConf.h => common/CicoConf.h} | 139 +- lib/common/CicoEFLApp.cpp | 571 ++++++ lib/common/CicoEFLApp.h | 141 ++ .../common/CicoGKeyFileConfig.cpp | 63 +- .../common/CicoGKeyFileConfig.h | 24 +- lib/common/CicoLibString.cpp | 62 + lib/common/CicoLibString.h | 37 + .../common/CicoResourceConfig.cpp | 72 +- .../common/CicoResourceConfig.h | 42 +- {src/homescreen => lib/common}/CicoSound.cpp | 55 +- {src/homescreen => lib/common}/CicoSound.h | 10 +- .../CicoSystemConfig.cpp} | 379 ++-- .../CicoSystemConfig.h} | 34 +- .../common}/Cico_aul_listen_app.cpp | 1 + .../Cico_aul_listen_app.h | 1 + lib/common/Makefile.am | 49 + .../CicoSCAppResourceController.cpp | 446 +++++ .../CicoSCAppResourceController.h | 71 + lib/system-controller/CicoSCCommand.cpp | 8 +- lib/system-controller/CicoSCCommand.h | 8 +- lib/system-controller/CicoSCDisplay.cpp | 6 +- lib/system-controller/CicoSCInputController.cpp | 48 +- lib/system-controller/CicoSCLayer.h | 2 +- .../CicoSCLifeCycleController.cpp | 139 +- lib/system-controller/CicoSCLifeCycleController.h | 37 +- lib/system-controller/CicoSCMessage.cpp | 10 +- lib/system-controller/CicoSCMessage.h | 1 + lib/system-controller/CicoSCPolicyDef.h | 37 + lib/system-controller/CicoSCPolicyManager.cpp | 651 ++----- lib/system-controller/CicoSCPolicyManager.h | 41 +- lib/system-controller/CicoSCResourceManager.cpp | 348 ++-- lib/system-controller/CicoSCServer.cpp | 193 ++- lib/system-controller/CicoSCServer.h | 9 + .../CicoSCSysResourceController.cpp | 132 +- .../CicoSCSysResourceController.h | 14 +- lib/system-controller/CicoSCUserManager.cpp | 165 +- lib/system-controller/CicoSCUserManager.h | 39 +- lib/system-controller/CicoSCVInfo.h | 113 ++ lib/system-controller/CicoSCVInfoManager.cpp | 505 ++++++ lib/system-controller/CicoSCVInfoManager.h | 117 ++ lib/system-controller/CicoSCWayland.cpp | 24 +- lib/system-controller/CicoSCWayland.h | 2 +- lib/system-controller/CicoSCWindow.cpp | 8 +- lib/system-controller/CicoSCWindowController.cpp | 281 +-- lib/system-controller/CicoSCWindowController.h | 3 + lib/system-controller/CicoSCWlInputMgrIF.cpp | 41 +- lib/system-controller/CicoSCWlWinMgrIF.cpp | 65 +- lib/system-controller/Cico_aul_listen_app.cpp | 101 -- lib/system-controller/Makefile.am | 8 +- lib/system-controller/ico_syc_mrp_resource.c | 34 +- .../ico_syc_mrp_resource_private.h | 4 +- packaging/ico-uxf-homescreen.changes | 7 + packaging/ico-uxf-homescreen.spec | 21 +- .../res/config/homescreen.conf | 139 +- .../res/config}/onscreen.conf | 0 .../res/config}/statusbar.conf | 4 +- .../res/images/time_0.png | Bin .../res/images/time_1.png | Bin .../res/images/time_2.png | Bin .../res/images/time_3.png | Bin .../res/images/time_4.png | Bin .../res/images/time_5.png | Bin .../res/images/time_6.png | Bin .../res/images/time_7.png | Bin .../res/images/time_8.png | Bin .../res/images/time_9.png | Bin .../res/images/time_am.png | Bin .../res/images/time_pm.png | Bin .../res/images/time_ten.png | Bin .../res/config/policy.json | 1686 +++++++++++------- .../res/config/system-controller.xml | 25 + .../res/config/system.xml | 51 +- .../res/config/system_sysres.json | 28 + src/Makefile.am | 7 +- src/homescreen/CicoHSAppControl.cpp | 351 ++++ src/homescreen/CicoHSAppControl.h | 80 + src/homescreen/CicoHSAppHistory.cpp | 3 +- src/homescreen/CicoHSAppHistory.h | 1 + src/homescreen/CicoHSAppHistoryExt.cpp | 5 +- src/homescreen/CicoHSAppHistoryExt.h | 2 +- src/homescreen/CicoHSAppInfo.cpp | 13 +- src/homescreen/CicoHSAppInfo.h | 4 +- src/homescreen/CicoHSBackWindow.cpp | 7 +- src/homescreen/CicoHSBackWindow.h | 4 +- src/homescreen/CicoHSCmdOpts.cpp | 163 ++ src/homescreen/CicoHSCmdOpts.h | 75 + src/homescreen/CicoHSCommand.cpp | 334 ++++ src/homescreen/CicoHSCommand.h | 118 ++ src/homescreen/CicoHSCommandArg.cpp | 90 + src/homescreen/CicoHSCommandArg.h | 52 + src/homescreen/CicoHSControlBarTouch.cpp | 26 +- src/homescreen/CicoHSControlBarTouch.h | 9 +- src/homescreen/CicoHSControlBarWindow.cpp | 34 +- src/homescreen/CicoHSControlBarWindow.h | 16 +- src/homescreen/CicoHSEFLApp.cpp | 163 ++ src/homescreen/CicoHSEFLApp.h | 67 + ...ontroller.cpp => CicoHSLifeCycleController.cpp} | 160 +- ...cleController.h => CicoHSLifeCycleController.h} | 55 +- src/homescreen/CicoHSMenuTile.cpp | 23 +- src/homescreen/CicoHSMenuTile.h | 1 + src/homescreen/CicoHSMenuTouch.cpp | 134 +- src/homescreen/CicoHSMenuTouch.h | 4 +- src/homescreen/CicoHSMenuWindow.cpp | 45 +- src/homescreen/CicoHSMenuWindow.h | 10 +- src/homescreen/CicoHSMessage.cpp | 284 +++ src/homescreen/CicoHSMessage.h | 108 ++ src/homescreen/CicoHSServer.cpp | 684 ++++++++ src/homescreen/CicoHSServer.h | 137 ++ src/homescreen/CicoHSSwipeInputWindow.h | 2 +- src/homescreen/CicoHSSwipeTouch.cpp | 119 +- src/homescreen/CicoHSSwipeTouch.h | 5 +- src/homescreen/CicoHSWindow.cpp | 3 +- src/homescreen/CicoHSWindow.h | 2 +- src/homescreen/CicoHSWindowController.cpp | 38 +- src/homescreen/CicoHSWindowController.h | 5 +- src/homescreen/CicoHomeScreen.cpp | 477 +++-- src/homescreen/CicoHomeScreen.h | 28 +- src/homescreen/CicoHomeScreenCommon.h | 1 + src/homescreen/CicoHomeScreenSound.cpp | 188 -- src/homescreen/CicoHomeScreenSound.h | 59 - src/homescreen/CicoHomeScreenSoundConfig.cpp | 107 -- src/homescreen/CicoHomeScreenSoundConfig.h | 48 - src/homescreen/CicoLog.cpp | 245 --- src/homescreen/CicoLog.h | 23 - src/homescreen/CicoSCAilItems.cpp | 770 --------- src/homescreen/CicoSCAilItems.h | 110 -- src/homescreen/CicoSCAulItems.cpp | 206 --- src/homescreen/CicoSCAulItems.h | 58 - src/homescreen/CicoSCCommonDef.h | 44 - src/homescreen/CicoSCConf.h | 581 ------- src/homescreen/CicoSCSystemConfig.cpp | 1813 -------------------- src/homescreen/CicoSCSystemConfig.h | 181 -- src/homescreen/Cico_aul_listen_app.h | 21 - src/homescreen/Makefile.am | 174 +- src/homescreen/home_screen_main.cpp | 286 ++- src/homescreen/home_screen_main.h | 26 - src/homescreen/home_screen_res.h | 5 +- .../CicoOnScreenAction.cpp | 10 +- src/{homescreen => onscreen}/CicoOnScreenAction.h | 0 .../CicoOnScreenAppList.cpp | 8 +- src/{homescreen => onscreen}/CicoOnScreenAppList.h | 0 .../CicoOnScreenContext.cpp | 0 src/{homescreen => onscreen}/CicoOnScreenContext.h | 0 .../CicoOnScreenControlWindow.cpp | 0 .../CicoOnScreenControlWindow.h | 0 src/onscreen/Makefile.am | 72 + src/{homescreen => onscreen}/on_screen.cpp | 0 src/{homescreen => onscreen}/on_screen.h | 0 src/statusbar/CicoSBConfigDef.h | 24 + src/statusbar/CicoSBResourceDef.h | 37 + .../CicoStatusBarControlWindow.cpp | 20 +- .../CicoStatusBarControlWindow.h | 12 +- .../CicoStatusBarTime.cpp | 2 +- src/{homescreen => statusbar}/CicoStatusBarTime.h | 3 +- src/statusbar/Makefile.am | 60 + src/{homescreen => statusbar}/status_bar.cpp | 33 +- src/{homescreen => statusbar}/status_bar.h | 10 +- src/syscond/CicoEFLApp.cpp | 320 ---- src/syscond/CicoEFLApp.h | 83 - src/syscond/CicoSysConDaemon.cpp | 137 +- src/syscond/CicoSysConDaemon.h | 83 +- src/syscond/CicoSysConLogConfig.cpp | 280 +++ src/syscond/CicoSysConLogConfig.h | 118 ++ src/syscond/Makefile.am | 12 +- src/syscond/main.cpp | 109 +- tool/rm_autogen-file.sh | 6 + 181 files changed, 9895 insertions(+), 8059 deletions(-) create mode 100644 ico-uxf-homescreen.manifest rename lib/{system-controller/CicoSCAilItems.cpp => common/CicoAilItems.cpp} (90%) rename lib/{system-controller/CicoSCAilItems.h => common/CicoAilItems.h} (89%) rename lib/{system-controller/CicoSCAulItems.cpp => common/CicoAulItems.cpp} (72%) rename lib/{system-controller/CicoSCAulItems.h => common/CicoAulItems.h} (59%) rename lib/{system-controller/CicoSCCommonDef.h => common/CicoCommonDef.h} (74%) rename lib/{system-controller/CicoSCConf.h => common/CicoConf.h} (83%) create mode 100644 lib/common/CicoEFLApp.cpp create mode 100644 lib/common/CicoEFLApp.h rename src/homescreen/CicoHomeScreenConfig.cpp => lib/common/CicoGKeyFileConfig.cpp (71%) rename src/homescreen/CicoHomeScreenConfig.h => lib/common/CicoGKeyFileConfig.h (75%) create mode 100644 lib/common/CicoLibString.cpp create mode 100644 lib/common/CicoLibString.h rename src/homescreen/CicoHomeScreenResourceConfig.cpp => lib/common/CicoResourceConfig.cpp (59%) rename src/homescreen/CicoHomeScreenResourceConfig.h => lib/common/CicoResourceConfig.h (63%) rename {src/homescreen => lib/common}/CicoSound.cpp (86%) rename {src/homescreen => lib/common}/CicoSound.h (91%) rename lib/{system-controller/CicoSCSystemConfig.cpp => common/CicoSystemConfig.cpp} (84%) rename lib/{system-controller/CicoSCSystemConfig.h => common/CicoSystemConfig.h} (89%) rename {src/homescreen => lib/common}/Cico_aul_listen_app.cpp (98%) rename lib/{system-controller => common}/Cico_aul_listen_app.h (94%) create mode 100644 lib/common/Makefile.am create mode 100644 lib/system-controller/CicoSCAppResourceController.cpp create mode 100644 lib/system-controller/CicoSCAppResourceController.h create mode 100644 lib/system-controller/CicoSCVInfo.h create mode 100644 lib/system-controller/CicoSCVInfoManager.cpp create mode 100644 lib/system-controller/CicoSCVInfoManager.h delete mode 100644 lib/system-controller/Cico_aul_listen_app.cpp rename res/{org.tizen.ico.homescreen/res/apps/org.tizen.ico.onscreen => org.tizen.ico.onscreen/res/config}/onscreen.conf (100%) rename res/{org.tizen.ico.homescreen/res/apps/org.tizen.ico.statusbar => org.tizen.ico.statusbar/res/config}/statusbar.conf (81%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_0.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_1.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_2.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_3.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_4.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_5.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_6.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_7.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_8.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_9.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_am.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_pm.png (100%) rename res/{org.tizen.ico.homescreen => org.tizen.ico.statusbar}/res/images/time_ten.png (100%) create mode 100644 res/org.tizen.ico.system-controller/res/config/system-controller.xml create mode 100644 res/org.tizen.ico.system-controller/res/config/system_sysres.json create mode 100644 src/homescreen/CicoHSAppControl.cpp create mode 100644 src/homescreen/CicoHSAppControl.h create mode 100644 src/homescreen/CicoHSCmdOpts.cpp create mode 100644 src/homescreen/CicoHSCmdOpts.h create mode 100644 src/homescreen/CicoHSCommand.cpp create mode 100644 src/homescreen/CicoHSCommand.h create mode 100644 src/homescreen/CicoHSCommandArg.cpp create mode 100644 src/homescreen/CicoHSCommandArg.h create mode 100644 src/homescreen/CicoHSEFLApp.cpp create mode 100644 src/homescreen/CicoHSEFLApp.h rename src/homescreen/{CicoSCLifeCycleController.cpp => CicoHSLifeCycleController.cpp} (84%) rename src/homescreen/{CicoSCLifeCycleController.h => CicoHSLifeCycleController.h} (65%) create mode 100644 src/homescreen/CicoHSMessage.cpp create mode 100644 src/homescreen/CicoHSMessage.h create mode 100644 src/homescreen/CicoHSServer.cpp create mode 100644 src/homescreen/CicoHSServer.h delete mode 100644 src/homescreen/CicoHomeScreenSound.cpp delete mode 100644 src/homescreen/CicoHomeScreenSound.h delete mode 100644 src/homescreen/CicoHomeScreenSoundConfig.cpp delete mode 100644 src/homescreen/CicoHomeScreenSoundConfig.h delete mode 100644 src/homescreen/CicoLog.cpp delete mode 100644 src/homescreen/CicoLog.h delete mode 100644 src/homescreen/CicoSCAilItems.cpp delete mode 100644 src/homescreen/CicoSCAilItems.h delete mode 100644 src/homescreen/CicoSCAulItems.cpp delete mode 100644 src/homescreen/CicoSCAulItems.h delete mode 100644 src/homescreen/CicoSCCommonDef.h delete mode 100644 src/homescreen/CicoSCConf.h delete mode 100644 src/homescreen/CicoSCSystemConfig.cpp delete mode 100644 src/homescreen/CicoSCSystemConfig.h delete mode 100644 src/homescreen/Cico_aul_listen_app.h delete mode 100644 src/homescreen/home_screen_main.h rename src/{homescreen => onscreen}/CicoOnScreenAction.cpp (96%) rename src/{homescreen => onscreen}/CicoOnScreenAction.h (100%) rename src/{homescreen => onscreen}/CicoOnScreenAppList.cpp (98%) rename src/{homescreen => onscreen}/CicoOnScreenAppList.h (100%) rename src/{homescreen => onscreen}/CicoOnScreenContext.cpp (100%) rename src/{homescreen => onscreen}/CicoOnScreenContext.h (100%) rename src/{homescreen => onscreen}/CicoOnScreenControlWindow.cpp (100%) rename src/{homescreen => onscreen}/CicoOnScreenControlWindow.h (100%) create mode 100644 src/onscreen/Makefile.am rename src/{homescreen => onscreen}/on_screen.cpp (100%) rename src/{homescreen => onscreen}/on_screen.h (100%) create mode 100644 src/statusbar/CicoSBConfigDef.h create mode 100644 src/statusbar/CicoSBResourceDef.h rename src/{homescreen => statusbar}/CicoStatusBarControlWindow.cpp (96%) rename src/{homescreen => statusbar}/CicoStatusBarControlWindow.h (94%) rename src/{homescreen => statusbar}/CicoStatusBarTime.cpp (98%) rename src/{homescreen => statusbar}/CicoStatusBarTime.h (97%) create mode 100644 src/statusbar/Makefile.am rename src/{homescreen => statusbar}/status_bar.cpp (82%) rename src/{homescreen => statusbar}/status_bar.h (76%) delete mode 100644 src/syscond/CicoEFLApp.cpp delete mode 100644 src/syscond/CicoEFLApp.h create mode 100644 src/syscond/CicoSysConLogConfig.cpp create mode 100644 src/syscond/CicoSysConLogConfig.h diff --git a/configure.ac b/configure.ac index 10a5027..f885798 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.68]) -AC_INIT([org.tizen.ico.homescreen], [0.9.06], []) +AC_INIT([org.tizen.ico.homescreen], [0.9.10], []) AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz]) AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_HEADERS([config.h]) @@ -122,6 +122,7 @@ AC_CHECK_FUNCS([gethostname gettimeofday memset setenv strcasecmp strdup strerro AC_CONFIG_FILES([Makefile lib/Makefile + lib/common/Makefile lib/apps-framework/Makefile lib/misc/Makefile lib/misc/state-machine/Makefile @@ -129,6 +130,7 @@ AC_CONFIG_FILES([Makefile src/Makefile src/syscond/Makefile src/homescreen/Makefile + src/statusbar/Makefile tool/Makefile tests/Makefile tests/system-controller/Makefile diff --git a/data/lib/systemd/user/ico-system-controller.service b/data/lib/systemd/user/ico-system-controller.service index 830b21f..c54f30f 100644 --- a/data/lib/systemd/user/ico-system-controller.service +++ b/data/lib/systemd/user/ico-system-controller.service @@ -8,4 +8,4 @@ Wants=ico-device-input-controller.service ico-vic-carsim.service Environment=TIZEN_PLATFORMLOGGING_MODE=1 Environment=TIZEN_DLOG_LEVEL=1 Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket -ExecStart=/usr/apps/org.tizen.ico.system-controller/bin/IcoSysconDaemon +ExecStart=/usr/apps/org.tizen.ico.system-controller/bin/IcoSysconDaemon --user app diff --git a/data/share/packages/org.tizen.ico.homescreen.xml b/data/share/packages/org.tizen.ico.homescreen.xml index f78d34e..e2d4a6a 100644 --- a/data/share/packages/org.tizen.ico.homescreen.xml +++ b/data/share/packages/org.tizen.ico.homescreen.xml @@ -1,5 +1,5 @@ - + IVI HomeScreen Application diff --git a/data/share/packages/org.tizen.ico.statusbar.xml b/data/share/packages/org.tizen.ico.statusbar.xml index 0fddce6..01fcd29 100644 --- a/data/share/packages/org.tizen.ico.statusbar.xml +++ b/data/share/packages/org.tizen.ico.statusbar.xml @@ -1,5 +1,5 @@ - + IVI StatusBar Application diff --git a/data/share/packages/org.tizen.ico.system-controller.xml b/data/share/packages/org.tizen.ico.system-controller.xml index acb4364..d0443cf 100644 --- a/data/share/packages/org.tizen.ico.system-controller.xml +++ b/data/share/packages/org.tizen.ico.system-controller.xml @@ -1,5 +1,5 @@ - + ico system-controller diff --git a/ico-uxf-homescreen.manifest b/ico-uxf-homescreen.manifest new file mode 100644 index 0000000..dbc776d --- /dev/null +++ b/ico-uxf-homescreen.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/include/ico_syc_msg_cmd_def.h b/include/ico_syc_msg_cmd_def.h index 7ee9404..c7ea8c3 100644 --- a/include/ico_syc_msg_cmd_def.h +++ b/include/ico_syc_msg_cmd_def.h @@ -11,7 +11,7 @@ /** * @file ico_syc_msg_cmd_def.h * - * @brief + * @brief */ /*========================================================================*/ #ifndef __ICO_SYC_MSG_CMD_DEF_H__ @@ -160,6 +160,14 @@ extern "C" { /* notify state changed to homescreen */ #define MSG_CMD_NOTIFY_CHANGED_STATE 0x00060001 + +/* application operation */ +#define MSG_CMD_APP_START 1000 +#define MSG_CMD_APP_STOP 1001 + +/* window change */ +#define MSG_CMD_WIN_CHANGE 2000 + #ifdef __cplusplus } #endif diff --git a/include/ico_syc_type.h b/include/ico_syc_type.h index 7c5827c..b343a6b 100644 --- a/include/ico_syc_type.h +++ b/include/ico_syc_type.h @@ -151,6 +151,7 @@ typedef enum _state_onoff { */ typedef struct _win_move { char *zone; /* area of showing application window */ + int layer; /* layer of showing application window */ int pos_x; /* window's display position (x) */ int pos_y; /* window's display position (y) */ int width; /* window width */ @@ -286,7 +287,6 @@ typedef struct _state_info { typedef void (*ico_syc_callback_t) (const ico_syc_ev_e event, const void *detail, void *user_data); - #ifdef __cplusplus } diff --git a/lib/Makefile.am b/lib/Makefile.am index 37ecf92..8e30ebf 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,4 +1,5 @@ SUBDIRS=\ + common \ apps-framework \ misc \ system-controller diff --git a/lib/apps-framework/ico_syc_winctl.c b/lib/apps-framework/ico_syc_winctl.c index 7872ebf..3d97b10 100644 --- a/lib/apps-framework/ico_syc_winctl.c +++ b/lib/apps-framework/ico_syc_winctl.c @@ -156,10 +156,12 @@ _create_win_move_msg(const char *appid, int surface, /* set move info */ if (move->zone != NULL) { json_object_set_string_member(argobj, MSG_PRMKEY_ZONE, move->zone); + json_object_set_int_member(argobj, MSG_PRMKEY_LAYER, move->layer); } else { json_object_set_int_member(argobj, MSG_PRMKEY_POS_X, move->pos_x); json_object_set_int_member(argobj, MSG_PRMKEY_POS_Y, move->pos_y); + json_object_set_int_member(argobj, MSG_PRMKEY_LAYER, -1); } json_object_set_int_member(argobj, MSG_PRMKEY_WIDTH, move->width); json_object_set_int_member(argobj, MSG_PRMKEY_HEIGHT, move->height); diff --git a/lib/system-controller/CicoSCAilItems.cpp b/lib/common/CicoAilItems.cpp similarity index 90% rename from lib/system-controller/CicoSCAilItems.cpp rename to lib/common/CicoAilItems.cpp index 39e1769..4350a84 100644 --- a/lib/system-controller/CicoSCAilItems.cpp +++ b/lib/common/CicoAilItems.cpp @@ -6,6 +6,7 @@ * http://www.apache.org/licenses/LICENSE-2.0 * */ + #include #include #include @@ -13,27 +14,18 @@ #include #include -#include "CicoSCAilItems.h" -#include "CicoSCConf.h" -#include "CicoSCSystemConfig.h" -#include "CicoLog.h" +#include +#include "CicoAilItems.h" +#include "CicoConf.h" +#include "CicoSystemConfig.h" +#include "CicoLibString.h" using namespace std; -void split(const string &s, char d, vector &e) -{ - stringstream ss(s); - string it; - while(getline(ss, it, d)) { - e.push_back(it); - } - return; -} - /** * @brief constructor */ -CicoSCAilItems::CicoSCAilItems() +CicoAilItems::CicoAilItems() { ICO_TRA("start"); init(); @@ -49,7 +41,7 @@ CicoSCAilItems::CicoSCAilItems() * @param exe exec path by ail information data * @param cateforys environ file data */ -CicoSCAilItems::CicoSCAilItems(const char* pkg, const char* icon, +CicoAilItems::CicoAilItems(const char* pkg, const char* icon, const char* nam, const char* ctgry, const char* typ, const char* exe, const std::string categorys, bool ndisp) @@ -60,7 +52,7 @@ CicoSCAilItems::CicoSCAilItems(const char* pkg, const char* icon, ICO_TRA("end"); } -CicoSCAilItems::CicoSCAilItems(const CicoSCAilItems &s) +CicoAilItems::CicoAilItems(const CicoAilItems &s) { m_appid = s.m_appid; // PACKAGE NAME m_icon = s.m_icon; // ICON @@ -96,7 +88,7 @@ CicoSCAilItems::CicoSCAilItems(const CicoSCAilItems &s) /** * @brief */ -CicoSCAilItems::~CicoSCAilItems() +CicoAilItems::~CicoAilItems() { ICO_TRA("start"); ICO_TRA("end"); @@ -104,7 +96,7 @@ CicoSCAilItems::~CicoSCAilItems() /** * @brief init member */ -void CicoSCAilItems::init() +void CicoAilItems::init() { m_appid.clear(); // PACKAGE NAME @@ -116,9 +108,9 @@ void CicoSCAilItems::init() m_categories.clear(); // CATEGORIES const CicoSCDefaultConf* oCSCDC; - oCSCDC = CicoSCSystemConfig::getInstance()->getDefaultConf(); + oCSCDC = CicoSystemConfig::getInstance()->getDefaultConf(); if (NULL != oCSCDC) { - ICO_TRA("CicoSCAilItems::init base CicoSCDefaultConf"); + ICO_DBG("CicoAilItems::init base CicoSCDefaultConf"); m_nodeID = oCSCDC->node; m_kindID = oCSCDC->appkind; m_categoryID = oCSCDC->category; @@ -134,7 +126,7 @@ void CicoSCAilItems::init() m_switch = oCSCDC->inputsw; } else { - ICO_TRA("CicoSCAilItems::init base define"); + ICO_DBG("CicoAilItems::init base define"); m_nodeID = DINITm_nodeID; // "run=xxx" xxx change to id m_kindID = DINITm_kindID; // "kind=xxx" xxx change to id m_categoryID = DINITm_categoryID; // "category=xxx" xxx change to id @@ -171,7 +163,7 @@ void CicoSCAilItems::init() * @param exe exec path by ail information data * @param cateforys environ file data */ -void CicoSCAilItems::setup(const char* pkg, const char* icon, +void CicoAilItems::setup(const char* pkg, const char* icon, const char* nam, const char* ctgry, const char* typ, const char* exe, std::string categorys, bool ndisp) @@ -228,7 +220,7 @@ const string s_Animation_time("Animation_time"); * @brief category string parse * @parm category string data split code ";" */ -void CicoSCAilItems::categoryParse(const std::string categorys) +void CicoAilItems::categoryParse(const std::string categorys) { ICO_TRA("start"); if (categorys.empty()) { @@ -254,7 +246,7 @@ void CicoSCAilItems::categoryParse(const std::string categorys) inputDevName.clear(); switchName.clear(); - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); + CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance(); ICO_DBG("category def size = %d", x.size()); for (it = x.begin(); it != x.end(); it++) { @@ -422,7 +414,7 @@ void CicoSCAilItems::categoryParse(const std::string categorys) * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryParseRun(const string& s) +bool CicoAilItems::categoryParseRun(const string& s) { ICO_TRA("start"); const char* ps = s.c_str(); @@ -433,7 +425,7 @@ bool CicoSCAilItems::categoryParseRun(const string& s) } // "run=xxx" // TODO mk_k START getHostID(..) request order - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); + CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance(); int nodeID = CSCSC->getNodeIdbyName(&ps[c+1]); // TODO mk_k int nodeID = -1; // TODO mk_k int nodeID = CSCSC->getHostID(&ps[c+1]); @@ -453,7 +445,7 @@ bool CicoSCAilItems::categoryParseRun(const string& s) * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryParseKind(const string& s) +bool CicoAilItems::categoryParseKind(const string& s) { ICO_TRA("start"); const char* ps = s.c_str(); @@ -463,7 +455,7 @@ bool CicoSCAilItems::categoryParseKind(const string& s) return false; } // "kind=xxx" xxx change to id - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); + CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance(); int kindID = CSCSC->getAppKindIdbyName(&ps[c+1]); if (kindID==-1) { ICO_TRA("end"); @@ -480,7 +472,7 @@ bool CicoSCAilItems::categoryParseKind(const string& s) * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryParseCategory(const string& s) +bool CicoAilItems::categoryParseCategory(const string& s) { ICO_TRA("start"); const char* ps = s.c_str(); @@ -490,7 +482,7 @@ bool CicoSCAilItems::categoryParseCategory(const string& s) return false; // not "category=xxx" } // "category=xxx" xxx change to id - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); + CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance(); int categoryID = CSCSC->getCategoryIdbyName(&ps[c+1]); if (categoryID==-1) { ICO_TRA("end"); @@ -509,7 +501,7 @@ bool CicoSCAilItems::categoryParseCategory(const string& s) * @retval true get value success * @retval false get not good */ -bool CicoSCAilItems::categoryParseGetValue(const std::string& s, +bool CicoAilItems::categoryParseGetValue(const std::string& s, const std::string& k, std::string & val) { @@ -552,7 +544,7 @@ bool CicoSCAilItems::categoryParseGetValue(const std::string& s, * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryGetDisplay(const string& disp, +bool CicoAilItems::categoryGetDisplay(const string& disp, const string& layer, const string& zone) { @@ -562,7 +554,7 @@ bool CicoSCAilItems::categoryGetDisplay(const string& disp, return false; } - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); + CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance(); m_display = CSCSC->getDisplayIdbyName(disp); ICO_DBG("display %s->%d", disp.c_str(), m_display); if (false == layer.empty()) { @@ -584,7 +576,7 @@ bool CicoSCAilItems::categoryGetDisplay(const string& disp, * @retval true get data * @retval false param fail */ -bool CicoSCAilItems::categoryGetSound(const string& sound, const string& zone) +bool CicoAilItems::categoryGetSound(const string& sound, const string& zone) { ICO_TRA("start"); if (true == sound.empty()) { @@ -592,7 +584,7 @@ bool CicoSCAilItems::categoryGetSound(const string& sound, const string& zone) return false; } - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); + CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance(); m_sound = CSCSC->getSoundIdbyName(sound); ICO_DBG("sound %s->%d", sound.c_str(), m_sound); if (false == zone.empty()) { @@ -603,7 +595,7 @@ bool CicoSCAilItems::categoryGetSound(const string& sound, const string& zone) return true; } -bool CicoSCAilItems::categoryGetInput(const string& inputDev, +bool CicoAilItems::categoryGetInput(const string& inputDev, const string& sw) { ICO_TRA("start"); @@ -612,7 +604,7 @@ bool CicoSCAilItems::categoryGetInput(const string& inputDev, return false; } - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); + CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance(); m_sound = CSCSC->getInputDevIdbyName(inputDev); ICO_DBG("sound %s->%d", inputDev.c_str(), m_sound); if (false == sw.empty()) { @@ -629,7 +621,7 @@ bool CicoSCAilItems::categoryGetInput(const string& inputDev, * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryParseNodisplay(const string& s) +bool CicoAilItems::categoryParseNodisplay(const string& s) { ICO_TRA("start"); const char* ps = s.c_str(); @@ -654,7 +646,7 @@ bool CicoSCAilItems::categoryParseNodisplay(const string& s) * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryParseAnimation(const string& s) +bool CicoAilItems::categoryParseAnimation(const string& s) { ICO_TRA("start"); const char* ps = s.c_str(); @@ -688,7 +680,7 @@ bool CicoSCAilItems::categoryParseAnimation(const string& s) * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryParseInvisiblecpu(const string& s) +bool CicoAilItems::categoryParseInvisiblecpu(const string& s) { ICO_TRA("start"); const char* ps = s.c_str(); @@ -716,7 +708,7 @@ bool CicoSCAilItems::categoryParseInvisiblecpu(const string& s) * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryParseNoconfigure(const string&) +bool CicoAilItems::categoryParseNoconfigure(const string&) { // TODO mk_k ICO_TRA("start"); @@ -732,7 +724,7 @@ bool CicoSCAilItems::categoryParseNoconfigure(const string&) * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryParseMenuoverlap(const string&) +bool CicoAilItems::categoryParseMenuoverlap(const string&) { ICO_TRA("start"); m_memnuOverlap = true; @@ -746,7 +738,7 @@ bool CicoSCAilItems::categoryParseMenuoverlap(const string&) * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryParseAuto(const string&) +bool CicoAilItems::categoryParseAuto(const string&) { ICO_TRA("start"); m_autoStart = true; @@ -760,11 +752,11 @@ bool CicoSCAilItems::categoryParseAuto(const string&) * @retval true parse success * @retval false parse fail */ -bool CicoSCAilItems::categoryParseNoauto(const string&) +bool CicoAilItems::categoryParseNoauto(const string&) { ICO_TRA("start"); m_autoStart = false; ICO_TRA("end"); return true; } - +// vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCAilItems.h b/lib/common/CicoAilItems.h similarity index 89% rename from lib/system-controller/CicoSCAilItems.h rename to lib/common/CicoAilItems.h index 8539f67..9631530 100644 --- a/lib/system-controller/CicoSCAilItems.h +++ b/lib/common/CicoAilItems.h @@ -6,8 +6,8 @@ * http://www.apache.org/licenses/LICENSE-2.0 * */ -#ifndef CICOSCAILITEMS_H -#define CICOSCAILITEMS_H +#ifndef CICOAILITEMS_H +#define CICOAILITEMS_H #include #include #include @@ -31,21 +31,21 @@ * */ -class CicoSCAilItems { +class CicoAilItems { public: // member method - CicoSCAilItems(); - CicoSCAilItems(const char* pkg, const char* icon, const char* nam, + CicoAilItems(); + CicoAilItems(const char* pkg, const char* icon, const char* nam, const char* ctgry, const char* typ, const char* exe, std::string categorys, bool ndisp); - CicoSCAilItems(const CicoSCAilItems& rAilItems); - ~CicoSCAilItems(); + CicoAilItems(const CicoAilItems& rAilItems); + ~CicoAilItems(); void init(); void setup(const char* pkg, const char* icon, const char* nam, const char* ctgry, const char* typ, const char* exe, std::string categorys, bool ndisp); - const CicoSCAilItems* p() const; + const CicoAilItems* p() const; protected: // member method void categoryParse(const std::string categorys); @@ -102,9 +102,10 @@ public: // member aria bool m_resumeShow; }; -inline const CicoSCAilItems* CicoSCAilItems::p() const +inline const CicoAilItems* CicoAilItems::p() const { return this; } #endif // CICOAILITEMS_H +// vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCAulItems.cpp b/lib/common/CicoAulItems.cpp similarity index 72% rename from lib/system-controller/CicoSCAulItems.cpp rename to lib/common/CicoAulItems.cpp index 331bc4c..88ff3b1 100644 --- a/lib/system-controller/CicoSCAulItems.cpp +++ b/lib/common/CicoAulItems.cpp @@ -16,20 +16,20 @@ #include #include -#include "CicoLog.h" -#include "CicoSCAulItems.h" -#include "CicoSCAilItems.h" -#include "CicoSCConf.h" -#include "CicoSCSystemConfig.h" +#include +#include "CicoAulItems.h" +#include "CicoAilItems.h" +#include "CicoConf.h" +#include "CicoSystemConfig.h" using namespace std; /** * @brief AUL Items class constructor */ -CicoSCAulItems::CicoSCAulItems() +CicoAulItems::CicoAulItems() { - ICO_TRA("CicoSCAulItems::CicoSCAulItems"); + ICO_TRA("start"); m_appid.clear(); // appid m_pid = 0; // pid m_category = DINITm_categoryID; @@ -38,22 +38,23 @@ CicoSCAulItems::CicoSCAulItems() m_defCgrpCpu.clear(); m_defCgrpMem.clear(); m_aulstt = AUL_R_OK; + ICO_TRA("end"); } /** * @brief AUL Items class constructor */ -CicoSCAulItems::CicoSCAulItems(const char* appid, int pid, int ctgry, - int aulstt, const CicoSCWindow* obj) +CicoAulItems::CicoAulItems(const char* appid, int pid, int ctgry, + int aulstt, const void* obj) :m_appid(appid), m_pid(pid), m_category(ctgry), m_aulstt(aulstt) { - ICO_TRA("constructor %s, %d, %x", appid? appid: "(NIL)", pid, obj); + ICO_TRA("start %s, %d, %x", appid? appid: "(NIL)", pid, obj); enterWindow(obj); getPidCgroupInfo(pid, m_defCgrpMem, m_defCgrpCpu); m_cpucgroup = -1; m_memcgroup = -1; if (DINITm_categoryID != m_category) { - CicoSCSystemConfig* conf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig* conf = CicoSystemConfig::getInstance(); const CicoSCCategoryConf* objX = conf->getCategoryObjbyCaategoryID(m_category); if (NULL != objX) { @@ -61,12 +62,13 @@ CicoSCAulItems::CicoSCAulItems(const char* appid, int pid, int ctgry, ICO_DBG("categ:%d -> cgroup: %d", m_category, m_cpucgroup); } } + ICO_TRA("end"); } /** * @brief AUL Items class constructor */ -CicoSCAulItems::CicoSCAulItems(const CicoSCAulItems& s) +CicoAulItems::CicoAulItems(const CicoAulItems& s) { m_appid = s.m_appid; m_pid = s.m_pid; @@ -89,27 +91,27 @@ CicoSCAulItems::CicoSCAulItems(const CicoSCAulItems& s) /** * @brief AUL Items class destructor */ -CicoSCAulItems::~CicoSCAulItems() +CicoAulItems::~CicoAulItems() { - ICO_TRA("CicoSCAulItems::~CicoSCAulItems"); + ICO_TRA("CicoAulItems::~CicoAulItems"); m_CSCWptrs.clear(); } /** - * @brief CicoSCWindow pointer entry + * @brief window information pointer entry * @param obj entry pointer */ -void CicoSCAulItems::enterWindow(const CicoSCWindow* obj) +void CicoAulItems::enterWindow(const void* obj) { - ICO_TRA("CicoSCAulItems::enterWindow %x", obj); + ICO_TRA("CicoAulItems::enterWindow %x", obj); if ((NULL == obj) || (0 == obj)) { - ICO_TRA("CicoSCAulItems::enterWindow"); + ICO_TRA("CicoAulItems::enterWindow"); return; } bool bingo = false; // Registered flag off #if 1 // TODO mk_k - vector::iterator it = m_CSCWptrs.begin(); - vector::iterator theEnd = m_CSCWptrs.end(); + vector::iterator it = m_CSCWptrs.begin(); + vector::iterator theEnd = m_CSCWptrs.end(); for(; it != theEnd; ++it) { if (obj == *it) { // if Registered ? bingo = true; // Registered flag on @@ -129,27 +131,27 @@ void CicoSCAulItems::enterWindow(const CicoSCWindow* obj) ICO_TRA("add window pointer"); m_CSCWptrs.push_back(obj); } - ICO_TRA("CicoSCAulItems::enterWindow"); + ICO_TRA("CicoAulItems::enterWindow"); return; } /** - * @brief removw CicoSCWindow pointer + * @brief remove window information pointer * @param obj remove target */ -void CicoSCAulItems::rmWindow(const CicoSCWindow* obj) +void CicoAulItems::rmWindow(const void* obj) { - ICO_TRA("CicoSCAulItems::rmWindow %x", obj); - vector::iterator it = m_CSCWptrs.begin(); - vector::iterator theEnd = m_CSCWptrs.end(); + ICO_TRA("CicoAulItems::rmWindow %x", obj); + vector::iterator it = m_CSCWptrs.begin(); + vector::iterator theEnd = m_CSCWptrs.end(); for(; it != theEnd; ++it) { if (obj == *it) { - ICO_TRA("CicoSCAulItems::rmWindow"); + ICO_TRA("CicoAulItems::rmWindow"); m_CSCWptrs.erase(it); break; // break of for } } - ICO_TRA("CicoSCAulItems::rmWindow"); + ICO_TRA("CicoAulItems::rmWindow"); return; } @@ -162,9 +164,9 @@ void CicoSCAulItems::rmWindow(const CicoSCWindow* obj) static const char* g_procPidCgroupFileFmt="/proc/%d/cgroup"; static const char* g_cpuWord = "cpuacct,cpu:"; static const char* g_memWord = "memory:"; -bool CicoSCAulItems::getPidCgroupInfo(int pid, string& m, string& c) +bool CicoAulItems::getPidCgroupInfo(int pid, string& m, string& c) { - ICO_TRA("CicoSCAulItems::getPidCgroupInfo"); + ICO_TRA("start"); char fn[64]; sprintf(fn, g_procPidCgroupFileFmt, pid); const size_t cpuWdSz = strlen(g_cpuWord); @@ -193,7 +195,7 @@ bool CicoSCAulItems::getPidCgroupInfo(int pid, string& m, string& c) } } if ((0 != pC) && (0 != pM)) { - ICO_DBG("CicoSCAulItems::getPidCgroupInfo m=%s, c=%s", pM, pC); + ICO_DBG("CicoAulItems::getPidCgroupInfo m=%s, c=%s", pM, pC); m = pM; c = pC; bR = true; @@ -201,14 +203,14 @@ bool CicoSCAulItems::getPidCgroupInfo(int pid, string& m, string& c) } } ifs.close(); - ICO_TRA("CicoSCAulItems::getPidCgroupInfo %s", bR? "true": "false"); + ICO_TRA("end %s", bR? "true": "false"); return bR; } /** * @brief appid update */ -void CicoSCAulItems::update_appid() +void CicoAulItems::update_appid() { if (AUL_R_OK == m_aulstt) { return; @@ -223,3 +225,4 @@ void CicoSCAulItems::update_appid() ICO_TRA("update end %d, %s", m_aulstt, m_appid.c_str()); return ; } +// vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCAulItems.h b/lib/common/CicoAulItems.h similarity index 59% rename from lib/system-controller/CicoSCAulItems.h rename to lib/common/CicoAulItems.h index 61c90a2..3e12af7 100644 --- a/lib/system-controller/CicoSCAulItems.h +++ b/lib/common/CicoAulItems.h @@ -6,33 +6,29 @@ * http://www.apache.org/licenses/LICENSE-2.0 * */ -#ifndef CICOSCAULITEMS_H -#define CICOSCAULITEMS_H +#ifndef CICOAULITEMS_H +#define CICOAULITEMS_H #include #include -#ifndef __CICO_SC_WINDOW_H__ -class CicoSCWindow; -#endif - /** * @brief System controller unit * application life cycle information data * */ -class CicoSCAulItems { +class CicoAulItems { public: // member method - CicoSCAulItems(); - CicoSCAulItems(const char* appid, int pid, int ctgry, int aulstt, - const CicoSCWindow* obj=NULL); - CicoSCAulItems(const CicoSCAulItems& raul); - ~CicoSCAulItems(); - - const CicoSCAulItems* p() const; - void enterWindow(const CicoSCWindow* obj); - void rmWindow(const CicoSCWindow* obj); + CicoAulItems(); + CicoAulItems(const char* appid, int pid, int ctgry, int aulstt, + const void* obj=NULL); + CicoAulItems(const CicoAulItems& raul); + ~CicoAulItems(); + + const CicoAulItems* p() const; + void enterWindow(const void* obj); + void rmWindow(const void* obj); void update_appid(); protected: // member method bool getPidCgroupInfo(int pid, std::string& m, std::string& c); @@ -44,7 +40,7 @@ public: // member aria int m_category; // int m_cpucgroup; int m_memcgroup; - std::vector m_CSCWptrs; + std::vector m_CSCWptrs; protected: // member aria std::string m_defCgrpCpu; @@ -53,9 +49,10 @@ protected: // member aria }; -inline const CicoSCAulItems* CicoSCAulItems::p() const +inline const CicoAulItems* CicoAulItems::p() const { return this; } #endif // CICOSCAULITEMS_H +// vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCCommonDef.h b/lib/common/CicoCommonDef.h similarity index 74% rename from lib/system-controller/CicoSCCommonDef.h rename to lib/common/CicoCommonDef.h index 5b019f5..812d771 100644 --- a/lib/system-controller/CicoSCCommonDef.h +++ b/lib/common/CicoCommonDef.h @@ -9,13 +9,13 @@ //========================================================================== /** - * @file CicoSCCommonDef.h + * @file CicoCommonDef.h * * @brief This file is definition of common value */ //========================================================================== -#ifndef __CICO_SC_COMMON_DEF_H__ -#define __CICO_SC_COMMON_DEF_H__ +#ifndef __CICO_COMMON_DEF_H__ +#define __CICO_COMMON_DEF_H__ //-------------------------------------------------------------------------- // definition of layer type @@ -40,5 +40,26 @@ #define ICO_DISPLAY1_ZONEID_MIN (21) ///! display1 zone id min #define ICO_DISPLAY1_ZONEID_MAX (40) ///! display1 zone id max -#endif // __CICO_SC_COMMON_DEF_H__ +//-------------------------------------------------------------------------- +// type +//-------------------------------------------------------------------------- +typedef enum _ico_type +{ + ICO_TYPE_UNKNOW = 0, + ICO_TYPE_BOOLEAN, + ICO_TYPE_INT8, + ICO_TYPE_UINT8, + ICO_TYPE_INT16, + ICO_TYPE_UINT16, + ICO_TYPE_INT32, + ICO_TYPE_UINT32, + ICO_TYPE_INT64, + ICO_TYPE_UINT64, + ICO_TYPE_DOUBLE, + ICO_TYPE_STRING, + + ICO_TYPE_MAX, +} ico_type_t; + +#endif // __CICO_COMMON_DEF_H__ // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCConf.h b/lib/common/CicoConf.h similarity index 83% rename from lib/system-controller/CicoSCConf.h rename to lib/common/CicoConf.h index 92af9e7..c947523 100644 --- a/lib/system-controller/CicoSCConf.h +++ b/lib/common/CicoConf.h @@ -9,20 +9,21 @@ //========================================================================== /** - * @file CicoSCConf.h + * @file CicoConf.h * * @brief This file is definition of SystemConfigs */ //========================================================================== -#ifndef __CICO_SC_CONF_H__ -#define __CICO_SC_CONF_H__ +#ifndef __CICO_CONF_H__ +#define __CICO_CONF_H__ #include #include +#include #include #include -#include "CicoSCCommonDef.h" +#include "CicoCommonDef.h" //========================================================================== /** @@ -528,8 +529,9 @@ class CicoSCResourceConf public: /// default constructor CicoSCResourceConf() - :m_bDoIt(false), m_bLog(false), m_cpuCGRPPath(""), m_sampling(-1), - m_retryCnt(5), m_lowLimitVal(25), m_highLimitVal(90) {} + :m_bDoIt(false), m_bDoItApp(false), m_bLog(false), m_cpuCGRPPath(""), + m_sampling(-1), m_retryCnt(5), m_lowLimitVal(25), + m_highLimitVal(90) {} /// destructor virtual ~CicoSCResourceConf() {} @@ -537,14 +539,15 @@ public: /// dump log this class member variables void dumpConf(void) { - ICO_DBG("do:%s, log:%s, dir:%s, smpl:%d r:%d l:%d h:%d sz:%d", - m_bDoIt? "true": "false", m_bLog? "true": "false", - m_cpuCGRPPath.c_str(), m_sampling, m_retryCnt, m_lowLimitVal, - m_highLimitVal, m_cpuCtrl.size()); + ICO_DBG("do:%s,%s log:%s, dir:%s, smpl:%d r:%d l:%d h:%d sz:%d", + m_bDoIt? "true": "false", m_bDoItApp? "true": "false", + m_bLog? "true": "false", m_cpuCGRPPath.c_str(), m_sampling, + m_retryCnt, m_lowLimitVal, m_highLimitVal, m_cpuCtrl.size()); } public: bool m_bDoIt; ///< resource control enable flag + bool m_bDoItApp; bool m_bLog; ///< resource control log enable flag std::string m_cpuCGRPPath; ///< cpu cgroup path int m_sampling; ///< sampling period @@ -577,5 +580,119 @@ public: std::string m_parent_dir; ///< parent dir }; -#endif // __CICO_SC_CONF_H__ +//========================================================================== +/** + * @brief This class holds vehicle information property of system config + */ +//========================================================================== +class CicoSCVIPropertyConf +{ +public: + /// default constructor + CicoSCVIPropertyConf() + : name(""), objname(""), property(""), typestr(""), + type(ICO_TYPE_UNKNOW) {} + + /// destructor + virtual ~CicoSCVIPropertyConf() {} + + /// dump log this class member variables + void dumpConf(void) + { + ICO_DBG("vehicle_info: id=%02d name=%s objname=%s property=%s " + "zone=%d typestr=%s type=%d", + id, name.c_str(), objname.c_str(), property.c_str(), + zone, typestr.c_str(), type); + } + + int typeStrToInt(const std::string & str) + { + int ret = ICO_TYPE_UNKNOW; + if (0 == typestr.compare("BOOLEAN")) { + ret = ICO_TYPE_BOOLEAN; + } + else if (0 == typestr.compare("INT8")) { + ret = ICO_TYPE_INT8; + } + else if ((0 == typestr.compare("UINT8")) || + (0 == typestr.compare("BYTE"))) { + ret = ICO_TYPE_UINT8; + } + else if (0 == typestr.compare("INT16")) { + ret = ICO_TYPE_INT16; + } + else if (0 == typestr.compare("UINT16")) { + ret = ICO_TYPE_UINT16; + } + else if (0 == typestr.compare("INT32")) { + ret = ICO_TYPE_INT32; + } + else if (0 == typestr.compare("UINT32")) { + ret = ICO_TYPE_UINT32; + } + else if (0 == typestr.compare("INT64")) { + ret = ICO_TYPE_INT64; + } + else if (0 == typestr.compare("UINT64")) { + ret = ICO_TYPE_UINT64; + } + else if (0 == typestr.compare("DOUBLE")) { + ret = ICO_TYPE_DOUBLE; + } + else if (0 == typestr.compare("STRING")) { + ret = ICO_TYPE_STRING; + } + else { + ret = ICO_TYPE_UNKNOW; + } + return ret; + } + +public: + int id; + std::string name; + std::string objname; + std::string property; + int zone; + std::string typestr; + int type; +}; + +//========================================================================== +/** + * @brief This class holds vehicle information of system config + */ +//========================================================================== +class CicoSCVehicleInfoConf +{ +public: + /// default constructor + CicoSCVehicleInfoConf() : retryCnt(0), waitTime(0) {} + + /// destructor + virtual ~CicoSCVehicleInfoConf() {} + + /// dump log this class member variables + void dumpConf(void) + { + ICO_DBG("vehicle info: retry=%d waitTime=%d", retryCnt, waitTime); + std::map::iterator itr; + itr = properties.begin(); + for(; itr != properties.end(); ++itr) { + itr->second->dumpConf(); + } + } + +public: + ///< retry count + int retryCnt; + + ///< retry wait time[ms] + int waitTime; + + ///< parent dir + std::map properties; +}; + +#endif // __CICO_CONF_H__ // vim:set expandtab ts=4 sw=4: diff --git a/lib/common/CicoEFLApp.cpp b/lib/common/CicoEFLApp.cpp new file mode 100644 index 0000000..baa0613 --- /dev/null +++ b/lib/common/CicoEFLApp.cpp @@ -0,0 +1,571 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoEFLApp.cpp + * + * @brief This file is implemetation of CicoEFLApp class + */ +//========================================================================== + +#include +#include +#include + +#include + +#include "CicoEFLApp.h" + +//-------------------------------------------------------------------------- +/** + * @brief constructor + */ +//-------------------------------------------------------------------------- +CicoEFLApp::CicoEFLApp() + : m_pkgName(""), m_appid(""), m_version("") +{ +// ICO_DBG("CicoEFLApp::CicoEFLApp Enter"); + m_appEventCB.create = appfwCreateCB; + m_appEventCB.terminate = appfwTerminateCB; + m_appEventCB.pause = appfwPauseCB; + m_appEventCB.resume = appfwResumeCB; + m_appEventCB.service = appfwServiceCB; + m_appEventCB.low_memory = appfwLowMemoryCB; + m_appEventCB.low_battery = appfwLowBatteryCB; + m_appEventCB.device_orientation = appfwDeviceOrientationCB; + m_appEventCB.language_changed = appfwLanguageChangedCB; + m_appEventCB.region_format_changed = appfwRegionFormatChangedCB; + + char *value; + int ret = app_get_package(&value); + if (APP_ERROR_NONE == ret) { + m_pkgName = value; + free(value); + } + + ret = app_get_id(&value); + if (APP_ERROR_NONE == ret) { + m_appid = value; + free(value); + } + + ret = app_get_version(&value); + if (APP_ERROR_NONE == ret) { + m_version = value; + free(value); + } + +// ICO_DBG("CicoEFLApp::CicoEFLApp Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief destructor + */ +//-------------------------------------------------------------------------- +CicoEFLApp::~CicoEFLApp() +{ +// ICO_DBG("CicoEFLApp::~CicoEFLApp Enter"); +// ICO_DBG("CicoEFLApp::~CicoEFLApp Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief start EFL main loop + * + * @param [in] argc count of argument + * @param [in] argv variables of argument + */ +//-------------------------------------------------------------------------- +int +CicoEFLApp::start(int argc, char **argv) +{ + ICO_DBG("CicoEFLApp::start Enter"); + int ret = app_efl_main(&argc, &argv, &m_appEventCB, this); + ICO_DBG("CicoEFLApp::start Leave(ret=%d)", ret); + return ret; +} + +//-------------------------------------------------------------------------- +/** + * @brief stop EFL main loop + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::stop(void) +{ + app_efl_exit(); +} + +//-------------------------------------------------------------------------- +/** + * @brief get application package name + * + * @return application package name + */ +//-------------------------------------------------------------------------- +std::string & +CicoEFLApp::getPackageName(void) +{ + return m_pkgName; +} + +//-------------------------------------------------------------------------- +/** + * @brief get application id + * + * @return application id + */ +//-------------------------------------------------------------------------- +std::string & +CicoEFLApp::getAppId(void) +{ + return m_appid; +} + +//-------------------------------------------------------------------------- +/** + * @brief get application version + * + * @return application version + */ +//-------------------------------------------------------------------------- +std::string & +CicoEFLApp::getVersion(void) +{ + return m_version; +} + +//-------------------------------------------------------------------------- +/** + * @brief convart appfw error code to string + * + * @param [in] error code of error + * + * @return string of error + */ +//-------------------------------------------------------------------------- +const char* +CicoEFLApp::appfwErrorToString(int error) +{ + switch(error) { + case APP_ERROR_NONE: + return (const char*)"APP_ERROR_NONE"; + break; + case APP_ERROR_INVALID_PARAMETER: + return (const char*)"APP_ERROR_INVALID_PARAMETER"; + break; + case APP_ERROR_OUT_OF_MEMORY: + return (const char*)"APP_ERROR_OUT_OF_MEMORY"; + break; + case APP_ERROR_INVALID_CONTEXT: + return (const char*)"APP_ERROR_INVALID_CONTEXT"; + break; + case APP_ERROR_NO_SUCH_FILE: + return (const char*)"APP_ERROR_NO_SUCH_FILE"; + break; + case APP_ERROR_ALREADY_RUNNING: + return (const char*)"APP_ERROR_ALREADY_RUNNING"; + break; + default: + break; + } + + return (const char*)"TIZEN_ERROR_UNKNOWN"; +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on create + * + * @param [in] user_data The user data passed from the callback + * registration function + * + * @return true on success, false on error + */ +//-------------------------------------------------------------------------- +bool +CicoEFLApp::onCreate(void *user_data) +{ + ICO_WRN("CicoEFLApp::onCreate called."); + return false; +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on terminate + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::onTerminate(void *user_data) +{ + ICO_WRN("CicoEFLApp::onTerminate called."); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on pause + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::onPause(void *user_data) +{ + ICO_WRN("CicoEFLApp::onPause called."); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on resume + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::onResume(void *user_data) +{ + ICO_WRN("CicoEFLApp::onResume called."); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on service + * + * @param [in] service The handle to the service + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::onService(service_h service, void *user_data) +{ + ICO_WRN("CicoEFLApp::onService called."); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on low memory + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::onLowMemory(void *user_data) +{ + ICO_WRN("CicoEFLApp::onLowMemory called."); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on low battery + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::onLowBattery(void *user_data) +{ + ICO_WRN("CicoEFLApp::onLowBattery called."); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on device orientation + * + * @param [in] orientation The orientation of device + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::onDeviceOrientation(app_device_orientation_e orientation, + void *user_data) +{ + ICO_WRN("CicoEFLApp::onDeviceOrientation called."); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on language changed + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::onLanguageChanged(void *user_data) +{ + ICO_WRN("CicoEFLApp::onLanguageChanged called."); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on region format changed + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::onRegionFormatChanged(void *user_data) +{ + ICO_WRN("CicoEFLApp::onRegionFormatChanged called."); +} + +//========================================================================== +// pravate functions +//========================================================================== +//-------------------------------------------------------------------------- +/** + * @brief Called at the start of the application. + * + * @param [in] user_data The user data passed from the callback + * registration function + * + * @return true on success, false on error + */ +//-------------------------------------------------------------------------- +bool +CicoEFLApp::appfwCreateCB(void *user_data) +{ + ICO_DBG("CicoEFLApp::appfwCreateCB Enter"); + + if (NULL == user_data) { + ICO_DBG("CicoEFLApp::appfwCreateCB Leave"); + return false; + } + + bool ret = static_cast(user_data)->onCreate(user_data); + + ICO_DBG("CicoEFLApp::appfwCreateCB Leave(%sd)", ret ? "true" : "false"); + + return ret; +} + +//-------------------------------------------------------------------------- +/** + * @brief Called once after the main loop of application exits. + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::appfwTerminateCB(void *user_data) +{ + ICO_DBG("CicoEFLApp::appfwTerminateCB Enter"); + + if (NULL == user_data) { + ICO_DBG("CicoEFLApp::appfwTerminateCB Leave"); + return; + } + + static_cast(user_data)->onTerminate(user_data); + + ICO_DBG("CicoEFLApp::appfwTerminateCB Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief Called when the application is completely obscured by another + * application and becomes invisible. + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::appfwPauseCB(void *user_data) +{ + ICO_DBG("CicoEFLApp::appfwPauseCB Enter"); + + if (NULL == user_data) { + ICO_DBG("CicoEFLApp::appfwPauseCB Leave"); + return; + } + + static_cast(user_data)->onPause(user_data); + + ICO_DBG("CicoEFLApp::appfwPauseCB Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief Called when the application becomes visible. + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::appfwResumeCB(void *user_data) +{ + ICO_DBG("CicoEFLApp::appfwResumeCB Enter"); + + if (NULL == user_data) { + ICO_DBG("CicoEFLApp::appfwResumeCB Leave"); + return; + } + + static_cast(user_data)->onResume(user_data); + + ICO_DBG("CicoEFLApp::appfwResumeCB Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief Called when other application send the launch request to + * the application. + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::appfwServiceCB(service_h service, void *user_data) +{ + ICO_DBG("CicoEFLApp::appfwServiceCB Enter"); + + if (NULL == user_data) { + ICO_DBG("CicoEFLApp::appfwServiceCB Leave"); + return; + } + + static_cast(user_data)->onService(service, user_data); + + ICO_DBG("CicoEFLApp::appfwServiceCB Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief Called when the system memory is running low. + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::appfwLowMemoryCB(void *user_data) +{ + ICO_DBG("CicoEFLApp::appfwLowMemoryCB Enter"); + + if (NULL == user_data) { + ICO_DBG("CicoEFLApp::appfwLowMemoryCB Leave"); + return; + } + + static_cast(user_data)->onLowMemory(user_data); + + ICO_DBG("CicoEFLApp::appfwLowMemoryCB Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief Called when the battery power is running low. + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::appfwLowBatteryCB(void *user_data) +{ + ICO_DBG("CicoEFLApp::appfwLowBatteryCB Enter"); + + if (NULL == user_data) { + ICO_DBG("CicoEFLApp::appfwLowBatteryCB Leave"); + return; + } + + static_cast(user_data)->onLowBattery(user_data); + + ICO_DBG("CicoEFLApp::appfwLowBatteryCB Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief Called when the orientation of device changes. + * + * @param [in] orientation The orientation of device + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::appfwDeviceOrientationCB(app_device_orientation_e orientation, + void *user_data) +{ + ICO_DBG("CicoEFLApp::appfwDeviceOrientationCB Enter"); + + if (NULL == user_data) { + ICO_DBG("CicoEFLApp::appfwDeviceOrientationCB Leave"); + return; + } + + static_cast(user_data)->onDeviceOrientation(orientation, + user_data); + + ICO_DBG("CicoEFLApp::appfwDeviceOrientationCB Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief Called when language setting changes. + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::appfwLanguageChangedCB(void *user_data) +{ + ICO_DBG("CicoEFLApp::appfwLanguageChangedCB Enter"); + + if (NULL == user_data) { + ICO_DBG("CicoEFLApp::appfwDeviceOrientationCB Leave"); + return; + } + + static_cast(user_data)->onLanguageChanged(user_data); + + ICO_DBG("CicoEFLApp::appfwLanguageChangedCB Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief Called when region format setting changes. + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoEFLApp::appfwRegionFormatChangedCB(void *user_data) +{ + ICO_DBG("CicoEFLApp::appfwRegionFormatChangedCB Enter"); + + if (NULL == user_data) { + ICO_DBG("CicoEFLApp::appfwDeviceOrientationCB Leave"); + return; + } + + static_cast(user_data)->onRegionFormatChanged(user_data); + + ICO_DBG("CicoEFLApp::appfwRegionFormatChangedCB Leave"); +} +// vim: set expandtab ts=4 sw=4; diff --git a/lib/common/CicoEFLApp.h b/lib/common/CicoEFLApp.h new file mode 100644 index 0000000..a358dbf --- /dev/null +++ b/lib/common/CicoEFLApp.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoEFLApp.h + * + * @brief This file is definition of CicoEFLApp class + */ +//========================================================================== +#ifndef __CICO_EFL_APP_H__ +#define __CICO_EFL_APP_H__ + +#include + +#include + +//-------------------------------------------------------------------------- +/** + * @class CicoGeometry + * + * @brief This class provide tizen appfw funciton + */ +//-------------------------------------------------------------------------- +class CicoEFLApp { +public: + // default constructor + CicoEFLApp(); + + // destructor + virtual ~CicoEFLApp(); + + // start main loop + int start(int argc, char **argv); + + // stop main loop + void stop(void); + + // get application package name + std::string & getPackageName(void); + + // get application id + std::string & getAppId(void); + + // get application version + std::string & getVersion(void); + + // convert application error to string + const char* appfwErrorToString(int error); + + // callback function on create + virtual bool onCreate(void *user_data); + + // callback function on terminate + virtual void onTerminate(void *user_data); + + // callback function on pause + virtual void onPause(void *user_data); + + // callback function on resume + virtual void onResume(void *user_data); + + // callback function on service + virtual void onService(service_h service, void *user_data); + + // callback function on low memory + virtual void onLowMemory(void *user_data); + + // callback function on low battery + virtual void onLowBattery(void *user_data); + + // callback function on device orientation + virtual void onDeviceOrientation(app_device_orientation_e orientation, + void *user_data); + + // callback function on language changed + virtual void onLanguageChanged(void *user_data); + + // callback function on region format changed + virtual void onRegionFormatChanged(void *user_data); + +protected: + // assignment operator + CicoEFLApp& operator=(const CicoEFLApp &object); + + // copy constructor + CicoEFLApp(const CicoEFLApp &object); + +private: + // callback function on create for tizen appfw + static bool appfwCreateCB(void *user_data); + + // callback function on terminate for tizen appfw + static void appfwTerminateCB(void *user_data); + + // callback function on pause for tizen appfw + static void appfwPauseCB(void *user_data); + + // callback function on resume for tizen appfw + static void appfwResumeCB(void *user_data); + + // callback function on service for tizen appfw + static void appfwServiceCB(service_h service, void *user_data); + + // callback function on low memory for tizen appfw + static void appfwLowMemoryCB(void *user_data); + + // callback function on low battery for tizen appfw + static void appfwLowBatteryCB(void *user_data); + + // callback function on device orientation for tizen appfw + static void appfwDeviceOrientationCB(app_device_orientation_e orientation, + void *user_data); + + // callback function on language changed for tizen appfw + static void appfwLanguageChangedCB(void *user_data); + + // callback function on region format changed for tizen appfw + static void appfwRegionFormatChangedCB(void *user_data); + +private: + // application package name + std::string m_pkgName; + + // application id + std::string m_appid; + + // application version + std::string m_version; + + // application callbacks + app_event_callback_s m_appEventCB; +}; +#endif //__CICO_EFL_APP_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHomeScreenConfig.cpp b/lib/common/CicoGKeyFileConfig.cpp similarity index 71% rename from src/homescreen/CicoHomeScreenConfig.cpp rename to lib/common/CicoGKeyFileConfig.cpp index 9244f4e..c522c8b 100644 --- a/src/homescreen/CicoHomeScreenConfig.cpp +++ b/lib/common/CicoGKeyFileConfig.cpp @@ -9,36 +9,37 @@ //========================================================================== /** - * @file CicoHomeScreenConfig + * @file CicoGKeyFileConfig * - * @brief This file is implementation of CicoHomeScreenConfig class + * @brief This file is implementation of CicoGKeyFileConfig class */ //========================================================================== -#include "CicoHomeScreenConfig.h" -#include "CicoHomeScreenResourceConfig.h" +#include +#include "CicoGKeyFileConfig.h" +#include "CicoResourceConfig.h" //========================================================================== // public functions //========================================================================== //-------------------------------------------------------------------------- /** - * @brief CicoHomeScreenConfig::CicoHomeScreenConfig + * @brief CicoGKeyFileConfig::CicoGKeyFileConfig * Constractor */ //-------------------------------------------------------------------------- -CicoHomeScreenConfig::CicoHomeScreenConfig() +CicoGKeyFileConfig::CicoGKeyFileConfig() : m_gKeyFile(NULL) { } //-------------------------------------------------------------------------- /** - * @brief CicoHomeScreenConfig::CicoHomeScreenConfig + * @brief CicoGKeyFileConfig::CicoGKeyFileConfig * destructor */ //-------------------------------------------------------------------------- -CicoHomeScreenConfig::~CicoHomeScreenConfig() +CicoGKeyFileConfig::~CicoGKeyFileConfig() { if (NULL != m_gKeyFile) { g_key_file_free(m_gKeyFile); @@ -47,34 +48,34 @@ CicoHomeScreenConfig::~CicoHomeScreenConfig() //-------------------------------------------------------------------------- /** - * @brief CicoHomeScreenConfig::Initialize + * @brief CicoGKeyFileConfig::Initialize * read and initialize for homescreen configuration * - * @param[in] conf configuration file name + * @param[in] conf configuration file name * @return result - * @retval ICO_HS_OK success - * @retval ICO_HS_ERR error + * @retval true success + * @retval false error */ //-------------------------------------------------------------------------- -int -CicoHomeScreenConfig::Initialize(const char *conf) +bool +CicoGKeyFileConfig::Initialize(const char *conf) { GError *error = NULL; - char path[ICO_HS_TEMP_BUF_SIZE]; + char path[ICO_TEMP_BUF_SIZE]; GString *filepath; if (NULL != m_gKeyFile) { /*if initialize was done*/ - return ICO_HS_OK; + return true; } m_gKeyFile = g_key_file_new(); filepath = g_string_new("test"); - CicoHomeScreenResourceConfig::GetConfPath(path, sizeof(path)); + CicoResourceConfig::GetConfPath(path, sizeof(path)); g_string_printf(filepath, "%s/%s", path, conf); if (!g_file_test(filepath->str, G_FILE_TEST_IS_REGULAR)) { - return ICO_HS_ERR; + return false; } // load config file @@ -85,17 +86,17 @@ CicoHomeScreenConfig::Initialize(const char *conf) if (error != NULL) { ICO_WRN("%s: %s", filepath->str, error->message); g_error_free(error); - return ICO_HS_ERR; + return false; } g_string_free(filepath, TRUE); - return ICO_HS_OK; + return true; } /*--------------------------------------------------------------------------*/ /** - * @brief CicoHomeScreenConfig::ConfigGetInteger + * @brief CicoGKeyFileConfig::ConfigGetInteger * Return integer value in homescreen configuration file. * If not exist,return defaultvlaue in params. * @@ -106,15 +107,12 @@ CicoHomeScreenConfig::Initialize(const char *conf) */ /*--------------------------------------------------------------------------*/ int -CicoHomeScreenConfig::ConfigGetInteger(const char *group_name, const char *key, int default_value) +CicoGKeyFileConfig::ConfigGetInteger(const char *group_name, const char *key, int default_value) { GError *error = NULL; if (m_gKeyFile == NULL) { - /* if initialize is didn't yet */ - if (Initialize(ICO_HOMESCREEN_CONFIG_FILE) != ICO_HS_OK) { - return default_value; - } + return default_value; } int value = g_key_file_get_integer(m_gKeyFile, group_name, key, &error); @@ -128,7 +126,7 @@ CicoHomeScreenConfig::ConfigGetInteger(const char *group_name, const char *key, /*--------------------------------------------------------------------------*/ /** - * @brief CicoHomeScreenConfig::ConfigGetString + * @brief CicoGKeyFileConfig::ConfigGetString * Return string value in homescreen configuration file. * If not exist,return defaultvlaue in params. * @@ -139,16 +137,13 @@ CicoHomeScreenConfig::ConfigGetInteger(const char *group_name, const char *key, */ /*--------------------------------------------------------------------------*/ const char * -CicoHomeScreenConfig::ConfigGetString(const char *group_name, const char *key, - const char *default_value) +CicoGKeyFileConfig::ConfigGetString(const char *group_name, const char *key, + const char *default_value) { GError *error = NULL; - if (m_gKeyFile == NULL) { - /* if initialize is didn't yet */ - if (Initialize(ICO_HOMESCREEN_CONFIG_FILE) != ICO_HS_OK) { - return default_value; - } + if (m_gKeyFile == NULL) { + return default_value; } const char *value = g_key_file_get_string(m_gKeyFile, group_name, key, diff --git a/src/homescreen/CicoHomeScreenConfig.h b/lib/common/CicoGKeyFileConfig.h similarity index 75% rename from src/homescreen/CicoHomeScreenConfig.h rename to lib/common/CicoGKeyFileConfig.h index 0d4cc10..66f344b 100644 --- a/src/homescreen/CicoHomeScreenConfig.h +++ b/lib/common/CicoGKeyFileConfig.h @@ -9,13 +9,13 @@ //========================================================================== /** - * @file CicoHomeScreenConfig + * @file CicoGKeyFileConfig * - * @brief This file is definition of CicoHomeScreenConfig class + * @brief This file is definition of CicoGKeyFileConfig class */ //========================================================================== -#ifndef __CICO_HOMESCREEN_CONFIG_H__ -#define __CICO_HOMESCREEN_CONFIG_H__ +#ifndef __CICO_G_KEY_FILE_CONFIG_H__ +#define __CICO_G_KEY_FILE_CONFIG_H__ #include @@ -26,22 +26,24 @@ #define ICO_ONSCREEN_CONFIG_FILE "onscreen.conf" #define ICO_STATUSBAR_CONFIG_FILE "statusbar.conf" +#define ICO_TEMP_BUF_SIZE (256) + //-------------------------------------------------------------------------- /** * @brief */ //-------------------------------------------------------------------------- -class CicoHomeScreenConfig +class CicoGKeyFileConfig { public: // constructor - CicoHomeScreenConfig(); + CicoGKeyFileConfig(); // destructor - ~CicoHomeScreenConfig(); + ~CicoGKeyFileConfig(); // intialize - int Initialize(const char *conf); + bool Initialize(const char *conf); // get integer value int ConfigGetInteger(const char *group_name, @@ -55,13 +57,13 @@ public: private: // assignment operator - CicoHomeScreenConfig operator=(const CicoHomeScreenConfig&); + CicoGKeyFileConfig operator=(const CicoGKeyFileConfig&); // copy constructor - CicoHomeScreenConfig(const CicoHomeScreenConfig&); + CicoGKeyFileConfig(const CicoGKeyFileConfig&); private: GKeyFile *m_gKeyFile; }; -#endif // __CICO_HOMESCREEN_CONFIG_H__ +#endif // __CICO_G_KEY_FILE_CONFIG_H__ // vim: set expandtab ts=4 sw=4: diff --git a/lib/common/CicoLibString.cpp b/lib/common/CicoLibString.cpp new file mode 100644 index 0000000..0d37110 --- /dev/null +++ b/lib/common/CicoLibString.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ +#include +#include +#include +#include +#include + +using namespace std; + +/** + * @brief split string + * @param s split target + * @param d + * @param e store split word + */ +void split(const std::string &s, char d, std::vector &e) +{ + std::stringstream ss(s); + std::string it; + while(getline(ss, it, d)) { + e.push_back(it); + } + return; +} + +/** + * @brief trim + * @param s target string + * @param trim charactor + * @ret trim string + */ +std::string trim(const std::string& s, const char* t) +{ + std::string r; + std::string::size_type left = s.find_first_not_of(t); + if (left != std::string::npos) { + std::string::size_type right = s.find_last_not_of(t); + r = s.substr(left, right - left + 1); + } + return r; +} + +/** + * @brief directory last slash add + * @param s directory path string + */ +void chkAndAddSlash(std::string& s) +{ + int sz = s.size(); + const char* p = s.c_str(); + if ('/' != p[sz-1]) { + s += "/"; + } +} + diff --git a/lib/common/CicoLibString.h b/lib/common/CicoLibString.h new file mode 100644 index 0000000..e7a5289 --- /dev/null +++ b/lib/common/CicoLibString.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +#ifndef _CICOLIBSTRING_H_ +#define _CICOLIBSTRING_H_ +#include +#include + +/** + * @brief split string + * @param s split target + * @param d + * @param e store split word + */ +void split(const std::string &s, char d, std::vector &e); + +/** + * @brief trim + * @param s target string + * @param trim charactor + * @ret trim string + */ +std::string trim(const std::string& s, const char* t = " \t\v\r\n"); + +/** + * @brief directory last slash add + * @param s directory path string + */ +void chkAndAddSlash(string& s); + +#endif diff --git a/src/homescreen/CicoHomeScreenResourceConfig.cpp b/lib/common/CicoResourceConfig.cpp similarity index 59% rename from src/homescreen/CicoHomeScreenResourceConfig.cpp rename to lib/common/CicoResourceConfig.cpp index 9ba32c2..a9dea3b 100644 --- a/src/homescreen/CicoHomeScreenResourceConfig.cpp +++ b/lib/common/CicoResourceConfig.cpp @@ -12,14 +12,19 @@ * @date Feb-15-2013 */ -#include "CicoHomeScreenResourceConfig.h" +#include +#include +#include + +#include +#include "CicoResourceConfig.h" /*============================================================================*/ /* functions */ /*============================================================================*/ /*--------------------------------------------------------------------------*/ /** - * @brief CicoHomeScreenResourceConfig::GetImagePath + * @brief CicoResourceConfig::GetImagePath * set the directory path of the image files. * * @param[out] buff buffer that the pass set @@ -28,24 +33,26 @@ */ /*--------------------------------------------------------------------------*/ void -CicoHomeScreenResourceConfig::GetImagePath(char *buff, int len) +CicoResourceConfig::GetImagePath(char *buff, int len) { char *pkg; memset(buff, 0, len); pkg = getenv("PKG_NAME"); if (pkg) { - snprintf(buff, len, image_path, pkg); + snprintf(buff, len, ICO_IMAGE_PATH, pkg); } else { pkg = getenv(ICO_HS_CONFIG_TOP_ENV); - snprintf(buff, len, local_image_path, pkg ? pkg : local_top_path); + snprintf(buff, len, ICO_LOCAL_IMAGE_PATH, + pkg ? pkg : ICO_LOCAL_TOP_PATH); } + ICO_DBG("buff=\"%s\"", buff); } /*--------------------------------------------------------------------------*/ /** - * @brief CicoHomeScreenResourceConfig::GetSoundPath + * @brief CicoResourceConfig::GetSoundPath * set the directory path of the sounds files. * * @param[out] buff buffer that the pass set @@ -54,24 +61,25 @@ CicoHomeScreenResourceConfig::GetImagePath(char *buff, int len) */ /*--------------------------------------------------------------------------*/ void -CicoHomeScreenResourceConfig::GetSoundPath(char *buff, int len) +CicoResourceConfig::GetSoundPath(char *buff, int len) { char *pkg; memset(buff, 0, len); pkg = getenv("PKG_NAME"); if (pkg) { - snprintf(buff, len, sound_path, pkg); + snprintf(buff, len, ICO_SOUND_PATH, pkg); } else { pkg = getenv(ICO_HS_CONFIG_TOP_ENV); - snprintf(buff, len, local_sound_path, pkg ? pkg : local_top_path); + snprintf(buff, len, ICO_LOCAL_SOUND_PATH, + pkg ? pkg : ICO_LOCAL_TOP_PATH); } } /*--------------------------------------------------------------------------*/ /** - * @brief CicoHomeScreenResourceConfig::GetEdjPath + * @brief CicoResourceConfig::GetEdjPath * set the directory path of efj files. * * @param[out] buff buffer that the pass set @@ -80,51 +88,25 @@ CicoHomeScreenResourceConfig::GetSoundPath(char *buff, int len) */ /*--------------------------------------------------------------------------*/ void -CicoHomeScreenResourceConfig::GetEdjPath(char *buff, int len) -{ - char *pkg; - - memset(buff, 0, len); - pkg = getenv("PKG_NAME"); - if (pkg) { - snprintf(buff, len, edj_path, pkg); - } - else { - pkg = getenv(ICO_HS_CONFIG_TOP_ENV); - snprintf(buff, len, local_edj_path, pkg ? pkg : local_top_path); - } -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHomeScreenResourceConfig::GetOnscreenEdjPath - * set the directory path of edj files for onscreen. - *void -hs_get_image_path(char *buff, int len) - * @param[out] buff buffer that the pass set - * @param[in] len buffer length - * @return none - */ -/*--------------------------------------------------------------------------*/ -void -CicoHomeScreenResourceConfig::GetOnscreenEdjPath(char *buff, int len) +CicoResourceConfig::GetEdjPath(char *buff, int len) { char *pkg; memset(buff, 0, len); pkg = getenv("PKG_NAME"); if (pkg) { - snprintf(buff, len, edj_path, ICO_HS_APPID_DEFAULT_ONS); + snprintf(buff, len, ICO_EDJ_PATH, pkg); } else { pkg = getenv(ICO_HS_CONFIG_TOP_ENV); - snprintf(buff, len, local_edj_path, pkg ? pkg : local_top_path); + snprintf(buff, len, ICO_LOCAL_EDJ_PATH, + pkg ? pkg : ICO_LOCAL_TOP_PATH); } } /*--------------------------------------------------------------------------*/ /** - * @brief CicoHomeScreenResourceConfig::GetConfPath + * @brief CicoResourceConfig::GetConfPath * set the directory path of edj files for onscreen. * * @param[out] buff buffer that the pass set @@ -133,17 +115,19 @@ CicoHomeScreenResourceConfig::GetOnscreenEdjPath(char *buff, int len) */ /*--------------------------------------------------------------------------*/ void -CicoHomeScreenResourceConfig::GetConfPath(char *buff, int len) +CicoResourceConfig::GetConfPath(char *buff, int len) { char *pkg; memset(buff, 0, len); pkg = getenv("PKG_NAME"); if (pkg) { - snprintf(buff, len, manifest_path, pkg); + snprintf(buff, len, ICO_MANIFEST_PATH, pkg); } else { pkg = getenv(ICO_HS_CONFIG_TOP_ENV); - snprintf(buff, len, local_manifest_path, pkg ? pkg : local_top_path); + snprintf(buff, len, ICO_LOCAL_MANIFEST_PATH, + pkg ? pkg : ICO_LOCAL_TOP_PATH); } } +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHomeScreenResourceConfig.h b/lib/common/CicoResourceConfig.h similarity index 63% rename from src/homescreen/CicoHomeScreenResourceConfig.h rename to lib/common/CicoResourceConfig.h index 4cd87ca..8318275 100644 --- a/src/homescreen/CicoHomeScreenResourceConfig.h +++ b/lib/common/CicoResourceConfig.h @@ -1,5 +1,5 @@ -#ifndef __CICOHOMESCREENRESOURCECONFIG_H__ -#define __CICOHOMESCREENRESOURCECONFIG_H__ +#ifndef __CICO_RESOURCECONFIG_H__ +#define __CICO_RESOURCECONFIG_H__ /* * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. * @@ -14,15 +14,26 @@ * @date Feb-15-2013 */ -#include -#include -#include +//#include +//#include +//#include -#include "CicoHomeScreenCommon.h" -#include "home_screen_res.h" +//#include "CicoHomeScreenCommon.h" +//#include "home_screen_res.h" + +#define ICO_EDJ_PATH "/usr/apps/%s/res/edj/" +#define ICO_IMAGE_PATH "/usr/apps/%s/res/images/" +#define ICO_SOUND_PATH "/usr/apps/%s/res/sounds/" +#define ICO_MANIFEST_PATH "/usr/apps/%s/res/config/" +#define ICO_LOCAL_TOP_PATH "/home/tizen/HomeScreen" +#define ICO_LOCAL_EDJ_PATH "%s/src/" +#define ICO_LOCAL_IMAGE_PATH "%s/res/images/" +#define ICO_LOCAL_SOUND_PATH "%s/res/sounds/" +#define ICO_LOCAL_MANIFEST_PATH "%s/res/apps/org.tizen.ico.homescreen/" /* Environment variable for UI-FW top directory */ #define ICO_HS_CONFIG_TOP_ENV "UIFW_TOPDIR" +#if 0 /* Default top directory of UI-FW */ #define ICO_HS_CONFIG_TOP_TOPDIR "/usr/apps/org.tizen.ico.homescreen" /* Environment variable for top directory of cconfiguration files */ @@ -38,23 +49,22 @@ #define ICO_HS_CONFIG_CONF_DIR_MAX 63 /* Maximum length of Wayland connection name */ #define ICO_UXF_CONF_WAYLAND_NAME 39 +#endif /*============================================================================*/ -/* Class Declaration (CicoHomeScreenResourceConfig) */ +/* Class Declaration (CicoResourceConfig) */ /*============================================================================*/ -class CicoHomeScreenResourceConfig +class CicoResourceConfig { public: static void GetImagePath(char *buff, int len); static void GetSoundPath(char *buff, int len); static void GetEdjPath(char *buff, int len); - static void GetOnscreenEdjPath(char *buff, int len); static void GetConfPath(char *buff, int len); protected: - CicoHomeScreenResourceConfig operator = - (const CicoHomeScreenResourceConfig&); - CicoHomeScreenResourceConfig(const CicoHomeScreenResourceConfig&); + CicoResourceConfig operator = + (const CicoResourceConfig&); + CicoResourceConfig(const CicoResourceConfig&); }; - -#endif - +#endif // __CICO_RESOURCECONFIG_H__ +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoSound.cpp b/lib/common/CicoSound.cpp similarity index 86% rename from src/homescreen/CicoSound.cpp rename to lib/common/CicoSound.cpp index 4aa9343..b7241e1 100644 --- a/src/homescreen/CicoSound.cpp +++ b/lib/common/CicoSound.cpp @@ -21,9 +21,9 @@ #include #include -#include "CicoHomeScreenCommon.h" -#include "CicoHomeScreenResourceConfig.h" -#include "CicoHomeScreenConfig.h" +#include +#include "CicoResourceConfig.h" +#include "CicoGKeyFileConfig.h" #include "CicoSound.h" @@ -77,15 +77,15 @@ CicoSound::GetInstance(void) * * @param[in] homescreen_config configuration instance * @return result - * @retval ICO_HS_OK success - * @retval ICO_HS_ERR err + * @retval true success + * @retval false error */ //-------------------------------------------------------------------------- -int -CicoSound::Initialize(CicoHomeScreenConfig *hsConfig) +bool +CicoSound::Initialize(CicoGKeyFileConfig *hsConfig) { if (true == m_initialized) { - return ICO_HS_OK; + return true; } m_command = hsConfig->ConfigGetString(ICO_CONFIG_SOUND, @@ -110,7 +110,7 @@ CicoSound::Initialize(CicoHomeScreenConfig *hsConfig) m_initialized = true; - return ICO_HS_OK; + return true; } /*--------------------------------------------------------------------------*/ @@ -119,15 +119,14 @@ CicoSound::Initialize(CicoHomeScreenConfig *hsConfig) * play the given sound file(.wav). * * @return result - * @retval ICO_HS_OK success - * @retval ICO_HS_ERR err + * @retval true success + * @retval false error */ /*--------------------------------------------------------------------------*/ -int +bool CicoSound::PlayOperationSound(void) { return PlaySound(m_operationSFile); - } /*--------------------------------------------------------------------------*/ @@ -135,15 +134,14 @@ CicoSound::PlayOperationSound(void) * @brief CicoSound::PlaySuccessSound * * @return result - * @retval ICO_HS_OK success - * @retval ICO_HS_ERR err + * @retval true success + * @retval false error */ /*--------------------------------------------------------------------------*/ -int +bool CicoSound::PlaySuccessSound(void) { return PlaySound(m_successSFile); - } /*--------------------------------------------------------------------------*/ @@ -151,15 +149,14 @@ CicoSound::PlaySuccessSound(void) * @brief CicoSound::PlaySuccessSound * * @return result - * @retval ICO_HS_OK success - * @retval ICO_HS_ERR err + * @retval true success + * @retval false error */ /*--------------------------------------------------------------------------*/ -int +bool CicoSound::PlayFailureSound(void) { return PlaySound(m_failureSFile); - } /*--------------------------------------------------------------------------*/ @@ -168,28 +165,28 @@ CicoSound::PlayFailureSound(void) * play the given sound file(.wav). * * @return result - * @retval ICO_HS_OK success - * @retval ICO_HS_ERR err + * @retval true success + * @retval false error */ /*--------------------------------------------------------------------------*/ -int +bool CicoSound::PlaySound(std::string & soundFile) { int pid; - char command[ICO_HS_TEMP_BUF_SIZE]; + char command[256]; if (false == m_initialized) { - return ICO_HS_ERR; + return false; } if (true == m_operationSFile.empty()) { ICO_WRN("CicoSound::PlaySound: Leave(error file name is empty)"); - return ICO_HS_ERR; + return false; } if (m_operationSFile.at(0) != '/') { ICO_WRN("CicoSound::PlaySound: Leave(file name not absolute path"); - return ICO_HS_ERR; + return false; } /* given by full file path */ @@ -203,6 +200,6 @@ CicoSound::PlaySound(std::string & soundFile) exit(0); } - return ICO_HS_OK; + return true; } // vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoSound.h b/lib/common/CicoSound.h similarity index 91% rename from src/homescreen/CicoSound.h rename to lib/common/CicoSound.h index 98c5bb7..547ee91 100644 --- a/src/homescreen/CicoSound.h +++ b/lib/common/CicoSound.h @@ -42,19 +42,19 @@ public: static CicoSound* GetInstance(void); // initialized - int Initialize(CicoHomeScreenConfig *hs_config); + bool Initialize(CicoGKeyFileConfig *hs_config); // play sound - int PlaySound(std::string & soundFile); + bool PlaySound(std::string & soundFile); // play opreration sound - int PlayOperationSound(void); + bool PlayOperationSound(void); // play success sound - int PlaySuccessSound(void); + bool PlaySuccessSound(void); // play failure sound - int PlayFailureSound(void); + bool PlayFailureSound(void); protected: // default constructor diff --git a/lib/system-controller/CicoSCSystemConfig.cpp b/lib/common/CicoSystemConfig.cpp similarity index 84% rename from lib/system-controller/CicoSCSystemConfig.cpp rename to lib/common/CicoSystemConfig.cpp index f23b912..dc5220b 100644 --- a/lib/system-controller/CicoSCSystemConfig.cpp +++ b/lib/common/CicoSystemConfig.cpp @@ -9,26 +9,33 @@ /*========================================================================*/ /** - * @file CicoSCSystemConfig.cpp + * @file CicoSystemConfig.cpp * - * @brief This file implementation of CicoSCSystemConfig class + * @brief This file implementation of CicoSystemConfig class */ /*========================================================================*/ -#include "CicoSCSystemConfig.h" -#include "CicoSCConf.h" +#include +#include +#include +#include +#include +#include "CicoSystemConfig.h" +#include "CicoConf.h" + +using namespace boost::property_tree; //========================================================================== // private static variable //========================================================================== -CicoSCSystemConfig* CicoSCSystemConfig::ms_myInstance = NULL; +CicoSystemConfig* CicoSystemConfig::ms_myInstance = NULL; //-------------------------------------------------------------------------- /** * @brief default constructor */ //-------------------------------------------------------------------------- -CicoSCSystemConfig::CicoSCSystemConfig() +CicoSystemConfig::CicoSystemConfig() { m_typeTable[""] = ICO_NODETYPE_CENTER; m_typeTable["center"] = ICO_NODETYPE_CENTER; @@ -77,54 +84,59 @@ CicoSCSystemConfig::CicoSCSystemConfig() * @brief destructor */ //-------------------------------------------------------------------------- -CicoSCSystemConfig::~CicoSCSystemConfig() +CicoSystemConfig::~CicoSystemConfig() { // TODO } //-------------------------------------------------------------------------- /** - * @brief Get instance of CicoSCSystemConfig + * @brief Get instance of CicoSystemConfig * - * @return pointer of CicoSCSystemConfig object + * @return pointer of CicoSystemConfig object */ //-------------------------------------------------------------------------- -CicoSCSystemConfig* -CicoSCSystemConfig::getInstance(void) +CicoSystemConfig* +CicoSystemConfig::getInstance(void) { if (NULL == ms_myInstance) { - ms_myInstance = new CicoSCSystemConfig(); + ms_myInstance = new CicoSystemConfig(); } return ms_myInstance; } //-------------------------------------------------------------------------- /** - * @brief Get instance of CicoSCSystemConfig + * @brief Get instance of CicoSystemConfig * * @param [in] confFile config file name - * @return 0 on success, other on error + * @return true on success, false on error */ //-------------------------------------------------------------------------- -int -CicoSCSystemConfig::load(const string & confFile) +bool +CicoSystemConfig::load(const string & confFile) { - ptree root; - read_xml(confFile, root); - - createNodeConfList(root); - createDisplayConfList(root); - createSoundConfList(root); - createPortConf(root); - createCategoryConf(root); - createAppKindConf(root); - createInputDevList(root); - createDefaultConf(root); - createLogConf(root); - createResourceConf(root); - createUserConf(root); - - return 0; //TODO + try { + ptree root; + read_xml(confFile, root); + + createNodeConfList(root); + createDisplayConfList(root); + createSoundConfList(root); + createPortConf(root); + createCategoryConf(root); + createAppKindConf(root); + createInputDevList(root); + createDefaultConf(root); + createResourceConf(root); + createUserConf(root); + createVehicleInfoConf(root); + } + catch (...) { + ICO_ERR("catch exception!"); + return false; + } + return true; } //-------------------------------------------------------------------------- @@ -135,7 +147,7 @@ CicoSCSystemConfig::load(const string & confFile) */ //-------------------------------------------------------------------------- const vector& -CicoSCSystemConfig::getNodeConfList(void) const +CicoSystemConfig::getNodeConfList(void) const { return m_nodeConfList; } @@ -148,7 +160,7 @@ CicoSCSystemConfig::getNodeConfList(void) const */ //-------------------------------------------------------------------------- const vector& -CicoSCSystemConfig::getDisplayConfList(void) const +CicoSystemConfig::getDisplayConfList(void) const { return m_displayConfList; } @@ -161,7 +173,7 @@ CicoSCSystemConfig::getDisplayConfList(void) const */ //-------------------------------------------------------------------------- const vector& -CicoSCSystemConfig::getSoundConfList(void) const +CicoSystemConfig::getSoundConfList(void) const { return m_soundConfList; } @@ -174,7 +186,7 @@ CicoSCSystemConfig::getSoundConfList(void) const */ //-------------------------------------------------------------------------- const vector & -CicoSCSystemConfig::getInputDevConfList(void) const +CicoSystemConfig::getInputDevConfList(void) const { return m_inputDevConfList; } @@ -187,7 +199,7 @@ CicoSCSystemConfig::getInputDevConfList(void) const */ //-------------------------------------------------------------------------- const vector & -CicoSCSystemConfig::getCategoryConfList(void) const +CicoSystemConfig::getCategoryConfList(void) const { return m_categoryConfList; } @@ -200,7 +212,7 @@ CicoSCSystemConfig::getCategoryConfList(void) const */ //-------------------------------------------------------------------------- const vector & -CicoSCSystemConfig::getAppKindConfList(void) const +CicoSystemConfig::getAppKindConfList(void) const { return m_appKindConfList; } @@ -213,7 +225,7 @@ CicoSCSystemConfig::getAppKindConfList(void) const */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createNodeConfList(const ptree & root) +CicoSystemConfig::createNodeConfList(const ptree & root) { // // if (root.not_found() == root.find("systemconfig")) { @@ -271,7 +283,7 @@ CicoSCSystemConfig::createNodeConfList(const ptree & root) */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createDisplayConfList(const ptree & root) +CicoSystemConfig::createDisplayConfList(const ptree & root) { // // if (root.not_found() != root.find("systemconfi.displays")) { @@ -351,7 +363,7 @@ CicoSCSystemConfig::createDisplayConfList(const ptree & root) */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createLayerConf(const ptree::value_type & child, +CicoSystemConfig::createLayerConf(const ptree::value_type & child, CicoSCDisplayConf* displayConf) { ptree layers = child.second.get_child("layers"); @@ -402,7 +414,7 @@ CicoSCSystemConfig::createLayerConf(const ptree::value_type & child, */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createDisplayZoneConf(const ptree::value_type & child, +CicoSystemConfig::createDisplayZoneConf(const ptree::value_type & child, CicoSCDisplayConf* displayConf) { ptree zones = child.second.get_child("zones"); @@ -497,7 +509,7 @@ CicoSCSystemConfig::createDisplayZoneConf(const ptree::value_type & child, */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createSoundConfList(const ptree & root) +CicoSystemConfig::createSoundConfList(const ptree & root) { // ptree sounds = root.get_child("systemconfig.sounds"); @@ -542,7 +554,7 @@ CicoSCSystemConfig::createSoundConfList(const ptree & root) */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createSoundZoneConf(const ptree::value_type & child, +CicoSystemConfig::createSoundZoneConf(const ptree::value_type & child, CicoSCSoundConf* soundConf) { // @@ -580,7 +592,7 @@ CicoSCSystemConfig::createSoundZoneConf(const ptree::value_type & child, */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createPortConf(const ptree & root) +CicoSystemConfig::createPortConf(const ptree & root) { // ptree ports = root.get_child("systemconfig.ports"); @@ -619,7 +631,7 @@ CicoSCSystemConfig::createPortConf(const ptree & root) */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createCategoryConf(const ptree & root) +CicoSystemConfig::createCategoryConf(const ptree & root) { // ptree categorys = root.get_child("systemconfig.categorys"); @@ -688,7 +700,7 @@ CicoSCSystemConfig::createCategoryConf(const ptree & root) */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createAppKindConf(const ptree & root) +CicoSystemConfig::createAppKindConf(const ptree & root) { // ptree appkinds = root.get_child("systemconfig.appkinds"); @@ -736,7 +748,7 @@ CicoSCSystemConfig::createAppKindConf(const ptree & root) */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createInputDevList(const ptree & root) +CicoSystemConfig::createInputDevList(const ptree & root) { // ptree inputs = root.get_child("systemconfig.inputs"); @@ -772,7 +784,7 @@ CicoSCSystemConfig::createInputDevList(const ptree & root) */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createSwitchList(const ptree::value_type & child, +CicoSystemConfig::createSwitchList(const ptree::value_type & child, CicoSCInputDevConf* inputDevConf) { ptree switchs = child.second.get_child("switchs"); @@ -813,7 +825,7 @@ CicoSCSystemConfig::createSwitchList(const ptree::value_type & child, */ //-------------------------------------------------------------------------- void -CicoSCSystemConfig::createDefaultConf(const ptree & root) +CicoSystemConfig::createDefaultConf(const ptree & root) { // ptree defaults = root.get_child("systemconfig.default"); @@ -924,26 +936,6 @@ CicoSCSystemConfig::createDefaultConf(const ptree & root) //-------------------------------------------------------------------------- /** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createLogConf(const ptree & root) -{ - // - // - ptree logNode = root.get_child("systemconfig.log"); - int loglevel = logNode.get("loglevel"); - bool logflush = logNode.get("logflush"); - - m_loglevel = loglevel; - m_logflush = logflush; -} - -//-------------------------------------------------------------------------- -/** * @brief resource config class object create * * @param [in] @@ -952,32 +944,88 @@ CicoSCSystemConfig::createLogConf(const ptree & root) void getArray(ptree& t, vector& vec); static const char* g_resource_cpu = "systemconfig.resource_cpu_control"; void -CicoSCSystemConfig::createResourceConf(const ptree & root) +CicoSystemConfig::createResourceConf(const ptree & root) { m_resourceConf = new CicoSCResourceConf; ptree rc = root.get_child(g_resource_cpu); bool b = false; - optional opts = rc.get_optional("do_it"); - if (true == opts.is_initialized()) { - string v = opts.get(); - if (0 == v.compare("yes")) { - b = true; + bool bApp = false; + + ptree lcl_pt; + string fPath; + bool bF = false; + if ((CicoSCDefaultConf*)0 != m_defaultConf) { + fPath = m_defaultConf->confdir; + fPath += string("/"); + fPath += string("system_sysres.json"); + struct stat buff; + /* file check */ + memset(&buff, 0, sizeof(buff)); + if (0 == stat(fPath.c_str(), &buff)) { + read_json(fPath.c_str(), lcl_pt); + bF = true; + } + } + if (true==bF) { + try{ + if (boost::optional function = + lcl_pt.get_optional("function")) { + string v = function.get(); + if (0 == v.compare("yes")) { + b = true; + } + else if (0 == v.compare("app")) { + bApp = true; + } + } + } + catch (...) { + ICO_WRN("NG json file(%s)", fPath.c_str()); + b = false; + bApp = false; } } - m_resourceConf->m_bDoIt = b; - if (false == b) { - return; + else { + optional opts = rc.get_optional("do_it"); + if (true == opts.is_initialized()) { + string v = opts.get(); + if (0 == v.compare("yes")) { + b = true; + } + else if (0 == v.compare("app")) { + bApp = true; + } + } } + m_resourceConf->m_bDoIt = b; + m_resourceConf->m_bDoItApp = bApp; string dirnm; - optional opts2 = rc.get_optional("ctrl_dir_path"); - if (true == opts2.is_initialized()) { - dirnm = opts2.get(); + if (true == bF) { + try { + if (boost::optional ctrl_dir_path = + lcl_pt.get_optional("ctrl_dir_path")) { + dirnm = ctrl_dir_path.get(); + } + } + catch (...) { + ICO_WRN("NG json file(%s)", fPath.c_str()); + } } else { + optional opts2 = rc.get_optional("ctrl_dir_path"); + if (true == opts2.is_initialized()) { + dirnm = opts2.get(); + } + } + if (true == dirnm.empty()) { dirnm = "/sys/fs/cgroup/cpu,cpuacct/SCprivate"; } m_resourceConf->m_cpuCGRPPath = dirnm; + if (false == b) { + return; + } + optional opts; opts = rc.get_optional("sampling_wait"); if (true == opts.is_initialized()) { @@ -1034,6 +1082,90 @@ CicoSCSystemConfig::createResourceConf(const ptree & root) //-------------------------------------------------------------------------- /** + * @brief vechicle information config class object create + * + * @param [in] + */ +//-------------------------------------------------------------------------- +void +CicoSystemConfig::createVehicleInfoConf(const ptree & root) +{ + m_vehicleInfoConf = new CicoSCVehicleInfoConf(); + + ptree child = root.get_child("systemconfig.vehicle_info"); + + optional retryCnt; + optional waitTime; + + retryCnt = child.get_optional("retryCnt"); + if (false == retryCnt.is_initialized()) { + ICO_WRN("vehicle_info.retryCnt element not found"); + retryCnt = optional(0); + } + + waitTime = child.get_optional("waitTime"); + if (false == waitTime.is_initialized()) { + ICO_WRN("vehicle_info.waitTime element not found"); + waitTime = optional(0); + } + + m_vehicleInfoConf->retryCnt = retryCnt.get(); + m_vehicleInfoConf->waitTime = waitTime.get(); + + BOOST_FOREACH (const ptree::value_type& vinfo, child) { + optional id; + optional name; + optional objname; + optional property; + optional zone; + optional type; + + id = vinfo.second.get_optional(".id"); + if (false == id.is_initialized()) { + continue; + } + + name = vinfo.second.get_optional(".name"); + if (false == name.is_initialized()) { + continue; + } + + property = vinfo.second.get_optional("property"); + if (false == property.is_initialized()) { + continue; + } + + objname = vinfo.second.get_optional("objname"); + if (false == objname.is_initialized()) { + continue; + } + + zone = vinfo.second.get_optional("zone"); + if (false == zone.is_initialized()) { + continue; + } + + type = vinfo.second.get_optional("type"); + if (false == type.is_initialized()) { + continue; + } + + CicoSCVIPropertyConf* viprop = new CicoSCVIPropertyConf(); + viprop->id = id.get(); + viprop->name = name.get(); + viprop->objname = objname.get(); + viprop->property = property.get(); + viprop->zone = zone.get(); + viprop->typestr = type.get(); + viprop->type = viprop->typeStrToInt(viprop->typestr); + m_vehicleInfoConf->properties[id.get()] = viprop; + } + + m_vehicleInfoConf->dumpConf(); +} + +//-------------------------------------------------------------------------- +/** * @brief user config class object create * * @param [in] @@ -1041,7 +1173,7 @@ CicoSCSystemConfig::createResourceConf(const ptree & root) //-------------------------------------------------------------------------- static const char* g_login_user_conf = "systemconfig.login_user"; void -CicoSCSystemConfig::createUserConf(const ptree & root) +CicoSystemConfig::createUserConf(const ptree & root) { m_userConf = new CicoSCUserConf; ptree rc = root.get_child(g_login_user_conf); @@ -1063,7 +1195,7 @@ CicoSCSystemConfig::createUserConf(const ptree & root) */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::calcGeometryExpr(const string & expr, +CicoSystemConfig::calcGeometryExpr(const string & expr, CicoSCDisplayConf* conf) { int val = 0; @@ -1151,7 +1283,7 @@ CicoSCSystemConfig::calcGeometryExpr(const string & expr, */ //-------------------------------------------------------------------------- const CicoSCNodeConf* -CicoSCSystemConfig::findNodeConfbyName(const string & name) +CicoSystemConfig::findNodeConfbyName(const string & name) { vector::iterator itr; itr = m_nodeConfList.begin(); @@ -1173,7 +1305,7 @@ CicoSCSystemConfig::findNodeConfbyName(const string & name) */ //-------------------------------------------------------------------------- const CicoSCDisplayConf* -CicoSCSystemConfig::findDisplayConfbyName(const string & name) +CicoSystemConfig::findDisplayConfbyName(const string & name) { vector::iterator itr; itr = m_displayConfList.begin(); @@ -1196,7 +1328,7 @@ CicoSCSystemConfig::findDisplayConfbyName(const string & name) */ //-------------------------------------------------------------------------- const CicoSCLayerConf* -CicoSCSystemConfig::findLayerConfbyName(const string & displayName, +CicoSystemConfig::findLayerConfbyName(const string & displayName, const string & layerName) { const CicoSCDisplayConf* displayConf = NULL; @@ -1226,17 +1358,17 @@ CicoSCSystemConfig::findLayerConfbyName(const string & displayName, */ //-------------------------------------------------------------------------- const CicoSCDisplayZoneConf* -CicoSCSystemConfig::findDisplayZoneConfbyName(const string & displayName, +CicoSystemConfig::findDisplayZoneConfbyName(const string & displayName, const string & zoneName) { -// ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Enter" +// ICO_TRA("CicoSystemConfig::findDisplayZoneConfbyName Enter" // "(displayName=%s zoneNmae=%s)", // displayName.c_str(), zoneName.c_str()); const CicoSCDisplayConf* displayConf = NULL; displayConf = findDisplayConfbyName(displayName); if (NULL == displayConf) { -// ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave(NULL)"); +// ICO_TRA("CicoSystemConfig::findDisplayZoneConfbyName Leave(NULL)"); return NULL; } @@ -1246,13 +1378,13 @@ CicoSCSystemConfig::findDisplayZoneConfbyName(const string & displayName, const CicoSCDisplayZoneConf* conf = NULL; conf = const_cast(*itr); if (zoneName == conf->name) { -// ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave" +// ICO_TRA("CicoSystemConfig::findDisplayZoneConfbyName Leave" // "(0x%08x)", conf); return conf; } } -// ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave(NULL)"); +// ICO_TRA("CicoSystemConfig::findDisplayZoneConfbyName Leave(NULL)"); return NULL; } @@ -1264,7 +1396,7 @@ CicoSCSystemConfig::findDisplayZoneConfbyName(const string & displayName, */ //-------------------------------------------------------------------------- const CicoSCSoundConf* -CicoSCSystemConfig::findSoundConfbyName(const string & name) +CicoSystemConfig::findSoundConfbyName(const string & name) { vector::iterator itr; itr = m_soundConfList.begin(); @@ -1287,10 +1419,10 @@ CicoSCSystemConfig::findSoundConfbyName(const string & name) */ //-------------------------------------------------------------------------- const CicoSCSoundZoneConf* -CicoSCSystemConfig::findSoundZoneConfbyName(const string & soundName, +CicoSystemConfig::findSoundZoneConfbyName(const string & soundName, const string & zoneName) { -// ICO_DBG("CicoSCSystemConfig::findSoundZoneConfbyName Enter" +// ICO_TRA("CicoSystemConfig::findSoundZoneConfbyName Enter" // "(soundName=%s zoneNmae=%s)", // soundName.c_str(), zoneName.c_str()); @@ -1321,7 +1453,7 @@ CicoSCSystemConfig::findSoundZoneConfbyName(const string & soundName, */ //-------------------------------------------------------------------------- const CicoSCInputDevConf* -CicoSCSystemConfig::findInputDevConfbyName(const string & name) +CicoSystemConfig::findInputDevConfbyName(const string & name) { vector::iterator itr; itr = m_inputDevConfList.begin(); @@ -1344,7 +1476,7 @@ CicoSCSystemConfig::findInputDevConfbyName(const string & name) */ //-------------------------------------------------------------------------- const CicoSCSwitchConf* -CicoSCSystemConfig::findSwitchConfbyName(const string & inputDevName, +CicoSystemConfig::findSwitchConfbyName(const string & inputDevName, const string & switchName) { const CicoSCInputDevConf* inputDevConf = NULL; @@ -1377,7 +1509,7 @@ CicoSCSystemConfig::findSwitchConfbyName(const string & inputDevName, */ //-------------------------------------------------------------------------- const CicoSCAppKindConf* -CicoSCSystemConfig::findAppKindConfbyName(const string & name) +CicoSystemConfig::findAppKindConfbyName(const string & name) { vector::iterator itr; itr = m_appKindConfList.begin(); @@ -1400,7 +1532,7 @@ CicoSCSystemConfig::findAppKindConfbyName(const string & name) */ //-------------------------------------------------------------------------- const CicoSCDisplayZoneConf* -CicoSCSystemConfig::findDisplayZoneConfbyId(int id) +CicoSystemConfig::findDisplayZoneConfbyId(int id) { vector::iterator itr; itr = m_displayConfList.begin(); @@ -1425,7 +1557,7 @@ CicoSCSystemConfig::findDisplayZoneConfbyId(int id) */ //-------------------------------------------------------------------------- const CicoSCSoundZoneConf* -CicoSCSystemConfig::findSoundZoneConfbyId(int id) +CicoSystemConfig::findSoundZoneConfbyId(int id) { vector::iterator itr; itr = m_soundConfList.begin(); @@ -1450,7 +1582,7 @@ CicoSCSystemConfig::findSoundZoneConfbyId(int id) */ //-------------------------------------------------------------------------- const CicoSCCategoryConf* -CicoSCSystemConfig::findCategoryConfbyName(const string & name) +CicoSystemConfig::findCategoryConfbyName(const string & name) { vector::iterator itr; itr = m_categoryConfList.begin(); @@ -1474,7 +1606,7 @@ CicoSCSystemConfig::findCategoryConfbyName(const string & name) */ //-------------------------------------------------------------------------- const CicoSCCategoryConf* -CicoSCSystemConfig::findCategoryConfbyId(int id) +CicoSystemConfig::findCategoryConfbyId(int id) { vector::iterator itr; itr = m_categoryConfList.begin(); @@ -1497,7 +1629,7 @@ CicoSCSystemConfig::findCategoryConfbyId(int id) */ //-------------------------------------------------------------------------- const CicoSCAppKindConf * -CicoSCSystemConfig::findAppKindConfbyId(int id) +CicoSystemConfig::findAppKindConfbyId(int id) { vector::iterator itr; itr = m_appKindConfList.begin(); @@ -1518,7 +1650,7 @@ CicoSCSystemConfig::findAppKindConfbyId(int id) */ //-------------------------------------------------------------------------- const CicoSCDefaultConf* -CicoSCSystemConfig::getDefaultConf(void) +CicoSystemConfig::getDefaultConf(void) { return m_defaultConf; } @@ -1531,7 +1663,7 @@ CicoSCSystemConfig::getDefaultConf(void) */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getNodeIdbyName(const string & name) +CicoSystemConfig::getNodeIdbyName(const string & name) { const CicoSCNodeConf* conf = NULL; conf = findNodeConfbyName(name); @@ -1550,7 +1682,7 @@ CicoSCSystemConfig::getNodeIdbyName(const string & name) */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getDisplayIdbyName(const string & name) +CicoSystemConfig::getDisplayIdbyName(const string & name) { const CicoSCDisplayConf* conf = NULL; conf = findDisplayConfbyName(name); @@ -1569,7 +1701,7 @@ CicoSCSystemConfig::getDisplayIdbyName(const string & name) */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getLayerIdfbyName(const string & displayName, +CicoSystemConfig::getLayerIdfbyName(const string & displayName, const string & layerName) { const CicoSCLayerConf* conf = NULL; @@ -1589,7 +1721,7 @@ CicoSCSystemConfig::getLayerIdfbyName(const string & displayName, */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getDizplayZoneIdbyName(const string & displayName, +CicoSystemConfig::getDizplayZoneIdbyName(const string & displayName, const string & zoneName) { const CicoSCDisplayZoneConf* conf = NULL; @@ -1609,7 +1741,7 @@ CicoSCSystemConfig::getDizplayZoneIdbyName(const string & displayName, */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getDizplayZoneIdbyFullName(const string & zoneFullName) +CicoSystemConfig::getDizplayZoneIdbyFullName(const string & zoneFullName) { string::size_type index = zoneFullName.find(".", 0); if (string::npos == index) { @@ -1635,7 +1767,7 @@ CicoSCSystemConfig::getDizplayZoneIdbyFullName(const string & zoneFullName) */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getSoundIdbyName(const string & name) +CicoSystemConfig::getSoundIdbyName(const string & name) { const CicoSCSoundConf* conf = NULL; conf = findSoundConfbyName(name); @@ -1654,7 +1786,7 @@ CicoSCSystemConfig::getSoundIdbyName(const string & name) */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getSoundZoneIdbyName(const string & soundName, +CicoSystemConfig::getSoundZoneIdbyName(const string & soundName, const string & zoneName) { const CicoSCSoundZoneConf* conf = NULL; @@ -1674,7 +1806,7 @@ CicoSCSystemConfig::getSoundZoneIdbyName(const string & soundName, */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getSoundZoneIdbyFullName(const string & zoneFullName) +CicoSystemConfig::getSoundZoneIdbyFullName(const string & zoneFullName) { string::size_type index = zoneFullName.find(".", 0); if (string::npos == index) { @@ -1700,7 +1832,7 @@ CicoSCSystemConfig::getSoundZoneIdbyFullName(const string & zoneFullName) */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getInputDevIdbyName(const string & name) +CicoSystemConfig::getInputDevIdbyName(const string & name) { const CicoSCInputDevConf* conf = NULL; conf = findInputDevConfbyName(name); @@ -1719,7 +1851,7 @@ CicoSCSystemConfig::getInputDevIdbyName(const string & name) */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getSwitchIdbyName(const string & inputDevName, +CicoSystemConfig::getSwitchIdbyName(const string & inputDevName, const string & switchName) { const CicoSCSwitchConf* conf = NULL; @@ -1739,7 +1871,7 @@ CicoSCSystemConfig::getSwitchIdbyName(const string & inputDevName, */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getAppKindIdbyName(const string & name) +CicoSystemConfig::getAppKindIdbyName(const string & name) { const CicoSCAppKindConf* conf = NULL; conf = findAppKindConfbyName(name); @@ -1758,7 +1890,7 @@ CicoSCSystemConfig::getAppKindIdbyName(const string & name) */ //-------------------------------------------------------------------------- int -CicoSCSystemConfig::getCategoryIdbyName(const string & name) +CicoSystemConfig::getCategoryIdbyName(const string & name) { const CicoSCCategoryConf* conf = NULL; conf = findCategoryConfbyName(name); @@ -1777,7 +1909,7 @@ CicoSCSystemConfig::getCategoryIdbyName(const string & name) */ //-------------------------------------------------------------------------- const CicoSCCategoryConf* -CicoSCSystemConfig::getCategoryObjbyCaategoryID(int id) +CicoSystemConfig::getCategoryObjbyCaategoryID(int id) { if (-1 == id) { return NULL; @@ -1802,6 +1934,19 @@ CicoSCSystemConfig::getCategoryObjbyCaategoryID(int id) * @param [in] */ //-------------------------------------------------------------------------- +CicoSCVehicleInfoConf* +CicoSystemConfig::getVehicleInfoConf(void) +{ + return m_vehicleInfoConf; +} + +//-------------------------------------------------------------------------- +/** + * @brief array xml tree to vector + * + * @param [in] + */ +//-------------------------------------------------------------------------- void getArray(ptree& t, vector& vec) { vec.clear(); diff --git a/lib/system-controller/CicoSCSystemConfig.h b/lib/common/CicoSystemConfig.h similarity index 89% rename from lib/system-controller/CicoSCSystemConfig.h rename to lib/common/CicoSystemConfig.h index 3e8a1cd..74bd248 100644 --- a/lib/system-controller/CicoSCSystemConfig.h +++ b/lib/common/CicoSystemConfig.h @@ -9,13 +9,13 @@ //========================================================================== /** - * @file CicoSCSystemConfig.h + * @file CicoSystemConfig.h * - * @brief This file is definition of CicoSCSystemConfig class + * @brief This file is definition of CicoSystemConfig class */ //========================================================================== -#ifndef __CICO_SC_SYSTEM_CONFIG_H__ -#define __CICO_SC_SYSTEM_CONFIG_H__ +#ifndef __CICO_SYSTEM_CONFIG_H__ +#define __CICO_SYSTEM_CONFIG_H__ #include #include @@ -46,6 +46,7 @@ class CicoSCInputDevConf; class CicoSCDefaultConf; class CicoSCResourceConf; class CicoSCUserConf; +class CicoSCVehicleInfoConf; #endif //========================================================================== @@ -53,12 +54,12 @@ class CicoSCUserConf; * @brief This class has function of access to system config information */ //========================================================================== -class CicoSCSystemConfig +class CicoSystemConfig { public: - static CicoSCSystemConfig* getInstance(void); + static CicoSystemConfig* getInstance(void); - int load(const string & confFile); + bool load(const string & confFile); const vector & getNodeConfList(void) const; const vector & getDisplayConfList(void) const; @@ -120,18 +121,20 @@ public: return m_userConf; }; + CicoSCVehicleInfoConf* getVehicleInfoConf(void); + private: // default constructor - CicoSCSystemConfig(); + CicoSystemConfig(); // destructor - ~CicoSCSystemConfig(); + ~CicoSystemConfig(); // assignment operator - CicoSCSystemConfig& operator=(const CicoSCSystemConfig &object); + CicoSystemConfig& operator=(const CicoSystemConfig &object); // copy constructor - CicoSCSystemConfig(const CicoSCSystemConfig &object); + CicoSystemConfig(const CicoSystemConfig &object); void createNodeConfList(const ptree & root); void createDisplayConfList(const ptree & root); @@ -150,14 +153,14 @@ private: void createSwitchList(const ptree::value_type & child, CicoSCInputDevConf* inputDevConf); void createDefaultConf(const ptree & root); - void createLogConf(const ptree & root); void createResourceConf(const ptree & root); void createUserConf(const ptree & root); + void createVehicleInfoConf(const ptree & root); int calcGeometryExpr(const string & expr, CicoSCDisplayConf* conf); private: - static CicoSCSystemConfig* ms_myInstance; + static CicoSystemConfig* ms_myInstance; string m_confFile; map m_typeTable; map m_displayTypeTable; @@ -171,11 +174,10 @@ private: vector m_appKindConfList; int m_sysconPort; int m_soundPluginPort; - int m_loglevel; - bool m_logflush; CicoSCDefaultConf *m_defaultConf; CicoSCResourceConf *m_resourceConf; CicoSCUserConf *m_userConf; + CicoSCVehicleInfoConf *m_vehicleInfoConf; }; -#endif // __CICO_SC_SYSTEM_CONFIG_H__ +#endif // __CICO_SYSTEM_CONFIG_H__ // vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/Cico_aul_listen_app.cpp b/lib/common/Cico_aul_listen_app.cpp similarity index 98% rename from src/homescreen/Cico_aul_listen_app.cpp rename to lib/common/Cico_aul_listen_app.cpp index 6e14ed5..cd295dd 100644 --- a/src/homescreen/Cico_aul_listen_app.cpp +++ b/lib/common/Cico_aul_listen_app.cpp @@ -99,3 +99,4 @@ bool aul_listen_app_dead_signal_add(int (*func) (int, void *), void *data) dead_p.push_back(data); return true; } +// vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/Cico_aul_listen_app.h b/lib/common/Cico_aul_listen_app.h similarity index 94% rename from lib/system-controller/Cico_aul_listen_app.h rename to lib/common/Cico_aul_listen_app.h index f650e3b..e112c84 100644 --- a/lib/system-controller/Cico_aul_listen_app.h +++ b/lib/common/Cico_aul_listen_app.h @@ -19,3 +19,4 @@ int aul_listen_app_dead_signal_add(int (*func) (int, void *), void *data); void initAulListenXSignal(); #endif +// vim:set expandtab ts=4 sw=4: diff --git a/lib/common/Makefile.am b/lib/common/Makefile.am new file mode 100644 index 0000000..cd74b11 --- /dev/null +++ b/lib/common/Makefile.am @@ -0,0 +1,49 @@ +AM_CPPFLAGS = $(GCC_CXXFLAGS) + +noinst_LTLIBRARIES =\ + libico-common.la + +#lib_LTLIBRARIES =\ +# libico-system-controller.la + +libico_common_la_LDFLAGS = -version-info 0:9:0 +libico_common_la_SOURCES = \ + CicoEFLApp.cpp \ + CicoSystemConfig.cpp \ + CicoAilItems.cpp \ + CicoAulItems.cpp \ + Cico_aul_listen_app.cpp \ + CicoGKeyFileConfig.cpp \ + CicoResourceConfig.cpp \ + CicoSound.cpp \ + CicoLibString.cpp + +libico_common_la_CPPFLAGS = \ + $(GCC_CXXFLAGS) \ + @ECORE_CFLAGS@ \ + @EINA_CFLAGS@ \ + @GLIB_CFLAGS@ \ + @AIL_CFLAGS@ \ + @BUNDLE_CFLAGS@ \ + @AUL_CFLAGS@ \ + @PKGMGR_CFLAGS@ \ + @CAPIAPPFWAPPLICATION_CFLAGS@ \ + $(UWS_CFLAGS) \ + -I../../include + +libico_common_la_LIBADD = \ + @ECORE_LIBS@ \ + @EINA_LIBS@ \ + @GLIB_LIBS@ \ + @AIL_LIBS@ \ + @BUNDLE_LIBS@ \ + @AUL_LIBS@ \ + @PKGMGR_LIBS@ \ + @CAPIAPPFWAPPLICATION_LIBS@ \ + $(UWS_LIBS) + +AM_LDFLAGS = -module -avoid-version -rpath $(libdir) + +.FORCE : + +# vim:set ts=4 sw=4: diff --git a/lib/system-controller/CicoSCAppResourceController.cpp b/lib/system-controller/CicoSCAppResourceController.cpp new file mode 100644 index 0000000..12b6ff7 --- /dev/null +++ b/lib/system-controller/CicoSCAppResourceController.cpp @@ -0,0 +1,446 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "CicoLog.h" +#include "CicoSCCommand.h" +#include "CicoSCSysResourceController.h" +#include "CicoSCAppResourceController.h" +#include "CicoSCLifeCycleController.h" +#include "CicoSCUserManager.h" +#include "CicoConf.h" +#include "CicoSystemConfig.h" +#include "CicoLibString.h" +#include +//#include + +/** + * @brief constructor + */ +CicoSCAppResourceController::CicoSCAppResourceController() +{ + ICO_TRA("start"); + m_bDoItApp = false; + m_filepath.clear(); + ICO_TRA("end"); +} + +/** + * @brief destructor + */ +CicoSCAppResourceController::~CicoSCAppResourceController() +{ + ICO_TRA("start"); + ICO_TRA("end"); +} + +/** + * @brief startAppResource + */ +bool CicoSCAppResourceController::initAppResource() +{ + ICO_TRA("start"); + if (true == m_bDoIt) { + ICO_TRA("end"); + return false; + } + if (0 == m_rConf) { + ICO_TRA("end"); + return false; + } + m_bDoItApp = m_rConf->m_bDoItApp; + if (false == m_bDoItApp) { + ICO_TRA("end"); + return false; + } + m_filepath.clear(); + ICO_TRA("end"); + return true; +} + +/** + * @brief startAppResource + */ +bool CicoSCAppResourceController::startAppResource(const string& un) +{ + ICO_TRA("start %s", un.c_str()); + if (false == m_bDoItApp) { + ICO_TRA("end"); + return false; + } + + string fn; + getAppResourceFilePath(un, fn); + if (false == orderApps(fn)) { + ICO_TRA("end"); + return false; + } + m_filepath = fn; + ICO_TRA("end"); + return true; +} + +/** + * @brief get application resouce file path + * @param un user name + * @param fi file path application resource file + */ +void CicoSCAppResourceController::getAppResourceFilePath(const string& un, + string& fp) const +{ + CicoSCUserManager *cscum = CicoSCUserManager::getInstance(); + cscum->getWorkingDir(un, fp); + fp += D_STRappResource; +} + +/** + * @brief oder application resource + */ +bool CicoSCAppResourceController::orderApps(const string& filepath) +{ + ICO_TRA("start"); + if (false == m_bDoItApp) { + ICO_TRA("end"); + return false; + } + clearApps(); + + if (false == readApps(filepath)) { + ICO_TRA("end fail:read"); + return false; + } + + // read finish + if (0 == m_vAppid.size()) { + ICO_TRA("end fail read2"); + return false; + } + init_cgroup_app_dir(); + init_cgroup_app_cpushare(); + return false; +} + +/** + * @brief read app + * @param filepath file name (full path) + */ +bool CicoSCAppResourceController::readApps(const string& filepath) +{ + ICO_TRA("start file:%s", filepath.c_str()); + if (false == m_bDoItApp) { + ICO_TRA("end"); + return false; + } + bool bR = false; + double d1 = 1024.0; + double d2 = 100.0; +#if 0 // TODO + // text file read + ifstream ifs(filepath.c_str()); + char sBuff[256]; + while(ifs.getline(sBuff,sizeof(sBuff))) { + string tagApp(sBuff); + if (true == tagApp.empty()) { + continue; + } + vector vTmp; + split(tagApp, ',', vTmp); + if (2 == vTmp.size()) { + string appid = trim(vTmp[0]); + string share = trim(vTmp[1]); + int iShare = atoi(share.c_str()); + if (0 != iShare) { + if (100 < iShare) { + ICO_DBG("change %d -> 100", iShare); + iShare = 100; + } + iShare = (int)(d1 * ((double)iShare) / d2); + ICO_DBG("TARGET_OK %s, %d", appid.c_str(), iShare); + m_vAppid.push_back(appid); + m_vShares.push_back(iShare); + bR = true; + } + else { + ICO_DBG("TARGET_NG %s, >> %s <<", appid.c_str(), share.c_str()); + } + + } + else { + ICO_DBG("TARGET_NG >> %s <<", sBuff); + } + vTmp.clear(); + } + ifs.close(); +#else + struct stat buff; + /* file check */ + memset(&buff, 0, sizeof(buff)); + if (0 != stat(filepath.c_str(), &buff)) { + ICO_TRA("end"); + return false; + } + bool bStt=true; + // json read + try { + ptree pt; + read_json(filepath.c_str(), pt); + // cpu_shares + BOOST_FOREACH (const ptree::value_type& child, + pt.get_child(DSTRcpu_shares)) { + const ptree& info = child.second; + + string appid; + int iShareO; + // cpu_shares.share + if (boost::optional iVal = info.get_optional(DSTRshare)) { + iShareO = iVal.get(); + } + else { + ICO_DBG("NG get share"); + bStt=false; + break; // break of BOOST_FOREACH + } + + // cpu_shares.appid + if (boost::optional sVal = + info.get_optional(DSTRappid)) { + appid = sVal.get(); + } + else { + ICO_DBG("NG get appid"); + bStt=false; + break; // break of BOOST_FOREACH + } + // DATA get! + int iShare = iShareO; + if (100 < iShare) { + iShare = 100; + } + iShare = (int)(d1 * ((double)iShare) / d2); + ICO_DBG("TARGET_GET %d(%d), %s", iShare, iShareO, appid.c_str()); + m_vAppid.push_back(appid); + m_vShares.push_back(iShare); + bR = true; + } + } + catch (...) { + ICO_WRN("NG read(%s)", filepath.c_str()); + bStt = false; + } + if (false == bStt) { + m_vAppid.clear(); + m_vShares.clear(); + ICO_TRA("end %d", (int)bR); + return false; + } +#endif + ICO_DBG("read %d, %d, %d, %d", m_vAppid.size(), m_vShares.size(), + m_RCCpuTasks.size(), m_RCCpuShares.size()); + ICO_TRA("end %d", (int)bR); + return bR; +} + +/** + * @brief initialize cgroup application + */ +void CicoSCAppResourceController::init_cgroup_app_dir() +{ + ICO_TRA("start"); + if (false == m_bDoItApp) { + ICO_TRA("end"); + return; + } + string sTasks(D_STRtasks); + string sShares(D_STRcpushares); + string t1(m_rConf->m_cpuCGRPPath); + chkAndAddSlash(t1); + + string tDir1(m_rConf->m_cpuCGRPPath); + vector d; + d.push_back(tDir1); + chkAndAddSlash(tDir1); + + vector::iterator it = m_vAppid.begin(); + for (; it != m_vAppid.end(); it++) { + // make cgroup apps directroy full path + string tDir2(tDir1); + tDir2 += *it; + d.push_back(tDir2); + chkAndAddSlash(tDir2); + // make cgroup tasks file full path + string tDir3tasks(tDir2); + tDir3tasks += sTasks; + m_RCCpuTasks.push_back(tDir3tasks); + // make cgroup cpu.shares file full path + string tDir4cpushare(tDir2); + tDir4cpushare += sShares; + m_RCCpuShares.push_back(tDir4cpushare); + } + make_directorys(d); + ICO_TRA("end"); + return; +} + +/** + * @brief initialize cgroup application + */ +void CicoSCAppResourceController::init_cgroup_app_cpushare() +{ + ICO_TRA("start"); + if (false == m_bDoItApp) { + ICO_TRA("end"); + return; + } + + vector::iterator itDir = m_RCCpuShares.begin(); + vector::iterator itShare = m_vShares.begin(); + while (itDir != m_RCCpuShares.end()) { + replaceCgroupFile(*itDir, *itShare); + ++itDir; + ++itShare; + } + ICO_TRA("end"); + return; +} + +/** + * @brief clear Apps + */ +bool CicoSCAppResourceController::clearApps() +{ + ICO_TRA("start"); + if (false == m_bDoItApp) { + ICO_TRA("end"); + return false; + } + m_vAppid.clear(); + m_vShares.clear(); + m_RCCpuTasks.clear(); + m_RCCpuShares.clear(); + ICO_TRA("end fail:read"); + return true; +} + +/** + * @brief entry + * @param appid + * @param pid + */ +bool CicoSCAppResourceController::entryApp(const string& appid, int pid) +{ + ICO_TRA("start appid(%s), pid(%d)", appid.c_str(), pid); + if (false == m_bDoItApp) { + ICO_TRA("end"); + return false; + } + vector::iterator itTasks = m_RCCpuTasks.begin(); + vector::iterator itAppid = m_vAppid.begin(); + string tasks; + tasks.clear(); + while (itTasks != m_RCCpuTasks.end()) { + if (0 == (*itAppid).compare(appid.c_str())) { + tasks = *itTasks; + break; + } + ++itTasks; + ++itAppid; + } + if (true == tasks.empty()) { + ICO_TRA("end no match appid"); + return false; + } + replaceCgroupFile(tasks, pid); + ICO_TRA("end write cgroup %s, %d", tasks.c_str(), pid); + return true; +} + +/** + * @brief entry application's + * @param vAulItem + */ +bool CicoSCAppResourceController::entryApps(vector& vAulItem) +{ + ICO_TRA("start size(%d)", vAulItem.size()); + if (false == m_bDoItApp) { + ICO_TRA("end"); + return false; + } + bool bR = false; + vector::iterator it = vAulItem.begin(); + while (it != vAulItem.end()) { + entryApp(it->m_appid, it->m_pid); + bR = true; + ++it; + } + ICO_TRA("end %s", bR? "true": "false"); + return bR; +} + +/** + * @brief create applications Resource file + * @param file path create target + */ +void CicoSCAppResourceController::createAppResourceFile(const string& filepath) +{ + ICO_TRA("start %s", filepath.c_str()); +#if 0 + ofstream ofs; + ofs.open(filepath.c_str(), ios::trunc); + const vector& vAil = + CicoSCLifeCycleController::getInstance()->getAilList(); + vector::const_iterator it = vAil.begin(); + for (; it != vAil.end(); ++it) { + ofs << (*it).m_appid << ",100" << endl; + } + ofs.close(); +#else + try{ + ptree pt; + ptree child; + + const vector& vAil = + CicoSCLifeCycleController::getInstance()->getAilList(); + vector::const_iterator it = vAil.begin(); + for (; it != vAil.end(); ++it) { + { + ptree info; + info.put(DSTRshare, 100); + info.put(DSTRappid, (*it).m_appid.c_str()); + child.push_back(std::make_pair("", info)); + } + } + pt.add_child(DSTRcpu_shares, child); + write_json(filepath.c_str(), pt); + } + catch (std::exception const& e) { + ICO_WRN("catch exception %s", e.what()); + } + catch (...) { + ICO_WRN("NG write(%s)", filepath.c_str()); + } + +#endif + ICO_TRA("end"); +} diff --git a/lib/system-controller/CicoSCAppResourceController.h b/lib/system-controller/CicoSCAppResourceController.h new file mode 100644 index 0000000..0f6250f --- /dev/null +++ b/lib/system-controller/CicoSCAppResourceController.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ +/** + * @brief CicoSCAppResourceController + * SystemController resource + * Application Resouce Controller + * + * @date Aug-05-2013 create start + */ + +#ifndef CICOSCAPPRESOURCECONTROLLER_H +#define CICOSCAPPRESOURCECONTROLLER_H +#include +#include +#include + +#include "CicoAilItems.h" +#include "CicoAulItems.h" +#include "CicoSCSysResourceController.h" + +#define D_STRappResource "appResource.json" +#define DSTRcpu_shares "cpu_shares" +#define DSTRshare "share" +#define DSTRappid "appid" +/** + * @brief System Controller Application Resource Controller class + */ +class CicoSCAppResourceController : public CicoSCSysResourceController +{ +public: + CicoSCAppResourceController(); + ~CicoSCAppResourceController(); + + bool initAppResource(); + bool startAppResource(const std::string& un); + bool clearApps(); + + bool isAppResource(); + + bool entryApp(const std::string& appid, int pid); + bool entryApps(std::vector& vAulItem); + + void getAppResourceFilePath(const std::string& un, std::string& fp) const; + void createAppResourceFile(const std::string& filepath); +protected: + bool orderApps(const std::string& filepath); + bool readApps(const std::string& filepath); + void init_cgroup_app_dir(); + void init_cgroup_app_cpushare(); + +protected: + bool m_bDoItApp; +private: + + std::vector m_vAppid; + std::vector m_vShares; + std::string m_filepath; +}; + +inline bool CicoSCAppResourceController::isAppResource() +{ + return m_bDoItApp; +} + +#endif // CICOSCAPPRESOURCECONTROLLER_H diff --git a/lib/system-controller/CicoSCCommand.cpp b/lib/system-controller/CicoSCCommand.cpp index cec8a1f..40d9524 100644 --- a/lib/system-controller/CicoSCCommand.cpp +++ b/lib/system-controller/CicoSCCommand.cpp @@ -74,7 +74,7 @@ CicoSCCommand::~CicoSCCommand() int CicoSCCommand::parseMessage(const char *message) { -// ICO_DBG("CicoSCCommand::parseMessage Enter(%s)", message); +// ICO_TRA("CicoSCCommand::parseMessage Enter(%s)", message); try { stringstream jsonString(message); ptree root; @@ -110,11 +110,11 @@ CicoSCCommand::parseMessage(const char *message) catch (std::exception const& e) { ICO_WRN("catch exception %s", e.what()); -// ICO_ERR("CicoSCCommand::parseMessage Leave(EINVAL)"); +// ICO_TRA("CicoSCCommand::parseMessage Leave(EINVAL)"); return ICO_SYC_EINVAL; } -// ICO_DBG("CicoSCCommand::parseMessage Leave(EOK)"); +// ICO_TRA("CicoSCCommand::parseMessage Leave(EOK)"); return ICO_SYC_EOK; } @@ -126,7 +126,7 @@ CicoSCCommand::parseMessage(const char *message) void CicoSCCommand::dump(void) { - ICO_DBG("Command: cmdid=0x%08X appid=%s pid=%d", cmdid, appid.c_str(), pid); + ICO_INF("Command: cmdid=0x%08X appid=%s pid=%d", cmdid, appid.c_str(), pid); if (NULL != this->opt) { this->opt->dump(); } diff --git a/lib/system-controller/CicoSCCommand.h b/lib/system-controller/CicoSCCommand.h index 1145afd..719143e 100644 --- a/lib/system-controller/CicoSCCommand.h +++ b/lib/system-controller/CicoSCCommand.h @@ -71,7 +71,6 @@ public: animation.c_str(), animationTime, x, y, width, height, raise, visible, active, framerate, stride, format); - } int nodeid; //!< id of node @@ -169,7 +168,7 @@ class CicoSCCmdResCtrlOpt : public CicoSCCommandOption public: /// default constructor CicoSCCmdResCtrlOpt() - : dispres(false), dispzone(""), winname(""), surfaceid(-1), + : dispres(false), dispzone(""), layerid(-1), winname(""), surfaceid(-1), animation(""), animationTime(0), soundres(false), soundzone(""), soundname(""), adjust(0), inputres(false), device(""), input(0), type(0) {} @@ -181,11 +180,11 @@ public: void dump(void) { ICO_DBG("ResCtrlOpt: " - "diapres=%s dispzone=%s winname=%s srufaceid=0x%08X " + "diapres=%s dispzone=%s layerid=%d winname=%s srufaceid=0x%08X " "animation=%s animatime=%d soundres=%s soundzone=%s" "soundname=%s soundid=%d adjust=%d inputres=%s " "device=%s input=%d type=%d", - dispres ? "true" : "false", dispzone.c_str(), + dispres ? "true" : "false", dispzone.c_str(), layerid, winname.c_str(), surfaceid, animation.c_str(), animationTime, soundres ? "true" : "false", soundzone.c_str(), soundname.c_str(), @@ -195,6 +194,7 @@ public: bool dispres; //!< flag of display resource std::string dispzone; //!< name of display zone + int layerid; //!< id of window layer std::string winname; //!< name of window int surfaceid; //!< id of surface std::string animation; //!< name of animation diff --git a/lib/system-controller/CicoSCDisplay.cpp b/lib/system-controller/CicoSCDisplay.cpp index 21f8584..1331a35 100644 --- a/lib/system-controller/CicoSCDisplay.cpp +++ b/lib/system-controller/CicoSCDisplay.cpp @@ -91,19 +91,19 @@ CicoSCDisplay::dump(void) CicoSCDisplayZone* CicoSCDisplay::findDisplayZonebyFullName(const string & fullname) { -// ICO_DBG("CicoSCDisplay:findDisplayZonebyFullName Enter" +// ICO_TRA("CicoSCDisplay:findDisplayZonebyFullName Enter" // "(fullname=%s)", fullname.c_str()); std::map::iterator itr; itr = zoneList.begin(); for (; itr != zoneList.end(); ++itr) { if (itr->second->fullname == fullname) { -// ICO_DBG("CicoSCDisplay:findDisplayZonebyFullName Leave(found)"); +// ICO_TRA("CicoSCDisplay:findDisplayZonebyFullName Leave(found)"); return itr->second; } } -// ICO_DBG("CicoSCDisplay:findDisplayZonebyFullName Leave(not found)"); +// ICO_TRA("CicoSCDisplay:findDisplayZonebyFullName Leave(not found)"); return NULL; } // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCInputController.cpp b/lib/system-controller/CicoSCInputController.cpp index 7460d09..15d6fec 100644 --- a/lib/system-controller/CicoSCInputController.cpp +++ b/lib/system-controller/CicoSCInputController.cpp @@ -27,8 +27,8 @@ using namespace std; #include "ico_syc_error.h" #include "ico_syc_msg_cmd_def.h" #include "ico_syc_private.h" -#include "CicoSCSystemConfig.h" -#include "CicoSCConf.h" +#include "CicoSystemConfig.h" +#include "CicoConf.h" #include "CicoSCCommand.h" #include "CicoSCServer.h" #include "CicoSCMessage.h" @@ -61,7 +61,7 @@ int initDB(void) { const vector& inputDevConfList = - CicoSCSystemConfig::getInstance()->getInputDevConfList(); + CicoSystemConfig::getInstance()->getInputDevConfList(); vector::const_iterator itr; itr = inputDevConfList.begin(); for (; itr != inputDevConfList.end(); ++itr) { @@ -99,7 +99,7 @@ initDB(void) void CicoSCInputController::handleCommand(const CicoSCCommand *cmd) { - ICO_DBG("CicoSCInputController::handleCommand Enter" + ICO_TRA("CicoSCInputController::handleCommand Enter" "(cmdid=0x%08X)", cmd->cmdid); CicoSCCmdInputDevCtrlOpt *opt; @@ -138,7 +138,7 @@ CicoSCInputController::handleCommand(const CicoSCCommand *cmd) break; } - ICO_DBG("CicoSCInputController::handleCommand Leave"); + ICO_TRA("CicoSCInputController::handleCommand Leave"); } //-------------------------------------------------------------------------- @@ -159,14 +159,14 @@ CicoSCInputController::addInputApp(const string &appid, int fix, int keycode) { - ICO_DBG("CicoSCInputController::addInputApp Enter" + ICO_TRA("CicoSCInputController::addInputApp Enter" "(appid=%s device=%s input=%d fix=%d keycode=%d)", appid.c_str(), device.c_str(), input, fix, keycode); CicoSCWlInputMgrIF::addInputApp(appid.c_str(), device.c_str(), input, fix, keycode); - ICO_DBG("CicoSCInputController::addInputApp Leave(EOK)"); + ICO_TRA("CicoSCInputController::addInputApp Leave(EOK)"); return ICO_SYC_EOK; } @@ -184,13 +184,13 @@ CicoSCInputController::delInputApp(const string &appid, const string &device, int input) { - ICO_DBG("CicoSCInputController::delInputApp Enter" + ICO_TRA("CicoSCInputController::delInputApp Enter" "(appid=%s device=%s input=%d)", appid.c_str(), device.c_str(), input); CicoSCWlInputMgrIF::delInputApp(appid.c_str(), device.c_str(), input); - ICO_DBG("CicoSCInputController::delInputApp Leave(EOK)"); + ICO_TRA("CicoSCInputController::delInputApp Leave(EOK)"); return ICO_SYC_EOK; } @@ -216,14 +216,14 @@ CicoSCInputController::sendInputEvent(const string &appid, int code, int value) { - ICO_DBG("CicoSCInputController::sendInputEvent Enter" + ICO_TRA("CicoSCInputController::sendInputEvent Enter" "(appid=%s surfaceid=0x%08X type=%d dev_no=%d time=%d code=%d value=%d)", appid.c_str(), surfaceid, type, deviceno, time, code, value); CicoSCWlInputMgrIF::sendInputEvent(appid.c_str(), surfaceid, type, deviceno, time, code, value); - ICO_DBG("CicoSCInputController::sendInputEvent Leave(EOK)"); + ICO_TRA("CicoSCInputController::sendInputEvent Leave(EOK)"); return ICO_SYC_EOK; } @@ -265,7 +265,7 @@ CicoSCInputController::setInputRegion(const string &appid, snprintf(target, ICO_SYC_MAX_LEN-1, "%s@%s", winname.c_str(), appid.c_str()); - ICO_DBG("CicoSCInputController::setInputRegion Enter" + ICO_TRA("CicoSCInputController::setInputRegion Enter" "(target=%s x=%d y=%d width=%d height=%d " "hotspot=%d/%d cursor=%d/%d-%d/%d attr=%d)", target, x, y, width, height, hotspot_x, hotspot_y, @@ -275,7 +275,7 @@ CicoSCInputController::setInputRegion(const string &appid, hotspot_x, hotspot_y, cursor_x, cursor_y, cursor_width, cursor_height, attr); - ICO_DBG("CicoSCInputController::setInputRegion Leave(EOK)"); + ICO_TRA("CicoSCInputController::setInputRegion Leave(EOK)"); return ICO_SYC_EOK; } @@ -303,12 +303,12 @@ CicoSCInputController::unsetInputRegion(const string &appid, snprintf(target, ICO_SYC_MAX_LEN-1, "%s@%s", winname.c_str(), appid.c_str()); - ICO_DBG("CicoSCInputController::unsetInputRegion Enter" + ICO_TRA("CicoSCInputController::unsetInputRegion Enter" "(target=%s x=%d y=%d width=%d height=%d", target, x, y, width, height); CicoSCWlInputMgrIF::unsetInputRegion(target, x, y, width, height); - ICO_DBG("CicoSCInputController::unsetInputRegion Leave(EOK)"); + ICO_TRA("CicoSCInputController::unsetInputRegion Leave(EOK)"); return ICO_SYC_EOK; } @@ -336,7 +336,7 @@ CicoSCInputController::capabilitiesCB(void *data, const char *codename, int32_t code) { - ICO_DBG("CicoSCInputController::capabilitiesCB Enter", + ICO_TRA("CicoSCInputController::capabilitiesCB Enter", "device=%s type=%s swname=%s input=%s codename=%s code=%d", device, type, swname, input, codename, code); @@ -359,7 +359,7 @@ CicoSCInputController::capabilitiesCB(void *data, sw->input = input; } - CicoSCSystemConfig *sysConf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *sysConf = CicoSystemConfig::getInstance(); const CicoSCSwitchConf *swconf = NULL; swconf = sysConf->findSwitchConfbyName(device, swname); if (NULL != swconf) { @@ -370,7 +370,7 @@ CicoSCInputController::capabilitiesCB(void *data, } } - ICO_DBG("CicoSCInputController::capabilitiesCB Leave"); + ICO_TRA("CicoSCInputController::capabilitiesCB Leave"); } //-------------------------------------------------------------------------- @@ -393,7 +393,7 @@ CicoSCInputController::codeCB(void *data, const char *codename, int32_t code) { - ICO_DBG("CicoSCInputController::codeCB Enter" + ICO_TRA("CicoSCInputController::codeCB Enter" "(device=%s input=%d codename=%s code=%d)", device, input, codename, code); @@ -418,7 +418,7 @@ CicoSCInputController::codeCB(void *data, sw->code.push_back(code); sw->codename.push_back(codename); - ICO_DBG("CicoSCInputController::codeCB Leave"); + ICO_TRA("CicoSCInputController::codeCB Leave"); } //-------------------------------------------------------------------------- @@ -443,7 +443,7 @@ CicoSCInputController::inputCB(void *data, int32_t code, int32_t state) { - ICO_DBG("CicoSCInputController::inputCB Enter" + ICO_TRA("CicoSCInputController::inputCB Enter" "time=%d device=%s input=%d code=%d state=%d", time, device, input, code, state); @@ -457,7 +457,7 @@ CicoSCInputController::inputCB(void *data, message->addArgObject("state", state); CicoSCServer::getInstance()->sendMessageToHomeScreen(message); - ICO_DBG("CicoSCInputController::inputCB Leave"); + ICO_TRA("CicoSCInputController::inputCB Leave"); } //-------------------------------------------------------------------------- @@ -474,8 +474,8 @@ CicoSCInputController::regionCB(void *data, struct ico_input_mgr_device *ico_input_mgr_dev, struct wl_array *region) { - ICO_DBG("CicoSCInputController::regionCB Enter"); - ICO_DBG("CicoSCInputController::regionCB Leave"); + ICO_TRA("CicoSCInputController::regionCB Enter"); + ICO_TRA("CicoSCInputController::regionCB Leave"); } //-------------------------------------------------------------------------- diff --git a/lib/system-controller/CicoSCLayer.h b/lib/system-controller/CicoSCLayer.h index 50b2541..bc9e5c6 100644 --- a/lib/system-controller/CicoSCLayer.h +++ b/lib/system-controller/CicoSCLayer.h @@ -17,7 +17,7 @@ #ifndef __CICO_SC_LAYER_H__ #define __CICO_SC_LAYER_H__ -#include "CicoSCCommonDef.h" +#include "CicoCommonDef.h" //-------------------------------------------------------------------------- /** diff --git a/lib/system-controller/CicoSCLifeCycleController.cpp b/lib/system-controller/CicoSCLifeCycleController.cpp index 0b9dd31..a1fcc17 100644 --- a/lib/system-controller/CicoSCLifeCycleController.cpp +++ b/lib/system-controller/CicoSCLifeCycleController.cpp @@ -19,12 +19,13 @@ #include "ico_syc_error.h" #include "CicoLog.h" -#include "CicoSCAulItems.h" -#include "CicoSCAilItems.h" +#include "CicoAulItems.h" +#include "CicoAilItems.h" #include "CicoSCLifeCycleController.h" -#include "CicoSCConf.h" -#include "CicoSCSystemConfig.h" +#include "CicoConf.h" +#include "CicoSystemConfig.h" #include "CicoSCSysResourceController.h" +#include "CicoSCAppResourceController.h" #include "Cico_aul_listen_app.h" using namespace std; @@ -136,7 +137,15 @@ CicoSCLifeCycleController::CicoSCLifeCycleController() { m_gconf = (GKeyFile*)NULL; m_pc = (pkgmgr_client*)NULL; +#if 0 m_RC = new CicoSCSysResourceController; + m_RC->startSysResource(); +#else + m_RC = new CicoSCAppResourceController; + if (false == m_RC->startSysResource()) { + m_RC->initAppResource(); + } +#endif ailRenewFlagOff(); initAIL(); initAUL(); @@ -173,15 +182,16 @@ int CicoSCLifeCycleController::launch(const char* appid, bundle* b) ICO_TRA("start %s", appid); // appid check AIL table exist if (NULL == findAIL(appid)) { - ICO_TRA("not find"); + ICO_TRA("end fail(not find)"); return ICO_SYC_ENOSYS; } + ICO_PRF("CHG_APP_STA request app=%s", appid); int r = aul_launch_app(appid, b); if (0 > r) { - ICO_TRA("aul_launch_app NG %d", r); + ICO_TRA("end fail(%d)", r); return ICO_SYC_ENOSYS; } - ICO_TRA("launch success"); + ICO_TRA("end success(%d)", r); return ICO_SYC_EOK; } @@ -256,7 +266,7 @@ int CicoSCLifeCycleController::terminate(const std::string& appid) int CicoSCLifeCycleController::terminate(int pid) { ICO_TRA("CicoSCLifeCycleController::terminate %d", pid); - const CicoSCAulItems* t = findAUL(pid); + const CicoAulItems* t = findAUL(pid); if ((NULL == t) || (0 == t)) { ICO_TRA("not find"); return ICO_SYC_EPERM; @@ -353,7 +363,7 @@ bool CicoSCLifeCycleController::isRunning(const char* appid) ICO_TRA("start %s", appid); bool r = false; #if 0 // TODO mk_k - vector::iterator it; + vector::iterator it; for (it = m_aul.begin(); it != m_aul.end(); ++it) { it->update_appid(); if (0 == strcasecmp(it->m_appid.c_str(), appid)) { @@ -390,13 +400,13 @@ bool CicoSCLifeCycleController::isRunning(const std::string& appid) /** * @brief find ail data * @param appid find key - * @return CicoSCAilItems class pointer + * @return CicoAilItems class pointer * @retval NULL is not find */ -const CicoSCAilItems* CicoSCLifeCycleController::findAIL(const char* appid) const +const CicoAilItems* CicoSCLifeCycleController::findAIL(const char* appid) const { ICO_TRA("start"); - const CicoSCAilItems* r = NULL; + const CicoAilItems* r = NULL; int sz = m_ail.size(); for (int i = 0; i < sz; i++) { if (0 == strcasecmp(m_ail[i].m_appid.c_str(), appid)) { @@ -411,10 +421,10 @@ const CicoSCAilItems* CicoSCLifeCycleController::findAIL(const char* appid) cons /** * @brief find ail data * @param appid find key - * @return CicoSCAilItems class pointer + * @return CicoAilItems class pointer * @retval NULL is not find */ -const CicoSCAilItems* CicoSCLifeCycleController::findAIL(const std::string& appid) const +const CicoAilItems* CicoSCLifeCycleController::findAIL(const std::string& appid) const { // ICO_TRA("call findAIL(const char*)"); return findAIL((const char*)appid.c_str()); @@ -430,7 +440,7 @@ bool CicoSCLifeCycleController::getPIDs(const char* appid, std::vector& pid ICO_TRA("start %s", appid); bool r = false; #if 0 // TODO mk_k - vector::iterator it; + vector::iterator it; for (it = m_aul.begin(); it != m_aul.end(); ++it) { it->update_appid(); if (0 == strcasecmp(it->m_appid.c_str(), appid)) { @@ -441,7 +451,7 @@ bool CicoSCLifeCycleController::getPIDs(const char* appid, std::vector& pid #else int sz = m_aul.size(); for (int i = 0; i < sz; i++) { - CicoSCAulItems* t = (CicoSCAulItems*)m_aul[i].p(); + CicoAulItems* t = (CicoAulItems*)m_aul[i].p(); t->update_appid(); if (0 == strcasecmp(t->m_appid.c_str(), appid)) { pids.push_back(t->m_pid); @@ -468,13 +478,13 @@ bool CicoSCLifeCycleController::getPIDs(std::string& appid, std::vector& pi * @param appid target application appid * @return pid */ -const CicoSCAulItems* CicoSCLifeCycleController::findAUL(int pid) +const CicoAulItems* CicoSCLifeCycleController::findAUL(int pid) { ICO_TRA("start %d", pid); - const CicoSCAulItems* r = NULL; + const CicoAulItems* r = NULL; int sz = m_aul.size(); for (int i = 0; i < sz; i++) { - CicoSCAulItems* t = (CicoSCAulItems*)m_aul[i].p(); + CicoAulItems* t = (CicoAulItems*)m_aul[i].p(); t->update_appid(); if (t->m_pid == pid) { r = t; @@ -543,7 +553,7 @@ int CSCLCCpkgmgr_handlerX(int req_id, const char *pkg_type, const char *pkg_name void CicoSCLifeCycleController::renewAIL() { ICO_TRA("start"); - vector old = m_ail; + vector old = m_ail; m_ail.clear(); int cnt =0; while (false == createAilItems()) { @@ -563,8 +573,8 @@ void CicoSCLifeCycleController::renewAIL() vector add_appid; vector remove_appid; - vector::iterator it_n; - vector::iterator it_o; + vector::iterator it_n; + vector::iterator it_o; for(it_n = m_aul.begin(); it_n != m_aul.end(); ++it_n) { bool bingo = false; for(it_o = old.begin(); it_o != old.end(); ++it_o) { @@ -694,7 +704,7 @@ bool CicoSCLifeCycleController::createAilItems() if (NULL == m_gconf) { m_gconf = g_key_file_new(); GString* gsfp = g_string_new("xx"); - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); + CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance(); g_string_printf(gsfp, "%s/%s", CSCSC->getDefaultConf()->confdir.c_str(), ICO_SYC_CONFIG_APPATTR); GError *gerr = NULL; @@ -767,7 +777,7 @@ bool CicoSCLifeCycleController::addAIL(const char* sPkg, const char* sIco, ICO_TRA("start pkg(%s)", sPkg? sPkg: "(NULL)"); string category; getCategory(sPkg, sNm, sCtg, category); - CicoSCAilItems CSCAI(sPkg, sIco, sNm, sCtg, sTyp, sExe, category, bndsp); + CicoAilItems CSCAI(sPkg, sIco, sNm, sCtg, sTyp, sExe, category, bndsp); m_ail.push_back(CSCAI); ICO_TRA("end"); return true; @@ -826,6 +836,12 @@ void CicoSCLifeCycleController::getCategory(const char* sPkg, const char* sNm, snprintf(work, sizeof(work)-1, "%s.%d", appCtgryType == 0 ? sPkg : sNm, i); gerr = NULL; + + if (NULL != appCtgry) { + g_free(appCtgry); + appCtgry = NULL; + } + appCtgry = g_key_file_get_string(m_gconf, sectAppAttr, work, &gerr); if (gerr != NULL) { g_clear_error(&gerr); @@ -833,6 +849,10 @@ void CicoSCLifeCycleController::getCategory(const char* sPkg, const char* sNm, } } } + if (NULL != appCtgry) { + g_free(appCtgry); + appCtgry = NULL; + } g_clear_error(&gerr); /* get category */ @@ -868,7 +888,7 @@ void CicoSCLifeCycleController::enterAUL(const char* appid, int pid, bool bPushBack = true; int sz = m_aul.size(); for (int i = 0; i < sz; i++) { - CicoSCAulItems* t = (CicoSCAulItems*) m_aul[i].p(); + CicoAulItems* t = (CicoAulItems*) m_aul[i].p(); t->update_appid(); if (t->m_pid == pid) { bPushBack = false; // push_back flag off @@ -888,15 +908,72 @@ void CicoSCLifeCycleController::enterAUL(const char* appid, int pid, // AUL list Unregistered ICO_DBG("push_back(AUL(%s, %d, %x))", appid, pid, obj); int ctgry = DINITm_categoryID; - const CicoSCAilItems* ailObj = findAIL(appid); + const CicoAilItems* ailObj = findAIL(appid); if ((NULL != ailObj) && (0 != ailObj)) { ctgry = ailObj->m_categoryID; } - CicoSCAulItems entryAUL(appid, pid, ctgry, aulstt, obj); + CicoAulItems entryAUL(appid, pid, ctgry, aulstt, obj); m_aul.push_back(entryAUL); if (-1 != entryAUL.m_cpucgroup) { m_RC->entryCgroupCPU(pid, entryAUL.m_cpucgroup); } + m_RC->entryApp(appid, pid); + } + ICO_TRA("end"); +} + +/** + * @brief application resource function is runnning + * @ret bool runnning state + * @retval true application resource runnning + * @retval true application resource stopping + */ +bool CicoSCLifeCycleController::isAppResource() const +{ + if (NULL == m_RC) { + return false; + } + return m_RC->isAppResource(); +} + +/** + * @brief + * @param anem user login name + */ +bool CicoSCLifeCycleController::startAppResource(const string& name) +{ + ICO_TRA("start"); + if (NULL == m_RC) { + ICO_TRA("end"); + return false; + } + bool bR = m_RC->startAppResource(name); + ICO_TRA("end %s", bR? "true": "false"); + return bR; +} + +/** + * @brief + * @param anem user login name + */ +void CicoSCLifeCycleController::createAppResourceFile(const string& user) +{ + ICO_TRA("start"); + if (NULL == m_RC) { + ICO_TRA("end"); + return; + } + if (false == m_RC->isAppResource()) { + ICO_TRA("end"); + return; + } + string file; + m_RC->getAppResourceFilePath(user, file); + struct stat buff; + /* file check */ + memset(&buff, 0, sizeof(buff)); + if (0 != stat(file.c_str(), &buff)) { + m_RC->createAppResourceFile(file); } ICO_TRA("end"); } @@ -908,7 +985,7 @@ bool CicoSCLifeCycleController::removeAUL(int pid) { ICO_TRA("start %d", pid); bool r = false; - vector::iterator it; + vector::iterator it; for(it = m_aul.begin(); it != m_aul.end(); ++it) { if (pid == it->m_pid) { ICO_DBG("erase appid=%s", it->m_appid.c_str()); @@ -935,7 +1012,7 @@ int CSCLCCapp_launch_handlerX(int pid, CicoSCLifeCycleController* x) char appid[255]; memset(appid, 0, sizeof(appid)); int iR = Xaul_app_get_appid_bypid(pid, appid, sizeof(appid)); // pid to appid - ICO_DBG("%d=aul_app_get_appid_bypid %d , %s", iR, pid, appid); + ICO_PRF("CHG_APP_STA notice app=%s, pid=%d, rval=%d", appid, pid, iR); x->enterAUL(appid, pid, NULL, iR); ICO_TRA("end %s %d", appid, pid); return 0; @@ -967,11 +1044,11 @@ int CSCLCCapp_dead_handlerX(int pid, CicoSCLifeCycleController* x) * @brief AUL infomaton list * @return AUL information item list Container */ -const std::vector& CicoSCLifeCycleController::getAulList() +const std::vector& CicoSCLifeCycleController::getAulList() { int sz = m_aul.size(); for (int i = 0; i < sz; i++) { - CicoSCAulItems* t = (CicoSCAulItems*)m_aul[i].p(); + CicoAulItems* t = (CicoAulItems*)m_aul[i].p(); t->update_appid(); } return m_aul; diff --git a/lib/system-controller/CicoSCLifeCycleController.h b/lib/system-controller/CicoSCLifeCycleController.h index 4d0f680..4a89a2d 100644 --- a/lib/system-controller/CicoSCLifeCycleController.h +++ b/lib/system-controller/CicoSCLifeCycleController.h @@ -15,17 +15,23 @@ #include #include -#include "CicoSCAilItems.h" -#include "CicoSCAulItems.h" +#include "CicoAilItems.h" +#include "CicoAulItems.h" #ifndef __CICO_SC_WINDOW_H__ class CicoSCWindow; #endif +#if 0 #ifndef CICOSCSYSRESOURCECONTROLLER_H class CicoSCSysResourceController; #endif +#else +#ifndef CICOSCAPPRESOURCECONTROLLER_H +class CicoSCAppResourceController; +#endif +#endif class CicoSCLifeCycleController { public: @@ -49,24 +55,27 @@ public: bool isRunning(const char* appid); bool isRunning(const std::string& appid); - const std::vector& getAilList() const; - const CicoSCAilItems* findAIL(const char* appid) const; - const CicoSCAilItems* findAIL(const std::string& appid) const; + const std::vector& getAilList() const; + const CicoAilItems* findAIL(const char* appid) const; + const CicoAilItems* findAIL(const std::string& appid) const; bool isAilRenew() const; void ailRenewFlagOff(); - const std::vector& getAulList(); + const std::vector& getAulList(); // TODO mk_k Should I think about the multiple return values start /* - const CicoSCAulItems* findAUL(const char* appid) const; - const CicoSCAulItems* findAUL(const std::string& appid) const; + const CicoAulItems* findAUL(const char* appid) const; + const CicoAulItems* findAUL(const std::string& appid) const; */ - const CicoSCAulItems* findAUL(int pid); + const CicoAulItems* findAUL(int pid); bool getPIDs(const char* appid, std::vector& pids) const; bool getPIDs(std::string& appid, std::vector& pids) const; void enterAUL(const char* appid, int pid, const CicoSCWindow* obj = NULL, int aulstt = AUL_R_OK); + bool isAppResource() const; + bool startAppResource(const std::string& name); + void createAppResourceFile(const std::string& user); protected: void initAIL(); friend ail_cb_ret_e CSCLCCail_list_appinfo_cbX(const ail_appinfo_h appinfo, @@ -96,11 +105,15 @@ private: static CicoSCLifeCycleController* ms_myInstance; protected: - std::vector m_ail; - std::vector m_aul; + std::vector m_ail; + std::vector m_aul; GKeyFile* m_gconf; pkgmgr_client* m_pc; +#if 0 CicoSCSysResourceController* m_RC; +#else + CicoSCAppResourceController* m_RC; +#endif bool m_ailRenew; }; @@ -109,7 +122,7 @@ protected: * @return AIL information item list Container */ inline -const std::vector& CicoSCLifeCycleController::getAilList() const +const std::vector& CicoSCLifeCycleController::getAilList() const { return m_ail; } diff --git a/lib/system-controller/CicoSCMessage.cpp b/lib/system-controller/CicoSCMessage.cpp index 6485bdd..6b809bb 100644 --- a/lib/system-controller/CicoSCMessage.cpp +++ b/lib/system-controller/CicoSCMessage.cpp @@ -42,6 +42,7 @@ CicoSCMessage::CicoSCMessage() m_rootObj = json_object_new(); m_argObj = json_object_new(); m_array = json_array_new(); + m_data.clear(); } //-------------------------------------------------------------------------- @@ -51,13 +52,13 @@ CicoSCMessage::CicoSCMessage() //-------------------------------------------------------------------------- CicoSCMessage::~CicoSCMessage() { - //ICO_DBG("CicoSCMessage::~CicoSCMessage Enter"); + //ICO_TRA("CicoSCMessage::~CicoSCMessage Enter"); json_array_unref(m_array); json_object_unref(m_rootObj); json_object_unref(m_argObj); json_node_free(m_root); g_object_unref(m_generator); - //ICO_DBG("CicoSCMessage::~CicoSCMessage Leave"); + //ICO_TRA("CicoSCMessage::~CicoSCMessage Leave"); } //-------------------------------------------------------------------------- @@ -252,7 +253,10 @@ CicoSCMessage::getData(void) json_node_take_object(m_root, m_rootObj); json_generator_set_root(m_generator, m_root); gsize len = 0; - return json_generator_to_data(m_generator, &len); + gchar* data = json_generator_to_data(m_generator, &len); + m_data = data; + g_free(data); + return m_data.c_str(); } //-------------------------------------------------------------------------- diff --git a/lib/system-controller/CicoSCMessage.h b/lib/system-controller/CicoSCMessage.h index f5ba8de..b09cc46 100644 --- a/lib/system-controller/CicoSCMessage.h +++ b/lib/system-controller/CicoSCMessage.h @@ -102,6 +102,7 @@ private: JsonObject *m_argObj; //!< json arg objects JsonArray *m_array; //!< json array std::string m_toAppid; //!< send to appid + std::string m_data; //!< json format data }; #endif // __CICO_SC_MESSAGE_H__ // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCPolicyDef.h b/lib/system-controller/CicoSCPolicyDef.h index e6bb30b..b6b5c04 100644 --- a/lib/system-controller/CicoSCPolicyDef.h +++ b/lib/system-controller/CicoSCPolicyDef.h @@ -110,6 +110,32 @@ #define STID_DISPLAY0_CATEGORY9 12009 #define STID_DISPLAY0_CATEGORY10 12010 #define STID_DISPLAY0_CATEGORY11 12011 +#if 1 // MK21031223 _MK_MK_ +#define STID_DISP0_ZONE2_CATEGORY 12100 +#define STID_DISP0_ZONE2_CATEGORY1 12101 +#define STID_DISP0_ZONE2_CATEGORY2 12102 +#define STID_DISP0_ZONE2_CATEGORY3 12103 +#define STID_DISP0_ZONE2_CATEGORY4 12104 +#define STID_DISP0_ZONE2_CATEGORY5 12105 +#define STID_DISP0_ZONE2_CATEGORY6 12106 +#define STID_DISP0_ZONE2_CATEGORY7 12107 +#define STID_DISP0_ZONE2_CATEGORY8 12108 +#define STID_DISP0_ZONE2_CATEGORY9 12109 +#define STID_DISP0_ZONE2_CATEGORY10 12110 +#define STID_DISP0_ZONE2_CATEGORY11 12111 +#define STID_DISP0_ZONE3_CATEGORY 12200 +#define STID_DISP0_ZONE3_CATEGORY1 12201 +#define STID_DISP0_ZONE3_CATEGORY2 12202 +#define STID_DISP0_ZONE3_CATEGORY3 12203 +#define STID_DISP0_ZONE3_CATEGORY4 12204 +#define STID_DISP0_ZONE3_CATEGORY5 12205 +#define STID_DISP0_ZONE3_CATEGORY6 12206 +#define STID_DISP0_ZONE3_CATEGORY7 12207 +#define STID_DISP0_ZONE3_CATEGORY8 12208 +#define STID_DISP0_ZONE3_CATEGORY9 12209 +#define STID_DISP0_ZONE3_CATEGORY10 12210 +#define STID_DISP0_ZONE3_CATEGORY11 12211 +#endif // MK20131223 _MK_MK_ // display1 category state id #define STID_DISPLAY1_CATEGORY 13000 @@ -212,7 +238,18 @@ #define EVID_DISPLAY_ZONE_ACQUIRE 10000 #define EVID_DISPLAY_ZONE_RELEASE 10999 +#if 1 // MK20131223 _MK_MK_ +#define ZONEID_CENTER_FULL 1 +#define ZONEID_CENTER_UPPER 2 +#define ZONEID_CENTER_LOWER 3 +#endif // MK20131223 _MK_MK_ + + #define EVID_DISPLAY0_CATEGORY 12000 +#if 1 // MK20131223 _MK_MK_ +#define EVID_DISP0_ZONE2_CATEGORY 12100 +#define EVID_DISP0_ZONE3_CATEGORY 12200 +#endif // MK20131223 _MK_MK_ #define EVID_DISPLAY1_CATEGORY 13000 #define EVID_ONSCREEN 14000 diff --git a/lib/system-controller/CicoSCPolicyManager.cpp b/lib/system-controller/CicoSCPolicyManager.cpp index 529d073..7b1c2ce 100644 --- a/lib/system-controller/CicoSCPolicyManager.cpp +++ b/lib/system-controller/CicoSCPolicyManager.cpp @@ -16,7 +16,8 @@ //========================================================================== #include -using namespace std; + +#include #include "CicoSCPolicyManager.h" #include "CicoStateMachine.h" @@ -31,96 +32,9 @@ using namespace std; #include "CicoSCMessage.h" #include "ico_syc_msg_cmd_def.h" #include "ico_syc_type.h" -#include "CicoSCCommonDef.h" - -//========================================================================== -// define -//========================================================================== - -// Defines of D-Bus target. -#define DBUS_SERVICE "org.automotive.message.broker" -#define DBUS_INTERFACE "org.freedesktop.DBus.Properties" -#define DBUS_METHOD "Get" - -// Defines of maximum number. -#define AMB_MAX_VHCLINFO 10 /**< maximum number of vehicle info */ - -// Enumerations of Vehicle information key. -typedef enum { - AMB_VHCL_SPEED = 1, /**< Vehicle speed */ - AMB_SHIFT_POSITION, /**< Shift position */ - AMB_LIGHT_LEFT, /**< Light left(Turn left) */ - AMB_LIGHT_RIGHT, /**< Light right(Turn right) */ - AMB_NIGHT_MODE, /**< Night mode */ - AMB_MAX_INFO /**< Maximum number of type */ -} _amb_vhcl_key_e; - -// -typedef struct _vehicle_info_property_t { - int key; /* Vehicle Information key */ - const char *property; /* D-Bus property name */ - const char *path; /* D-Bus path name */ - const char *interface; /* D-Bus interface name */ -} vhcl_info_prop_t; - -// structure of Vehicle information data. -typedef struct _vehicle_info_data { - int key; /* Vehicle Information key */ - DBusPendingCall *pending; - E_DBus_Signal_Handler *handler; - int request; - double val; -} _vhcldata_t; - -_vhcldata_t vhcl_data[AMB_MAX_INFO]; - -//*======================================================================== -// global variable -//======================================================================== - -static const vhcl_info_prop_t apf_vhcl_info[] = { - { - AMB_VHCL_SPEED, - "VehicleSpeed", - "/org/automotive/runningstatus/VehicleSpeed", - "org.automotive.VehicleSpeed" - }, - { - AMB_SHIFT_POSITION, - "ShiftPosition", - "/org/automotive/runningstatus/Transmission", - "org.automotive.Transmission" - }, -#if 0 // use LightStatus -/* use LightStatus, because AMB not support access of TurnSignal by D-Bus */ - { - ICO_SYC_VEHICLEINFO_TURN_SIGNAL, - "TurnSignal", - "/org/automotive/runningstatus/TurnSignal", - "org.automotive.TurnSignal" - }, -#else // use LightStatus - { - AMB_LIGHT_LEFT, - "LeftTurn", - "/org/automotive/runningstatus/LightStatus", - "org.automotive.LightStatus" - }, - { - AMB_LIGHT_RIGHT, - "RightTurn", - "/org/automotive/runningstatus/LightStatus", - "org.automotive.LightStatus" - }, -#endif // use LightStatus - { - AMB_NIGHT_MODE, - "NightMode", - "/org/automotive/custom/NightMode", - "org.automotive.NightMode" - }, - { 0, "\0", "\0", "\0" } -}; +#include "CicoCommonDef.h" +#include "CicoSCVInfoManager.h" +#include "CicoSCVInfo.h" //-------------------------------------------------------------------------- /** @@ -129,8 +43,7 @@ static const vhcl_info_prop_t apf_vhcl_info[] = { //-------------------------------------------------------------------------- CicoSCPolicyManager::CicoSCPolicyManager(CicoSCResourceManager* resourceMgr) : m_initialized(false), - m_dbusConnection(NULL), - m_ecoreTimer(NULL), + m_ecoreEvHandler(NULL), m_stateMachine(NULL), m_resourceMgr(resourceMgr) { @@ -153,20 +66,23 @@ CicoSCPolicyManager::~CicoSCPolicyManager() int CicoSCPolicyManager::initialize(void) { - ICO_DBG("CicoSCPolicyManager::initialize Enter"); + ICO_TRA("CicoSCPolicyManager::initialize Enter"); - int ret = ICO_SYC_EOK; - ret = initAMB(); + int ret = initStateMachine(); if (ICO_SYC_EOK != ret) { return ret; } - ret = initStateMachine(); - if (ICO_SYC_EOK != ret) { - return ret; - } + CicoSCVInfoManager* vinfomgr = CicoSCVInfoManager::getInstance(); + m_ecoreEvHandler = ecore_event_handler_add( + vinfomgr->getEcoreEvType(), + CicoSCPolicyManager::changedVehicleInfoCB, + this); + + vinfomgr->getVehicleInfo(ICO_VINFO_NIGHT_MODE); + vinfomgr->getVehicleInfo(ICO_VINFO_DRIVING_MODE); - ICO_DBG("CicoSCPolicyManager::initialize Leave"); + ICO_TRA("CicoSCPolicyManager::initialize Leave"); return ret; } @@ -178,439 +94,88 @@ CicoSCPolicyManager::initialize(void) void CicoSCPolicyManager::terminate(void) { - int idx = 0; - - ICO_DBG("CicoSCPolicyManager::terminate Enter"); - - for (idx = 0; vhcl_data[idx].key; idx++) { - if (vhcl_data[idx].handler != NULL) { - e_dbus_signal_handler_del(m_dbusConnection, - vhcl_data[idx].handler); - } - } - - ICO_DBG("CicoSCPolicyManager::terminate Leave"); + ICO_TRA("CicoSCPolicyManager::terminate Enter"); + ICO_TRA("CicoSCPolicyManager::terminate Leave"); } //-------------------------------------------------------------------------- /** - * @brief initialize amb connection + * @brief */ //-------------------------------------------------------------------------- -int -CicoSCPolicyManager::initAMB(void) +void +CicoSCPolicyManager::onChangedVehicleInfo(int type, void *event) { - ICO_DBG("CicoSCPolicyManager::initAMB Enter"); - - int ret = 0; - int idx; - char signalname[64]; - - if (true == m_initialized) { - ICO_DBG("CicoSCPolicyManager::initAMB Leave(EOK)"); - return ICO_SYC_EOK; - } - - /* Zero clear vhcl_data */ - memset(vhcl_data, 0, sizeof(vhcl_data)); - - e_dbus_init(); - - /* Get D-Bus connection */ - m_dbusConnection = e_dbus_bus_get(DBUS_BUS_SYSTEM); - if (! m_dbusConnection) { - ICO_ERR("dbus_bus_get failed."); - ICO_ERR("CicoSCPolicyManager::initAMB Leave(EIO)"); - return ICO_SYC_EIO; - } - - /* receive propertychanged request to AMB */ - for (idx = 0; apf_vhcl_info[idx].key; idx++) { - memset(signalname, 0, sizeof(signalname)); - /* set vehicleinfo set key */ - vhcl_data[idx].key = apf_vhcl_info[idx].key; + ICO_TRA("CicoSCPolicyManager::onChangedVehicleInfo Enter"); - if (apf_vhcl_info[idx].path[0] == 0) { - /* currently not support this vehicle information */ - continue; - } - - strcpy(signalname, apf_vhcl_info[idx].property); - strcat(signalname, "Changed"); - vhcl_data[idx].handler = e_dbus_signal_handler_add(m_dbusConnection, - DBUS_SERVICE, NULL, - apf_vhcl_info[idx].interface, - signalname, - AMBpropertyChanged, - (void*)&vhcl_data[idx].key); - - } - - /* recv response from AMB timer start */ - ret = ecore_init(); - if (ret == 0) { - ICO_ERR("ecore_init"); - ICO_ERR("CicoSCPolicyManager::initAMB Leave(ENOSYS)"); - return ICO_SYC_ENOSYS; + if (NULL == event) { + ICO_WRN("data is null"); + return; } - m_ecoreTimer = ecore_timer_add(0.2, //TODO - CicoSCPolicyManager::ecoreTimerCB, this); - if (! m_ecoreTimer) { - ICO_ERR("ecore_timer_add failed."); - ICO_ERR("CicoSCPolicyManager::initAMB Leave(ENOSYS)"); - return ICO_SYC_ENOSYS; + if (CicoSCVInfoManager::getInstance()->getEcoreEvType() != type) { + ICO_WRN("unknown ecore event type(%d)", type); + return; } - m_initialized = true; - - ICO_DBG("CicoSCPolicyManager::initAMB Leave(EOK)"); - return ICO_SYC_EOK; -} - -//-------------------------------------------------------------------------- -/** - * @brief send AMB request - */ -//-------------------------------------------------------------------------- -int -CicoSCPolicyManager::sendAMBRequest(void) -{ -#if 0 -// ICO_DBG("CicoSCPolicyManager::sendAMBRequest Enter"); - - DBusMessage *dbus_message = NULL; - int idx; - int ret = ICO_SYC_EOK; - - for (idx = 0; apf_vhcl_info[idx].key; idx++) { - /* set vehicle info key */ - vhcl_data[idx].key = apf_vhcl_info[idx].key; - - /* status is pending ? */ - if (vhcl_data[idx].pending) { - ICO_WRN("(%s) not complete", apf_vhcl_info[idx].property); - continue; - } - - if (apf_vhcl_info[idx].path[0] == 0) { - /* currently not support this vehicle information */ - continue; - } + bool chgCamera = false; + bool chgRegulation = false; + bool chgNightMode = false; - /* Create send message */ - dbus_message = dbus_message_new_method_call(DBUS_SERVICE, - apf_vhcl_info[idx].path, - DBUS_INTERFACE, - DBUS_METHOD); - if (! dbus_message) { - ICO_ERR("dbus_message_new_method_call"); - ret = ICO_SYC_EIO; - } - /* Set parameters into message */ - else if (! dbus_message_append_args(dbus_message, - DBUS_TYPE_STRING, - &apf_vhcl_info[idx].interface, - DBUS_TYPE_STRING, - &apf_vhcl_info[idx].property, - DBUS_TYPE_INVALID)) { - ICO_ERR("dbus_message_append_args"); - ret = ICO_SYC_EIO; - } - /* Set destination */ - else if (! dbus_message_set_destination(dbus_message, - DBUS_SERVICE)) { - ICO_ERR("dbus_message_set_destination"); - ret = ICO_SYC_EIO; + CicoSCVInfo* vinfo = static_cast(event); + switch (vinfo->getProperty()) { + case ICO_VINFO_VEHICLE_SPEED: + ICO_DBG("ICO_VINFO_VEHICLE_SPEED : %d", vinfo->getInt32Value()); +// (void)sendSMEvent(EVID_VELOCTY, (int)vinfo->getInt32Value()); +// if (true == sendSMEvent(EVID_DRVREGULATION)) { +// chgRegulation = true; +// } + break; + case ICO_VINFO_SHIFT_POSITION: + ICO_DBG("ICO_VINFO_SHIFT_POSITION : %d", vinfo->getUint8Value()); + (void)sendSMEvent(EVID_SHIFTPOS, (int)vinfo->getUint8Value()); + if (true == sendSMEvent(EVID_CAMERA)) { + chgCamera = true; } - /* Send message */ - else if (! dbus_connection_send_with_reply(m_dbusConnection, - dbus_message, - &vhcl_data[idx].pending, - 200)) { - ICO_ERR("dbus_connection_send"); - vhcl_data[idx].pending = NULL; - ret = ICO_SYC_EIO; + break; + case ICO_VINFO_LIGHT_LEFT: + ICO_DBG("ICO_VINFO_LIGHT_LEFT : %s", + vinfo->getBooleanValue() ? "true" : "false"); + if (false == vinfo->getBooleanValue()) { + (void)sendSMEvent(EVID_TURN_OFF); } else { - //ICO_DBG("REQUEST req (%s)", apf_vhcl_info[idx].property); - } - - if (dbus_message) { - /* Release message */ - dbus_message_unref(dbus_message); - } - } - - /* dispatch if data queue exist */ - do { - dbus_connection_read_write_dispatch(m_dbusConnection, 0); - } while (dbus_connection_get_dispatch_status(m_dbusConnection) - == DBUS_DISPATCH_DATA_REMAINS); - - //ICO_DBG("CicoSCPolicyManager::sendAMBRequest Leave"); - return ret; -#endif - return 0; -} - -//-------------------------------------------------------------------------- -/** - * @brief get vehicle information - */ -//-------------------------------------------------------------------------- -int -CicoSCPolicyManager::getVehicleInfo(void) -{ - #if 0 - DBusMessage *dbus_message = NULL; - DBusMessageIter iter_head; - DBusMessageIter iter; - int idx; - char type; - int32_t i32; - int16_t i16; - uint32_t u32; - uint16_t u16; - dbus_bool_t b; - uint8_t u8; - double d64; - - /* dispatch if data queue exist */ - do { - dbus_connection_read_write_dispatch(m_dbusConnection, 0); - } while (dbus_connection_get_dispatch_status(m_dbusConnection) - == DBUS_DISPATCH_DATA_REMAINS); - - /* analyze reply data */ - for (idx = 0; apf_vhcl_info[idx].key; idx++) { - if (! vhcl_data[idx].pending) { - continue; - } - if (! dbus_pending_call_get_completed(vhcl_data[idx].pending)) { - //ICO_WRN("(%s) NOT complete", apf_vhcl_info[idx].property); - continue; + (void)sendSMEvent(EVID_TURN_LEFT); } - - dbus_message = dbus_pending_call_steal_reply(vhcl_data[idx].pending); - if (! dbus_message) { - //ICO_WRN("(%s) NO reply", apf_vhcl_info[idx].property); - continue; + if (true == sendSMEvent(EVID_CAMERA)) { + chgCamera = true; } - - if (dbus_message_get_type(dbus_message) == DBUS_MESSAGE_TYPE_ERROR) { - dbus_message_unref(dbus_message); - dbus_pending_call_cancel(vhcl_data[idx].pending); - vhcl_data[idx].pending = NULL; - //ICO_ERR("(%s) reply error", apf_vhcl_info[idx].property); - continue; + break; + case ICO_VINFO_LIGHT_RIGHT: + ICO_DBG("ICO_VINFO_LIGHT_RIGHT: %s", + vinfo->getBooleanValue() ? "true" : "false"); + if (false == vinfo->getBooleanValue()) { + (void)sendSMEvent(EVID_TURN_OFF); } - - dbus_message_iter_init(dbus_message, &iter_head); - dbus_message_iter_recurse(&iter_head, &iter); - - type = dbus_message_iter_get_arg_type(&iter); - switch (type) { - case DBUS_TYPE_INT32: - dbus_message_iter_get_basic(&iter, &i32); - vhcl_data[idx].val = (double)i32; - break; - case DBUS_TYPE_INT16: - dbus_message_iter_get_basic(&iter, &i16); - vhcl_data[idx].val = (double)i16; - break; - case DBUS_TYPE_UINT32: - dbus_message_iter_get_basic(&iter, &u32); - break; - case DBUS_TYPE_UINT16: - dbus_message_iter_get_basic(&iter, &u16); - vhcl_data[idx].val = (double)u16; - break; - case DBUS_TYPE_BOOLEAN: - dbus_message_iter_get_basic(&iter, &b); - if (b) vhcl_data[idx].val = (double)1.0; - else vhcl_data[idx].val = (double)0.0; - break; - case DBUS_TYPE_BYTE: - dbus_message_iter_get_basic(&iter, &u8); - vhcl_data[idx].val = (double)u8; - break; - case DBUS_TYPE_DOUBLE: - dbus_message_iter_get_basic(&iter, &d64); - vhcl_data[idx].val = (double)d64; - break; - default: - ICO_ERR("(%s) illegal data type(0x%02x)", - apf_vhcl_info[idx].property, ((int)type) & 0x0ff); - break; + else { + (void)sendSMEvent(EVID_TURN_RIGHT); } - //ICO_DBG("REQUEST ans (%s) = %.2f", - // apf_vhcl_info[idx].property, vhcl_data[idx].val); - - /* free message and pending */ - dbus_message_unref(dbus_message); - dbus_pending_call_cancel(vhcl_data[idx].pending); - vhcl_data[idx].pending = NULL; - }; - - return ICO_SYC_EOK; -#endif - return ICO_SYC_EOK; -} - -//-------------------------------------------------------------------------- -/** - * @brief ecore timer callback - */ -//-------------------------------------------------------------------------- -Eina_Bool -CicoSCPolicyManager::ecoreTimerCB(void *user_data) -{ - CicoSCPolicyManager *policyMgr = - static_cast(user_data); - policyMgr->recvAMBVehicleInfo(); - - return ECORE_CALLBACK_RENEW; -} -//-------------------------------------------------------------------------- -/** - * @brief receive AMB vehicle information - */ -//-------------------------------------------------------------------------- -void -CicoSCPolicyManager::AMBpropertyChanged(void *data, DBusMessage *msg) -{ - DBusMessageIter iter, variant; - int idx; - char type; - int32_t i32; - int16_t i16; - uint32_t u32; - uint16_t u16; - dbus_bool_t b; - uint8_t u8; - double d64; - - int key; - key = *((int *)data); - - if (!msg || !dbus_message_iter_init(msg, &iter)) { - ICO_ERR("received illegal message."); - return; - } - - for (idx = 0; vhcl_data[idx].key; idx++) { - if (vhcl_data[idx].key == key) { - break; + if (true == sendSMEvent(EVID_CAMERA)) { + chgCamera = true; } - } - if (idx == AMB_MAX_INFO) { - return; - } - - dbus_message_iter_recurse(&iter, &variant); - type = dbus_message_iter_get_arg_type(&variant); - switch (type) { - case DBUS_TYPE_INT32: - dbus_message_iter_get_basic(&variant, &i32); - vhcl_data[idx].val = (double)i32; - break; - case DBUS_TYPE_INT16: - dbus_message_iter_get_basic(&variant, &i16); - vhcl_data[idx].val = (double)i16; - break; - case DBUS_TYPE_UINT32: - dbus_message_iter_get_basic(&variant, &u32); - break; - case DBUS_TYPE_UINT16: - dbus_message_iter_get_basic(&variant, &u16); - vhcl_data[idx].val = (double)u16; break; - case DBUS_TYPE_BOOLEAN: - dbus_message_iter_get_basic(&variant, &b); - if (b) vhcl_data[idx].val = (double)1.0; - else vhcl_data[idx].val = (double)0.0; + case ICO_VINFO_NIGHT_MODE: + ICO_DBG("ICO_VINFO_NIGHT_MODE : %d", vinfo->getUint32Value()); + chgNightMode = sendSMEvent(EVID_NIGHTMODE, (int)vinfo->getUint32Value()); break; - case DBUS_TYPE_BYTE: - dbus_message_iter_get_basic(&variant, &u8); - vhcl_data[idx].val = (double)u8; - break; - case DBUS_TYPE_DOUBLE: - dbus_message_iter_get_basic(&variant, &d64); - vhcl_data[idx].val = (double)d64; + case ICO_VINFO_DRIVING_MODE: + ICO_DBG("ICO_VINFO_DRIVING_MODE : %d", vinfo->getUint32Value()); + chgRegulation = sendSMEvent(EVID_DRVREGULATION, (int)vinfo->getUint32Value()); break; default: - ICO_ERR("(%s) illegal data type(0x%02x)", - apf_vhcl_info[idx].property, ((int)type) & 0x0ff); + ICO_WRN("not such key (%d)", vinfo->getProperty()); break; } -} - -//-------------------------------------------------------------------------- -/** - * @brief receive AMB vehicle information - */ -//-------------------------------------------------------------------------- -void -CicoSCPolicyManager::recvAMBVehicleInfo(void) -{ -// ICO_DBG("CicoSCPolicyManager::recvAMBVehicleInfo Enter"); - - int idx = 0; - int key = 0; - bool chgCamera = false; - bool chgRegulation = false; - bool chgNightMode = false; - - //getVehicleInfo(); - - /* get vehicle info values */ - for (idx = 0; idx < AMB_MAX_VHCLINFO; idx++) { - if (vhcl_data[idx].key == 0) break; - key = vhcl_data[idx].key; - switch (key) { - case AMB_VHCL_SPEED: - (void)sendSMEvent(EVID_VELOCTY, (int)vhcl_data[idx].val); - if (true == sendSMEvent(EVID_DRVREGULATION)) { - chgRegulation = true; - } - break; - case AMB_SHIFT_POSITION: - (void)sendSMEvent(EVID_SHIFTPOS, (int)vhcl_data[idx].val); - if (true == sendSMEvent(EVID_CAMERA)) { - chgCamera = true; - } - break; - case AMB_LIGHT_LEFT: - if (0.0 == vhcl_data[idx].val) { - (void)sendSMEvent(EVID_TURN_OFF); - } - else { - (void)sendSMEvent(EVID_TURN_LEFT); - } - if (true == sendSMEvent(EVID_CAMERA)) { - chgCamera = true; - } - break; - case AMB_LIGHT_RIGHT: - if (0.0 == vhcl_data[idx].val) { - (void)sendSMEvent(EVID_TURN_OFF); - } - else { - (void)sendSMEvent(EVID_TURN_LEFT); - } - if (true == sendSMEvent(EVID_CAMERA)) { - chgCamera = true; - } - break; - case AMB_NIGHT_MODE: - chgNightMode = sendSMEvent(EVID_NIGHTMODE, (int)vhcl_data[idx].val); - break; - default: - ICO_WRN("not such key (%d)", key); - break; - } - } if (true == chgRegulation) { ICO_DBG("true == chgRegulation"); @@ -667,11 +232,20 @@ CicoSCPolicyManager::recvAMBVehicleInfo(void) } CicoSCServer::getInstance()->sendMessageToHomeScreen(message); } - - /* send request to AMB */ - //sendAMBRequest(); -// ICO_DBG("CicoSCPolicyManager::recvAMBVehicleInfo Leave"); + ICO_TRA("CicoSCPolicyManager::onChangedVehicleInfo Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief + */ +//-------------------------------------------------------------------------- +Eina_Bool +CicoSCPolicyManager::changedVehicleInfoCB(void *data, int type, void *event) +{ + static_cast(data)->onChangedVehicleInfo(type, event); + return EINA_TRUE; } //-------------------------------------------------------------------------- @@ -693,7 +267,7 @@ CicoSCPolicyManager::getPolicyStates(void) int CicoSCPolicyManager::initStateMachine(void) { - ICO_DBG("CicoSCPolicyManager::initStateMachine Enter"); + ICO_TRA("CicoSCPolicyManager::initStateMachine Enter"); CicoStateMachineCreator creator; @@ -708,6 +282,7 @@ CicoSCPolicyManager::initStateMachine(void) int ret = m_stateMachine->start(); if (ret == 0) { ICO_ERR("CicoStateMachine::start failed."); + ICO_TRA("CicoSCPolicyManager::initStateMachine Leave(ENOSYS)"); return ICO_SYC_ENOSYS; } @@ -819,7 +394,7 @@ CicoSCPolicyManager::initStateMachine(void) m_inputStates.push_back(m_policyStates[STID_INPUT1_USING]); m_inputStates.push_back(m_policyStates[STID_INPUT2_USING]); - ICO_DBG("CicoSCPolicyManager::initStateMachine Leave"); + ICO_TRA("CicoSCPolicyManager::initStateMachine Leave(EOK)"); return ICO_SYC_EOK; } @@ -892,12 +467,31 @@ CicoSCPolicyManager::sendSMEvent(unsigned short event_id, int value) bool CicoSCPolicyManager::acquireDisplayResource(int type, int zoneid, int priority) { - ICO_DBG("CicoSCPolicyManager::acquireDisplayResource Enter" + ICO_TRA("CicoSCPolicyManager::acquireDisplayResource Enter" "(type=0x%08X zoneid=%d priority=%d)", type, zoneid, priority); bool chg = false; if (RESID_TYPE_BASIC == type) { +#if 1 // MK20131223 _MK_MK_ + unsigned short category_ev = EVID_DISPLAY0_CATEGORY; + if (ZONEID_CENTER_UPPER == zoneid) { + category_ev = EVID_DISP0_ZONE2_CATEGORY; + + } + else if (ZONEID_CENTER_LOWER == zoneid) { + category_ev = EVID_DISP0_ZONE3_CATEGORY; + } + + bool zoneChg = testSMEvent(EVID_DISPLAY_ZONE_ACQUIRE, zoneid); + bool cateChg = testSMEvent(category_ev, priority); + ICO_DBG("zoneChg=%d cateChg=%d", zoneChg, cateChg); + if ((true == zoneChg) && (true == cateChg)) { + sendSMEvent(EVID_DISPLAY_ZONE_ACQUIRE, zoneid); + sendSMEvent(category_ev, priority); + chg = true; + } +#else // MK20131223 _MK_MK_ bool zoneChg = testSMEvent(EVID_DISPLAY_ZONE_ACQUIRE, zoneid); bool cateChg = testSMEvent(EVID_DISPLAY0_CATEGORY, priority); ICO_DBG("zoneChg=%d cateChg=%d", zoneChg, cateChg); @@ -906,6 +500,7 @@ CicoSCPolicyManager::acquireDisplayResource(int type, int zoneid, int priority) sendSMEvent(EVID_DISPLAY0_CATEGORY, priority); chg = true; } +#endif // MK20131223 _MK_MK_ #if 0 //-- { debug dump else { std::map::iterator itr; @@ -932,7 +527,7 @@ CicoSCPolicyManager::acquireDisplayResource(int type, int zoneid, int priority) else if (RESID_TYPE_ONSCREEN == type) { chg = sendSMEvent(EVID_ONSCREEN, priority); } - ICO_DBG("CicoSCPolicyManager::acquireDisplayResource Leave(%s)", + ICO_TRA("CicoSCPolicyManager::acquireDisplayResource Leave(%s)", chg ? "true" : "false"); return chg; } @@ -946,7 +541,7 @@ CicoSCPolicyManager::releaseDisplayResource(int zoneid, int priority) bool CicoSCPolicyManager::acquireSoundResource(int type, int zoneid, int priority) { - ICO_DBG("CicoSCPolicyManager::acquireSoundResource Enter" + ICO_TRA("CicoSCPolicyManager::acquireSoundResource Enter" "(type=0x%08X zoneid=%d priority=%d)", type, zoneid, priority); bool chg = false; @@ -973,7 +568,7 @@ CicoSCPolicyManager::acquireSoundResource(int type, int zoneid, int priority) } } - ICO_DBG("CicoSCPolicyManager::acquireSoundResource Leave(%s)", + ICO_TRA("CicoSCPolicyManager::acquireSoundResource Leave(%s)", chg ? "true" : "false"); return chg; } @@ -981,7 +576,7 @@ CicoSCPolicyManager::acquireSoundResource(int type, int zoneid, int priority) bool CicoSCPolicyManager::releaseSoundResource(int type, int zoneid) { - ICO_DBG("CicoSCPolicyManager::acquireSoundResource Enter" + ICO_TRA("CicoSCPolicyManager::acquireSoundResource Enter" "(type=%d zoneid=%d)", type, zoneid); bool chg = false; @@ -1001,7 +596,7 @@ CicoSCPolicyManager::releaseSoundResource(int type, int zoneid) } } - ICO_DBG("CicoSCPolicyManager::acquireSoundResource Leave(%s)", + ICO_TRA("CicoSCPolicyManager::acquireSoundResource Leave(%s)", chg ? "true" : "false"); return true; @@ -1010,19 +605,25 @@ CicoSCPolicyManager::releaseSoundResource(int type, int zoneid) bool CicoSCPolicyManager::acquireInputResource(int input, int priority) { - ICO_DBG("CicoSCPolicyManager::acquireInputResource Enter" - "input=%d priority=%d", input, priority); + ICO_TRA("CicoSCPolicyManager::acquireInputResource Enter" + "(input=%d priority=%d)", input, priority); bool chg = false; if (1 == input) { - chg = sendSMEvent(EVID_INPUT1_ACQUIRE, input); + chg = testSMEvent(EVID_INPUT1_ACQUIRE, input); + if (true == chg) { + sendSMEvent(EVID_INPUT1_ACQUIRE, input); + } } else if (2 == input) { - chg = sendSMEvent(EVID_INPUT2_ACQUIRE, input); + chg = testSMEvent(EVID_INPUT2_ACQUIRE, input); + if (true == chg) { + sendSMEvent(EVID_INPUT2_ACQUIRE, input); + } } - ICO_DBG("CicoSCPolicyManager::acquireInputResource Leave(%s)", + ICO_TRA("CicoSCPolicyManager::acquireInputResource Leave(%s)", chg ? "true" : "false"); return chg; } @@ -1111,7 +712,7 @@ CicoSCPolicyManager::isExistDisplayZoneOwer(int zoneid) */ //-------------------------------------------------------------------------- void -CicoSCPolicyManager::notifyConnected(const string & appid) +CicoSCPolicyManager::notifyConnected(const std::string & appid) { // Notify regulation changed state CicoSCMessage *message = new CicoSCMessage(); diff --git a/lib/system-controller/CicoSCPolicyManager.h b/lib/system-controller/CicoSCPolicyManager.h index 7d5677a..591f7b6 100644 --- a/lib/system-controller/CicoSCPolicyManager.h +++ b/lib/system-controller/CicoSCPolicyManager.h @@ -71,8 +71,6 @@ public: void notifyChangedState(int state); - void recvAMBVehicleInfo(void); - // get states const std::map& getPolicyStates(void); @@ -86,8 +84,6 @@ public: // notify connected process void notifyConnected(const std::string & appid); - static void AMBpropertyChanged(void *data, DBusMessage *msg); - private: // default constructor CicoSCPolicyManager(); @@ -98,32 +94,39 @@ private: // copy constructor CicoSCPolicyManager(const CicoSCPolicyManager &object); - // initialize amb connection - int initAMB(void); - - // send request to amb - int sendAMBRequest(void); - - // get vehicle information - int getVehicleInfo(void); - - // timer callback function for ecore - static Eina_Bool ecoreTimerCB(void *user_data); - // initialize state machine int initStateMachine(void); + // callback function for changed vehicle informantion + void onChangedVehicleInfo(int type, void *event); + private: - bool m_initialized; - E_DBus_Connection *m_dbusConnection; - Ecore_Timer *m_ecoreTimer; + // callback function for changed vehicle informantion + static Eina_Bool changedVehicleInfoCB(void *data, int type, void *event); +private: + // initialized flag + bool m_initialized; + + // ecore event handler + Ecore_Event_Handler* m_ecoreEvHandler; + + // CicoStateMachine instance CicoStateMachine *m_stateMachine; + + // CicoSCResourceManager instance CicoSCResourceManager *m_resourceMgr; + // state list std::map m_policyStates; + + // display zone state list std::map m_dispZoneStates; + + // sound zone state list std::vector m_soundZoneStates; + + // input state list std::vector m_inputStates; }; #endif // __CICO_SC_POLICY_MANAGER_H__ diff --git a/lib/system-controller/CicoSCResourceManager.cpp b/lib/system-controller/CicoSCResourceManager.cpp index 26e38d6..0ac98e3 100644 --- a/lib/system-controller/CicoSCResourceManager.cpp +++ b/lib/system-controller/CicoSCResourceManager.cpp @@ -24,12 +24,12 @@ using namespace std; #include "ico_syc_mrp_resource_private.h" #include "ico_syc_msg_cmd_def.h" -#include "CicoSCSystemConfig.h" -#include "CicoSCConf.h" +#include "CicoSystemConfig.h" +#include "CicoConf.h" #include "CicoSCCommand.h" #include "CicoSCPolicyManager.h" #include "CicoSCLifeCycleController.h" -#include "CicoSCAilItems.h" +#include "CicoAilItems.h" #include "CicoSCWindowController.h" #include "CicoSCInputController.h" #include "CicoSCPolicyDef.h" @@ -112,7 +112,7 @@ CicoSCResourceManager::CicoSCResourceManager() { m_policyMgr = new CicoSCPolicyManager(this); - CicoSCSystemConfig *sysConf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *sysConf = CicoSystemConfig::getInstance(); list l; { @@ -171,38 +171,41 @@ CicoSCResourceManager::~CicoSCResourceManager() int CicoSCResourceManager::initialize(void) { - ICO_DBG("CicoSCResourceManager::initialize Enter"); + ICO_TRA("CicoSCResourceManager::initialize Enter"); int ret = ICO_SYC_EOK; ret = ico_syc_mrp_init(enforceSound, this); if (ICO_SYC_EOK != ret) { + ICO_TRA("CicoSCResourceManager::initialize Leave"); return ret; } ret = m_policyMgr->initialize(); if (ICO_SYC_EOK != ret) { + ICO_TRA("CicoSCResourceManager::initialize Leave"); return ret; } - ICO_DBG("CicoSCResourceManager::initialize Leave"); + ICO_TRA("CicoSCResourceManager::initialize Leave"); return ret; } void CicoSCResourceManager::terminate(void) { - ICO_DBG("CicoSCResourceManager::terminate Enter"); + ICO_TRA("CicoSCResourceManager::terminate Enter"); m_policyMgr->terminate(); - ICO_DBG("CicoSCResourceManager::terminate Leave"); + ico_syc_mrp_term(); + ICO_TRA("CicoSCResourceManager::terminate Leave"); } void CicoSCResourceManager::handleCommand(const CicoSCCommand &cmd, bool internal) { - ICO_DBG("CicoSCResourceManager::handleCommand Enter" + ICO_TRA("CicoSCResourceManager::handleCommand Enter" "(cmdid=0x%08X internal=%s)", cmd.cmdid, internal ? "true" : "false"); @@ -287,7 +290,7 @@ CicoSCResourceManager::handleCommand(const CicoSCCommand &cmd, ICO_WRN("Unknown command"); } - ICO_DBG("CicoSCResourceManager::handleCommand Leave"); + ICO_TRA("CicoSCResourceManager::handleCommand Leave"); } void @@ -306,7 +309,7 @@ CicoSCResourceManager::setInputController(CicoSCInputController *inputCtrl) resource_request_t * CicoSCResourceManager::popDispResReq(resource_request_t *req) { - ICO_DBG("CicoSCResourceManager::popDispResReq Enter"); + ICO_TRA("CicoSCResourceManager::popDispResReq Enter"); map >::iterator itr; itr = m_dispReqQueue.begin(); @@ -318,13 +321,13 @@ CicoSCResourceManager::popDispResReq(resource_request_t *req) ICO_DBG("Dequeue waiting display request queue zone=%d req=0x%08x", itr->first, *itr2); m_dispReqQueue[req->dispzoneid].erase(itr2); - ICO_DBG("CicoSCResourceManager::popDispResReq Leave" + ICO_TRA("CicoSCResourceManager::popDispResReq Leave" "(0x%08x)", *itr2); return *itr2; } } - ICO_DBG("CicoSCResourceManager::popDispResReq Leave(NULL)"); + ICO_TRA("CicoSCResourceManager::popDispResReq Leave(NULL)"); return NULL; } #endif @@ -332,7 +335,7 @@ CicoSCResourceManager::popDispResReq(resource_request_t *req) resource_request_t * CicoSCResourceManager::popSoundResReq(resource_request_t *req) { - ICO_DBG("CicoSCResourceManager::popSoundResReq Enter"); + ICO_TRA("CicoSCResourceManager::popSoundResReq Enter"); map >::iterator itr; itr = m_soundReqQueue.begin(); @@ -341,22 +344,23 @@ CicoSCResourceManager::popSoundResReq(resource_request_t *req) list::iterator itr2; itr2 = find_if(itr->second.begin(), itr->second.end(), comp); if (itr->second.end() != itr2) { - ICO_DBG("Dequeue waiting sound request queue zone=%d req=0x%08x", - itr->first, *itr2); + ICO_DBG("Dequeue waiting sound request queue" + "(req=0x%08x zone:%02d:%s appid=%s)", + *itr2, itr->first, (*itr2)->soundzone, (*itr2)->appid); m_soundReqQueue[req->soundzoneid].erase(itr2); - ICO_DBG("CicoSCResourceManager::popSoundResReq Leave" + ICO_TRA("CicoSCResourceManager::popSoundResReq Leave" "(0x%08x)", *itr2); return *itr2; } } - ICO_DBG("CicoSCResourceManager::popSoundResReq Leave(NULL)"); + ICO_TRA("CicoSCResourceManager::popSoundResReq Leave(NULL)"); return NULL; } resource_request_t * CicoSCResourceManager::popInputResReq(resource_request_t *req) { - ICO_DBG("CicoSCResourceManager::popInputResReq Enter"); + ICO_TRA("CicoSCResourceManager::popInputResReq Enter"); map >::iterator itr; itr = m_inputReqQueue.begin(); @@ -365,16 +369,17 @@ CicoSCResourceManager::popInputResReq(resource_request_t *req) list::iterator itr2; itr2 = find_if(itr->second.begin(), itr->second.end(), comp); if (itr->second.end() != itr2) { - ICO_DBG("Dequeue waiting input request queue input=%d req=0x%08x", - itr->first, *itr2); + ICO_DBG("Dequeue waiting input request queue" + "(req=0x%08x input:%d appid=%s)", + *itr2, (*itr2)->input, (*itr2)->appid); m_inputReqQueue[req->input].erase(itr2); - ICO_DBG("CicoSCResourceManager::popInputResReq Leave" + ICO_TRA("CicoSCResourceManager::popInputResReq Leave" "(0x%08x)", *itr2); return *itr2; } } - ICO_DBG("CicoSCResourceManager::popDispResReq Leave(NULL)"); + ICO_TRA("CicoSCResourceManager::popDispResReq Leave(NULL)"); return NULL; } @@ -383,14 +388,14 @@ bool CicoSCResourceManager::acquireDisplayResource(resource_request_t *newreq, bool control) { - ICO_DBG("CicoSCResourceManager::acquireDisplayResource Enter"); + ICO_TRA("CicoSCResourceManager::acquireDisplayResource Enter"); - CicoSCSystemConfig *sysConf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *sysConf = CicoSystemConfig::getInstance(); const CicoSCAppKindConf *appKindConf = NULL; appKindConf = sysConf->findAppKindConfbyId(newreq->appkind); if (NULL == appKindConf) { ICO_ERR("not found CicoSCAppKindConf instance"); - ICO_DBG("CicoSCResourceManager::acquireDisplayResource Leave(false)"); + ICO_TRA("CicoSCResourceManager::acquireDisplayResource Leave(false)"); return false; } @@ -406,7 +411,7 @@ CicoSCResourceManager::acquireDisplayResource(resource_request_t *newreq, delResourceRequest(newreq); ICO_DBG("kind of system application"); - ICO_DBG("CicoSCResourceManager::acquireDisplayResource Leave(true)"); + ICO_TRA("CicoSCResourceManager::acquireDisplayResource Leave(true)"); return true; } @@ -446,6 +451,7 @@ CicoSCResourceManager::acquireDisplayResource(resource_request_t *newreq, req->dispzoneid = newreq->dispzoneid; if (NULL != req->dispzone) free(req->dispzone); req->dispzone = strdup(newreq->dispzone); + req->layerid = newreq->layerid; if (NULL != req->animation) free(req->animation); req->animation = strdup(newreq->animation); req->animationTime = newreq->animationTime; @@ -455,7 +461,7 @@ CicoSCResourceManager::acquireDisplayResource(resource_request_t *newreq, } if (false == control) { - ICO_DBG("Enqueue waiting display resource request" + ICO_TRA("Enqueue waiting display resource request" "(req=0x%08x appid=%s)", req, req->appid); m_waitingDispResReq.push_front(req); #if 1 //DEBUG @@ -474,7 +480,7 @@ CicoSCResourceManager::acquireDisplayResource(resource_request_t *newreq, else { if (-1 != chgzone) { // move request window - m_winCtrl->setGeometry(req->surfaceid, req->dispzone, + m_winCtrl->setGeometry(req->surfaceid, req->dispzone, req->layerid, req->animation, req->animationTime, req->animation, req->animationTime); } @@ -493,14 +499,14 @@ CicoSCResourceManager::acquireDisplayResource(resource_request_t *newreq, #endif //DEBUG } - ICO_DBG("CicoSCResourceManager::acquireDisplayResource Leave"); + ICO_TRA("CicoSCResourceManager::acquireDisplayResource Leave"); return true; } void CicoSCResourceManager::releaseDisplayResource(resource_request_t *newreq) { - ICO_DBG("CicoSCResourceManager::releaseDisplayResource Enter" + ICO_TRA("CicoSCResourceManager::releaseDisplayResource Enter" "(newreq=0x%08x)", newreq); // if exist in wating request list, pop request @@ -508,7 +514,7 @@ CicoSCResourceManager::releaseDisplayResource(resource_request_t *newreq) if (NULL != req) { delResourceRequest(req); delResourceRequest(newreq); - ICO_DBG("CicoSCResourceManager::releaseDisplayResource Leave"); + ICO_TRA("CicoSCResourceManager::releaseDisplayResource Leave"); return; } @@ -538,20 +544,20 @@ CicoSCResourceManager::releaseDisplayResource(resource_request_t *newreq) } } - ICO_DBG("CicoSCResourceManager::releaseDisplayResource Leave"); + ICO_TRA("CicoSCResourceManager::releaseDisplayResource Leave"); } bool CicoSCResourceManager::acquireSoundResource(resource_request_t *newreq) { - ICO_DBG("CicoSCResourceManager::acquireSoundResource Enter"); + ICO_TRA("CicoSCResourceManager::acquireSoundResource Enter"); - CicoSCSystemConfig *sysConf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *sysConf = CicoSystemConfig::getInstance(); const CicoSCAppKindConf *appKindConf = NULL; appKindConf = sysConf->findAppKindConfbyId(newreq->appkind); if (NULL == appKindConf) { ICO_ERR("not found CicoSCAppKindConf instance"); - ICO_DBG("CicoSCResourceManager::acquireSoundResource Leave(false)"); + ICO_TRA("CicoSCResourceManager::acquireSoundResource Leave(false)"); return false; } @@ -562,7 +568,7 @@ CicoSCResourceManager::acquireSoundResource(resource_request_t *newreq) delResourceRequest(newreq); ICO_DBG("kind of system application"); - ICO_DBG("CicoSCResourceManager::acquireSoundResource Leave(true)"); + ICO_TRA("CicoSCResourceManager::acquireSoundResource Leave(true)"); return true; } @@ -576,7 +582,7 @@ CicoSCResourceManager::acquireSoundResource(resource_request_t *newreq) if (true == comp(m_curSoundResReq[req->soundzoneid])) { ICO_DBG("already acquired appid=%s pid=%d soundid=0x%08X", req->appid, req->pid, req->soundid); - ICO_DBG("CicoSCResourceManager::acquireSoundResource Leave(true)"); + ICO_TRA("CicoSCResourceManager::acquireSoundResource Leave(true)"); // free new request delResourceRequest(newreq); return true; @@ -590,19 +596,20 @@ CicoSCResourceManager::acquireSoundResource(resource_request_t *newreq) updateSoundResource(req); } else { - ICO_DBG("Enqueue waiting sound request queue zone=%d req=0x%08x", - req->soundzoneid, req); + ICO_DBG("Enqueue waiting sound request queue" + "(req=0x%08x zone:%02d:%s appid=%s)", + req, req->soundzoneid, req->soundzone, req->appid); m_soundReqQueue[req->soundzoneid].push_front(req); } - ICO_DBG("CicoSCResourceManager::acquireSoundResource Leave"); + ICO_TRA("CicoSCResourceManager::acquireSoundResource Leave"); return true; } void CicoSCResourceManager::releaseSoundResource(resource_request_t *newreq) { - ICO_DBG("CicoSCResourceManager::releaseSoundResource Enter"); + ICO_TRA("CicoSCResourceManager::releaseSoundResource Enter"); bool curchg = false; CompSoundResourceRequest comp(newreq); @@ -612,6 +619,15 @@ CicoSCResourceManager::releaseSoundResource(resource_request_t *newreq) } if (true == comp(m_curSoundResReq[i])) { + ICO_DBG("Dequeue current sound resource ower request" + "(req=0x%08x zoneid=%02d:%s appid=%s)", + m_curSoundResReq[i], m_curSoundResReq[i]->dispzoneid, + m_curSoundResReq[i]->dispzone, + m_curSoundResReq[i]->appid); + ICO_PRF("CHG_GUI_RES sound deprived zone=%02d:%s appid=%s", + m_curSoundResReq[i]->dispzoneid, + m_curSoundResReq[i]->dispzone, + m_curSoundResReq[i]->appid); ico_syc_mrp_release_sound_resource(m_curSoundResReq[i]); delResourceRequest(newreq); delResourceRequest(m_curSoundResReq[i]); @@ -631,7 +647,7 @@ CicoSCResourceManager::releaseSoundResource(resource_request_t *newreq) req = NULL; } delResourceRequest(newreq); - ICO_DBG("CicoSCResourceManager::releaseSoundResource Leave"); + ICO_TRA("CicoSCResourceManager::releaseSoundResource Leave"); return; } @@ -652,7 +668,8 @@ CicoSCResourceManager::releaseSoundResource(resource_request_t *newreq) if (true == active) { resource_request_t* req = *itr2; ICO_DBG("Dequeue waiting sound request queue " - "zone=%d req=0x%08x", itr->first, *itr2); + "(req=0x%08x zone:%02d:%s appid=%s)", + *itr2, itr->first, (*itr2)->soundzone, (*itr2)->appid); itr->second.erase(itr2); updateSoundResource(req); break; @@ -660,13 +677,13 @@ CicoSCResourceManager::releaseSoundResource(resource_request_t *newreq) } } - ICO_DBG("CicoSCResourceManager::releaseSoundResource Leave"); + ICO_TRA("CicoSCResourceManager::releaseSoundResource Leave"); } bool CicoSCResourceManager::acquireInputResource(resource_request_t *newreq) { - ICO_DBG("CicoSCResourceManager::acquireInputResource Enter"); + ICO_TRA("CicoSCResourceManager::acquireInputResource Enter"); resource_request_t *req = popInputResReq(newreq); if (NULL == req) { @@ -678,7 +695,7 @@ CicoSCResourceManager::acquireInputResource(resource_request_t *newreq) if (true == comp(m_curInputResReq[req->input])) { ICO_DBG("already acquired appid=%s pid=%d input=0x%08X", req->appid, req->pid, req->input); - ICO_DBG("CicoSCResourceManager::acquireInputResource Leave(true)"); + ICO_TRA("CicoSCResourceManager::acquireInputResource Leave(true)"); // free new request delResourceRequest(newreq); return true; @@ -689,18 +706,19 @@ CicoSCResourceManager::acquireInputResource(resource_request_t *newreq) updateInputResource(req); } else { - ICO_DBG("Enqueue waiting input request queue input=%d req=0x%08x", - req->input, req); + ICO_DBG("Enqueue waiting input request queue" + "(req=0x%08x input:%d appid=%s)", req, req->input, req->appid); m_inputReqQueue[req->input].push_front(req); } - ICO_DBG("CicoSCResourceManager::acquireInputResource Leave"); + ICO_TRA("CicoSCResourceManager::acquireInputResource Leave(true)"); return true; } void CicoSCResourceManager::releaseInputResource(resource_request_t *newreq) { + ICO_TRA("CicoSCResourceManager::releaseInputResource Enter"); bool curchg = false; CompInputResourceRequest comp(newreq); for (int i = 0; i < (int)m_curInputResReq.size(); ++i) { @@ -714,6 +732,12 @@ CicoSCResourceManager::releaseInputResource(resource_request_t *newreq) m_curInputResReq[i]->device, m_curInputResReq[i]->input); } + ICO_DBG("Dequeue current input resource ower request" + "(req=0x%08x input=%d appid=%s)", + m_curInputResReq[i], m_curInputResReq[i]->input, + m_curInputResReq[i]->appid); + ICO_PRF("CHG_GUI_RES input deprived input=%d appid=%s", + m_curInputResReq[i]->input, m_curInputResReq[i]->appid); delResourceRequest(newreq); delResourceRequest(m_curInputResReq[i]); m_curInputResReq[i] = NULL; @@ -731,7 +755,7 @@ CicoSCResourceManager::releaseInputResource(resource_request_t *newreq) req = NULL; } delResourceRequest(newreq); - ICO_DBG("CicoSCResourceManager::releaseInputResource Leave"); + ICO_TRA("CicoSCResourceManager::releaseInputResource Leave"); return; } @@ -749,13 +773,15 @@ CicoSCResourceManager::releaseInputResource(resource_request_t *newreq) if (true == active) { resource_request_t* req = *itr2; ICO_DBG("Dequeue waiting input request queue " - "input=%d req=0x%08x", itr->first, *itr2); + "(req=0x%08x input:%d appid=%s)", + *itr2, (*itr2)->input, (*itr2)->appid); itr->second.erase(itr2); updateInputResource(req); break; } } } + ICO_TRA("CicoSCResourceManager::releaseInputResource Leave"); } resource_request_t * @@ -763,18 +789,18 @@ CicoSCResourceManager::newResourceRequest(int resid, int reqtype, const CicoSCCommand &cmd) { - ICO_DBG("CicoSCResourceManager::newResourceRequest Enter"); + ICO_TRA("CicoSCResourceManager::newResourceRequest Enter"); resource_request_t *req = NULL; req = (resource_request_t*)calloc(1, sizeof(resource_request_t)); CicoSCCmdResCtrlOpt *opt = (CicoSCCmdResCtrlOpt*)cmd.opt; - CicoSCSystemConfig *systemConfig = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *systemConfig = CicoSystemConfig::getInstance(); req->reqtype = reqtype; CicoSCLifeCycleController *lifeCycle = CicoSCLifeCycleController::getInstance(); - const CicoSCAilItems* ailItem = lifeCycle->findAIL(cmd.appid); + const CicoAilItems* ailItem = lifeCycle->findAIL(cmd.appid); if (NULL != ailItem) { req->category = ailItem->m_categoryID; req->appkind = ailItem->m_kindID; @@ -804,6 +830,7 @@ CicoSCResourceManager::newResourceRequest(int resid, if (resid == RESID_KIND_DISPLAY) { req->dispzone = strdup(opt->dispzone.c_str()); req->dispzoneid = systemConfig->getDizplayZoneIdbyFullName(req->dispzone); + req->layerid = opt->layerid; req->winname = strdup(opt->winname.c_str()); req->surfaceid = opt->surfaceid; req->id = opt->surfaceid;; @@ -825,7 +852,7 @@ CicoSCResourceManager::newResourceRequest(int resid, req->id = opt->input; } - ICO_DBG("CicoSCResourceManager::newResourceRequest Leave" + ICO_TRA("CicoSCResourceManager::newResourceRequest Leave" "(req=0x%08x appid=%s)", req, req->appid); return req; } @@ -851,16 +878,16 @@ CicoSCResourceManager::enforceSound(unsigned short state, resource_request_t *req, void *user_data) { - ICO_DBG("CicoSCResourceManager::enforceSound Enter"); + ICO_TRA("CicoSCResourceManager::enforceSound Enter"); /* NOP */ - ICO_DBG("CicoSCResourceManager::enforceSound Leave"); + ICO_TRA("CicoSCResourceManager::enforceSound Leave"); } // receive changed state void CicoSCResourceManager::receiveChangedState(int state) { - ICO_DBG("CicoSCResourceManager::receiveChangedState Enter" + ICO_TRA("CicoSCResourceManager::receiveChangedState Enter" "(state=%d)", state); if (STID_DRVREGULATION_ON == state) { @@ -876,7 +903,7 @@ CicoSCResourceManager::receiveChangedState(int state) updateInputResourceRegulation(state); } - ICO_DBG("CicoSCResourceManager::receiveChangedState Leave"); + ICO_TRA("CicoSCResourceManager::receiveChangedState Leave"); } //-------------------------------------------------------------------------- @@ -896,7 +923,7 @@ void CicoSCResourceManager::updateDisplayResource(resource_request_t *req, int chgzoneid) { - ICO_DBG("CicoSCResourceManager::updateDisplayResource Enter" + ICO_TRA("CicoSCResourceManager::updateDisplayResource Enter" "(req=0x%08x)", req); std::map::iterator itr; @@ -909,6 +936,7 @@ CicoSCResourceManager::updateDisplayResource(resource_request_t *req, // show request window m_winCtrl->show(req->surfaceid, req->animation, req->animationTime); m_winCtrl->activeCB(NULL, NULL, req->surfaceid, -1); + ICO_TRA("CicoSCResourceManager::updateDisplayResource Leave"); return; } resource_request_t *popreq = popCurDispResOwerReq(itr->second); @@ -922,7 +950,9 @@ CicoSCResourceManager::updateDisplayResource(resource_request_t *req, popreq->state = RES_STATE_WAITING; // enqueue request ICO_DBG("Enqueue waiting display resource request" - "(req=0x%08x appid=%s", popreq, popreq->appid); + "(req=0x%08x zone=%02d:%s appid=%s", + popreq, popreq->dispzoneid, + popreq->dispzone, popreq->appid); m_waitingDispResReq.push_front(popreq); #if 1 //DEBUG dumpWaitingDispResReq(); @@ -944,25 +974,34 @@ CicoSCResourceManager::updateDisplayResource(resource_request_t *req, } ICO_DBG("Dequeue current display resource ower request" - "(req=0x%08x zoneid=%d appid=%s)", - tmpreq, tmpreq->dispzoneid, tmpreq->appid); + "(req=0x%08x zoneid=%02d:%s appid=%s)", + tmpreq, tmpreq->dispzoneid, tmpreq->dispzone, tmpreq->appid); + ICO_PRF("CHG_GUI_RES display deprived zone=%02d:%s appid=%s", + tmpreq->dispzoneid, tmpreq->dispzone, tmpreq->appid); itr2->second = NULL; // hide current window m_winCtrl->hide(tmpreq->surfaceid, NULL, 0); ICO_DBG("Enqueue waiting display resource request" - "(req=0x%08x appid=%s", tmpreq, tmpreq->appid); + "(req=0x%08x zone=%02d:%s appid=%s", + tmpreq, tmpreq->dispzoneid, tmpreq->dispzone, tmpreq->appid); m_waitingDispResReq.push_front(tmpreq); } if (NULL != m_winCtrl) { + int ret = ICO_SYC_EOK; if (-1 != chgzoneid) { // move request window - m_winCtrl->setGeometry(req->surfaceid, req->dispzone, - req->animation, req->animationTime, - req->animation, req->animationTime); + ret = m_winCtrl->setGeometry(req->surfaceid, req->dispzone, + req->layerid, + req->animation, req->animationTime, + req->animation, req->animationTime); + if (ICO_SYC_EOK != ret) { + return; + } } + // show request window m_winCtrl->show(req->surfaceid, req->animation, req->animationTime); } @@ -970,8 +1009,10 @@ CicoSCResourceManager::updateDisplayResource(resource_request_t *req, req->state = RES_STATE_ACQUIRED; // update current zone request ICO_DBG("Enqueue current display resource ower request" - "(req=0x%08x zoneid=%d appid=%s)", - req, req->dispzoneid, req->appid); + "(req=0x%08x zoneid=%02d:%s appid=%s)", + req, req->dispzoneid, req->dispzone, req->appid); + ICO_PRF("CHG_GUI_RES display acquired zone=%02d:%s appid=%s", + req->dispzoneid, req->dispzone, req->appid); m_curDispResOwerReq[req->dispzoneid] = req; #if 1 //DEBUG dumpCurDispResOwerReq(); @@ -998,25 +1039,29 @@ CicoSCResourceManager::updateDisplayResource(resource_request_t *req, if (true == active) { resource_request_t* req = *itr; ICO_DBG("Dequeue waiting display resource request" - "(req=0x%08x appid=%s)", *itr, (*itr)->appid); + "(req=0x%08x zone=%02d:%s appid=%s)", + *itr, (*itr)->dispzoneid, + (*itr)->dispzone, (*itr)->appid); m_waitingDispResReq.erase(itr); #if 1 //DEBUG dumpWaitingDispResReq(); #endif //DEBUG updateDisplayResource(req); +#if 0 m_winCtrl->active(req->surfaceid, -1); +#endif break; } } } - ICO_DBG("CicoSCResourceManager::updateDisplayResource Leave"); + ICO_TRA("CicoSCResourceManager::updateDisplayResource Leave"); } void CicoSCResourceManager::updateSoundResource(resource_request_t *req) { - ICO_DBG("CicoSCResourceManager::updateSoundResource Enter" + ICO_TRA("CicoSCResourceManager::updateSoundResource Enter" "(req=0x%08x)", req); for (int i = 0; i < (int)m_curSoundResReq.size(); ++i) { ICO_DBG("zoneid=%d active=%d current=0x%08x", @@ -1033,9 +1078,19 @@ CicoSCResourceManager::updateSoundResource(resource_request_t *req) m_curSoundResReq[i]->state = RES_STATE_WAITING; // enqueue request ICO_DBG("Enqueue waiting sound request queue " - "zone=%d req=0x%08x", i, m_curSoundResReq[i]); + "(req=0x%08x zone:%02d:%s appid=%s)", + m_curSoundResReq[i], i, + m_curSoundResReq[i]->soundzone, m_curSoundResReq[i]->appid); m_soundReqQueue[i].push_front(m_curSoundResReq[i]); + // initialize current zone request + ICO_DBG("Dequeue current sound request queue " + "(req=0x%08x zone:%02d:%s appid=%s)", + m_curSoundResReq[i], i, + m_curSoundResReq[i]->soundzone, m_curSoundResReq[i]->appid); + ICO_PRF("CHG_GUI_RES sound deprived zone=%02d:%s appid=%s", + i, m_curSoundResReq[i]->soundzone, + m_curSoundResReq[i]->appid); m_curSoundResReq[i] = NULL; } } @@ -1047,15 +1102,20 @@ CicoSCResourceManager::updateSoundResource(resource_request_t *req) // state change to acquired req->state = RES_STATE_ACQUIRED; // update current zone request + ICO_DBG("Enqueue current sound request queue " + "(req=0x%08x zone:%02d:%s appid=%s)", + req, req->soundzoneid, req->soundzone, req->appid); + ICO_PRF("CHG_GUI_RES sound acquired zone=%02d:%s appid=%s", + req->soundzoneid, req->soundzone, req->appid); m_curSoundResReq[req->soundzoneid] = req; } - ICO_DBG("CicoSCResourceManager::updateSoundResource Leave"); + ICO_TRA("CicoSCResourceManager::updateSoundResource Leave"); } void CicoSCResourceManager::updateInputResource(resource_request_t *req) { - ICO_DBG("CicoSCResourceManager::updateInputResource Enter" + ICO_TRA("CicoSCResourceManager::updateInputResource Enter" "(req=0x%08x)", req); for (int i = 0; i < (int)m_curInputResReq.size(); ++i) { ICO_DBG("input=%d active=%d current=0x%08x", @@ -1077,9 +1137,17 @@ CicoSCResourceManager::updateInputResource(resource_request_t *req) m_curInputResReq[i]->state = RES_STATE_WAITING; // enqueue request ICO_DBG("Enqueue waiting input request queue " - "zone=%d req=0x%08x", i, m_curInputResReq[i]); + "(req=0x%08x input:%d appid=%s)", + m_curInputResReq[i], i, m_curInputResReq[i]->appid); m_inputReqQueue[i].push_front(m_curInputResReq[i]); // initialize current zone request + ICO_DBG("Dequeue current input request queue " + "(req=0x%08x input:%d appid=%s)", + m_curInputResReq[i], + m_curInputResReq[i]->input, m_curInputResReq[i]->appid); + ICO_PRF("CHG_GUI_RES input deprived input=%d appid=%s", + m_curInputResReq[i]->input, + m_curInputResReq[i]->appid); m_curInputResReq[i] = NULL; } } @@ -1090,15 +1158,19 @@ CicoSCResourceManager::updateInputResource(resource_request_t *req) // state change to acquired req->state = RES_STATE_ACQUIRED; // update current zone request + ICO_DBG("Enqueue current input request queue " + "(req=0x%08x input:%d appid=%s)", req, req->input, req->appid); + ICO_PRF("CHG_GUI_RES input acquired input=%d appid=%s", + req->input, req->appid); m_curInputResReq[req->input] = req; } - ICO_DBG("CicoSCResourceManager::updateInputResource Leave"); + ICO_TRA("CicoSCResourceManager::updateInputResource Leave"); } void CicoSCResourceManager::updateDisplayResourceRegulation(int state) { - ICO_DBG("CicoSCResourceManager::updateDisplayResourceRegulation Enter" + ICO_TRA("CicoSCResourceManager::updateDisplayResourceRegulation Enter" "(state=%d)", state); if (STID_DRVREGULATION_ON == state) { @@ -1127,7 +1199,7 @@ CicoSCResourceManager::updateDisplayResourceRegulation(int state) } if (false == curchg) { - ICO_DBG("CicoSCResourceManager::updateDisplayResourceRegulation " + ICO_TRA("CicoSCResourceManager::updateDisplayResourceRegulation " "Leave"); return; } @@ -1192,10 +1264,17 @@ CicoSCResourceManager::updateDisplayResourceRegulation(int state) req->prio); if (true == active) { ICO_DBG("Dequeue waiting display resource request" - "(req=0x%08x appid=%s)", req, req->appid); + "(req=0x%08x zone=%02d:%s appid=%s)", + req, req->dispzoneid, + req->dispzone, req->appid); m_waitingDispResReq.erase(itr2); ICO_DBG("Enqueue current display resource request" - "(req=0x%08x appid=%s)", req, req->appid); + "(req=0x%08x zone=%02d:%s appid=%s)", + req, req->dispzoneid, + req->dispzone, req->appid); + ICO_PRF("CHG_GUI_RES display acquired zone=%02d:%s " + "appid=%s", + req->dispzoneid, req->dispzone, req->appid); m_curDispResOwerReq[req->dispzoneid] = req; #if 1 //DEBUG dumpCurDispResOwerReq(); @@ -1237,13 +1316,13 @@ CicoSCResourceManager::updateDisplayResourceRegulation(int state) } } - ICO_DBG("CicoSCResourceManager::updateDisplayResourceRegulation Leave"); + ICO_TRA("CicoSCResourceManager::updateDisplayResourceRegulation Leave"); } void CicoSCResourceManager::updateSoundResourceRegulation(int state) { - ICO_DBG("CicoSCResourceManager::updateSoundResourceRegulation Enter" + ICO_TRA("CicoSCResourceManager::updateSoundResourceRegulation Enter" "(state=%d)", state); bool curchg = false; @@ -1263,7 +1342,8 @@ CicoSCResourceManager::updateSoundResourceRegulation(int state) current->state = RES_STATE_WAITING; // enqueue request ICO_DBG("Enqueue waiting sound request queue " - "zone=%d req=0x%08x", i, current); + "(req=0x%08x zone:%02d:%s appid=%s)", + current, i, current->soundzone, current->appid); m_soundReqQueue[i].push_front(current); // initialize current zone request m_curSoundResReq[i] = NULL; @@ -1272,7 +1352,7 @@ CicoSCResourceManager::updateSoundResourceRegulation(int state) } if ((false == curchg) && (STID_DRVREGULATION_ON == state)) { - ICO_DBG("CicoSCResourceManager::updateSoundResourceRegulation Leave"); + ICO_TRA("CicoSCResourceManager::updateSoundResourceRegulation Leave"); return; } @@ -1294,7 +1374,8 @@ CicoSCResourceManager::updateSoundResourceRegulation(int state) if (true == active) { resource_request_t* req = *itr2; ICO_DBG("Dequeue waiting sound request queue " - "zone=%d req=0x%08x", itr->first, *itr2); + "(req=0x%08x zone:%02d:%s appid=%s)", + *itr2, itr->first, (*itr2)->soundzone, (*itr2)->appid); itr->second.erase(itr2); updateSoundResource(req); break; @@ -1302,13 +1383,13 @@ CicoSCResourceManager::updateSoundResourceRegulation(int state) } } - ICO_DBG("CicoSCResourceManager::updateSoundResourceRegulation Leave"); + ICO_TRA("CicoSCResourceManager::updateSoundResourceRegulation Leave"); } void CicoSCResourceManager::updateInputResourceRegulation(int state) { - ICO_DBG("CicoSCResourceManager::updateInputResourceRegulation Enter" + ICO_TRA("CicoSCResourceManager::updateInputResourceRegulation Enter" "(state=%d)", state); bool curchg = false; @@ -1332,7 +1413,8 @@ CicoSCResourceManager::updateInputResourceRegulation(int state) current->state = RES_STATE_WAITING; // enqueue request ICO_DBG("Enqueue waiting input request queue " - "zone=%d req=0x%08x", i, current); + "(req=0x%08x input:%d appid=%s)", + current, i, current->appid); m_inputReqQueue[i].push_front(current); // initialize current zone request m_curInputResReq[i] = NULL; @@ -1341,7 +1423,7 @@ CicoSCResourceManager::updateInputResourceRegulation(int state) } if ((false == curchg) && (STID_DRVREGULATION_ON == state)) { - ICO_DBG("CicoSCResourceManager::updateInputResourceRegulation Leave"); + ICO_TRA("CicoSCResourceManager::updateInputResourceRegulation Leave"); return; } @@ -1361,7 +1443,8 @@ CicoSCResourceManager::updateInputResourceRegulation(int state) if (true == active) { resource_request_t* req = *itr2; ICO_DBG("Dequeue waiting input request queue " - "zone=%d req=0x%08x", itr->first, *itr2); + "(req=0x%08x input:%d appid=%s)", + *itr2, (*itr2)->input, (*itr2)->appid); itr->second.erase(itr2); updateInputResource(req); break; @@ -1369,7 +1452,7 @@ CicoSCResourceManager::updateInputResourceRegulation(int state) } } - ICO_DBG("CicoSCResourceManager::updateInputResourceRegulation Leave"); + ICO_TRA("CicoSCResourceManager::updateInputResourceRegulation Leave"); } //-------------------------------------------------------------------------- @@ -1421,8 +1504,11 @@ CicoSCResourceManager::popCurDispResOwerReq(resource_request_t *req) CompDisplayResourceRequest comp(req); if (true == comp(itr->second)) { ICO_DBG("Dequeue current display resource ower request" - "(req=0x%08x zoneid=%d appid=%s)", - itr->second, itr->first, itr->second->appid); + "(req=0x%08x zoneid=%02d:%s appid=%s)", + itr->second, itr->first, + itr->second->dispzone, itr->second->appid); + ICO_PRF("CHG_GUI_RES display deprived zone=%02d:%s appid=%s", + itr->first, itr->second->dispzone, itr->second->appid); resource_request_t *findreq = itr->second; itr->second = NULL; #if 1 //DEBUG @@ -1544,28 +1630,28 @@ CicoSCResourceManager::dumpWaitingDispResReq(void) void CicoSCResourceManager::updateDispResRegulationPreProc(resource_request_t *req) { - ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Enter"); + ICO_TRA("CicoSCResourceManager::updateDispResRegulationPreProc Enter"); #if 1 //DEBUG dumpCurDispResOwerReq(); dumpWaitingDispResReq(); #endif //DEBUG if (NULL == req) { - ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Leave"); + ICO_TRA("CicoSCResourceManager::updateDispResRegulationPreProc Leave"); return; } if (false == m_policyMgr->getRegulation()) { - ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Leave"); + ICO_TRA("CicoSCResourceManager::updateDispResRegulationPreProc Leave"); return; } - CicoSCSystemConfig *sysConf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *sysConf = CicoSystemConfig::getInstance(); const CicoSCAppKindConf *appKindConf = NULL; appKindConf = sysConf->findAppKindConfbyId(req->appkind); if (NULL == appKindConf) { ICO_ERR("not found CicoSCAppKindConf instance"); - ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Leave"); + ICO_TRA("CicoSCResourceManager::updateDispResRegulationPreProc Leave"); return; } @@ -1581,7 +1667,7 @@ CicoSCResourceManager::updateDispResRegulationPreProc(resource_request_t *req) delResourceRequest(req); ICO_DBG("kind of system application"); - ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Leave"); + ICO_TRA("CicoSCResourceManager::updateDispResRegulationPreProc Leave"); return; } @@ -1644,6 +1730,8 @@ CicoSCResourceManager::updateDispResRegulationPreProc(resource_request_t *req) ICO_DBG("Dequeue current display resource request" "(req=0x%08x zone:%02d:%s appid=%s)", curreq, curreq->dispzoneid, curreq->dispzone, curreq->appid); + ICO_PRF("CHG_GUI_RES display deprived zone=%02d:%s appid=%s", + curreq->dispzoneid, curreq->dispzone, curreq->appid); m_curDispResOwerReq[curreq->dispzoneid] = NULL; if (curreq->surfaceid != req->surfaceid) { @@ -1659,6 +1747,8 @@ CicoSCResourceManager::updateDispResRegulationPreProc(resource_request_t *req) "(req=0x%08x zone:%02d:%s appid=%s)", waitreq, waitreq->dispzoneid, waitreq->dispzone, waitreq->appid); + ICO_PRF("CHG_GUI_RES display acquired zone=%02d:%s appid=%s", + waitreq->dispzoneid, waitreq->dispzone, waitreq->appid); m_curDispResOwerReq[waitreq->dispzoneid] = waitreq; } } @@ -1667,6 +1757,8 @@ CicoSCResourceManager::updateDispResRegulationPreProc(resource_request_t *req) "(req=0x%08x zone:%02d:%s appid=%s)", curreq, curreq->dispzoneid, curreq->dispzone, curreq->appid); + ICO_PRF("CHG_GUI_RES display acquired zone=%02d:%s appid=%s", + curreq->dispzoneid, curreq->dispzone, curreq->appid); m_curDispResOwerReq[curreq->dispzoneid] = curreq; } } @@ -1676,7 +1768,7 @@ CicoSCResourceManager::updateDispResRegulationPreProc(resource_request_t *req) dumpCurDispResOwerReq(); dumpWaitingDispResReq(); #endif //DEBUG - ICO_DBG("CicoSCResourceManager::updateDispResRegulationPreProc Leave"); + ICO_TRA("CicoSCResourceManager::updateDispResRegulationPreProc Leave"); } //-------------------------------------------------------------------------- @@ -1687,6 +1779,8 @@ CicoSCResourceManager::updateDispResRegulationPreProc(resource_request_t *req) void CicoSCResourceManager::updateSoundResRegulationPreProc(resource_request_t *req) { + ICO_TRA("CicoSCResourceManager::updateSoundResRegulationPreProc Enter"); + if (NULL == req) { return; } @@ -1695,12 +1789,12 @@ CicoSCResourceManager::updateSoundResRegulationPreProc(resource_request_t *req) return; } - CicoSCSystemConfig *sysConf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *sysConf = CicoSystemConfig::getInstance(); const CicoSCAppKindConf *appKindConf = NULL; appKindConf = sysConf->findAppKindConfbyId(req->appkind); if (NULL == appKindConf) { ICO_ERR("not found CicoSCAppKindConf instance"); - ICO_DBG("CicoSCResourceManager::acquireSoundResource Leave(false)"); + ICO_TRA("CicoSCResourceManager::updateSoundResRegulationPreProc Leave"); return; } @@ -1711,7 +1805,7 @@ CicoSCResourceManager::updateSoundResRegulationPreProc(resource_request_t *req) delResourceRequest(req); ICO_DBG("kind of system application"); - ICO_DBG("CicoSCResourceManager::acquireSoundResource Leave(true)"); + ICO_TRA("CicoSCResourceManager::updateSoundResRegulationPreProc Leave"); return; } @@ -1724,32 +1818,43 @@ CicoSCResourceManager::updateSoundResRegulationPreProc(resource_request_t *req) if (NULL != curreq) { ICO_DBG("Dequeue current sound resource request" - "(req=0x%08x zone:%02d appid=%s)", - curreq, curreq->soundzoneid, curreq->appid); + "(req=0x%08x zone:%02d:%s appid=%s)", + curreq, curreq->soundzoneid, curreq->soundzone, curreq->appid); + ICO_PRF("CHG_GUI_RES sound deprived zone=%02d:%s appid=%s", + curreq->soundzoneid, curreq->soundzone, curreq->appid); m_curSoundResReq[curreq->soundzoneid] = NULL; if (0 != strcmp(curreq->appid, req->appid)) { resource_request_t *waitreq = popSoundResReq(req); ICO_DBG("Enqueue waiting sound resource request" - "(req=0x%08x zone:%02d appid=%s)", - curreq, curreq->soundzoneid, curreq->appid); + "(req=0x%08x zone:%02d:%s appid=%s)", + curreq, curreq->soundzoneid, + curreq->soundzone, curreq->appid); m_soundReqQueue[curreq->soundzoneid].push_front(curreq); if (NULL != waitreq) { ICO_DBG("Enqueue current sound resource request" - "(req=0x%08x zone:%02d appid=%s)", - waitreq, waitreq->soundzoneid, waitreq->appid); + "(req=0x%08x zone:%02d:%s appid=%s)", + waitreq, waitreq->soundzoneid, + waitreq->soundzone, waitreq->appid); + ICO_PRF("CHG_GUI_RES sound acquired zone=%02d:%s appid=%s", + waitreq->soundzoneid, waitreq->soundzoneid, + waitreq->appid); m_curSoundResReq[curreq->soundzoneid] = waitreq; } } else { ICO_DBG("Enqueue current sound resource request" - "(req=0x%08x zone:%02d appid=%s)", - curreq, curreq->soundzoneid, curreq->appid); + "(req=0x%08x zone:%02d:%s appid=%s)", + curreq, curreq->soundzoneid, + curreq->soundzone, curreq->appid); + ICO_PRF("CHG_GUI_RES sound acquired zone=%d:%s appid=%s", + curreq->soundzoneid, curreq->soundzone, curreq->appid); m_curSoundResReq[curreq->soundzoneid] = curreq; } } delResourceRequest(req); + ICO_TRA("CicoSCResourceManager::updateSoundResRegulationPreProc Leave"); } //-------------------------------------------------------------------------- @@ -1760,6 +1865,8 @@ CicoSCResourceManager::updateSoundResRegulationPreProc(resource_request_t *req) void CicoSCResourceManager::updateInputResRegulationPreProc(resource_request_t *req) { + ICO_TRA("CicoSCResourceManager::updateInputResRegulationPreProc Enter"); + if (NULL == req) { return; } @@ -1777,32 +1884,39 @@ CicoSCResourceManager::updateInputResRegulationPreProc(resource_request_t *req) if (NULL != curreq) { ICO_DBG("Dequeue current input resource request" - "(req=0x%08x zone:%02d appid=%s)", + "(req=0x%08x input:%d appid=%s)", curreq, curreq->input, curreq->appid); + ICO_PRF("CHG_GUI_RES input deprived input=%d appid=%s", + curreq->input, curreq->appid); m_curInputResReq[curreq->input] = NULL; if (0 != strcmp(curreq->appid, req->appid)) { resource_request_t *waitreq = popInputResReq(req); ICO_DBG("Enqueue waiting input resource request" - "(req=0x%08x zone:%02d appid=%s)", + "(req=0x%08x input:%d appid=%s)", curreq, curreq->input, curreq->appid); m_inputReqQueue[curreq->input].push_front(curreq); if (NULL != waitreq) { ICO_DBG("Enqueue current input resource request" - "(req=0x%08x zone:%02d appid=%s)", + "(req=0x%08x input:%d appid=%s)", waitreq, waitreq->input, waitreq->appid); + ICO_PRF("CHG_GUI_RES input acquired input=%d appid=%s", + waitreq->input, waitreq->appid); m_curInputResReq[curreq->input] = waitreq; } } else { ICO_DBG("Enqueue current input resource request" - "(req=0x%08x zone:%02d appid=%s)", + "(req=0x%08x input:%d appid=%s)", curreq, curreq->input, curreq->appid); + ICO_PRF("CHG_GUI_RES input acquired input=%d appid=%s", + curreq->input, curreq->appid); m_curInputResReq[curreq->input] = curreq; } } delResourceRequest(req); + ICO_TRA("CicoSCResourceManager::updateInputResRegulationPreProc Leave"); } //-------------------------------------------------------------------------- diff --git a/lib/system-controller/CicoSCServer.cpp b/lib/system-controller/CicoSCServer.cpp index d958f1b..e9b72c3 100644 --- a/lib/system-controller/CicoSCServer.cpp +++ b/lib/system-controller/CicoSCServer.cpp @@ -75,7 +75,9 @@ CicoSCServer::CicoSCServer() //-------------------------------------------------------------------------- CicoSCServer::~CicoSCServer() { - // TODO + if (NULL != m_uwsContext) { + ico_uws_close(m_uwsContext); + } } //-------------------------------------------------------------------------- @@ -203,6 +205,52 @@ CicoSCServer::startup(int port, const char *protocol) //-------------------------------------------------------------------------- /** + * @brief teardown server + */ +//-------------------------------------------------------------------------- +void +CicoSCServer::teardown(void) +{ + ICO_TRA("CicoSCServer::teardown Enter"); + { + std::list::iterator itr; + itr = m_uwsHandlerList.begin(); + for (; itr != m_uwsHandlerList.end(); ++itr) { + if (NULL != (*itr)->ecoreFdHandler) { + ecore_main_fd_handler_del((*itr)->ecoreFdHandler); + (*itr)->ecoreFdHandler = NULL; + } + delete(*itr); + } + m_uwsHandlerList.clear(); + } + + { + std::list::iterator itr; + itr = m_sendMsgQueue.begin(); + for (; itr != m_sendMsgQueue.end(); ++itr) { + delete(*itr); + } + m_sendMsgQueue.clear(); + } + + { + std::list::iterator itr; + itr = m_recvCmdQueue.begin(); + for (; itr != m_recvCmdQueue.end(); ++itr) { + delete(*itr); + } + } + + if (NULL != m_uwsContext) { + ico_uws_close(m_uwsContext); + m_uwsContext = NULL; + } + ICO_TRA("CicoSCServer::teardown Leave"); +} + +//-------------------------------------------------------------------------- +/** * @brief add poll websocket file destructor * * @param [in] handler websocket handler @@ -211,7 +259,7 @@ CicoSCServer::startup(int port, const char *protocol) void CicoSCServer::addPollFd(CicoSCUwsHandler *handler) { - ICO_DBG("CicoSCServer::addPollFd Enter(fd=%d)", handler->fd); + ICO_TRA("CicoSCServer::addPollFd Enter(fd=%d)", handler->fd); Ecore_Fd_Handler_Flags flags; flags = (Ecore_Fd_Handler_Flags)(ECORE_FD_READ | ECORE_FD_ERROR); @@ -222,7 +270,7 @@ CicoSCServer::addPollFd(CicoSCUwsHandler *handler) ICO_DBG("Enqueue uwsHandler(0x%08x)", handler); m_uwsHandlerList.push_back(handler); - ICO_DBG("CicoSCServer::addPollFd Leave"); + ICO_TRA("CicoSCServer::addPollFd Leave"); } //-------------------------------------------------------------------------- @@ -235,10 +283,18 @@ CicoSCServer::addPollFd(CicoSCUwsHandler *handler) void CicoSCServer::delPollFd(CicoSCUwsHandler *handler) { - ICO_DBG("CicoSCServer::delPollFd Enter"); + ICO_TRA("CicoSCServer::delPollFd Enter"); + + if (NULL == handler) { + ICO_WRN("handler is null"); + ICO_TRA("CicoSCServer::delPollFd Leave"); + return; + } - ecore_main_fd_handler_del(handler->ecoreFdHandler); - handler->ecoreFdHandler = NULL; + if (NULL != handler->ecoreFdHandler) { + ecore_main_fd_handler_del(handler->ecoreFdHandler); + handler->ecoreFdHandler = NULL; + } list::iterator itr; itr = m_uwsHandlerList.begin(); @@ -251,7 +307,7 @@ CicoSCServer::delPollFd(CicoSCUwsHandler *handler) } delete handler; - ICO_DBG("CicoSCServer::delPollFd Enter"); + ICO_TRA("CicoSCServer::delPollFd Leave"); } //-------------------------------------------------------------------------- @@ -266,11 +322,11 @@ CicoSCServer::delPollFd(CicoSCUwsHandler *handler) void CicoSCServer::dispatch(const CicoSCUwsHandler *handler) { -// ICO_DBG("CicoSCServer::dispatch Enter(handler=0x%08x)", handler); +// ICO_TRA("CicoSCServer::dispatch Enter(handler=0x%08x)", handler); if (NULL == handler) { ICO_WRN("handler is null"); - ICO_DBG("CicoSCServer::dispatch Leave"); + ICO_TRA("CicoSCServer::dispatch Leave"); return; } @@ -279,12 +335,12 @@ CicoSCServer::dispatch(const CicoSCUwsHandler *handler) // There is a possibility that after calling ico_uws_service function, // the file is deleted. Check whether handler not the disabled. if (false == isExistUwsHandler(handler)) { - ICO_DBG("CicoSCServer::dispatch Leave"); + ICO_TRA("CicoSCServer::dispatch Leave"); return; } if (true == m_dispatchProcessing) { - ICO_DBG("CicoSCServer::dispatch Leave(disptch processing)"); + ICO_TRA("CicoSCServer::dispatch Leave(disptch processing)"); return; } @@ -326,7 +382,7 @@ CicoSCServer::dispatch(const CicoSCUwsHandler *handler) if (NULL == handler->ecoreFdHandler) { ICO_ERR("ecoreFdHandler is null"); - ICO_DBG("CicoSCServer::dispatch Leave"); + ICO_TRA("CicoSCServer::dispatch Leave"); return; } @@ -347,13 +403,13 @@ CicoSCServer::dispatch(const CicoSCUwsHandler *handler) send_itr = m_sendMsgQueue.erase(send_itr); ICO_DBG("Dequeue Message(id=%d)", msg->getId()); if ((NULL != sendHandler) && (true == sendHandler->serviceFlag)) { + const char *data = msg->getData(); ICO_DBG("<<appid.c_str(), sendHandler->id, msg->getData()); + sendHandler->appid.c_str(), sendHandler->id, data); // ICO_DBG("called: ico_usw_send called(context=0x%08x id=0x%08x)", // sendHandler->uwsContext, sendHandler->id); ico_uws_send(sendHandler->uwsContext, sendHandler->id, - (unsigned char *)msg->getData(), - strlen(msg->getData())); + (unsigned char *)data, strlen(data)); delete msg; @@ -367,7 +423,7 @@ CicoSCServer::dispatch(const CicoSCUwsHandler *handler) ecore_main_fd_handler_active_set(handler->ecoreFdHandler, flags); } -// ICO_DBG("CicoSCServer::dispatch Leave"); +// ICO_TRA("CicoSCServer::dispatch Leave"); } //-------------------------------------------------------------------------- @@ -383,7 +439,7 @@ CicoSCServer::dispatch(const CicoSCUwsHandler *handler) int CicoSCServer::sendMessage(const string & appid, CicoSCMessage* msg) { - ICO_DBG("CicoSCServer::sendMessage Enter(appid=%s, msg=%s)", + ICO_TRA("CicoSCServer::sendMessage Enter(appid=%s, msg=%s)", appid.c_str(), msg->getData()); msg->setSendToAppid(appid); @@ -402,7 +458,7 @@ CicoSCServer::sendMessage(const string & appid, CicoSCMessage* msg) dispatch(handler); } - ICO_DBG("CicoSCServer::sendMessage Leave(EOK)"); + ICO_TRA("CicoSCServer::sendMessage Leave(EOK)"); return ICO_SYC_EOK; } @@ -418,6 +474,12 @@ CicoSCServer::sendMessage(const string & appid, CicoSCMessage* msg) int CicoSCServer::sendMessageToHomeScreen(CicoSCMessage* msg) { + // if user change processing(homescree is not running) + if (true == m_userMgr->isStoppingNow()) { + ICO_DBG("homescreen not running"); + return ICO_SYC_ENOENT; + } + const CicoSCUser *loginUser = m_userMgr->getLoginUser(); if (NULL == loginUser) { ICO_WRN("homescreen unknown"); @@ -466,7 +528,7 @@ CicoSCServer::uwsReceiveEventCB(const struct ico_uws_context *context, Eina_Bool CicoSCServer::ecoreFdCallback(void *data, Ecore_Fd_Handler *ecoreFdhandler) { -// ICO_DBG("CicoSCServer::ecoreFdCallback Enter"); +// ICO_TRA("CicoSCServer::ecoreFdCallback Enter"); CicoSCUwsHandler *handler = NULL; handler = static_cast(data)->findUwsHandler(ecoreFdhandler); @@ -474,7 +536,7 @@ CicoSCServer::ecoreFdCallback(void *data, Ecore_Fd_Handler *ecoreFdhandler) static_cast(data)->dispatch(handler); } -// ICO_DBG("CicoSCServer::ecoreFdCallback Leave"); +// ICO_TRA("CicoSCServer::ecoreFdCallback Leave"); return ECORE_CALLBACK_RENEW; } @@ -496,7 +558,21 @@ CicoSCServer::receiveEventCB(const struct ico_uws_context *context, const ico_uws_detail *detail, void *user_data) { -// ICO_DBG("CicoSCServer::receiveEventCB Enter"); +// ICO_TRA("CicoSCServer::receiveEventCB Enter"); + + switch (event) { + case ICO_UWS_EVT_CLOSE: + ICO_DBG(">>>RECV ICO_UWS_EVT_CLOSE(id=0x%08x)", (int)id); +// ICO_TRA("CicoSCServer::receiveEventCB Leave"); + return; + case ICO_UWS_EVT_ERROR: + ICO_DBG(">>>RECV ICO_UWS_EVT_ERROR(id=0x%08x, err=%d)", + (int)id, detail->_ico_uws_error.code); +// ICO_TRA("CicoSCServer::receiveEventCB Leave"); + return; + default: + break; + } // find handler CicoSCUwsHandler *handler = findUwsHandler(context, id); @@ -514,6 +590,7 @@ CicoSCServer::receiveEventCB(const struct ico_uws_context *context, break; case ICO_UWS_EVT_CLOSE: ICO_DBG(">>>RECV ICO_UWS_EVT_CLOSE(id=0x%08x)", (int)id); + delete handler; break; case ICO_UWS_EVT_RECEIVE: { @@ -529,6 +606,7 @@ CicoSCServer::receiveEventCB(const struct ico_uws_context *context, if (cmd->cmdid == MSG_CMD_SEND_APPID) { if (0 == cmd->appid.length()) { ICO_WRN("command argument invalid appid null"); + delete cmd; break; } handler->appid = cmd->appid; @@ -543,6 +621,7 @@ CicoSCServer::receiveEventCB(const struct ico_uws_context *context, ecore_main_fd_handler_active_set(handler->ecoreFdHandler, flags); notifyConnected(handler->appid); + delete cmd; break; } @@ -551,25 +630,81 @@ CicoSCServer::receiveEventCB(const struct ico_uws_context *context, m_recvCmdQueue.push_back(cmd); break; } - case ICO_UWS_EVT_ERROR: - ICO_DBG(">>>RECV ICO_UWS_EVT_ERROR(id=0x%08x, err=%d)", - (int)id, detail->_ico_uws_error.code); - break; case ICO_UWS_EVT_ADD_FD: ICO_DBG(">>>RECV ICO_UWS_EVT_ADD_FD(id=0x%08x, fd=%d)", - (int)id, detail->_ico_uws_fd.fd); + (int)id, detail->_ico_uws_fd.fd); handler->fd = detail->_ico_uws_fd.fd; addPollFd(handler); break; case ICO_UWS_EVT_DEL_FD: - ICO_DBG(">>>RECV ICO_UWS_EVT_DEL_FD(id=0x%08x, fd=%d)", - (int)id, detail->_ico_uws_fd.fd); + ICO_DBG(">>>RECV ICO_UWS_EVT_DEL_FD(id=0x%08x, fd=%d, appid=%s)", + (int)id, detail->_ico_uws_fd.fd, handler->appid.c_str()); + clearRecvCmdQueue(handler->appid); + clearSendMsgQueue(handler->appid); delPollFd(handler); break; default: break; } -// ICO_DBG("CicoSCServer::receiveEventCB Leave"); +// ICO_TRA("CicoSCServer::receiveEventCB Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief clear receive command queue + * + * @param [in] appid clear command application id + */ +//-------------------------------------------------------------------------- +void +CicoSCServer::clearRecvCmdQueue(const std::string & appid) +{ + ICO_TRA("CicoSCServer::clearCmdQueue Enter(appid=%s)", appid.c_str()); + + std::list::iterator itr; + itr = m_recvCmdQueue.begin(); + for (; itr != m_recvCmdQueue.end(); ) { + if (0 == appid.compare((*itr)->appid)) { + ICO_DBG("Dequeue command(0x%08x)", (*itr)->cmdid); + delete *itr; + itr = m_recvCmdQueue.erase(itr); + } + else { + ++itr; + } + } + m_recvCmdQueue.clear(); + + ICO_TRA("CicoSCServer::clearCmdQueue Leave") +} + +//-------------------------------------------------------------------------- +/** + * @brief clear send message queue + * + * @param [in] appid clear message application id + */ +//-------------------------------------------------------------------------- +void +CicoSCServer::clearSendMsgQueue(const std::string & appid) +{ + ICO_TRA("CicoSCServer::clearMsgQueue Enter(appid=%s)", appid.c_str()) + + std::list::iterator itr; + itr = m_sendMsgQueue.begin(); + while(itr != m_sendMsgQueue.end()) { + if (0 == appid.compare((*itr)->getSendToAppid())) { + ICO_DBG("Dequeue Message(id=%d)", (*itr)->getId()); + delete *itr; + itr = m_sendMsgQueue.erase(itr); + } + else { + ++itr; + } + } + m_sendMsgQueue.clear(); + + ICO_TRA("CicoSCServer::clearMsgQueue Leave") } //-------------------------------------------------------------------------- diff --git a/lib/system-controller/CicoSCServer.h b/lib/system-controller/CicoSCServer.h index 5288b0f..baf81ee 100644 --- a/lib/system-controller/CicoSCServer.h +++ b/lib/system-controller/CicoSCServer.h @@ -66,6 +66,9 @@ public: // startup server int startup(int port, const char *protocol); + // startup server + void teardown(void); + // send message to application client int sendMessage(const std::string & appid, CicoSCMessage* msg); @@ -79,6 +82,12 @@ public: const ico_uws_detail *detail, void *user_data); + // clear receive command queue + void clearRecvCmdQueue(const std::string & appid); + + // clear send message queue + void clearSendMsgQueue(const std::string & appid); + private: // default constructor CicoSCServer(); diff --git a/lib/system-controller/CicoSCSysResourceController.cpp b/lib/system-controller/CicoSCSysResourceController.cpp index 17e02a1..06cb008 100644 --- a/lib/system-controller/CicoSCSysResourceController.cpp +++ b/lib/system-controller/CicoSCSysResourceController.cpp @@ -28,8 +28,8 @@ #include "CicoSCSysResourceMonitor.h" #include "CicoSCLifeCycleController.h" #include "CicoSCSysResourceController.h" -#include "CicoSCConf.h" -#include "CicoSCSystemConfig.h" +#include "CicoConf.h" +#include "CicoSystemConfig.h" #include //#include @@ -73,66 +73,15 @@ CicoSCSysResourceController::CicoSCSysResourceController() m_cgrpMEM = 0; m_cpu = -1; m_mem = -1; - m_rConf = CicoSCSystemConfig::getInstance()->getResourceConf(); + m_bDoIt = false; + m_rConf = CicoSystemConfig::getInstance()->getResourceConf(); if (0 != m_rConf) { g_RC_LOG = m_rConf->m_bLog; if (-1 != m_rConf->m_sampling) { g_samplingWaitTimer = m_rConf->m_sampling; } } - if (false == m_rConf->m_bDoIt) { - ICO_TRA("end"); - return ; - } // cpu,cpuacct cgroup init - init_cgroup(); // cgroup - m_monitor = new CicoSCSysResourceMonitor(); - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); - string filePath(CSCSC->getDefaultConf()->confdir); - filePath += string("/"); - filePath += gstrStateMachineFileName; - - CicoStateMachineCreator csmc; - m_stt = csmc.createFile(filePath); - if ((CicoStateMachine*)0 == m_stt) { - ICO_ERR("state machine create error(%s)", filePath.c_str()); - return; - } - - m_SRCCPU_LOW = new CicoSRCCPU_LOW(this); - m_SRCCPU_HIGH = new CicoSRCCPU_HIGH(this); - m_SRCMEM_LOW = new CicoSRCMEM_LOW(this); - m_SRCMEM_HIGH = new CicoSRCMEM_HIGH(this); - - CicoState* s = (CicoState*)m_stt->getState(gstrSRCCPU_LOW); - if ((CicoState*)0 != s) { - s->addEntryAction(m_SRCCPU_LOW); - s->addDoAction(m_SRCCPU_LOW); - } - s = (CicoState*)m_stt->getState(gstrSRCCPU_HIGH); - if ((CicoState*)0 != s) { - s->addEntryAction(m_SRCCPU_HIGH); - s->addDoAction(m_SRCCPU_HIGH); - } - s = (CicoState*)m_stt->getState(gstrSRCMEM_LOW); - if ((CicoState*)0 != s) { - s->addEntryAction(m_SRCMEM_LOW); - s->addDoAction(m_SRCMEM_LOW); - } - s = (CicoState*)m_stt->getState(gstrSRCMEM_HIGH); - if ((CicoState*)0 != s) { - s->addEntryAction(m_SRCMEM_HIGH); - s->addDoAction(m_SRCMEM_HIGH); - } - m_stt->start(); - double tVal = (double)g_samplingWaitTimer / 100; -#if 1 - ICO_TRA("ECORE_TIMER(%f)", tVal); - g_SCResourceWatch = ecore_timer_add(tVal, ico_SCResourceWatch, this); -#else - ICO_TRA("ECORE_TIMER(%f)", tVal); - g_SCResourceWatch = ecore_timer_add(tVal, ico_SCResourceWatch, 0); -#endif ICO_TRA("end"); } @@ -186,6 +135,70 @@ CicoSCSysResourceController::~CicoSCSysResourceController() } /** + * @brief startWatch + */ +bool CicoSCSysResourceController::startSysResource() +{ + ICO_TRA("start"); + if (0 == m_rConf) { + ICO_TRA("end"); + return false; + } + m_bDoIt = m_rConf->m_bDoIt; + if (false == m_bDoIt) { + ICO_TRA("end"); + return false; + } + // cpu,cpuacct cgroup init + init_cgroup(); // cgroup + m_monitor = new CicoSCSysResourceMonitor(); + CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance(); + string filePath(CSCSC->getDefaultConf()->confdir); + filePath += string("/"); + filePath += gstrStateMachineFileName; + + CicoStateMachineCreator csmc; + m_stt = csmc.createFile(filePath); + if ((CicoStateMachine*)0 == m_stt) { + ICO_ERR("state machine create error(%s)", filePath.c_str()); + ICO_TRA("end"); + return false; + } + + m_SRCCPU_LOW = new CicoSRCCPU_LOW(this); + m_SRCCPU_HIGH = new CicoSRCCPU_HIGH(this); + m_SRCMEM_LOW = new CicoSRCMEM_LOW(this); + m_SRCMEM_HIGH = new CicoSRCMEM_HIGH(this); + + CicoState* s = (CicoState*)m_stt->getState(gstrSRCCPU_LOW); + if ((CicoState*)0 != s) { + s->addEntryAction(m_SRCCPU_LOW); + s->addDoAction(m_SRCCPU_LOW); + } + s = (CicoState*)m_stt->getState(gstrSRCCPU_HIGH); + if ((CicoState*)0 != s) { + s->addEntryAction(m_SRCCPU_HIGH); + s->addDoAction(m_SRCCPU_HIGH); + } + s = (CicoState*)m_stt->getState(gstrSRCMEM_LOW); + if ((CicoState*)0 != s) { + s->addEntryAction(m_SRCMEM_LOW); + s->addDoAction(m_SRCMEM_LOW); + } + s = (CicoState*)m_stt->getState(gstrSRCMEM_HIGH); + if ((CicoState*)0 != s) { + s->addEntryAction(m_SRCMEM_HIGH); + s->addDoAction(m_SRCMEM_HIGH); + } + m_stt->start(); + double tVal = (double)g_samplingWaitTimer / 100; + ICO_TRA("ECORE_TIMER(%f)", tVal); + g_SCResourceWatch = ecore_timer_add(tVal, ico_SCResourceWatch, this); + ICO_TRA("end"); + return true; +} + +/** * @brief watch * @return true:change level false:no change */ @@ -331,7 +344,8 @@ void CicoSCSysResourceController::resourceControlMemLimit(bool bHight) bool CicoSCSysResourceController::entryCgroupCPU(int pid, int grpNo) { ICO_TRA("start pid(%d), cgrpNo(%d)", pid, grpNo); - if ((0 > grpNo) || ((int)m_RCCpuTasks.size() <= grpNo)) { + if (((0 > grpNo) || ((int)m_RCCpuTasks.size() <= grpNo)) || + ((NULL == m_rConf) || (false == m_rConf->m_bDoIt))) { ICO_TRA("end %d", m_RCCpuTasks.size()); return false; } @@ -387,8 +401,8 @@ void CicoSCSysResourceController::init_cgroup_cpu() return; } string ss("/"); - string sTasks("tasks"); - string sShares("cpu.shares"); + string sTasks(D_STRtasks); + string sShares(D_STRcpushares); string t1(m_rConf->m_cpuCGRPPath); if ('/' != t1[t1.size()-1]) { t1 += ss; @@ -475,7 +489,7 @@ CicoSRCCPU_LOW::CicoSRCCPU_LOW(CicoSCSysResourceController* obj): m_val = -1; // cpu or memory usage value m_baseVal = -1; // cpu or memory base usage value m_cnt = 0; - m_rConf = CicoSCSystemConfig::getInstance()->getResourceConf(); + m_rConf = CicoSystemConfig::getInstance()->getResourceConf(); } /** diff --git a/lib/system-controller/CicoSCSysResourceController.h b/lib/system-controller/CicoSCSysResourceController.h index da6d828..d48dc51 100644 --- a/lib/system-controller/CicoSCSysResourceController.h +++ b/lib/system-controller/CicoSCSysResourceController.h @@ -32,6 +32,9 @@ class CicoSCSysResourceMonitor; class CicoSCResourceConf; #endif +#define D_STRtasks "tasks" +#define D_STRcpushares "cpu.shares" + class CicoSCSysResourceController; /** @@ -103,6 +106,8 @@ public: bool isWactchAllReady() const; + bool startSysResource(); // start cgroup controll + bool watch(); // watch request (please interval call) const CicoSCSysResourceMonitor& getMonitor() const; int getCpuUsge() const; @@ -119,9 +124,13 @@ protected: bool replaceCgroupFile(const std::string& tgt, int val); bool replaceCgroupFile(const std::string& tgt, const char* val); -private: +protected: CicoSCSysResourceMonitor* m_monitor; const CicoSCResourceConf* m_rConf; + std::vector m_RCCpuTasks; + std::vector m_RCCpuShares; + bool m_bDoIt; +private: CicoStateMachine* m_stt; CicoSRCCPU_LOW* m_SRCCPU_LOW; @@ -131,11 +140,8 @@ private: int m_cpu; int m_mem; - std::vector m_RCCpuTasks; - std::vector m_RCCpuShares; int m_cgrpCPU; int m_cgrpMEM; - }; /** diff --git a/lib/system-controller/CicoSCUserManager.cpp b/lib/system-controller/CicoSCUserManager.cpp index ce478a6..6547605 100644 --- a/lib/system-controller/CicoSCUserManager.cpp +++ b/lib/system-controller/CicoSCUserManager.cpp @@ -34,14 +34,14 @@ using namespace boost::property_tree; #include "CicoSCCommand.h" #include "CicoSCLastInfo.h" -#include "CicoSCAulItems.h" +#include "CicoAulItems.h" #include "CicoSCLifeCycleController.h" #include "CicoSCMessage.h" #include "CicoSCServer.h" #include "CicoSCUserManager.h" #include "CicoSCUser.h" -#include "CicoSCConf.h" -#include "CicoSCSystemConfig.h" +#include "CicoConf.h" +#include "CicoSystemConfig.h" #include "Cico_aul_listen_app.h" using namespace std; @@ -101,7 +101,7 @@ CicoSCUserManager::CicoSCUserManager() m_waitHS.clear(); m_wait = false; // login-user application information file - m_uConfig = CicoSCSystemConfig::getInstance()->getUserConf(); + m_uConfig = CicoSystemConfig::getInstance()->getUserConf(); if ((NULL == m_uConfig) || (true == m_uConfig->m_parent_dir.empty())) { m_parentDir = ICO_SYC_DEFAULT_PATH; } @@ -129,7 +129,7 @@ CicoSCUserManager::CicoSCUserManager() //-------------------------------------------------------------------------- CicoSCUserManager::~CicoSCUserManager() { - ICO_DBG("CicoSCUserManager::~CicoSCUserManager() Enter"); + ICO_TRA("CicoSCUserManager::~CicoSCUserManager Enter"); // clear homescreen list m_homescreenList.clear(); @@ -152,7 +152,7 @@ CicoSCUserManager::~CicoSCUserManager() m_userList.clear(); m_vppa.clear(); - ICO_DBG("CicoSCUserManager::~CicoSCUserManager() Leave(EOK)"); + ICO_TRA("CicoSCUserManager::~CicoSCUserManager Leave"); } //-------------------------------------------------------------------------- @@ -182,7 +182,7 @@ CicoSCUserManager::getInstance(void) void CicoSCUserManager::handleCommand(const CicoSCCommand * cmd) { - ICO_DBG("CicoSCUserManager::handleCommand Enter (%d)", cmd->cmdid); + ICO_TRA("CicoSCUserManager::handleCommand Enter(%d)", cmd->cmdid); CicoSCCmdUserMgrOpt *opt = static_cast(cmd->opt); @@ -208,7 +208,7 @@ CicoSCUserManager::handleCommand(const CicoSCCommand * cmd) break; } - ICO_DBG("CicoSCUserManager::handleCommand Leave(EOK)"); + ICO_TRA("CicoSCUserManager::handleCommand Leave"); } //-------------------------------------------------------------------------- @@ -222,7 +222,7 @@ CicoSCUserManager::handleCommand(const CicoSCCommand * cmd) int CicoSCUserManager::load(const string & confFile) { - ICO_DBG("CicoSCUserManager::load Enter (%s)", confFile.c_str()); + ICO_TRA("CicoSCUserManager::load Enter (%s)", confFile.c_str()); ptree root; // read config file (xml) @@ -234,7 +234,7 @@ CicoSCUserManager::load(const string & confFile) // set login user name setLoginUser(root); - ICO_DBG("CicoSCUserManager::load Leave(EOK)"); + ICO_TRA("CicoSCUserManager::load Leave(EOK)"); // always success return ICO_SYC_EOK; @@ -251,12 +251,13 @@ CicoSCUserManager::load(const string & confFile) int CicoSCUserManager::initialize(void) { - ICO_DBG("CicoSCUserManager::initialize Enter"); + ICO_TRA("CicoSCUserManager::initialize Enter"); // get login user information const CicoSCUser *user = findUserConfbyName(m_login); if (NULL == user) { - ICO_ERR("CicoSCUserManager::initialize Leave(ENXIO)"); + ICO_ERR("user not found"); + ICO_TRA("CicoSCUserManager::initialize Leave(ENXIO)"); return ICO_SYC_ENXIO; } @@ -289,7 +290,7 @@ CicoSCUserManager::initialize(void) // save last user saveLastUser(); - ICO_DBG("CicoSCUserManager::initialize Leave(EOK)"); + ICO_TRA("CicoSCUserManager::initialize Leave(EOK)"); return ICO_SYC_EOK; } @@ -345,7 +346,7 @@ CicoSCUserManager::getHomeScreenList(void) void CicoSCUserManager::changeUser(const string & name, const string & passwd) { - ICO_DBG("CicoSCUserManager::changeUser Enter" + ICO_TRA("CicoSCUserManager::changeUser Enter" "(user=%s pass=%s)", name.c_str(), passwd.c_str()); char tmpText[128]; @@ -355,22 +356,28 @@ CicoSCUserManager::changeUser(const string & name, const string & passwd) const CicoSCUser *conf = NULL; // check all user logoff if ((name.empty()) || (name[0] == ' ')) { - ICO_DBG("CicoSCUserManager::changeUser Leave(all user logoff)"); + ICO_TRA("CicoSCUserManager::changeUser Leave(all user logoff)"); flagFileOn(); killingAppsAndHS(oldUsr); return; } + // if changed user name is same last user name + if (0 == name.compare(m_login)) { + ICO_TRA("CicoSCUserManager::changeUser Leave(request is same user)"); + return; + } + // get user config conf = findUserConfbyName(name); if (NULL == conf) { - ICO_ERR("CicoSCUserManager::changeUser Leave(ENXIO)"); + ICO_TRA("CicoSCUserManager::changeUser Leave(ENXIO)"); return; } // check password if (passwd != conf->passwd) { - ICO_ERR("CicoSCUserManager::changeUser Leave(EINVAL)"); + ICO_TRA("CicoSCUserManager::changeUser Leave(EINVAL)"); return; } @@ -386,6 +393,8 @@ CicoSCUserManager::changeUser(const string & name, const string & passwd) // killing running application and homeScreen killingAppsAndHS(oldUsr); + CicoSCLifeCycleController* csclcc = CicoSCLifeCycleController::getInstance(); + csclcc->startAppResource(name); // check wheather directory exists vector mk_dir_info; @@ -402,6 +411,7 @@ CicoSCUserManager::changeUser(const string & name, const string & passwd) } mkdir(dir, S_IRWXU | S_IRWXG | S_IRWXO); } + csclcc->createAppResourceFile(name); if (0 != m_vppa.size()) { // wait dead signal recieve @@ -409,7 +419,7 @@ CicoSCUserManager::changeUser(const string & name, const string & passwd) m_waitHS = conf->homescreen; m_wait = true; // run call launchHomescreenReq is appDeadHandler ! - ICO_DBG("CicoSCUserManager::changeUser Leave(WAIT:%s)", m_waitName.c_str()); + ICO_TRA("CicoSCUserManager::changeUser Leave(WAIT:%s)", m_waitName.c_str()); return; } // change homescreen application @@ -424,7 +434,7 @@ CicoSCUserManager::changeUser(const string & name, const string & passwd) m_waitName.clear(); m_waitHS.clear(); m_wait = false; - ICO_DBG("CicoSCUserManager::changeUser Leave(EOK)"); + ICO_TRA("CicoSCUserManager::changeUser Leave(EOK)"); } //-------------------------------------------------------------------------- @@ -438,24 +448,18 @@ CicoSCUserManager::changeUser(const string & name, const string & passwd) //-------------------------------------------------------------------------- bool CicoSCUserManager::impritingLastApps(const string& ofnm) { - // - // - // + ICO_TRA("CicoSCUserManager::impritingLastApps Enter"); vector vs; -#if 0 - - AAAAAAAAAA - -#else CicoSCLifeCycleController* oCSCLCC; oCSCLCC = CicoSCLifeCycleController::getInstance(); if ((NULL == oCSCLCC) || (0 == oCSCLCC)) { - ICO_ERR("CicoSCUserManager::impritingLastApps Leave(ENXIO)"); + ICO_ERR(" CicoSCLifeCycleController is null"); + ICO_TRA("CicoSCUserManager::impritingLastApps Leave(false)"); return false; } - const vector& aulList = oCSCLCC->getAulList(); + const vector& aulList = oCSCLCC->getAulList(); for (int i=aulList.size() ; i != 1; i--) { - const CicoSCAulItems* pO = aulList[i-1].p(); + const CicoAulItems* pO = aulList[i-1].p(); if ((NULL == pO) || (0 == pO)) { continue; } @@ -470,10 +474,10 @@ bool CicoSCUserManager::impritingLastApps(const string& ofnm) } vs.push_back(pO->m_appid); } -#endif + if (0 == vs.size()) { remove(ofnm.c_str()); - ICO_ERR("CicoSCUserManager::impritingLastApps app none"); + ICO_TRA("CicoSCUserManager::impritingLastApps Leave(app none)"); return true; } ofstream ofs; @@ -483,7 +487,7 @@ bool CicoSCUserManager::impritingLastApps(const string& ofnm) ofs << *it << endl; } ofs.close(); - ICO_ERR("CicoSCUserManager::impritingLastApps app = %d", vs.size()); + ICO_TRA("CicoSCUserManager::impritingLastApps app = %d", vs.size()); return false; } @@ -498,25 +502,20 @@ bool CicoSCUserManager::impritingLastApps(const string& ofnm) //-------------------------------------------------------------------------- bool CicoSCUserManager::killingAppsAndHS(const string&) { -/* TODO - const CicoSCUser *cnf = findUserConfbyName(usrnm); - if (NULL == cnf) { - ICO_ERR("CicoSCUserManager::killingAppsAndHS Leave(ENXIO)"); - return false; - } -*/ + ICO_TRA("CicoSCUserManager::killingAppsAndHS Enter"); + m_vppa.clear(); CicoSCLifeCycleController* oCSCLCC; oCSCLCC = CicoSCLifeCycleController::getInstance(); if ((NULL == oCSCLCC) || (0 == oCSCLCC)) { - ICO_ERR("CicoSCUserManager::killingAppsAndHS Leave(ENXIO)"); + ICO_TRA("CicoSCUserManager::killingAppsAndHS Leave(ENXIO)"); return false; } bool r = false; - const vector& aulList = oCSCLCC->getAulList(); + const vector& aulList = oCSCLCC->getAulList(); vector pids; for (int i=aulList.size() ; i != 0; i--) { - const CicoSCAulItems* pObj = aulList[i-1].p(); + const CicoAulItems* pObj = aulList[i-1].p(); if ((NULL == pObj) || (0 == pObj)) { continue; } @@ -530,7 +529,8 @@ bool CicoSCUserManager::killingAppsAndHS(const string&) for (int j=0; j < sz; j++) { oCSCLCC->terminate(pids[j]); } - ICO_DBG("CicoSCUserManager::killingAppsAndHS ret=%s", r? "true": "false"); + ICO_TRA("CicoSCUserManager::killingAppsAndHS Leave(ret=%s)", + r? "true": "false"); return r; } @@ -587,9 +587,7 @@ bool CicoSCUserManager::launchHomescreenReq(const string& usr, oCSCLCC = CicoSCLifeCycleController::getInstance(); int r = oCSCLCC->launch(appid_hs.c_str(), b); -// -// ??? bundle_free(b); -// + bundle_free(b); if (ICO_SYC_EOK != r) { ICO_DBG("CicoSCUserManager::launchHomescreenReq false(%d)", r); @@ -648,7 +646,7 @@ CicoSCUserManager::dumpHomeScreenList(void) void CicoSCUserManager::userlistCB(const string & appid) { - ICO_DBG("CicoSCUserManager::userlistCB Enter (%s)", appid.c_str()); + ICO_TRA("CicoSCUserManager::userlistCB Enter (%s)", appid.c_str()); // send message CicoSCMessage *message = new CicoSCMessage(); @@ -670,7 +668,7 @@ CicoSCUserManager::userlistCB(const string & appid) CicoSCServer::getInstance()->sendMessage(appid, message); - ICO_DBG("CicoSCUserManager::userlistCB Leave(EOK)"); + ICO_TRA("CicoSCUserManager::userlistCB Leave"); } //-------------------------------------------------------------------------- @@ -685,7 +683,7 @@ CicoSCUserManager::userlistCB(const string & appid) void CicoSCUserManager::lastinfoCB(const string & appid) { - ICO_DBG("CicoSCUserManager::lastinfoCB Enter (%s)", appid.c_str()); + ICO_TRA("CicoSCUserManager::lastinfoCB Enter(%s)", appid.c_str()); // send message CicoSCMessage *message = new CicoSCMessage(); @@ -707,7 +705,7 @@ CicoSCUserManager::lastinfoCB(const string & appid) CicoSCServer::getInstance()->sendMessage(appid, message); - ICO_DBG("CicoSCUserManager::lastinfoCB Leave(EOK)"); + ICO_TRA("CicoSCUserManager::lastinfoCB Leave"); } //-------------------------------------------------------------------------- @@ -720,7 +718,7 @@ CicoSCUserManager::lastinfoCB(const string & appid) void CicoSCUserManager::saveLastUser(void) { - ICO_DBG("CicoSCUserManager::saveLastUser Enter (name=%s)", m_login.c_str()); + ICO_TRA("CicoSCUserManager::saveLastUser Enter(name=%s)", m_login.c_str()); // output last user name to file std::ofstream stream; @@ -729,7 +727,7 @@ CicoSCUserManager::saveLastUser(void) stream << m_login << std::endl; stream.close(); - ICO_DBG("CicoSCUserManager::saveLastUser Leave(EOK)"); + ICO_TRA("CicoSCUserManager::saveLastUser Leave"); } //-------------------------------------------------------------------------- @@ -742,14 +740,14 @@ CicoSCUserManager::saveLastUser(void) void CicoSCUserManager::loadLastUser(void) { - ICO_DBG("CicoSCUserManager::loadLastUser Enter"); + ICO_TRA("CicoSCUserManager::loadLastUser Enter"); // check weather file exists struct stat st; int ret = stat(ICO_SYC_LASTUSER_FILE, &st); if (0 != ret) { // last user file does not exist - ICO_DBG("CicoSCUserManager::loadLastUser Leave(ENXIO)"); + ICO_TRA("CicoSCUserManager::loadLastUser Leave"); return; } @@ -776,7 +774,7 @@ CicoSCUserManager::loadLastUser(void) } } - ICO_DBG("CicoSCUserManager::loadLastUser Leave(EOK)"); + ICO_TRA("CicoSCUserManager::loadLastUser Leave"); } //-------------------------------------------------------------------------- @@ -789,10 +787,11 @@ CicoSCUserManager::loadLastUser(void) void CicoSCUserManager::loadLastInfo() { - ICO_DBG("CicoSCUserManager::loadLastInfo Enter (name=%s)", m_login.c_str()); + ICO_TRA("CicoSCUserManager::loadLastInfo Enter(name=%s)", m_login.c_str()); if (m_login.empty()) { - ICO_ERR("CicoSCUserManager::loadLastInfo Leave(EINVAL)"); + ICO_ERR("m_login is empty"); + ICO_TRA("CicoSCUserManager::loadLastInfo Leave(m_login is empty)"); return; } @@ -802,7 +801,8 @@ CicoSCUserManager::loadLastInfo() // check login user if (NULL == loginUser) { // login user does not exist in the user list - ICO_DBG("CicoSCUserManager::setLastInfo Leave(ENXIO)"); + ICO_ERR("login user not found"); + ICO_TRA("CicoSCUserManager::setLastInfo Leave(login user not found)"); return; } @@ -812,7 +812,8 @@ CicoSCUserManager::loadLastInfo() int ret = stat(dir.c_str(), &st); if (0 != ret) { // lastinfo directory does not exist - ICO_DBG("CicoSCUserManager::loadLastInfo Leave(ENXIO)"); + ICO_ERR("lastinfo directory dose not exist)"); + ICO_TRA("CicoSCUserManager::loadLastInfo Leave(dir dose not exist)"); return; } @@ -845,7 +846,7 @@ CicoSCUserManager::loadLastInfo() } free(filelist); - ICO_DBG("CicoSCUserManager::loadLastInfo Leave(EOK)"); + ICO_TRA("CicoSCUserManager::loadLastInfo Leave"); } //-------------------------------------------------------------------------- @@ -859,7 +860,7 @@ CicoSCUserManager::loadLastInfo() void CicoSCUserManager::setLoginUser(const ptree & root) { - ICO_DBG("CicoSCUserManager::setLoginUser Enter"); + ICO_TRA("CicoSCUserManager::setLoginUser Enter"); // load last user name loadLastUser(); @@ -896,7 +897,7 @@ CicoSCUserManager::setLoginUser(const ptree & root) // dump data ICO_DBG("login user name: %s", m_login.c_str()); - ICO_DBG("CicoSCUserManager::setLoginUser Leave(EOK)"); + ICO_TRA("CicoSCUserManager::setLoginUser Leave"); } //-------------------------------------------------------------------------- @@ -910,7 +911,7 @@ CicoSCUserManager::setLoginUser(const ptree & root) void CicoSCUserManager::createUserList(const ptree & root) { - ICO_DBG("CicoSCUserManager::createUserList Enter"); + ICO_TRA("CicoSCUserManager::createUserList Enter"); ptree homescreens = root.get_child("userconfig.users"); @@ -957,7 +958,7 @@ CicoSCUserManager::createUserList(const ptree & root) m_userList.push_back(userConf); } - ICO_DBG("CicoSCUserManager::createUserList Leave(EOK)"); + ICO_TRA("CicoSCUserManager::createUserList Leave"); } //-------------------------------------------------------------------------- @@ -971,7 +972,7 @@ CicoSCUserManager::createUserList(const ptree & root) void CicoSCUserManager::createHomeScreenList(const ptree & root) { - ICO_DBG("CicoSCUserManager::createHomeScreenList Enter"); + ICO_TRA("CicoSCUserManager::createHomeScreenList Enter"); ptree homescreens = root.get_child("userconfig.homescreens"); @@ -992,7 +993,7 @@ CicoSCUserManager::createHomeScreenList(const ptree & root) // dump data dumpHomeScreenList(); - ICO_DBG("CicoSCUserManager::createHomeScreenList Leave(EOK)"); + ICO_TRA("CicoSCUserManager::createHomeScreenList Leave"); } //-------------------------------------------------------------------------- @@ -1007,7 +1008,7 @@ CicoSCUserManager::createHomeScreenList(const ptree & root) void CicoSCUserManager::setLastInfo(const string & appid, const string & info) { - ICO_DBG("CicoSCUserManager::setLastInfo Enter(appid: %s, info: %s)", + ICO_TRA("CicoSCUserManager::setLastInfo Enter(appid: %s, info: %s)", appid.c_str(), info.c_str()); CicoSCUser* loginUser = NULL; @@ -1018,7 +1019,8 @@ CicoSCUserManager::setLastInfo(const string & appid, const string & info) // check login user if (NULL == loginUser) { // login user does not exist in the user list - ICO_DBG("CicoSCUserManager::setLastInfo Leave(ENXIO)"); + ICO_ERR("login user does not exist in the user list"); + ICO_TRA("CicoSCUserManager::setLastInfo Leave"); return; } @@ -1067,7 +1069,7 @@ CicoSCUserManager::setLastInfo(const string & appid, const string & info) ICO_DBG("login user=%s", (loginUser->name).c_str()); lastInfo->dumpLastInfo(); - ICO_DBG("CicoSCUserManager::setLastInfo Leave(EOK)"); + ICO_TRA("CicoSCUserManager::setLastInfo Leave(EOK)"); } //-------------------------------------------------------------------------- @@ -1081,20 +1083,20 @@ CicoSCUserManager::setLastInfo(const string & appid, const string & info) const CicoSCUser* CicoSCUserManager::findUserConfbyName(const string & name) { -// ICO_DBG("CicoSCUserManager::findUserConfbyName Enter (%s)", name.c_str()); +// ICO_TRA("CicoSCUserManager::findUserConfbyName Enter (%s)", name.c_str()); vector::iterator itr; itr = m_userList.begin(); for (; itr != m_userList.end(); ++itr) { const CicoSCUser* conf = const_cast(*itr); if (name == conf->name) { -// ICO_DBG("CicoSCUserManager::findUserConfbyName Leave(%s)", +// ICO_TRA("CicoSCUserManager::findUserConfbyName Leave(%s)", // conf->name); return conf; } } -// ICO_DBG("CicoSCUserManager::findUserConfbyName Leave(NULL)"); +// ICO_TRA("CicoSCUserManager::findUserConfbyName Leave(NULL)"); return NULL; } @@ -1139,20 +1141,6 @@ void CicoSCUserManager::flagFileOff() } /** - * @brief directory last slash add - * @param s directory path string - */ -void chkAndAddSlash(string& s) -{ - int sz = s.size(); - const char* p = s.c_str(); - if ('/' != p[sz-1]) { - s += "/"; - } -} - - -/** * @brief app dead Handler * @param pid dead pid * @return bool @@ -1210,8 +1198,7 @@ bool CicoSCUserManager::appDeadHandler(int pid) m_waitName.clear(); m_waitHS.clear(); m_wait = false; - ICO_DBG("end homescreen start req.(%s)", appid.c_str()); + ICO_TRA("end homescreen start req.(%s)", appid.c_str()); return true; } - // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCUserManager.h b/lib/system-controller/CicoSCUserManager.h index 3a3276a..b9063a0 100644 --- a/lib/system-controller/CicoSCUserManager.h +++ b/lib/system-controller/CicoSCUserManager.h @@ -55,6 +55,7 @@ public: // change user void changeUser(const std::string & name, const std::string & passwd); + void cloaseUser(); // dump log void dumpUserList(void); @@ -62,6 +63,12 @@ public: // application daed watcher bool appDeadHandler(int pid); + + bool isStoppingNow(); + + // working user directory make + void getWorkingDir(const std::string& usr, std::string& dir); + const std::string& getHomeDir() const; private: // default constructor CicoSCUserManager(); @@ -104,9 +111,6 @@ private: // Killing running application and homeScreen bool killingAppsAndHS(const std::string& usrnm); - // working user directory make - void getWorkingDir(const std::string& usr, std::string& dir); - // launch homescreen request bool launchHomescreenReq(const std::string& usr, const std::string& appid_hs); @@ -129,5 +133,34 @@ private: std::string m_waitName; /// wait backup login name std::string m_waitHS; /// wait backup homescreen appid }; + +/** + * @brief get Homescreen Stopping Status + * @ret bool + * @retval true: stopping now + * @retval false: no stop + * + */ +inline bool CicoSCUserManager::isStoppingNow(){ + return !m_vppa.empty(); +} + +/** + * @brief close User + */ +inline void CicoSCUserManager::cloaseUser() +{ + flagFileOn(); + killingAppsAndHS(m_login); +} + +/** + * + */ +inline const std::string& CicoSCUserManager::getHomeDir() const +{ + return m_parentDir; +} + #endif // __CICO_SC_USER_MANAGER_H__ // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCVInfo.h b/lib/system-controller/CicoSCVInfo.h new file mode 100644 index 0000000..b502480 --- /dev/null +++ b/lib/system-controller/CicoSCVInfo.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoSCVInfo.h + * + * @brief This file is definition of CicoSCVInfo class + */ +//========================================================================== +#ifndef __CICO_SC_VINFO_H__ +#define __CICO_SC_VINFO_H__ + +#include + +//-------------------------------------------------------------------------- +/** + * @brief Enumerations of vehicle information property + */ +//-------------------------------------------------------------------------- +typedef enum _ico_vinfo_prop { + ICO_VINFO_VEHICLE_SPEED = 1, ///< vehicle speed + ICO_VINFO_SHIFT_POSITION, ///< shift position + ICO_VINFO_LIGHT_LEFT, ///< light left(Turn left) + ICO_VINFO_LIGHT_RIGHT, ///< light right(Turn right) + ICO_VINFO_NIGHT_MODE, ///< night mode + ICO_VINFO_DRIVING_MODE, ///< driving mode + + ICO_VINFO_MAX ///< maximum number of type +} ico_vinfo_prop_e; + +//-------------------------------------------------------------------------- +/** + * @brief This class holds vehicle information + */ +//-------------------------------------------------------------------------- +class CicoSCVInfo +{ +public: + // default constructor + CicoSCVInfo(int type, int prop, union dbus_value_variant value) + : m_type(type), m_prop(prop), m_value(value) {} + + // destructor + virtual ~CicoSCVInfo() {} + + // get value type + int getType(void) { return m_type; } + + // get property + int getProperty(void) { return m_prop; } + + // get boolean value + bool getBooleanValue(void) { return (m_value.bval != 0) ? true : false; } + + // get int8_t value + int8_t getint8Value(void) { return m_value.yval; } + + // get uint8_t value + uint8_t getUint8Value(void) { return m_value.yval; } + + // get int16_t value + int16_t getInt16Value(void) { return m_value.i16val; } + + // get uint16_t value + uint16_t getUint16Value(void) { return m_value.ui16val; } + + // get int32_t value + int32_t getInt32Value(void) { return m_value.i32val; } + + // get uint32_t value + uint32_t getUint32Value(void) { return m_value.ui32val; } + + // get int64_t value + int64_t getInt64Value(void) { return m_value.i64val; } + + // get uint64_t value + uint64_t getUint64Value(void) { return m_value.ui64val; } + + // get double value + double getDoubleValue(void) { return m_value.dval; } + + // get string value + const char* getStringValue(void) { return (const char*)m_value.sval; } + +private: + // default constructor + CicoSCVInfo(); + + // assignment operator + CicoSCVInfo& operator=(const CicoSCVInfo &object); + + // copy constructor + CicoSCVInfo(const CicoSCVInfo &object); + +private: + // type of value + int m_type; + + // property id of vehicle information + int m_prop; + + // vehicle information value + union dbus_value_variant m_value; +}; +#endif // __CICO_SC_VINFO_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCVInfoManager.cpp b/lib/system-controller/CicoSCVInfoManager.cpp new file mode 100644 index 0000000..507f297 --- /dev/null +++ b/lib/system-controller/CicoSCVInfoManager.cpp @@ -0,0 +1,505 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoSCVInfoManager.cpp + * + * @brief This file implementation of CicoSCVInfoManager class + */ +//========================================================================== + +#include + +#include + +#include "CicoLog.h" +#include +#include "CicoSCVInfoManager.h" +#include "CicoSystemConfig.h" +#include "CicoConf.h" +#include "CicoSCVInfo.h" + +//========================================================================== +// private static variable +//========================================================================== +CicoSCVInfoManager* CicoSCVInfoManager::ms_myInstance = NULL; +int CicoSCVInfoManager::ms_ecoreEvType= 0; +dbus_type CicoSCVInfoManager::ms_dbusTypes[ICO_TYPE_MAX]; +int CicoSCVInfoManager::ms_retryCnt = 0; + +//-------------------------------------------------------------------------- +/** + * @brief default constructor + */ +//-------------------------------------------------------------------------- +CicoSCVInfoManager::CicoSCVInfoManager() + : m_initialized(false) +{ + ms_dbusTypes[ICO_TYPE_UNKNOW] = DBUS_TYPE_INT32; + ms_dbusTypes[ICO_TYPE_BOOLEAN] = DBUS_TYPE_BOOLEAN; + ms_dbusTypes[ICO_TYPE_INT8] = DBUS_TYPE_BYTE; + ms_dbusTypes[ICO_TYPE_UINT8] = DBUS_TYPE_BYTE; + ms_dbusTypes[ICO_TYPE_INT16] = DBUS_TYPE_INT16; + ms_dbusTypes[ICO_TYPE_UINT16] = DBUS_TYPE_UINT16; + ms_dbusTypes[ICO_TYPE_INT32] = DBUS_TYPE_INT32; + ms_dbusTypes[ICO_TYPE_UINT32] = DBUS_TYPE_UINT32; + ms_dbusTypes[ICO_TYPE_INT64] = DBUS_TYPE_INT64; + ms_dbusTypes[ICO_TYPE_UINT64] = DBUS_TYPE_UINT64; + ms_dbusTypes[ICO_TYPE_DOUBLE] = DBUS_TYPE_DOUBLE; + ms_dbusTypes[ICO_TYPE_STRING] = DBUS_TYPE_STRING; + + ms_ecoreEvType = ecore_event_type_new(); +} + +//-------------------------------------------------------------------------- +/** + * @brief destructor + */ +//-------------------------------------------------------------------------- +CicoSCVInfoManager::~CicoSCVInfoManager() +{ +} + +//-------------------------------------------------------------------------- +/** + * @brief get instance of CicoSystemConfig + * + * @return pointer of CicoSystemConfig object + */ +//-------------------------------------------------------------------------- +CicoSCVInfoManager* +CicoSCVInfoManager::getInstance(void) +{ + if (NULL == ms_myInstance) { + ms_myInstance = new CicoSCVInfoManager(); + } + return ms_myInstance; +} + +//-------------------------------------------------------------------------- +/** + * @brief startup communication of vehicle information + * + * @return result + * @retval true success + * @retval false error + */ +//-------------------------------------------------------------------------- +bool +CicoSCVInfoManager::startup(void) +{ + ICO_TRA("CicoSCVInfoManager::startup Enter"); + + if (true == m_initialized) { + ICO_DBG("already initialized."); + ICO_TRA("CicoSCVInfoManager::startup Leave(true)"); + } + + ICO_DBG("called: ico_dbus_amb_start"); + int ret = ico_dbus_amb_start(); + if (0 != ret) { + ICO_ERR("ico_dbus_amb_start failed. ret=%d", ret); + ICO_TRA("CicoSCVInfoManager::startup Leave(false)"); + return false; + } + + m_initialized = true; + + startMonitoring(); + + + ICO_TRA("CicoSCVInfoManager::startup Leave(true)"); + return true; +} + +//-------------------------------------------------------------------------- +/** + * @brief teardown communication of vehicle information + * + * @return result + * @retval true success + * @retval false error + */ +//-------------------------------------------------------------------------- +bool +CicoSCVInfoManager::teardown(void) +{ + ICO_TRA("CicoSCVInfoManager::teardown Enter"); + + if (false == m_initialized) { + ICO_DBG("not initialized."); + ICO_TRA("CicoSCVInfoManager::teardown Leave(true)"); + } + + m_initialized = false; + + stopMonitoring(); + + ICO_DBG("called: ico_dbus_amb_end"); + int ret = ico_dbus_amb_end(); + if (0 != ret) { + ICO_ERR("ico_dbus_amb_end faile. ret=%d", ret); + ICO_TRA("CicoSCVInfoManager::teardown Leave(false)"); + return false; + } + + ICO_TRA("CicoSCVInfoManager::teardown Leave(true)"); + return true; +} + +//-------------------------------------------------------------------------- +/** + * @brief get ecore event type of changed vehicle information + * + * @return ecore event type + */ +//-------------------------------------------------------------------------- +int +CicoSCVInfoManager::getEcoreEvType(void) +{ + return ms_ecoreEvType; +} + +//-------------------------------------------------------------------------- +/** + * @brief get vehicle information + * + * @param [in] property vehicle information property + * + * @return result + * @retval true success + * @retval false error + */ +//-------------------------------------------------------------------------- +bool +CicoSCVInfoManager::getVehicleInfo(int property) +{ + ICO_TRA("CicoSCVInfoManager::getVehicleInfo Enter(prop=%d)", property); + + if (false == m_initialized) { + ICO_DBG("not initialized."); + ICO_TRA("CicoSCVInfoManager::getVehicleInfo Leave(false)"); + return false; + } + + CicoSystemConfig* sysconf = CicoSystemConfig::getInstance(); + CicoSCVehicleInfoConf* viconf = sysconf->getVehicleInfoConf(); + std::map::iterator itr; + itr = viconf->properties.find(property); + if (itr == viconf->properties.end()) { + ICO_WRN("not found propetry(%d)", property); + return false; + } + + ICO_DBG("called: ico_dbus_amb_get(objname=%s prop=%s zone=%d type=%d)", + itr->second->objname.c_str(), + itr->second->property.c_str(), + itr->second->zone, + ms_dbusTypes[itr->second->type]); + int ret = ico_dbus_amb_get(itr->second->objname.c_str(), + itr->second->property.c_str(), + itr->second->zone, + ms_dbusTypes[itr->second->type], + CicoSCVInfoManager::dbusAMBGetCB, + itr->second); + if (0 != ret) { + ICO_WRN("ico_dbus_amb_get failed. ret=%d", ret); + ICO_TRA("CicoSCVInfoManager::getVehicleInfo Leave(false)"); + return false; + } + + ICO_TRA("CicoSCVInfoManager::getVehicleInfo Leave(true)"); + return true; +} + +//========================================================================== +// private functions +//========================================================================== + +//-------------------------------------------------------------------------- +/** + * @brief start vehicle information monitoring + */ +//-------------------------------------------------------------------------- +void +CicoSCVInfoManager::startMonitoring(void) +{ + ICO_TRA("CicoSCVInfoManager::startMonitoring Enter"); + + CicoSystemConfig* sysconf = CicoSystemConfig::getInstance(); + CicoSCVehicleInfoConf* viconf = sysconf->getVehicleInfoConf(); + std::map::iterator itr; + itr = viconf->properties.begin(); + + for (; itr != viconf->properties.end(); ++itr) { + ICO_DBG("called: ico_dbus_amb_find_property" + "(objname=%s prop=%s zone=%d type=%d)", + itr->second->objname.c_str(), + itr->second->property.c_str(), + itr->second->zone, + ms_dbusTypes[itr->second->type]); + int ret = ico_dbus_amb_find_property(itr->second->objname.c_str(), + itr->second->property.c_str(), + itr->second->zone, + ms_dbusTypes[itr->second->type], + CicoSCVInfoManager::dbusAMBFindCB, + itr->second); + if (0 != ret) { + ICO_WRN("ico_dbus_amb_find_property failed. ret=%d", ret); + } + } + + ICO_TRA("CicoSCVInfoManager::startMonitoring Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief stop vehicle information monitoring + */ +//-------------------------------------------------------------------------- +void +CicoSCVInfoManager::stopMonitoring(void) +{ + ICO_TRA("CicoSCVInfoManager::stopMonitoring Enter"); + + CicoSystemConfig* sysconf = CicoSystemConfig::getInstance(); + CicoSCVehicleInfoConf* viconf = sysconf->getVehicleInfoConf(); + std::map::iterator itr; + itr = viconf->properties.begin(); + for (; itr != viconf->properties.end(); ++itr) { + ICO_DBG("called: ico_dbus_amb_unsubscribe" + "(objname=%s prop=%s zone=%d type=%d)", + itr->second->objname.c_str(), + itr->second->property.c_str(), + itr->second->zone, + ms_dbusTypes[itr->second->type]); + int ret = ico_dbus_amb_unsubscribe(itr->second->objname.c_str(), + itr->second->property.c_str(), + itr->second->zone); + if (0 != ret) { + ICO_WRN("ico_dbus_amb_subscribe failed. ret=%d", ret); + } + } + + ICO_TRA("CicoSCVInfoManager::stopMonitoring Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function of Ecore_End_Cb + * + * @param [in] user_data user data + * @param [in] func_data funnction data + */ +//-------------------------------------------------------------------------- +void +CicoSCVInfoManager::evVInfoFree(void* user_data, void* func_data) +{ + ICO_TRA("CicoSCVInfoManager::evVInfoFree Enter"); + delete static_cast(func_data); + ICO_TRA("CicoSCVInfoManager::evVInfoFree Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function of ecore timer + * + * @param [in] data user data + */ +//-------------------------------------------------------------------------- +Eina_Bool +CicoSCVInfoManager::ecoreRetryFindPropCB(void *data) +{ + ICO_TRA("CicoSCVInfoManager::ecoreRetryFindPropCB Enter"); + if (NULL != data) { + CicoSCVIPropertyConf* viProp = static_cast(data); + ICO_DBG("called: ico_dbus_amb_find_property" + "(objname=%s prop=%s zone=%d type=%d)", + viProp->objname.c_str(), + viProp->property.c_str(), + viProp->zone, + ms_dbusTypes[viProp->type]); + int ret = ico_dbus_amb_find_property(viProp->objname.c_str(), + viProp->property.c_str(), + viProp->zone, + ms_dbusTypes[viProp->type], + CicoSCVInfoManager::dbusAMBFindCB, + viProp); + if (0 != ret) { + ICO_WRN("ico_dbus_amb_property failed. ret=%d", ret); + } + + } + ICO_TRA("CicoSCVInfoManager::ecoreRetryFindPropCB Leave(cancel)"); + return ECORE_CALLBACK_CANCEL; +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function of ico_dbus_amb_get result + * + * @param [in] objectname dbus object name + * @param [in] property vehicle information's name + * @param [in] type type of vechcle information + * @param [in] data user data + * @param [in] error error information + */ +//-------------------------------------------------------------------------- +void +CicoSCVInfoManager::dbusAMBFindCB(const char *objectname, + const char *property, + dbus_type type, + void *data, + ico_dbus_error_t *error) +{ + ICO_TRA("CicoSCVInfoManager::dbusAMBFindCB Enter" + "(objname=%s prop=%s type=%d)", + objectname, property, type); + + if (NULL == data) { + ICO_WRN("data is null"); + return; + } + + CicoSCVIPropertyConf* viProp = static_cast(data); + + // if find property is error, retry. + if (NULL != error) { + CicoSystemConfig* sysconf = CicoSystemConfig::getInstance(); + CicoSCVehicleInfoConf* viconf = sysconf->getVehicleInfoConf(); + ICO_DBG("retryCnt=%d/%d", ms_retryCnt, viconf->retryCnt); + if (viconf->retryCnt > ms_retryCnt) { + ms_retryCnt++; + ICO_DBG("called: ecore_timer_add"); + Ecore_Timer *timer = NULL; + timer = ecore_timer_add((double)viconf->waitTime/1000.0f, + CicoSCVInfoManager::ecoreRetryFindPropCB, + viProp); + if (NULL == timer) { + ICO_ERR("ecore_timer_add() failed."); + } + + } + ICO_TRA("CicoSCVInfoManager::dbusAMBFindCB Levae"); + return; + } + + // get vehicle information + ICO_DBG("called: ico_dbus_amb_get(objname=%s prop=%s zone=%d type=%d)", + viProp->objname.c_str(), + viProp->property.c_str(), + viProp->zone, + ms_dbusTypes[viProp->type]); + int ret = ico_dbus_amb_get(viProp->objname.c_str(), + viProp->property.c_str(), + viProp->zone, + ms_dbusTypes[viProp->type], + CicoSCVInfoManager::dbusAMBGetCB, + viProp); + if (0 != ret) { + ICO_WRN("ico_dbus_amb_subscribe failed. ret=%d", ret); + } + + // subscribe vehicle information + ICO_DBG("called: ico_dbus_amb_subscribe" + "(objname=%s prop=%s zone=%d type=%d)", + viProp->objname.c_str(), + viProp->property.c_str(), + viProp->zone, + ms_dbusTypes[viProp->type]); + ret = ico_dbus_amb_subscribe(viProp->objname.c_str(), + viProp->property.c_str(), + viProp->zone, + ms_dbusTypes[viProp->type], + CicoSCVInfoManager::dbusAMBNotifyCB, + viProp); + if (0 != ret) { + ICO_WRN("ico_dbus_amb_subscribe failed. ret=%d", ret); + } + + ICO_TRA("CicoSCVInfoManager::dbusAMBFindCB Levae"); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function of ico_dbus_amb_get result + * + * @param [in] objectname dbus object name + * @param [in] property vehicle information's name + * @param [in] type type of vechcle information + * @param [in] value vechcle information's value + * @param [in] data user data + */ +//-------------------------------------------------------------------------- +void +CicoSCVInfoManager::dbusAMBGetCB(const char *objectname, + const char *property, + dbus_type type, + union dbus_value_variant value, + void *data) +{ + ICO_TRA("CicoSCVInfoManager::dbusAMBGetCB Enter" + "(objname=%s prop=%s type=%d)", + objectname, property, type); + + if (NULL == data) { + ICO_WRN("data is null"); + return; + } + + CicoSCVIPropertyConf* viConf = static_cast(data); + + CicoSCVInfo* vinfo = new CicoSCVInfo(type, viConf->id, value); + ecore_event_add(ms_ecoreEvType, vinfo, + CicoSCVInfoManager::evVInfoFree, NULL); + + ICO_TRA("CicoSCVInfoManager::dbusAMBGetCB Levae"); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function of ico_dbus_amb_get result + * + * @param [in] objectname dbus object name + * @param [in] property vehicle information's name + * @param [in] type type of vechcle information + * @param [in] value vechcle information's value + * @param [in] sequence number of sequence + * @parma [in] tv recored time + * @param [in] data user data + */ +//-------------------------------------------------------------------------- +void +CicoSCVInfoManager::dbusAMBNotifyCB(const char *objectname, + const char *property, + dbus_type type, + union dbus_value_variant value, + int sequence, + struct timeval tv, + void *data) +{ + ICO_TRA("CicoSCVInfoManager::dbusAMBNotifyCB Enter" + "(objname=%s prop=%s type=%d)", + objectname, property, type); + + if (NULL == data) { + ICO_WRN("data is null"); + return; + } + + CicoSCVIPropertyConf* viConf = static_cast(data); + + CicoSCVInfo* vinfo = new CicoSCVInfo(type, viConf->id, value); + ecore_event_add(ms_ecoreEvType, vinfo, + CicoSCVInfoManager::evVInfoFree, NULL); + + ICO_TRA("CicoSCVInfoManager::dbusAMBNotifyCB Leave"); +} +// vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCVInfoManager.h b/lib/system-controller/CicoSCVInfoManager.h new file mode 100644 index 0000000..e5bb420 --- /dev/null +++ b/lib/system-controller/CicoSCVInfoManager.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoSCVInfoManager.h + * + * @brief This file is definition of CicoSCVInfoManager class + */ +//========================================================================== +#ifndef __CICO_SC_VINFO_MANAGER_H__ +#define __CICO_SC_VINFO_MANAGER_H__ + +#include +#include + +#include +#include "CicoCommonDef.h" + +//========================================================================== +// Forward declaration +//========================================================================== + +//========================================================================== +/* + * @brief This class manage vehicle information + */ +//========================================================================== +class CicoSCVInfoManager +{ +public: + // get CicoSCVInfoManager instance + static CicoSCVInfoManager* getInstance(void); + + // startup communication of vehicle information + bool startup(void); + + // teardown communication of vehicle information + bool teardown(void); + + // get ecore event type + int getEcoreEvType(void); + + // get vehicle information + bool getVehicleInfo(int property); + +private: + // default constructor + CicoSCVInfoManager(); + + // destructor + ~CicoSCVInfoManager(); + + // assignment operator + CicoSCVInfoManager& operator=(const CicoSCVInfoManager &object); + + // copy constructor + CicoSCVInfoManager(const CicoSCVInfoManager &object); + + // start vehicle information monitoring + void startMonitoring(void); + + // stop vehicle information monitoring + void stopMonitoring(void); + + // callback find vehicle information + static void dbusAMBFindCB(const char *objectname, + const char *property, + dbus_type type, + void *user_data, + ico_dbus_error_t *error); + + // callback get vehicle information + static void dbusAMBGetCB(const char *objectname, + const char *property, + dbus_type type, + union dbus_value_variant value, + void *user_data); + + // callback notify vehicle information + static void dbusAMBNotifyCB(const char *objectname, + const char *property, + dbus_type type, + union dbus_value_variant value, + int sequence, + struct timeval tv, + void *user_data); + + // callback function of Ecore_End_Cb + static void evVInfoFree(void* user_data, void* func_data); + + // callback function of ecore timer + static Eina_Bool ecoreRetryFindPropCB(void *data); + +private: + // CicoSCVInfoManager instannce + static CicoSCVInfoManager* ms_myInstance; + + // ecore event type + static int ms_ecoreEvType; + + // dbus_type table + static dbus_type ms_dbusTypes[ICO_TYPE_MAX]; + + static int ms_retryCnt; + + // initialized flag + bool m_initialized; +}; +#endif // __CICO_SC_VINFO_MANAGER_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCWayland.cpp b/lib/system-controller/CicoSCWayland.cpp index 8241ea6..4a38a58 100644 --- a/lib/system-controller/CicoSCWayland.cpp +++ b/lib/system-controller/CicoSCWayland.cpp @@ -90,9 +90,9 @@ CicoSCWayland::getInstance(void) */ //-------------------------------------------------------------------------- int -CicoSCWayland::intialize(void) +CicoSCWayland::initialize(void) { - ICO_DBG("CicoSCWayland::initialize Enter"); + ICO_TRA("CicoSCWayland::initialize Enter"); for (int i = 0; i < (5000/50); ++i) { m_wlDisplay = wl_display_connect(NULL); if (NULL != m_wlDisplay) { @@ -103,7 +103,7 @@ CicoSCWayland::intialize(void) if (NULL == m_wlDisplay) { ICO_ERR("wl_display_connect failed."); - ICO_ERR("CicoSCWayland::initialize Leave(EIO)"); + ICO_TRA("CicoSCWayland::initialize Leave(EIO)"); return ICO_SYC_EIO; } @@ -111,7 +111,7 @@ CicoSCWayland::intialize(void) m_wlRegistry = wl_display_get_registry(m_wlDisplay); if (NULL == m_wlRegistry) { ICO_ERR("wl_display_get_registry failed."); - ICO_ERR("CicoSCWayland::initialize Leave(EIO)"); + ICO_TRA("CicoSCWayland::initialize Leave(EIO)"); return ICO_SYC_EIO; } @@ -140,8 +140,8 @@ CicoSCWayland::intialize(void) } if (ifcount != initCount) { - ICO_DBG("initialize interface time up NG"); - ICO_ERR("CicoSCWayland::initialize Leave(EIO)"); + ICO_ERR("initialize interface time up NG"); + ICO_TRA("CicoSCWayland::initialize Leave(EIO)"); return ICO_SYC_EIO; } else { @@ -158,7 +158,7 @@ CicoSCWayland::intialize(void) ICO_DBG("CicoSCWayland::initialize: Wayland/Weston connect OK"); - ICO_DBG("CicoSCWayland::initialize: Leave(EOK)"); + ICO_TRA("CicoSCWayland::initialize: Leave(EOK)"); return ICO_SYC_EOK; } @@ -242,7 +242,7 @@ int CicoSCWayland::getWlFd(void) int CicoSCWayland::addEcoreMainWlFdHandler(void) { - ICO_DBG("CicoSCWayland::addEcoreMainWlFdHandler Enter"); + ICO_TRA("CicoSCWayland::addEcoreMainWlFdHandler Enter"); ICO_DBG("called: ecore_main_fd_handler_add(fd=%d)", m_wlFd); m_ecoreFdHandler = ecore_main_fd_handler_add(m_wlFd, ECORE_FD_READ, @@ -252,7 +252,7 @@ CicoSCWayland::addEcoreMainWlFdHandler(void) NULL); if (NULL == m_ecoreFdHandler) { ICO_ERR("ecore_main_fd_handler_add failed."); - ICO_DBG("CicoSCWayland::addEcoreMainWlFdHandler Leave(EIO)"); + ICO_TRA("CicoSCWayland::addEcoreMainWlFdHandler Leave(EIO)"); return ICO_SYC_EIO; } ecore_main_loop_iterate(); @@ -266,7 +266,7 @@ CicoSCWayland::addEcoreMainWlFdHandler(void) CicoSCWayland::getInstance()->dispatchDisplay(); } - ICO_DBG("CicoSCWayland::addEcoreMainWlFdHandler Leave"); + ICO_TRA("CicoSCWayland::addEcoreMainWlFdHandler Leave"); return ICO_SYC_EOK; } @@ -357,7 +357,7 @@ CicoSCWayland::wlGlobalCB(void *data, Eina_Bool CicoSCWayland::waylandFdHandler(void *data, Ecore_Fd_Handler *handler) { -// ICO_DBG("waylandFdHandler: Enter"); +// ICO_TRA("waylandFdHandler: Enter"); CicoSCWayland::getInstance()->flushDisplay(); @@ -380,7 +380,7 @@ CicoSCWayland::waylandFdHandler(void *data, Ecore_Fd_Handler *handler) } CicoSCWayland::getInstance()->flushDisplay(); -// ICO_DBG("waylandFdHandler: Leave"); +// ICO_TRA("waylandFdHandler: Leave"); return ECORE_CALLBACK_RENEW ; } // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCWayland.h b/lib/system-controller/CicoSCWayland.h index 94be850..c7ab6cb 100644 --- a/lib/system-controller/CicoSCWayland.h +++ b/lib/system-controller/CicoSCWayland.h @@ -40,7 +40,7 @@ public: static CicoSCWayland* getInstance(); // initialize wayland connection - int intialize(void); + int initialize(void); // flush display void flushDisplay(void); diff --git a/lib/system-controller/CicoSCWindow.cpp b/lib/system-controller/CicoSCWindow.cpp index 5a0019a..3661f4b 100644 --- a/lib/system-controller/CicoSCWindow.cpp +++ b/lib/system-controller/CicoSCWindow.cpp @@ -32,8 +32,8 @@ CicoSCWindow::CicoSCWindow() subwindow(0), eventmask(0), x(-1), y(-1), width(-1), height(-1), visible(false), raise(false), active(false) { - ICO_DBG("CicoSCWindow::CicoSCWindow Enter"); - ICO_DBG("CicoSCWindow::CicoSCWindow Leave"); +// ICO_TRA("CicoSCWindow::CicoSCWindow Enter"); +// ICO_TRA("CicoSCWindow::CicoSCWindow Leave"); } //-------------------------------------------------------------------------- @@ -43,8 +43,8 @@ CicoSCWindow::CicoSCWindow() //-------------------------------------------------------------------------- CicoSCWindow::~CicoSCWindow() { - ICO_DBG("CicoSCWindow::~CicoSCWindow Enter"); - ICO_DBG("CicoSCWindow::~CicoSCWindow Leave"); +// ICO_TRA("CicoSCWindow::~CicoSCWindow Enter"); +// ICO_TRA("CicoSCWindow::~CicoSCWindow Leave"); } //-------------------------------------------------------------------------- diff --git a/lib/system-controller/CicoSCWindowController.cpp b/lib/system-controller/CicoSCWindowController.cpp index 430eb55..7c9d944 100644 --- a/lib/system-controller/CicoSCWindowController.cpp +++ b/lib/system-controller/CicoSCWindowController.cpp @@ -32,8 +32,8 @@ using namespace std; #include "CicoSCWindowController.h" #include "CicoLog.h" -#include "CicoSCSystemConfig.h" -#include "CicoSCConf.h" +#include "CicoSystemConfig.h" +#include "CicoConf.h" #include "CicoSCDisplay.h" #include "CicoSCLayer.h" #include "CicoSCDisplayZone.h" @@ -78,10 +78,10 @@ CicoSCWindowController::~CicoSCWindowController() int CicoSCWindowController::initDB(void) { - ICO_DBG("CicoSCWindowController::initDB: Enter"); + ICO_TRA("CicoSCWindowController::initDB: Enter"); const vector& displayList = - CicoSCSystemConfig::getInstance()->getDisplayConfList(); + CicoSystemConfig::getInstance()->getDisplayConfList(); vector::const_iterator itr; itr = displayList.begin(); for (; itr != displayList.end(); ++itr) { @@ -128,7 +128,7 @@ CicoSCWindowController::initDB(void) m_displayList.push_back(display); } - ICO_DBG("CicoSCWindowController::initDB: Leave"); + ICO_TRA("CicoSCWindowController::initDB: Leave"); return ICO_SYC_EOK; } @@ -164,14 +164,15 @@ CicoSCWindowController::show(int surfaceid, const char *animation, int animationTime) { - ICO_DBG("CicoSCWindowController::show Enter" + ICO_TRA("CicoSCWindowController::show Enter" "(surfaceid=0x%08X animation=%s animationTime=%d)", surfaceid, animation, animationTime); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::show Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::show Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -222,7 +223,7 @@ CicoSCWindowController::show(int surfaceid, // flush display CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::show Leave(EOK)"); + ICO_TRA("CicoSCWindowController::show Leave(EOK)"); return ICO_SYC_EOK; } @@ -245,20 +246,21 @@ CicoSCWindowController::hide(int surfaceid, const char *animation, int animationTime) { - ICO_DBG("CicoSCWindowController::hide Enter" + ICO_TRA("CicoSCWindowController::hide Enter" "(surfaceid=0x%08X animation=%s animationTime=%d)", surfaceid, animation, animationTime); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::hide Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::hide Leave(ENOENT)"); return ICO_SYC_ENOENT; } if (false == window->visible) { ICO_DBG("already hide state"); - ICO_DBG("CicoSCWindowController::hide Leave(EOK)"); + ICO_TRA("CicoSCWindowController::hide Leave(EOK)"); return ICO_SYC_EOK; } @@ -295,7 +297,7 @@ CicoSCWindowController::hide(int surfaceid, // flush display CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::hide Leave(EOK)"); + ICO_TRA("CicoSCWindowController::hide Leave(EOK)"); return ICO_SYC_EOK; } @@ -322,14 +324,15 @@ CicoSCWindowController::resize(int surfaceid, const char *animation, int animationTime) { - ICO_DBG("CicoSCWindowController::resize Enter" + ICO_TRA("CicoSCWindowController::resize Enter" "(surfaceid=0x%08X h=%d w=%d animation=%s animationTime=%d)", surfaceid, w, h, animation, animationTime); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::resize Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::resize Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -351,7 +354,7 @@ CicoSCWindowController::resize(int surfaceid, // flush display CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::resize Leave(EOK)"); + ICO_TRA("CicoSCWindowController::resize Leave(EOK)"); return ICO_SYC_EOK; } @@ -380,7 +383,7 @@ CicoSCWindowController::move(int surfaceid, const char *animation, int animationTime) { - ICO_DBG("CicoSCWindowController::move Enter" + ICO_TRA("CicoSCWindowController::move Enter" "(surfaceid=0x%08X nodeid=%d x=%d y=%d " "animation=%s animationTime=%d)", surfaceid, nodeid, x, y, animation, animationTime); @@ -388,7 +391,8 @@ CicoSCWindowController::move(int surfaceid, // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::move Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::move Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -416,7 +420,7 @@ CicoSCWindowController::move(int surfaceid, // flush display CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::move Leave(EOK)"); + ICO_TRA("CicoSCWindowController::move Leave(EOK)"); return ICO_SYC_EOK; } @@ -439,14 +443,15 @@ CicoSCWindowController::raise(int surfaceid, const char *animation, int animationTime) { - ICO_DBG("CicoSCWindowController::raise Enter" + ICO_TRA("CicoSCWindowController::raise Enter" "(surfaceid=0x%08X animation=%s animationTime=%d)", surfaceid, animation, animationTime); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::raise Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::raise Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -470,7 +475,7 @@ CicoSCWindowController::raise(int surfaceid, // flush display CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::raise Leave(EOK)"); + ICO_TRA("CicoSCWindowController::raise Leave(EOK)"); return ICO_SYC_EOK; } @@ -480,6 +485,7 @@ CicoSCWindowController::raise(int surfaceid, * * @param [in] surfaceid wayland surface id * @param [in] nodeid node id + * @param [in] layerid layer id * @param [in] x window x position * @param [in] y window y position * @param [in] w window width @@ -498,6 +504,7 @@ CicoSCWindowController::raise(int surfaceid, int CicoSCWindowController::setGeometry(int surfaceid, int nodeid, + int layerid, int x, int y, int w, @@ -507,18 +514,19 @@ CicoSCWindowController::setGeometry(int surfaceid, const char *moveAnimation, int moveAnimationTime) { - ICO_DBG("CicoSCWindowController::setGeometry Enter" - "(surfaceid=0x%08X nodeid=%d x=%d y=%d w=%d h=%d " + ICO_TRA("CicoSCWindowController::setGeometry Enter" + "(surfaceid=0x%08X nodeid=%d layerid=%d x=%d y=%d w=%d h=%d " "resizeAnimation=%s resizeAnimationTime=%d " "moveAnimation=%s moveAnimationTime=%d)", - surfaceid, nodeid, x, y, w, h, + surfaceid, nodeid, layerid, x, y, w, h, resizeAnimation, resizeAnimationTime, moveAnimation, moveAnimationTime); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::setGeometry Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::setGeometry Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -549,7 +557,7 @@ CicoSCWindowController::setGeometry(int surfaceid, if (m_physicalDisplayTotal <= (unsigned int)moveNodeId) { ICO_WRN("nodeid(%d) is over physical display total(%d)", m_physicalDisplayTotal, nodeid); - ICO_WRN("CicoSCWindowController::setGeometry Leave(EINVAL)"); + ICO_TRA("CicoSCWindowController::setGeometry Leave(EINVAL)"); return ICO_SYC_EINVAL; } @@ -573,6 +581,14 @@ CicoSCWindowController::setGeometry(int surfaceid, moveH = h; } + // set window layer to Multi Window Manager + if (0 <= layerid) { + setWindowLayer(window->surfaceid, layerid); + } + + // update window attr + window->nodeid = moveNodeId; + // set visible request to Multi Window Manager CicoSCWlWinMgrIF::setPositionsize(window->surfaceid, moveNodeId, moveX, moveY, moveW, moveH, @@ -581,7 +597,7 @@ CicoSCWindowController::setGeometry(int surfaceid, // flush display CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::setGeometry Leave(EOK)"); + ICO_TRA("CicoSCWindowController::setGeometry Leave(EOK)"); return ICO_SYC_EOK; } @@ -590,6 +606,7 @@ CicoSCWindowController::setGeometry(int surfaceid, * @brief set window(surface) geometry * * @param [in] surfaceid wayland surface id + * @param [in] layerid layer id * @param [in] nodeid node id * @param [in] zone display zone name * @param [in] resizeAnimation resize animation name @@ -607,28 +624,31 @@ CicoSCWindowController::setGeometry(int surfaceid, int CicoSCWindowController::setGeometry(int surfaceid, const char *zone, + int layerid, const char *resizeAnimation, int resizeAnimationTime, const char *moveAnimation, int moveAnimationTime) { - ICO_DBG("CicoSCWindowController::setGeometry Enter" - "(surfaceid=0x%08X zone=%s " + ICO_TRA("CicoSCWindowController::setGeometry Enter" + "(surfaceid=0x%08X zone=%s layerid=%d " "resizeAnimation=%s resizeAnimationTime=%d " "moveAnimation=%s moveAnimationTime=%d)", - surfaceid, zone, + surfaceid, zone, layerid, resizeAnimation, resizeAnimationTime, moveAnimation, moveAnimationTime); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::setGeometry Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::setGeometry Leave(ENOENT)"); return ICO_SYC_ENOENT; } if ((NULL == zone) || ('\0' == zone[0])) { - ICO_WRN("CicoSCWindowController::setGeometry Leave(EINVAL)"); + ICO_WRN("zone value is invalid"); + ICO_TRA("CicoSCWindowController::setGeometry Leave(EINVAL)"); return ICO_SYC_EINVAL; } @@ -646,14 +666,14 @@ CicoSCWindowController::setGeometry(int surfaceid, if (NULL == dispzone) { ICO_WRN("display zone name(%s) is invalid.", zone); - ICO_WRN("CicoSCWindowController::setGeometry Leave(EINVAL)"); + ICO_TRA("CicoSCWindowController::setGeometry Leave(EINVAL)"); return ICO_SYC_EINVAL; } if (m_physicalDisplayTotal <= (unsigned int)displayno) { ICO_WRN("nodeid(%d) is over physical display total(%d)", m_physicalDisplayTotal, displayno); - ICO_WRN("CicoSCWindowController::setGeometry Leave(EINVAL)"); + ICO_TRA("CicoSCWindowController::setGeometry Leave(EINVAL)"); return ICO_SYC_EINVAL; } @@ -687,13 +707,13 @@ CicoSCWindowController::setGeometry(int surfaceid, window->zone = dispzone->fullname; setAttributes(window->surfaceid); - int ret = setGeometry(surfaceid, displayno, + int ret = setGeometry(surfaceid, displayno, layerid, dispzone->x, dispzone->y, dispzone->width, dispzone->height, resizeAnimation, resizeAnimationTime, moveAnimation, moveAnimationTime); - ICO_DBG("CicoSCWindowController::setGeometry Leave(EOK)"); + ICO_TRA("CicoSCWindowController::setGeometry Leave(EOK)"); return ret; } @@ -716,14 +736,15 @@ CicoSCWindowController::lower(int surfaceid, const char *animation, int animationTime) { - ICO_DBG("CicoSCWindowController::lower Enter" + ICO_TRA("CicoSCWindowController::lower Enter" "(surfaceid=0x%08X animation=%s animationTime=%d)", surfaceid, animation, animationTime); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::lower Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::lower Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -746,7 +767,7 @@ CicoSCWindowController::lower(int surfaceid, // flush display CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::lower Leave(EOK)"); + ICO_TRA("CicoSCWindowController::lower Leave(EOK)"); return ICO_SYC_EOK; } @@ -766,13 +787,14 @@ CicoSCWindowController::lower(int surfaceid, int CicoSCWindowController::setWindowLayer(int surfaceid, int layerid) { - ICO_DBG("CicoSCWindowController::setWindowLayer Enter" + ICO_TRA("CicoSCWindowController::setWindowLayer Enter" "(surfaceid=0x%08X layerid=%x)", surfaceid, layerid); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::setWindowLayer Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::setWindowLayer Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -782,7 +804,7 @@ CicoSCWindowController::setWindowLayer(int surfaceid, int layerid) // check special layer if ((layerid != ICO_WINDOW_MGR_LAYERTYPE_TOUCH) && (layerid != ICO_WINDOW_MGR_LAYERTYPE_CURSOR)) { - ICO_WRN("CicoSCWindowController::setWindowLayer Leave(ENOENT[disp=%d,layer=%d])", + ICO_TRA("CicoSCWindowController::setWindowLayer Leave(ENOENT[disp=%d,layer=%d])", window->displayid, layerid); return ICO_SYC_ENOENT; } @@ -797,7 +819,7 @@ CicoSCWindowController::setWindowLayer(int surfaceid, int layerid) // flush display CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::setWindowLayer Leave(EOK)"); + ICO_TRA("CicoSCWindowController::setWindowLayer Leave(EOK)"); return ICO_SYC_EOK; } @@ -817,13 +839,14 @@ CicoSCWindowController::setWindowLayer(int surfaceid, int layerid) int CicoSCWindowController::showLayer(int displayid, int layerid) { - ICO_DBG("CicoSCWindowController::showLayer Enter" + ICO_TRA("CicoSCWindowController::showLayer Enter" "(displayid=%d layerid=%d)", displayid, layerid); // find layer information in layer list CicoSCLayer* layer = findLayer(displayid, layerid); if (NULL == layer) { - ICO_WRN("CicoSCWindowController::showLayer Leave(ENOENT)"); + ICO_WRN("not found layer information"); + ICO_TRA("CicoSCWindowController::showLayer Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -832,7 +855,7 @@ CicoSCWindowController::showLayer(int displayid, int layerid) // flush display CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::showLayer Leave(EOK)"); + ICO_TRA("CicoSCWindowController::showLayer Leave(EOK)"); return ICO_SYC_EOK; } @@ -852,14 +875,15 @@ CicoSCWindowController::showLayer(int displayid, int layerid) int CicoSCWindowController::hideLayer(int displayid, int layerid) { - ICO_DBG("CicoSCWindowController::hideLayer Enter" + ICO_TRA("CicoSCWindowController::hideLayer Enter" "displayid=%d layerid=%d)", displayid, layerid); // find layer information in layer list CicoSCLayer* layer = findLayer(displayid, layerid); if (NULL == layer) { - ICO_WRN("CicoSCWindowController::hideLayer Leave(ENOENT)"); + ICO_WRN("not found layer information"); + ICO_TRA("CicoSCWindowController::hideLayer Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -868,7 +892,7 @@ CicoSCWindowController::hideLayer(int displayid, int layerid) // flush display CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::hideVisible Leave(EOK)"); + ICO_TRA("CicoSCWindowController::hideVisible Leave(EOK)"); return ICO_SYC_EOK; } @@ -890,14 +914,15 @@ CicoSCWindowController::active(int surfaceid, int target) { CicoSCWindow *window = NULL; - ICO_DBG("CicoSCWindowController::active Enter" + ICO_TRA("CicoSCWindowController::active Enter" "(surfaceid=0x%08X, target=%08X)", surfaceid, target); // find window information in window list if (surfaceid) { window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::active Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::active Leave(ENOENT)"); return ICO_SYC_ENOENT; } } @@ -936,7 +961,7 @@ CicoSCWindowController::active(int surfaceid, int target) } } - ICO_DBG("CicoSCWindowController::active Leave(EOK)"); + ICO_TRA("CicoSCWindowController::active Leave(EOK)"); return ICO_SYC_EOK; } @@ -956,12 +981,13 @@ CicoSCWindowController::active(int surfaceid, int target) int CicoSCWindowController::mapSurface(int surfaceid, int framerate) { - ICO_WRN("CicoSCWindowController::mapSurface Enter"); + ICO_TRA("CicoSCWindowController::mapSurface Enter"); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::mapSurface Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::mapSurface Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -972,7 +998,7 @@ CicoSCWindowController::mapSurface(int surfaceid, int framerate) CicoSCWlWinMgrIF::mapSurface(surfaceid, framerate); CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::mapSurface Leave(EOK)"); + ICO_TRA("CicoSCWindowController::mapSurface Leave(EOK)"); return ICO_SYC_EOK; } @@ -991,19 +1017,20 @@ CicoSCWindowController::mapSurface(int surfaceid, int framerate) int CicoSCWindowController::unmapSurface(int surfaceid) { - ICO_DBG("CicoSCWindowController::unmapSurface Enter"); + ICO_TRA("CicoSCWindowController::unmapSurface Enter"); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::unmapSurface Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::unmapSurface Leave(ENOENT)"); return ICO_SYC_ENOENT; } CicoSCWlWinMgrIF::unmapSurface(surfaceid); CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::unmapSurface Leave(EOK)"); + ICO_TRA("CicoSCWindowController::unmapSurface Leave(EOK)"); return ICO_SYC_EOK; } @@ -1045,20 +1072,22 @@ CicoSCWindowController::getDisplayedWindow(int zoneid) int CicoSCWindowController::setAttributes(int surfaceid) { - ICO_DBG("CicoSCWindowController::setAttributes Enter" + ICO_TRA("CicoSCWindowController::setAttributes Enter" "(surfaceid=0x%08X)", surfaceid); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::setAttributes Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::setAttributes Leave(ENOENT)"); return ICO_SYC_ENOENT; } // find zone const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid); if (NULL == zone) { - ICO_WRN("CicoSCWindowController::setAttributes Leave(ENOENT)"); + ICO_WRN("not found zone information"); + ICO_TRA("CicoSCWindowController::setAttributes Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -1082,7 +1111,7 @@ CicoSCWindowController::setAttributes(int surfaceid) CicoSCWlWinMgrIF::setAttributes(surfaceid, attributes); CicoSCWayland::getInstance()->flushDisplay(); - ICO_DBG("CicoSCWindowController::setAttributes Leave(EOK)"); + ICO_TRA("CicoSCWindowController::setAttributes Leave(EOK)"); return ICO_SYC_EOK; } @@ -1108,14 +1137,15 @@ CicoSCWindowController::createdCB(void *data, const char *appid, int32_t layertype) { - ICO_DBG("CicoSCWindowController::createdCB Enter" + ICO_TRA("CicoSCWindowController::createdCB Enter" "(surfaceid=0x%08X winname=%s pid=%d appid=%s layer=%x)", surfaceid, winname, pid, appid, layertype); if (layertype == ICO_WINDOW_MGR_LAYERTYPE_INPUTPANEL) { // So far, SystemController ignores this event // because it does not support InputPanel(Software Keyboard). - ICO_DBG("CicoSCWindowController::createdCB Leave(Input Panel)"); + ICO_WRN("Input Panel layer create window information skip."); + ICO_TRA("CicoSCWindowController::createdCB Leave(Input Panel)"); return; } @@ -1130,9 +1160,9 @@ CicoSCWindowController::createdCB(void *data, CicoSCLifeCycleController* appctrl; appctrl = CicoSCLifeCycleController::getInstance(); - const CicoSCAilItems *ailItem = appctrl->findAIL(appid); + const CicoAilItems *ailItem = appctrl->findAIL(appid); if (NULL == ailItem) { - const CicoSCAulItems* aulitem = appctrl->findAUL(pid); + const CicoAulItems* aulitem = appctrl->findAUL(pid); if (NULL != aulitem) { window->appid = aulitem->m_appid; ICO_DBG("appid=%s", window->appid.c_str()); @@ -1160,8 +1190,9 @@ CicoSCWindowController::createdCB(void *data, } } else{ + delete window; ICO_WRN("ail item not found."); - ICO_WRN("CicoSCWindowController::createdCB Leave(ENOENT)"); + ICO_TRA("CicoSCWindowController::createdCB Leave(ENOENT)"); return; } @@ -1208,7 +1239,7 @@ CicoSCWindowController::createdCB(void *data, opt->soundres = true; opt->soundname = window->appid; opt->soundid = 0; - CicoSCSystemConfig *sysconf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *sysconf = CicoSystemConfig::getInstance(); const CicoSCDefaultConf *defconf = sysconf->getDefaultConf(); if (NULL != defconf) { const CicoSCSoundZoneConf *zoneconf = @@ -1226,7 +1257,7 @@ CicoSCWindowController::createdCB(void *data, } #endif - ICO_DBG("CicoSCWindowController::createdCB Leave"); + ICO_TRA("CicoSCWindowController::createdCB Leave"); } //-------------------------------------------------------------------------- @@ -1245,12 +1276,13 @@ CicoSCWindowController::nameCB(void *data, uint32_t surfaceid, const char *winname) { - ICO_DBG("CicoSCWindowController::nameCB Enter" + ICO_TRA("CicoSCWindowController::nameCB Enter" "(surfaceid=0x%08X winname=%s)", surfaceid, winname); CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_DBG("CicoSCWindowController::nameCB Leave"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::nameCB Leave"); return; } @@ -1267,7 +1299,7 @@ CicoSCWindowController::nameCB(void *data, message->addArgObject("winname", window->name); CicoSCServer::getInstance()->sendMessageToHomeScreen(message); - ICO_DBG("CicoSCWindowController::nameCB Leave"); + ICO_TRA("CicoSCWindowController::nameCB Leave"); } //-------------------------------------------------------------------------- @@ -1284,12 +1316,13 @@ CicoSCWindowController::destroyedCB(void *data, struct ico_window_mgr *ico_window_mgr, uint32_t surfaceid) { - ICO_DBG("CicoSCWindowController::destroyedCB Enter" + ICO_TRA("CicoSCWindowController::destroyedCB Enter" "(surfaceid=0x%08X)", surfaceid); CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_DBG("CicoSCWindowController::destroyedCB Leave"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::destroyedCB Leave"); return; } @@ -1326,7 +1359,7 @@ CicoSCWindowController::destroyedCB(void *data, opt->soundres = true; opt->soundname = window->appid; opt->soundid = 0; - CicoSCSystemConfig *sysconf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *sysconf = CicoSystemConfig::getInstance(); const CicoSCDefaultConf *defconf = sysconf->getDefaultConf(); if (NULL != defconf) { const CicoSCSoundZoneConf *zoneconf = @@ -1343,7 +1376,7 @@ CicoSCWindowController::destroyedCB(void *data, m_windowList.erase(window->surfaceid); delete(window); - ICO_DBG("CicoSCWindowController::destroyedCB Leave"); + ICO_TRA("CicoSCWindowController::destroyedCB Leave"); } //-------------------------------------------------------------------------- @@ -1369,13 +1402,14 @@ CicoSCWindowController::visibleCB(void *data, int32_t raise, int32_t hint) { - ICO_DBG("CicoSCWindowController::visibleCB Enter" + ICO_TRA("CicoSCWindowController::visibleCB Enter" "(surfaceid=0x%08X visible=%d raise=%d hint=%d)", surfaceid, visible, raise, hint); CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_DBG("CicoSCWindowController::visibleCB Leave"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::visibleCB Leave"); return; } @@ -1391,7 +1425,7 @@ CicoSCWindowController::visibleCB(void *data, } if ((window->visible == newVisible) && (window->raise == newRaise) ){ - ICO_DBG("CicoSCWindowController::visibleCB Leave"); + ICO_TRA("CicoSCWindowController::visibleCB Leave"); return; } @@ -1423,7 +1457,7 @@ CicoSCWindowController::visibleCB(void *data, message->addArgObject("active", window->active ? 1 : 0); CicoSCServer::getInstance()->sendMessageToHomeScreen(message); - ICO_DBG("CicoSCWindowController::visibleCB Leave"); + ICO_TRA("CicoSCWindowController::visibleCB Leave"); } //-------------------------------------------------------------------------- @@ -1457,7 +1491,7 @@ CicoSCWindowController::configureCB(void *data, int32_t height, int32_t hint) { - ICO_DBG("CicoSCWindowController::configureCB Enter" + ICO_TRA("CicoSCWindowController::configureCB Enter" "(surfaceid=0x%08X node=%d layer=%x.%x x=%d y=%d " "width=%d height=%d hint=%d)", surfaceid, node, layertype, layer, x, y, width, height, hint); @@ -1465,12 +1499,13 @@ CicoSCWindowController::configureCB(void *data, if (layertype == ICO_WINDOW_MGR_LAYERTYPE_INPUTPANEL) { // So far, SystemController ignores this event // because it does not support InputPanel(Software Keyboard). - ICO_DBG("CicoSCWindowController::configureCB Leave(Input Panel)"); + ICO_TRA("CicoSCWindowController::configureCB Leave(Input Panel)"); return; } CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_DBG("CicoSCWindowController::visibleCB Leave" + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::visibleCB Leave" "(update window visible failed)"); return; } @@ -1481,12 +1516,6 @@ CicoSCWindowController::configureCB(void *data, window->width = width; window->height = height; window->layertype = layertype; -#if 0 - if (window->layerid != layer) { - window->layerid = layer; - layer = findLayer(window->displayid, layer); - } -#endif } // send message @@ -1514,7 +1543,7 @@ CicoSCWindowController::configureCB(void *data, message->addArgObject("active", window->active ? 1 : 0); CicoSCServer::getInstance()->sendMessageToHomeScreen(message); - ICO_DBG("CicoSCWindowController::configureCB Leave"); + ICO_TRA("CicoSCWindowController::configureCB Leave"); } //-------------------------------------------------------------------------- @@ -1534,22 +1563,23 @@ CicoSCWindowController::activeCB(void *data, uint32_t surfaceid, int32_t active) { - ICO_DBG("CicoSCWindowController::activeCB Enter" + ICO_TRA("CicoSCWindowController::activeCB Enter" "(surfaceid=0x%08X active=%d)", surfaceid, active); CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_DBG("CicoSCWindowController::activeCB Leave(not found window)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::activeCB Leave(not found window)"); return; } if (0 == active) { - ICO_DBG("CicoSCWindowController::activeCB Leave(not active)"); + ICO_TRA("CicoSCWindowController::activeCB Leave(not active)"); return; } if (0 != window->active) { - ICO_DBG("CicoSCWindowController::activeCB Leave(already active)"); + ICO_TRA("CicoSCWindowController::activeCB Leave(already active)"); return; } @@ -1562,7 +1592,7 @@ CicoSCWindowController::activeCB(void *data, message->addArgObject("winname", window->name); CicoSCServer::getInstance()->sendMessageToHomeScreen(message); - ICO_DBG("CicoSCWindowController::activeCB Leave"); + ICO_TRA("CicoSCWindowController::activeCB Leave"); } //-------------------------------------------------------------------------- @@ -1582,7 +1612,7 @@ CicoSCWindowController::layerVisibleCB(void *data, uint32_t layer, int32_t visible) { - ICO_DBG("CicoSCWindowController::layerVisibleCB Enter" + ICO_TRA("CicoSCWindowController::layerVisibleCB Enter" "layer=%d visible=%d)", layer, visible); // send message @@ -1593,7 +1623,7 @@ CicoSCWindowController::layerVisibleCB(void *data, message->addArgObject("visible", visible); CicoSCServer::getInstance()->sendMessageToHomeScreen(message); - ICO_DBG("CicoSCWindowController::layerVisibleCB Leave"); + ICO_TRA("CicoSCWindowController::layerVisibleCB Leave"); } //-------------------------------------------------------------------------- @@ -1612,7 +1642,7 @@ CicoSCWindowController::appSurfacesCB(void *data, const char *appid, struct wl_array *surfaces) { - ICO_DBG("CicoSCWindowController::appSurfacesCB Enter(appid=%s)", appid); + ICO_TRA("CicoSCWindowController::appSurfacesCB Enter(appid=%s)", appid); //struct wl_array { // size_t size; @@ -1626,7 +1656,7 @@ CicoSCWindowController::appSurfacesCB(void *data, ICO_DBG("appSurfacesCB: surface=%d", (int)*p); } - ICO_DBG("CicoSCWindowController::appSurfacesCB Leave"); + ICO_TRA("CicoSCWindowController::appSurfacesCB Leave"); } //-------------------------------------------------------------------------- @@ -1659,7 +1689,7 @@ CicoSCWindowController::mapSurfaceCB(void *data, { int command; - ICO_DBG("CicoSCWindowController::mapSurfaceCB Enter(ev=%d surf=%x " + ICO_TRA("CicoSCWindowController::mapSurfaceCB Enter(ev=%d surf=%x " "type=%d target=%d w/h=%d/%d stride=%d form=%x)", event, surfaceid, type, target, width, height, stride, format); @@ -1680,7 +1710,7 @@ CicoSCWindowController::mapSurfaceCB(void *data, command = MSG_CMD_UNMAP_THUMB; break; default: - ICO_DBG("CicoSCWindowController::mapSurfaceCB Leave(Unknown event(%d))", event); + ICO_TRA("CicoSCWindowController::mapSurfaceCB Leave(Unknown event(%d))", event); return; } @@ -1696,7 +1726,7 @@ CicoSCWindowController::mapSurfaceCB(void *data, message->addArgObject("format", format); CicoSCServer::getInstance()->sendMessageToHomeScreen(message); - ICO_DBG("CicoSCWindowController::mapSurfaceCB Leave"); + ICO_TRA("CicoSCWindowController::mapSurfaceCB Leave"); } //-------------------------------------------------------------------------- @@ -1727,7 +1757,7 @@ CicoSCWindowController::outputGeometryCB(void *data, const char *model, int32_t transform) { - ICO_DBG("CicoSCWlWinMgrIF::outputGeometryCB Enter" + ICO_TRA("CicoSCWindowController::outputGeometryCB Enter" "(x=%d y=%d physical_width=%d physical_height=%d " "subpixel=%d make=%s model=%s transform=%d)", x, y, physical_width, physical_height, @@ -1735,12 +1765,14 @@ CicoSCWindowController::outputGeometryCB(void *data, ++m_physicalDisplayTotal; if (0 == m_displayList.size()) { - ICO_DBG("CicoSCWlWinMgrIF::outputGeometryCB Leave(display is zero)"); + ICO_TRA("CicoSCWindowController::outputGeometryCB Leave" + "(display is zero)"); return; } if (m_displayList.size() < m_physicalDisplayTotal) { - ICO_WRN("CicoSCWlWinMgrIF::outputGeometryCB Leave(display total unmatch)"); + ICO_TRA("CicoSCWindowController::outputGeometryCB Leave" + "(display total unmatch)"); return; } @@ -1766,7 +1798,7 @@ CicoSCWindowController::outputGeometryCB(void *data, } display->dump(); - ICO_DBG("CicoSCWlWinMgrIF::outputGeometryCB Leave"); + ICO_TRA("CicoSCWindowController::outputGeometryCB Leave"); } //-------------------------------------------------------------------------- @@ -1789,12 +1821,12 @@ CicoSCWindowController::outputModeCB(void *data, int32_t height, int32_t refresh) { - ICO_DBG("CicoSCWlWinMgrIF::outputModeCB Enter" + ICO_TRA("CicoSCWindowController::outputModeCB Enter" "(flags=%d width=%d height=%d refresh=%d)", flags, width, height, refresh); if (0 == m_displayList.size()) { - ICO_DBG("CicoSCWlWinMgrIF::outputModeCB Leave(display is zero"); + ICO_TRA("CicoSCWindowController::outputModeCB Leave(display is zero)"); return; } @@ -1811,7 +1843,7 @@ CicoSCWindowController::outputModeCB(void *data, display->dump(); } - ICO_DBG("CicoSCWlWinMgrIF::outputModeCB Leave"); + ICO_TRA("CicoSCWindowController::outputModeCB Leave"); } //========================================================================== @@ -1895,7 +1927,7 @@ CicoSCWindowController::findDisplayZone(int zoneid) void CicoSCWindowController::handleCommand(const CicoSCCommand * cmd) { -// ICO_DBG("CicoSCWindowController::handleCommand Enter(%d)", cmd->cmdid); +// ICO_TRA("CicoSCWindowController::handleCommand Enter(%d)", cmd->cmdid); CicoSCCmdWinCtrlOpt *opt = static_cast(cmd->opt); @@ -1912,6 +1944,7 @@ CicoSCWindowController::handleCommand(const CicoSCCommand * cmd) /* show command (normal) */ (void)notifyResourceManager(opt->surfaceid, NULL, + opt->layerid, opt->animation.c_str(), opt->animationTime); } @@ -1928,19 +1961,20 @@ CicoSCWindowController::handleCommand(const CicoSCCommand * cmd) break; } if (true == opt->zone.empty()) { - (void)setGeometry(opt->surfaceid, opt->nodeid, opt->x, opt->y, - opt->width, opt->height, + (void)setGeometry(opt->surfaceid, opt->nodeid, opt->layerid, + opt->x, opt->y, opt->width, opt->height, opt->animation.c_str(), opt->animationTime, opt->animation.c_str(), opt->animationTime); } else if (opt->zone == window->zone) { - (void)setGeometry(opt->surfaceid, opt->zone.c_str(), + (void)setGeometry(opt->surfaceid, opt->zone.c_str(), opt->layerid, opt->animation.c_str(), opt->animationTime, opt->animation.c_str(), opt->animationTime); } else { (void)notifyResourceManager(opt->surfaceid, opt->zone.c_str(), + opt->layerid, opt->animation.c_str(), opt->animationTime); } @@ -1975,23 +2009,26 @@ CicoSCWindowController::handleCommand(const CicoSCCommand * cmd) break; } -// ICO_DBG("CicoSCWindowController::handleCommand Leave"); +// ICO_TRA("CicoSCWindowController::handleCommand Leave"); } int CicoSCWindowController::notifyResourceManager(int surfaceid, const char *zone, + int layerid, const char *animation, int animationTime) { - ICO_DBG("CicoSCWindowController::notifyResourceManager Enter" - "(surfaceid=0x%08X zone=%s animation=%s animationTime=%d)", - surfaceid, zone, animation, animationTime); + ICO_TRA("CicoSCWindowController::notifyResourceManager Enter" + "(surfaceid=0x%08X zone=%s layerid=%d " + "animation=%s animationTime=%d)", + surfaceid, zone, layerid, animation, animationTime); // find window information in window list CicoSCWindow *window = findWindow(surfaceid); if (NULL == window) { - ICO_WRN("CicoSCWindowController::notifyResourceManager Leave(ENOENT)"); + ICO_WRN("not found window information"); + ICO_TRA("CicoSCWindowController::notifyResourceManager Leave(ENOENT)"); return ICO_SYC_ENOENT; } @@ -2005,6 +2042,7 @@ CicoSCWindowController::notifyResourceManager(int surfaceid, opt->dispres = true; opt->winname = window->name; + opt->layerid = layerid; opt->surfaceid = window->surfaceid; opt->animation = animation ? animation : ""; opt->animationTime = animationTime; @@ -2015,7 +2053,8 @@ CicoSCWindowController::notifyResourceManager(int surfaceid, opt->dispzone = zone->fullname; } else { - ICO_WRN("CicoSCWindowController::notifyResourceManager Leave(ENOENT)"); + ICO_WRN("not found zone information"); + ICO_TRA("CicoSCWindowController::notifyResourceManager Leave(ENOENT)"); return ICO_SYC_ENOENT; } } @@ -2026,7 +2065,7 @@ CicoSCWindowController::notifyResourceManager(int surfaceid, opt->soundres = true; opt->soundname = window->appid; opt->soundid = 0; - CicoSCSystemConfig *sysconf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *sysconf = CicoSystemConfig::getInstance(); const CicoSCDefaultConf *defconf = sysconf->getDefaultConf(); if (NULL != defconf) { const CicoSCSoundZoneConf *zoneconf = @@ -2039,7 +2078,7 @@ CicoSCWindowController::notifyResourceManager(int surfaceid, m_resMgr->handleCommand((const CicoSCCommand&)cmd, true); - ICO_DBG("CicoSCWindowController::notifyResourceManager Leave(EOK)"); + ICO_TRA("CicoSCWindowController::notifyResourceManager Leave(EOK)"); return ICO_SYC_EOK; } // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCWindowController.h b/lib/system-controller/CicoSCWindowController.h index 2ee2321..b3f9d87 100644 --- a/lib/system-controller/CicoSCWindowController.h +++ b/lib/system-controller/CicoSCWindowController.h @@ -78,6 +78,7 @@ public: int setGeometry(int surfaceid, int nodeid, + int layerid, int x, int y, int w, @@ -89,6 +90,7 @@ public: int setGeometry(int surfaceid, const char *zone, + int layerid, const char *resizeAnimation, int resizeAnimationTime, const char *moveAnimation, @@ -215,6 +217,7 @@ private: int notifyResourceManager(int surfaceid, const char *zone, + int layerid, const char *animation, int animationTime); diff --git a/lib/system-controller/CicoSCWlInputMgrIF.cpp b/lib/system-controller/CicoSCWlInputMgrIF.cpp index e133269..72ed678 100644 --- a/lib/system-controller/CicoSCWlInputMgrIF.cpp +++ b/lib/system-controller/CicoSCWlInputMgrIF.cpp @@ -68,33 +68,35 @@ CicoSCWlInputMgrIF::initInterface(void *data, const char *interface, uint32_t version) { - ICO_DBG("CicoSCWlInputMgrIF::initInterface : Enter(interface=%s)", + ICO_TRA("CicoSCWlInputMgrIF::initInterface : Enter(interface=%s)", interface); if (0 == strcmp(interface, ICO_WL_INPUT_MGR_CTRL_IF)) { // get interface instance + ICO_DBG("called: wl_registry_bind"); void *wlProxy = wl_registry_bind(registry, name, &ico_input_mgr_control_interface, 1); if (NULL == wlProxy) { - ICO_WRN("initInterface : interface(%s) wl_registry_bind failed.", - interface); - ICO_WRN("initInterface : Leave(binding failed)"); + ICO_WRN("interface(%s) wl_registry_bind failed.", interface); + ICO_TRA("CicoSCWlInputMgrIF::initInterface Leave", + "(binding failed)"); return; } m_inputmgr = (struct ico_input_mgr_control*)wlProxy; } else if (0 == strcmp(interface, ICO_WL_EXINPUT_IF)) { // get interface instance + ICO_DBG("called: wl_registry_bind"); void *wlProxy = wl_registry_bind(registry, name, &ico_exinput_interface, 1); if (NULL == wlProxy) { - ICO_WRN("initInterface : interface(%s) wl_registry_bind failed.", - interface); - ICO_WRN("initInterface : Leave(binding failed)"); + ICO_WRN("interface(%s) wl_registry_bind failed.", interface); + ICO_TRA("CicoSCWlInputMgrIF::initInterface Leave", + "(binding failed)"); return; } @@ -105,14 +107,15 @@ CicoSCWlInputMgrIF::initInterface(void *data, } else if (0 == strcmp(interface, ICO_WL_INPUT_MGR_DEV_IF)) { // get interface instance + ICO_DBG("called: wl_registry_bind"); void *wlProxy = wl_registry_bind(registry, name, &ico_input_mgr_device_interface, 1); if (NULL == wlProxy) { - ICO_WRN("initInterface : interface(%s) wl_registry_bind failed.", - interface); - ICO_WRN("initInterface : Leave(binding failed)"); + ICO_WRN("interface(%s) wl_registry_bind failed.", interface); + ICO_TRA("CicoSCWlInputMgrIF::initInterface Leave" + "(binding failed)"); return; } @@ -127,7 +130,7 @@ CicoSCWlInputMgrIF::initInterface(void *data, (NULL != m_exinput)) { m_initialized = true; } - ICO_DBG("CicoSCWlInputMgrIF::initInterface : Leave"); + ICO_TRA("CicoSCWlInputMgrIF::initInterface Leave"); } //-------------------------------------------------------------------------- @@ -402,7 +405,7 @@ CicoSCWlInputMgrIF::wlCapabilitiesCB(void *data, const char *codename, int32_t code) { - ICO_DBG("CicoSCWlInputMgrIF::wlCapabilitiesCB Enter"); +// ICO_TRA("CicoSCWlInputMgrIF::wlCapabilitiesCB Enter"); if (NULL == data) { ICO_WRN("wlCapabilitiesCB: data is null"); @@ -412,7 +415,7 @@ CicoSCWlInputMgrIF::wlCapabilitiesCB(void *data, device, type, swname, input, codename, code); - ICO_DBG("CicoSCWlInputMgrIF::wlCapabilitiesCB Leave"); +// ICO_TRA("CicoSCWlInputMgrIF::wlCapabilitiesCB Leave"); } //-------------------------------------------------------------------------- @@ -435,7 +438,7 @@ CicoSCWlInputMgrIF::wlCodeCB(void *data, const char *codename, int32_t code) { - ICO_DBG("CicoSCWlInputMgrIF::wlCodeCB Enter"); +// ICO_TRA("CicoSCWlInputMgrIF::wlCodeCB Enter"); if (NULL == data) { ICO_WRN("wlCodeCB: data is null"); @@ -445,7 +448,7 @@ CicoSCWlInputMgrIF::wlCodeCB(void *data, device, input, codename, code); - ICO_DBG("CicoSCWlInputMgrIF::wlCodeCB Leave"); +// ICO_TRA("CicoSCWlInputMgrIF::wlCodeCB Leave"); } //-------------------------------------------------------------------------- @@ -470,7 +473,7 @@ CicoSCWlInputMgrIF::wlInputCB(void *data, int32_t code, int32_t state) { - ICO_DBG("CicoSCWlInputMgrIF::wlInputCB Enter"); +// ICO_TRA("CicoSCWlInputMgrIF::wlInputCB Enter"); if (NULL == data) { ICO_WRN("wlInputCB: data is null"); @@ -480,7 +483,7 @@ CicoSCWlInputMgrIF::wlInputCB(void *data, time, device, input, code, state); - ICO_DBG("CicoSCWlInputMgrIF::wlInputCB Leave"); +// ICO_TRA("CicoSCWlInputMgrIF::wlInputCB Leave"); } //-------------------------------------------------------------------------- @@ -497,7 +500,7 @@ CicoSCWlInputMgrIF::wlRegionCB(void *data, struct ico_input_mgr_device *ico_input_mgr_dev, struct wl_array *region) { - ICO_DBG("CicoSCWlInputMgrIF::wlRegionCB Enter"); +// ICO_TRA("CicoSCWlInputMgrIF::wlRegionCB Enter"); if (NULL == data) { ICO_WRN("wlRegionCB: data is null"); @@ -506,6 +509,6 @@ CicoSCWlInputMgrIF::wlRegionCB(void *data, static_cast(data)->regionCB(data, ico_input_mgr_dev, region); - ICO_DBG("CicoSCWlInputMgrIF::wlRegionCB Leave"); +// ICO_TRA("CicoSCWlInputMgrIF::wlRegionCB Leave"); } // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/CicoSCWlWinMgrIF.cpp b/lib/system-controller/CicoSCWlWinMgrIF.cpp index 75ddb25..b69c23f 100644 --- a/lib/system-controller/CicoSCWlWinMgrIF.cpp +++ b/lib/system-controller/CicoSCWlWinMgrIF.cpp @@ -79,19 +79,20 @@ CicoSCWlWinMgrIF::initInterface(void *data, const char *interface, uint32_t version) { - ICO_DBG("CicoSCWlWinMgrIF::initInterface : Enter(interface=%s)", interface); + ICO_TRA("CicoSCWlWinMgrIF::initInterface Enter(interface=%s)", interface); // check interface name if (0 == strcmp(interface, ICO_WL_WIN_MGR_IF)) { // get interface instance + ICO_DBG("called: wl_registry_bind"); void *wlProxy = wl_registry_bind(registry, name, &ico_window_mgr_interface, 1); if (NULL == wlProxy) { - ICO_WRN("initInterface : interface(%s) wl_registry_bind failed.", + ICO_WRN("interface(%s) wl_registry_bind failed.", interface); - ICO_WRN("CicoSCWlWinMgrIF::initInterface : Leave(binding failed)"); + ICO_TRA("CicoSCWlWinMgrIF::initInterface Leave(binding failed)"); return; } @@ -104,21 +105,22 @@ CicoSCWlWinMgrIF::initInterface(void *data, ico_window_mgr_set_user_data(m_winmgr, NULL/*TODO*/); #endif - ICO_DBG("call ico_window_mgr_declare_manager"); + ICO_DBG("called: ico_window_mgr_declare_manager"); ico_window_mgr_declare_manager(m_winmgr, ICO_WINDOW_MGR_DECLARE_MANAGER_MANAGER); } else if (0 == strcmp(interface, ICO_WL_OUTPUT_IF)) { // get interface instance + ICO_DBG("called: wl_registry_bind"); void *wlProxy = wl_registry_bind(registry, name, &wl_output_interface, 1); if (NULL == wlProxy) { - ICO_WRN("initInterface : interface(%s) wl_registry_bind failed.", + ICO_WRN("interface(%s) wl_registry_bind failed.", interface); - ICO_WRN("CicoSCWlWinMgrIF::initInterface : Leave(binding failed)"); + ICO_TRA("CicoSCWlWinMgrIF::initInterface Leave(binding failed)"); return; } @@ -131,7 +133,8 @@ CicoSCWlWinMgrIF::initInterface(void *data, #endif } else { - ICO_WRN("initInterface : Leave(unmatch interface)"); + ICO_WRN("unmatch interface"); + ICO_TRA("CicoSCWlWinMgrIF::initInterface Leave(unmatch interface)"); return; } @@ -139,7 +142,7 @@ CicoSCWlWinMgrIF::initInterface(void *data, m_initialized = true; } - ICO_DBG("CicoSCWlWinMgrIF::initInterface : Leave"); + ICO_TRA("CicoSCWlWinMgrIF::initInterface Leave"); } //-------------------------------------------------------------------------- @@ -382,7 +385,7 @@ CicoSCWlWinMgrIF::createdCB(void *data, const char *appid, int32_t layertype) { - ICO_DBG("CicoSCWlWinMgrIF::createdCB called."); + ICO_WRN("CicoSCWlWinMgrIF::createdCB called."); } //-------------------------------------------------------------------------- @@ -652,7 +655,7 @@ CicoSCWlWinMgrIF::wlCreatedCB(void *data, const char *appid, int32_t layertype) { -// ICO_DBG("CicoSCWlWinMgrIF::wlCreatedCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlCreatedCB Enter"); if (NULL == data) { ICO_WRN("wlCreatedCB : data is null"); return; @@ -660,7 +663,7 @@ CicoSCWlWinMgrIF::wlCreatedCB(void *data, static_cast(data)->createdCB(data, ico_window_mgr, surfaceid, winname, pid, appid, layertype); -// ICO_DBG("CicoSCWlWinMgrIF::wlCreatedCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlCreatedCB Leave"); } //-------------------------------------------------------------------------- @@ -679,7 +682,7 @@ CicoSCWlWinMgrIF::wlNameCB(void *data, uint32_t surfaceid, const char *winname) { -// ICO_DBG("CicoSCWlWinMgrIF::wlNameCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlNameCB Enter"); if (NULL == data) { ICO_WRN("wlNameCB: data is null"); @@ -687,7 +690,7 @@ CicoSCWlWinMgrIF::wlNameCB(void *data, } static_cast(data)->nameCB(data, ico_window_mgr, surfaceid, winname); -// ICO_DBG("CicoSCWlWinMgrIF::wlNameCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlNameCB Leave"); } //-------------------------------------------------------------------------- @@ -704,7 +707,7 @@ CicoSCWlWinMgrIF::wlDestroyedCB(void *data, struct ico_window_mgr *ico_window_mgr, uint32_t surfaceid) { -// ICO_DBG("CicoSCWlWinMgrIF::wlDestroyedCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlDestroyedCB Enter"); if (NULL == data) { ICO_WRN("wlDestroyedCB: data is null"); @@ -712,7 +715,7 @@ CicoSCWlWinMgrIF::wlDestroyedCB(void *data, } static_cast(data)->destroyedCB(data, ico_window_mgr, surfaceid); -// ICO_DBG("CicoSCWlWinMgrIF::wlDestroyedCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlDestroyedCB Leave"); } //-------------------------------------------------------------------------- @@ -738,7 +741,7 @@ CicoSCWlWinMgrIF::wlVisibleCB(void *data, int32_t raise, int32_t hint) { -// ICO_DBG("CicoSCWlWinMgrIF::wlVisibleCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlVisibleCB Enter"); if (NULL == data) { ICO_WRN("wlVisibleCB: data is null"); @@ -747,7 +750,7 @@ CicoSCWlWinMgrIF::wlVisibleCB(void *data, static_cast(data)->visibleCB(data, ico_window_mgr, surfaceid, visible, raise, hint); -// ICO_DBG("CicoSCWlWinMgrIF::wlVisibleCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlVisibleCB Leave"); } //-------------------------------------------------------------------------- @@ -781,7 +784,7 @@ CicoSCWlWinMgrIF::wlConfigureCB(void *data, int32_t height, int32_t hint) { -// ICO_DBG("CicoSCWlWinMgrIF::wlConfigureCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlConfigureCB Enter"); if (NULL == data) { ICO_WRN("wlConfigureCB: data is null"); @@ -791,7 +794,7 @@ CicoSCWlWinMgrIF::wlConfigureCB(void *data, surfaceid, node, layertype, layer, x, y, width, height, hint); -// ICO_DBG("CicoSCWlWinMgrIF::wlConfigureCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlConfigureCB Leave"); } //-------------------------------------------------------------------------- /** @@ -810,7 +813,7 @@ CicoSCWlWinMgrIF::wlActiveCB(void *data, uint32_t surfaceid, int32_t active) { -// ICO_DBG("CicoSCWlWinMgrIF::wlActiveCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlActiveCB Enter"); if (NULL == data) { ICO_WRN("wlActiveCB: data is null"); @@ -818,7 +821,7 @@ CicoSCWlWinMgrIF::wlActiveCB(void *data, } static_cast(data)->activeCB(data, ico_window_mgr, surfaceid, active); -// ICO_DBG("CicoSCWlWinMgrIF::wlActiveCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlActiveCB Leave"); } //-------------------------------------------------------------------------- @@ -838,7 +841,7 @@ CicoSCWlWinMgrIF::wlLayerVisibleCB(void *data, uint32_t layer, int32_t visible) { -// ICO_DBG("CicoSCWlWinMgrIF::wlLayerVisibleCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlLayerVisibleCB Enter"); if (NULL == data) { ICO_WRN("wlLayerVisibleCB: data is null"); @@ -846,7 +849,7 @@ CicoSCWlWinMgrIF::wlLayerVisibleCB(void *data, } static_cast(data)->layerVisibleCB(data, ico_window_mgr, layer, visible); -// ICO_DBG("CicoSCWlWinMgrIF::wlLayerVisibleCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlLayerVisibleCB Leave"); } //-------------------------------------------------------------------------- @@ -867,7 +870,7 @@ CicoSCWlWinMgrIF::wlAppSurfacesCB(void *data, int32_t pid, struct wl_array *surfaces) { -// ICO_DBG("CicoSCWlWinMgrIF::wlAppSurfacesCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlAppSurfacesCB Enter"); if (NULL == data) { ICO_WRN("wlAppSurfacesCB: data is null"); @@ -875,7 +878,7 @@ CicoSCWlWinMgrIF::wlAppSurfacesCB(void *data, } static_cast(data)->appSurfacesCB(data, ico_window_mgr, appid, pid, surfaces); -// ICO_DBG("CicoSCWlWinMgrIF::wlAppSurfacesCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlAppSurfacesCB Leave"); } //-------------------------------------------------------------------------- @@ -906,7 +909,7 @@ CicoSCWlWinMgrIF::wlMapSurfaceCB(void *data, int32_t stride, uint32_t format) { -// ICO_DBG("CicoSCWlWinMgrIF::wlMapSurfaceCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlMapSurfaceCB Enter"); if (NULL == data) { ICO_WRN("wlMapSurfaceCB: data is null"); @@ -917,7 +920,7 @@ CicoSCWlWinMgrIF::wlMapSurfaceCB(void *data, type, target, width, height, stride, format); -// ICO_DBG("CicoSCWlWinMgrIF::wlMapSurfaceCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlMapSurfaceCB Leave"); } //-------------------------------------------------------------------------- @@ -948,7 +951,7 @@ CicoSCWlWinMgrIF::wlOutputGeometryCB(void *data, const char *model, int32_t transform) { -// ICO_DBG("CicoSCWlWinMgrIF::wlOutputGeometryCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlOutputGeometryCB Enter"); if (NULL == data) { ICO_WRN("wlOutputGeometryCB: data is null"); @@ -962,7 +965,7 @@ CicoSCWlWinMgrIF::wlOutputGeometryCB(void *data, make, model, transform); -// ICO_DBG("CicoSCWlWinMgrIF::wlOutputGeometryCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlOutputGeometryCB Leave"); } //-------------------------------------------------------------------------- @@ -985,7 +988,7 @@ CicoSCWlWinMgrIF::wlOutputModeCB(void *data, int32_t height, int32_t refresh) { -// ICO_DBG("CicoSCWlWinMgrIF::wlOutputModeCB Enter"); +// ICO_TRA("CicoSCWlWinMgrIF::wlOutputModeCB Enter"); if (NULL == data) { ICO_WRN("wlOutputGeometryCB: data is null"); @@ -993,6 +996,6 @@ CicoSCWlWinMgrIF::wlOutputModeCB(void *data, } static_cast(data)->outputModeCB(data, wl_output, flags, width, height, refresh); -// ICO_DBG("CicoSCWlWinMgrIF::wlOutputModeCB Leave"); +// ICO_TRA("CicoSCWlWinMgrIF::wlOutputModeCB Leave"); } // vim:set expandtab ts=4 sw=4: diff --git a/lib/system-controller/Cico_aul_listen_app.cpp b/lib/system-controller/Cico_aul_listen_app.cpp deleted file mode 100644 index 6e14ed5..0000000 --- a/lib/system-controller/Cico_aul_listen_app.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -/** - * @brief Homescreen application aul handler multi support - * - * @date Sep-23-2013 - */ -#include -#include -#include -#include - -using namespace std; - - -//bool aul_listen_app_launch_signal_del(int (*func) (int, void *)); -//bool aul_listen_app_dead_signal_del(int (*func) (int, void *)); - -static vector launch_f; -static vector launch_p; -static vector dead_f; -static vector dead_p; - -/** - * @brief aul launch handler - * @param pid - * @param data user data - */ -static int app_launch_handler(int pid, void *data) -{ - vector::iterator itf = launch_f.begin(); - vector::iterator itp = launch_p.begin(); - while(itf != launch_f.end()) { - void* f = *itf; - void* p = *itp; - int (*fnc)(int, void*) = (int (*)(int, void*))f; - fnc(pid, p); - ++itf; - ++itp; - } - return 0; -} - -/** - * @brief aul dead handler - * @param pid - * @param data user data - */ -static int app_dead_handler(int pid, void *data) -{ - vector::iterator itf = dead_f.begin(); - vector::iterator itp = dead_p.begin(); - while(itf != dead_f.end()) { - void* f = *itf; - void* p = *itp; - int (*fnc)(int, void*) = (int (*)(int, void*))f; - fnc(pid, p); - ++itf; - ++itp; - } - return 0; -} - -/** - * @ init. aul callback - */ -void initAulListenXSignal() -{ - aul_listen_app_launch_signal(app_launch_handler, NULL); - aul_listen_app_dead_signal(app_dead_handler, NULL); -} - -/** - * @brief aul_listien_app_launch_signal multi - * @param func callback function - * @param data user data - */ -bool aul_listen_app_launch_signal_add(int (*func) (int, void *), void *data) -{ - launch_f.push_back((void*)func); - launch_p.push_back(data); - return true; -} - -/** - * @brief aul_listien_app_dead_signal multi - * @param func callback function - * @param data user data - */ -bool aul_listen_app_dead_signal_add(int (*func) (int, void *), void *data) -{ - dead_f.push_back((void*)func); - dead_p.push_back(data); - return true; -} diff --git a/lib/system-controller/Makefile.am b/lib/system-controller/Makefile.am index f736a19..dff2a04 100644 --- a/lib/system-controller/Makefile.am +++ b/lib/system-controller/Makefile.am @@ -8,10 +8,7 @@ noinst_LTLIBRARIES =\ libico_system_controller_la_LDFLAGS = -version-info 0:9:0 libico_system_controller_la_SOURCES = \ - CicoSCAilItems.cpp \ - CicoSCAulItems.cpp \ CicoSCLifeCycleController.cpp \ - CicoSCSystemConfig.cpp \ CicoSCWaylandIF.cpp \ CicoSCWayland.cpp \ CicoSCWlWinMgrIF.cpp \ @@ -31,10 +28,11 @@ libico_system_controller_la_SOURCES = \ CicoSCUserManager.cpp \ CicoSCSysResourceController.cpp \ CicoSCSysResourceMonitor.cpp \ + CicoSCAppResourceController.cpp \ CicoSCResourceManager.cpp \ ico_syc_mrp_resource.c \ CicoSCPolicyManager.cpp \ - Cico_aul_listen_app.cpp + CicoSCVInfoManager.cpp libico_system_controller_la_CPPFLAGS = \ $(GCC_CXXFLAGS) \ @@ -56,9 +54,11 @@ libico_system_controller_la_CPPFLAGS = \ $(UWS_CFLAGS) \ $(WESTONPLUGIN_CFLAGS) \ -I../../include \ + -I../common \ -I../misc/state-machine libico_system_controller_la_LIBADD = \ + ../common/.libs/libico-common.a \ @ECORE_LIBS@ \ @EINA_LIBS@ \ @GLIB_LIBS@ \ diff --git a/lib/system-controller/ico_syc_mrp_resource.c b/lib/system-controller/ico_syc_mrp_resource.c index 391c4df..877be5f 100644 --- a/lib/system-controller/ico_syc_mrp_resource.c +++ b/lib/system-controller/ico_syc_mrp_resource.c @@ -108,10 +108,10 @@ int ico_syc_mrp_init(ico_syc_mrp_enforce_sound_t soundcb, void *user_data) mrp_list_init(&mrp_reqs); - ICO_DBG("mrp_mainloop_ecore_get() called."); + ICO_DBG("called: mrp_mainloop_ecore_get()"); mrp_ml = mrp_mainloop_ecore_get(); - ICO_DBG("mrp_res_connecte() called."); + ICO_DBG("called: mrp_res_connecte()"); mrp_ctx = mrp_res_create(mrp_ml, ico_syc_mrp_state_cb, NULL); if (!mrp_ctx) { @@ -119,7 +119,7 @@ int ico_syc_mrp_init(ico_syc_mrp_enforce_sound_t soundcb, void *user_data) return ICO_SYC_EIO; } - ICO_DBG("mrp_domctl_create() called."); + ICO_DBG("called: mrp_domctl_create()"); mrp_dc = mrp_domctl_create("ico-homescreen", mrp_ml, ico_tables, MRP_ARRAY_SIZE(ico_tables), ico_watches, MRP_ARRAY_SIZE(ico_watches), @@ -131,7 +131,7 @@ int ico_syc_mrp_init(ico_syc_mrp_enforce_sound_t soundcb, void *user_data) return ICO_SYC_EIO; } - ICO_DBG("mrp_domctl_connect() called."); + ICO_DBG("called: mrp_domctl_connect()"); if (!mrp_domctl_connect(mrp_dc, MRP_DEFAULT_DOMCTL_ADDRESS, 0)) { ICO_ERR("ico_syc_mrp_init: Leave(mrp_domctl_connect Error)"); return ICO_SYC_EIO; @@ -140,6 +140,21 @@ int ico_syc_mrp_init(ico_syc_mrp_enforce_sound_t soundcb, void *user_data) return ICO_SYC_EOK; } +void ico_syc_mrp_term(void) +{ + if (NULL != mrp_ctx) { + mrp_res_destroy(mrp_ctx); + } + + if (NULL != mrp_dc) { + mrp_domctl_destroy(mrp_dc); + } + + if (NULL != mrp_ml) { + mrp_mainloop_destroy(mrp_ml); + } +} + void ico_syc_mrp_add_request(resource_request_t *req) { @@ -220,7 +235,7 @@ ico_syc_mrp_acquire_sound_resource(resource_request_t *newreq) ICO_DBG("ico_syc_mrp_acquire_sound_resource: " "could not create resource for sound"); - ICO_DBG("mrp_res_create_resource_set called."); + ICO_DBG("called: mrp_res_create_resource_set()"); rs = mrp_res_create_resource_set(mrp_ctx, resource_class, ico_syc_mrp_resource_cb, @@ -232,7 +247,7 @@ ico_syc_mrp_acquire_sound_resource(resource_request_t *newreq) return false; } - ICO_DBG("mrp_res_set_autorelease called."); + ICO_DBG("called: mrp_res_set_autorelease()"); if (!mrp_res_set_autorelease(mrp_ctx, FALSE, rs)) { ICO_ERR("ico_syc_mrp_acquire_sound_resource: " "failed to set auto release mode"); @@ -240,7 +255,7 @@ ico_syc_mrp_acquire_sound_resource(resource_request_t *newreq) return false; } - ICO_DBG("mrp_res_create_resource called."); + ICO_DBG("called: mrp_res_create_resource"); res = mrp_res_create_resource(mrp_ctx, rs, "audio_playback", TRUE, FALSE); if (!res) { @@ -282,7 +297,7 @@ ico_syc_mrp_acquire_sound_resource(resource_request_t *newreq) req->released = 0; } - ICO_DBG("mrp_res_acquire_resource_set called."); + ICO_DBG("called: mrp_res_acquire_resource_set()"); mrp_res_acquire_resource_set(mrp_ctx, req->rset); } @@ -598,6 +613,9 @@ ico_syc_mrp_active_app(const char *appid) values[1].type = MRP_DOMCTL_STRING; values[1].str = appid; + ICO_DBG("called: mrp_domctl_set_data" + "(tables[0].rows[0]={\"%s\",\"%s\"})", + values[0].str, values[1].str); if (!mrp_domctl_set_data(mrp_dc, tables, 1, ico_sys_mrp_export_notify, NULL)) { ICO_DBG("ico_syc_mrp_active_app: " diff --git a/lib/system-controller/ico_syc_mrp_resource_private.h b/lib/system-controller/ico_syc_mrp_resource_private.h index 68eac67..8abcb82 100644 --- a/lib/system-controller/ico_syc_mrp_resource_private.h +++ b/lib/system-controller/ico_syc_mrp_resource_private.h @@ -64,7 +64,7 @@ typedef struct { #define ICO_UXF_MAX_DEVICE_NAME 255 /* request information */ -typedef struct _resource_request { +typedef struct _resource_request { int id; /* request object */ int prio; /* request priority */ unsigned short reqtype; /* Request type */ @@ -78,6 +78,7 @@ typedef struct _resource_request { char *dispzone; /* area of showing application window */ int dispzoneid; /* area of showing application window */ + int layerid; /* layer of showing application window */ char *winname; /* window's surface name */ int surfaceid; /* window id */ char *animation; /* name of animation */ @@ -106,6 +107,7 @@ typedef void (*ico_syc_mrp_enforce_sound_t)(unsigned short state, int ico_syc_mrp_init(ico_syc_mrp_enforce_sound_t soundcb, void *user_data); +void ico_syc_mrp_term(void); bool ico_syc_mrp_acquire_sound_resource(resource_request_t *req); bool ico_syc_mrp_release_sound_resource(resource_request_t *req); diff --git a/packaging/ico-uxf-homescreen.changes b/packaging/ico-uxf-homescreen.changes index 4f2bf9f..d2a9c68 100644 --- a/packaging/ico-uxf-homescreen.changes +++ b/packaging/ico-uxf-homescreen.changes @@ -1,3 +1,10 @@ +* Thu Dec 26 2013 Shibata Makoto accepted/tizen_ivi_stable/20131119.040218@878f49e +- 0.9.10 release +-- bug fix: An action is inaccurate when the menu of HomeScreen is multi-touched +-- bug fix: TIVI-1997 - Touch doesn't work in ico homescreen after some operations +-- bug fix: TIVI-2161 - Close app by long press doesn't work after some operations +-- revise: add manifest file for SMACK label setting + * Wed Nov 06 2013 Shibata Makoto accepted/tizen/20131029.175553@d661402 - 0.9.07 release. -- bugfix: Last information cannot set up / acquire.(Native app) diff --git a/packaging/ico-uxf-homescreen.spec b/packaging/ico-uxf-homescreen.spec index 495a82e..58cf25d 100644 --- a/packaging/ico-uxf-homescreen.spec +++ b/packaging/ico-uxf-homescreen.spec @@ -1,6 +1,6 @@ Name: ico-uxf-homescreen Summary: Sample homescreen and system controller -Version: 0.9.07 +Version: 0.9.10 Release: 1.1 Group: Graphics & UI Framework/Automotive UI License: Apache-2.0 @@ -8,7 +8,7 @@ URL: "" Source0: %{name}-%{version}.tar.bz2 BuildRequires: pkgconfig(wayland-client) >= 1.2 -BuildRequires: ico-uxf-weston-plugin-devel >= 0.9.07 +BuildRequires: ico-uxf-weston-plugin-devel >= 0.9.08 BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(ecore-wayland) @@ -34,8 +34,8 @@ BuildRequires: boost-devel BuildRequires: mesa-devel BuildRequires: ico-uxf-utilities-devel Requires: weston >= 1.2 -Requires: ico-uxf-weston-plugin >= 0.9.07 -Requires: ico-uxf-utilities +Requires: ico-uxf-weston-plugin >= 0.9.08 +Requires: ico-uxf-utilities >= 0.9.06 %description Sample homescreen application and system controller daemon @@ -69,17 +69,6 @@ rm -rf %{buildroot} %make_install -STATUSBARDIR="%{buildroot}/usr/apps/org.tizen.ico.statusbar" -mkdir -p ${STATUSBARDIR}/res/images -mkdir -p ${STATUSBARDIR}/res/edj -mkdir -p ${STATUSBARDIR}/res/config -mkdir -p ${STATUSBARDIR}/bin -mkdir -p %{_bindir} -cp -rf data/apps/org.tizen.ico.statusbar %{buildroot}/usr/apps/ -install -m 0755 src/homescreen/StatusBar ${STATUSBARDIR}/bin/ -install -m 0644 res/org.tizen.ico.homescreen/res/images/time*.png ${STATUSBARDIR}/res/images -install -m 0644 data/share/packages/org.tizen.ico.statusbar.xml %{buildroot}/usr/share/packages -cp res/org.tizen.ico.homescreen/res/apps/org.tizen.ico.statusbar/* ${STATUSBARDIR}/res/config cp tool/ico_clear_screen %{buildroot}%{_bindir} cp tool/ico_change_loginuser %{buildroot}%{_bindir} @@ -102,6 +91,7 @@ rm -f /home/app/layout.txt %{_bindir}/ail_initdb %files +%manifest %{name}.manifest %defattr(-,root,root,-) /usr/apps/org.tizen.ico.homescreen /usr/apps/org.tizen.ico.statusbar @@ -121,6 +111,7 @@ rm -f /home/app/layout.txt /home/app/ico/defaultApps.info %files system-controller-devel +%manifest %{name}.manifest %defattr(-,root,root,-) %{_includedir}/ico-appfw/ico_syc_application.h %{_includedir}/ico-appfw/ico_syc_appresctl.h diff --git a/res/org.tizen.ico.homescreen/res/config/homescreen.conf b/res/org.tizen.ico.homescreen/res/config/homescreen.conf index cfb22dc..2f5cfa7 100644 --- a/res/org.tizen.ico.homescreen/res/config/homescreen.conf +++ b/res/org.tizen.ico.homescreen/res/config/homescreen.conf @@ -1,69 +1,134 @@ -[homescreen] -tileinfo_rowcnt=3 -tileinfo_colcnt=5 -tileinfo_valid=1;0;1;1;0;0;0;1;1;1;1;1;0;1;0 -tileinfo_type=22;0;11;12;0;0;0;21;11;11;11;11;0;12;0 -tileinfo_app0=org.tizen.browser -tileinfo_app3=org.tizen.music-player -tileinfo_app2=org.tizen.gallery -tileinfo_app7=org.tizen.setting -tileinfo_app8=org.tizen.calendar -tileinfo_app9=org.tizen.dialer -tileinfo_app10=org.tizen.calculator -tileinfo_app11=org.tizen.memo -tileinfo_app13=org.tizen.smartsearch -tileinfo_app14=none +#=========================================================================== +# +# HomeScreen application configuration file +# +#=========================================================================== +#--------------------------------------------------------------------------- +# HomeScreen application setting +# +# -- statusbar +# StatusBar application id +# -- onscreen +# OnScreen application id +# +#--------------------------------------------------------------------------- +[homescreen] statusbar=org.tizen.ico.statusbar onscreen=org.tizen.ico.onscreen -bgimage=/opt/share/settings/Wallpapers/Home_default.jpg +#--------------------------------------------------------------------------- +# HomeScreen application log setting +# +# -- filename +# log file name +# -- loglevel +# none : all level log print off +# all : all level log print on +# performance : perfromance log print on +# trace : trace log print on +# debug : debug log print on +# info : info log print on +# warning : warning log print on +# critical : critical print on +# error : error print on +# -- logflush +# on : log output with log flush +# off : log output without log flush +# -- ecorelog +# on : ecore log print enabled +# off : ecore log print disabled +#--------------------------------------------------------------------------- +[log] +filename=HomeScreen +loglevel=all +logflush=on +ecorelog=on -### configuration for sounds +#--------------------------------------------------------------------------- +# HomeScreen operation sound setting +# +# -- commnad +# paly sound commnad +# volume 0...65536 +# -- operation +# operation sound file path +# -- success +# success sound file path +# -- failure +# failure sound file path +#--------------------------------------------------------------------------- [sound] -# command -# volume 0...65536 command=paplay --device=0 --volume=30000 --stream-name=HOMESCREEN_BEEP - -# operation sound file path operation=/usr/apps/org.tizen.ico.homescreen/res/sound/operation.wav - -# success sound file path success=/usr/apps/org.tizen.ico.homescreen/res/sound/success.wav - -# failure sound file path failure=/usr/apps/org.tizen.ico.homescreen/res/sound/failure.wav +#--------------------------------------------------------------------------- +# HomeScreen application history setting +# +# -- timer +# swipe operation timeout value[sec] +# -- manage_off_app +# Application to be excluded from history management +# specify the application ID, separated by semicolons +# -- write_off_app +# Application to be excluded from history record +#--------------------------------------------------------------------------- [app_history] timer=10 manage_off_app=org.tizen.ico.homescreen;org.tizen.ico.statusbar write_off_app=org.tizen.ico.login +#--------------------------------------------------------------------------- +# application's window move to second display setting +# +# -- keyname +# trigger switch keycode +# -- movezone +# zonename on second display +# -- animation +# animation name on move +# -- animatime +# animation time on move[ms] +#--------------------------------------------------------------------------- [switchzone] -# trigger switch keyname keyname=m - -# move zone name movezone=Mid.Left - -# move animation -# animation : animation name -# animatime : animation time [ms] animation=Fade animatime=400 +#--------------------------------------------------------------------------- +# control bar shortcut setting +# +# -- shortcut_app0 +# application id of the 1st shortcut from the left +# -- shortcut_app1 +# application id of the 2nd shortcut from the left +# -- shortcut_app2 +# application id of the 3rd shortcut from the left +# -- shortcut_app3 +# application id of the 4th shortcut from the left +#--------------------------------------------------------------------------- [controlbar] shortcut_app0=t8j6HTRpuz.MediaPlayer shortcut_app1= shortcut_app2= shortcut_app3= +#--------------------------------------------------------------------------- +# standerd swith trigger setting +# +# -- homekeyname +# trigger home switch keyname +# -- backkeyname +# trigger back switch keyname +# -- menukeyname +# trigger menu switch keyname +#--------------------------------------------------------------------------- [standardswitch] -# trigger home switch keyname homekeyname=h - -# trigger back switch keyname backkeyname=b - -# trigger menu switch keyname menukeyname=l + +# vim:set expandtab ts=4 sw=4: diff --git a/res/org.tizen.ico.homescreen/res/apps/org.tizen.ico.onscreen/onscreen.conf b/res/org.tizen.ico.onscreen/res/config/onscreen.conf similarity index 100% rename from res/org.tizen.ico.homescreen/res/apps/org.tizen.ico.onscreen/onscreen.conf rename to res/org.tizen.ico.onscreen/res/config/onscreen.conf diff --git a/res/org.tizen.ico.homescreen/res/apps/org.tizen.ico.statusbar/statusbar.conf b/res/org.tizen.ico.statusbar/res/config/statusbar.conf similarity index 81% rename from res/org.tizen.ico.homescreen/res/apps/org.tizen.ico.statusbar/statusbar.conf rename to res/org.tizen.ico.statusbar/res/config/statusbar.conf index 5a7d6df..79bb42b 100644 --- a/res/org.tizen.ico.homescreen/res/apps/org.tizen.ico.statusbar/statusbar.conf +++ b/res/org.tizen.ico.statusbar/res/config/statusbar.conf @@ -1,8 +1,8 @@ ## statusbar private configration [statusbar] wsport=10001 -##orientaion(1:VERTICAL, 2:HORIZONTAL) -#orientaion=2 +##orientation(1:VERTICAL, 2:HORIZONTAL) +#orientation=2 shortcut_app0=org.tizen.ico.app-samplenavi shortcut_app1=org.tizen.music-player diff --git a/res/org.tizen.ico.homescreen/res/images/time_0.png b/res/org.tizen.ico.statusbar/res/images/time_0.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_0.png rename to res/org.tizen.ico.statusbar/res/images/time_0.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_1.png b/res/org.tizen.ico.statusbar/res/images/time_1.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_1.png rename to res/org.tizen.ico.statusbar/res/images/time_1.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_2.png b/res/org.tizen.ico.statusbar/res/images/time_2.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_2.png rename to res/org.tizen.ico.statusbar/res/images/time_2.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_3.png b/res/org.tizen.ico.statusbar/res/images/time_3.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_3.png rename to res/org.tizen.ico.statusbar/res/images/time_3.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_4.png b/res/org.tizen.ico.statusbar/res/images/time_4.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_4.png rename to res/org.tizen.ico.statusbar/res/images/time_4.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_5.png b/res/org.tizen.ico.statusbar/res/images/time_5.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_5.png rename to res/org.tizen.ico.statusbar/res/images/time_5.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_6.png b/res/org.tizen.ico.statusbar/res/images/time_6.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_6.png rename to res/org.tizen.ico.statusbar/res/images/time_6.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_7.png b/res/org.tizen.ico.statusbar/res/images/time_7.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_7.png rename to res/org.tizen.ico.statusbar/res/images/time_7.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_8.png b/res/org.tizen.ico.statusbar/res/images/time_8.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_8.png rename to res/org.tizen.ico.statusbar/res/images/time_8.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_9.png b/res/org.tizen.ico.statusbar/res/images/time_9.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_9.png rename to res/org.tizen.ico.statusbar/res/images/time_9.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_am.png b/res/org.tizen.ico.statusbar/res/images/time_am.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_am.png rename to res/org.tizen.ico.statusbar/res/images/time_am.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_pm.png b/res/org.tizen.ico.statusbar/res/images/time_pm.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_pm.png rename to res/org.tizen.ico.statusbar/res/images/time_pm.png diff --git a/res/org.tizen.ico.homescreen/res/images/time_ten.png b/res/org.tizen.ico.statusbar/res/images/time_ten.png similarity index 100% rename from res/org.tizen.ico.homescreen/res/images/time_ten.png rename to res/org.tizen.ico.statusbar/res/images/time_ten.png diff --git a/res/org.tizen.ico.system-controller/res/config/policy.json b/res/org.tizen.ico.system-controller/res/config/policy.json index 0ff99c5..bb9a115 100644 --- a/res/org.tizen.ico.system-controller/res/config/policy.json +++ b/res/org.tizen.ico.system-controller/res/config/policy.json @@ -1,19 +1,19 @@ "stateMachine":{ "name":"Policy", "value":1, - "initial":[1001,2001,3001,3101,4001,5001,9001,10999,11999,12003,13009,14999,15999,16999,17999,20999,22999,30001,30101], + "initial":[1001,2001,3001,3101,4001,5001,9001,10999,11999,12003,12103,12203,13009,14999,15999,16999,17999,20999,22999,30001,30101], "state":{ "name":"Driving", "value":1000, "state":{ "name":"Stopping", "value":1001, - "event":{"name":"EV1000","value":1000, "transition":1002, "guardCondition":[{"operator":">","value":0 }]} + "event":{"name":"EV1000", "value":1000, "transition":1002, "guardCondition":[{"operator":">", "value":0}]} }, "state":{ "name":"Running", "value":1002, - "event":{"name":"EV1000","value":1000, "transition":1001, "guardCondition":[{"operator":"=","value":0 }]} + "event":{"name":"EV1000", "value":1000, "transition":1001, "guardCondition":[{"operator":"=", "value":0}]} } }, @@ -23,22 +23,22 @@ "state":{ "name":"Parking", "value":2001, - "event":{"name":"EV2000","value":2000, "transition":2002, "guardCondition":[{"operator":"=","value":255}]}, - "event":{"name":"EV2000","value":2000, "transition":2003, "guardCondition":[{ "operator":"!=","value":255}, - {"join":"and","operator":"!=","value":128}]} + "event":{"name":"EV2000", "value":2000, "transition":2002, "guardCondition":[{"operator":"=", "value":255}]}, + "event":{"name":"EV2000", "value":2000, "transition":2003, "guardCondition":[{ "operator":"!=", "value":255}, + {"join":"and", "operator":"!=", "value":128}]} }, "state":{ "name":"Reverse", "value":2002, - "event":{"name":"EV2000","value":2000, "transition":2001, "guardCondition":[{"operator":"=","value":128}]}, - "event":{"name":"EV2000","value":2000, "transition":2003, "guardCondition":[{ "operator":"!=","value":255}, - {"join":"and","operator":"!=","value":128}]} + "event":{"name":"EV2000", "value":2000, "transition":2001, "guardCondition":[{"operator":"=", "value":128}]}, + "event":{"name":"EV2000", "value":2000, "transition":2003, "guardCondition":[{ "operator":"!=", "value":255}, + {"join":"and", "operator":"!=", "value":128}]} }, "state":{ "name":"OtherShiftPos", "value":2003, - "event":{"name":"EV2000","value":2000, "transition":2001, "guardCondition":[{"operator":"=","value":255}]}, - "event":{"name":"EV2000","value":2000, "transition":2002, "guardCondition":[{"operator":"=","value":128}]} + "event":{"name":"EV2000", "value":2000, "transition":2001, "guardCondition":[{"operator":"=", "value":255}]}, + "event":{"name":"EV2000", "value":2000, "transition":2002, "guardCondition":[{"operator":"=", "value":128}]} } }, @@ -48,12 +48,12 @@ "state":{ "name":"TurnLeftOff", "value":3001, - "event":{"name":"EV3001","value":3001, "transition":3002} + "event":{"name":"EV3001", "value":3001, "transition":3002} }, "state":{ "name":"TurnLeftOn", "value":3002, - "event":{"name":"EV3000","value":3000, "transition":3001} + "event":{"name":"EV3000", "value":3000, "transition":3001} } }, @@ -63,12 +63,12 @@ "state":{ "name":"TurnRightOff", "value":3101, - "event":{"name":"EV3101","value":3101, "transition":3102} + "event":{"name":"EV3101", "value":3101, "transition":3102} }, "state":{ "name":"TurnRightOn", "value":3102, - "event":{"name":"EV3100","value":3100, "transition":3101} + "event":{"name":"EV3100", "value":3100, "transition":3101} } }, @@ -78,38 +78,38 @@ "state":{ "name":"CameraOff", "value":4001, - "event":{"name":"EV4000","value":4000, "transition":4002, "guardCondition":[{"operator":"in","value":"Reverse"}]}, - "event":{"name":"EV4000","value":4000, "transition":4003, "guardCondition":[{"operator":"in","value":"TurnLeftOn"}]}, - "event":{"name":"EV4000","value":4000, "transition":4004, "guardCondition":[{"operator":"in","value":"TurnRightOn"}]} + "event":{"name":"EV4000", "value":4000, "transition":4002, "guardCondition":[{"operator":"in", "value":"Reverse"}]}, + "event":{"name":"EV4000", "value":4000, "transition":4003, "guardCondition":[{"operator":"in", "value":"TurnLeftOn"}]}, + "event":{"name":"EV4000", "value":4000, "transition":4004, "guardCondition":[{"operator":"in", "value":"TurnRightOn"}]} }, "state":{ "name":"CameraBack", "value":4002, - "event":{"name":"EV4000","value":4000, "transition":4001, "guardCondition":[{ "operator":"not","value":"Reverse"}, - {"join":"and","operator":"in","value":"TurnLeftOff"}, - {"join":"and","operator":"in","value":"TurnRightOff"}]}, - "event":{"name":"EV4000","value":4000, "transition":4003, "guardCondition":[{ "operator":"not","value":"Reverse"}, - {"join":"and","operator":"in","value":"WinkerLeft"}]}, - "event":{"name":"EV4000","value":4000, "transition":4004, "guardCondition":[{ "operator":"not","value":"Reverse"}, - {"join":"and","operator":"in","value":"WinkerRight"}]} + "event":{"name":"EV4000", "value":4000, "transition":4001, "guardCondition":[{ "operator":"not", "value":"Reverse"}, + {"join":"and", "operator":"in", "value":"TurnLeftOff"}, + {"join":"and", "operator":"in", "value":"TurnRightOff"}]}, + "event":{"name":"EV4000", "value":4000, "transition":4003, "guardCondition":[{ "operator":"not", "value":"Reverse"}, + {"join":"and", "operator":"in", "value":"WinkerLeft"}]}, + "event":{"name":"EV4000", "value":4000, "transition":4004, "guardCondition":[{ "operator":"not", "value":"Reverse"}, + {"join":"and", "operator":"in", "value":"WinkerRight"}]} }, "state":{ "name":"CameraLeft", "value":4003, - "event":{"name":"EV4000","value":4000, "transition":4001, "guardCondition":[{ "operator":"not","value":"Reverse"}, - {"join":"and","operator":"in","value":"TurnLeftOff"}, - {"join":"and","operator":"in","value":"TurnRightOff"}]}, - "event":{"name":"EV4000","value":4000, "transition":4002, "guardCondition":[{"operator":"in","value":"Reverse"}]}, - "event":{"name":"EV4000","value":4000, "transition":4004, "guardCondition":[{ "operator":"not","value":"Reverse"}, - {"join":"and","operator":"in","value":"WinkerRight"}]} + "event":{"name":"EV4000", "value":4000, "transition":4001, "guardCondition":[{ "operator":"not", "value":"Reverse"}, + {"join":"and", "operator":"in", "value":"TurnLeftOff"}, + {"join":"and", "operator":"in", "value":"TurnRightOff"}]}, + "event":{"name":"EV4000", "value":4000, "transition":4002, "guardCondition":[{"operator":"in", "value":"Reverse"}]}, + "event":{"name":"EV4000", "value":4000, "transition":4004, "guardCondition":[{ "operator":"not", "value":"Reverse"}, + {"join":"and", "operator":"in", "value":"WinkerRight"}]} }, "state":{ "name":"CameraRight", "value":4004, - "event":{"name":"EV4000","value":4000, "transition":4001, "guardCondition":[{"operator":"not","value":"WinkerRight"}]}, - "event":{"name":"EV4000","value":4000, "transition":4002, "guardCondition":[{"operator":"in","value":"Reverse"}]}, - "event":{"name":"EV4000","value":4000, "transition":4003, "guardCondition":[{ "operator":"not","value":"Reverse"}, - {"join":"and","operator":"in","value":"WinkerLeft"}]} + "event":{"name":"EV4000", "value":4000, "transition":4001, "guardCondition":[{"operator":"not", "value":"WinkerRight"}]}, + "event":{"name":"EV4000", "value":4000, "transition":4002, "guardCondition":[{"operator":"in", "value":"Reverse"}]}, + "event":{"name":"EV4000", "value":4000, "transition":4003, "guardCondition":[{ "operator":"not", "value":"Reverse"}, + {"join":"and", "operator":"in", "value":"WinkerLeft"}]} } }, @@ -119,114 +119,134 @@ "state":{ "name":"NightModeOff", "value":5001, - "event":{"name":"EV5000","value":5000, "transition":5002, "guardCondition":[{"operator":"=","value":1}]} + "event":{"name":"EV5000", "value":5000, "transition":5002, "guardCondition":[{"operator":"=", "value":1}]} }, "state":{ "name":"NightModeOn", "value":5002, - "event":{"name":"EV5000","value":5000, "transition":5001, "guardCondition":[{"operator":"=","value":0}]} + "event":{"name":"EV5000", "value":5000, "transition":5001, "guardCondition":[{"operator":"=", "value":0}]} } }, "state":{ - "name":"DrivingRegulation", + "name":"DrivingMode", "value":9000, "state":{ - "name":"NotRegulating", + "name":"DrivingModeOff", "value":9001, - "event":{"name":"EV9000","value":9000, "transition":9002, "guardCondition":[{"operator":"in","value":"Running"}]} + "event":{"name":"EV9000", "value":9000, "transition":9002, "guardCondition":[{"operator":"=", "value":1}]} }, "state":{ - "name":"Regulating", + "name":"DrivingModeOn", "value":9002, - "event":{"name":"EV9000","value":9000, "transition":9001, "guardCondition":[{"operator":"in","value":"Stopping"}]} + "event":{"name":"EV9000", "value":9000, "transition":9001, "guardCondition":[{"operator":"=", "value":0}]} } }, "state":{ "name":"Display0Zone", "value":10000, - "state":{ - "name":"Display0Zone1", - "value":10001, - "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]}, - "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]}, - "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]}, - "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{ "operator":">=","value":1}, - {"join":"and","operator":"<=","value":20}]} - }, - "state":{ - "name":"Display0Zone2", - "value":10002, - "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]}, - "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]}, - "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]}, - "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{ "operator":">=","value":1}, - {"join":"and","operator":"<=","value":20}]} - }, - "state":{ - "name":"Display0Zone3", - "value":10003, - "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]}, - "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]}, - "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]}, - "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{ "operator":">=","value":1}, - {"join":"and","operator":"<=","value":20}]} + "state":{ /* App ONLY */ + "name":"Display0ZoneFullA", + "value":10020, + "event":{"name":"EV10000", "value":10000, "transition":10001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV10000", "value":10000, "transition":10011, "guardCondition":[{"operator":"=", "value":11}]}, + "event":{"name":"EV10000", "value":10000, "transition":10012, "guardCondition":[{"operator":"=", "value":12}]}, + "event":{"name":"EV10000", "value":10000, "transition":10013, "guardCondition":[{"operator":"=", "value":13}]}, + "event":{"name":"EV10000", "value":10000, "transition":10020, "guardCondition":[{"operator":"=", "value":20}]}, + "event":{"name":"EV10999", "value":10999, "transition":10999, "guardCondition":[{ "operator":">=", "value":1}, + {"join":"and", "operator":"<=", "value":20}]} + }, + "state":{ /* StatusBar + App + MenuBar */ + "name":"Display0ZoneFullB", + "value":10901, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV10000", "value":10000, "transition":10011, "guardCondition":[{"operator":"=", "value":11}]}, + "event":{"name":"EV10000", "value":10000, "transition":10012, "guardCondition":[{"operator":"=", "value":12}]}, + "event":{"name":"EV10000", "value":10000, "transition":10013, "guardCondition":[{"operator":"=", "value":13}]}, + "event":{"name":"EV10000", "value":10000, "transition":10020, "guardCondition":[{"operator":"=", "value":20}]}, + "event":{"name":"EV10999", "value":10999, "transition":10999, "guardCondition":[{ "operator":">=", "value":1}, + {"join":"and", "operator":"<=", "value":20}]}, + "state":{ + "name":"Display0Zone1", + "value":10001, + "event":{"name":"EV10000", "value":10000, "transition":10001, "guardCondition":[{"operator":"=", "value":1}]} + } + }, + "state":{ /* StatusBar + App + App + MenuBar */ + "name":"Display0ZoneHalf", + "initial":[10002,10003], + "value":10902, + "event":{"name":"EV10000", "value":10000, "transition":10001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV10000", "value":10000, "transition":10011, "guardCondition":[{"operator":"=", "value":11}]}, + "event":{"name":"EV10000", "value":10000, "transition":10012, "guardCondition":[{"operator":"=", "value":12}]}, + "event":{"name":"EV10000", "value":10000, "transition":10013, "guardCondition":[{"operator":"=", "value":13}]}, + "event":{"name":"EV10000", "value":10000, "transition":10020, "guardCondition":[{"operator":"=", "value":20}]}, + "event":{"name":"EV10999", "value":10999, "transition":10999, "guardCondition":[{ "operator":">=", "value":1}, + {"join":"and", "operator":"<=", "value":20}]}, + "state":{ + "name":"Display0Zone2", + "value":10002, + "event":{"name":"EV10000", "value":10000, "transition":10002, "guardCondition":[{"operator":"=", "value":2}]} + }, + "state":{ + "name":"Display0Zone3", + "value":10003, + "event":{"name":"EV10000", "value":10000, "transition":10003, "guardCondition":[{"operator":"=", "value":3}]} + } }, "state":{ "name":"Display0Zone11", "value":10011, - "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]}, - "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]}, - "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]}, - "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{ "operator":">=","value":1}, - {"join":"and","operator":"<=","value":20}]} + "event":{"name":"EV10000", "value":10000, "transition":10001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV10000", "value":10000, "transition":10011, "guardCondition":[{"operator":"=", "value":11}]}, + "event":{"name":"EV10000", "value":10000, "transition":10012, "guardCondition":[{"operator":"=", "value":12}]}, + "event":{"name":"EV10000", "value":10000, "transition":10013, "guardCondition":[{"operator":"=", "value":13}]}, + "event":{"name":"EV10000", "value":10000, "transition":10020, "guardCondition":[{"operator":"=", "value":20}]}, + "event":{"name":"EV10999", "value":10999, "transition":10999, "guardCondition":[{ "operator":">=", "value":1}, + {"join":"and", "operator":"<=", "value":20}]} }, "state":{ "name":"Display0Zone12", "value":10012, - "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]}, - "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]}, - "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]}, - "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{ "operator":">=","value":1}, - {"join":"and","operator":"<=","value":20}]} + "event":{"name":"EV10000", "value":10000, "transition":10001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV10000", "value":10000, "transition":10011, "guardCondition":[{"operator":"=", "value":11}]}, + "event":{"name":"EV10000", "value":10000, "transition":10012, "guardCondition":[{"operator":"=", "value":12}]}, + "event":{"name":"EV10000", "value":10000, "transition":10013, "guardCondition":[{"operator":"=", "value":13}]}, + "event":{"name":"EV10000", "value":10000, "transition":10020, "guardCondition":[{"operator":"=", "value":20}]}, + "event":{"name":"EV10999", "value":10999, "transition":10999, "guardCondition":[{ "operator":">=", "value":1}, + {"join":"and", "operator":"<=", "value":20}]} }, "state":{ "name":"Display0Zone13", "value":10013, - "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]}, - "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]}, - "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]}, - "event":{ "name":"EV10999","value":10999, "transition":10999, "guardCondition":[{ "operator":">=","value":1}, - {"join":"and","operator":"<=","value":20}]} + "event":{"name":"EV10000", "value":10000, "transition":10001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV10000", "value":10000, "transition":10011, "guardCondition":[{"operator":"=", "value":11}]}, + "event":{"name":"EV10000", "value":10000, "transition":10012, "guardCondition":[{"operator":"=", "value":12}]}, + "event":{"name":"EV10000", "value":10000, "transition":10013, "guardCondition":[{"operator":"=", "value":13}]}, + "event":{"name":"EV10000", "value":10000, "transition":10020, "guardCondition":[{"operator":"=", "value":20}]}, + "event":{"name":"EV10999", "value":10999, "transition":10999, "guardCondition":[{ "operator":">=", "value":1}, + {"join":"and", "operator":"<=", "value":20}]} }, "state":{ "name":"Display0NoOwer", "value":10999, - "event":{ "name":"EV10000","value":10000, "transition":10001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV10000","value":10000, "transition":10002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV10000","value":10000, "transition":10003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV10000","value":10000, "transition":10011, "guardCondition":[{"operator":"=","value":11}]}, - "event":{ "name":"EV10000","value":10000, "transition":10012, "guardCondition":[{"operator":"=","value":12}]}, - "event":{ "name":"EV10000","value":10000, "transition":10013, "guardCondition":[{"operator":"=","value":13}]} + "event":{"name":"EV10000", "value":10000, "transition":10001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV10000", "value":10000, "transition":10902, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV10000", "value":10000, "transition":10011, "guardCondition":[{"operator":"=", "value":11}]}, + "event":{"name":"EV10000", "value":10000, "transition":10012, "guardCondition":[{"operator":"=", "value":12}]}, + "event":{"name":"EV10000", "value":10000, "transition":10013, "guardCondition":[{"operator":"=", "value":13}]}, + "event":{"name":"EV10000", "value":10000, "transition":10020, "guardCondition":[{"operator":"=", "value":20}]} } }, @@ -236,36 +256,36 @@ "state":{ "name":"Display1Zone1", "value":11001, - "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":21}]}, - "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":22}]}, - "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":23}]}, - "event":{ "name":"EV10999","value":10999, "transition":11999, "guardCondition":[{ "operator":">=","value":21}, - {"join":"and","operator":"<=","value":40}]} + "event":{"name":"EV10000", "value":10000, "transition":11001, "guardCondition":[{"operator":"=", "value":21}]}, + "event":{"name":"EV10000", "value":10000, "transition":11002, "guardCondition":[{"operator":"=", "value":22}]}, + "event":{"name":"EV10000", "value":10000, "transition":11003, "guardCondition":[{"operator":"=", "value":23}]}, + "event":{"name":"EV10999", "value":10999, "transition":11999, "guardCondition":[{ "operator":">=", "value":21}, + {"join":"and", "operator":"<=", "value":40}]} }, "state":{ "name":"Display1Zone2", "value":11002, - "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":21}]}, - "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":22}]}, - "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":23}]}, - "event":{ "name":"EV10999","value":10999, "transition":11999, "guardCondition":[{ "operator":">=","value":21}, - {"join":"and","operator":"<=","value":40}]} + "event":{"name":"EV10000", "value":10000, "transition":11001, "guardCondition":[{"operator":"=", "value":21}]}, + "event":{"name":"EV10000", "value":10000, "transition":11002, "guardCondition":[{"operator":"=", "value":22}]}, + "event":{"name":"EV10000", "value":10000, "transition":11003, "guardCondition":[{"operator":"=", "value":23}]}, + "event":{"name":"EV10999", "value":10999, "transition":11999, "guardCondition":[{ "operator":">=", "value":21}, + {"join":"and", "operator":"<=", "value":40}]} }, "state":{ "name":"Display1Zone3", "value":11003, - "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":21}]}, - "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":22}]}, - "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":23}]}, - "event":{ "name":"EV10999","value":10999, "transition":11999, "guardCondition":[{ "operator":">=","value":21}, - {"join":"and","operator":"<=","value":40}]} + "event":{"name":"EV10000", "value":10000, "transition":11001, "guardCondition":[{"operator":"=", "value":21}]}, + "event":{"name":"EV10000", "value":10000, "transition":11002, "guardCondition":[{"operator":"=", "value":22}]}, + "event":{"name":"EV10000", "value":10000, "transition":11003, "guardCondition":[{"operator":"=", "value":23}]}, + "event":{"name":"EV10999", "value":10999, "transition":11999, "guardCondition":[{ "operator":">=", "value":21}, + {"join":"and", "operator":"<=", "value":40}]} }, "state":{ "name":"Display1NoOwer", "value":11999, - "event":{ "name":"EV10000","value":10000, "transition":11001, "guardCondition":[{"operator":"=","value":21}]}, - "event":{ "name":"EV10000","value":10000, "transition":11002, "guardCondition":[{"operator":"=","value":22}]}, - "event":{ "name":"EV10000","value":10000, "transition":11003, "guardCondition":[{"operator":"=","value":23}]} + "event":{"name":"EV10000", "value":10000, "transition":11001, "guardCondition":[{"operator":"=", "value":21}]}, + "event":{"name":"EV10000", "value":10000, "transition":11002, "guardCondition":[{"operator":"=", "value":22}]}, + "event":{"name":"EV10000", "value":10000, "transition":11003, "guardCondition":[{"operator":"=", "value":23}]} } }, @@ -275,189 +295,573 @@ "state":{ "name":"Display0Category1", /* Menu */ "value":12001, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display0Category2", /* Message */ "value":12002, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display0Category3", /* Map */ "value":12003, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display0Category4", /* Driving */ "value":12004, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display0Category5", /* CarSetting */ "value":12005, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display0Category6", /* Camera.Back */ "value":12006, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display0Category7", /* Camera.Left */ "value":12007, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display0Category8", /* Camera.Right */ "value":12008, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display0Category9", /* Entertainment */ "value":12009, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display0Category10", /* Entertainment.audio */ "value":12010, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display0Category11", /* Entertainment.visiual */ "value":12011, - "event":{ "name":"EV12000","value":12000, "transition":12001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV12000","value":12000, "transition":12002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV12000","value":12000, "transition":12003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV12000","value":12000, "transition":12004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV12000","value":12000, "transition":12005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV12000","value":12000, "transition":12006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV12000","value":12000, "transition":12007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV12000","value":12000, "transition":12008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV12000","value":12000, "transition":12009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12010, "guardCondition":[{ "operator":"=","value":10}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV12000","value":12000, "transition":12011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV12000", "value":12000, "transition":12001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12000", "value":12000, "transition":12002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12000", "value":12000, "transition":12003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12000", "value":12000, "transition":12004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12000", "value":12000, "transition":12005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12000", "value":12000, "transition":12006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12000", "value":12000, "transition":12007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12000", "value":12000, "transition":12008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12000", "value":12000, "transition":12009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12010, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12000", "value":12000, "transition":12011, "guardCondition":[{"operator":"=", "value":11}]} + } + }, + + "state":{ + "name":"Disp0Zone2Category", + "value":12100, + "state":{ + "name":"Disp0Zone2Category1", /* Menu */ + "value":12101, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone2Category2", /* Message */ + "value":12102, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone2Category3", /* Map */ + "value":12103, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone2Category4", /* Driving */ + "value":12104, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone2Category5", /* CarSetting */ + "value":12105, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone2Category6", /* Camera.Back */ + "value":12106, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone2Category7", /* Camera.Left */ + "value":12107, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone2Category8", /* Camera.Right */ + "value":12108, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone2Category9", /* Entertainment */ + "value":12109, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone2Category10", /* Entertainment.audio */ + "value":12110, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone2Category11", /* Entertainment.visiual */ + "value":12111, + "event":{"name":"EV12100", "value":12100, "transition":12101, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12100", "value":12100, "transition":12102, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12100", "value":12100, "transition":12103, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12100", "value":12100, "transition":12104, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12100", "value":12100, "transition":12105, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12100", "value":12100, "transition":12106, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12100", "value":12100, "transition":12107, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12100", "value":12100, "transition":12108, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12100", "value":12100, "transition":12109, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12110, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12100", "value":12100, "transition":12111, "guardCondition":[{"operator":"=", "value":11}]} + } + }, + + "state":{ + "name":"Disp0Zone3Category", + "value":12200, + "state":{ + "name":"Disp0Zone3Category1", /* Menu */ + "value":12201, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone3Category2", /* Message */ + "value":12202, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone3Category3", /* Map */ + "value":12203, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone3Category4", /* Driving */ + "value":12204, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone3Category5", /* CarSetting */ + "value":12205, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone3Category6", /* Camera.Back */ + "value":12206, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone3Category7", /* Camera.Left */ + "value":12207, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone3Category8", /* Camera.Right */ + "value":12208, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone3Category9", /* Entertainment */ + "value":12209, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone3Category10", /* Entertainment.audio */ + "value":12210, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} + }, + "state":{ + "name":"Disp0Zone3Category11", /* Entertainment.visiual */ + "value":12211, + "event":{"name":"EV12200", "value":12200, "transition":12201, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV12200", "value":12200, "transition":12202, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV12200", "value":12200, "transition":12203, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV12200", "value":12200, "transition":12204, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV12200", "value":12200, "transition":12205, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV12200", "value":12200, "transition":12206, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV12200", "value":12200, "transition":12207, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV12200", "value":12200, "transition":12208, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV12200", "value":12200, "transition":12209, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12210, "guardCondition":[{ "operator":"=", "value":10}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV12200", "value":12200, "transition":12211, "guardCondition":[{"operator":"=", "value":11}]} } }, @@ -467,167 +871,167 @@ "state":{ "name":"Display1Category1", "value":13001, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display1Category2", "value":13002, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display1Category3", "value":13003, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display1Category4", "value":13004, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display1Category5", "value":13005, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display1Category6", "value":13006, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display1Category7", "value":13007, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display1Category8", "value":13008, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display1Category9", "value":13009, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display1Category10", "value":13010, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} }, "state":{ "name":"Display1Category11", "value":13011, - "event":{ "name":"EV13000","value":13000, "transition":13001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV13000","value":13000, "transition":13002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV13000","value":13000, "transition":13003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV13000","value":13000, "transition":13004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV13000","value":13000, "transition":13005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV13000","value":13000, "transition":13006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV13000","value":13000, "transition":13007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV13000","value":13000, "transition":13008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV13000","value":13000, "transition":13009, "guardCondition":[{"operator":"=","value":9}]}, - "event":{ "name":"EV13000","value":13000, "transition":13010, "guardCondition":[{"operator":"=","value":10}]}, - "event":{ "name":"EV13000","value":13000, "transition":13011, "guardCondition":[{"operator":"=","value":11}]} + "event":{"name":"EV13000", "value":13000, "transition":13001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV13000", "value":13000, "transition":13002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV13000", "value":13000, "transition":13003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV13000", "value":13000, "transition":13004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV13000", "value":13000, "transition":13005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV13000", "value":13000, "transition":13006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV13000", "value":13000, "transition":13007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV13000", "value":13000, "transition":13008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV13000", "value":13000, "transition":13009, "guardCondition":[{"operator":"=", "value":9}]}, + "event":{"name":"EV13000", "value":13000, "transition":13010, "guardCondition":[{"operator":"=", "value":10}]}, + "event":{"name":"EV13000", "value":13000, "transition":13011, "guardCondition":[{"operator":"=", "value":11}]} } }, @@ -637,27 +1041,27 @@ "state":{ "name":"OnScreen_Invisible", "value":14999, - "event":{ "name":"EV14000","value":14000, "transition":14001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV14000","value":14000, "transition":14002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV14000","value":14000, "transition":14003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV14000", "value":14000, "transition":14001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV14000", "value":14000, "transition":14002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV14000", "value":14000, "transition":14003, "guardCondition":[{"operator":"=", "value":3}]} }, "state":{ "name":"OnScreen_Warning", "value":14001, - "event":{ "name":"EV14001","value":14001, "transition":14999} + "event":{"name":"EV14001", "value":14001, "transition":14999} }, "state":{ "name":"OnScreen_Attention", "value":14002, - "event":{ "name":"EV14001","value":14001, "transition":14999}, - "event":{ "name":"EV14000","value":14000, "transition":14001, "guardCondition":[{"operator":"=","value":1}]} + "event":{"name":"EV14001", "value":14001, "transition":14999}, + "event":{"name":"EV14000", "value":14000, "transition":14001, "guardCondition":[{"operator":"=", "value":1}]} }, "state":{ "name":"OnScreen_Message", "value":14003, - "event":{ "name":"EV14001","value":14001, "transition":14999}, - "event":{ "name":"EV14000","value":14000, "transition":14001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV14000","value":14000, "transition":14002, "guardCondition":[{"operator":"=","value":2}]} + "event":{"name":"EV14001", "value":14001, "transition":14999}, + "event":{"name":"EV14000", "value":14000, "transition":14001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV14000", "value":14000, "transition":14002, "guardCondition":[{"operator":"=", "value":2}]} } }, @@ -667,27 +1071,27 @@ "state":{ "name":"IntterputDisplay0Zone1_Invisible", "value":15999, - "event":{ "name":"EV15000","value":15000, "transition":15001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV15000","value":15000, "transition":15002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV15000","value":15000, "transition":15003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV15000", "value":15000, "transition":15001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV15000", "value":15000, "transition":15002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV15000", "value":15000, "transition":15003, "guardCondition":[{"operator":"=", "value":3}]} }, "state":{ "name":"IntterputDisplay0Zone1_Priority1", "value":15001, - "event":{ "name":"EV15000","value":15001, "transition":15999} + "event":{"name":"EV15000", "value":15001, "transition":15999} }, "state":{ "name":"IntterputDisplay0Zone1_Priority2", "value":15002, - "event":{ "name":"EV15000","value":15001, "transition":15999}, - "event":{ "name":"EV15000","value":15000, "transition":15001, "guardCondition":[{"operator":"=","value":1}]} + "event":{"name":"EV15000", "value":15001, "transition":15999}, + "event":{"name":"EV15000", "value":15000, "transition":15001, "guardCondition":[{"operator":"=", "value":1}]} }, "state":{ "name":"IntterputDisplay0Zone1_Priority3", "value":15003, - "event":{ "name":"EV15000","value":15001, "transition":15999}, - "event":{ "name":"EV15000","value":15000, "transition":15001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV15000","value":15000, "transition":15002, "guardCondition":[{"operator":"=","value":2}]} + "event":{"name":"EV15000", "value":15001, "transition":15999}, + "event":{"name":"EV15000", "value":15000, "transition":15001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV15000", "value":15000, "transition":15002, "guardCondition":[{"operator":"=", "value":2}]} } }, @@ -697,27 +1101,27 @@ "state":{ "name":"IntterputDisplay0Zone2_Invisible", "value":16999, - "event":{ "name":"EV16000","value":16000, "transition":16001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV16000","value":16000, "transition":16002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV16000","value":16000, "transition":16003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV16000", "value":16000, "transition":16001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV16000", "value":16000, "transition":16002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV16000", "value":16000, "transition":16003, "guardCondition":[{"operator":"=", "value":3}]} }, "state":{ "name":"IntterputDisplay0Zone2_Priority1", "value":16001, - "event":{ "name":"EV16000","value":16001, "transition":16999} + "event":{"name":"EV16000", "value":16001, "transition":16999} }, "state":{ "name":"IntterputDisplay0Zone2_Priority2", "value":16002, - "event":{ "name":"EV16000","value":16001, "transition":16999}, - "event":{ "name":"EV16000","value":16000, "transition":16001, "guardCondition":[{"operator":"=","value":1}]} + "event":{"name":"EV16000", "value":16001, "transition":16999}, + "event":{"name":"EV16000", "value":16000, "transition":16001, "guardCondition":[{"operator":"=", "value":1}]} }, "state":{ "name":"IntterputDisplay0Zone2_Priority3", "value":16003, - "event":{ "name":"EV16000","value":16001, "transition":16999}, - "event":{ "name":"EV16000","value":16000, "transition":16001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV16000","value":16000, "transition":16002, "guardCondition":[{"operator":"=","value":2}]} + "event":{"name":"EV16000", "value":16001, "transition":16999}, + "event":{"name":"EV16000", "value":16000, "transition":16001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV16000", "value":16000, "transition":16002, "guardCondition":[{"operator":"=", "value":2}]} } }, @@ -727,27 +1131,27 @@ "state":{ "name":"IntterputDisplay0Zone3_Invisible", "value":17999, - "event":{ "name":"EV17000","value":17000, "transition":17001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV17000","value":17000, "transition":17002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV17000","value":17000, "transition":17003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV17000", "value":17000, "transition":17001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV17000", "value":17000, "transition":17002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV17000", "value":17000, "transition":17003, "guardCondition":[{"operator":"=", "value":3}]} }, "state":{ "name":"IntterputDisplay0Zone3_Priority1", "value":17001, - "event":{ "name":"EV17000","value":17001, "transition":17999} + "event":{"name":"EV17000", "value":17001, "transition":17999} }, "state":{ "name":"IntterputDisplay0Zone3_Priority2", "value":17002, - "event":{ "name":"EV17000","value":17001, "transition":17999}, - "event":{ "name":"EV17000","value":17000, "transition":17001, "guardCondition":[{"operator":"=","value":1}]} + "event":{"name":"EV17000", "value":17001, "transition":17999}, + "event":{"name":"EV17000", "value":17000, "transition":17001, "guardCondition":[{"operator":"=", "value":1}]} }, "state":{ "name":"IntterputDisplay0Zone3_Priority3", "value":17003, - "event":{ "name":"EV17000","value":17001, "transition":17999}, - "event":{ "name":"EV17000","value":17000, "transition":17001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV17000","value":17000, "transition":17002, "guardCondition":[{"operator":"=","value":2}]} + "event":{"name":"EV17000", "value":17001, "transition":17999}, + "event":{"name":"EV17000", "value":17000, "transition":17001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV17000", "value":17000, "transition":17002, "guardCondition":[{"operator":"=", "value":2}]} } }, @@ -757,33 +1161,33 @@ "state":{ "name":"SoundZone_NoUse", /* No Use */ "value":20999, - "event":{ "name":"EV20000","value":20000, "transition":20001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV20000","value":20000, "transition":20002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV20000","value":20000, "transition":20003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV20000", "value":20000, "transition":20001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV20000", "value":20000, "transition":20002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV20000", "value":20000, "transition":20003, "guardCondition":[{"operator":"=", "value":3}]} }, "state":{ "name":"SoundZone1", /* Full */ "value":20001, - "event":{ "name":"EV20999","value":20999, "transition":20999 }, - "event":{ "name":"EV20000","value":20000, "transition":20001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV20000","value":20000, "transition":20002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV20000","value":20000, "transition":20003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV20999", "value":20999, "transition":20999}, + "event":{"name":"EV20000", "value":20000, "transition":20001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV20000", "value":20000, "transition":20002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV20000", "value":20000, "transition":20003, "guardCondition":[{"operator":"=", "value":3}]} }, "state":{ "name":"SoundZone2", /* Driver */ "value":20002, - "event":{ "name":"EV20999","value":20999, "transition":20999 }, - "event":{ "name":"EV20000","value":20000, "transition":20001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV20000","value":20000, "transition":20002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV20000","value":20000, "transition":20003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV20999", "value":20999, "transition":20999}, + "event":{"name":"EV20000", "value":20000, "transition":20001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV20000", "value":20000, "transition":20002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV20000", "value":20000, "transition":20003, "guardCondition":[{"operator":"=", "value":3}]} }, "state":{ "name":"SoundZone3", /* Passenger */ "value":20003, - "event":{ "name":"EV20999","value":20999, "transition":20999 }, - "event":{ "name":"EV20000","value":20000, "transition":20001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV20000","value":20000, "transition":20002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV20000","value":20000, "transition":20003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV20999", "value":20999, "transition":20999}, + "event":{"name":"EV20000", "value":20000, "transition":20001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV20000", "value":20000, "transition":20002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV20000", "value":20000, "transition":20003, "guardCondition":[{"operator":"=", "value":3}]} } }, @@ -793,217 +1197,217 @@ "state":{ "name":"SoundCategory_Unknown", /* unknown */ "value":22999, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory1", /* Menu */ "value":22001, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory2", /* Message */ "value":22002, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory3", /* Map */ "value":22003, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory4", /* Driving */ "value":22004, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory5", /* CarSetting */ "value":22005, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory6", /* Camera.Back */ "value":22006, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory7", /* Camera.Left */ "value":22007, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory8", /* Camera.Right */ "value":22008, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory9", /* Entertainment */ "value":22009, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory10", /* Entertainment.audio */ "value":22010, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} }, "state":{ "name":"SoundCategory11", /* Entertainment.visiual */ "value":22011, - "event":{ "name":"EV22999","value":22999, "transition":22999 }, - "event":{ "name":"EV22000","value":22000, "transition":22001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV22000","value":22000, "transition":22002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV22000","value":22000, "transition":22003, "guardCondition":[{"operator":"=","value":3}]}, - "event":{ "name":"EV22000","value":22000, "transition":22004, "guardCondition":[{"operator":"=","value":4}]}, - "event":{ "name":"EV22000","value":22000, "transition":22005, "guardCondition":[{"operator":"=","value":5}]}, - "event":{ "name":"EV22000","value":22000, "transition":22006, "guardCondition":[{"operator":"=","value":6}]}, - "event":{ "name":"EV22000","value":22000, "transition":22007, "guardCondition":[{"operator":"=","value":7}]}, - "event":{ "name":"EV22000","value":22000, "transition":22008, "guardCondition":[{"operator":"=","value":8}]}, - "event":{ "name":"EV22000","value":22000, "transition":22009, "guardCondition":[{ "operator":"=","value":9}, - {"join":"and","operator":"not","value":"Regulating"}]}, - "event":{ "name":"EV22000","value":22000, "transition":22010, "guardCondition":[{ "operator":"=","value":10}]}, - "event":{ "name":"EV22000","value":22000, "transition":22011, "guardCondition":[{"operator":"=","value":11}, - {"join":"and","operator":"not","value":"Regulating"}]} + "event":{"name":"EV22999", "value":22999, "transition":22999}, + "event":{"name":"EV22000", "value":22000, "transition":22001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV22000", "value":22000, "transition":22002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV22000", "value":22000, "transition":22003, "guardCondition":[{"operator":"=", "value":3}]}, + "event":{"name":"EV22000", "value":22000, "transition":22004, "guardCondition":[{"operator":"=", "value":4}]}, + "event":{"name":"EV22000", "value":22000, "transition":22005, "guardCondition":[{"operator":"=", "value":5}]}, + "event":{"name":"EV22000", "value":22000, "transition":22006, "guardCondition":[{"operator":"=", "value":6}]}, + "event":{"name":"EV22000", "value":22000, "transition":22007, "guardCondition":[{"operator":"=", "value":7}]}, + "event":{"name":"EV22000", "value":22000, "transition":22008, "guardCondition":[{"operator":"=", "value":8}]}, + "event":{"name":"EV22000", "value":22000, "transition":22009, "guardCondition":[{ "operator":"=", "value":9}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]}, + "event":{"name":"EV22000", "value":22000, "transition":22010, "guardCondition":[{ "operator":"=", "value":10}]}, + "event":{"name":"EV22000", "value":22000, "transition":22011, "guardCondition":[{"operator":"=", "value":11}, + {"join":"and", "operator":"not", "value":"DrivingModeOn"}]} } }, @@ -1013,27 +1417,27 @@ "state":{ "name":"IntterputSoundZone1_NoOutput", "value":25999, - "event":{ "name":"EV25000","value":25000, "transition":25001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV25000","value":25000, "transition":25002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV25000","value":25000, "transition":25003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV25000", "value":25000, "transition":25001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV25000", "value":25000, "transition":25002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV25000", "value":25000, "transition":25003, "guardCondition":[{"operator":"=", "value":3}]} }, "state":{ "name":"IntterputSoundZone1_Priority1", "value":25001, - "event":{ "name":"EV25999","value":25999, "transition":25999} + "event":{"name":"EV25999", "value":25999, "transition":25999} }, "state":{ "name":"IntterputSoundZone1_Priority2", "value":25002, - "event":{ "name":"EV25999","value":25999, "transition":25999}, - "event":{ "name":"EV25000","value":25000, "transition":25001, "guardCondition":[{"operator":"=","value":1}]} + "event":{"name":"EV25999", "value":25999, "transition":25999}, + "event":{"name":"EV25000", "value":25000, "transition":25001, "guardCondition":[{"operator":"=", "value":1}]} }, "state":{ "name":"IntterputSoundZone1_Priority3", "value":25003, - "event":{ "name":"EV25999","value":25999, "transition":25999}, - "event":{ "name":"EV25000","value":25000, "transition":25001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV25000","value":25000, "transition":25002, "guardCondition":[{"operator":"=","value":2}]} + "event":{"name":"EV25999", "value":25999, "transition":25999}, + "event":{"name":"EV25000", "value":25000, "transition":25001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV25000", "value":25000, "transition":25002, "guardCondition":[{"operator":"=", "value":2}]} } }, @@ -1043,27 +1447,27 @@ "state":{ "name":"IntterputSoundZone2_NoOutput", "value":26999, - "event":{ "name":"EV26000","value":26000, "transition":26001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV26000","value":26000, "transition":26002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV26000","value":26000, "transition":26003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV26000", "value":26000, "transition":26001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV26000", "value":26000, "transition":26002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV26000", "value":26000, "transition":26003, "guardCondition":[{"operator":"=", "value":3}]} }, "state":{ "name":"IntterputSoundZone2_Priority1", "value":26001, - "event":{ "name":"EV26999","value":26999, "transition":26999} + "event":{"name":"EV26999", "value":26999, "transition":26999} }, "state":{ "name":"IntterputSoundZone2_Priority2", "value":26002, - "event":{ "name":"EV26999","value":26999, "transition":26999}, - "event":{ "name":"EV26000","value":26000, "transition":26001, "guardCondition":[{"operator":"=","value":1}]} + "event":{"name":"EV26999", "value":26999, "transition":26999}, + "event":{"name":"EV26000", "value":26000, "transition":26001, "guardCondition":[{"operator":"=", "value":1}]} }, "state":{ "name":"IntterputSoundZone2_Priority3", "value":26003, - "event":{ "name":"EV26999","value":26999, "transition":26999}, - "event":{ "name":"EV26000","value":26000, "transition":26001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV26000","value":26000, "transition":26002, "guardCondition":[{"operator":"=","value":2}]} + "event":{"name":"EV26999", "value":26999, "transition":26999}, + "event":{"name":"EV26000", "value":26000, "transition":26001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV26000", "value":26000, "transition":26002, "guardCondition":[{"operator":"=", "value":2}]} } }, @@ -1073,27 +1477,27 @@ "state":{ "name":"IntterputSoundZone3_NoOutput", "value":27999, - "event":{ "name":"EV27000","value":27000, "transition":27001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV27000","value":27000, "transition":27002, "guardCondition":[{"operator":"=","value":2}]}, - "event":{ "name":"EV27000","value":27000, "transition":27003, "guardCondition":[{"operator":"=","value":3}]} + "event":{"name":"EV27000", "value":27000, "transition":27001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV27000", "value":27000, "transition":27002, "guardCondition":[{"operator":"=", "value":2}]}, + "event":{"name":"EV27000", "value":27000, "transition":27003, "guardCondition":[{"operator":"=", "value":3}]} }, "state":{ "name":"IntterputSoundZone3_Priority1", "value":27001, - "event":{ "name":"EV27999","value":27999, "transition":27999} + "event":{"name":"EV27999", "value":27999, "transition":27999} }, "state":{ "name":"IntterputSoundZone3_Priority2", "value":27002, - "event":{ "name":"EV27999","value":27999, "transition":27999}, - "event":{ "name":"EV27000","value":27000, "transition":27001, "guardCondition":[{"operator":"=","value":1}]} + "event":{"name":"EV27999", "value":27999, "transition":27999}, + "event":{"name":"EV27000", "value":27000, "transition":27001, "guardCondition":[{"operator":"=", "value":1}]} }, "state":{ "name":"IntterputSoundZone3_Priority3", "value":27003, - "event":{ "name":"EV27999","value":27999, "transition":27999}, - "event":{ "name":"EV27000","value":27000, "transition":27001, "guardCondition":[{"operator":"=","value":1}]}, - "event":{ "name":"EV27000","value":27000, "transition":27002, "guardCondition":[{"operator":"=","value":2}]} + "event":{"name":"EV27999", "value":27999, "transition":27999}, + "event":{"name":"EV27000", "value":27000, "transition":27001, "guardCondition":[{"operator":"=", "value":1}]}, + "event":{"name":"EV27000", "value":27000, "transition":27002, "guardCondition":[{"operator":"=", "value":2}]} } }, @@ -1103,13 +1507,13 @@ "state":{ "name":"Input1_NotUsing", "value":30001, - "event":{ "name":"EV30000","value":30000, "transition":30002} + "event":{"name":"EV30000", "value":30000, "transition":30002} }, "state":{ "name":"Input1_Using", "value":30002, - "event":{ "name":"EV30000","value":30000, "transition":30002}, - "event":{ "name":"EV30001","value":30000, "transition":30001} + "event":{"name":"EV30000", "value":30000, "transition":30002}, + "event":{"name":"EV30001", "value":30001, "transition":30001} } }, @@ -1119,15 +1523,15 @@ "state":{ "name":"Input2_NotUsing", "value":30101, - "event":{ "name":"EV30100","value":30100, "transition":30102} + "event":{"name":"EV30100", "value":30100, "transition":30102} }, "state":{ "name":"Input2_Using", "value":30102, - "event":{ "name":"EV30100","value":30100, "transition":30102}, - "event":{ "name":"EV30101","value":30100, "transition":30101} + "event":{"name":"EV30100", "value":30100, "transition":30102}, + "event":{"name":"EV30101", "value":30101, "transition":30101} } }, - "finalState":{"name":"TheEnd","value":9999 } + "finalState":{"name":"TheEnd", "value":9999} } diff --git a/res/org.tizen.ico.system-controller/res/config/system-controller.xml b/res/org.tizen.ico.system-controller/res/config/system-controller.xml new file mode 100644 index 0000000..1568d0f --- /dev/null +++ b/res/org.tizen.ico.system-controller/res/config/system-controller.xml @@ -0,0 +1,25 @@ + + + + + + + IcoSysConDaemon + + + + + + + + + + + + + + diff --git a/res/org.tizen.ico.system-controller/res/config/system.xml b/res/org.tizen.ico.system-controller/res/config/system.xml index 0eb0907..76f1f97 100644 --- a/res/org.tizen.ico.system-controller/res/config/system.xml +++ b/res/org.tizen.ico.system-controller/res/config/system.xml @@ -262,7 +262,7 @@ 0 1 - + unknown always parked @@ -321,7 +321,7 @@ - yes + app /sys/fs/cgroup/cpu,cpuacct/SCprivate 300 6 @@ -380,15 +380,50 @@ none - - - 128 - false - - /home/app/ico + + 40 + 200 + + VehicleSpeed + VehicleSpeed + 0 + INT32 + + + Transmission + ShiftPosition + 0 + BYTE + + + LightStatus + LeftTurn + 0 + BOOLEAN + + + LightStatus + RightTurn + 0 + BOOLEAN + + + NightMode + NightMode + 0 + UINT32 + + + DrivingMode + DrivingMode + 0 + UINT32 + + + diff --git a/res/org.tizen.ico.system-controller/res/config/system_sysres.json b/res/org.tizen.ico.system-controller/res/config/system_sysres.json new file mode 100644 index 0000000..bcf9df6 --- /dev/null +++ b/res/org.tizen.ico.system-controller/res/config/system_sysres.json @@ -0,0 +1,28 @@ +{ + "function": "app", + "ctrl_dir_path": "/sys/fs/cgroup/cpu,cpuacct/SCprivate", + "sampling_wait": 300, + "retry_cnt": 6, + "low_limit_value": 30, + "high_limit_value": 92, + "sector":[ + { + "id": 0, + "name": "groupA", + "hight":[500, 600, 700], + "low": [1000, 500, 600] + }, + { + "id": 1, + "name": "groupB", + "hight":[300, 250, 200], + "low": [1000, 300, 250] + }, + { + "id": 2, + "name": "groupC", + "hight":[200, 150, 100], + "low": [1000, 200, 150] + } + ] +} diff --git a/src/Makefile.am b/src/Makefile.am index 1202654..8500249 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,4 @@ -SUBDIRS= \ - syscond \ - homescreen +SUBDIRS= \ + syscond \ + homescreen \ + statusbar diff --git a/src/homescreen/CicoHSAppControl.cpp b/src/homescreen/CicoHSAppControl.cpp new file mode 100644 index 0000000..4d05a4c --- /dev/null +++ b/src/homescreen/CicoHSAppControl.cpp @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ +/** + * @brief Application control class + * + * @date Dec-18-2013 + */ + +using namespace std; +#include "CicoHSAppControl.h" +#include "CicoHomeScreen.h" +#include "CicoHSCommand.h" +#include "CicoHSLifeCycleController.h" + +#include +#include "ico_syc_msg_cmd_def.h" + +/*============================================================================*/ +/* static members */ +/*============================================================================*/ +CicoHSAppControl *CicoHSAppControl::ms_myInstance = NULL; + +/*============================================================================*/ +/* functions */ +/*============================================================================*/ +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSAppControl::CicoHSAppControl + * Constractor + * + * @param[in] none + * @return none + */ +/*--------------------------------------------------------------------------*/ +CicoHSAppControl::CicoHSAppControl(void) +{ + ICO_TRA("CicoHSAppControl::CicoHSAppControl Enter"); + + ICO_TRA("CicoHSAppControl::CicoHSAppControl Leave"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSAppControl::~CicoHSMenuWindo + * Destractor + * + * @param[in] none + * @return none + */ +/*--------------------------------------------------------------------------*/ +CicoHSAppControl::~CicoHSAppControl(void) +{ + /* Do not somthing to do */ +} + +//-------------------------------------------------------------------------- +/** + * @brief CicoHSAppControl::getInstance + * Get instance of CicoHSAppControl + * + * @param none + * @return pointer of CicoHSAppControl object + */ +//-------------------------------------------------------------------------- +CicoHSAppControl* +CicoHSAppControl::getInstance(void) +{ + if (NULL == ms_myInstance) { + ms_myInstance = new CicoHSAppControl(); + } + return ms_myInstance; +} + +//-------------------------------------------------------------------------- +/** + * @brief CicoHSAppControl::handleCommand + * Handle command + * + * @param [in] cmd control command + * @return none + */ +//-------------------------------------------------------------------------- +void +CicoHSAppControl::handleCommand(const CicoHSCommand * cmd) +{ + ICO_TRA("CicoHSAppControl::handleCommand Enter(%d)", cmd->cmdid); + + CicoHSCmdAppCtlOpt *opt = static_cast(cmd->opt); + int ret = -1; + vector::iterator it = opt->arg.begin(); + + switch (cmd->cmdid) { + case MSG_CMD_APP_START: + // start application + ExecuteApp(it->m_appid); + break; + case MSG_CMD_APP_STOP: + if ((it->m_appid).empty() == true) { + ret = GetAppId(it->m_pid, it->m_appid); + if (ret != 0) { + break; + } + } + // stop application + TerminateApp(it->m_appid); + break; + case MSG_CMD_WIN_CHANGE: +# if 0 + while( it != opt->arg.end() ) { + if ((it->m_appid).empty() == true) { + ret = GetAppId(it->m_pid, it->m_appid); + if (ret != 0) { + ++it; + continue; + } + } + // change application window + WinChangeApp(it->m_appid, it->m_zone, it->m_visible); + ++it; + } +#else + WinChgControl(opt->arg); +#endif + + break; + default: + ICO_WRN("Unknown Command(0x%08X)", cmd->cmdid); + break; + } + ICO_TRA("CicoHSAppControl::handleCommand Leave"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSAppControl::GetAppId + * get application id + * + * @param[in] pid pid + * @return appid none + */ +/*--------------------------------------------------------------------------*/ +int +CicoHSAppControl::GetAppId(int pid, string& appid) +{ + ICO_TRA("CicoHSAppControl::GetAppId Enter"); + + if (pid == -1 ) { + ICO_ERR("No pid"); + return -1; + } + + const CicoAulItems* aul = CicoHSLifeCycleController::getInstance()->findAUL(pid); + if ((NULL == aul) || (0 == aul)) { + ICO_TRA("aul items not find"); + return -1; + } + appid = aul->m_appid; + return 0; + + ICO_TRA("CicoHSAppControl::GetAppId Leave"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSAppControl::WinChangeApp + * change application window + * + * @param[in] appid application id + * @param[in] zone zone + * @param[in] visible visible val + * @return none + */ +/*--------------------------------------------------------------------------*/ +void +CicoHSAppControl::WinChangeApp(const string& appid, const string& zone, int visible) +{ + ICO_TRA("CicoHSAppControl::WinChangeApp Enter"); + + if (visible == 1) { + MoveApp(appid, zone); + ShowApp(appid); + } + else if (visible == 0) { + MoveApp(appid, zone); + HideApp(appid); + } + else { + ICO_ERR("Unknown visible(%d)", visible); + } + + ICO_TRA("CicoHSAppControl::WinChangeApp Leave"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSAppControl::MoveApp + * move application + * + * @param[in] appid application id + * @param[in] zone zone + * @return none + */ +/*--------------------------------------------------------------------------*/ +void +CicoHSAppControl::MoveApp(const string& appid, const string& zone) +{ + ICO_TRA("CicoHSAppControl::MoveApp Enter"); + + CicoHomeScreen::MoveApp(appid, zone); + + ICO_TRA("CicoHSAppControl::MoveApp Leave"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSAppControl::ShowApp + * show application + * + * @param[in] appid application id + * @return none + */ +/*--------------------------------------------------------------------------*/ +void +CicoHSAppControl::ShowApp(const string& appid) +{ + ICO_TRA("CicoHSAppControl::ShowApp Enter"); + + CicoHomeScreen::ShowApp(appid); + + ICO_TRA("CicoHSAppControl::ShowApp Leave"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSAppControl::HideApp + * hide application + * + * @param[in] appid application id + * @return none + */ +/*--------------------------------------------------------------------------*/ +void +CicoHSAppControl::HideApp(const string& appid) +{ + ICO_TRA("CicoHSAppControl::HideApp Enter"); + + CicoHomeScreen::HideApp(appid); + + ICO_TRA("CicoHSAppControl::HideApp Leave"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSAppControl::ExecuteApp + * execute application + * + * @param[in] appid application id + * @return none + */ +/*--------------------------------------------------------------------------*/ +void +CicoHSAppControl::ExecuteApp(const string& appid) +{ + ICO_TRA("CicoHSAppControl::ExecuteApp Enter"); + + CicoHomeScreen::ExecuteApp(appid.c_str()); + + ICO_TRA("CicoHSAppControl::ExecuteApp Leave"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSAppControl::TerminateApp + * teminate application + * + * @param[in] appid application id + * @return none + */ +/*--------------------------------------------------------------------------*/ +void +CicoHSAppControl::TerminateApp(const string& appid) +{ + ICO_TRA("CicoHSAppControl::TerminateApp Enter"); + + CicoHomeScreen::TerminateApp(appid.c_str()); + + ICO_TRA("CicoHSAppControl::TerminateApp Leave"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHSAppControl::WinChgControl + * WIN_CHANGE command exec. + * + * @param[in] arg appid,zone,visible data + * @return bool + * @retval true: success + * @retval false: fail + */ +/*--------------------------------------------------------------------------*/ +bool +CicoHSAppControl::WinChgControl(vector& arg) +{ + ICO_TRA("start WinChgControl(%d)", arg.size()); + // Check show control and appid get + bool bShow = false; + vector::iterator it = arg.begin(); + while ( it != arg.end() ) { + if (true == (it->m_appid).empty()) { + if (0 != GetAppId(it->m_pid, it->m_appid)) { + ++it; + continue; // continue of while + } + ICO_DBG("%d -> %s getappid", it->m_pid, (it->m_appid).c_str()); + } + if (1 == it->m_visible) { + bShow = true; + } + ++it; + } + if (false == bShow) { + ICO_TRA("end Nothing show"); + return false; + } + // Hide set + it = arg.begin(); + while ( it != arg.end() ) { + if ((0 == it->m_visible) && (false == (it->m_appid).empty())) { + WinChangeApp(it->m_appid, it->m_zone, it->m_visible); + } + ++it; + } + // Show set + it = arg.begin(); + while ( it != arg.end() ) { + if ((1 == it->m_visible) && (false == (it->m_appid).empty())) { + WinChangeApp(it->m_appid, it->m_zone, it->m_visible); + } + ++it; + } + ICO_TRA("end"); + return true; +} + +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSAppControl.h b/src/homescreen/CicoHSAppControl.h new file mode 100644 index 0000000..c7dd2bb --- /dev/null +++ b/src/homescreen/CicoHSAppControl.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSAppControl.h + * + * @brief This file is definition of CicoHSAppControl class + */ +//========================================================================== +#ifndef __CICO_HS_APP_CONTROL_H__ +#define __CICO_HS_APP_CONTROL_H__ +#include +#include +#include "CicoHSCommandArg.h" + +//========================================================================== +// Forward declaration +//========================================================================== +class CicoHSCommand; + +//========================================================================== +/* + * @brief This class manages control of user and access to user information + */ +//========================================================================== +class CicoHSAppControl +{ +public: + // get CicoHSAppControl instance + static CicoHSAppControl* getInstance(void); + + // handle command + void handleCommand(const CicoHSCommand * cmd); + + // change application window + void WinChangeApp(const std::string& appid, const std::string& zone, int visible); + + // move application + void MoveApp(const std::string& appid, const std::string& zone); + + // show application + void ShowApp(const std::string& appid); + + // hide application + void HideApp(const std::string& appid); + + // execute application + void ExecuteApp(const std::string& appid); + + // teminate application + void TerminateApp(const std::string& appid); + + // get application id + int GetAppId(int pid, std::string& appid); + +private: + // default constructor + CicoHSAppControl(); + + // destructor + ~CicoHSAppControl(); + + // assignment operator + CicoHSAppControl& operator=(const CicoHSAppControl &object); + + bool WinChgControl(std::vector& arg); +private: + static CicoHSAppControl* ms_myInstance; ///< CicoHSAppControl Object + +}; + +#endif // __CICO_HS_APP_CONTROL_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSAppHistory.cpp b/src/homescreen/CicoHSAppHistory.cpp index ff95cc6..828a6a6 100644 --- a/src/homescreen/CicoHSAppHistory.cpp +++ b/src/homescreen/CicoHSAppHistory.cpp @@ -25,7 +25,7 @@ #include "CicoHSAppHistory.h" #include "CicoHomeScreenCommon.h" #include "CicoHomeScreen.h" -#include "CicoLog.h" +#include using namespace std; @@ -386,3 +386,4 @@ const std::string& CicoHSAppHistory::getSwipeCurrentAppid() } return m_swipeStr; } +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSAppHistory.h b/src/homescreen/CicoHSAppHistory.h index 7d323da..9790614 100644 --- a/src/homescreen/CicoHSAppHistory.h +++ b/src/homescreen/CicoHSAppHistory.h @@ -137,3 +137,4 @@ inline void CicoHSAppHistory::setHomeScreen(CicoHomeScreen* hs) } #endif // CICOHSAPPHISTORY_H +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSAppHistoryExt.cpp b/src/homescreen/CicoHSAppHistoryExt.cpp index 3f4418b..bc3eb47 100644 --- a/src/homescreen/CicoHSAppHistoryExt.cpp +++ b/src/homescreen/CicoHSAppHistoryExt.cpp @@ -27,7 +27,7 @@ #include "Cico_aul_listen_app.h" #include "CicoHomeScreenCommon.h" #include "CicoHomeScreen.h" -#include "CicoLog.h" +#include using namespace std; @@ -53,7 +53,7 @@ static int ico_CHSAHapp_launch_handler(int pid, void *data) char appid[255]; memset(appid, 0, sizeof(appid)); int iR = Xaul_app_get_appid_bypid(pid, appid, sizeof(appid)); - ICO_DBG("%d=aul_app_get_appid_bypid %d , %s", iR, pid, appid); + ICO_PRF("CHG_APP_STA 1.notice app=%s, pid=%d, rval=%d", appid, pid, iR); return o->appLaunch(pid, appid, iR); } @@ -803,3 +803,4 @@ void CicoHSAppHistoryExt::stopStartupCheck() m_vpbpa.clear(); m_lastStartupApp.clear(); } +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSAppHistoryExt.h b/src/homescreen/CicoHSAppHistoryExt.h index 9cd30e6..069cc11 100644 --- a/src/homescreen/CicoHSAppHistoryExt.h +++ b/src/homescreen/CicoHSAppHistoryExt.h @@ -217,4 +217,4 @@ inline void CicoHSAppHistoryExt::clearSelectApp() } #endif // CICOHSAPPHISTORYEXT_H - +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSAppInfo.cpp b/src/homescreen/CicoHSAppInfo.cpp index 7718863..3fe9be8 100644 --- a/src/homescreen/CicoHSAppInfo.cpp +++ b/src/homescreen/CicoHSAppInfo.cpp @@ -16,8 +16,9 @@ //========================================================================== #include "CicoHSAppInfo.h" -#include "CicoSCSystemConfig.h" -#include "CicoSCConf.h" +#include "CicoSystemConfig.h" +#include "CicoConf.h" +#include "CicoHSLifeCycleController.h" //========================================================================== // public functions @@ -33,7 +34,7 @@ CicoHSAppInfo::CicoHSAppInfo(const char *appid) : m_appid(appid), m_category(0), m_window_num(0), m_last_surface(0) { memset(m_window_info_i, 0, sizeof(m_window_info_i)); - m_life_cycle_controller = CicoSCLifeCycleController::getInstance(); + m_life_cycle_controller = CicoHSLifeCycleController::getInstance(); } //-------------------------------------------------------------------------- @@ -374,10 +375,10 @@ CicoHSAppInfo::GetLastSurface(void) const char * CicoHSAppInfo::GetDefaultZone(void) { - m_life_cycle_controller = CicoSCLifeCycleController::getInstance(); - const CicoSCAilItems* ailItem = m_life_cycle_controller->findAIL(m_appid); + m_life_cycle_controller = CicoHSLifeCycleController::getInstance(); + const CicoAilItems* ailItem = m_life_cycle_controller->findAIL(m_appid); - CicoSCSystemConfig *sysConf = CicoSCSystemConfig::getInstance(); + CicoSystemConfig *sysConf = CicoSystemConfig::getInstance(); const CicoSCDisplayZoneConf *zoneConf = NULL; if (NULL != ailItem) { zoneConf = sysConf->findDisplayZoneConfbyId(ailItem->m_displayZone); diff --git a/src/homescreen/CicoHSAppInfo.h b/src/homescreen/CicoHSAppInfo.h index b925107..17d7e73 100644 --- a/src/homescreen/CicoHSAppInfo.h +++ b/src/homescreen/CicoHSAppInfo.h @@ -27,7 +27,7 @@ #include "ico_syc_winctl.h" #include "CicoHomeScreenCommon.h" -#include "CicoSCLifeCycleController.h" +#include "CicoHSLifeCycleController.h" #define ICO_HS_APPLICATION_FULL_SCREEN_POS_X 0 #define ICO_HS_APPLICATION_FULL_SCREEN_POS_Y 64 @@ -146,7 +146,7 @@ private: /// window information list std::vector m_window_info; /// life cycle controller instance - CicoSCLifeCycleController *m_life_cycle_controller; + CicoHSLifeCycleController *m_life_cycle_controller; }; #endif // __CICO_HS_APP_INFO_H__ // vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSBackWindow.cpp b/src/homescreen/CicoHSBackWindow.cpp index d7430d1..d1ac207 100644 --- a/src/homescreen/CicoHSBackWindow.cpp +++ b/src/homescreen/CicoHSBackWindow.cpp @@ -12,7 +12,7 @@ * @date Aug-08-2013 */ #include "CicoHSBackWindow.h" -#include "CicoHomeScreenResourceConfig.h" +#include "CicoResourceConfig.h" /*============================================================================*/ /* functions */ @@ -30,7 +30,7 @@ CicoHSBackWindow::CicoHSBackWindow(void) { evas = NULL; - CicoHomeScreenResourceConfig::GetImagePath(img_dir_path,ICO_HS_MAX_PATH_BUFF_LEN); + CicoResourceConfig::GetImagePath(img_dir_path,ICO_HS_MAX_PATH_BUFF_LEN); } @@ -115,5 +115,4 @@ CicoHSBackWindow::FreeBackWindow(void) evas_object_del(canvas); FreeWindow(); } - - +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSBackWindow.h b/src/homescreen/CicoHSBackWindow.h index c5fbf89..79c6b91 100644 --- a/src/homescreen/CicoHSBackWindow.h +++ b/src/homescreen/CicoHSBackWindow.h @@ -29,7 +29,7 @@ #include #include "CicoHomeScreenCommon.h" -#include "CicoHomeScreenConfig.h" +#include "CicoGKeyFileConfig.h" #include "CicoHSWindow.h" class CicoHSBackWindow :public CicoHSWindow @@ -52,4 +52,4 @@ class CicoHSBackWindow :public CicoHSWindow CicoHSBackWindow(const CicoHSBackWindow&); }; #endif - +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSCmdOpts.cpp b/src/homescreen/CicoHSCmdOpts.cpp new file mode 100644 index 0000000..df6ca41 --- /dev/null +++ b/src/homescreen/CicoHSCmdOpts.cpp @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +/*========================================================================*/ +/** + * @file CicoHSCmdOpts.cpp + * + * @brief This file implementation of CicoHSCmdOpts class + */ +/*========================================================================*/ + +#include +#include + +#include "ico_log.h" +#include "ico_syc_public.h" +#include "CicoHSCmdOpts.h" + +CicoHSCmdOpts* CicoHSCmdOpts::ms_myInstance = NULL; + +//-------------------------------------------------------------------------- +/** + * @brief default constructor + */ +//-------------------------------------------------------------------------- +CicoHSCmdOpts::CicoHSCmdOpts() + : m_loginUser(""), m_historyFilePath(""), m_defaultHistoryFilePath(""), + m_flagPath("") +{ +} + +//-------------------------------------------------------------------------- +/** + * @brief destructor + */ +//-------------------------------------------------------------------------- +CicoHSCmdOpts::~CicoHSCmdOpts() +{ +} + +//-------------------------------------------------------------------------- +/** + * @brief get this class instance + */ +//-------------------------------------------------------------------------- +CicoHSCmdOpts* +CicoHSCmdOpts::getInstance(void) +{ + if (NULL == ms_myInstance) { + ms_myInstance = new CicoHSCmdOpts(); + } + + return ms_myInstance; +} + +//-------------------------------------------------------------------------- +/** + * @brief parse command options + */ +//-------------------------------------------------------------------------- +void +CicoHSCmdOpts::parse(int argc, char *argv[]) +{ + ICO_TRA("CicoHSCmdOpts::parse Enter"); + /* get LOGIN-USER parameter */ + bundle *b = bundle_import_from_argv(argc, argv); // import from argc+argv + const char* valusr = bundle_get_val(b, ICO_SYC_APP_BUNDLE_KEY1); + const char* valpath = bundle_get_val(b, ICO_SYC_APP_BUNDLE_KEY2); + const char* valpathD = bundle_get_val(b, ICO_SYC_APP_BUNDLE_KEY3); + const char* valFlagPath = bundle_get_val(b, ICO_SYC_APP_BUNDLE_KEY4); + if ((NULL != valusr) && (0 != valusr)) { + m_loginUser = valusr; + } + else { + m_loginUser.clear(); + } + + if ((NULL != valpath) && (0 != valpath)) { + m_historyFilePath = valpath; + } + else { + m_historyFilePath.clear(); + } + + if ((NULL != valpathD) && (0 != valpathD)) { + m_defaultHistoryFilePath = valpathD; + } + else { + m_defaultHistoryFilePath.clear(); + } + std::string flagPath; + if ((NULL != valFlagPath) && (0 != valFlagPath)) { + m_flagPath = valFlagPath; + } + else { + flagPath.clear(); + } + ICO_DBG("PARAM=\"%s\", \"%s\", \"%s\", \"%s\"", + m_loginUser.c_str(), m_historyFilePath.c_str(), + m_defaultHistoryFilePath.c_str(), m_flagPath.c_str()); + bundle_free(b); + valusr = valpath = valpathD = valFlagPath = NULL; + ICO_TRA("CicoHSCmdOpts::parse Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief get login user name + * + * @return long user name + */ +//-------------------------------------------------------------------------- +const std::string & +CicoHSCmdOpts::getLoginUser(void) +{ + return m_loginUser; +} + +//-------------------------------------------------------------------------- +/** + * @brief get history file path + * + * @return history file path + */ +//-------------------------------------------------------------------------- +const std::string & +CicoHSCmdOpts::getHistoryFilePath(void) +{ + return m_historyFilePath; +} + +//-------------------------------------------------------------------------- +/** + * @brief get application default history file path + * + * @return default history file path + */ +//-------------------------------------------------------------------------- +const std::string & +CicoHSCmdOpts::getDefaultHistoryFilePath(void) +{ + return m_defaultHistoryFilePath; +} + +//-------------------------------------------------------------------------- +/** + * @brief get application history file flag + * + * @return application history file flag + */ +//-------------------------------------------------------------------------- +const std::string & +CicoHSCmdOpts::getFlagPath(void) +{ + return m_flagPath; +} +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSCmdOpts.h b/src/homescreen/CicoHSCmdOpts.h new file mode 100644 index 0000000..24b5ec0 --- /dev/null +++ b/src/homescreen/CicoHSCmdOpts.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSCmdOpts.h + * + * @brief This file is definition of CicoHSCmdOpts class + */ +//========================================================================== +#ifndef __CICO_HS_CMD_OPTS_H__ +#define __CICO_HS_CMD_OPTS_H__ + +#include + +//========================================================================== +/** + * @brief This class hold command options + */ +//========================================================================== +class CicoHSCmdOpts +{ +public: + // get this class instance + static CicoHSCmdOpts* getInstance(void); + + // perse command options + void parse(int argc, char *argv[]); + + // get login user name + const std::string & getLoginUser(void); + + // get application history file path + const std::string & getHistoryFilePath(void); + + /// get application default history file path + const std::string & getDefaultHistoryFilePath(void); + + /// get application history file flag + const std::string & getFlagPath(void); + +private: + // default constructor + CicoHSCmdOpts(); + + // destructor + ~CicoHSCmdOpts(); + + /// assignment operator + CicoHSCmdOpts& operator=(const CicoHSCmdOpts &object); + + /// copy constructor + CicoHSCmdOpts(const CicoHSCmdOpts &object); + +public: + /// this class instance + static CicoHSCmdOpts* ms_myInstance; + + /// login user name + std::string m_loginUser; + /// application history file path + std::string m_historyFilePath; + /// application default history file path + std::string m_defaultHistoryFilePath; + /// application history file flag + std::string m_flagPath; +}; +#endif // __CICO_HS_CMD_OPTS_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSCommand.cpp b/src/homescreen/CicoHSCommand.cpp new file mode 100644 index 0000000..f16b52b --- /dev/null +++ b/src/homescreen/CicoHSCommand.cpp @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSCommand.cpp + * + * @brief This file is implementation of CicoHSCommand class + */ +//========================================================================== + +#include +#include +#include +#include +#include +#include +#include +using namespace std; +using namespace boost; +using namespace boost::property_tree; + +#include "CicoHSCommand.h" +#include "CicoHSCommandArg.h" +#include +#include "ico_syc_error.h" +#include "ico_syc_msg_cmd_def.h" + +//-------------------------------------------------------------------------- +/** + * @brief default constructor + */ +//-------------------------------------------------------------------------- +CicoHSCommand::CicoHSCommand() + : cmdid(0), appid(""), pid(-1), seq_no(-1), opt(NULL) +{ +} + +//-------------------------------------------------------------------------- +/** + * @brief destructor + */ +//-------------------------------------------------------------------------- +CicoHSCommand::~CicoHSCommand() +{ + delete opt; +} + +//-------------------------------------------------------------------------- +/** + * @brief parse from message, create command + * + * @param [in] message message of interprocess communication + * + * @note + * message format(json format) + * key name of "appid", "command", "pid" is common command propety. + *
+ *  {
+ *    "appid":   (string) application id,
+ *    "command": (int)    command id,
+ *    "pid":     (int)    process id
+ *    ...
+ *    }
+ *  }
+ *  
+ */ +//-------------------------------------------------------------------------- +int +CicoHSCommand::parseMessage(const char *message) +{ +// ICO_TRA("CicoHSCommand::parseMessage Enter(%s)", message); + try { + stringstream jsonString(message); + ptree root; + read_json(jsonString, root); + + this->cmdid = getIntValue(root, MSG_PRMKEY_CMD); + this->appid = getStrValue(root, "source.appid"); + this->pid = getIntValue(root, "source.pid"); + this->seq_no = getIntValue(root, "source.seq_no"); + + switch (this->cmdid) { + case MSG_CMD_APP_START: + case MSG_CMD_APP_STOP: + case MSG_CMD_WIN_CHANGE: + parseAppCtlOpt(root); + break; + default: + break; + } + + // dump log command variables + dump(); + } + catch (std::exception const& e) + { + ICO_WRN("catch exception %s", e.what()); +// ICO_TRA("CicoHSCommand::parseMessage Leave(EINVAL)"); + return ICO_SYC_EINVAL; + } + +// ICO_TRA("CicoHSCommand::parseMessage Leave(EOK)"); + return ICO_SYC_EOK; +} + +//-------------------------------------------------------------------------- +/** + * @brief dump log this class member variables + */ +//-------------------------------------------------------------------------- +void +CicoHSCommand::dump(void) +{ + ICO_INF("Command: cmdid=0x%08X appid=%s pid=%d seq_no=%d", cmdid, appid.c_str(), pid, seq_no); + + if (NULL != this->opt) { +// this->opt->dump(); + } +} + +//-------------------------------------------------------------------------- +/** + * @brief get integer value by key + * + * @param [in] root root object of json object + * @param [in] key Key to get the value + * + * @return integer value on success, INT_MAX on error + */ +//-------------------------------------------------------------------------- +int +CicoHSCommand::getIntValue(const ptree & root, const char* key) +{ + int intValue = -1; + try { + intValue = root.get(key); + } + catch (std::exception const& e) + { + //ICO_WRN("catch exception %s", e.what()); + return intValue; + } + return intValue; +} + +//-------------------------------------------------------------------------- +/** + * @brief get string value by key + * + * @param [in] root root object of json object + * @param [in] key Key to get the value + * + * @return string value on success, empty string on error + */ +//-------------------------------------------------------------------------- +string +CicoHSCommand::getStrValue(const ptree & root, const char* key) +{ + string strValue = ""; + try { + strValue = root.get(key); + } + catch (std::exception const& e) + { + //ICO_WRN("catch exception %s", e.what()); + return strValue; + } + + if (strValue == "null") { + strValue = ""; + } + + return strValue; +} + +//-------------------------------------------------------------------------- +/** + * @brief query whether the object exists + * + * @param [in] root root object of json object + * @param [in] key Key to get the value + * + * @return true on exist, false on not exist + */ +//-------------------------------------------------------------------------- +bool +CicoHSCommand::isExistObject(const ptree & root, const char *key) +{ + try { + (void)root.get_child(key); + } + catch (std::exception const& e) + { + //ICO_WRN("catch exception %s", e.what()); + return false; + } + + return true; +} + +bool +CicoHSCommand::getArgArray(const ptree& pt, std::vector& vArg) +{ + + BOOST_FOREACH (const ptree::value_type& child, pt.get_child("arg")) { + bool chk = false; + const ptree& info = child.second; + string Pappid; + string Pzone; + const char* sAppid = NULL; + const char* sZone = NULL; + int iPid = 0; + int iVisible = 0; + try { + // arg.appid + if (boost::optional appid = info.get_optional("appid")) { + Pappid = appid.get(); + sAppid = Pappid.c_str(); + ICO_DBG("appid : %s ", sAppid); + chk = true; + } + // arg.pid + if (boost::optional pid = info.get_optional("pid")) { + iPid=pid.get(); + ICO_DBG("pid : %d ", iPid); + chk = true; + } + // arg.zone + if (boost::optional zone = info.get_optional("zone")) { + Pzone = zone.get(); + sZone = Pzone.c_str(); + ICO_DBG("zone : %s ", sZone); + chk = true; + } + // arg.visible + if (boost::optional vis = info.get_optional("visible")) { + iVisible = vis.get(); + ICO_DBG("visible : %d ", iVisible); + chk = true; + } + } + catch (std::exception const& e) + { + ICO_WRN("catch exception %s", e.what()); + return false; + } + + if (true == chk) { + vArg.push_back(CicoHSCommandArg(sAppid, sZone, iVisible, iPid)); + } + } + if (0 == vArg.size()){ + return false; + } + return true; +} + +bool +CicoHSCommand::getArg(const ptree& pt, std::vector& vArg) +{ + string Pappid; + string Pzone; + const char* sAppid = NULL; + const char* sZone = NULL; + int iPid = 0; + int iVisible = -1; + + try { + // Data.str + if (boost::optional str1 = pt.get_optional("arg.appid")) { + Pappid = str1.get(); + sAppid = Pappid.c_str(); + ICO_DBG("appid : %s ", sAppid); + } + if (boost::optional str2 = pt.get_optional("arg.zone")) { + Pzone = str2.get(); + sZone = Pzone.c_str(); + ICO_DBG("zone : %s ", sZone); + } + + if (boost::optional pid = pt.get_optional("arg.pid")) { + iPid = pid.get(); + ICO_DBG("pid : %d ", iPid); + } + if (boost::optional visible = pt.get_optional("arg.visible")) { + iVisible = visible.get(); + ICO_DBG("visible : %d ", iVisible); + } + } + catch (std::exception const& e) + { + ICO_WRN("catch exception %s", e.what()); + return false; + } + +// if (((NULL != sAppid) || (0 != iPid)) && ((NULL != sZone) || (-1 != iVisible))) { + if (((NULL != sAppid) || (0 != iPid))) { + vArg.push_back(CicoHSCommandArg(sAppid, sZone, iVisible, iPid)); + return true; + } + return false; +} + +void +CicoHSCommand::parseAppCtlOpt(const ptree & root) +{ + CicoHSCmdAppCtlOpt* options = new CicoHSCmdAppCtlOpt(); + this->opt = options; + + switch (this->cmdid) { + case MSG_CMD_APP_START: + case MSG_CMD_APP_STOP: + ICO_DBG("app_start stop : %d ", this->cmdid); + getArg(root, options->arg); + break; + case MSG_CMD_WIN_CHANGE: + ICO_DBG("win_chg : %d ", this->cmdid); + if (false == getArg(root, options->arg)) { + getArgArray(root, options->arg); + } + break; + default: + break; + } +} + +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSCommand.h b/src/homescreen/CicoHSCommand.h new file mode 100644 index 0000000..dd901f3 --- /dev/null +++ b/src/homescreen/CicoHSCommand.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSCommand.h + * + * @brief This file is definition of CicoHSCommand class + */ +//========================================================================== +#ifndef __CICO_HS_COMMAND_H__ +#define __CICO_HS_COMMAND_H__ + +#include +#include +#include + +#include "CicoHSCommandArg.h" +#include + +//========================================================================== +/** + * @brief command option variables + * This class is abstract class + */ +//========================================================================== +class CicoHSCommandOption +{ +public: + /// default constructor + CicoHSCommandOption() {} + + /// destructor + virtual ~CicoHSCommandOption() {} + + /// dump log this class member variables + virtual void dump(void) {} +}; + +class CicoHSCmdAppCtlOpt : public CicoHSCommandOption +{ +public: + /// default constructor + CicoHSCmdAppCtlOpt() {} + + /// destructor + virtual ~CicoHSCmdAppCtlOpt() {} + +#if 0 + /// dump log this class member variables + void dump(void) + { + ICO_DBG("AppCtlOpt: " + "tgt_appid=%s tgt_pid=%d zone=%s visible=%d", + tgt_appid.c_str(), tgt_pid, zone.c_str(), visible); + } +#endif + + vector arg; //!< appid,pid,zone,visible +}; + +//========================================================================== +/** + * @brief This class holds command information + */ +//========================================================================== +class CicoHSCommand +{ +public: + // default constructor + CicoHSCommand(); + + // destructor + ~CicoHSCommand(); + + // parse from message of process communication + int parseMessage(const char *cmdMessage); + + // dump log this class member variables + void dump(void); + + // get arg + bool getArg(const boost::property_tree:: ptree& pt, std::vector& vArg); + + // get arg array + bool getArgArray(const boost::property_tree:: ptree& pt, std::vector& vArg); + +private: + // get integer value + int getIntValue(const boost::property_tree::ptree & root, + const char* key); + + // get string value + std::string getStrValue(const boost::property_tree::ptree & root, + const char* key); + + // check exist object + bool isExistObject(const boost::property_tree::ptree & root, + const char *key); + + // parse application control options + void parseAppCtlOpt(const boost::property_tree::ptree & root); + +public: + unsigned long cmdid; //!< id of command + std::string appid; //!< id of application + int pid; //!< id of pid + int seq_no; //!< id of sequence number + CicoHSCommandOption *opt; //!< command option instance +}; +#endif // __CICO_HS_COMMAND_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSCommandArg.cpp b/src/homescreen/CicoHSCommandArg.cpp new file mode 100644 index 0000000..3039471 --- /dev/null +++ b/src/homescreen/CicoHSCommandArg.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSCommandArg.cpp + * + * @brief This file is implementation of CicoHSCommandArg class + */ +//========================================================================== + +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +using namespace boost; +using namespace boost::property_tree; + +#include "CicoHSCommandArg.h" +#include +#include "ico_syc_error.h" +#include "ico_syc_msg_cmd_def.h" + +//-------------------------------------------------------------------------- +/** + * @brief default constructor + */ +//-------------------------------------------------------------------------- +CicoHSCommandArg::CicoHSCommandArg() +{ + m_appid = ""; + m_zone = ""; + m_visible = 0; + m_pid = 0; +} + +//-------------------------------------------------------------------------- +/** + * @brief default constructor + */ +//-------------------------------------------------------------------------- +CicoHSCommandArg::CicoHSCommandArg(const CicoHSCommandArg& src) +{ + m_appid = src.m_appid; + m_zone = src.m_zone; + m_visible = src.m_visible; + m_pid = src.m_pid; +} + +//-------------------------------------------------------------------------- +/** + * @brief default constructor + */ +//-------------------------------------------------------------------------- +CicoHSCommandArg::CicoHSCommandArg(const char* appid, + const char* zone, + int visible, + int pid) +{ + if ((NULL != appid) &&(0 != strlen(appid))) { + m_appid = appid; + } + if ((NULL != zone) &&(0 != strlen(zone))) { + m_zone = zone; + } + m_visible = visible; + m_pid = pid; +} + +//-------------------------------------------------------------------------- +/** + * @brief destructor + */ +//-------------------------------------------------------------------------- +CicoHSCommandArg::~CicoHSCommandArg() +{ +} +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSCommandArg.h b/src/homescreen/CicoHSCommandArg.h new file mode 100644 index 0000000..34439bb --- /dev/null +++ b/src/homescreen/CicoHSCommandArg.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSCommandArg.h + * + * @brief This file is definition of CicoHSCommandArg class + */ +//========================================================================== +#ifndef __CICO_HS_COMMAND_ARG_H__ +#define __CICO_HS_COMMAND_ARG_H__ + +#include +#include +#include + +#include + +//========================================================================== +/** + * @brief This class holds command information + */ +//========================================================================== +class CicoHSCommandArg { +public: + // default constructor + CicoHSCommandArg(); + + CicoHSCommandArg(const CicoHSCommandArg& src); + + CicoHSCommandArg(const char* appid, + const char* zone, + int visible, + int pid=0); + // destructor + ~CicoHSCommandArg(); + +public: + std::string m_appid; + std::string m_zone; + int m_visible; + int m_pid; +}; +#endif // __CICO_HS_COMMAND_ARG_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSControlBarTouch.cpp b/src/homescreen/CicoHSControlBarTouch.cpp index a884275..048f710 100644 --- a/src/homescreen/CicoHSControlBarTouch.cpp +++ b/src/homescreen/CicoHSControlBarTouch.cpp @@ -17,6 +17,7 @@ /* static members */ /*============================================================================*/ CicoHSControlBarWindow* CicoHSControlBarTouch::ctl_bar_window; +bool CicoHSControlBarTouch::touch_down; /*============================================================================*/ /* functions */ @@ -34,6 +35,7 @@ void CicoHSControlBarTouch::Initialize(CicoHSControlBarWindow* ctl_bar_window) { CicoHSControlBarTouch::ctl_bar_window = ctl_bar_window; + touch_down = false; } /*--------------------------------------------------------------------------*/ @@ -67,6 +69,7 @@ void CicoHSControlBarTouch::TouchDownControlBar(void *data, Evas *evas, Evas_Object *obj, void *event_info) { + touch_down = true; } /*--------------------------------------------------------------------------*/ @@ -85,16 +88,23 @@ void CicoHSControlBarTouch::TouchUpControlBar(void *data, Evas *evas, Evas_Object *obj, void *event_info) { -// Evas_Event_Mouse_Up *info; -// int sub = 0; - ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar start"); - if(data == NULL) { + ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar Enter(down=%d)", + (int)touch_down); + + if (touch_down == false) { + // multi touch up, skiep + ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar not down, Skip"); + } + touch_down = false; + + if (data == NULL) { + ICO_PRF("TOUCH_EVENT Ctrl-Bar Down->Up app=(NIL)"); ctl_bar_window->TouchHome(); } else { - ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar appid = [%s]", - (const char *)data); - ctl_bar_window->TouchShortcut((const char *)data); + ICO_PRF("TOUCH_EVENT Ctrl-Bar Down->Up app=%s", (const char *)data); + ctl_bar_window->TouchShortcut((const char *)data); } - ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar end"); + ICO_DBG("CicoHSControlBarTouch::TouchUpControlBar Leave"); } +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSControlBarTouch.h b/src/homescreen/CicoHSControlBarTouch.h index 6ecd9b9..8a2884c 100644 --- a/src/homescreen/CicoHSControlBarTouch.h +++ b/src/homescreen/CicoHSControlBarTouch.h @@ -25,15 +25,16 @@ class CicoHSControlBarTouch public: static void Initialize(CicoHSControlBarWindow* ctl_bar_window); static void Finalize(void); - static void TouchDownControlBar(void *data, Evas *evas, Evas_Object *obj, void *event_info); - static void TouchUpControlBar(void *data, Evas *evas, Evas_Object *obj, void *event_info); + static void TouchDownControlBar(void *data, Evas *evas, Evas_Object *obj, void *event_info); + static void TouchUpControlBar(void *data, Evas *evas, Evas_Object *obj, void *event_info); private: static CicoHSControlBarWindow* ctl_bar_window; + static bool touch_down; + protected: CicoHSControlBarTouch operator=(const CicoHSControlBarTouch&); CicoHSControlBarTouch(const CicoHSControlBarTouch&); }; - #endif - +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSControlBarWindow.cpp b/src/homescreen/CicoHSControlBarWindow.cpp index d372e12..127e8f0 100644 --- a/src/homescreen/CicoHSControlBarWindow.cpp +++ b/src/homescreen/CicoHSControlBarWindow.cpp @@ -13,8 +13,8 @@ */ #include "CicoHSControlBarWindow.h" #include "CicoHSControlBarTouch.h" -#include "CicoHomeScreenConfig.h" -#include "CicoHomeScreenResourceConfig.h" +#include "CicoGKeyFileConfig.h" +#include "CicoResourceConfig.h" #include "CicoHomeScreen.h" #include "CicoHSSystemState.h" #include "CicoSound.h" @@ -35,10 +35,9 @@ CicoHSControlBarWindow::CicoHSControlBarWindow(void) { evas = NULL; - CicoHomeScreenResourceConfig::GetImagePath(img_dir_path, - ICO_HS_MAX_PATH_BUFF_LEN); + CicoResourceConfig::GetImagePath(img_dir_path, ICO_HS_MAX_PATH_BUFF_LEN); - CicoHomeScreenConfig config; + CicoGKeyFileConfig config; config.Initialize(ICO_HOMESCREEN_CONFIG_FILE); const char *value = config.ConfigGetString("switchzone", "keyname", "m"); if (strlen(value) > (sizeof(changeZoneKeyName) - 1)) { @@ -242,19 +241,19 @@ CicoHSControlBarWindow::CreateControlBarWindow(int pos_x, int pos_y, void CicoHSControlBarWindow::AddShortcut(Evas *evas, int width) { - ICO_DBG("CicoHSControlBarWindow::AddShortcut Enter"); + ICO_TRA("CicoHSControlBarWindow::AddShortcut Enter"); int escPosX; int x; int tmp_space; int s_cnt = 0; const char *tmp_appid; - CicoSCLifeCycleController *life_cycle_controller; + CicoHSLifeCycleController *life_cycle_controller; /* menu button x position */ escPosX = (width / 2) - (ICO_HS_CONTROL_BAR_MENU_BTN_WIDTH / 2); - life_cycle_controller = CicoSCLifeCycleController::getInstance(); + life_cycle_controller = CicoHSLifeCycleController::getInstance(); tmp_space = (width - (ICO_HS_CONTROL_BAR_MENU_BTN_WIDTH * ICO_HS_CONTROL_BAR_BTN_MAX_NUM)) @@ -281,7 +280,7 @@ CicoHSControlBarWindow::AddShortcut(Evas *evas, int width) } /* get APP information */ - std::vector aillist = + std::vector aillist = life_cycle_controller->getAilList(); /* add shortcut object */ @@ -308,7 +307,7 @@ CicoHSControlBarWindow::AddShortcut(Evas *evas, int width) s_cnt++; } - ICO_DBG("CicoHSControlBarWindow::AddShortcut Leave"); + ICO_TRA("CicoHSControlBarWindow::AddShortcut Leave"); return; } @@ -364,7 +363,7 @@ CicoHSControlBarWindow::TouchHome(void) void CicoHSControlBarWindow::SetNightMode(void) { - ICO_DBG("CicoHSControlBarWindow::SetNightMode Enter"); + ICO_TRA("CicoHSControlBarWindow::SetNightMode Enter"); bool state = CicoHSSystemState::getInstance()->getNightMode(); @@ -400,7 +399,7 @@ CicoHSControlBarWindow::SetNightMode(void) evas_object_image_file_set(menu_btn, img_path, NULL); } - ICO_DBG("CicoHSControlBarWindow::SetNightMode Leave"); + ICO_TRA("CicoHSControlBarWindow::SetNightMode Leave"); } /*--------------------------------------------------------------------------*/ @@ -415,7 +414,7 @@ CicoHSControlBarWindow::SetNightMode(void) void CicoHSControlBarWindow::SetRegulation(void) { - ICO_DBG("CicoHSControlBarWindow::SetRegulation Enter"); + ICO_TRA("CicoHSControlBarWindow::SetRegulation Enter"); char img_path[ICO_HS_MAX_PATH_BUFF_LEN]; if (true == CicoHSSystemState::getInstance()->getNightMode()) { @@ -446,7 +445,7 @@ CicoHSControlBarWindow::SetRegulation(void) } evas_object_image_file_set(menu_btn, img_path, NULL); - ICO_DBG("CicoHSControlBarWindow::SetRegulation Leave"); + ICO_TRA("CicoHSControlBarWindow::SetRegulation Leave"); } /*--------------------------------------------------------------------------*/ @@ -505,7 +504,7 @@ CicoHSControlBarWindow::GetAppId(void) void CicoHSControlBarWindow::TouchShortcut(const char *appid) { - ICO_DBG("CicoHSControlBarWindow::TouchShortcut Enter"); + ICO_TRA("CicoHSControlBarWindow::TouchShortcut Enter"); ActivationUpdate(); CicoSound::GetInstance()->PlayOperationSound(); @@ -515,7 +514,7 @@ CicoHSControlBarWindow::TouchShortcut(const char *appid) CicoHomeScreen::ExecuteApp(appid); } - ICO_DBG("CicoHSControlBarWindow::TouchShortcut Leave"); + ICO_TRA("CicoHSControlBarWindow::TouchShortcut Leave"); } //-------------------------------------------------------------------------- @@ -537,7 +536,7 @@ CicoHSControlBarWindow::onKeyDown(void *data, Evas *evas, CicoSound::GetInstance()->PlayOperationSound(); - ICO_DBG("onKeyDown: keyname=%s, key=%d", + ICO_PRF("TOUCH_EVENT Key Down keyname=%s, key=%d", evinfo->keyname, (char)*evinfo->key); if (0 == strcmp(evinfo->keyname, changeZoneKeyName)) { @@ -586,5 +585,4 @@ CicoHSControlBarWindow::ActivationUpdate(void) { return CicoHomeScreen::ActivationUpdate(); } - // vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSControlBarWindow.h b/src/homescreen/CicoHSControlBarWindow.h index 42fcc5d..7e22a0d 100644 --- a/src/homescreen/CicoHSControlBarWindow.h +++ b/src/homescreen/CicoHSControlBarWindow.h @@ -26,16 +26,16 @@ #include #include "CicoHomeScreenCommon.h" -#include "CicoHomeScreenConfig.h" +#include "CicoGKeyFileConfig.h" #include "CicoHSWindow.h" -#define ICO_HS_CONTROL_BAR_MENU_BTN_START_POS_Y 10 -#define ICO_HS_CONTROL_BAR_MENU_BTN_WIDTH 108 -#define ICO_HS_CONTROL_BAR_MENU_BTN_HEIGHT 108 +#define ICO_HS_CONTROL_BAR_MENU_BTN_START_POS_Y 14 +#define ICO_HS_CONTROL_BAR_MENU_BTN_WIDTH 100 +#define ICO_HS_CONTROL_BAR_MENU_BTN_HEIGHT 100 -#define ICO_HS_CONTROL_BAR_SHORTCUT_BTN_START_POS_Y 10 -#define ICO_HS_CONTROL_BAR_SHORTCUT_BTN_WIDTH 108 -#define ICO_HS_CONTROL_BAR_SHORTCUT_BTN_HEIGHT 108 +#define ICO_HS_CONTROL_BAR_SHORTCUT_BTN_START_POS_Y 14 +#define ICO_HS_CONTROL_BAR_SHORTCUT_BTN_WIDTH 100 +#define ICO_HS_CONTROL_BAR_SHORTCUT_BTN_HEIGHT 100 #define ICO_HS_CONTROL_BAR_SHORTCUT_MAX_NUM 4 #define ICO_HS_CONTROL_BAR_BTN_MAX_NUM (ICO_HS_CONTROL_BAR_SHORTCUT_MAX_NUM + 1) @@ -51,7 +51,7 @@ class CicoHSControlBarWindow :public CicoHSWindow void Finalize(void); int CreateControlBarWindow(int pos_x,int pos_y,int width,int height); void FreeControlBarWindow(void); - + void TouchHome(void); void SetWindowID(const char *appid,int surface); diff --git a/src/homescreen/CicoHSEFLApp.cpp b/src/homescreen/CicoHSEFLApp.cpp new file mode 100644 index 0000000..120f517 --- /dev/null +++ b/src/homescreen/CicoHSEFLApp.cpp @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSEFLApp.cpp + * + * @brief This file is implimention of CicoHSEFLApp class + */ +//========================================================================== + +#include +#include +#include + +#include "CicoHSEFLApp.h" +#include "CicoHomeScreen.h" +#include "CicoHSWindow.h" +#include "ico_log.h" + +//-------------------------------------------------------------------------- +/** + * @brief default constructor + */ +//-------------------------------------------------------------------------- +CicoHSEFLApp::CicoHSEFLApp() +{ +// ICO_TRA("CicoHSEFLApp::CicoHSEFLApp Enter"); +// ICO_TRA("CicoHSEFLApp::CicoHSEFLApp Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief destructor + */ +//-------------------------------------------------------------------------- +CicoHSEFLApp::~CicoHSEFLApp() +{ +// ICO_TRA("CicoHSEFLApp::~CicoHSEFLApp Enter"); +// ICO_TRA("CicoHSEFLApp::~CicoHSEFLApp Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on create + * + * @param [in] user_data The user data passed from the callback + * registration function + * + * @return true on success, false on error + */ +//-------------------------------------------------------------------------- +bool +CicoHSEFLApp::onCreate(void *user_data) +{ + ICO_TRA("CicoHSEFLApp::onCreate Enter"); + + try { + // load system config + CicoSystemConfig::getInstance()->load( + ICO_HS_LIFECYCLE_CONTROLLER_SETTING_PATH); + + // start homescreen + m_homescreen = new CicoHomeScreen(); + int ret = m_homescreen->StartHomeScreen(ICO_ORIENTATION_VERTICAL); + if(ret != ICO_OK){ + ICO_TRA("CicoHSEFLApp::onCreate Leave(false)"); + return false; + } + } + catch (const std::exception& e) { + std::cerr << e.what() << std::endl; + ICO_ERR("catch exception %s", e.what()); + ICO_TRA("CicoHSEFLApp::onCreate Leave(false)"); + return false; + } + catch (const std::string& str) { + std::cerr << str << std::endl; + ICO_ERR("catch exception %s", str.c_str()); + ICO_TRA("CicoHSEFLApp::onCreate Leave(false)"); + return false; + } + catch (...) { + ICO_ERR("catch exception unknown"); + ICO_TRA("CicoHSEFLApp::onCreate Leave(false)"); + return false; + } + + ICO_TRA("CicoHSEFLApp::onCreate Leave(true)"); + return true; +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on terminate + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoHSEFLApp::onTerminate(void *user_data) +{ + ICO_TRA("CicoHSEFLApp::onTerminate Enter"); + + m_homescreen->Finalize(); + delete m_homescreen; + + ICO_TRA("CicoHSEFLApp::onTerminate Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on pause + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoHSEFLApp::onPause(void *user_data) +{ + ICO_TRA("CicoHSEFLApp::onPause Enter"); + ICO_TRA("CicoHSEFLApp::onPause Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on resume + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoHSEFLApp::onResume(void *user_data) +{ + ICO_TRA("CicoHSEFLApp::onResume Enter"); + ICO_TRA("CicoHSEFLApp::onResume Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief callback function on service + * + * @param [in] service The handle to the service + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- +void +CicoHSEFLApp::onService(service_h service, void *user_data) +{ + ICO_TRA("CicoHSEFLApp::onService Enter"); + ICO_TRA("CicoHSEFLApp::onService Leave"); +} +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSEFLApp.h b/src/homescreen/CicoHSEFLApp.h new file mode 100644 index 0000000..f810a36 --- /dev/null +++ b/src/homescreen/CicoHSEFLApp.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSEFLApp.h + * + * @brief This file is definition of CicoHSEFLApp class + */ +//========================================================================== +#ifndef __CICO_HS_EFL_APP_H__ +#define __CICO_HS_EFL_APP_H__ + +#include "CicoEFLApp.h" + +//========================================================================== +// Forward declaration +//========================================================================== +class CicoHomeScreen; + +//========================================================================== +/** + * @brief ELF Application functions for HomeScreen + */ +//========================================================================== +class CicoHSEFLApp : public CicoEFLApp { +public: + // default constructor + CicoHSEFLApp(); + + // destructor + virtual ~CicoHSEFLApp(); + + // callback function on create + virtual bool onCreate(void *user_data); + + // callback function on terminate + virtual void onTerminate(void *user_data); + + // callback function on pause + virtual void onPause(void *user_data); + + // callback function on resume + virtual void onResume(void *user_data); + + // callback function on service + virtual void onService(service_h service, void *user_data); + +protected: + // assignment operator + CicoHSEFLApp& operator=(const CicoHSEFLApp &object); + + // copy constructor + CicoHSEFLApp(const CicoHSEFLApp &object); + +private: + // CicoHomeScreen instance + CicoHomeScreen* m_homescreen; +}; +#endif // __CICO_HS_EFL_APP_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoSCLifeCycleController.cpp b/src/homescreen/CicoHSLifeCycleController.cpp similarity index 84% rename from src/homescreen/CicoSCLifeCycleController.cpp rename to src/homescreen/CicoHSLifeCycleController.cpp index 353eabc..a4b0827 100644 --- a/src/homescreen/CicoSCLifeCycleController.cpp +++ b/src/homescreen/CicoHSLifeCycleController.cpp @@ -17,12 +17,12 @@ #include #include "ico_syc_error.h" -#include "CicoLog.h" -#include "CicoSCAulItems.h" -#include "CicoSCAilItems.h" -#include "CicoSCLifeCycleController.h" -#include "CicoSCConf.h" -#include "CicoSCSystemConfig.h" +#include +#include "CicoAulItems.h" +#include "CicoAilItems.h" +#include "CicoHSLifeCycleController.h" +#include "CicoConf.h" +#include "CicoSystemConfig.h" #include "Cico_aul_listen_app.h" using namespace std; @@ -45,7 +45,7 @@ using namespace std; #define ICO_SYC_ENOSYS -38 /* System error */ -CicoSCLifeCycleController* CicoSCLifeCycleController::ms_myInstance = NULL; +CicoHSLifeCycleController* CicoHSLifeCycleController::ms_myInstance = NULL; const char* DAilTypeFilPrm_Menu="menu"; const char* DAilTypeFilPrm_App="Application"; @@ -69,7 +69,7 @@ static int CSCLCCpkgmgr_handler(int req_id, const char *pkg_type, const char *pkg_name, const char *key, const char *val, const void *pmsg, void *data) { - CicoSCLifeCycleController* x = (CicoSCLifeCycleController*)data; + CicoHSLifeCycleController* x = (CicoHSLifeCycleController*)data; return CSCLCCpkgmgr_handlerX(req_id, pkg_type, pkg_name, key, val, pmsg, x); } @@ -84,7 +84,7 @@ static int CSCLCCpkgmgr_handler(int req_id, const char *pkg_type, static ail_cb_ret_e CSCLCCail_list_appinfo_cb(const ail_appinfo_h appinfo, void *data) { - CicoSCLifeCycleController* x = (CicoSCLifeCycleController*)data; + CicoHSLifeCycleController* x = (CicoHSLifeCycleController*)data; return CSCLCCail_list_appinfo_cbX(appinfo, x); } @@ -95,7 +95,7 @@ static ail_cb_ret_e CSCLCCail_list_appinfo_cb(const ail_appinfo_h appinfo, */ static int CSCLCCapp_launch_handler(int pid, void *data) { - CicoSCLifeCycleController* x = (CicoSCLifeCycleController*)data; + CicoHSLifeCycleController* x = (CicoHSLifeCycleController*)data; return CSCLCCapp_launch_handlerX(pid, x); } @@ -106,7 +106,7 @@ static int CSCLCCapp_launch_handler(int pid, void *data) */ static int CSCLCCapp_dead_handler(int pid, void *data) { - CicoSCLifeCycleController* x = (CicoSCLifeCycleController*)data; + CicoHSLifeCycleController* x = (CicoHSLifeCycleController*)data; return CSCLCCapp_dead_handlerX(pid, x); } @@ -148,7 +148,7 @@ int Xaul_app_get_appid_bypid(int pid, char *appid, int len) /** * @brief contractor */ -CicoSCLifeCycleController::CicoSCLifeCycleController() +CicoHSLifeCycleController::CicoHSLifeCycleController() { m_gconf = (GKeyFile*)NULL; m_pc = (pkgmgr_client*)NULL; @@ -160,16 +160,16 @@ CicoSCLifeCycleController::CicoSCLifeCycleController() /** * @brief destructor */ -CicoSCLifeCycleController::~CicoSCLifeCycleController() +CicoHSLifeCycleController::~CicoHSLifeCycleController() { } -CicoSCLifeCycleController* -CicoSCLifeCycleController::getInstance(void) +CicoHSLifeCycleController* +CicoHSLifeCycleController::getInstance(void) { if (NULL == ms_myInstance) { - ms_myInstance = new CicoSCLifeCycleController(); + ms_myInstance = new CicoHSLifeCycleController(); } return ms_myInstance; } @@ -183,20 +183,21 @@ CicoSCLifeCycleController::getInstance(void) * @retval ICO_SYC_EBUSY error(already launch) * @retval ICO_SYC_EPERM error(no authority) */ -int CicoSCLifeCycleController::launch(const char* appid) +int CicoHSLifeCycleController::launch(const char* appid) { ICO_TRA("start %s", appid); // appid check AIL table exist if (NULL == findAIL(appid)) { - ICO_TRA("not find"); + ICO_TRA("end fail(not find)"); return ICO_SYC_ENOSYS; } + ICO_PRF("CHG_APP_STA 2.request app=%s", appid); int r = aul_launch_app(appid, NULL); if (0 > r) { - ICO_TRA("aul_launch_app NG %d", r); + ICO_TRA("end fail(%d)", r); return ICO_SYC_ENOSYS; } - ICO_TRA("launch success"); + ICO_TRA("end success(%d)", r); return ICO_SYC_EOK; } @@ -209,7 +210,7 @@ int CicoSCLifeCycleController::launch(const char* appid) * @retval ICO_SYC_EBUSY error(already launch) * @retval ICO_SYC_EPERM error(no authority) */ -int CicoSCLifeCycleController::launch(const std::string& appid) +int CicoHSLifeCycleController::launch(const std::string& appid) { return launch((const char*)appid.c_str()); } @@ -223,9 +224,9 @@ int CicoSCLifeCycleController::launch(const std::string& appid) * @retval ICO_SYC_EBUSY error(already launch) * @retval ICO_SYC_EPERM error(no authority) */ -int CicoSCLifeCycleController::terminate(const char* appid) +int CicoHSLifeCycleController::terminate(const char* appid) { - ICO_TRA("CicoSCLifeCycleController::terminate %s", appid); + ICO_TRA("CicoHSLifeCycleController::terminate %s", appid); int r = ICO_SYC_EOK; vector pids; if (true == getPIDs(appid, pids)) { @@ -254,7 +255,7 @@ int CicoSCLifeCycleController::terminate(const char* appid) * @retval ICO_SYC_EBUSY error(already launch) * @retval ICO_SYC_EPERM error(no authority) */ -int CicoSCLifeCycleController::terminate(const std::string& appid) +int CicoHSLifeCycleController::terminate(const std::string& appid) { return terminate((const char*)appid.c_str()); } @@ -268,10 +269,10 @@ int CicoSCLifeCycleController::terminate(const std::string& appid) * @retval ICO_SYC_EBUSY error(already launch) * @retval ICO_SYC_EPERM error(no authority) */ -int CicoSCLifeCycleController::terminate(int pid) +int CicoHSLifeCycleController::terminate(int pid) { - ICO_TRA("CicoSCLifeCycleController::terminate %d", pid); - const CicoSCAulItems* t = findAUL(pid); + ICO_TRA("CicoHSLifeCycleController::terminate %d", pid); + const CicoAulItems* t = findAUL(pid); if ((NULL == t) || (0 == t)) { ICO_TRA("not find"); return ICO_SYC_EPERM; @@ -285,9 +286,9 @@ int CicoSCLifeCycleController::terminate(int pid) * @retval ICO_SYC_EOK success * @retval ICO_SYC_ENOSYS error */ -int CicoSCLifeCycleController::terminateR(int pid) +int CicoHSLifeCycleController::terminateR(int pid) { - ICO_TRA("CicoSCLifeCycleController::terminateR %d", pid); + ICO_TRA("CicoHSLifeCycleController::terminateR %d", pid); int r = aul_terminate_pid(pid); if (r < 0) { ICO_DBG("terminate error pid:%d, r:%d", pid, r); @@ -305,7 +306,7 @@ int CicoSCLifeCycleController::terminateR(int pid) * @retval ICO_SYC_EBUSY error(already launch) * @retval ICO_SYC_EPERM error(no authority) */ -int CicoSCLifeCycleController::suspend(const char* appid) +int CicoHSLifeCycleController::suspend(const char* appid) { int r = ICO_SYC_EOK; vector pids; @@ -335,7 +336,7 @@ int CicoSCLifeCycleController::suspend(const char* appid) * @retval ICO_SYC_EBUSY error(already launch) * @retval ICO_SYC_EPERM error(no authority) */ -int CicoSCLifeCycleController::suspend(const std::string& appid) +int CicoHSLifeCycleController::suspend(const std::string& appid) { return suspend((const char*)appid.c_str()); } @@ -349,7 +350,7 @@ int CicoSCLifeCycleController::suspend(const std::string& appid) * @retval ICO_SYC_EBUSY error(already launch) * @retval ICO_SYC_EPERM error(no authority) */ -int CicoSCLifeCycleController::suspend(int pid) +int CicoHSLifeCycleController::suspend(int pid) { // TODO mk_k // TODO mk_k @@ -363,11 +364,11 @@ int CicoSCLifeCycleController::suspend(int pid) * @retval true is running * @retval false not running */ -bool CicoSCLifeCycleController::isRunning(const char* appid) +bool CicoHSLifeCycleController::isRunning(const char* appid) { bool r = false; #if 0 // TODO mk_k - vector::iterator it = m_aul.begin(); + vector::iterator it = m_aul.begin(); while (it != m_aul.end()) { it->update_appid(); ICO_DBG("%s == %s", it->m_appid.c_str(), appid); @@ -388,7 +389,7 @@ bool CicoSCLifeCycleController::isRunning(const char* appid) } } #endif - ICO_TRA("CicoSCLifeCycleController::isRunning %s=%s", appid, r ? "true" : "false"); + ICO_TRA("CicoHSLifeCycleController::isRunning %s=%s", appid, r ? "true" : "false"); return r; } @@ -399,7 +400,7 @@ bool CicoSCLifeCycleController::isRunning(const char* appid) * @retval true is running * @retval false not running */ -bool CicoSCLifeCycleController::isRunning(const std::string& appid) +bool CicoHSLifeCycleController::isRunning(const std::string& appid) { return isRunning((const char*)appid.c_str()); } @@ -407,13 +408,13 @@ bool CicoSCLifeCycleController::isRunning(const std::string& appid) /** * @brief find ail data * @param appid find key - * @return CicoSCAilItems class pointer + * @return CicoAilItems class pointer * @retval NULL is not find */ -const CicoSCAilItems* CicoSCLifeCycleController::findAIL(const char* appid) const +const CicoAilItems* CicoHSLifeCycleController::findAIL(const char* appid) const { ICO_TRA("start"); - const CicoSCAilItems* r = NULL; + const CicoAilItems* r = NULL; int sz = m_ail.size(); for (int i = 0; i < sz; i++) { if (0 == strcasecmp(m_ail[i].m_appid.c_str(), appid)) { @@ -428,10 +429,10 @@ const CicoSCAilItems* CicoSCLifeCycleController::findAIL(const char* appid) cons /** * @brief find ail data * @param appid find key - * @return CicoSCAilItems class pointer + * @return CicoAilItems class pointer * @retval NULL is not find */ -const CicoSCAilItems* CicoSCLifeCycleController::findAIL(const std::string& appid) const +const CicoAilItems* CicoHSLifeCycleController::findAIL(const std::string& appid) const { ICO_TRA("call findAIL(const chr*)"); return findAIL((const char*)appid.c_str()); @@ -442,12 +443,12 @@ const CicoSCAilItems* CicoSCLifeCycleController::findAIL(const std::string& appi * @param appid target application appid * @return pid */ -bool CicoSCLifeCycleController::getPIDs(const char* appid, std::vector& pids) const +bool CicoHSLifeCycleController::getPIDs(const char* appid, std::vector& pids) const { ICO_TRA("start %s", appid); bool r = false; #if 0 // TODO mk_k - vector::iterator it; + vector::iterator it; for (it = m_aul.begin(); it != m_aul.end(); ++it) { it->update_appid(); if (0 == strcasecmp(it->m_appid.c_str(), appid)) { @@ -458,7 +459,7 @@ bool CicoSCLifeCycleController::getPIDs(const char* appid, std::vector& pid #else int sz = m_aul.size(); for (int i = 0; i < sz; i++) { - CicoSCAulItems* t = (CicoSCAulItems*)m_aul[i].p(); + CicoAulItems* t = (CicoAulItems*)m_aul[i].p(); t->update_appid(); if (0 == strcasecmp(t->m_appid.c_str(), appid)) { pids.push_back(t->m_pid); @@ -475,7 +476,7 @@ bool CicoSCLifeCycleController::getPIDs(const char* appid, std::vector& pid * @param appid target application appid * @return pid */ -bool CicoSCLifeCycleController::getPIDs(std::string& appid, std::vector& pids) const +bool CicoHSLifeCycleController::getPIDs(std::string& appid, std::vector& pids) const { return getPIDs((const char*)appid.c_str(), pids); } @@ -485,13 +486,13 @@ bool CicoSCLifeCycleController::getPIDs(std::string& appid, std::vector& pi * @param appid target application appid * @return pid */ -const CicoSCAulItems* CicoSCLifeCycleController::findAUL(int pid) +const CicoAulItems* CicoHSLifeCycleController::findAUL(int pid) { ICO_TRA("start %d", pid); - const CicoSCAulItems* r = NULL; + const CicoAulItems* r = NULL; int sz = m_aul.size(); for (int i = 0; i < sz; i++) { - CicoSCAulItems* t = (CicoSCAulItems*)m_aul[i].p(); + CicoAulItems* t = (CicoAulItems*)m_aul[i].p(); if (t->m_pid == pid) { t->update_appid(); r = t; @@ -507,7 +508,7 @@ const CicoSCAulItems* CicoSCLifeCycleController::findAUL(int pid) /** * @brief ail information data initialization */ -void CicoSCLifeCycleController::initAIL() +void CicoHSLifeCycleController::initAIL() { ICO_TRA("start %x", m_pc); createAilItems(); @@ -533,7 +534,7 @@ void CicoSCLifeCycleController::initAIL() */ int CSCLCCpkgmgr_handlerX(int req_id, const char *pkg_type, const char *pkg_name, const char *key, const char *val, const void *pmsg, - CicoSCLifeCycleController* x) + CicoHSLifeCycleController* x) { // TODO mk_k ICO_TRA("pkgmgr t:%s, n:%s, k:%s, v:%s, m:%s",pkg_type, pkg_name, key, @@ -555,9 +556,9 @@ int CSCLCCpkgmgr_handlerX(int req_id, const char *pkg_type, const char *pkg_name /** * @brief AIL list renew */ -void CicoSCLifeCycleController::renewAIL() +void CicoHSLifeCycleController::renewAIL() { - vector old = m_ail; + vector old = m_ail; m_ail.clear(); int cnt =0; while (false == createAilItems()) { @@ -577,8 +578,8 @@ void CicoSCLifeCycleController::renewAIL() vector add_appid; vector remove_appid; - vector::iterator it_n; - vector::iterator it_o; + vector::iterator it_n; + vector::iterator it_o; for(it_n = m_aul.begin(); it_n != m_aul.end(); ++it_n) { bool bingo = false; for(it_o = old.begin(); it_o != old.end(); ++it_o) { @@ -617,13 +618,13 @@ void CicoSCLifeCycleController::renewAIL() /** * @brief ail_filter_list_appinfo_foreach callback function * @param appinfo appinfo_h the appinfo's handle - * @param x CicoSCLifeCycleController class pointer + * @param x CicoHSLifeCycleController class pointer * @retval AIL_CB_RET_CONTINUE return if you continue iteration * @retval AIL_CB_RET_CANCEL return if you cancel iteration * */ ail_cb_ret_e CSCLCCail_list_appinfo_cbX(const ail_appinfo_h appinfo, - CicoSCLifeCycleController* x) + CicoHSLifeCycleController* x) { ICO_TRA("start"); if ((NULL == x) || (0 == x)) { @@ -700,14 +701,14 @@ ail_cb_ret_e CSCLCCail_list_appinfo_cbX(const ail_appinfo_h appinfo, * @retval true success * @retval false fail create */ -bool CicoSCLifeCycleController::createAilItems() +bool CicoHSLifeCycleController::createAilItems() { ICO_TRA("start"); m_ail.clear(); // clear items if (NULL == m_gconf) { m_gconf = g_key_file_new(); GString* gsfp = g_string_new("xx"); - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); + CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance(); g_string_printf(gsfp, "%s/%s", CSCSC->getDefaultConf()->confdir.c_str(), ICO_SYC_CONFIG_APPATTR); GError *gerr = NULL; @@ -773,14 +774,14 @@ bool CicoSCLifeCycleController::createAilItems() * @retval true success added item * @retval false fail added item */ -bool CicoSCLifeCycleController::addAIL(const char* sPkg, const char* sIco, +bool CicoHSLifeCycleController::addAIL(const char* sPkg, const char* sIco, const char* sNm, const char* sCtg, const char* sTyp, const char* sExe, bool bndsp) { string category; getCategory(sPkg, sNm, sCtg, category); - CicoSCAilItems CSCAI(sPkg, sIco, sNm, sCtg, sTyp, sExe, category, bndsp); + CicoAilItems CSCAI(sPkg, sIco, sNm, sCtg, sTyp, sExe, category, bndsp); m_ail.push_back(CSCAI); return true; } @@ -792,7 +793,7 @@ bool CicoSCLifeCycleController::addAIL(const char* sPkg, const char* sIco, * @param sCtg ail categories (get key) * @param category read config file category string define */ -void CicoSCLifeCycleController::getCategory(const char* sPkg, const char* sNm, +void CicoHSLifeCycleController::getCategory(const char* sPkg, const char* sNm, const char* sCtg, std::string& category) { @@ -859,7 +860,7 @@ void CicoSCLifeCycleController::getCategory(const char* sPkg, const char* sNm, /** * @brief aul information data initialization */ -void CicoSCLifeCycleController::initAUL() +void CicoHSLifeCycleController::initAUL() { ICO_TRA("start"); aul_listen_app_launch_signal_add(CSCLCCapp_launch_handler, (void*)this); @@ -870,14 +871,14 @@ void CicoSCLifeCycleController::initAUL() /** * @brief */ -void CicoSCLifeCycleController::enterAUL(const char* appid, int pid, +void CicoHSLifeCycleController::enterAUL(const char* appid, int pid, const CicoSCWindow* obj, int aulstt) { ICO_TRA("start"); bool bPushBack = true; int sz = m_aul.size(); for (int i = 0; i < sz; i++) { - CicoSCAulItems* t = (CicoSCAulItems*)m_aul[i].p(); + CicoAulItems* t = (CicoAulItems*)m_aul[i].p(); if (t->m_pid == pid) { bPushBack = false; // push_back flag off if (NULL == obj) { @@ -895,7 +896,12 @@ void CicoSCLifeCycleController::enterAUL(const char* appid, int pid, if (true == bPushBack) { // push back flag on? // AUL list Unregistered ICO_DBG("push_back(AUL(%s, %d, %d, %x))", appid, pid, aulstt, obj); - m_aul.push_back(CicoSCAulItems(appid, pid, aulstt, obj)); + int ctgry = DINITm_categoryID; + const CicoAilItems* ailObj = findAIL(appid); + if ((NULL != ailObj) && (0 != ailObj)) { + ctgry = ailObj->m_categoryID; + } + m_aul.push_back(CicoAulItems(appid, pid, ctgry, aulstt, obj)); } ICO_TRA("end"); } @@ -903,11 +909,11 @@ void CicoSCLifeCycleController::enterAUL(const char* appid, int pid, /** * @brief */ -bool CicoSCLifeCycleController::removeAUL(int pid) +bool CicoHSLifeCycleController::removeAUL(int pid) { ICO_TRA("start %d", pid); bool r = false; - vector::iterator it; + vector::iterator it; for(it = m_aul.begin(); it != m_aul.end(); ++it) { if (pid == it->m_pid) { ICO_DBG("erase appid=%s", it->m_appid.c_str()); @@ -922,21 +928,21 @@ bool CicoSCLifeCycleController::removeAUL(int pid) /** * @brief - * @param x CicoSCLifeCycleController class pointer + * @param x CicoHSLifeCycleController class pointer */ -int CSCLCCapp_launch_handlerX(int pid, CicoSCLifeCycleController* x) +int CSCLCCapp_launch_handlerX(int pid, CicoHSLifeCycleController* x) { ICO_TRA("start %d, %x", pid, x); if ((NULL == x) || (0 == x)) { - ICO_TRA("end user data is NULL"); + ICO_TRA("end fail(user data is NULL)"); return -1; } char appid[255]; memset(appid, 0, sizeof(appid)); int iR = Xaul_app_get_appid_bypid(pid, appid, sizeof(appid)); - ICO_DBG("%d=aul_app_get_appid_bypid %d , %s", iR, pid, appid); + ICO_PRF("CHG_APP_STA notice app=%s, pid=%d, rval=%d", appid, pid, iR); x->enterAUL(appid, pid, NULL, iR); - ICO_TRA("end %s %d", appid, pid); + ICO_TRA("end success(%d, %s)", pid, appid); return 0; } @@ -944,9 +950,9 @@ int CSCLCCapp_launch_handlerX(int pid, CicoSCLifeCycleController* x) * @brief applications die. callback function * @param pid * @param data user data - * @param x CicoSCLifeCycleController class pointer + * @param x CicoHSLifeCycleController class pointer */ -int CSCLCCapp_dead_handlerX(int pid, CicoSCLifeCycleController* x) +int CSCLCCapp_dead_handlerX(int pid, CicoHSLifeCycleController* x) { ICO_TRA("start"); if ((NULL == x) || (0 == x)) { @@ -965,13 +971,13 @@ int CSCLCCapp_dead_handlerX(int pid, CicoSCLifeCycleController* x) * @brief AUL information list * @return AUL information item list Container */ -const vector& CicoSCLifeCycleController::getAulList() +const vector& CicoHSLifeCycleController::getAulList() { int sz = m_aul.size(); for (int i = 0; i < sz; i++) { - CicoSCAulItems* t = (CicoSCAulItems*)m_aul[i].p(); + CicoAulItems* t = (CicoAulItems*)m_aul[i].p(); t->update_appid(); } return m_aul; } - +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoSCLifeCycleController.h b/src/homescreen/CicoHSLifeCycleController.h similarity index 65% rename from src/homescreen/CicoSCLifeCycleController.h rename to src/homescreen/CicoHSLifeCycleController.h index 8a35950..6126256 100644 --- a/src/homescreen/CicoSCLifeCycleController.h +++ b/src/homescreen/CicoHSLifeCycleController.h @@ -6,8 +6,8 @@ * http://www.apache.org/licenses/LICENSE-2.0 * */ -#ifndef CICOSCLIFECYCLECONTROLLER_H -#define CICOSCLIFECYCLECONTROLLER_H +#ifndef CICOHSLIFECYCLECONTROLLER_H +#define CICOHSLIFECYCLECONTROLLER_H #include #include #include @@ -15,8 +15,8 @@ #include #include -#include "CicoSCAilItems.h" -#include "CicoSCAulItems.h" +#include "CicoAilItems.h" +#include "CicoAulItems.h" #ifndef __CICO_SC_WINDOW_H__ @@ -24,12 +24,12 @@ class CicoSCWindow; #endif -class CicoSCLifeCycleController { +class CicoHSLifeCycleController { public: - CicoSCLifeCycleController(); - ~CicoSCLifeCycleController(); + CicoHSLifeCycleController(); + ~CicoHSLifeCycleController(); - static CicoSCLifeCycleController* getInstance(void); + static CicoHSLifeCycleController* getInstance(void); // Starting application int launch(const char* appid); @@ -46,19 +46,19 @@ public: bool isRunning(const char* appid); bool isRunning(const std::string& appid); - const std::vector& getAilList() const; - const CicoSCAilItems* findAIL(const char* appid) const; - const CicoSCAilItems* findAIL(const std::string& appid) const; + const std::vector& getAilList() const; + const CicoAilItems* findAIL(const char* appid) const; + const CicoAilItems* findAIL(const std::string& appid) const; bool isAilRenew() const; void ailRenewFlagOff(); - const std::vector& getAulList(); + const std::vector& getAulList(); // TODO mk_k Should I think about the multiple return values start /* - const CicoSCAulItems* findAUL(const char* appid) const; - const CicoSCAulItems* findAUL(const std::string& appid) const; + const CicoAulItems* findAUL(const char* appid) const; + const CicoAulItems* findAUL(const std::string& appid) const; */ - const CicoSCAulItems* findAUL(int pid); + const CicoAulItems* findAUL(int pid); bool getPIDs(const char* appid, std::vector& pids) const; bool getPIDs(std::string& appid, std::vector& pids) const; void enterAUL(const char* appid, int pid, const CicoSCWindow* obj = NULL, @@ -68,20 +68,20 @@ public: protected: void initAIL(); friend ail_cb_ret_e CSCLCCail_list_appinfo_cbX(const ail_appinfo_h appinfo, - CicoSCLifeCycleController* x); + CicoHSLifeCycleController* x); bool createAilItems(); friend int CSCLCCpkgmgr_handlerX(int req_id, const char *pkg_type, const char *pkg_name, const char *key, const char *val, const void *pmsg, - CicoSCLifeCycleController *x); + CicoHSLifeCycleController *x); void renewAIL(); void ailRenewFlagOn(); void initAUL(); friend int CSCLCCapp_launch_handlerX(int pid, - CicoSCLifeCycleController *x); - friend int CSCLCCapp_dead_handlerX(int pid, CicoSCLifeCycleController *x); + CicoHSLifeCycleController *x); + friend int CSCLCCapp_dead_handlerX(int pid, CicoHSLifeCycleController *x); int terminateR(int pid); void getCategory(const char* sPkg, const char* sNm, const char* sCtg, @@ -91,11 +91,11 @@ protected: bool bndsp); bool removeAUL(int pid); private: - static CicoSCLifeCycleController* ms_myInstance; + static CicoHSLifeCycleController* ms_myInstance; protected: - std::vector m_ail; - std::vector m_aul; + std::vector m_ail; + std::vector m_aul; GKeyFile* m_gconf; pkgmgr_client* m_pc; bool m_ailRenew; @@ -106,7 +106,7 @@ protected: * @return AIL information item list Container */ inline -const std::vector& CicoSCLifeCycleController::getAilList() const +const std::vector& CicoHSLifeCycleController::getAilList() const { return m_ail; } @@ -118,7 +118,7 @@ const std::vector& CicoSCLifeCycleController::getAilList() const * @retval true change flag on * @retval false change flag off */ -inline bool CicoSCLifeCycleController::isAilRenew() const +inline bool CicoHSLifeCycleController::isAilRenew() const { return m_ailRenew; } @@ -126,7 +126,7 @@ inline bool CicoSCLifeCycleController::isAilRenew() const /** * @brief AIL change flag off set */ -inline void CicoSCLifeCycleController::ailRenewFlagOff() +inline void CicoHSLifeCycleController::ailRenewFlagOff() { m_ailRenew = false; } @@ -134,9 +134,10 @@ inline void CicoSCLifeCycleController::ailRenewFlagOff() /** * @brief AIL change flag on set */ -inline void CicoSCLifeCycleController::ailRenewFlagOn() +inline void CicoHSLifeCycleController::ailRenewFlagOn() { m_ailRenew = true; } -#endif // CICOSCLIFECYCLECONTROLLER_H +#endif // CICOHSLIFECYCLECONTROLLER_H +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSMenuTile.cpp b/src/homescreen/CicoHSMenuTile.cpp index 763ea79..2437295 100644 --- a/src/homescreen/CicoHSMenuTile.cpp +++ b/src/homescreen/CicoHSMenuTile.cpp @@ -40,9 +40,11 @@ static void SetYinvert(Evas_Object *obj); */ /*--------------------------------------------------------------------------*/ CicoHSMenuTile::CicoHSMenuTile(const char *appid, - const char *icon_image_path, int page, int subpage, + const char *icon_image_path, + int page, int subpage, int position, int width, int height) { + ICO_TRA("CicoHSMenuTile::CicoHSMenuTile Enter"); if (_CicoHSMenuTile_initialized == 0) { // Initialize and setting OpenGL/EGL functions ICO_DBG("CicoHSMenuTile::CicoHSMenuTile: initialize OpenGL/EGL functions"); @@ -91,6 +93,7 @@ CicoHSMenuTile::CicoHSMenuTile(const char *appid, this->height = height; pos_x = GetPositionX(); pos_y = GetPositionY(); + ICO_TRA("CicoHSMenuTile::CicoHSMenuTile Leave"); } /*--------------------------------------------------------------------------*/ @@ -118,6 +121,7 @@ CicoHSMenuTile::~CicoHSMenuTile(void) void CicoHSMenuTile::CreateObject(Evas *evas) { + ICO_TRA("CicoHSMenuTile::CreateObject Enter"); /*initial vaule*/ menu_evas = evas; menu_show = false; @@ -146,8 +150,11 @@ CicoHSMenuTile::CreateObject(Evas *evas) evas_object_move(term_icon, pos_x + width - ICO_HS_MENUTILE_TERM_ICON_WIDTH, pos_y); evas_object_resize(term_icon, ICO_HS_MENUTILE_TERM_ICON_WIDTH, ICO_HS_MENUTILE_TERM_ICON_HEIGHT); + evas_object_event_callback_add(term_icon, EVAS_CALLBACK_MOUSE_DOWN, + CicoHSMenuTouch::TouchDownTerm, appid); evas_object_event_callback_add(term_icon, EVAS_CALLBACK_MOUSE_UP, CicoHSMenuTouch::TouchUpTerm, appid); + ICO_TRA("CicoHSMenuTile::CreateObject Leave"); } /*--------------------------------------------------------------------------*/ @@ -627,11 +634,12 @@ CicoHSMenuTile::SetThumbnail(ico_syc_thumb_info_t *info) thumb.height = info->height; thumb.stride = info->stride; thumb.format = info->format; +#if 0 /* too many log */ ICO_DBG("CicoHSMenuTile::SetThumbnail: create %s(%08x) " "name=%d w/h/s=%d/%d/%d tile w/h=%d/%d", appid, thumb.surface, thumb.name, thumb.width, thumb.height, thumb.stride, width, height); - +#endif // delete image and texture if (thumb.image) { CicoHSMenuTile::glfunc.destroy_image( @@ -868,8 +876,9 @@ SetYinvert(Evas_Object *obj) } func; Evas_Video_Surface video; +#if 0 /* delete at evas-1.7.8-15.1 */ unsigned int video_caps; - +#endif const char *tmpf; int tmpf_fd; @@ -1099,8 +1108,12 @@ SetYinvert(Evas_Object *obj) // Evas old version check and revise if (((int)im & 0xffff0000) == 0) { // Evas old version - image_obj = (struct local_Evas_Object_Image *)(((int *)image_obj) - 1); + image_obj = (struct local_Evas_Object_Image *)(((int *)image_obj) + 1); im = (struct local_Evas_GL_Image *)image_obj->engine_data; } - im->native.yinvert = 1; + if (((int)im & 0xffff0000) != 0) { + if (im->native.yinvert == 0) + im->native.yinvert = 1; + } } +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSMenuTile.h b/src/homescreen/CicoHSMenuTile.h index 7bb62bf..b607e21 100644 --- a/src/homescreen/CicoHSMenuTile.h +++ b/src/homescreen/CicoHSMenuTile.h @@ -162,3 +162,4 @@ class CicoHSMenuTile CicoHSMenuTile(const CicoHSMenuTile&); }; #endif +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSMenuTouch.cpp b/src/homescreen/CicoHSMenuTouch.cpp index 7cb139f..aeaab05 100644 --- a/src/homescreen/CicoHSMenuTouch.cpp +++ b/src/homescreen/CicoHSMenuTouch.cpp @@ -25,6 +25,7 @@ int CicoHSMenuTouch::touch_state_a_y; Ecore_Timer *CicoHSMenuTouch::timer; bool CicoHSMenuTouch::long_act; +bool CicoHSMenuTouch::touch_down; CicoHSMenuWindow* CicoHSMenuTouch::menu_window; @@ -45,6 +46,7 @@ CicoHSMenuTouch::Initialize(CicoHSMenuWindow* menu_window) { timer = NULL; long_act = false; + touch_down = false; CicoHSMenuTouch::menu_window = menu_window; } @@ -80,35 +82,65 @@ void CicoHSMenuTouch::TouchDownMenu(void *data, Evas *evas, Evas_Object *obj, void *event_info) { Evas_Event_Mouse_Down *info; + int x, y; info = reinterpret_cast(event_info); - touch_state_b_x = info->output.x; - touch_state_b_y = info->output.y; + x = info->output.x; + y = info->output.y; + + touch_down = true; + + if (timer) { + ecore_timer_del(timer); + timer = NULL; + if ((x >= 0) && (y >= 0)) { + touch_state_b_x = x; + touch_state_b_y = y; + } + } + else { + touch_state_b_x = x; + touch_state_b_y = y; + } char *appid = reinterpret_cast(data); - if(appid == NULL){ + if (appid == NULL) { + ICO_DBG("CicoHSMenuTouch::TouchDownMenu: (%d,%d) No App", + touch_state_b_x, touch_state_b_y); return; } + ICO_PRF("TOUCH_EVENT Menu Down (%d,%d) app=%s", + touch_state_b_x, touch_state_b_y, appid); long_act = false; timer = ecore_timer_add(ICO_HS_MENU_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS, - LongPushed,NULL); + LongPushed, NULL); } +/*--------------------------------------------------------------------------*/ +/** + * @brief LongPushed::Touch timeout + * touch down timeout called from ecore + * + * @param[in] data user data(unused) + * @return fixed ECORE_CALLBACK_CANCEL + */ +/*--------------------------------------------------------------------------*/ Eina_Bool CicoHSMenuTouch::LongPushed(void *data) { - long_act = true; - timer = NULL; + ICO_TRA("CicoHSMenuTouch::LongPushed Enter"); + long_act = true; + timer = NULL; - /*stop select*/ - menu_window->ChangeTerminateMode(); + /*stop select*/ + menu_window->ChangeTerminateMode(); - return ECORE_CALLBACK_CANCEL; + ICO_TRA("CicoHSMenuTouch::LongPushed Leave"); + return ECORE_CALLBACK_CANCEL; } - /*--------------------------------------------------------------------------*/ /** * @brief CicoHSMenuTouch::TouchUpMenu @@ -125,34 +157,52 @@ void CicoHSMenuTouch::TouchUpMenu(void *data, Evas *evas, Evas_Object *obj, void *event_info) { Evas_Event_Mouse_Up *info; - char *appid = reinterpret_cast(data); - int sub_x = 0; - int sub_y = 0; + char *appid = reinterpret_cast(data); + int sub_x; + int sub_y; + int x, y; - if(timer != NULL){ + info = reinterpret_cast(event_info); + x = info->output.x; + y = info->output.y; + + if (timer != NULL) { ecore_timer_del(timer); timer = NULL; } + else if (touch_down == false) { + ICO_DBG("CicoHSMenuTouch::TouchUpMenu: (%d,%d) No Down, Skip", x, y); + return; + } + touch_down = false; + /* long push*/ - if(long_act == true){ + if (long_act == true) { + ICO_DBG("CicoHSMenuTouch::TouchUpMenu: timedout"); long_act = false; return; } - info = reinterpret_cast(event_info); - touch_state_a_x = info->output.x; - touch_state_a_y = info->output.y; + touch_state_a_x = x; + touch_state_a_y = y; + sub_x = touch_state_a_x - touch_state_b_x; sub_y = touch_state_a_y - touch_state_b_y; + + ICO_PRF("TOUCH_EVENT Menu Up (%d,%d)->(%d,%d) app=%s", + touch_state_b_x, touch_state_b_y, + touch_state_a_x, touch_state_a_y, appid? appid: "(NULL)"); + if (abs(sub_x) > abs(sub_y)) { /* menu slide*/ - if( sub_x > ICO_HS_MENU_TOUCH_FLICK_THREASHOLD_DISTANCE){ + if (sub_x > ICO_HS_MENU_TOUCH_FLICK_THREASHOLD_DISTANCE) { menu_window->GoBackMenu(); touch_state_b_x = 0; touch_state_b_y = 0; return; - }else if(sub_x < (-1 * ICO_HS_MENU_TOUCH_FLICK_THREASHOLD_DISTANCE)){ + } + else if (sub_x < (-1 * ICO_HS_MENU_TOUCH_FLICK_THREASHOLD_DISTANCE)) { menu_window->GoNextMenu(); touch_state_b_x = 0; touch_state_b_y = 0; @@ -160,12 +210,13 @@ CicoHSMenuTouch::TouchUpMenu(void *data, Evas *evas, Evas_Object *obj, void *eve } } else { - if( sub_y > ICO_HS_MENU_TOUCH_FLICK_THREASHOLD_DISTANCE){ + if (sub_y > ICO_HS_MENU_TOUCH_FLICK_THREASHOLD_DISTANCE) { menu_window->UpBackMenu(); touch_state_b_x = 0; touch_state_b_y = 0; return; - }else if(sub_y < (-1 * ICO_HS_MENU_TOUCH_FLICK_THREASHOLD_DISTANCE)){ + } + else if (sub_y < (-1 * ICO_HS_MENU_TOUCH_FLICK_THREASHOLD_DISTANCE)) { menu_window->DownNextMenu(); touch_state_b_x = 0; touch_state_b_y = 0; @@ -174,7 +225,7 @@ CicoHSMenuTouch::TouchUpMenu(void *data, Evas *evas, Evas_Object *obj, void *eve } /*execute application*/ - if(appid != NULL){ + if (appid != NULL) { // play operation sound CicoSound::GetInstance()->PlayOperationSound(); @@ -184,8 +235,27 @@ CicoHSMenuTouch::TouchUpMenu(void *data, Evas *evas, Evas_Object *obj, void *eve /*--------------------------------------------------------------------------*/ /** + * @brief CicoHSMenuTouch::TouchDownTerm + * touch down action at terminate icon + * + * @param[in] data data + * @param[in] evas evas + * @param[in] obj object + * @param[in] event_info event information + * @return none + */ +/*--------------------------------------------------------------------------*/ +void +CicoHSMenuTouch::TouchDownTerm(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + ICO_DBG("CicoHSMenuTouch::TouchDownTerm:"); + touch_down = true; +} + +/*--------------------------------------------------------------------------*/ +/** * @brief CicoHSMenuTouch::TouchUpTerm - * touch up action at menu + * touch up action at terminate icon * * @param[in] data data * @param[in] evas evas @@ -197,10 +267,19 @@ CicoHSMenuTouch::TouchUpMenu(void *data, Evas *evas, Evas_Object *obj, void *eve void CicoHSMenuTouch::TouchUpTerm(void *data, Evas *evas, Evas_Object *obj, void *event_info) { + // if no down, skip + ICO_DBG("CicoHSMenuTouch::TouchUpTerm: down=%d", (int)touch_down); + if (touch_down == false) { + ICO_DBG("CicoHSMenuTouch::TouchUpTerm: No Down, Skip"); + return; + } + touch_down = false; + // play opration sound CicoSound::GetInstance()->PlayOperationSound(); char *appid = reinterpret_cast(data); + ICO_PRF("TOUCH_EVENT Term Down->Up app=%s", appid? appid:"(NIL)"); strncpy(terminate_appid, appid, ICO_HS_MAX_PROCESS_NAME); @@ -220,8 +299,11 @@ CicoHSMenuTouch::TouchUpTerm(void *data, Evas *evas, Evas_Object *obj, void *eve */ /*--------------------------------------------------------------------------*/ void -CicoHSMenuTouch::TouchUpTerminateYes(void *data, Evas *evas, Evas_Object *obj, void *event_info) +CicoHSMenuTouch::TouchUpTerminateYes(void *data, Evas *evas, Evas_Object *obj, + void *event_info) { + ICO_PRF("TOUCH_EVENT TermYes Up app=%s", terminate_appid); + // play opration sound CicoSound::GetInstance()->PlayOperationSound(); @@ -242,6 +324,8 @@ CicoHSMenuTouch::TouchUpTerminateYes(void *data, Evas *evas, Evas_Object *obj, v void CicoHSMenuTouch::TouchUpTerminateNo(void *data, Evas *evas, Evas_Object *obj, void *event_info) { + ICO_PRF("TOUCH_EVENT TermNo Up app=%s", terminate_appid); + // play opration sound CicoSound::GetInstance()->PlayOperationSound(); diff --git a/src/homescreen/CicoHSMenuTouch.h b/src/homescreen/CicoHSMenuTouch.h index c0f283c..33f6cd8 100644 --- a/src/homescreen/CicoHSMenuTouch.h +++ b/src/homescreen/CicoHSMenuTouch.h @@ -23,7 +23,7 @@ #define ICO_HS_MENU_TOUCH_FLICK_THREASHOLD_DISTANCE 100 #define ICO_HS_MENU_TOUCH_FLICK_THREASHOLD_TIME_MSECONDS 1000 -#define ICO_HS_MENU_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS 2.5d +#define ICO_HS_MENU_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS 2.0d class CicoHSMenuTouch { @@ -51,6 +51,7 @@ class CicoHSMenuTouch static Ecore_Timer *timer; static bool long_act; + static bool touch_down; protected: CicoHSMenuTouch operator=(const CicoHSMenuTouch&); @@ -58,3 +59,4 @@ class CicoHSMenuTouch }; #endif +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSMenuWindow.cpp b/src/homescreen/CicoHSMenuWindow.cpp index d92714d..3920f4a 100644 --- a/src/homescreen/CicoHSMenuWindow.cpp +++ b/src/homescreen/CicoHSMenuWindow.cpp @@ -13,7 +13,7 @@ */ #include "CicoHSMenuWindow.h" #include "CicoHSMenuTouch.h" -#include "CicoHomeScreenResourceConfig.h" +#include "CicoResourceConfig.h" #include "CicoHomeScreen.h" #include "CicoHSSystemState.h" #include @@ -59,10 +59,9 @@ CicoHSMenuWindow::CicoHSMenuWindow(void) menu_window_instance = this; - life_cycle_controller = CicoSCLifeCycleController::getInstance(); + life_cycle_controller = CicoHSLifeCycleController::getInstance(); - CicoHomeScreenResourceConfig::GetImagePath(img_dir_path, - ICO_HS_MAX_PATH_BUFF_LEN); + CicoResourceConfig::GetImagePath(img_dir_path, ICO_HS_MAX_PATH_BUFF_LEN); m_showState = false; } @@ -117,17 +116,19 @@ CicoHSMenuWindow::SetMenuBack(void) int err = evas_object_image_load_error_get(canvas); if (err != EVAS_LOAD_ERROR_NONE) { ICO_ERR("CicoHSMenuWindow::SetMenuBack: backgound image is not exist"); + ICO_TRA("CicoHSMenuWindow::SetMenuBack Leave(ERR)"); evas_object_del(canvas); return ICO_ERROR; } evas_object_event_callback_add(canvas, EVAS_CALLBACK_MOUSE_DOWN, - CicoHSMenuTouch::TouchDownMenu,NULL); + CicoHSMenuTouch::TouchDownMenu,NULL); evas_object_event_callback_add(canvas, EVAS_CALLBACK_MOUSE_UP, - CicoHSMenuTouch::TouchUpMenu,NULL); + CicoHSMenuTouch::TouchUpMenu,NULL); evas_object_move(canvas, 0, 0); evas_object_resize(canvas, width, height); evas_object_show(canvas); + ICO_ERR("CicoHSMenuWindow::SetMenuBack Leave(EOK)"); return ICO_OK; } @@ -253,7 +254,7 @@ CicoHSMenuWindow::SetLayout(const char *filename,CicoLayoutInfo *layout,int num) void CicoHSMenuWindow::InitAppTiles(void) { - ICO_DBG("CicoHSMenuWindow::InitAppTiles Enter"); + ICO_TRA("CicoHSMenuWindow::InitAppTiles Enter"); current_page = 0; subcurrent_page = 0; @@ -268,7 +269,7 @@ CicoHSMenuWindow::InitAppTiles(void) all_tile_num = 0; all_page_num = 0; - ICO_DBG("CicoHSMenuWindow::InitAppTiles Leave"); + ICO_TRA("CicoHSMenuWindow::InitAppTiles Leave"); } /*--------------------------------------------------------------------------*/ @@ -293,7 +294,7 @@ CicoHSMenuWindow::SetAppTiles(void) current_page = 0; /* get APP information */ - std::vector aillist = + std::vector aillist = life_cycle_controller->getAilList(); /* get category infomation */ @@ -433,7 +434,7 @@ CicoHSMenuWindow::FreeAppTiles(void) void CicoHSMenuWindow::RenewAppTiles(void) { - ICO_DBG("CicoHSMenuWindow::RenewAppTiles Enter"); + ICO_TRA("CicoHSMenuWindow::RenewAppTiles Enter"); int ret; @@ -452,7 +453,7 @@ CicoHSMenuWindow::RenewAppTiles(void) /* update app info list */ CicoHomeScreen::RenewAppInfoList(); - ICO_DBG("CicoHSMenuWindow::RenewAppTiles Leave"); + ICO_TRA("CicoHSMenuWindow::RenewAppTiles Leave"); } /*--------------------------------------------------------------------------*/ @@ -1323,7 +1324,7 @@ CicoHSMenuWindow::SetMenuWindowID(const char *appid,int surface) void CicoHSMenuWindow::Show(ico_syc_animation_t *animation) { - ICO_DBG("CicoHSMenuWindow::Show Enter"); + ICO_TRA("CicoHSMenuWindow::Show Enter"); // if regulation == true, forbid show window. if (true == CicoHSSystemState::getInstance()->getRegulation()) { @@ -1346,7 +1347,7 @@ CicoHSMenuWindow::Show(ico_syc_animation_t *animation) ico_syc_show(appid, surface, animation); - ICO_DBG("CicoHSMenuWindow::Show Leave"); + ICO_TRA("CicoHSMenuWindow::Show Leave"); } /*--------------------------------------------------------------------------*/ @@ -1361,7 +1362,7 @@ CicoHSMenuWindow::Show(ico_syc_animation_t *animation) void CicoHSMenuWindow::Hide(ico_syc_animation_t *animation) { - ICO_DBG("CicoHSMenuWindow::Hide Enter"); + ICO_TRA("CicoHSMenuWindow::Hide Enter"); if(terminate_mode == true){ ChangeNormalMode(); @@ -1376,7 +1377,7 @@ CicoHSMenuWindow::Hide(ico_syc_animation_t *animation) } } - ICO_DBG("CicoHSMenuWindow::Hide Leave"); + ICO_TRA("CicoHSMenuWindow::Hide Leave"); } /*--------------------------------------------------------------------------*/ @@ -1392,11 +1393,12 @@ void CicoHSMenuWindow::ExecuteApp(const char *appid) { if(terminate_mode == true){ + ICO_DBG("CicoHSMenuWindow::ExecuteApp: exet %s but terminate_mode", appid); return; } - CicoHomeScreen::ExecuteApp(appid); } + /*--------------------------------------------------------------------------*/ /** * @brief CicoHSMenuWindow::TerminateApp @@ -1428,6 +1430,7 @@ void CicoHSMenuWindow::ChangeTerminateMode(void) { bool check = false; + /*check */ for (int ii = 0; ii < all_tile_num; ii++) { if(menu_tile[ii] == NULL){ @@ -1453,7 +1456,9 @@ CicoHSMenuWindow::ChangeTerminateMode(void) menu_tile[ii]->ShowTermIcon(); } terminate_mode = true; + ICO_DBG("CicoHSMenuWindow::ChangeTerminateMode: change to terminate mode"); } + /*--------------------------------------------------------------------------*/ /** * @brief CicoHSMenuWindow::ChangeNormalMode @@ -1474,6 +1479,7 @@ CicoHSMenuWindow::ChangeNormalMode(void) menu_tile[ii]->HideTermIcon(); } terminate_mode = false; + ICO_DBG("CicoHSMenuWindow::ChangeNormalMode: change to normal mode"); } /*--------------------------------------------------------------------------*/ @@ -1488,7 +1494,7 @@ CicoHSMenuWindow::ChangeNormalMode(void) void CicoHSMenuWindow::ValidMenuIcon(const char *appid) { -ICO_DBG("CicoHSMenuWindow::ValidMenuIcon(%s)", appid ? appid : "(NULL)" ); + ICO_DBG("CicoHSMenuWindow::ValidMenuIcon(%s)", appid ? appid : "(NULL)" ); for (int ii = 0; ii < all_tile_num; ii++) { if (strncmp(menu_tile[ii]->GetAppId(), appid, ICO_HS_MAX_PROCESS_NAME) == 0) { menu_tile[ii]->ValidMenuIcon(); @@ -1551,14 +1557,14 @@ CicoHSMenuWindow::SetThumbnail(const char *appid, ico_syc_thumb_info_t *info) void CicoHSMenuWindow::SetNightMode(void) { - ICO_DBG("CicoHSMenuWindow::SetNightMode Enter"); + ICO_TRA("CicoHSMenuWindow::SetNightMode Enter"); if (true == CicoHSSystemState::getInstance()->getNightMode()) { evas_object_color_set(rectangle,0,0,0,178); } else { evas_object_color_set(rectangle,120,120,120,178); } - ICO_DBG("CicoHSMenuWindow::SetNightMode Leave"); + ICO_TRA("CicoHSMenuWindow::SetNightMode Leave"); } /*--------------------------------------------------------------------------*/ @@ -1590,3 +1596,4 @@ CicoHSMenuWindow::Tile_Height(void) { return CicoHSMenuWindow::menu_tile_height; } +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSMenuWindow.h b/src/homescreen/CicoHSMenuWindow.h index 46782d2..d96ebf4 100644 --- a/src/homescreen/CicoHSMenuWindow.h +++ b/src/homescreen/CicoHSMenuWindow.h @@ -28,14 +28,14 @@ #include #include -#include "CicoHomeScreenConfig.h" +#include "CicoGKeyFileConfig.h" #include "CicoHSWindow.h" #include "CicoHSMenuTile.h" #include "CicoHomeScreenCommon.h" -#include "CicoSCAilItems.h" -#include "CicoSCLifeCycleController.h" +#include "CicoAilItems.h" +#include "CicoHSLifeCycleController.h" #define ICO_HS_MENU_SHOWING 0 #define ICO_HS_MENU_HIDING 1 @@ -180,7 +180,7 @@ class CicoHSMenuWindow :public CicoHSWindow Evas_Object *terminate_button_yes; Evas_Object *terminate_button_no; - CicoSCLifeCycleController *life_cycle_controller; + CicoHSLifeCycleController *life_cycle_controller; /* my instance (for callback) */ static CicoHSMenuWindow *menu_window_instance; bool m_showState; @@ -193,4 +193,4 @@ class CicoHSMenuWindow :public CicoHSWindow CicoHSMenuWindow(const CicoHSMenuWindow&); }; #endif - +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSMessage.cpp b/src/homescreen/CicoHSMessage.cpp new file mode 100644 index 0000000..b1f6684 --- /dev/null +++ b/src/homescreen/CicoHSMessage.cpp @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSMessage.cpp + * + * @brief This file implementation of CicoHSMessage class + */ +//========================================================================== + +#include +#include + +#include "CicoHSMessage.h" + +//========================================================================== +// private static variable +//========================================================================== +unsigned int CicoHSMessage::ms_counter = 0; + +//-------------------------------------------------------------------------- +/** + * @brief default constructor + */ +//-------------------------------------------------------------------------- +CicoHSMessage::CicoHSMessage() +{ + if (ms_counter == UINT_MAX) { + ms_counter = 0; + } + m_id = ++ms_counter; + m_generator = json_generator_new(); + m_root = json_node_new(JSON_NODE_OBJECT); + m_rootObj = json_object_new(); + m_argObj = json_object_new(); + m_array = json_array_new(); + m_data.clear(); +} + +//-------------------------------------------------------------------------- +/** + * @brief destructor + */ +//-------------------------------------------------------------------------- +CicoHSMessage::~CicoHSMessage() +{ + //ICO_TRA("CicoHSMessage::~CicoHSMessage Enter"); + json_array_unref(m_array); + json_object_unref(m_rootObj); + json_object_unref(m_argObj); + json_node_free(m_root); + g_object_unref(m_generator); + //ICO_TRA("CicoHSMessage::~CicoHSMessage Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief get message id + * + * @return id of message + */ +//-------------------------------------------------------------------------- +unsigned int +CicoHSMessage::getId(void) +{ + return m_id; +} + +//-------------------------------------------------------------------------- +/** + * @brief add root object for char pointer type + * + * @param [in] key key name of object + * @param [in] value value of object for char pointer type + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::addRootObject(const char * key, const char * value) +{ +// ICO_DBG("json_object_set_string_member(%s, %s) called.", key, value); + json_object_set_string_member(m_rootObj, key, value); +} + +//-------------------------------------------------------------------------- +/** + * @brief add root object for string type + * + * @param [in] key keyname of object + * @param [in] value value of object for string type + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::addRootObject(const char * key, const std::string & value) +{ +// ICO_DBG("json_object_set_string_member(%s, %s) called.", key, value.c_str()); + json_object_set_string_member(m_rootObj, key, value.c_str()); +} + +//-------------------------------------------------------------------------- +/** + * @brief add root object for integer type + * + * @param [in] key key name of object + * @param [in] value value of object for integer type + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::addRootObject(const char * key, int value) +{ +// ICO_DBG("json_object_set_int_member(%s, %d) called.", key, value); + json_object_set_int_member(m_rootObj, key, value); +} + +//-------------------------------------------------------------------------- +/** + * @brief add argument object for char pointer type + * + * @param [in] key key name of object + * @param [in] value value of object for char pointer type + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::addArgObject(const char * key, const char * value) +{ +// ICO_DBG("json_object_set_string_member(%s, %s) called.", key, value); + json_object_set_string_member(m_argObj, key, value); +} + +//-------------------------------------------------------------------------- +/** + * @brief add argument object for string type + * + * @param [in] key key name of object + * @param [in] value value of object for string type + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::addArgObject(const char * key, const std::string & value) +{ +// ICO_DBG("json_object_set_string_member(%s, %s) called.", key, value.c_str()); + json_object_set_string_member(m_argObj, key, value.c_str()); +} + +//-------------------------------------------------------------------------- +/** + * @brief add argument object for integer type + * + * @param [in] key key name of object + * @param [in] value value of object for integer type + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::addArgObject(const char * key, int value) +{ +// ICO_DBG("json_object_set_int_member(%s, %d) called.", key, value); + json_object_set_int_member(m_argObj, key, value); +} + +//-------------------------------------------------------------------------- +/** + * @brief add argument object for array type + * + * @param [in] key key name of array + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::addArgObject(const char * key) +{ + // count up reference + json_array_ref(m_array); + +// ICO_DBG("json_object_set_array_member(%s) called.", key); + json_object_set_array_member(m_argObj, key, m_array); +} + +//-------------------------------------------------------------------------- +/** + * @brief add array element for char pointer type + * + * @param [in] value value of object for char pointer type + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::addElmArray(const char * value) +{ +// ICO_DBG("json_array_add_string_element(%s) called.", value); + json_array_add_string_element(m_array, value); +} + +//-------------------------------------------------------------------------- +/** + * @brief add array element for string type + * + * @param [in] value value of object for string type + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::addElmArray(const std::string & value) +{ +// ICO_DBG("json_array_add_string_element(%s) called.", value.c_str()); + json_array_add_string_element(m_array, value.c_str()); +} + +//-------------------------------------------------------------------------- +/** + * @brief get destination handle + * + * @return pointer of destination handle + */ +//-------------------------------------------------------------------------- +CicoHSUwsHandle* +CicoHSMessage::getHandle(void) +{ + return m_uwsHandle; +} + +//-------------------------------------------------------------------------- +/** + * @brief set destination handle + * + * @param [in] handle destination handle + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::setHandle(CicoHSUwsHandle* handle) +{ + m_uwsHandle = handle; +} + +//-------------------------------------------------------------------------- +/** + * @brief get message data + * + * @return pointer of message data + */ +//-------------------------------------------------------------------------- +const char* +CicoHSMessage::getData(void) +{ + // count up reference + json_object_ref(m_rootObj); + json_object_ref(m_argObj); + + json_object_set_object_member(m_rootObj, "arg", m_argObj); + json_node_take_object(m_root, m_rootObj); + json_generator_set_root(m_generator, m_root); + gsize len = 0; + gchar* data = json_generator_to_data(m_generator, &len); + m_data = data; + g_free(data); + return m_data.c_str(); +} + +//-------------------------------------------------------------------------- +/** + * @brief get application id of destination + * + * @return application id + */ +//-------------------------------------------------------------------------- +const std::string & +CicoHSMessage::getSendToAppid(void) +{ + return m_toAppid; +} + +//-------------------------------------------------------------------------- +/** + * @brief set application id of destination + */ +//-------------------------------------------------------------------------- +void +CicoHSMessage::setSendToAppid(const std::string & appid) +{ + m_toAppid = appid; +} +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSMessage.h b/src/homescreen/CicoHSMessage.h new file mode 100644 index 0000000..fed1938 --- /dev/null +++ b/src/homescreen/CicoHSMessage.h @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSMessage.h + * + * @brief This file is definition of CicoHSMessage class + */ +//========================================================================== +#ifndef __CICO_HS_MESSAGE_H__ +#define __CICO_HS_MESSAGE_H__ + +#include + +#include + +//========================================================================== +// forward declaration +//========================================================================== +class CicoHSUwsHandle; + +//========================================================================== +/** + * @brief This class hold communication message + */ +//========================================================================== +class CicoHSMessage +{ +public: + // default constructor + CicoHSMessage(); + + // destructor + ~CicoHSMessage(); + + // get message id + unsigned int getId(void); + + // add root object for char pointer type + void addRootObject(const char * key, const char * value); + + // add root object for string type + void addRootObject(const char * key, const std::string & value); + + // add root object for integer type + void addRootObject(const char * key, int value); + + // add argument object for char pointer type + void addArgObject(const char * key, const char * value); + + // add argument object for string type + void addArgObject(const char * key, const std::string & value); + + // add argument object for integer type + void addArgObject(const char * key, int value); + + // add argument object for array type + void addArgObject(const char * key); + + // add element to array for char pointer type + void addElmArray(const char * value); + + // add element to array for string type + void addElmArray(const std::string & value); + + // get destination handle + CicoHSUwsHandle* getHandle(void); + + // set destination handle + void setHandle(CicoHSUwsHandle* handle); + + // get message data + const char* getData(void); + + // set application id of destination + void setSendToAppid(const std::string & appid); + + // get application id of destination + const std::string & getSendToAppid(void); + +private: + // assignment operator + CicoHSMessage& operator=(const CicoHSMessage &object); + + // copy constructor + CicoHSMessage(const CicoHSMessage &object); + +private: + static unsigned int ms_counter; //!< message id counter + int m_id; //!< message id + CicoHSUwsHandle *m_uwsHandle; //!< communication handler + JsonGenerator *m_generator; //!< json generator + JsonNode *m_root; //!< json root node + JsonObject *m_rootObj; //!< json root objects + JsonObject *m_argObj; //!< json arg objects + JsonArray *m_array; //!< json array + std::string m_toAppid; //!< send to appid + std::string m_data; //!< json format data +}; +#endif // __CICO_HS_MESSAGE_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSServer.cpp b/src/homescreen/CicoHSServer.cpp new file mode 100644 index 0000000..bd058bd --- /dev/null +++ b/src/homescreen/CicoHSServer.cpp @@ -0,0 +1,684 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSServer.cpp + * + * @brief This file implementation of CicoHSServer class + */ +//========================================================================== + +#include +using namespace std; + +#include "CicoHSServer.h" +#include "CicoHSCommand.h" +#include "CicoHSMessage.h" +#include "CicoHomeScreen.h" +#include "CicoHSAppControl.h" + +#include +#include "ico_syc_error.h" +#include "ico_syc_msg_cmd_def.h" + +class CicoHSUwsHandler +{ +public: + CicoHSUwsHandler() + : uwsContext(NULL), id(NULL), fd(-1), serviceFlag(false), + ecoreFdHandler(NULL), appid("") {} + void dump(void) const { + ICO_DBG("uwsContext=0x%08x fd=%d service=%s " + "ecoreFdHandler=0x%08x appid=%s", + uwsContext, fd, serviceFlag ? "true" : "false", + ecoreFdHandler, appid.c_str()); + } + struct ico_uws_context *uwsContext; + void* id; + int fd; + bool serviceFlag; + Ecore_Fd_Handler *ecoreFdHandler; + string appid; +}; + +//========================================================================== +// private static variable +//========================================================================== +CicoHSServer* CicoHSServer::ms_myInstance = NULL; + +//-------------------------------------------------------------------------- +/** + * @brief default constructor + */ +//-------------------------------------------------------------------------- +CicoHSServer::CicoHSServer() + : m_uwsContext(NULL), m_appCtrl(NULL), + m_dispatchProcessing(false) +{ +} + +//-------------------------------------------------------------------------- +/** + * @brief destructor + */ +//-------------------------------------------------------------------------- +CicoHSServer::~CicoHSServer() +{ + if (NULL != m_uwsContext) { + ico_uws_close(m_uwsContext); + } +} + +//-------------------------------------------------------------------------- +/** + * @brief get CicoHSServer instance + * + * @return CicoHSServer instance + */ +//-------------------------------------------------------------------------- +CicoHSServer* +CicoHSServer::getInstance(void) +{ + if (NULL == ms_myInstance) { + ms_myInstance = new CicoHSServer(); + } + + return ms_myInstance; +} + +//-------------------------------------------------------------------------- +/** + * @brief set application control instance + * + * @param [in] appCtrl application control instance + */ +//-------------------------------------------------------------------------- +void +CicoHSServer::setAppCtrl(CicoHSAppControl *appCtrl) +{ + m_appCtrl = appCtrl; +} + +//-------------------------------------------------------------------------- +/** + * @brief startup server + * + * @param [in] port websocket port + * @param [in] protocol websocket protocol name + * + * @return ICO_SYC_EOK on success, other on error + * @retval ICO_SYC_EOK success + * @retval ICO_SYC_ENOSYS error(connection fail) + */ +//-------------------------------------------------------------------------- +int +CicoHSServer::startup(int port, const char *protocol) +{ + /* create uir string ":PORT" */ + stringstream uri; + uri << ":" << port; + + /* create context */ + ICO_DBG("called: ico_uws_create_context(port=%s protocol=%s)", + uri.str().c_str(), protocol); + m_uwsContext = ico_uws_create_context(uri.str().c_str(), protocol); + if (NULL == m_uwsContext) { + ICO_ERR("ico_uws_create_context() failed."); + return ICO_SYC_ENOSYS; + } + ico_uws_service(m_uwsContext); + + /* set callback */ + int ret = ico_uws_set_event_cb(m_uwsContext, uwsReceiveEventCB, + (void *)this); + if (ret != ICO_UWS_ERR_NONE) { + ICO_ERR("ico_uws_set_event_cb() failed(%d).", ret); + return ICO_SYC_ENOSYS; + } + ico_uws_service(m_uwsContext); + + return ICO_SYC_EOK; +} + +//-------------------------------------------------------------------------- +/** + * @brief teardown server + */ +//-------------------------------------------------------------------------- +void +CicoHSServer::teardown(void) +{ + ICO_TRA("CicoHSServer::teardown Enter"); + { + std::list::iterator itr; + itr = m_uwsHandlerList.begin(); + for (; itr != m_uwsHandlerList.end(); ++itr) { + if (NULL != (*itr)->ecoreFdHandler) { + ecore_main_fd_handler_del((*itr)->ecoreFdHandler); + (*itr)->ecoreFdHandler = NULL; + } + delete(*itr); + } + m_uwsHandlerList.clear(); + } + + { + std::list::iterator itr; + itr = m_sendMsgQueue.begin(); + for (; itr != m_sendMsgQueue.end(); ++itr) { + delete(*itr); + } + m_sendMsgQueue.clear(); + } + + { + std::list::iterator itr; + itr = m_recvCmdQueue.begin(); + for (; itr != m_recvCmdQueue.end(); ++itr) { + delete(*itr); + } + } + + if (NULL != m_uwsContext) { + ico_uws_close(m_uwsContext); + m_uwsContext = NULL; + } + ICO_TRA("CicoHSServer::teardown Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief add poll websocket file destructor + * + * @param [in] handler websocket handler + */ +//-------------------------------------------------------------------------- +void +CicoHSServer::addPollFd(CicoHSUwsHandler *handler) +{ + ICO_TRA("CicoHSServer::addPollFd Enter(fd=%d)", handler->fd); + Ecore_Fd_Handler_Flags flags; + flags = (Ecore_Fd_Handler_Flags)(ECORE_FD_READ | ECORE_FD_ERROR); + + handler->ecoreFdHandler = ecore_main_fd_handler_add(handler->fd, flags, + ecoreFdCallback, + this, NULL, NULL); + + ICO_DBG("Enqueue uwsHandler(0x%08x)", handler); + m_uwsHandlerList.push_back(handler); + + ICO_TRA("CicoHSServer::addPollFd Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief delete poll websocket file destructor + * + * @param [in] handler websocket handler + */ +//-------------------------------------------------------------------------- +void +CicoHSServer::delPollFd(CicoHSUwsHandler *handler) +{ + ICO_TRA("CicoHSServer::delPollFd Enter"); + + if (NULL == handler) { + ICO_WRN("handler is null"); + ICO_TRA("CicoHSServer::delPollFd Leave"); + return; + } + + if (NULL != handler->ecoreFdHandler) { + ecore_main_fd_handler_del(handler->ecoreFdHandler); + handler->ecoreFdHandler = NULL; + } + + list::iterator itr; + itr = m_uwsHandlerList.begin(); + for (; itr != m_uwsHandlerList.end(); ++itr) { + if (*itr == handler) { + ICO_DBG("Dequeue uwsHandler(0x%08x)", *itr); + m_uwsHandlerList.erase(itr); + break; + } + } + delete handler; + + ICO_TRA("CicoHSServer::delPollFd Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief dispatch receive message process and send message process + * + * @param [in] handler websocket handler + * + * @return websocket handler instance on find, NULL on not found + */ +//-------------------------------------------------------------------------- +void +CicoHSServer::dispatch(const CicoHSUwsHandler *handler) +{ +// ICO_TRA("CicoHSServer::dispatch Enter(handler=0x%08x)", handler); + + if (NULL == handler) { + ICO_WRN("handler is null"); + ICO_TRA("CicoHSServer::dispatch Leave"); + return; + } + + ico_uws_service(handler->uwsContext); + + // There is a possibility that after calling ico_uws_service function, + // the file is deleted. Check whether handler not the disabled. + if (false == isExistUwsHandler(handler)) { + ICO_TRA("CicoHSServer::dispatch Leave"); + return; + } + + if (true == m_dispatchProcessing) { + ICO_TRA("CicoHSServer::dispatch Leave(disptch processing)"); + return; + } + + m_dispatchProcessing = true; + list::iterator itr; + itr = m_recvCmdQueue.begin(); + while(itr != m_recvCmdQueue.end()) { + ICO_DBG("Dequeue command(0x%08x)", (*itr)->cmdid); + CicoHSCommand *cmd = *itr; + itr = m_recvCmdQueue.erase(itr); + switch (cmd->cmdid) { + case MSG_CMD_APP_START: + case MSG_CMD_APP_STOP: + case MSG_CMD_WIN_CHANGE: + m_appCtrl->handleCommand(cmd); + break; + default: + ICO_WRN("command: Unknown type"); + break; + } + delete cmd; + } + m_dispatchProcessing = false; + + if (NULL == handler->ecoreFdHandler) { + ICO_ERR("ecoreFdHandler is null"); + ICO_TRA("CicoHSServer::dispatch Leave"); + return; + } + + Eina_Bool flag = ecore_main_fd_handler_active_get(handler->ecoreFdHandler, + ECORE_FD_WRITE); + if (EINA_TRUE == flag) { +// ICO_DBG("start send message"); + list::iterator send_itr; + send_itr = m_sendMsgQueue.begin(); + while (send_itr != m_sendMsgQueue.end()) { +// ICO_DBG("m_sendMsgQueue.size=%d", m_sendMsgQueue.size()); + CicoHSMessage* msg = *send_itr; + CicoHSUwsHandler *sendHandler = findUwsHandler(msg->getSendToAppid()); + if (handler != sendHandler) { + ++send_itr; + continue; + } + send_itr = m_sendMsgQueue.erase(send_itr); + ICO_DBG("Dequeue Message(id=%d)", msg->getId()); + if ((NULL != sendHandler) && (true == sendHandler->serviceFlag)) { + const char *data = msg->getData(); + ICO_DBG("<<appid.c_str(), sendHandler->id, data); +// ICO_DBG("called: ico_usw_send called(context=0x%08x id=0x%08x)", +// sendHandler->uwsContext, sendHandler->id); + ico_uws_send(sendHandler->uwsContext, sendHandler->id, + (unsigned char *)data, strlen(data)); + + delete msg; + + usleep(200); + } + } + + Ecore_Fd_Handler_Flags flags;; + flags = (Ecore_Fd_Handler_Flags)(ECORE_FD_READ | ECORE_FD_ERROR); + + ecore_main_fd_handler_active_set(handler->ecoreFdHandler, flags); + } + +// ICO_TRA("CicoHSServer::dispatch Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief send message to application client + * + * @param [in] appid application id of destination + * @param [in] msg message + * + * @return ICO_SYC_EOK on success, other on error + */ +//-------------------------------------------------------------------------- +int +CicoHSServer::sendMessage(const string & appid, CicoHSMessage* msg) +{ + ICO_TRA("CicoHSServer::sendMessage Enter(appid=%s, msg=%s)", + appid.c_str(), msg->getData()); + + msg->setSendToAppid(appid); + ICO_DBG("Enqueue Message(id=%d)", msg->getId()); + m_sendMsgQueue.push_back(msg); + + CicoHSUwsHandler *handler = findUwsHandler(appid); + if (NULL != handler) { + Ecore_Fd_Handler_Flags flags; + flags = (Ecore_Fd_Handler_Flags)(ECORE_FD_READ | + ECORE_FD_WRITE | + ECORE_FD_ERROR); + + ecore_main_fd_handler_active_set(handler->ecoreFdHandler, flags); + + dispatch(handler); + } + + ICO_TRA("CicoHSServer::sendMessage Leave(EOK)"); + return ICO_SYC_EOK; +} + +//-------------------------------------------------------------------------- +/* + * @brief websocket utility callback function + * + * @param [in] context context + * @param [in] event event kinds + * @param [in] id client id + * @param [in] detail event detail + * @param [in] data user data + */ +//-------------------------------------------------------------------------- +void +CicoHSServer::uwsReceiveEventCB(const struct ico_uws_context *context, + const ico_uws_evt_e event, + const void *id, + const ico_uws_detail *detail, + void *user_data) +{ + if (NULL == user_data) { + ICO_ERR("user_data is NULL"); + return; + } + + CicoHSServer* server = static_cast(user_data); + server->receiveEventCB(context, event, id, detail, user_data); +} + +//-------------------------------------------------------------------------- +/** + * @brief ecore file destructor callback fucntion + * + * @param [in] data user data + * @param [in] handler ecore file destructor handler + * + * @return ECORE_CALLBACK_RENEW on retry , ECORE_CALLBACK_CANCEL on cancel + */ +//-------------------------------------------------------------------------- +Eina_Bool +CicoHSServer::ecoreFdCallback(void *data, Ecore_Fd_Handler *ecoreFdhandler) +{ +// ICO_TRA("CicoHSServer::ecoreFdCallback Enter"); + + CicoHSUwsHandler *handler = NULL; + handler = static_cast(data)->findUwsHandler(ecoreFdhandler); + if (NULL != handler) { + static_cast(data)->dispatch(handler); + } + +// ICO_TRA("CicoHSServer::ecoreFdCallback Leave"); + return ECORE_CALLBACK_RENEW; +} + +//-------------------------------------------------------------------------- +/** + * @brief websocket callback function + * + * @param [in] context websocket context + * @param [in] event changed event + * @param [in] id source applicatin id + * @param [in] detail event detail information + * @param [in] user_data user data + */ +//-------------------------------------------------------------------------- +void +CicoHSServer::receiveEventCB(const struct ico_uws_context *context, + const ico_uws_evt_e event, + const void *id, + const ico_uws_detail *detail, + void *user_data) +{ +// ICO_TRA("CicoHSServer::receiveEventCB Enter"); + + switch (event) { + case ICO_UWS_EVT_CLOSE: + ICO_DBG(">>>RECV ICO_UWS_EVT_CLOSE(id=0x%08x)", (int)id); +// ICO_TRA("CicoHSServer::receiveEventCB Leave"); + return; + case ICO_UWS_EVT_ERROR: + ICO_DBG(">>>RECV ICO_UWS_EVT_ERROR(id=0x%08x, err=%d)", + (int)id, detail->_ico_uws_error.code); +// ICO_TRA("CicoHSServer::receiveEventCB Leave"); + return; + default: + break; + } + + // find handler + CicoHSUwsHandler *handler = findUwsHandler(context, id); + // If not found handler, create new handler + if (NULL == handler) { + handler = new CicoHSUwsHandler(); + handler->uwsContext = (struct ico_uws_context*)context; + handler->id = (void*)(id); + handler->serviceFlag = false; + } + + switch (event) { + case ICO_UWS_EVT_OPEN: + ICO_DBG(">>>RECV ICO_UWS_EVT_OPEN(id=0x%08x)", (int)id); + break; + case ICO_UWS_EVT_CLOSE: + ICO_DBG(">>>RECV ICO_UWS_EVT_CLOSE(id=0x%08x)", (int)id); + delete handler; + break; + case ICO_UWS_EVT_RECEIVE: + { + ICO_DBG(">>>RECV ICO_UWS_EVT_RECEIVE(id=0x%08x, msg=%s, len=%d)", + (int)id, (char *)detail->_ico_uws_message.recv_data, + detail->_ico_uws_message.recv_len); + + // convert message to command + CicoHSCommand *cmd = new CicoHSCommand(); + cmd->parseMessage((const char*)detail->_ico_uws_message.recv_data); + + // Enqueue command + ICO_DBG("Enqueue command(0x%08x)", cmd->cmdid); + m_recvCmdQueue.push_back(cmd); + break; + } + case ICO_UWS_EVT_ADD_FD: + ICO_DBG(">>>RECV ICO_UWS_EVT_ADD_FD(id=0x%08x, fd=%d)", + (int)id, detail->_ico_uws_fd.fd); + handler->fd = detail->_ico_uws_fd.fd; + addPollFd(handler); + break; + case ICO_UWS_EVT_DEL_FD: + ICO_DBG(">>>RECV ICO_UWS_EVT_DEL_FD(id=0x%08x, fd=%d, appid=%s)", + (int)id, detail->_ico_uws_fd.fd, handler->appid.c_str()); + clearRecvCmdQueue(handler->appid); + clearSendMsgQueue(handler->appid); + delPollFd(handler); + break; + default: + break; + } +// ICO_TRA("CicoHSServer::receiveEventCB Leave"); +} + +//-------------------------------------------------------------------------- +/** + * @brief clear receive command queue + * + * @param [in] appid clear command application id + */ +//-------------------------------------------------------------------------- +void +CicoHSServer::clearRecvCmdQueue(const std::string & appid) +{ + ICO_TRA("CicoHSServer::clearCmdQueue Enter(appid=%s)", appid.c_str()); + + std::list::iterator itr; + itr = m_recvCmdQueue.begin(); + for (; itr != m_recvCmdQueue.end(); ) { + if (0 == appid.compare((*itr)->appid)) { + ICO_DBG("Dequeue command(0x%08x)", (*itr)->cmdid); + delete *itr; + itr = m_recvCmdQueue.erase(itr); + } + else { + ++itr; + } + } + m_recvCmdQueue.clear(); + + ICO_TRA("CicoHSServer::clearCmdQueue Leave") +} + +//-------------------------------------------------------------------------- +/** + * @brief clear send message queue + * + * @param [in] appid clear message application id + */ +//-------------------------------------------------------------------------- +void +CicoHSServer::clearSendMsgQueue(const std::string & appid) +{ + ICO_TRA("CicoHSServer::clearMsgQueue Enter(appid=%s)", appid.c_str()) + + std::list::iterator itr; + itr = m_sendMsgQueue.begin(); + while(itr != m_sendMsgQueue.end()) { + if (0 == appid.compare((*itr)->getSendToAppid())) { + ICO_DBG("Dequeue Message(id=%d)", (*itr)->getId()); + delete *itr; + itr = m_sendMsgQueue.erase(itr); + } + else { + ++itr; + } + } + m_sendMsgQueue.clear(); + + ICO_TRA("CicoHSServer::clearMsgQueue Leave") +} + +//-------------------------------------------------------------------------- +/** + * @brief find websocket handler by context and id + * + * @param [in] context websocket context + * @param [in] id id + * + * @return websocket handler instance on find, NULL on not found + */ +//-------------------------------------------------------------------------- +CicoHSUwsHandler* +CicoHSServer::findUwsHandler(const struct ico_uws_context *context, + const void *id) +{ + list::iterator itr; + itr = m_uwsHandlerList.begin(); + for (; itr != m_uwsHandlerList.end(); ++itr) { +// ICO_DBG("handler->context=%p handler->id=%p context=%p id=%p", +// (*itr)->uwsContext, (*itr)->id, context, id); + if (((*itr)->uwsContext == context) && + ((*itr)->id == id)) { + return *itr; + } + } + return NULL; +} + +//-------------------------------------------------------------------------- +/** + * @brief find websocket handler by ecore file destructor handler + * + * @param [in] ecoreFdHandler ecore file destructor handler + * + * @return websocket handler instance on find, NULL on not found + */ +//-------------------------------------------------------------------------- +CicoHSUwsHandler* +CicoHSServer::findUwsHandler(const Ecore_Fd_Handler *ecoreFdHandler) +{ + list::iterator itr; + itr = m_uwsHandlerList.begin(); + for (; itr != m_uwsHandlerList.end(); ++itr) { + if ((*itr)->ecoreFdHandler == ecoreFdHandler) { + return *itr; + } + } + return NULL; +} + +//-------------------------------------------------------------------------- +/** + * @brief find websocket handler by appid + * + * @param [in] addid application id + * + * @return websocket handler instance on find, NULL on not found + */ +//-------------------------------------------------------------------------- +CicoHSUwsHandler* +CicoHSServer::findUwsHandler(const string & appid) +{ + list::iterator itr; + itr = m_uwsHandlerList.begin(); + for (; itr != m_uwsHandlerList.end(); ++itr) { +// ICO_DBG("handler->id=%p handler->appid=%s appid=%s", +// (*itr)->id, (*itr)->appid.c_str(), appid.c_str()); + if ((*itr)->appid == appid) { + return *itr; + } + } + return NULL; +} + +//-------------------------------------------------------------------------- +/** + * @brief find websocket handler by appid + * + * @param [in] handler websocket handler instance + * + * @return true on exist, false on not exist + */ +//-------------------------------------------------------------------------- +bool +CicoHSServer::isExistUwsHandler(const CicoHSUwsHandler *handler) +{ + list::iterator itr; + itr = m_uwsHandlerList.begin(); + for (; itr != m_uwsHandlerList.end(); ++itr) { + if (*itr == handler) { + return true; + } + } + return false; +} +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSServer.h b/src/homescreen/CicoHSServer.h new file mode 100644 index 0000000..7b90aa0 --- /dev/null +++ b/src/homescreen/CicoHSServer.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoHSServer.h + * + * @brief This file is definition of CicoHSServer class + */ +//========================================================================== +#ifndef __CICO_HS_SERVER_H__ +#define __CICO_HS_SERVER_H__ + +#include +#include + +#include +#include + +#include + +//========================================================================== +// forward declaration +//========================================================================== +class CicoHSUwsHandler; +class CicoHSMessage; +class CicoHSCommand; +class CicoHSAppControl; + +//========================================================================== +/** + * @brief This class has function of interprocess message server + */ +//========================================================================== +class CicoHSServer +{ +public: + // get CicoHSServer instance + static CicoHSServer* getInstance(); + + // set application control instance + void setAppCtrl(CicoHSAppControl* appCtrl); + + // startup server + int startup(int port, const char *protocol); + + // startup server + void teardown(void); + + // send message to application client + int sendMessage(const std::string & appid, CicoHSMessage* msg); + + // websocket callback function + void receiveEventCB(const struct ico_uws_context *context, + const ico_uws_evt_e event, + const void *id, + const ico_uws_detail *detail, + void *user_data); + + // clear receive command queue + void clearRecvCmdQueue(const std::string & appid); + + // clear send message queue + void clearSendMsgQueue(const std::string & appid); + +private: + // default constructor + CicoHSServer(); + + // destructor + ~CicoHSServer(); + + // assignment operator + CicoHSServer& operator=(const CicoHSServer &object); + + // copy constructor + CicoHSServer(const CicoHSServer &object); + + // websocket utility callback function + static void uwsReceiveEventCB(const struct ico_uws_context *context, + const ico_uws_evt_e event, + const void *id, + const ico_uws_detail *detail, + void *user_data); + + // ecore file destructor callback fucntion + static Eina_Bool ecoreFdCallback(void *data, + Ecore_Fd_Handler *handler); + + // add poll websocket file destructor + void addPollFd(CicoHSUwsHandler *handler); + + // delete poll websocket file destructor + void delPollFd(CicoHSUwsHandler *handler); + + // dispatch receive message process and send message process + void dispatch(const CicoHSUwsHandler *handler); + + // find websocket handle by context and id + CicoHSUwsHandler* findUwsHandler(const struct ico_uws_context *context, + const void *id); + + // find websocket handle by ecore file destructor handler + CicoHSUwsHandler* findUwsHandler(const Ecore_Fd_Handler *ecoreFdHandler); + + // find websocket handle by appid + CicoHSUwsHandler* findUwsHandler(const std::string & appid); + + // query whether the handler exists + bool isExistUwsHandler(const CicoHSUwsHandler *handler); + +private: + static CicoHSServer* ms_myInstance; ///< this class instance + + struct ico_uws_context *m_uwsContext; ///< websocket utility context + + CicoHSAppControl *m_appCtrl; ///< application control instance + + bool m_dispatchProcessing; + + /// websocket handler list + std::list m_uwsHandlerList; + + /// send message queue + std::list m_sendMsgQueue; + + /// recieve message queue + std::list m_recvCmdQueue; +}; +#endif // __CICO_HS_SERVER_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSSwipeInputWindow.h b/src/homescreen/CicoHSSwipeInputWindow.h index b8012dd..8ad6943 100644 --- a/src/homescreen/CicoHSSwipeInputWindow.h +++ b/src/homescreen/CicoHSSwipeInputWindow.h @@ -27,7 +27,7 @@ #include "ico_syc_type.h" #include "CicoHomeScreenCommon.h" -#include "CicoHomeScreenConfig.h" +#include "CicoGKeyFileConfig.h" #include "CicoHSWindow.h" class CicoHSSwipeInputWindow :public CicoHSWindow diff --git a/src/homescreen/CicoHSSwipeTouch.cpp b/src/homescreen/CicoHSSwipeTouch.cpp index e829a7a..f41439a 100644 --- a/src/homescreen/CicoHSSwipeTouch.cpp +++ b/src/homescreen/CicoHSSwipeTouch.cpp @@ -32,7 +32,7 @@ int CicoHSSwipeTouch::touch_state_a_y; int CicoHSSwipeTouch::touch_lasttime; Ecore_Timer *CicoHSSwipeTouch::timer; -bool CicoHSSwipeTouch::touch_down; +int CicoHSSwipeTouch::touch_down; bool CicoHSSwipeTouch::long_act; bool CicoHSSwipeTouch::set_xy_pos; @@ -60,7 +60,7 @@ CicoHSSwipeTouch::Initialize(CicoHSControlBarWindow* ctl_bar, CicoHSAppHistoryEx { timer = NULL; num_windows = 0; - touch_down = false; + touch_down = 0; long_act = false; set_xy_pos = false; @@ -108,16 +108,26 @@ CicoHSSwipeTouch::TouchDownSwipe(void *data, Evas *evas, Evas_Object *obj, void struct timeval ctime; int x, y; - touch_down = true; - gettimeofday(&ctime, NULL); - touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000); + if (timer) { + ecore_timer_del(timer); + timer = NULL; + } + touch_down ++; + info = reinterpret_cast(event_info); window = (CicoHSSwipeInputWindow *)data; - x = info->output.x + window->GetPosX(); y = info->output.y + window->GetPosY(); - ICO_DBG("TouchDownSwipe: x/y=%d/%d->%d/%d", info->output.x, info->output.y, x, y); + ICO_PRF("TOUCH_EVENT Swipe Down (%d,%d)->(%d,%d) (%d)", + info->output.x, info->output.y, x, y, touch_down); + if (touch_down == 1) { + gettimeofday(&ctime, NULL); + touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000); + long_act = false; + timer = ecore_timer_add(ICO_HS_SWIPE_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS, + LongPushed, NULL); + } if ((x >= 0) && (x < 4096) && (y >= 0) && (y < 4096)) { if (set_xy_pos == false) { set_xy_pos = true; @@ -127,10 +137,6 @@ CicoHSSwipeTouch::TouchDownSwipe(void *data, Evas *evas, Evas_Object *obj, void touch_state_a_x = x; touch_state_a_y = y; } - - long_act = false; - timer = ecore_timer_add(ICO_HS_SWIPE_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS, - LongPushed, NULL); } /*--------------------------------------------------------------------------*/ @@ -139,7 +145,7 @@ CicoHSSwipeTouch::TouchDownSwipe(void *data, Evas *evas, Evas_Object *obj, void * touch down timeout called from ecore * * @param[in] data user data(unused) - * @return fixed EINA_TRUE + * @return fixed ECORE_CALLBACK_CANCEL */ /*--------------------------------------------------------------------------*/ Eina_Bool @@ -150,15 +156,15 @@ CicoHSSwipeTouch::LongPushed(void *data) long_act = true; timer = NULL; + if (touch_down > 0) { + /* release my grab */ + ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime, + BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_RESET); + touch_down = 0; + } if (set_xy_pos == false) { ICO_DBG("LongPushed: unknown coordinate, Skip"); - /* release my grab */ - if (touch_down) { - ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime, - BTN_TOUCH, 9); - touch_down = false; - } long_act = false; return ECORE_CALLBACK_CANCEL; } @@ -170,8 +176,7 @@ CicoHSSwipeTouch::LongPushed(void *data) ABS_Z, (touch_state_b_x << 16) | touch_state_b_y); /* send TOUCH Down */ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1, - BTN_TOUCH, touch_down ? 8 : 1); - touch_down = false; + BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_DOWN); /* send ABS_X/Y */ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime, ABS_Z, ((touch_state_a_x) << 16) | (touch_state_a_y)); @@ -217,9 +222,15 @@ CicoHSSwipeTouch::TouchUpSwipe(void *data, Evas *evas, Evas_Object *obj, void *e touch_state_a_y = y; } - ICO_DBG("TouchUpSwipe: x/y=%d/%d->%d/%d (before %d/%d)", - info->output.x, info->output.y, - touch_state_a_x, touch_state_a_y, touch_state_b_x, touch_state_b_y); + ICO_PRF("TOUCH_EVENT Swipe Up (%d,%d)->(%d,%d) before(%d,%d) (%d)", + info->output.x, info->output.y, touch_state_a_x, touch_state_a_y, + touch_state_b_x, touch_state_b_y, touch_down - 1); + + if (touch_down > 1) { + touch_down --; + ICO_DBG("TouchUpSwipe: touch counter not 0(%d), Skip", touch_down); + return; + } if(timer != NULL){ ecore_timer_del(timer); @@ -229,6 +240,21 @@ CicoHSSwipeTouch::TouchUpSwipe(void *data, Evas *evas, Evas_Object *obj, void *e gettimeofday(&ctime, NULL); touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000); + if (touch_down == 0) { + /* send ABS_X/Y */ + ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1, + ABS_Z, (touch_state_a_x << 16) | touch_state_a_y); + /* send TOUCH Up */ + ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime, + BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_UP); + set_xy_pos = false; + long_act = false; + ICO_DBG("TouchUpSwipe: no touch down, Skip"); + return; + } + + touch_down --; + if (set_xy_pos == false) { ICO_DBG("TouchUpSwipe: unknown coordinate, Skip"); @@ -237,26 +263,19 @@ CicoHSSwipeTouch::TouchUpSwipe(void *data, Evas *evas, Evas_Object *obj, void *e ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2, ABS_Z, (touch_state_a_x << 16) | touch_state_a_y); /* send TOUCH Up */ - if ((touch_down == false) && (long_act == true)) { - /* Probably it is an internal event of Ecore */ - ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1, - BTN_TOUCH, 7); - } - else { - ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1, - BTN_TOUCH, 0); - } - touch_down = false; + ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1, + BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_UP); long_act = false; return; } set_xy_pos = false; /* long push */ - if((touch_down == false) || (long_act == true)) { + if(long_act == true) { ICO_DBG("TouchUpSwipe: not down(%d) or timedout(%d)", touch_down, long_act); - touch_down = false; set_xy_pos = false; + touch_down = 0; + long_act = false; /* send touch release event */ /* send ABS_X/Y */ @@ -264,7 +283,7 @@ CicoHSSwipeTouch::TouchUpSwipe(void *data, Evas *evas, Evas_Object *obj, void *e ABS_Z, (touch_state_a_x << 16) | touch_state_a_y); /* send TOUCH Up */ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1, - BTN_TOUCH, 0); + BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_UP); return; } sub = touch_state_a_x - touch_state_b_x; @@ -491,7 +510,7 @@ CicoHSSwipeTouch::TouchUpSwipe(void *data, Evas *evas, Evas_Object *obj, void *e ABS_Z, (touch_state_b_x << 16) | touch_state_b_y); /* send TOUCH Down */ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1, - BTN_TOUCH, touch_down ? 8 : 1); + BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_DOWN); /* send ABS_X/Y */ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime, ABS_Z, ((touch_state_b_x+1) << 16) | (touch_state_b_y+1)); @@ -505,10 +524,9 @@ CicoHSSwipeTouch::TouchUpSwipe(void *data, Evas *evas, Evas_Object *obj, void *e ABS_Z, (touch_state_a_x << 16) | touch_state_a_y); /* send TOUCH Up */ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime, - BTN_TOUCH, 0); + BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_UP); set_xy_pos = false; } - touch_down = false; } /*--------------------------------------------------------------------------*/ @@ -544,19 +562,19 @@ CicoHSSwipeTouch::TouchMoveSwipe(void *data, Evas *evas, Evas_Object *obj, void touch_state_a_x = x; touch_state_a_y = y; - if ((set_xy_pos == false) || (touch_down == false)) { + if ((set_xy_pos == false) || (touch_down == 0)) { set_xy_pos = true; touch_state_b_x = touch_state_a_x; touch_state_b_y = touch_state_a_y; ICO_DBG("TouchMoveSwipe: save x/y=%d/%d", touch_state_b_x, touch_state_b_y); } - ICO_DBG("TouchMoveSwipe: button=%x cur.x/y=%d/%d->%d/%d", - info->buttons, info->cur.output.x, info->cur.output.y, - touch_state_a_x, touch_state_a_y); + ICO_DBG("TouchMoveSwipe: Swipe Move (%d,%d)->(%d,%d) Button=%x", + info->cur.output.x, info->cur.output.y, + touch_state_a_x, touch_state_a_y, info->buttons); /* long push */ - if(touch_down == false) { + if(touch_down == 0) { ICO_DBG("TouchMoveSwipe: no TouchDown, Skip"); return; } @@ -575,6 +593,7 @@ CicoHSSwipeTouch::TouchMoveSwipe(void *data, Evas *evas, Evas_Object *obj, void ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime, ABS_Z, (touch_state_a_x << 16) | touch_state_a_y); + long_act = false; return; } @@ -586,15 +605,20 @@ CicoHSSwipeTouch::TouchMoveSwipe(void *data, Evas *evas, Evas_Object *obj, void ecore_timer_del(timer); timer = NULL; } - long_act = true; + long_act = false; + if (touch_down > 0) { + /* release my grab */ + ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime, + BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_RESET); + } /* send ABS_X/Y */ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2, ABS_Z, (touch_state_b_x << 16) | touch_state_b_y); /* send TOUCH Down */ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1, - BTN_TOUCH, touch_down ? 8 : 1); - touch_down = false; + BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_DOWN); + touch_down = 0; /* send ABS_X/Y */ gettimeofday(&ctime, NULL); touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000); @@ -603,3 +627,4 @@ CicoHSSwipeTouch::TouchMoveSwipe(void *data, Evas *evas, Evas_Object *obj, void set_xy_pos = false; } } +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSSwipeTouch.h b/src/homescreen/CicoHSSwipeTouch.h index 4827b56..e00beed 100644 --- a/src/homescreen/CicoHSSwipeTouch.h +++ b/src/homescreen/CicoHSSwipeTouch.h @@ -28,7 +28,7 @@ #define ICO_HS_SWIPE_TOUCH_DISTANCE_XY 200 #define ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE 80 #define ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_MOVE_Y 80 -#define ICO_HS_SWIPE_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS 2.5d +#define ICO_HS_SWIPE_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS 2.0d #define ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME 300 #define ICO_HS_MAX_SWIPEWINDOWS 4 @@ -56,7 +56,7 @@ class CicoHSSwipeTouch static int touch_lasttime; static Ecore_Timer *timer; - static bool touch_down; + static int touch_down; static bool long_act; static bool set_xy_pos; static int num_windows; @@ -68,3 +68,4 @@ class CicoHSSwipeTouch CicoHSSwipeTouch(const CicoHSSwipeTouch&); }; #endif +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSWindow.cpp b/src/homescreen/CicoHSWindow.cpp index 8a95d53..5e5726a 100644 --- a/src/homescreen/CicoHSWindow.cpp +++ b/src/homescreen/CicoHSWindow.cpp @@ -147,5 +147,4 @@ CicoHSWindow::HideWindow(void) /* hiding */ ecore_evas_hide(window); } - - +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSWindow.h b/src/homescreen/CicoHSWindow.h index 1beb633..41c5693 100644 --- a/src/homescreen/CicoHSWindow.h +++ b/src/homescreen/CicoHSWindow.h @@ -58,5 +58,5 @@ class CicoHSWindow Ecore_Evas *window; /* ecore-evas object */ }; - #endif +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSWindowController.cpp b/src/homescreen/CicoHSWindowController.cpp index 0501880..52e4c28 100644 --- a/src/homescreen/CicoHSWindowController.cpp +++ b/src/homescreen/CicoHSWindowController.cpp @@ -88,7 +88,7 @@ void CicoHSWindowController::GetFullScreenSize(int orientation, int *width, int *height) { - ICO_DBG("CicoHSWindowController::GetFullScreenSize Enter"); + ICO_TRA("CicoHSWindowController::GetFullScreenSize Enter"); int display_width = 0; int display_height = 0; @@ -119,38 +119,6 @@ CicoHSWindowController::GetFullScreenSize(int orientation, display_width : display_height); } #endif /* TizenIVI 3.0 ecore return correct display size */ - ICO_DBG("CicoHSWindowController::GetFullScreenSize Leave(w/h=%d/%d)", *width, *height); + ICO_TRA("CicoHSWindowController::GetFullScreenSize Leave(w/h=%d/%d)", *width, *height); } - -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHSWindowController::StartEcoreLoop - * start loop - * - * @param[in] none - * @return none - */ -/*--------------------------------------------------------------------------*/ -void -CicoHSWindowController::StartEcoreLoop(void) -{ - /* Start main loop */ - ecore_main_loop_begin(); -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHSWindowController::QuitEcoreLoop - * quit loop - * - * @param[in] none - * @return none - */ -/*--------------------------------------------------------------------------*/ -void -CicoHSWindowController::QuitEcoreLoop(void) -{ - /* Quit main loop */ - ecore_main_loop_quit(); -} - +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHSWindowController.h b/src/homescreen/CicoHSWindowController.h index e3524d5..4218b36 100644 --- a/src/homescreen/CicoHSWindowController.h +++ b/src/homescreen/CicoHSWindowController.h @@ -35,8 +35,6 @@ class CicoHSWindowController static void Initialize(void); static void Finalize(void); static void GetFullScreenSize(int orientation,int *width,int *height); - static void StartEcoreLoop(void); - static void QuitEcoreLoop(void); protected: CicoHSWindowController operator=(const CicoHSWindowController&); @@ -44,6 +42,5 @@ class CicoHSWindowController private: static Ecore_Evas *ms_ecoreEvas; }; - #endif - +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHomeScreen.cpp b/src/homescreen/CicoHomeScreen.cpp index 6a08ca2..e5f3641 100644 --- a/src/homescreen/CicoHomeScreen.cpp +++ b/src/homescreen/CicoHomeScreen.cpp @@ -18,9 +18,13 @@ #include "CicoHSAppHistoryExt.h" #include "CicoHomeScreen.h" #include "CicoHSSystemState.h" -#include "CicoSCLifeCycleController.h" -#include "CicoSCConf.h" - +#include "CicoHSLifeCycleController.h" +#include "CicoConf.h" +#include "CicoHSCmdOpts.h" +#include "Cico_aul_listen_app.h" +#include "CicoLibString.h" +#include "CicoHSServer.h" +#include "CicoHSAppControl.h" using namespace std; /*============================================================================*/ @@ -31,25 +35,15 @@ CicoHomeScreen * CicoHomeScreen::hs_instance; /*============================================================================*/ /* functions */ /*============================================================================*/ + /** - * @brief split string - * @param s split target - * @param d - * @param e store split word + * ecore timer void data typedef */ -#if 1 -void split(const string &s, char d, vector &e); -#else -void split(const string &s, char d, vector &e) -{ - stringstream ss(s); - string it; - while (getline(ss, it, d)) { - e.push_back(it); - } - return; -} -#endif +typedef struct t_launcApps_data { + string filePath; + string filePathD; + CicoHomeScreen *hs; +} launcApps_data_t; /*--------------------------------------------------------------------------*/ /** @@ -93,7 +87,7 @@ CicoHomeScreen::CicoHomeScreen(void) m_appHis = NULL; - life_cycle_controller = CicoSCLifeCycleController::getInstance(); + life_cycle_controller = CicoHSLifeCycleController::getInstance(); sub_display_appinfo = NULL; } @@ -192,7 +186,7 @@ void CicoHomeScreen::CreateAppInfoList(void) { /* get APP information*/ - std::vector aillist = life_cycle_controller->getAilList(); + std::vector aillist = life_cycle_controller->getAilList(); for (int ii = 0; ii < ICO_HS_MAX_APP_NUM; ii++) { if (apps_info[ii] != NULL) { @@ -266,10 +260,15 @@ CicoHomeScreen::ChangeActive(const char * appid, int surface) if (appinfo == NULL) { return; } + + ico_hs_window_info* wininfo = appinfo->GetWindowInfobySurface(surface); + if (wininfo == NULL) { + return; + } + appinfo->SetLastSurface(surface); // if window invisible, not update active information - ico_hs_window_info* wininfo = appinfo->GetWindowInfobySurface(surface); if (0 != wininfo->visible) { hs_instance->SetActiveAppInfo(appid); hs_instance->setActiveApp(appid); @@ -322,8 +321,10 @@ CicoHomeScreen::requestChangeZone(CicoHSAppInfo* appinfo) ICO_DBG("wininfo=%p", wininfo); const char *dispzone = moveZoneName; + int layer = HS_LAYER_2NDDISP_APP; if (NULL != GetSubDisplayAppInfo()) { dispzone = appinfo->GetDefaultZone(); + layer = HS_LAYER_APPLICATION; } if (NULL == dispzone) { @@ -334,48 +335,16 @@ CicoHomeScreen::requestChangeZone(CicoHSAppInfo* appinfo) ICO_DBG("change zone: \"%s\"->\"%s\"", wininfo->zone, dispzone); ico_syc_win_move_t move = { .zone = (char*)dispzone, + .layer = layer, .pos_x = 0, .pos_y = 0, .width = 0, .height = 0 }; - int layer = HS_LAYER_APPLICATION; - if (NULL == hs_instance->GetSubDisplayAppInfo()) { - layer = HS_LAYER_2NDDISP_APP; - } - - ico_syc_change_layer(wininfo->appid, wininfo->surface, layer); ico_syc_move(wininfo->appid, wininfo->surface, &move, &hs_instance->moveZoneAnimation); - if (NULL != GetSubDisplayAppInfo()) { - if (m_appHis) { - const string& wapp = m_appHis->getSelectApp(); - ICO_DBG("\"%s\"->\"%s\"", wapp.c_str(), wininfo->appid); - if ((false == wapp.empty()) && - (0 != wapp.compare(wininfo->appid))) { - requestHideAppid(wapp); - m_appHis->clearSelectApp(); - m_appHis->homeSwipe(); - } - } - ICO_TRA("reset sub display"); - SetSubDisplayAppInfo(NULL); - ChangeActive(wininfo->appid, wininfo->surface); - } - else { - ICO_TRA("set sub display"); - SetSubDisplayAppInfo(wininfo->appid); - } - - if (m_appHis) { - if (true == m_appHis->chgChk()) { - m_appHis->writeAppHistory(); - } - m_appHis->homeSwipe(); - } - ICO_TRA("Leave"); } @@ -731,41 +700,42 @@ CicoHomeScreen::ShowStatusBarWindow(ico_syc_win_info_t *win_info) void CicoHomeScreen::ShowApplicationWindow(ico_syc_win_info_t *win_info) { - ICO_DBG("CicoHomeScreen::ShowApplicationWindow Enter"); + ICO_TRA("CicoHomeScreen::ShowApplicationWindow Enter"); - CicoSCLifeCycleController *lifecycle = - CicoSCLifeCycleController::getInstance(); - const CicoSCAilItems* ailItem = lifecycle->findAIL(win_info->appid); + CicoHSLifeCycleController *lifecycle = + CicoHSLifeCycleController::getInstance(); + const CicoAilItems* ailItem = lifecycle->findAIL(win_info->appid); if (NULL == ailItem) { ICO_WRN("ailItem not found."); - ICO_DBG("CicoHomeScreen::ShowApplicationWindow Leave"); + ICO_TRA("CicoHomeScreen::ShowApplicationWindow Leave"); return; } int zoneid = ailItem->m_displayZone; ICO_DBG("zoneid=%d", zoneid); const CicoSCDisplayZoneConf* dispZoneConf = - CicoSCSystemConfig::getInstance()->findDisplayZoneConfbyId(zoneid); + CicoSystemConfig::getInstance()->findDisplayZoneConfbyId(zoneid); if (NULL == dispZoneConf) { ICO_WRN("display zone config not found."); - ICO_DBG("CicoHomeScreen::ShowApplicationWindow Leave"); + ICO_TRA("CicoHomeScreen::ShowApplicationWindow Leave"); return; } ICO_DBG("appid=%s zoneid=%d:%s", win_info->appid, zoneid, dispZoneConf->fullname.c_str()); ico_syc_win_move_t move; - int layer; - move.zone = (char*)dispZoneConf->fullname.c_str(); + move.zone = (char*)dispZoneConf->fullname.c_str(); + move.layer = HS_LAYER_APPLICATION; + if (ailItem->m_display != 0) { + move.layer = HS_LAYER_2NDDISP_APP; + } move.pos_x = 0; move.width = full_width; move.pos_y = ICO_HS_STATUSBAR_WINDOW_HEIGHT; move.height = full_height - ICO_HS_STATUSBAR_WINDOW_HEIGHT - ICO_HS_CONTROLBAR_WINDOW_HEIGHT; - layer = HS_LAYER_APPLICATION; - ico_syc_change_layer(win_info->appid,win_info->surface,layer); ico_syc_move(win_info->appid,win_info->surface,&move,NULL); ico_syc_animation_t animation; animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE; @@ -801,7 +771,7 @@ CicoHomeScreen::ShowApplicationWindow(ico_syc_win_info_t *win_info) } } #endif - ICO_DBG("CicoHomeScreen::ShowApplicationWindow Leave"); + ICO_TRA("CicoHomeScreen::ShowApplicationWindow Leave"); } /*--------------------------------------------------------------------------*/ @@ -1047,6 +1017,44 @@ CicoHomeScreen::EventCallBack(const ico_syc_ev_e event, if (appinfo == NULL) { return; } + + // change layer when moved zone in second display + ico_hs_window_info *winfo = NULL; + winfo = appinfo->GetWindowInfobySurface(win_attr->surface); + if (NULL != winfo) { + if (win_attr->nodeid != winfo->nodeid) { + if (0 == win_attr->nodeid) { + if (NULL != hs_instance->GetSubDisplayAppInfo()) { + if (hs_instance->m_appHis) { + const string& wapp = hs_instance->m_appHis->getSelectApp(); + ICO_DBG("\"%s\"->\"%s\"", wapp.c_str(), winfo->appid); + if ((false == wapp.empty()) && + (0 != wapp.compare(winfo->appid))) { + hs_instance->requestHideAppid(wapp); + hs_instance->m_appHis->clearSelectApp(); + hs_instance->m_appHis->homeSwipe(); + } + } + ICO_DBG("reset sub display"); + hs_instance->SetSubDisplayAppInfo(NULL); + hs_instance->ChangeActive(winfo->appid, winfo->surface); + } + } + else { + ICO_DBG("set sub display"); + hs_instance->SetSubDisplayAppInfo(winfo->appid); + } + + if (hs_instance->m_appHis) { + if (true == hs_instance->m_appHis->chgChk()) { + hs_instance->m_appHis->writeAppHistory(); + } + hs_instance->m_appHis->homeSwipe(); + } + } + } + + // update window information appinfo->AddWindowAttr(win_attr); hs_instance->UpdateTile(win_attr->appid); } @@ -1194,7 +1202,7 @@ CicoHomeScreen::StartRelations(void) */ /*--------------------------------------------------------------------------*/ int -CicoHomeScreen::Initialize(int orientation,CicoHomeScreenConfig *config) +CicoHomeScreen::Initialize(int orientation, CicoGKeyFileConfig *config) { ICO_DBG("CicoHomeScreen::Initialize: start"); @@ -1202,7 +1210,8 @@ CicoHomeScreen::Initialize(int orientation,CicoHomeScreenConfig *config) hs_instance = this; /*config copy*/ - this->config = config; + this->config = new CicoGKeyFileConfig(); + this->config->Initialize(ICO_HOMESCREEN_CONFIG_FILE); /*Get application info*/ CreateAppInfoList(); @@ -1280,23 +1289,21 @@ CicoHomeScreen::Initialize(int orientation,CicoHomeScreenConfig *config) /** * @brief CicoHomeScreen::InitializeAppHistory * Initialize application History Manager - * - * @param[in] user login-user name - * @param[in] path history write file path - * @param[in] flagpath control flag file path */ /*--------------------------------------------------------------------------*/ void -CicoHomeScreen::InitializeAppHistory(const string& user, const string& path, - const string& pathD, - const string& flagpath) +CicoHomeScreen::InitializeAppHistory(void) { - ICO_DBG("start %s, %s, %s", user.c_str(), path.c_str(), flagpath.c_str()); + ICO_DBG("start"); if (NULL != m_appHis) { ICO_DBG("end"); return; } - m_appHis = new CicoHSAppHistoryExt(user, path, pathD, flagpath); + CicoHSCmdOpts* cmdOpts = CicoHSCmdOpts::getInstance(); + m_appHis = new CicoHSAppHistoryExt(cmdOpts->getLoginUser(), + cmdOpts->getHistoryFilePath(), + cmdOpts->getDefaultHistoryFilePath(), + cmdOpts->getFlagPath()); m_appHis->force_flagoff(); m_appHis->setHomeScreen(this); @@ -1581,17 +1588,41 @@ CicoHomeScreen::DeleteSwipeInputWindow(void) /*--------------------------------------------------------------------------*/ /** - * @brief CicoHomeScreen::StartLoop - * start ecore loop + * @brief launch applications * - * @param[in] none - * @return none - */ -/*--------------------------------------------------------------------------*/ -void -CicoHomeScreen::StartLoop(void) -{ - CicoHSWindowController::StartEcoreLoop(); + * @param filepath start applications list file path + * @param filepathD defalt start applications list file path + * @return bool + * @retval true success + * @retval false fail + */ +/*--------------------------------------------------------------------------*/ +static Eina_Bool launchApps(void* data) +{ + ICO_DBG("start"); + launcApps_data_t* x = (launcApps_data_t*) data; + if ((NULL == x) || (NULL == x->hs)) { + ICO_DBG("end fail"); + return ECORE_CALLBACK_CANCEL; + } + + vector apps; + x->hs->readStartupApp(apps); + + int sz = apps.size(); + for (int i =sz; i > 0; i--) { + string appid = apps[i-1].first; + bool bFLAG = apps[i-1].second; + const char* app = appid.c_str(); + ICO_PRF("CHG_APP_STA 1.request app=%s", app); + int pid = aul_launch_app(appid.c_str(), NULL); + ICO_DBG(" 1.request [%d]%d:%s:%d", i, pid, app, (int)bFLAG); + if ((0 < pid) && (NULL != x->hs)) { + x->hs->startupCheckAdd(pid, appid, bFLAG); + } + } + ICO_DBG("end success"); + return ECORE_CALLBACK_CANCEL; } /*--------------------------------------------------------------------------*/ @@ -1603,9 +1634,107 @@ CicoHomeScreen::StartLoop(void) * @return none */ /*--------------------------------------------------------------------------*/ -void -CicoHomeScreen::StartHomeScreen() +int +CicoHomeScreen::StartHomeScreen(int orientation) { + ICO_TRA("CicoHomeScreen::StartHomeScreen Enter"); + + /*save instance pointer */ + hs_instance = this; + + /*config copy*/ + this->config = new CicoGKeyFileConfig(); + this->config->Initialize(ICO_HOMESCREEN_CONFIG_FILE); + + /*Get application info*/ + CreateAppInfoList(); + + /* get pkg name (home screen,status bar,on screen)*/ + char *pkg; + ICO_DBG("CicoHomeSceen::StartHomeScreen: %s: %s", + getenv("HOME"), getenv("PKG_NAME")); + pkg = getenv("PKG_NAME"); + memset(hs_package_name, 0, ICO_HS_MAX_PROCESS_NAME); + if (pkg) { + strncpy(hs_package_name, pkg, ICO_HS_MAX_PROCESS_NAME); + } + else { + strncpy(hs_package_name, ICO_HS_PROC_DEFAULT_HOMESCREEN, + ICO_HS_MAX_PROCESS_NAME); + } + + /* create application control instance */ + CicoHSAppControl *m_appctrl = CicoHSAppControl::getInstance(); + + /* create server instance */ + CicoHSServer *server = CicoHSServer::getInstance(); + server->setAppCtrl(m_appctrl); + server->startup(10001, (const char*)"ico_hs_protocol"); + + /* Initialize WindowController */ + CicoHSWindowController::Initialize(); + ICO_DBG("CicoHomeScreen::StartHomeScreen: window controller initialized"); + + ICO_DBG("CicoHomeScreen::StartHomeScreen: start connect to systemcontroller"); + ico_syc_connect(EventCallBack,NULL); + ICO_DBG("CicoHomeScreen::StartHomeScreen: end connect to systemcontroller"); + + /*initialize system controller*/ + /*my info*/ + ICO_DBG("CicoHomeScreen::StartHomeScreen: get package name %s",hs_package_name); + hs_app_info = GetAppInfo(hs_package_name); + + /*start home statusbar and onscreen*/ + StartRelations(); + ICO_DBG("CicoHomeScreen::StartHomeScreen: start relation apps"); + + /* Get screen size */ + CicoHSWindowController::GetFullScreenSize(orientation, + &full_width,&full_height); + + ICO_DBG("full screen size x=%d y=%d",full_width,full_height); + + /* MenuScreen Window Size */ + menu_width = full_width; + menu_height = full_height - ICO_HS_STATUSBAR_WINDOW_HEIGHT - + ICO_HS_CONTROLBAR_WINDOW_HEIGHT; + + /* BackGround Window Size */ + bg_width = full_width; + bg_height = full_height; + + /* Control Bar Window Size */ + ctl_bar_width = full_width; + ctl_bar_height = ICO_HS_CONTROLBAR_WINDOW_HEIGHT; + + // load switch display zone config + moveZoneName = config->ConfigGetString("switchzone", "movezone", NULL); + + moveZoneAnimation.name = (char*)config->ConfigGetString("switchzone", + "animation", + ICO_HS_ANIMATION_FADE); + + moveZoneAnimation.time = config->ConfigGetInteger("switchzone", + "animatime", 400); + + // debug log + ICO_DBG("moveZoneName=%s animation=%s time=%d", + moveZoneName, moveZoneAnimation.name, moveZoneAnimation.time); + + // AUL Listen Signal set(launch/dead) + initAulListenXSignal(); + + // application history class init. before call launchApps + InitializeAppHistory(); + + /* application history launch */ + t_launcApps_data* x = new t_launcApps_data; + CicoHSCmdOpts* cmdOpts = CicoHSCmdOpts::getInstance(); + x->filePath = cmdOpts->getHistoryFilePath(); + x->filePathD = cmdOpts->getDefaultHistoryFilePath(); + x->hs = this; + ecore_timer_add(0.01, launchApps, x); + /*Create window*/ CreateControlBarWindow(); @@ -1623,8 +1752,8 @@ CicoHomeScreen::StartHomeScreen() /*Show Home Screen*/ ShowHomeScreenLayer(); - /* start loop*/ - StartLoop(); + ICO_TRA("CicoHomeScreen::StartHomeScreen Leave"); + return 0; } /*--------------------------------------------------------------------------*/ @@ -1774,11 +1903,11 @@ CicoHomeScreen::setActiveApp(const char* appid) void CicoHomeScreen::SetNightMode(void* data) { - ICO_DBG("CicoHomeScreen::SetNightMode Enter"); + ICO_TRA("CicoHomeScreen::SetNightMode Enter"); // night mode action hs_instance->ctl_bar_window->SetNightMode(); hs_instance->menu_window->SetNightMode(); - ICO_DBG("CicoHomeScreen::SetNightMode Leave"); + ICO_TRA("CicoHomeScreen::SetNightMode Leave"); } /*--------------------------------------------------------------------------*/ @@ -1792,7 +1921,7 @@ CicoHomeScreen::SetNightMode(void* data) void CicoHomeScreen::SetRegulation(void* data) { - ICO_DBG("CicoHomeScreen::SetRegulation Enter"); + ICO_TRA("CicoHomeScreen::SetRegulation Enter"); // window control hs_instance->controlRegulation(); // regulation action @@ -1820,7 +1949,7 @@ CicoHomeScreen::SetRegulation(void* data) } } - ICO_DBG("CicoHomeScreen::SetRegulation Leave"); + ICO_TRA("CicoHomeScreen::SetRegulation Leave"); } /*--------------------------------------------------------------------------*/ @@ -1846,7 +1975,7 @@ CicoHomeScreen::RenewAppInfoList_i(void) } /* get APP information*/ - std::vector aillist = life_cycle_controller->getAilList(); + std::vector aillist = life_cycle_controller->getAilList(); /*create instance*/ for ( ii = 0; @@ -1915,9 +2044,9 @@ CicoHomeScreen::RenewAppInfoList_i(void) void CicoHomeScreen::RenewAppInfoList(void) { - ICO_DBG("CicoHomeScreen::RenewAppInfoList Enter"); + ICO_TRA("CicoHomeScreen::RenewAppInfoList Enter"); hs_instance->RenewAppInfoList_i(); - ICO_DBG("CicoHomeScreen::RenewAppInfoList Leave"); + ICO_TRA("CicoHomeScreen::RenewAppInfoList Leave"); } /*--------------------------------------------------------------------------*/ @@ -1948,27 +2077,29 @@ void CicoHomeScreen::startupCheckAdd(int pid, const std::string& appid, /*--------------------------------------------------------------------------*/ void CicoHomeScreen::startupCheck(const char* appid) { - ICO_TRA("start"); + ICO_TRA("CicoHomeScreen::startupCheck Enter"); if (NULL == life_cycle_controller) { - ICO_TRA("end"); + ICO_ERR("life_cycle_controller is null"); + ICO_TRA("CicoHomeScreen::startupCheck Leave"); return; } if (NULL == m_appHis) { - ICO_TRA("end"); + ICO_ERR("m_appHis is null"); + ICO_TRA("CicoHomeScreen::startupCheck Leave"); return; } if (false == m_appHis->isStartupChecking()) { - ICO_TRA("end"); + ICO_TRA("CicoHomeScreen::startupCheck Leave"); return; } m_appHis->update_appid(); m_appHis->startupEntryFinish(appid); if (false == m_appHis->isFinish()) { - ICO_TRA("end"); + ICO_TRA("CicoHomeScreen::startupCheck Leave"); return; } finishStartup(); - ICO_TRA("end"); + ICO_TRA("CicoHomeScreen::startupCheck Leave"); } /*--------------------------------------------------------------------------*/ @@ -1982,7 +2113,7 @@ void CicoHomeScreen::startupCheck(const char* appid) void CicoHomeScreen::finishStartup(void) { - ICO_TRA("start"); + ICO_TRA("CicoHomeScreen::finishStartup Enter"); string last = m_appHis->getLastStartupAppid(); const string& subDisp = m_appHis->getSubDispAppid(); @@ -2033,7 +2164,7 @@ void CicoHomeScreen::finishStartup(void) } m_appHis->stopStartupCheck(); - ICO_TRA("end"); + ICO_TRA("CicoHomeScreen::finishStartup Leave"); } /*--------------------------------------------------------------------------*/ @@ -2046,14 +2177,14 @@ void CicoHomeScreen::finishStartup(void) /*--------------------------------------------------------------------------*/ void CicoHomeScreen::readStartupApp(std::vector& apps) { - ICO_DBG("start"); + ICO_TRA("CicoHomeScreen::readStartupApp Enter"); if (NULL == m_appHis) { apps.clear(); } else { m_appHis->readAppHistory(apps); } - ICO_DBG("end (%d)", (int)apps.size()); + ICO_TRA("CicoHomeScreen::readStartupApp Leave(%d)", (int)apps.size()); return; } @@ -2112,7 +2243,7 @@ void CicoHomeScreen::requestShowAppid(const std::string& app) void CicoHomeScreen::requestActivationAppid(const std::string& app) { const char* appid = app.c_str(); - ICO_TRA("start %s", appid); + ICO_TRA("CicoHomeScreen::requestActivationAppid Enter(%s)", appid); CicoHSAppInfo *ai = GetAppInfo(appid); if (NULL == ai) { ICO_DBG("end %d", appid); @@ -2122,7 +2253,7 @@ void CicoHomeScreen::requestActivationAppid(const std::string& app) hs_instance->SetActiveAppInfo(app.c_str()); ico_syc_show(appid, surface, NULL); ico_syc_change_active(appid, surface); - ICO_TRA("end"); + ICO_TRA("CicoHomeScreen::requestActivationAppid Leave"); } /*--------------------------------------------------------------------------*/ @@ -2135,9 +2266,11 @@ void CicoHomeScreen::requestActivationAppid(const std::string& app) /*--------------------------------------------------------------------------*/ void CicoHomeScreen::controlRegulation(bool regStt) { - ICO_TRA("start %s", regStt? "true": "false"); + ICO_TRA("CicoHomeScreen::controlRegulation Enter(%s)", + regStt? "true": "false"); if (NULL == m_appHis) { - ICO_TRA("end"); + ICO_ERR("m_appHis is null"); + ICO_TRA("CicoHomeScreen::controlRegulation Leave"); return; } const string& wapp = m_appHis->getSelectApp(); // select appid get @@ -2151,7 +2284,7 @@ void CicoHomeScreen::controlRegulation(bool regStt) m_appHis->clearSelectApp(); // select appid clear m_appHis->homeSwipe(); } - ICO_TRA("end"); + ICO_TRA("CicoHomeScreen::controlRegulation Leave"); } /*--------------------------------------------------------------------------*/ @@ -2183,8 +2316,10 @@ CicoHomeScreen::ActivationUpdate(void) bool CicoHomeScreen::ActivationUpdate_i(void) { + ICO_TRA("CicoHomeScreen::ActivationUpdate_i Enter"); if (NULL == m_appHis) { - ICO_DBG("false"); + ICO_ERR("m_appHis is null"); + ICO_TRA("CicoHomeScreen::ActivationUpdate_i Leave(false)"); return false; } bool bR = false; @@ -2199,8 +2334,116 @@ CicoHomeScreen::ActivationUpdate_i(void) m_appHis->clearSelectApp(); // select appid clear m_appHis->homeSwipe(); } - ICO_DBG("%s", bR? "true": "false"); + ICO_TRA("CicoHomeScreen::ActivationUpdate_i Leave(%s)", + bR? "true": "false"); return bR; } +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHomeScreen::ShowApp_i + * show app + * + * @param app appid + */ +/*--------------------------------------------------------------------------*/ +void +CicoHomeScreen::ShowApp_i(const std::string& app) +{ + CicoHSAppInfo *appinfo = GetAppInfo(app.c_str()); + if (appinfo == NULL) { + ICO_TRA("end get appinfo is NULL"); + return; + } + + ico_syc_animation_t animation; + animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE; + animation.time = ICO_HS_MENU_ANIMATION_DURATION; + + ico_syc_show(appinfo->GetAppId(), appinfo->GetLastSurface(), &animation); + ico_syc_change_active(appinfo->GetAppId(), appinfo->GetLastSurface()); + hs_instance->SetActiveAppInfo(appinfo->GetAppId()); + //raise +// RaiseApplicationWindow(appinfo->GetAppId(), +// appinfo->GetLastSurface()); + ICO_DBG("raise app %s", app.c_str()); + m_appHis->moveHistoryHead(app); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHomeScreen::ShowApp + * show app + * + * @param app appid + */ +/*--------------------------------------------------------------------------*/ +void +CicoHomeScreen::ShowApp(const std::string& app) +{ + hs_instance->ShowApp_i(app); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHomeScreen::HideAppid + * hide app + * + * @param app appid + */ +/*--------------------------------------------------------------------------*/ +void +CicoHomeScreen::HideApp(const std::string& app) +{ + const char* appid = app.c_str(); + ICO_TRA("start %s", appid); + CicoHSAppInfo *ai = GetAppInfo(appid); + if (NULL == ai) { + ICO_DBG("end %d", appid); + return; + } + + ico_syc_animation_t animation; + animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE; + animation.time = ICO_HS_MENU_ANIMATION_DURATION; + + int surface = ai->GetLastSurface(); + ico_syc_hide(appid, surface, &animation); + ICO_TRA("end"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief CicoHomeScreen::MoveApp + * move app + * + * @param app appid + * @param zone zone + */ +/*--------------------------------------------------------------------------*/ +void +CicoHomeScreen::MoveApp(const std::string& app, const std::string& zone) +{ + CicoHSAppInfo *appinfo = GetAppInfo((const char*)app.c_str()); + if ((CicoHSAppInfo*)0 == appinfo) { + ICO_DBG("GetAppInfo(%s) is NULL" , app.c_str()); + return; + } + + int surface = appinfo->GetLastSurface(); + ico_hs_window_info* wininfo = appinfo->GetWindowInfobySurface(surface); + int layer = HS_LAYER_APPLICATION; + const char *dispzone = (const char*)zone.c_str(); + ico_syc_win_move_t move = { + .zone = (char*)dispzone, + .layer = layer, + .pos_x = 0, + .pos_y = 0, + .width = 0, + .height = 0 + }; + + ico_syc_move(wininfo->appid, wininfo->surface, &move, + &hs_instance->moveZoneAnimation); +} // vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHomeScreen.h b/src/homescreen/CicoHomeScreen.h index 6d672ce..52c0432 100644 --- a/src/homescreen/CicoHomeScreen.h +++ b/src/homescreen/CicoHomeScreen.h @@ -26,7 +26,7 @@ #include "CicoHomeScreenCommon.h" -#include "CicoHomeScreenConfig.h" +#include "CicoGKeyFileConfig.h" #include "CicoHSMenuWindow.h" #include "CicoHSBackWindow.h" #include "CicoHSControlBarWindow.h" @@ -34,8 +34,8 @@ #include "CicoHSWindowController.h" #include "CicoHSAppInfo.h" -#include "CicoSCSystemConfig.h" -#include "CicoSCLifeCycleController.h" +#include "CicoSystemConfig.h" +#include "CicoHSLifeCycleController.h" #include "CicoHSAppHistory.h" #include "CicoHSAppHistoryExt.h" @@ -58,11 +58,10 @@ #define ICO_HS_CONFIG_HOMESCREEN "homescreen" #define ICO_HS_CONFIG_ONSCREEN "onscreen" -#define ICO_HS_CONFIG_STATUBAR "statusbar" #define ICO_HS_CONFIG_SOUND "sound" #define ICO_HS_CONFIG_SB "statusbar" #define ICO_HS_CONFIG_ONS "onscreen" -#define ICO_HS_APPID_DEFAULT_SB "org.tizen.ico.statusbar" /* default status bar appid */ +#define ICO_HS_APPID_DEFAULT_SB "org.tizen.ico.statusbar" /* default statusbar appid */ #define ICO_HS_APPID_DEFAULT_ONS "org.tizen.ico.onscreen" /* default on screen appid */ #define ICO_HS_GROUP_SPECIAL "menu" @@ -76,10 +75,8 @@ class CicoHomeScreen public: CicoHomeScreen(void); ~CicoHomeScreen(void); - int Initialize(int orientation,CicoHomeScreenConfig *config); - void InitializeAppHistory(const std::string& user, const std::string& path, - const std::string& pathD, - const std::string& flagpath); + int Initialize(int orientation,CicoGKeyFileConfig *config); + void InitializeAppHistory(void); void Finalize(void); int StartRelations(); void CreateMenuWindow(void); @@ -92,7 +89,6 @@ class CicoHomeScreen void DeleteControlBarWindow(void); void CreateSwipeInputWindow(void); void DeleteSwipeInputWindow(void); - void StartLoop(void); char *GetHsPackageName(void); char *GetSbPackageName(void); char *GetOsPackageName(void); @@ -111,7 +107,7 @@ class CicoHomeScreen static CicoHSAppInfo *GetAppInfo(const char *appid); void SetMode(int mode); int GetMode(void); - void StartHomeScreen(); + int StartHomeScreen(int orientation); void UpdateTile(const char *appid); static void RenewAppInfoList(void); @@ -136,6 +132,9 @@ class CicoHomeScreen void controlRegulation(bool regStt=true); static bool ActivationUpdate(void); bool ActivationUpdate_i(void); + static void ShowApp(const std::string& app); + static void HideApp(const std::string& app); + static void MoveApp(const std::string& app, const std::string& zone); private: int GetProcessWindow(const char *appid); static void EventCallBack(ico_syc_ev_e event,const void* detail,void* user_data); @@ -148,6 +147,7 @@ class CicoHomeScreen static void SetNightMode(void* data); static void SetRegulation(void* data); + void ShowApp_i(const std::string& app); void RenewAppInfoList_i(void); /*application control(do not use now)*/ @@ -177,11 +177,11 @@ class CicoHomeScreen /*mode*/ int mode; /*configuration*/ - CicoHomeScreenConfig *config; + CicoGKeyFileConfig *config; /*my instance for callback*/ static CicoHomeScreen *hs_instance; - CicoSCLifeCycleController* life_cycle_controller; + CicoHSLifeCycleController* life_cycle_controller; CicoHSAppHistoryExt* m_appHis; // current sub display appinfo @@ -199,5 +199,5 @@ class CicoHomeScreen CicoHomeScreen operator=(const CicoHomeScreen&); CicoHomeScreen(const CicoHomeScreen&); }; - #endif +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHomeScreenCommon.h b/src/homescreen/CicoHomeScreenCommon.h index f9c1cec..fd073fd 100644 --- a/src/homescreen/CicoHomeScreenCommon.h +++ b/src/homescreen/CicoHomeScreenCommon.h @@ -129,3 +129,4 @@ #define ICO_HS_ANIMATION_DURATION (400) #endif +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoHomeScreenSound.cpp b/src/homescreen/CicoHomeScreenSound.cpp deleted file mode 100644 index 8a1d427..0000000 --- a/src/homescreen/CicoHomeScreenSound.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -/** - * @brief sound an operation of homescreen - * - * @date Apr-04-2013 - */ - -#include "CicoHomeScreenSound.h" - -/*============================================================================*/ -/* functions */ -/*============================================================================*/ - -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHomeScreenSound::ReadSoundConfiguration - * read configuration and set - * - * @param[in] homescreen_config configuration instance - * @param[in] type operation type - * @param[in] conf_name configuration name - * @return result - * @retval >=0 success - * @retval NULL err - */ -/*--------------------------------------------------------------------------*/ -CicoHomeScreenSoundConfig * -CicoHomeScreenSound::ReadSoundConfiguration(CicoHomeScreenConfig *homescreen_config, - int type, char *conf_name) -{ - char *file; - CicoHomeScreenSoundConfig *sound_config; - - sound_config = new CicoHomeScreenSoundConfig(); - if (sound_config == NULL) { - ICO_WRN("CicoHomeScreenSound::ReadSoundConfiguration: Leave(fail to alloc memory"); - return NULL; - } - - if (strcmp(conf_name, ICO_HS_SND_CNAME_DEFAULT) == 0) { - file = (char *)homescreen_config->ConfigGetString(ICO_HS_CONFIG_SOUND, - conf_name,ICO_HS_SND_FNAME_DEFAULT); - } - else { - file = (char *)homescreen_config->ConfigGetString(ICO_HS_CONFIG_HOMESCREEN, - conf_name,NULL); - } - - if (!file) { - ICO_ERR("CicoHomeScreenSound::ReadSoundConfiguration: Leave(given config is not exist"); - delete sound_config; - return NULL; - } - - sound_config->SetFile(file); - sound_config->SetType(type); - sound_config->SetNext(sound_files); - - sound_files = sound_config; - - return sound_config; -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHomeScreenSound::CicoHomeScreenSound - * constractor - * - * @param none - * @return none - */ -/*--------------------------------------------------------------------------*/ -CicoHomeScreenSound::CicoHomeScreenSound(void){ - snd_is_initialize = false; - sound_files = NULL; -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief Initialize - * initialize to sound a operation - * - * @param[in] homescreen_config configuration instance - * @return result - * @retval ICO_HS_OK success - * @retval ICO_HS_ERR err - */ -/*--------------------------------------------------------------------------*/ -int -CicoHomeScreenSound::Initialize(CicoHomeScreenConfig *homescreen_config) -{ - if (snd_is_initialize != true) { - /* read sound file name from configuration */ - ReadSoundConfiguration(homescreen_config,ICO_HS_SND_TYPE_DEFAULT, - const_cast(ICO_HS_SND_CNAME_DEFAULT)); - - CicoHomeScreenResourceConfig::GetSoundPath(soundpath, sizeof(soundpath)); - snd_is_initialize = true; - } - - return ICO_HS_OK; -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHomeScreenSound::PlaySound - * play the given sound file(.wav). - * - * @param[in] wav_file wav formated file. - * @return result - * @retval ICO_HS_OK success - * @retval ICO_HS_ERR err - */ -/*--------------------------------------------------------------------------*/ -int -CicoHomeScreenSound::PlaySound(char *wav_file) -{ - int pid; - char command[ICO_HS_TEMP_BUF_SIZE]; - - if (snd_is_initialize != true) { - return ICO_HS_ERR; - } - - if (!wav_file) { - ICO_WRN("CicoHomeScreenSound::PlaySound: Leave(error file name is NULL"); - return ICO_HS_ERR; - } - - if (wav_file[0] == '/') { - /* given by full file path */ - snprintf(command, sizeof(command), - "paplay --stream-name=HOMESCREEN_BEEP %s", wav_file); - } - else { - snprintf(command, sizeof(command), - "paplay --stream-name=HOMESCREEN_BEEP %s/%s", soundpath, wav_file); - } - - ICO_DBG("CicoHomeScreenSound::PlaySound: system(%s)", command); - pid = fork(); - if (!pid) { - system(command); - exit(0); - } - - return ICO_HS_OK; -} - - -/*--------------------------------------------------------------------------*/ -/** - * @brief hs_snd_get_filename - * get the file name by given operation type - * - * @param[in] type operation type - * @return pointer to the file name - * @retval >=0 success - * @retval NULL err - */ -/*--------------------------------------------------------------------------*/ -char * -CicoHomeScreenSound::GetSoundFileName(int type) -{ - CicoHomeScreenSoundConfig *sound_config; - - if (snd_is_initialize != true) { - return NULL; - } - - sound_config = sound_files; - while (sound_config != NULL) { - if (sound_config->GetType() == type) { - return sound_config->GetFile(); - } - sound_config = sound_config->GetNext(); - } - - return NULL; -} - diff --git a/src/homescreen/CicoHomeScreenSound.h b/src/homescreen/CicoHomeScreenSound.h deleted file mode 100644 index 7d5b68b..0000000 --- a/src/homescreen/CicoHomeScreenSound.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __CICOHOMESCREENSOUND_H__ -#define __CICOHOMESCREENSOUND_H__ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -/** - * @brief sound an operation of homescreen - * - * @date Apr-04-2013 - */ - -#include -#include -#include -#include -#include - -//#include "ico_uxf.h" -//#include "ico_uxf_conf_def.h" -//#include "home_screen.h" -#include "CicoHomeScreenCommon.h" -#include "CicoHomeScreenConfig.h" -#include "CicoHomeScreenResourceConfig.h" -#include "CicoHomeScreenSoundConfig.h" - -/* define for sound configuration */ -#define ICO_HS_SND_TYPE_DEFAULT (1) - -#define ICO_HS_SND_CNAME_DEFAULT "sound_default" -#define ICO_HS_SND_FNAME_DEFAULT "default.wav" - - -/*============================================================================*/ -/* Class Declaration (CicoHomeScreenSound) */ -/*============================================================================*/ -class CicoHomeScreenSound -{ - public: - CicoHomeScreenSound(void); - CicoHomeScreenSoundConfig *ReadSoundConfiguration(CicoHomeScreenConfig *homescreen_config, - int type,char *conf_name); - int Initialize(CicoHomeScreenConfig *homescreen_config); - int PlaySound(char *wav_file); - char *GetSoundFileName(int type); - private: - int snd_is_initialize; - CicoHomeScreenSoundConfig *sound_files; - char soundpath[ICO_HS_TEMP_BUF_SIZE]; - protected: - CicoHomeScreenSound operator = (const CicoHomeScreenSound&); - CicoHomeScreenSound(const CicoHomeScreenSound&); -}; - -#endif diff --git a/src/homescreen/CicoHomeScreenSoundConfig.cpp b/src/homescreen/CicoHomeScreenSoundConfig.cpp deleted file mode 100644 index 0bda5a6..0000000 --- a/src/homescreen/CicoHomeScreenSoundConfig.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -/** - * @brief sound an operation of homescreen - * - * @date Apr-04-2013 - */ - -#include "CicoHomeScreenSoundConfig.h" - -/*============================================================================*/ -/* functions */ -/*============================================================================*/ - -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHomeScreenSoundConfig::SetFile - * set sound file name - * - * @param[in] file_tmp sound file name - * @return none - */ -/*--------------------------------------------------------------------------*/ -void -CicoHomeScreenSoundConfig::SetFile(char *file_tmp) -{ - file = file_tmp; -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHomeScreenSoundConfig::GetFile - * get sound file name - * - * @param[in] none - * @return sound file name - */ -/*--------------------------------------------------------------------------*/ -char* -CicoHomeScreenSoundConfig::GetFile(void) -{ - return file; -} -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHomeScreenSoundConfig::SetType - * set sound type - * - * @param[in] type_tmp the value to set type - * @return none - */ -/*--------------------------------------------------------------------------*/ -void -CicoHomeScreenSoundConfig::SetType(int type_tmp) -{ - type = type_tmp; -} -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHomeScreenSoundConfig::GetType - * get sound type - * - * @param[in] none - * @return type - */ -/*--------------------------------------------------------------------------*/ -int -CicoHomeScreenSoundConfig::GetType(void) -{ - return type; -} -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHomeScreenSoundConfig::SetNext - * set next instance - * - * @param[in] next instance - * @return none - */ -/*--------------------------------------------------------------------------*/ -void -CicoHomeScreenSoundConfig::SetNext(CicoHomeScreenSoundConfig *next_tmp) -{ - next = next_tmp; -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief CicoHomeScreenSoundConfig::GetNext - * get next instance - * - * @param[in] none - * @return next instance - */ -/*--------------------------------------------------------------------------*/ -CicoHomeScreenSoundConfig* -CicoHomeScreenSoundConfig::GetNext(void) -{ - return next; -} - diff --git a/src/homescreen/CicoHomeScreenSoundConfig.h b/src/homescreen/CicoHomeScreenSoundConfig.h deleted file mode 100644 index 107f652..0000000 --- a/src/homescreen/CicoHomeScreenSoundConfig.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef __HOMESCREENSOUNDCONFIG_H__ -#define __HOMESCREENSOUNDCONFIG_H__ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -/** - * @brief sound an operation of homescreen - * - * @date Apr-04-2013 - */ - -#include -#include -#include -#include -#include - -#include "CicoHomeScreenConfig.h" -#include "CicoHomeScreenResourceConfig.h" - -/*============================================================================*/ -/* Class Declaration (CicoHomeScreenSoundConfig) */ -/*============================================================================*/ -class CicoHomeScreenSoundConfig -{ - public: - CicoHomeScreenSoundConfig(){}; - void SetFile(char *file_tmp); - char *GetFile(void); - void SetType(int type_tmp); - int GetType(void); - void SetNext(CicoHomeScreenSoundConfig *next_tmp); - CicoHomeScreenSoundConfig *GetNext(void); - private: - CicoHomeScreenSoundConfig *next; - int type; /* operation type */ - char *file; /* sound file name */ - protected: - CicoHomeScreenSoundConfig operator=(const CicoHomeScreenSoundConfig&); - CicoHomeScreenSoundConfig(const CicoHomeScreenSoundConfig&); -}; - -#endif diff --git a/src/homescreen/CicoLog.cpp b/src/homescreen/CicoLog.cpp deleted file mode 100644 index 4e51269..0000000 --- a/src/homescreen/CicoLog.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -/** - * @brief Application Framework debug log function - * - * @date Feb-28-2013 - */ - -#include -#include "CicoLog.h" - -CicoLog* CicoLog::ms_myInstance = NULL; -int CicoLog::m_sTimeZone = 99*60*60; - -CicoLog::CicoLog() - : m_logLevel(0x7fffffff), m_flushMode(true), m_initialized(false), - m_sDbgFd(NULL), m_sDbgLines(0) -{ - memset(&m_sDbgProg[0], 0, sizeof(m_sDbgProg)); -} - -CicoLog::~CicoLog() -{ - closeLog(); -} - -CicoLog* -CicoLog::getInstance(void) -{ - if (NULL == ms_myInstance) { - ms_myInstance = new CicoLog(); - } - return ms_myInstance; -} -/*--------------------------------------------------------------------------*/ -/** - * @brief ico_apf_log_print: printout log message - * - * @param[in] fmt message format(same as printf) - * @param[in] ... arguments if need - * @return nothing - */ -/*--------------------------------------------------------------------------*/ -void -CicoLog::printLog(int loglevel, const char *fmt, ...) -{ - if (m_logLevel < loglevel) { - return; - } - va_list list; - - if (! m_sDbgFd) { - openLog(NULL); - } -#if ICO_APF_LOG_STDOUT == 0 - else if (m_sDbgLines >= (ICO_LOG_MAXLINES-2)) { - if (m_sDbgLines >= ICO_LOG_MAXLINES) { - closeLog(); - openLog(m_sDbgProg); - } - else { - fflush(m_sDbgFd); - } - } -#endif /*ICO_APF_LOG_STDOUT*/ - if (m_sDbgFd) { - va_start(list, fmt); - vfprintf(m_sDbgFd, fmt, list); - va_end(list); - if (m_flushMode) { - fflush(m_sDbgFd); - } - } - if (m_sDbgFd != stdout) { - m_sDbgLines ++; - } -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief open: open log file - * - * @param[in] prog program name - * @return nothing - */ -/*--------------------------------------------------------------------------*/ -void -CicoLog::openLog(const char *prog) -{ -#if ICO_LOG_STDOUT == 0 - int idx; - char sPath[128]; - char sPath2[128]; -#endif /*ICO_LOG_STDOUT*/ - - if (m_sDbgFd) { - fflush(m_sDbgFd); - if (m_sDbgFd != stdout) { - fclose(m_sDbgFd); - } - } - - m_sDbgLines = 0; - - if ((! prog) || (*prog == 0)) { - m_sDbgFd = stdout; - m_sDbgProg[0] = 0; - return; - } - else { - strncpy(m_sDbgProg, prog, sizeof(m_sDbgProg)-1); - m_sDbgProg[sizeof(m_sDbgProg)-1] = 0; - } -#if ICO_LOG_STDOUT > 0 - m_sDbgFd = stdout; -#else /*ICO_LOG_STDOUT*/ - snprintf(sPath, sizeof(sPath)-1, "%s/%s.log%d", - ICO_LOG_DIR, m_sDbgProg, ICO_LOG_MAXFILES-1); - (void) remove(sPath); - - for (idx = (ICO_LOG_MAXFILES-1); idx > 0; idx--) { - strcpy(sPath2, sPath); - if (idx > 1) { - snprintf(sPath, sizeof(sPath)-1, "%s/%s.log%d", - ICO_LOG_DIR, m_sDbgProg, idx-1); - } - else { - snprintf(sPath, sizeof(sPath)-1, "%s/%s.log", - ICO_LOG_DIR, m_sDbgProg); - } - (void) rename(sPath, sPath2); - } - m_sDbgFd = fopen(sPath, "w"); - if (! m_sDbgFd) { - m_sDbgFd = stdout; - } - else if ((m_initialized == false) && - (m_sDbgFd != stdout) && (m_sDbgFd != stderr)) { - m_initialized = true; - fflush(stdout); - fflush(stderr); - stdout = m_sDbgFd; - stderr = m_sDbgFd; - } -#endif /*ICO_LOG_STDOUT*/ -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief closeLog: close log file - * - * @param nothing - * @return nothing - */ -/*--------------------------------------------------------------------------*/ -void -CicoLog::closeLog(void) -{ -#if ICO_LOG_STDOUT == 0 - if (m_sDbgFd) { - fflush(m_sDbgFd); - if (m_sDbgFd != stdout) { - fclose(m_sDbgFd); - } - m_sDbgFd = (FILE *)0; - } -#endif /*ICO_LOG_STDOUT*/ -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief flushLog: flush log file - * - * @param nothing - * @return nothing - */ -/*--------------------------------------------------------------------------*/ -void -CicoLog::flushLog(void) -{ - if ((m_sDbgFd != NULL) && (m_flushMode == 0)) { - fflush(m_sDbgFd); - } -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief getStrCurtime: create current time string - * - * @param[in] level log level string(header of log message) - * @return current time string - */ -/*--------------------------------------------------------------------------*/ -char * -CicoLog::getStrCurTime(const char *level) -{ - struct timeval NowTime; - extern long timezone; - static char sBuf[28]; - - gettimeofday(&NowTime, (struct timezone *)0); - if (m_sTimeZone > (24*60*60)) { - tzset(); - m_sTimeZone = timezone; - } - NowTime.tv_sec -= m_sTimeZone; - - sprintf(sBuf, "%02d:%02d:%02d.%03d[%s]@%d", - (int)((NowTime.tv_sec/3600) % 24), - (int)((NowTime.tv_sec/60) % 60), - (int)(NowTime.tv_sec % 60), - (int)NowTime.tv_usec/1000, level, getpid()); - - return sBuf; -} - -/*--------------------------------------------------------------------------*/ -/** - * @brief setLogLevel: set log output level - * - * @param[in] loglevel log output level - * @return nothing - */ -/*--------------------------------------------------------------------------*/ -void -CicoLog::setLogLevel(const int loglevel) -{ - m_logLevel = loglevel & (~(ICO_LOG_FLUSH|ICO_LOG_NOFLUSH)); - - if (m_logLevel & (ICO_LOG_FLUSH|ICO_LOG_NOFLUSH)) { - if (m_logLevel & ICO_LOG_FLUSH) { - m_flushMode = true; - } - else { - m_flushMode = false; - } - } -} -// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoLog.h b/src/homescreen/CicoLog.h deleted file mode 100644 index bd04cf0..0000000 --- a/src/homescreen/CicoLog.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ - -/*========================================================================*/ -/** - * @file CicoLog.h - * - * @brief debug log function - */ -/*========================================================================*/ -#ifndef __CICO_LOG_H__ -#define __CICO_LOG_H__ - -#include - -#endif // __CICO__LOG_H__ -/* vim:set expandtab ts=4 sw=4: */ diff --git a/src/homescreen/CicoSCAilItems.cpp b/src/homescreen/CicoSCAilItems.cpp deleted file mode 100644 index c4676b3..0000000 --- a/src/homescreen/CicoSCAilItems.cpp +++ /dev/null @@ -1,770 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -#include -#include -#include -#include -#include -#include - -#include "CicoSCAilItems.h" -#include "CicoSCConf.h" -#include "CicoSCSystemConfig.h" -#include "CicoLog.h" - -using namespace std; - -void split(const string &s, char d, vector &e) -{ - stringstream ss(s); - string it; - while(getline(ss, it, d)) { - e.push_back(it); - } - return; -} - -/** - * @brief constructor - */ -CicoSCAilItems::CicoSCAilItems() -{ - ICO_TRA("start"); - init(); - ICO_TRA("end"); -} - -/** - * @brief constructor - * @param pkg package name(appid) by ail infomation data - * @param icon icon path and file name by ail infomation data - * @param nam name by ail infomation data - * @param ctgry category by ail infomation data - * @param exe exec path by ail infomation data - * @param cateforys environ file data - */ -CicoSCAilItems::CicoSCAilItems(const char* pkg, const char* icon, - const char* nam, const char* ctgry, - const char* typ, const char* exe, - const std::string categorys, bool ndisp) -{ - ICO_TRA("start"); - init(); - setup(pkg, icon, nam, ctgry, typ, exe, categorys, ndisp); - ICO_TRA("end"); -} - -CicoSCAilItems::CicoSCAilItems(const CicoSCAilItems &s) -{ - m_appid = s.m_appid; // PACKAGE NAME - m_icon = s.m_icon; // ICON - m_name = s.m_name; // NAME - m_execPath = s.m_execPath; // EXEC - m_type = s.m_type; // TYPE - - m_categories = s.m_categories; // CATEGORIES - - m_nodeID = s.m_nodeID; // "run=xxx" xxx change to id - m_kindID = s.m_kindID; // "kind=xxx" xxx change to id - m_categoryID = s.m_categoryID; // "category=xxx" xxx change to id - - m_display = s.m_display; // - m_layer = s.m_layer; - m_displayZone = s.m_displayZone; // display zone number - m_soundZone = s.m_soundZone; // sound zone number - m_sound = s.m_sound; - m_inputDev = s.m_inputDev; // input device number - m_switch = s.m_switch; - m_noIcon = s.m_noIcon; - m_animation = s.m_animation; - m_animationTime = s.m_animationTime; - m_invisibleCPU = s.m_invisibleCPU; - m_memnuOverlap = s.m_memnuOverlap; - m_autoStart = s.m_autoStart; // auto start flag - - m_group = s.m_group; - m_location = s.m_location; - m_resumeShow = s.m_resumeShow; -} - -/** - * @brief - */ -CicoSCAilItems::~CicoSCAilItems() -{ - ICO_TRA("start"); - ICO_TRA("end"); -} -/** - * @brief init member - */ -void CicoSCAilItems::init() -{ - - m_appid.clear(); // PACKAGE NAME - m_icon.clear(); // ICON - m_name.clear(); // NAME - m_execPath.clear(); // EXEC - m_type.clear(); // TYPE - - m_categories.clear(); // CATEGORIES - - const CicoSCDefaultConf* oCSCDC; - oCSCDC = CicoSCSystemConfig::getInstance()->getDefaultConf(); - if (NULL != oCSCDC) { - ICO_TRA("CicoSCAilItems::init base CicoSCDefaultConf"); - m_nodeID = oCSCDC->node; - m_kindID = oCSCDC->appkind; - m_categoryID = oCSCDC->category; - - m_display = oCSCDC->display; - m_layer = oCSCDC->layer; - m_displayZone = oCSCDC->displayzone; - - m_sound = oCSCDC->sound; - m_soundZone = oCSCDC->soundzone; - - m_inputDev = oCSCDC->inputdev; - m_switch = oCSCDC->inputsw; - } - else { - ICO_TRA("CicoSCAilItems::init base define"); - m_nodeID = DINITm_nodeID; // "run=xxx" xxx change to id - m_kindID = DINITm_kindID; // "kind=xxx" xxx change to id - m_categoryID = DINITm_categoryID; // "category=xxx" xxx change to id - - m_display = DINITm_display; // - m_layer = DINITm_layer; - m_displayZone = DINITm_displayZone; // display zone - - m_soundZone = DINITm_soundZone; // sound zone - m_sound = DINITm_sound; - - m_inputDev = DINITm_inputDev; // input device - m_switch = DINITm_switch; - } - - m_noIcon = false; - m_animation.clear(); - m_animationTime = DINITm_animationTime; - m_invisibleCPU = DINITm_invisibleCPU; - m_memnuOverlap = false; - m_autoStart = false; // auto start flag - - m_group.clear(); - m_location.clear(); - m_resumeShow = false; -} - -/** - * @brief constructor - * @param pkg package name(appid) by ail infomation data - * @param icon icon path and file name by ail infomation data - * @param nam name by ail infomation data - * @param ctgry category by ail infomation data - * @param exe exec path by ail infomation data - * @param cateforys environ file data - */ -void CicoSCAilItems::setup(const char* pkg, const char* icon, - const char* nam, const char* ctgry, - const char* typ, const char* exe, - std::string categorys, bool ndisp) -{ - ICO_TRA("start"); - m_appid.assign(pkg); - ICO_DBG("package name=%s", pkg? pkg: "(NULL)"); - - m_noIcon = ndisp; - if (NULL != icon) { - m_icon.assign(icon); - ICO_DBG("icon path=%s", icon? icon: "(NULL)"); - } - - if (NULL != nam) { - m_name.assign(nam); - ICO_DBG("name=%s", nam? nam: "(NULL)"); - } - - if (NULL != exe) { - m_execPath.assign(exe); - ICO_DBG("exec path=%s", exe? exe: "(NULL)"); - } - - if (NULL != typ) { - m_type.assign(typ); - ICO_DBG("type=%s", typ? typ: "(NULL)"); - } - - categoryParse(categorys); - ICO_TRA("end"); -} - -const string s_run("run"); -const string s_kind("kind"); -const string s_category("category"); -const string s_display("display"); -const string s_layer("layer"); -const string s_dispzone("dispzone"); -const string s_sound("sound"); -const string s_input("input"); -const string s_NoDisplay("NoDisplay"); -const string s_Animation("Animation"); -const string s_invisiblecpu("invisiblecpu"); -const string s_noconfigure("noconfigure"); -const string s_menuoverlap("menuoverlap"); -const string s_auto("auto"); -const string s_noauto("noauto"); - -const string s_soundzone("soundzone"); -const string s_Animation_time("Animation_time"); - -/** - * @brief category string parse - * @parm category string data split code ";" - */ -void CicoSCAilItems::categoryParse(const std::string categorys) -{ - ICO_TRA("start"); - if (categorys.empty()) { - ICO_TRA("end no category"); - return; - } - vector x; - split(categorys, ';', x); - vector::iterator it = x.begin(); // iterator - string displayName; - string layerName; - string dispZoneName; - string soundName; - string soundZoneName; - string inputDevName; - string switchName; - - displayName.clear(); - layerName.clear(); - dispZoneName.clear(); - soundName.clear(); - soundZoneName.clear(); - inputDevName.clear(); - switchName.clear(); - - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); - - ICO_DBG("category def size = %d", x.size()); - for (it = x.begin(); it != x.end(); it++) { - - // run - if (0 == strncasecmp(it->c_str(), s_run.c_str(), s_run.size())) { - if (true == categoryParseRun(*it)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // kind - if (0 == strncasecmp(it->c_str(), s_kind.c_str(), s_kind.size())) { - if (true == categoryParseKind(*it)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // category - if (0 == strncasecmp(it->c_str(), s_category.c_str(), - s_category.size())) { - if (true == categoryParseCategory(*it)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // display - if (0 == strncasecmp(it->c_str(), s_display.c_str(), - s_display.size())) { - if (true == categoryParseGetValue(*it, s_display, displayName)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // layer - if (0 == strncasecmp(it->c_str(), s_layer.c_str(), s_layer.size())) { - if (true == categoryParseGetValue(*it, s_layer, layerName)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // dispzone - if (0 == strncasecmp(it->c_str(), s_dispzone.c_str(), - s_dispzone.size())) { - if (true == categoryParseGetValue(*it, s_dispzone, dispZoneName)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // sound / soundzone - if (0 == strncasecmp(it->c_str(), s_soundzone.c_str(), - s_soundzone.size())) { - if (true == categoryParseGetValue(*it, s_soundzone, - soundZoneName)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - if (0 == strncasecmp(it->c_str(), s_sound.c_str(), s_sound.size())) { - if (true == categoryParseGetValue(*it, s_sound, soundName)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // input - if (0 == strncasecmp(it->c_str(), s_input.c_str(), s_input.size())) { - if (true == categoryParseGetValue(*it, s_input, inputDevName)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } -// TODO mk_k not get switchName -// switchName -// TODO mk_k not get switchName - - // NoDisplay - if (0 == strncasecmp(it->c_str(), s_NoDisplay.c_str(), - s_NoDisplay.size())) { - if (true == categoryParseNodisplay(*it)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // Animation / Animation_time - if (0 == strncasecmp(it->c_str(), s_Animation.c_str(), - s_Animation.size())) { - if (true == categoryParseAnimation(*it)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // invisiblecpu - if (0 == strncasecmp(it->c_str(), s_invisiblecpu.c_str(), - s_invisiblecpu.size())) { - if (true == categoryParseInvisiblecpu(*it)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // noconfigure - if (0 == strncasecmp(it->c_str(), s_noconfigure.c_str(), - s_noconfigure.size())) { - if (true == categoryParseNoconfigure(*it)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // menuoverlap - if (0 == strncasecmp(it->c_str(), s_menuoverlap.c_str(), - s_menuoverlap.size())) { - if (true == categoryParseMenuoverlap(*it)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // auto - if (0 == strncasecmp(it->c_str(), s_auto.c_str(), s_auto.size())) { - if (true == categoryParseAuto(*it)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - // noauto - if (0 == strncasecmp(it->c_str(), s_noauto.c_str(), - s_noauto.size())) { - if (true == categoryParseNoauto(*it)) { - ICO_DBG("Parse OK %s", it->c_str()); - continue; - } - } - - int categoryID = CSCSC->getCategoryIdbyName(*it); - const char* ttt = it->c_str()? it->c_str(): "(NULL)"; - ICO_DBG("Category %s->%d", ttt, categoryID); - if (-1 != categoryID) { - ICO_DBG("Category %d -> %d(%s)", m_categoryID, categoryID, ttt); - m_categoryID = categoryID; - continue; - } - - ICO_DBG("Parse UNKOWN %s", it->c_str()); - } - categoryGetDisplay(displayName, layerName, dispZoneName); - categoryGetSound(soundName, soundZoneName); - categoryGetInput(inputDevName, switchName); - ICO_TRA("end"); -} - -/** - * @brief category string parse - * @param category string - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryParseRun(const string& s) -{ - ICO_TRA("start"); - const char* ps = s.c_str(); - int c = s_run.size(); - if ('=' != ps[c]) { - ICO_TRA("end"); - return false; - } - // "run=xxx" -// TODO mk_k START getHostID(..) request order - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); - int nodeID = CSCSC->getNodeIdbyName(&ps[c+1]); -// TODO mk_k int nodeID = -1; -// TODO mk_k int nodeID = CSCSC->getHostID(&ps[c+1]); -// TODO mk_k END getHostID(..) request order - if (nodeID==-1) { - ICO_TRA("end"); - return false; - } - m_nodeID = nodeID; - ICO_TRA("end %d", m_nodeID); - return true; -} - -/** - * @brief category string parse - * @param category string - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryParseKind(const string& s) -{ - ICO_TRA("start"); - const char* ps = s.c_str(); - int c = s_kind.size(); - if ('=' != ps[c]) { - ICO_TRA("end"); - return false; - } - // "kind=xxx" xxx change to id - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); - int kindID = CSCSC->getAppKindIdbyName(&ps[c+1]); - if (kindID==-1) { - ICO_TRA("end"); - return false; - } - m_kindID = kindID; - ICO_TRA("end %d", m_kindID); - return true; -} - -/** - * @brief category string parse - * @param category string - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryParseCategory(const string& s) -{ - ICO_TRA("start"); - const char* ps = s.c_str(); - int c = s_category.size(); - if ('=' != ps[c]) { - ICO_TRA("end"); - return false; // not "category=xxx" - } - // "category=xxx" xxx change to id - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); - int categoryID = CSCSC->getCategoryIdbyName(&ps[c+1]); - if (categoryID==-1) { - ICO_TRA("end"); - return false; // unkown category xxx - } - m_categoryID = categoryID; - ICO_TRA("end"); - return true; -} - -/** - * @brief value get - * @param s "key=value" string - * @param k key string - * @param val store value - * @retval true get value success - * @retval false get not good - */ -bool CicoSCAilItems::categoryParseGetValue(const std::string& s, - const std::string& k, - std::string & val) -{ - ICO_TRA("start, %s, %s", s.c_str(), k.c_str()); - const char* ps = s.c_str(); - int c = k.size(); - int c2; -#if 0 // TODO mk_k x!? - int x = -1; -#endif // TODO mk_k x!? - if ('=' == ps[c]) { -#if 0 // TODO mk_k x!? - x = 0; -#endif // TODO mk_k x!? - c2 = c+1; - } -#if 0 // TODO mk_k .[0-9] !? - else if (('.' == ps[c]) && - (0 != isdigit((int)ps[c+1])) && - ('=' == ps[c+2])) { - x = (int) ps[c+1] - '0'; - c2 = c+3; - - } -#endif // TODO mk_k .[0-9] !? - else { - ICO_TRA("end NG"); - return false; - } - val = s.substr(c2); - ICO_TRA("end %s", val.c_str()); - return true; -} - -/** - * @brief get - * @param disp display key name - * @param layer display layer key name - * @param zone display zone key name - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryGetDisplay(const string& disp, - const string& layer, - const string& zone) -{ - ICO_TRA("start"); - if (true == disp.empty()) { - ICO_TRA("end not get display's data"); - return false; - } - - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); - m_display = CSCSC->getDisplayIdbyName(disp); - ICO_DBG("display %s->%d", disp.c_str(), m_display); - if (false == layer.empty()) { - m_layer = CSCSC->getLayerIdfbyName(disp, layer); - ICO_DBG("layer %s, %s->%d", disp.c_str(), layer.c_str(), m_layer); - } - if (false == zone.empty()) { - m_displayZone = CSCSC->getDizplayZoneIdbyName(disp, zone); - ICO_DBG("zone %s, %s->%d", disp.c_str(), zone.c_str(), m_displayZone); - } - ICO_TRA("end d:%d l:%d z:%d", m_display, m_layer, m_displayZone); - return true; -} - -/** - * @brief get sound config data - * @param sound name key - * @param soundZone name key - * @retval true get data - * @retval false param fail - */ -bool CicoSCAilItems::categoryGetSound(const string& sound, const string& zone) -{ - ICO_TRA("start"); - if (true == sound.empty()) { - ICO_TRA("end not get sound's data"); - return false; - } - - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); - m_sound = CSCSC->getSoundIdbyName(sound); - ICO_DBG("sound %s->%d", sound.c_str(), m_sound); - if (false == zone.empty()) { - m_soundZone = CSCSC->getSoundZoneIdbyName(sound, zone); - ICO_DBG("zone %s, %s->%d", sound.c_str(), zone.c_str(), m_soundZone); - } - ICO_TRA("end s:%d z:%d", m_sound, m_soundZone); - return true; -} - -bool CicoSCAilItems::categoryGetInput(const string& inputDev, - const string& sw) -{ - ICO_TRA("start"); - if (true == inputDev.empty()) { - ICO_TRA("end not get input Device's data"); - return false; - } - - CicoSCSystemConfig* CSCSC = CicoSCSystemConfig::getInstance(); - m_sound = CSCSC->getInputDevIdbyName(inputDev); - ICO_DBG("sound %s->%d", inputDev.c_str(), m_sound); - if (false == sw.empty()) { - m_switch = CSCSC->getSwitchIdbyName(inputDev, sw); - ICO_DBG("switch %s, %s->%d", inputDev.c_str(), sw.c_str(), m_switch); - } - ICO_TRA("end idev:%d i:%d", m_inputDev, m_switch); - return true; -} - -/** - * @brief category string parse - * @param category string - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryParseNodisplay(const string& s) -{ - ICO_TRA("start"); - const char* ps = s.c_str(); - int c = s_NoDisplay.size(); - if ('=' != ps[c]) { - ICO_TRA("end"); - return false; // not "NoDisplay=true/false" - } - if (0 == strcasecmp(&ps[c+1], "false")) { - m_noIcon = false; - } - else { - m_noIcon = true; - } - ICO_TRA("end"); - return true; -} - -/** - * @brief category string parse - * @param category string - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryParseAnimation(const string& s) -{ - ICO_TRA("start"); - const char* ps = s.c_str(); - int c = s_Animation_time.size(); - bool b_at = false; // animation time flag off - if (0 == strncasecmp(ps, s_Animation_time.c_str(), c)) { - b_at = true; // flag on - } - else { - c = s_Animation.size(); // not Animation_time - } - if ('=' != ps[c]) { - ICO_TRA("end"); - return false; // not "Animation=xxx" / "Animation_time=xxx" - } - if (true == b_at) { - // Animation_time - m_animationTime = (int)strtol(&ps[c+1], (char **)0, 0); - } - else { - // Animation - m_animation = &ps[c+1]; - } - ICO_TRA("end"); - return true; -} - -/** - * @brief category string parse - * @param category string - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryParseInvisiblecpu(const string& s) -{ - ICO_TRA("start"); - const char* ps = s.c_str(); - int c = s_invisiblecpu.size(); - if ('=' != ps[c]) { - ICO_TRA("end"); - return false; // not "invisibluecpu=xxx" - } - if (0 == strcasecmp(&ps[c+1], "yes")) { - m_invisibleCPU = 100; - } - else if (0 != strcasecmp(&ps[c+1], "no")) { - m_invisibleCPU = (int)strtol(&ps[c+1], (char **)0, 0); - } - else { // "no" - m_invisibleCPU = 0; - } - ICO_TRA("end %s,%d", &ps[c+1], m_invisibleCPU); - return true; -} - -/** - * @brief category string parse - * @param category string - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryParseNoconfigure(const string&) -{ -// TODO mk_k - ICO_TRA("start"); -// m_noconfigure = true; - ICO_TRA("end"); -// return true; - return false; -} - -/** - * @brief category string parse - * @param category string - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryParseMenuoverlap(const string&) -{ - ICO_TRA("start"); - m_memnuOverlap = true; - ICO_TRA("end"); - return true; -} - -/** - * @brief category string parse - * @param category string - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryParseAuto(const string&) -{ - ICO_TRA("start"); - m_autoStart = true; - ICO_TRA("end"); - return true; -} - -/** - * @brief category string parse - * @param category string - * @retval true parse success - * @retval false parse fail - */ -bool CicoSCAilItems::categoryParseNoauto(const string&) -{ - ICO_TRA("start"); - m_autoStart = false; - ICO_TRA("end"); - return true; -} - diff --git a/src/homescreen/CicoSCAilItems.h b/src/homescreen/CicoSCAilItems.h deleted file mode 100644 index 596dd50..0000000 --- a/src/homescreen/CicoSCAilItems.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -#ifndef CICOSCAILITEMS_H -#define CICOSCAILITEMS_H -#include -#include -#include - - -#define DINITm_nodeID -1 -#define DINITm_kindID -1 -#define DINITm_categoryID -1 -#define DINITm_display -1 -#define DINITm_layer -1 -#define DINITm_displayZone -1 -#define DINITm_soundZone -1 -#define DINITm_sound -1 -#define DINITm_inputDev -1 -#define DINITm_switch -1 -#define DINITm_animationTime 0 -#define DINITm_invisibleCPU 0 - -/** - * @brief AIL infomation data class - * - */ - -class CicoSCAilItems { -public: // member method - CicoSCAilItems(); - CicoSCAilItems(const char* pkg, const char* icon, const char* nam, - const char* ctgry, const char* typ, const char* exe, - std::string categorys, bool ndisp); - CicoSCAilItems(const CicoSCAilItems& rAilItems); - ~CicoSCAilItems(); - - void init(); - void setup(const char* pkg, const char* icon, const char* nam, - const char* ctgry, const char* typ, const char* exe, - std::string categorys, bool ndisp); - - const CicoSCAilItems* p() const; - -protected: // member method - void categoryParse(const std::string categorys); - bool categoryParseRun(const std::string& s); - bool categoryParseKind(const std::string& s); - bool categoryParseCategory(const std::string& s); - bool categoryParseGetValue(const std::string& s, const std::string& k, - std::string & val); - bool categoryGetDisplay(const std::string& disp, const std::string& layer, - const std::string& zone); - bool categoryGetSound(const std::string& sound, const std::string& zone); - bool categoryGetInput(const std::string& inputDev, - const std::string& sw); - bool categoryParseNodisplay(const std::string& s); - bool categoryParseAnimation(const std::string& s); - bool categoryParseInvisiblecpu(const std::string& s); - bool categoryParseNoconfigure(const std::string& s); - bool categoryParseMenuoverlap(const std::string& s); - bool categoryParseAuto(const std::string& s); - bool categoryParseNoauto(const std::string& s); - -private: // member method - -public: // member aria - std::string m_appid; // PACKAGE NAME - std::string m_icon; // ICON - std::string m_name; // NAME - std::string m_execPath; // EXEC - std::string m_type; // TYPE - - std::string m_categories; // CATEGORIES - - int m_nodeID; // "run=xxx" xxx change to id - int m_kindID; // "kind=xxx" xxx change to id - int m_categoryID; // "category=xxx" xxx change to id - - int m_display; // - int m_layer; - int m_displayZone; // display zone - int m_soundZone; // sound zone - int m_sound; - int m_inputDev; // input device - int m_switch; - bool m_noIcon; - std::string m_animation; - int m_animationTime; - int m_invisibleCPU; - bool m_memnuOverlap; - bool m_autoStart; // auto start flag - - - std::string m_group; - std::string m_location; - bool m_resumeShow; -}; - -inline const CicoSCAilItems* CicoSCAilItems::p() const -{ - return this; -} - -#endif // CICOAILITEMS_H diff --git a/src/homescreen/CicoSCAulItems.cpp b/src/homescreen/CicoSCAulItems.cpp deleted file mode 100644 index 6cf015c..0000000 --- a/src/homescreen/CicoSCAulItems.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "CicoLog.h" -#include "CicoSCAulItems.h" - -using namespace std; - -/** - * @brief AUL Items class constructor - */ -CicoSCAulItems::CicoSCAulItems() -{ - ICO_TRA("CicoSCAulItems::CicoSCAulItems"); - m_appid.clear(); // appid - m_pid = 0; // pid - m_aulstt = AUL_R_OK; - m_defCgrpCpu.clear(); - m_defCgrpMem.clear(); -} - -/** - * @brief AUL Items class constructor - */ -CicoSCAulItems::CicoSCAulItems(const char* appid, int pid, int aulstt, - const CicoSCWindow* obj) - :m_appid(appid), m_pid(pid), m_aulstt(aulstt) -{ - ICO_TRA("CicoSCAulItems::CicoSCAulItems"); - enterWindow(obj); - getPidCgroupInfo(pid, m_defCgrpMem, m_defCgrpCpu); -} - -/** - * @brief AUL Items class constructor - */ -CicoSCAulItems::CicoSCAulItems(const CicoSCAulItems& s) -{ - m_appid = s.m_appid; - m_pid = s.m_pid; - m_aulstt = s.m_aulstt; -#if 1 // TODO mk_k - m_CSCWptrs = s.m_CSCWptrs; -#else - int sz = s.m_CSCWptrs.size(); - for (int i = 0; i < sz; i++) { - m_CSCWptrs.push_back(s.m_CSCWptrs[i]); - } -#endif - m_defCgrpCpu = s.m_defCgrpCpu; - m_defCgrpMem = s.m_defCgrpMem; -} - -/** - * @brief AUL Items class destructor - */ -CicoSCAulItems::~CicoSCAulItems() -{ - ICO_TRA("CicoSCAulItems::~CicoSCAulItems"); - m_CSCWptrs.clear(); -} - -/** - * @brief CicoSCWindow pointer entry - * @param obj entry pointer - */ -void CicoSCAulItems::enterWindow(const CicoSCWindow* obj) -{ - ICO_TRA("CicoSCAulItems::enterWindow %x", obj); - if ((NULL == obj) || (0 == obj)) { - ICO_TRA("CicoSCAulItems::enterWindow"); - return; - } - bool bingo = false; // Registered flag off -#if 1 // TODO mk_k - vector::iterator it = m_CSCWptrs.begin(); - vector::iterator theEnd = m_CSCWptrs.end(); - for(; it != theEnd; ++it) { - if (obj == *it) { // if Registered ? - bingo = true; // Registered flag on - break; // break of for - } - } -#else - int sz = m_CSCWptrs.size(); - for (int i = 0; i < sz; i++) { - if (obj == m_CSCWptrs[i]) { - bingo = true; - break; // break of for - } - } -#endif - if (false == bingo) { - ICO_TRA("add window pointer"); - m_CSCWptrs.push_back(obj); - } - ICO_TRA("CicoSCAulItems::enterWindow"); - return; -} - -/** - * @brief removw CicoSCWindow pointer - * @param obj remove target - */ -void CicoSCAulItems::rmWindow(const CicoSCWindow* obj) -{ - ICO_TRA("CicoSCAulItems::rmWindow %x", obj); - vector::iterator it = m_CSCWptrs.begin(); - vector::iterator theEnd = m_CSCWptrs.end(); - for(; it != theEnd; ++it) { - if (obj == *it) { - ICO_TRA("CicoSCAulItems::rmWindow"); - m_CSCWptrs.erase(it); - break; // break of for - } - } - ICO_TRA("CicoSCAulItems::rmWindow"); - return; -} - -/** - * @brief get cgroup data by /proc/[pid]/cgroup file - * @parm pid target pid number - * @param m store cgroup memory directory data - * @param c store cgroup cpu,cpuacct directory data - */ -static const char* g_procPidCgroupFileFmt="/proc/%d/cgroup"; -static const char* g_cpuWord = "cpuacct,cpu:"; -static const char* g_memWord = "memory:"; -bool CicoSCAulItems::getPidCgroupInfo(int pid, string& m, string& c) -{ - ICO_TRA("CicoSCAulItems::getPidCgroupInfo"); - char fn[64]; - sprintf(fn, g_procPidCgroupFileFmt, pid); - const size_t cpuWdSz = strlen(g_cpuWord); - const size_t memWdSz = strlen(g_memWord); - string tmp; - ifstream ifs(fn); - bool bR = false; - const char* pC = 0; - const char* pM = 0; - while (ifs >> tmp) { - if (true == tmp.empty()) { - continue; - } - const char* pT = tmp.c_str(); - const char* pS = pT; - for (;pS != '\0'; pS++) { - if (':' == *pS) { - pS++; - if (0 == strncmp(pS, g_cpuWord, cpuWdSz)) { //cpu - pC = pS + cpuWdSz; // get cgroup cpu directory - } - else if (0 == strncmp(pS, g_memWord, memWdSz)) { // memory - pM = pS + memWdSz; // get cgroup memory directory - } - break; // break of for - } - } - if ((0 != pC) && (0 != pM)) { - ICO_DBG("CicoSCAulItems::getPidCgroupInfo m=%s, c=%s", pM, pC); - m = pM; - c = pC; - bR = true; - break; // break of while - } - } - ifs.close(); - ICO_TRA("CicoSCAulItems::getPidCgroupInfo %s", bR? "true": "false"); - return bR; -} - -/** - * @brief appid update - */ -void CicoSCAulItems::update_appid() -{ - if (AUL_R_OK == m_aulstt) { - return; - } - ICO_TRA("update start %d, %s", m_aulstt, m_appid.c_str()); - char buf[255]; - buf[0] = '\0'; // STOP CODE - m_aulstt = aul_app_get_appid_bypid(m_pid, buf, sizeof(buf)); - if (AUL_R_OK == m_aulstt) { - m_appid = buf; - } - ICO_TRA("update end %d, %s", m_aulstt, m_appid.c_str()); - return ; -} diff --git a/src/homescreen/CicoSCAulItems.h b/src/homescreen/CicoSCAulItems.h deleted file mode 100644 index b3773c0..0000000 --- a/src/homescreen/CicoSCAulItems.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -#ifndef CICOSCAULITEMS_H -#define CICOSCAULITEMS_H - -#include -#include - -#ifndef __CICO_SC_WINDOW_H__ -class CicoSCWindow; -#endif - - -/** - * @brief System controller unit - * application life cycle information data - * - */ - -class CicoSCAulItems { -public: // member method - CicoSCAulItems(); - CicoSCAulItems(const char* appid, int pid, int aulstt, - const CicoSCWindow* obj=NULL); - CicoSCAulItems(const CicoSCAulItems& raul); - ~CicoSCAulItems(); - - const CicoSCAulItems* p() const; - void enterWindow(const CicoSCWindow* obj); - void rmWindow(const CicoSCWindow* obj); - void update_appid(); -protected: // member method - bool getPidCgroupInfo(int pid, std::string& m, std::string& c); -private: // member method - -public: // member aria - std::string m_appid; // appid - int m_pid; // pid - std::vector m_CSCWptrs; - -protected: // member aria - std::string m_defCgrpCpu; - std::string m_defCgrpMem; - int m_aulstt; -}; - -inline const CicoSCAulItems* CicoSCAulItems::p() const -{ - return this; -} - -#endif // CICOSCAULITEMS_H diff --git a/src/homescreen/CicoSCCommonDef.h b/src/homescreen/CicoSCCommonDef.h deleted file mode 100644 index 5b019f5..0000000 --- a/src/homescreen/CicoSCCommonDef.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ - -//========================================================================== -/** - * @file CicoSCCommonDef.h - * - * @brief This file is definition of common value - */ -//========================================================================== -#ifndef __CICO_SC_COMMON_DEF_H__ -#define __CICO_SC_COMMON_DEF_H__ - -//-------------------------------------------------------------------------- -// definition of layer type -//-------------------------------------------------------------------------- -#define ICO_LAYER_TYPE_BACKGROUND (1) ///! layer type of background -#define ICO_LAYER_TYPE_APPLICATION (2) ///! layer type of application -#define ICO_LAYER_TYPE_HOMESCREEN (3) ///! layer type of homescreen -#define ICO_LAYER_TYPE_INTERRPUTAPP (4) ///! layer type of homescreen -#define ICO_LAYER_TYPE_ONSCREEN (5) ///! layer type of homescreen -#define ICO_LAYER_TYPE_INPUT (101) ///! layer type of input panel(soft keyboard) -#define ICO_LAYER_TYPE_TOUCH (102) ///! layer type of touch panel input -#define ICO_LAYER_TYPE_CURSOR (103) ///! layer type of cursor - -//-------------------------------------------------------------------------- -// range of zone id -//-------------------------------------------------------------------------- -// center display -#define ICO_DISPLAY0_ZONEID_MIN (1) ///! display0 zone id min -#define ICO_DISPLAY0_ZONEID_MAX (20) ///! display0 zone id max - -// second display -#define ICO_DISPLAY1_ZONEID_MIN (21) ///! display1 zone id min -#define ICO_DISPLAY1_ZONEID_MAX (40) ///! display1 zone id max - -#endif // __CICO_SC_COMMON_DEF_H__ -// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoSCConf.h b/src/homescreen/CicoSCConf.h deleted file mode 100644 index 92af9e7..0000000 --- a/src/homescreen/CicoSCConf.h +++ /dev/null @@ -1,581 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ - -//========================================================================== -/** - * @file CicoSCConf.h - * - * @brief This file is definition of SystemConfigs - */ -//========================================================================== -#ifndef __CICO_SC_CONF_H__ -#define __CICO_SC_CONF_H__ - -#include -#include -#include - -#include -#include "CicoSCCommonDef.h" - -//========================================================================== -/** - * @brief enumeration of node type - */ -//========================================================================== -typedef enum _node_type { - ICO_NODETYPE_CENTER = 0, ///< Center display - ICO_NODETYPE_METER = 1, ///< Meter display - ICO_NODETYPE_REMOTE = 2, ///< Information device(mobile device) - ICO_NODETYPE_PASSENGER = 3, ///< Passenger display - ICO_NODETYPE_REAR = 4, ///< Rear-seat entertainment - ICO_NODETYPE_REARLEFT = 5, ///< Rear-seat entertainment(Left) - ICO_NODETYPE_REARRIGHT = 6, ///< Rear-seat entertainment(right) -} ico_nodetype_e; - -//========================================================================== -/** - * @brief enumeration of display type - */ -//========================================================================== -typedef enum _display_type { - ICO_DISPLAYTYPE_CENTER = 0, ///< Center display - ICO_DISPLAYTYPE_METER = 1, ///< Meter display - ICO_DISPLAYTYPE_REMOTE = 2, ///< Information device(mobile device) - ICO_DISPLAYTYPE_PASSENGER = 3, ///< Passenger display - ICO_DISPLAYTYPE_REAR = 4, ///< Rear-seat display - ICO_DISPLAYTYPE_REARLEFT = 5, ///< Rear-seat display(left) - ICO_DISPLAYTYPE_REARRIGHT = 6, ///< Rear-seat display(right) -} ico_display_type_e; - -//========================================================================== -/** - * @brief enumeration of policy type - */ -//========================================================================== -typedef enum _policy { - ICO_POLICY_ALWAYS = 0, ///< No control - ICO_POLICY_RUNNING = 1, ///< Running only - ICO_POLICY_PARKED = 2, ///< Parked only - ICO_POLICY_SHIFT_PARKING = 3, ///< Shift-position is park - ICO_POLICY_SHIFT_REVERSES = 4, ///< Shift-position is reverses - ICO_POLICY_BLINKER_LEFT = 5, ///< Blinker is left - ICO_POLICY_BLINKER_RIGHT = 6, ///< Blinker is right -} ico_policy_e; - -//========================================================================== -/** - * @brief enumeration of application privilege - */ -//========================================================================== -typedef enum _privilege { - ICO_PRIVILEGE_ALMIGHTY = 0, ///< almighty privilege - ICO_PRIVILEGE_SYSTEM = 1, ///< system level - ICO_PRIVILEGE_SYSTEM_AUDIO = 2, ///< system level(audio only) - ICO_PRIVILEGE_SYSTEM_VISIBLE = 3, ///< system level(visible only) - ICO_PRIVILEGE_MAKER = 4, ///< maker level - ICO_PRIVILEGE_CERTIFICATE = 5, ///< certificated - ICO_PRIVILEGE_NONE = 6, ///< no privilege -} ico_privilege_e; - -#define ICO_SYC_CONFIG_APPATTR "app_attr.conf" //TODO - -//========================================================================== -/** - * @brief This class holds display information of system config - */ -//========================================================================== -class CicoSCNodeConf -{ -public: - /// default constructor - CicoSCNodeConf() - : id(-1), name(""), address(""), type(-1) {} - - /// destructor - virtual ~CicoSCNodeConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG("node: id=%d name=%s address=%s type=%d", - id, name.c_str(), address.c_str(), type); - } - -public: - int id; ///< node id - std::string name; ///< node name - std::string address; ///< node ip address - int type; ///< node type -}; - -//========================================================================== -/** - * @brief This class holds layer information of system config - */ -//========================================================================== -class CicoSCLayerConf -{ -public: - /// default constructor - CicoSCLayerConf() - : id(-1), name(""), type(-1), menuoverlap(false) {} - - /// destructor - virtual ~CicoSCLayerConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG(" layer: id=%d name=%s type=%d menuoverlap=%s", - id, name.c_str(), type, menuoverlap ? "true" : "false"); - } - -public: - int id; ///< layer id - std::string name; ///< layer name - int type; ///< layer type - bool menuoverlap; ///< menu overlap flag -}; - -//========================================================================== -/** - * @brief This class holds display zone information of system config - */ -//========================================================================== -class CicoSCDisplayZoneConf -{ -public: - /// default constructor - CicoSCDisplayZoneConf() - : id(-1), name(""), fullname(""), x(-1), y(-1), w(-1), h(-1), - aspectFixed(false), aspectAlignLeft(false), - aspectAlignRight(false), aspectAlignTop(false), - aspectAlignBottom(false) {} - - /// destructor - virtual ~CicoSCDisplayZoneConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG(" zone: id=%d name=%s fullname=%s x/y=%d/%d " - "w/h=%d/%d aspect(fixed=%s l/r=%s/%s t/b=%s/%s", - id, name.c_str(), fullname.c_str(), x, y, w, h, - aspectFixed ? "true" : "false", - aspectAlignLeft ? "true" : "false", - aspectAlignRight ? "true" : "false", - aspectAlignTop ? "true" : "false", - aspectAlignBottom ? "true" : "false"); - } - -public: - int id; ///< display zone id - std::string name; ///< display zone name - std::string fullname; ///< display zone fullname - int x; ///< display zone x position - int y; ///< display zone y position - int w; ///< display zone width - int h; ///< display zone height - - /// fixed asppect ratio flag - bool aspectFixed; - /// horizontal direction to aligned at the left - bool aspectAlignLeft; - /// horizontal direction to aligned at the right - bool aspectAlignRight; - /// vertical direction is aligned at the top - bool aspectAlignTop; - /// vertical direction is aligned at the bottom - bool aspectAlignBottom; -}; - -//========================================================================== -/** - * @brief This class holds display information of system config - */ -//========================================================================== -class CicoSCDisplayConf -{ -public: - /// default constructor - CicoSCDisplayConf() - : id(-1), name(""), node(-1), no(-1), - type(-1), width(-1), height(-1), inch(-1) {} - - /// destructor - virtual ~CicoSCDisplayConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG("display: id=%d name=%s node=%d no=%d " - "type=%d width=%d height=%d inch=%d", - id, name.c_str(), node, no, type, width, height, inch); - } - -public: - int id; ///< display id - std::string name; ///< display name - int node; ///< display node id - int no; ///< display number - int type; ///< display type - int width; ///< display width resolution - int height; ///< display height resolution - int inch; ///< display inch size - - // layer config list - std::vector layerConfList; - - // zone config list - std::vector zoneConfList; -}; - -//========================================================================== -/** - * @brief This class holds sound zone information of system config - */ -//========================================================================== -class CicoSCSoundZoneConf -{ -public: - /// default constructor - CicoSCSoundZoneConf() - : id(-1), name(""), fullname("") {} - - /// destructor - virtual ~CicoSCSoundZoneConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG(" zone: id=%d name=%s fullname=%s", - id, name.c_str(), fullname.c_str()); - } - -public: - int id; ///< sound zone id - std::string name; ///< sound zone name - std::string fullname; ///< sound zone full name -}; - -//========================================================================== -/** - * @brief This class holds sound information of system config - */ -//========================================================================== -class CicoSCSoundConf -{ -public: - /// default constructor - CicoSCSoundConf() - : id(-1), name(""), no(-1) {} - - /// destructor - virtual ~CicoSCSoundConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG("sound: id=%d name=%s no=%d", id, name.c_str(), no); - } - -public: - int id; ///< sound id - std::string name; ///< sound name - int no; ///< sound number - std::vector zoneConfList; ///< sound config list -}; - -//========================================================================== -/** - * @brief This class holds category information of system config - */ -//========================================================================== -class CicoSCCategoryConf -{ -public: - /// default constructor - CicoSCCategoryConf() - : id(-1), name(""), type(""), - view(-1), sound(-1), input(-1), priority(0), rctrl(-1) {} - - /// destructor - virtual ~CicoSCCategoryConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG("category: id=%d name=%s type=%s " - "view=%d sound=%d input=%d priority=%d", - id, name.c_str(), type.c_str(), - view, sound, input, priority); - } - -public: - int id; ///< category id - std::string name; ///< category name - std::string type; ///< category type - int view; ///< category view - int sound; ///< category sound - int input; ///< category input - int priority; ///< category priority - int rctrl; ///< resource control information -}; - -//========================================================================== -/** - * @brief This class holds application kind information of system config - */ -//========================================================================== -class CicoSCAppKindConf -{ -public: - enum _privilege { - PRIVILEGE_ALMIGHTY = 0, ///< almighty privilege - PRIVILEGE_SYSTEM = 1, ///< system level - PRIVILEGE_SYSTEM_AUDIO = 2, ///< system level(audio only) - PRIVILEGE_SYSTEM_VISIBLE = 3, ///< system level(visible only) - PRIVILEGE_MAKER = 4, ///< maker level - PRIVILEGE_CERTIFICATE = 5, ///< certificated - PRIVILEGE_NONE = 6, ///< no privilege - }; - - /// default constructor - CicoSCAppKindConf() - : id(-1), name(""), privilege(-1), priority(0){} - - /// destructor - virtual ~CicoSCAppKindConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG("appkind: id=%d name=%s priority=%d priority=%d", - id, name.c_str(), privilege, priority); - } - -public: - int id; ///< application kind id - std::string name; ///< application kind name - int privilege; ///< application privilege - int priority; ///< application priority -}; - -//========================================================================== -/** - * @brief This class holds input device switch information of system config - */ -//========================================================================== -class CicoSCSwitchConf -{ -public: - /// default constructor - CicoSCSwitchConf() - : id(-1), name(""), appid(""), keycode(0){} - - /// destructor - virtual ~CicoSCSwitchConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG(" switch: id=%d name=%s appid=%s", - id, name.c_str(), appid.c_str()); - } - -public: - int id; ///< input device switch id - std::string name; ///< input device switch name - std::string appid; ///< fixed assign apllication name - int keycode; ///< keycode of input device switch -}; - -//========================================================================== -/** - * @brief This class holds input device information of system config - */ -//========================================================================== -class CicoSCInputDevConf -{ -public: - /// default constructor - CicoSCInputDevConf() - : id(-1), name("") {} - - /// destructor - virtual ~CicoSCInputDevConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG("inputdev: id=%d name=%s", id, name.c_str()); - } - -public: - int id; ///< input device id - std::string name; ///< input device name - std::vector switchConfList; ///< switch list -}; - -//========================================================================== -/** - * @brief This class holds default information of system config - */ -//========================================================================== -class CicoSCDefaultConf -{ -public: - /// default constructor - CicoSCDefaultConf() - : topdir(""), confdir(""), - node(-1), appkind(-1), category(-1), display(-1), - layer(-1), displayzone(-1), sound(-1), soundzone(-1), - inputdev(-1), inputsw(-1) {}; - - /// destructor - virtual ~CicoSCDefaultConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG("default: topdir=%s confdir=%s " - "node=%d appkind=%d category=%d " - "display=%d layer=%d displayzone=%d " - "sound=%d soundzone=%d inputdev=%d inputsw=%d", - topdir.c_str(), confdir.c_str(), - node, appkind, category, display, layer, displayzone, - sound, soundzone, inputdev, inputsw); - } - -public: - std::string topdir; ///< top directory path - std::string confdir; ///< config directory path - int node; ///< default application node id - int appkind; ///< default application kind - int category; ///< default application category - int display; ///< default application display - int layer; ///< default application display layer - int displayzone; ///< default application display zone - int sound; ///< default application sound - int soundzone; ///< default application sound zone - int inputdev; ///< default input device - int inputsw; ///< default input device switch -}; - -//========================================================================== -/** - * @brief This class holds cpu resource group information of system config - */ -//========================================================================== -class CicoSCCpuResourceGrp -{ -public: - /// default constructor - CicoSCCpuResourceGrp() - :m_id(-1), m_bDoIt(false), m_grpNm("") {} - - /// destructor - virtual ~CicoSCCpuResourceGrp() {} - - /// dump log this class member variables - void dumpConf(void) - { - std::stringstream hightlist; - { - std::vector::iterator itr = m_hight.begin(); - for (; itr != m_hight.end(); ++itr) { - hightlist << " " << *itr; - } - - } - - std::stringstream lowlist; - { - std::vector::iterator itr = m_low.begin(); - for (; itr != m_low.end(); ++itr) { - lowlist << " " << *itr; - } - - } - - ICO_DBG("cpu reousrce group; id=%d doIt=%s grpNm=%s, high=%d, low=%d", - m_id, m_bDoIt? "true": "false", m_grpNm.c_str(), - hightlist.str().c_str(), lowlist.str().c_str()); - }; - -public: - int m_id; ///< cpu resource group id - bool m_bDoIt; ///< cpu resouce control enable flag - std::string m_grpNm; ///< cpu resource group name - std::vector m_hight; ///< hight threshold list - std::vector m_low; ///< low threshold list -}; - -//========================================================================== -/** - * @brief This class holds system resource information of system config - */ -//========================================================================== -class CicoSCResourceConf -{ -public: - /// default constructor - CicoSCResourceConf() - :m_bDoIt(false), m_bLog(false), m_cpuCGRPPath(""), m_sampling(-1), - m_retryCnt(5), m_lowLimitVal(25), m_highLimitVal(90) {} - - /// destructor - virtual ~CicoSCResourceConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG("do:%s, log:%s, dir:%s, smpl:%d r:%d l:%d h:%d sz:%d", - m_bDoIt? "true": "false", m_bLog? "true": "false", - m_cpuCGRPPath.c_str(), m_sampling, m_retryCnt, m_lowLimitVal, - m_highLimitVal, m_cpuCtrl.size()); - } - -public: - bool m_bDoIt; ///< resource control enable flag - bool m_bLog; ///< resource control log enable flag - std::string m_cpuCGRPPath; ///< cpu cgroup path - int m_sampling; ///< sampling period - int m_retryCnt; ///< retry count - int m_lowLimitVal; ///< low limit value - int m_highLimitVal; ///< high limit value - std::vector m_cpuCtrl; ///< cpu control config list -}; - -//========================================================================== -/** - * @brief This class holds user information of system config - */ -//========================================================================== -class CicoSCUserConf -{ -public: - /// default constructor - CicoSCUserConf() :m_parent_dir("/home/app/ico") {} - /// destructor - virtual ~CicoSCUserConf() {} - - /// dump log this class member variables - void dumpConf(void) - { - ICO_DBG("parent dir:%s", m_parent_dir.c_str()); - } - -public: - std::string m_parent_dir; ///< parent dir -}; - -#endif // __CICO_SC_CONF_H__ -// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoSCSystemConfig.cpp b/src/homescreen/CicoSCSystemConfig.cpp deleted file mode 100644 index f23b912..0000000 --- a/src/homescreen/CicoSCSystemConfig.cpp +++ /dev/null @@ -1,1813 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ - -/*========================================================================*/ -/** - * @file CicoSCSystemConfig.cpp - * - * @brief This file implementation of CicoSCSystemConfig class - */ -/*========================================================================*/ - -#include "CicoSCSystemConfig.h" -#include "CicoSCConf.h" - -//========================================================================== -// private static variable -//========================================================================== -CicoSCSystemConfig* CicoSCSystemConfig::ms_myInstance = NULL; - -//-------------------------------------------------------------------------- -/** - * @brief default constructor - */ -//-------------------------------------------------------------------------- -CicoSCSystemConfig::CicoSCSystemConfig() -{ - m_typeTable[""] = ICO_NODETYPE_CENTER; - m_typeTable["center"] = ICO_NODETYPE_CENTER; - m_typeTable["meter"] = ICO_NODETYPE_METER; - m_typeTable["remote"] = ICO_NODETYPE_REMOTE; - m_typeTable["passenger"] = ICO_NODETYPE_PASSENGER; - m_typeTable["rear"] = ICO_NODETYPE_REAR; - m_typeTable["rearleft"] = ICO_NODETYPE_REARLEFT; - m_typeTable["rearright"] = ICO_NODETYPE_REARRIGHT; - - m_displayTypeTable[""] = ICO_DISPLAYTYPE_CENTER; - m_displayTypeTable["center"] = ICO_DISPLAYTYPE_CENTER; - m_displayTypeTable["meter"] = ICO_DISPLAYTYPE_METER; - m_displayTypeTable["remote"] = ICO_DISPLAYTYPE_REMOTE; - m_displayTypeTable["passenger"] = ICO_DISPLAYTYPE_PASSENGER; - m_displayTypeTable["rear"] = ICO_DISPLAYTYPE_REAR; - m_displayTypeTable["rearleft"] = ICO_DISPLAYTYPE_REARLEFT; - m_displayTypeTable["rearright"] = ICO_DISPLAYTYPE_REARRIGHT; - - // - m_categoryTalbe[""] = ICO_POLICY_ALWAYS; - m_categoryTalbe["always"] = ICO_POLICY_ALWAYS; - m_categoryTalbe["run"] = ICO_POLICY_RUNNING; - m_categoryTalbe["park"] = ICO_POLICY_PARKED; - m_categoryTalbe["shift_park"] = ICO_POLICY_SHIFT_PARKING; - m_categoryTalbe["shift_back"] = ICO_POLICY_SHIFT_REVERSES; - m_categoryTalbe["shift_rev"] = ICO_POLICY_SHIFT_REVERSES; - m_categoryTalbe["blinker_left"] = ICO_POLICY_BLINKER_LEFT; - m_categoryTalbe["blinker_right"] = ICO_POLICY_BLINKER_RIGHT; - - // - m_privilegeTable["almighty"] = ICO_PRIVILEGE_ALMIGHTY; - m_privilegeTable["system"] = ICO_PRIVILEGE_SYSTEM; - m_privilegeTable["system.audio"] = ICO_PRIVILEGE_SYSTEM_AUDIO; - m_privilegeTable["system.visible"] = ICO_PRIVILEGE_SYSTEM_VISIBLE; - m_privilegeTable["maker"] = ICO_PRIVILEGE_MAKER; - m_privilegeTable["certificate"] = ICO_PRIVILEGE_CERTIFICATE; - m_privilegeTable["none"] = ICO_PRIVILEGE_NONE; - m_privilegeTable[""] = ICO_PRIVILEGE_NONE; - m_resourceConf = NULL; - m_userConf = NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief destructor - */ -//-------------------------------------------------------------------------- -CicoSCSystemConfig::~CicoSCSystemConfig() -{ - // TODO -} - -//-------------------------------------------------------------------------- -/** - * @brief Get instance of CicoSCSystemConfig - * - * @return pointer of CicoSCSystemConfig object - */ -//-------------------------------------------------------------------------- -CicoSCSystemConfig* -CicoSCSystemConfig::getInstance(void) -{ - if (NULL == ms_myInstance) { - ms_myInstance = new CicoSCSystemConfig(); - } - return ms_myInstance; -} - -//-------------------------------------------------------------------------- -/** - * @brief Get instance of CicoSCSystemConfig - * - * @param [in] confFile config file name - * @return 0 on success, other on error - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::load(const string & confFile) -{ - ptree root; - read_xml(confFile, root); - - createNodeConfList(root); - createDisplayConfList(root); - createSoundConfList(root); - createPortConf(root); - createCategoryConf(root); - createAppKindConf(root); - createInputDevList(root); - createDefaultConf(root); - createLogConf(root); - createResourceConf(root); - createUserConf(root); - - return 0; //TODO -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const vector& -CicoSCSystemConfig::getNodeConfList(void) const -{ - return m_nodeConfList; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const vector& -CicoSCSystemConfig::getDisplayConfList(void) const -{ - return m_displayConfList; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const vector& -CicoSCSystemConfig::getSoundConfList(void) const -{ - return m_soundConfList; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const vector & -CicoSCSystemConfig::getInputDevConfList(void) const -{ - return m_inputDevConfList; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const vector & -CicoSCSystemConfig::getCategoryConfList(void) const -{ - return m_categoryConfList; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const vector & -CicoSCSystemConfig::getAppKindConfList(void) const -{ - return m_appKindConfList; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createNodeConfList(const ptree & root) -{ - // -// if (root.not_found() == root.find("systemconfig")) { -// ICO_ERR("nodes element not found"); -// return; -// } - ptree nodes = root.get_child("systemconfig.nodes"); - - BOOST_FOREACH (const ptree::value_type& child, nodes) { - if (0 != strcmp(child.first.data(),"node")) { - ICO_ERR("unknown element(%s)", child.first.data()); - } - optional id = optional(-1); - optional name; - optional type; - optional address; - - id = child.second.get_optional(".id"); - if (false == id.is_initialized()) { - ICO_ERR("node.id attr not found"); - continue; - } - name = child.second.get_optional(".name"); - if (false == name.is_initialized()) { - ICO_ERR("node.name attr not found"); - continue; - } - type = child.second.get_optional("type"); - if (false == type.is_initialized()) { - ICO_ERR("node.type element not found"); - continue; - } - address = child.second.get_optional("ipaddress"); - if (false == address.is_initialized()) { - ICO_ERR("node.address element not found"); - continue; - } - - CicoSCNodeConf* nodeConf = new CicoSCNodeConf; - nodeConf->id = id.get(); - nodeConf->name = name.get(); - nodeConf->type = m_typeTable[type.get()]; - nodeConf->address = address.get(); - m_nodeConfList.push_back(nodeConf); - - nodeConf->dumpConf(); - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createDisplayConfList(const ptree & root) -{ - // -// if (root.not_found() != root.find("systemconfi.displays")) { -// ICO_ERR("displays element not found"); -// return; -// } - - ptree displays = root.get_child("systemconfig.displays"); - BOOST_FOREACH (const ptree::value_type& child, displays) { - optional id = optional(-1); - optional name; - optional node; - optional no = optional(-1); - optional type; - optional width = optional(-1); - optional height = optional(-1); - - id = child.second.get_optional(".id"); - if (false == id.is_initialized()) { - ICO_ERR("display.id attr not found"); - continue; - } - name = child.second.get_optional(".name"); - if (false == name.is_initialized()) { - ICO_ERR("display.name attr not found"); - continue; - } - node = child.second.get_optional("node"); - if (false == node.is_initialized()) { - ICO_ERR("display.node attr not found"); - continue; - } - no = child.second.get_optional("no"); - if (false == no.is_initialized()) { - ICO_ERR("display.no element not found"); - continue; - } - type = child.second.get_optional("type"); - if (false == type.is_initialized()) { - ICO_ERR("display.type element not found"); - continue; - } - width = child.second.get_optional("width"); - if (false == width.is_initialized()) { - ICO_ERR("display.width element not found"); - continue; - } - height = child.second.get_optional("height"); - if (false == height.is_initialized()) { - ICO_ERR("display.height element not found"); - continue; - } - - CicoSCDisplayConf* displayConf = new CicoSCDisplayConf(); - displayConf->id = id.get(); - displayConf->name = name.get(); - displayConf->node = getNodeIdbyName(node.get()); - displayConf->no = no.get(); - displayConf->type = m_displayTypeTable[type.get()]; - displayConf->width = width.get(); - displayConf->height = height.get(); - - displayConf->dumpConf(); - - createLayerConf(child, displayConf); - createDisplayZoneConf(child, displayConf); - - m_displayConfList.push_back(displayConf); - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createLayerConf(const ptree::value_type & child, - CicoSCDisplayConf* displayConf) -{ - ptree layers = child.second.get_child("layers"); - BOOST_FOREACH (const ptree::value_type& layer, layers) { - optional id = optional(-1); - optional name; - optional type = optional(-1); - optional overlap = optional(false); - - id = layer.second.get_optional(".id"); - if (false == id.is_initialized()) { - ICO_ERR("disply.layer.id attr not found"); - continue; - } - name = layer.second.get_optional(".name"); - if (false == name.is_initialized()) { - ICO_ERR("disply.layer.name attr not found"); - continue; - } - type = layer.second.get_optional("type"); - if (false == type.is_initialized()) { - ICO_ERR("disply.layer.type element not found"); - continue; - } - overlap = layer.second.get_optional("menuoverlap"); - if (false == overlap.is_initialized()) { - ICO_ERR("disply.layer.overlap element not found"); - continue; - } - - CicoSCLayerConf* layerConf = new CicoSCLayerConf(); - layerConf->id = id.get(); - layerConf->name = name.get(); - layerConf->type = type.get(); - layerConf->menuoverlap = overlap.get(); - - displayConf->layerConfList.push_back(layerConf); - - layerConf->dumpConf(); - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createDisplayZoneConf(const ptree::value_type & child, - CicoSCDisplayConf* displayConf) -{ - ptree zones = child.second.get_child("zones"); - BOOST_FOREACH (const ptree::value_type& zone, zones) { - optional id = optional(-1); - optional name; - optional x; - optional y; - optional w; - optional h; - optional fixed; - optional l; - optional r; - optional t; - optional b; - - id = zone.second.get_optional(".id"); - if (false == id.is_initialized()) { - ICO_WRN("zone.id.attr not found"); - continue; - } - name = zone.second.get_optional(".name"); - if (false == name.is_initialized()) { - ICO_WRN("zone.name.attr not found"); - continue; - } - x = zone.second.get_optional("geometry..x"); - if (false == x.is_initialized()) { - ICO_WRN("zone.geometry.x attr not found"); - continue; - } - y = zone.second.get_optional("geometry..y"); - if (false == y.is_initialized()) { - ICO_WRN("zone.geometry.y attr not found"); - continue; - } - w = zone.second.get_optional("geometry..w"); - if (false == w.is_initialized()) { - ICO_WRN("zone.geometry.w attr not found"); - continue; - } - h = zone.second.get_optional("geometry..h"); - if (false == h.is_initialized()) { - ICO_WRN("zone.geometry.h attr not found"); - continue; - } - fixed = zone.second.get_optional("aspect..Fixed"); - if (false == fixed.is_initialized()) { - fixed = optional(false); - } - l = zone.second.get_optional("aspect..AlignLeft"); - if (false == l.is_initialized()) { - l = optional(false); - } - r = zone.second.get_optional("aspect..AlignRight"); - if (false == r.is_initialized()) { - r = optional(false); - } - t = zone.second.get_optional("aspect..AlignTop"); - if (false == t.is_initialized()) { - t = optional(false); - } - b = zone.second.get_optional("aspect..AlignBottom"); - if (false == b.is_initialized()) { - b = optional(false); - } - - CicoSCDisplayZoneConf* zoneConf = new CicoSCDisplayZoneConf(); - zoneConf->id = id.get(); - zoneConf->name = name.get(); - zoneConf->fullname = displayConf->name + "." + name.get(); - zoneConf->x = calcGeometryExpr(x.get(), displayConf); - zoneConf->y = calcGeometryExpr(y.get(), displayConf); - zoneConf->w = calcGeometryExpr(w.get(), displayConf); - zoneConf->h = calcGeometryExpr(h.get(), displayConf); - zoneConf->aspectFixed = fixed.get(); - zoneConf->aspectAlignLeft = l.get(); - zoneConf->aspectAlignRight = r.get(); - zoneConf->aspectAlignTop = t.get(); - zoneConf->aspectAlignBottom = b.get(); - displayConf->zoneConfList.push_back(zoneConf); - - zoneConf->dumpConf(); - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createSoundConfList(const ptree & root) -{ - // - ptree sounds = root.get_child("systemconfig.sounds"); - BOOST_FOREACH (const ptree::value_type& child, sounds) { - optional id = optional(-1); - optional name; - optional no = optional(-1); - - id = child.second.get_optional(".id"); - if (false == id.is_initialized()) { - continue; - } - - name = child.second.get_optional(".name"); - if (false == name.is_initialized()) { - continue; - } - - no = child.second.get_optional("no"); - if (false == no.is_initialized()) { - continue; - } - - CicoSCSoundConf* soundConf = new CicoSCSoundConf(); - soundConf->id = id.get(); - soundConf->name = name.get(); - soundConf->no = no.get(); - - soundConf->dumpConf(); - - createSoundZoneConf(child, soundConf); - - m_soundConfList.push_back(soundConf); - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createSoundZoneConf(const ptree::value_type & child, - CicoSCSoundConf* soundConf) -{ - // - // - // ... - ptree zones = child.second.get_child("zones"); - BOOST_FOREACH (const ptree::value_type& zone, zones) { - optional id = optional(-1); - optional name; - - id = zone.second.get_optional(".id"); - if (false == id.is_initialized()) { - continue; - } - name = zone.second.get_optional(".name"); - if (false == name.is_initialized()) { - continue; - } - - CicoSCSoundZoneConf* zoneConf = new CicoSCSoundZoneConf(); - zoneConf->id = id.get(); - zoneConf->name = name.get(); - zoneConf->fullname = soundConf->name + "." + name.get(); - soundConf->zoneConfList.push_back(zoneConf); - - zoneConf->dumpConf(); - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createPortConf(const ptree & root) -{ - // - ptree ports = root.get_child("systemconfig.ports"); - BOOST_FOREACH (const ptree::value_type& child, ports) { - optional id = optional(-1); - optional name; - - id = child.second.get_optional(".id"); - if (false == id.is_initialized()) { - continue; - } - name = child.second.get_optional(".name"); - if (false == name.is_initialized()) { - continue; - } - - switch (id.get()) { - case 0: - // TODO - m_sysconPort = atoi(child.second.data().c_str()); - break; - case 1: - m_soundPluginPort = atoi(child.second.data().c_str()); - break; - default: - break; - } - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createCategoryConf(const ptree & root) -{ - // - ptree categorys = root.get_child("systemconfig.categorys"); - BOOST_FOREACH (const ptree::value_type& child, categorys) { - optional id = optional(-1); - optional name; - optional type; - optional view; - optional sound; - optional input; - optional priority = optional(-1); - optional r_ctrl = optional(-1); - - id = child.second.get_optional(".id"); - if (false == id.is_initialized()) { - continue; - } - name = child.second.get_optional(".name"); - if (false == name.is_initialized()) { - continue; - } - type = child.second.get_optional("type"); - if (false == type.is_initialized()) { - continue; - } - view = child.second.get_optional("view"); - if (false == view.is_initialized()) { - continue; - } - sound = child.second.get_optional("sound"); - if (false == sound.is_initialized()) { - continue; - } - input= child.second.get_optional("input"); - if (false == sound.is_initialized()) { - continue; - } - priority = child.second.get_optional("priority"); - if (false == priority.is_initialized()) { - continue; - } - r_ctrl = child.second.get_optional("r_ctrl"); - if (false == r_ctrl.is_initialized()) { - continue; - } - - CicoSCCategoryConf* categoryConf = new CicoSCCategoryConf(); - categoryConf->id = id.get(); - categoryConf->name = name.get(); - categoryConf->type = type.get(); - categoryConf->view = m_categoryTalbe[view.get()]; - categoryConf->sound = m_categoryTalbe[sound.get()]; - categoryConf->input = m_categoryTalbe[input.get()]; - categoryConf->priority = priority.get(); - categoryConf->rctrl = r_ctrl.get(); - m_categoryConfList.push_back(categoryConf); - categoryConf->dumpConf(); - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createAppKindConf(const ptree & root) -{ - // - ptree appkinds = root.get_child("systemconfig.appkinds"); - BOOST_FOREACH (const ptree::value_type& child, appkinds) { - optional id = optional(-1); - optional name; - optional privilege; - optional priority = optional(-1); - - id = child.second.get_optional(".id"); - if (false == id.is_initialized()) { - continue; - } - - name = child.second.get_optional(".name"); - if (false == name.is_initialized()) { - continue; - } - - privilege = child.second.get_optional("privilege"); - if (false == name.is_initialized()) { - continue; - } - - priority = child.second.get_optional("priority"); - if (false == priority.is_initialized()) { - continue; - } - - CicoSCAppKindConf* appKindConf = new CicoSCAppKindConf(); - appKindConf->id = id.get(); - appKindConf->name = name.get(); - appKindConf->privilege = m_privilegeTable[privilege.get()]; - appKindConf->priority = priority.get(); - m_appKindConfList.push_back(appKindConf); - appKindConf->dumpConf(); - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createInputDevList(const ptree & root) -{ - // - ptree inputs = root.get_child("systemconfig.inputs"); - BOOST_FOREACH (const ptree::value_type& child, inputs) { - optional id = optional(-1); - optional name; - - id = child.second.get_optional(".id"); - if (false == id.is_initialized()) { - continue; - } - - name = child.second.get_optional(".name"); - if (false == name.is_initialized()) { - continue; - } - - CicoSCInputDevConf* inputDevConf = new CicoSCInputDevConf(); - inputDevConf->id = id.get(); - inputDevConf->name = name.get(); - inputDevConf->dumpConf(); - - createSwitchList(child, inputDevConf); - m_inputDevConfList.push_back(inputDevConf); - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createSwitchList(const ptree::value_type & child, - CicoSCInputDevConf* inputDevConf) -{ - ptree switchs = child.second.get_child("switchs"); - BOOST_FOREACH (const ptree::value_type& zone, switchs) { - optional id = optional(-1); - optional name; - optional appid; - - id = zone.second.get_optional(".id"); - if (false == id.is_initialized()) { - continue; - } - - name = zone.second.get_optional(".name"); - if (false == name.is_initialized()) { - continue; - } - - appid = zone.second.get_optional(".appid"); - if (false == appid.is_initialized()) { - continue; - } - - CicoSCSwitchConf* switchConf = new CicoSCSwitchConf(); - switchConf->id = id.get(); - switchConf->name = name.get(); - switchConf->appid = appid.get(); - switchConf->dumpConf(); - inputDevConf->switchConfList.push_back(switchConf); - } -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createDefaultConf(const ptree & root) -{ - // - ptree defaults = root.get_child("systemconfig.default"); - - optional node; - optional appkind; - optional category; - optional display; - optional layer; - optional displayzone; - optional sound; - optional soundzone; - optional inputdev; - optional inputsw; - - node = defaults.get_optional("node"); - if (false == node.is_initialized()) { - ICO_WRN("default.node element not found"); - } - - appkind = defaults.get_optional("appkind"); - if (false == appkind.is_initialized()) { - ICO_WRN("default.appkind element not found"); - } - - category = defaults.get_optional("category"); - if (false == category.is_initialized()) { - ICO_WRN("default.category element not found"); - } - - display = defaults.get_optional("display"); - if (false == display.is_initialized()) { - ICO_WRN("default.display element not found"); - } - - layer = defaults.get_optional("layer"); - if (false == layer.is_initialized()) { - ICO_WRN("default.layer element not found"); - } - - displayzone = defaults.get_optional("displayzone"); - if (false == displayzone.is_initialized()) { - ICO_WRN("default.displayzone element not found"); - } - - sound = defaults.get_optional("sound"); - if (false == sound.is_initialized()) { - ICO_WRN("default.sound element not found"); - } - - soundzone = defaults.get_optional("soundzone"); - if (false == soundzone.is_initialized()) { - ICO_WRN("default.soundzone element not found"); - } - - inputdev = defaults.get_optional("inputdev"); - if (false == inputdev.is_initialized()) { - ICO_WRN("default.inputdev element not found"); - } - - inputsw = defaults.get_optional("inputsw"); - if (false == inputsw.is_initialized()) { - ICO_WRN("default.inputdsw element not found"); - } - - m_defaultConf = new CicoSCDefaultConf(); - - m_defaultConf->node = getNodeIdbyName(node.get()); - m_defaultConf->appkind = getAppKindIdbyName(appkind.get()); - m_defaultConf->category = getCategoryIdbyName(category.get()); - m_defaultConf->display = getDisplayIdbyName(display.get()); - m_defaultConf->layer = getLayerIdfbyName(display.get(), layer.get()); - m_defaultConf->displayzone = getDizplayZoneIdbyName(display.get(), - displayzone.get()); - m_defaultConf->sound = getSoundIdbyName(sound.get()); - m_defaultConf->soundzone = getSoundZoneIdbyName(sound.get(), - soundzone.get()); - m_defaultConf->inputdev = getInputDevIdbyName(inputdev.get()); - m_defaultConf->inputsw = getSwitchIdbyName(inputdev.get(), - inputsw.get()); - -//TODO -#define ICO_SYC_TOP_EVN (char*)"SYSCON_TOPDIR" -#define ICO_SYC_TOP_DIR (char*)"/usr/apps/org.tizen.ico.system-controller" - /* decide top directory in all configurations */ - char *topdir = getenv(ICO_SYC_TOP_EVN); - if (NULL == topdir) { - topdir = ICO_SYC_TOP_DIR; - } - m_defaultConf->topdir = topdir; - -//TODO -#define ICO_SYC_CONFIG_ENV (char*)"SYSCON_CONFDIR" -#define ICO_SYC_CONFIG_DIR (char*)"res/config" - /* decide top directory in configuration file's */ - char *confdir = getenv(ICO_SYC_CONFIG_ENV); - if (NULL != confdir) { - m_defaultConf->confdir = confdir; - } - else { - m_defaultConf->confdir = m_defaultConf->topdir; - m_defaultConf->confdir.append("/"); - m_defaultConf->confdir.append(ICO_SYC_CONFIG_DIR); - } - - m_defaultConf->dumpConf(); -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void -CicoSCSystemConfig::createLogConf(const ptree & root) -{ - // - // - ptree logNode = root.get_child("systemconfig.log"); - int loglevel = logNode.get("loglevel"); - bool logflush = logNode.get("logflush"); - - m_loglevel = loglevel; - m_logflush = logflush; -} - -//-------------------------------------------------------------------------- -/** - * @brief resource config class object create - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void getArray(ptree& t, vector& vec); -static const char* g_resource_cpu = "systemconfig.resource_cpu_control"; -void -CicoSCSystemConfig::createResourceConf(const ptree & root) -{ - m_resourceConf = new CicoSCResourceConf; - ptree rc = root.get_child(g_resource_cpu); - bool b = false; - optional opts = rc.get_optional("do_it"); - if (true == opts.is_initialized()) { - string v = opts.get(); - if (0 == v.compare("yes")) { - b = true; - } - } - m_resourceConf->m_bDoIt = b; - if (false == b) { - return; - } - - string dirnm; - optional opts2 = rc.get_optional("ctrl_dir_path"); - if (true == opts2.is_initialized()) { - dirnm = opts2.get(); - } - else { - dirnm = "/sys/fs/cgroup/cpu,cpuacct/SCprivate"; - } - m_resourceConf->m_cpuCGRPPath = dirnm; - - opts = rc.get_optional("sampling_wait"); - if (true == opts.is_initialized()) { - m_resourceConf->m_sampling = atoi(opts.get().c_str()); - } - - opts = rc.get_optional("log"); - if (true == opts.is_initialized()) { - string v = opts.get(); - if (0 == v.compare("true")) { - m_resourceConf->m_bLog = true; - } - } - - opts = rc.get_optional("retry_cnt"); - if (true == opts.is_initialized()) { - m_resourceConf->m_retryCnt = atoi(opts.get().c_str()); - } - - opts = rc.get_optional("low_limit_value"); - if (true == opts.is_initialized()) { - m_resourceConf->m_lowLimitVal = atoi(opts.get().c_str()); - } - - opts = rc.get_optional("high_limit_value"); - if (true == opts.is_initialized()) { - m_resourceConf->m_highLimitVal = atoi(opts.get().c_str()); - } - - BOOST_FOREACH(ptree::value_type& child, rc) { - optional id = optional(-1); - optional name; - id = child.second.get_optional(".id"); - if (false == id.is_initialized()) { - continue; - } - name = child.second.get_optional(".name"); - if (false == name.is_initialized()) { - continue; - } - ptree pth = child.second.get_child("hight_array"); - ptree ptl = child.second.get_child("low_array"); - - CicoSCCpuResourceGrp* obj = new CicoSCCpuResourceGrp; - obj->m_id = id.get(); - obj->m_bDoIt = b; - obj->m_grpNm = name.get(); - getArray(pth, obj->m_hight); - getArray(ptl, obj->m_low); - m_resourceConf->m_cpuCtrl.push_back(obj); - } - m_resourceConf->dumpConf(); -} - -//-------------------------------------------------------------------------- -/** - * @brief user config class object create - * - * @param [in] - */ -//-------------------------------------------------------------------------- -static const char* g_login_user_conf = "systemconfig.login_user"; -void -CicoSCSystemConfig::createUserConf(const ptree & root) -{ - m_userConf = new CicoSCUserConf; - ptree rc = root.get_child(g_login_user_conf); - optional opts = rc.get_optional("parent_dir"); - if (true == opts.is_initialized()) { - string v = opts.get(); - if (v.empty()) { - m_userConf->m_parent_dir = v; - } - } - m_userConf->dumpConf(); -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::calcGeometryExpr(const string & expr, - CicoSCDisplayConf* conf) -{ - int val = 0; - int wval; - int i, j, sign; - char word[32]; - - j = 0; - sign = 0; - for (i = 0; ; i++) { - if (expr[i] == ' ') continue; - if ((expr[i] == 0) || (expr[i] == '+') || (expr[i] == '-') || - (expr[i] == '*') || (expr[i] == '-') || (expr[i] == '/')) { - if (j > 0) { - word[j] = 0; - if ((strcasecmp(word, "dispw") == 0) || - (strcasecmp(word, "width") == 0)) { - wval = conf->width; - } - else if ((strcasecmp(word, "disph") == 0) || - (strcasecmp(word, "heigh") == 0)) { - wval = conf->height; - } - else { - wval = strtol(word, (char **)0, 0); - } - j = 0; - if (sign >= 10) { - wval = 0 - wval; - } - switch (sign % 10) { - case 0: /* assign */ - val = wval; - break; - case 1: /* '+' */ - val += wval; - break; - case 2: /* '-' */ - val -= wval; - break; - case 3: /* '*' */ - val *= wval; - break; - case 4: /* '/' */ - val /= wval; - break; - default: - break; - } - sign = 0; - if (expr[i] == '+') sign = 1; - else if (expr[i] == '-') sign = 2; - else if (expr[i] == '*') sign = 3; - else if (expr[i] == '/') sign = 4; - else sign = 0; - } - else { - if ((sign > 0) && (expr[i] == '-')) { - sign += 10; - } - else { - if (expr[i] == '+') sign = 1; - else if (expr[i] == '-') sign = 2; - else if (expr[i] == '*') sign = 3; - else if (expr[i] == '/') sign = 4; - else sign = 0; - } - } - if (expr[i] == 0) break; - } - else { - if (j < ((int)sizeof(word)-1)) { - word[j++] = expr[i]; - } - } - } - return val; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCNodeConf* -CicoSCSystemConfig::findNodeConfbyName(const string & name) -{ - vector::iterator itr; - itr = m_nodeConfList.begin(); - for (; itr != m_nodeConfList.end(); ++itr) { - const CicoSCNodeConf* conf = const_cast(*itr); - if (name == conf->name) { - return conf; - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCDisplayConf* -CicoSCSystemConfig::findDisplayConfbyName(const string & name) -{ - vector::iterator itr; - itr = m_displayConfList.begin(); - for (; itr != m_displayConfList.end(); ++itr) { - const CicoSCDisplayConf* conf = NULL; - conf = const_cast(*itr); - if (name == conf->name) { - return conf; - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCLayerConf* -CicoSCSystemConfig::findLayerConfbyName(const string & displayName, - const string & layerName) -{ - const CicoSCDisplayConf* displayConf = NULL; - displayConf = findDisplayConfbyName(displayName); - if (NULL == displayConf) { - return NULL; - } - - vector::const_iterator itr; - itr = displayConf->layerConfList.begin(); - for (; itr != displayConf->layerConfList.end(); ++itr) { - const CicoSCLayerConf* conf = NULL; - conf = const_cast(*itr); - if (layerName == conf->name) { - return conf; - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCDisplayZoneConf* -CicoSCSystemConfig::findDisplayZoneConfbyName(const string & displayName, - const string & zoneName) -{ -// ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Enter" -// "(displayName=%s zoneNmae=%s)", -// displayName.c_str(), zoneName.c_str()); - - const CicoSCDisplayConf* displayConf = NULL; - displayConf = findDisplayConfbyName(displayName); - if (NULL == displayConf) { -// ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave(NULL)"); - return NULL; - } - - vector::const_iterator itr; - itr = displayConf->zoneConfList.begin(); - for (; itr != displayConf->zoneConfList.end(); ++itr) { - const CicoSCDisplayZoneConf* conf = NULL; - conf = const_cast(*itr); - if (zoneName == conf->name) { -// ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave" -// "(0x%08x)", conf); - return conf; - } - } - -// ICO_DBG("CicoSCSystemConfig::findDisplayZoneConfbyName Leave(NULL)"); - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCSoundConf* -CicoSCSystemConfig::findSoundConfbyName(const string & name) -{ - vector::iterator itr; - itr = m_soundConfList.begin(); - for (; itr != m_soundConfList.end(); ++itr) { - const CicoSCSoundConf* conf = NULL; - conf = const_cast(*itr); - if (name == conf->name) { - return conf; - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCSoundZoneConf* -CicoSCSystemConfig::findSoundZoneConfbyName(const string & soundName, - const string & zoneName) -{ -// ICO_DBG("CicoSCSystemConfig::findSoundZoneConfbyName Enter" -// "(soundName=%s zoneNmae=%s)", -// soundName.c_str(), zoneName.c_str()); - - const CicoSCSoundConf* soundConf = NULL; - soundConf = findSoundConfbyName(soundName); - if (NULL == soundConf) { - return NULL; - } - - vector::const_iterator itr; - itr = soundConf->zoneConfList.begin(); - for (; itr != soundConf->zoneConfList.end(); ++itr) { - const CicoSCSoundZoneConf* conf = NULL; - conf = const_cast(*itr); - if (zoneName == conf->name) { - return conf; - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCInputDevConf* -CicoSCSystemConfig::findInputDevConfbyName(const string & name) -{ - vector::iterator itr; - itr = m_inputDevConfList.begin(); - for (; itr != m_inputDevConfList.end(); ++itr) { - const CicoSCInputDevConf* conf = NULL; - conf = const_cast(*itr); - if (name == conf->name) { - return conf; - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCSwitchConf* -CicoSCSystemConfig::findSwitchConfbyName(const string & inputDevName, - const string & switchName) -{ - const CicoSCInputDevConf* inputDevConf = NULL; - inputDevConf = findInputDevConfbyName(inputDevName); - if (NULL == inputDevConf) { - ICO_WRN("name(%s) input device config not found.", - inputDevName.c_str()); - return NULL; - } - - vector::const_iterator itr; - itr = inputDevConf->switchConfList.begin(); - for (; itr != inputDevConf->switchConfList.end(); ++itr) { - const CicoSCSwitchConf* conf = NULL; - conf = const_cast(*itr); - if (switchName == conf->name) { - return conf; - } - } - - ICO_WRN("name(%s) switch config not found.", switchName.c_str()); - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCAppKindConf* -CicoSCSystemConfig::findAppKindConfbyName(const string & name) -{ - vector::iterator itr; - itr = m_appKindConfList.begin(); - for (; itr != m_appKindConfList.end(); ++itr) { - const CicoSCAppKindConf* conf = NULL; - conf = const_cast(*itr); - if (name == conf->name) { - return conf; - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCDisplayZoneConf* -CicoSCSystemConfig::findDisplayZoneConfbyId(int id) -{ - vector::iterator itr; - itr = m_displayConfList.begin(); - for (; itr != m_displayConfList.end(); ++itr) { - vector::iterator itr2; - itr2 = (*itr)->zoneConfList.begin(); - for (; itr2 != (*itr)->zoneConfList.end(); ++itr2) { - if (id == (*itr2)->id) { - return *itr2; - } - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCSoundZoneConf* -CicoSCSystemConfig::findSoundZoneConfbyId(int id) -{ - vector::iterator itr; - itr = m_soundConfList.begin(); - for (; itr != m_soundConfList.end(); ++itr) { - vector::iterator itr2; - itr2 = (*itr)->zoneConfList.begin(); - for (; itr2 != (*itr)->zoneConfList.end(); ++itr2) { - if (id == (*itr2)->id) { - return *itr2; - } - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCCategoryConf* -CicoSCSystemConfig::findCategoryConfbyName(const string & name) -{ - vector::iterator itr; - itr = m_categoryConfList.begin(); - for (; itr != m_categoryConfList.end(); ++itr) { - const CicoSCCategoryConf* conf = NULL; - conf = const_cast(*itr); - if (name == conf->name) { - //return const_cast(itr->pointer); - return conf; - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCCategoryConf* -CicoSCSystemConfig::findCategoryConfbyId(int id) -{ - vector::iterator itr; - itr = m_categoryConfList.begin(); - for (; itr != m_categoryConfList.end(); ++itr) { - const CicoSCCategoryConf* conf = NULL; - conf = const_cast(*itr); - if (id == conf->id) { - return conf; - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCAppKindConf * -CicoSCSystemConfig::findAppKindConfbyId(int id) -{ - vector::iterator itr; - itr = m_appKindConfList.begin(); - for (; itr != m_appKindConfList.end(); ++itr) { - if (id == (*itr)->id) { - return *itr; - } - } - - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCDefaultConf* -CicoSCSystemConfig::getDefaultConf(void) -{ - return m_defaultConf; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getNodeIdbyName(const string & name) -{ - const CicoSCNodeConf* conf = NULL; - conf = findNodeConfbyName(name); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getDisplayIdbyName(const string & name) -{ - const CicoSCDisplayConf* conf = NULL; - conf = findDisplayConfbyName(name); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getLayerIdfbyName(const string & displayName, - const string & layerName) -{ - const CicoSCLayerConf* conf = NULL; - conf = findLayerConfbyName(displayName, layerName); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getDizplayZoneIdbyName(const string & displayName, - const string & zoneName) -{ - const CicoSCDisplayZoneConf* conf = NULL; - conf = findDisplayZoneConfbyName(displayName, zoneName); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getDizplayZoneIdbyFullName(const string & zoneFullName) -{ - string::size_type index = zoneFullName.find(".", 0); - if (string::npos == index) { - return -1; - } - string displayName = zoneFullName.substr(0, index); - string zoneName = zoneFullName.substr(index+1); - - const CicoSCDisplayZoneConf* conf = NULL; - conf = findDisplayZoneConfbyName(displayName, zoneName); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getSoundIdbyName(const string & name) -{ - const CicoSCSoundConf* conf = NULL; - conf = findSoundConfbyName(name); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getSoundZoneIdbyName(const string & soundName, - const string & zoneName) -{ - const CicoSCSoundZoneConf* conf = NULL; - conf = findSoundZoneConfbyName(soundName, zoneName); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getSoundZoneIdbyFullName(const string & zoneFullName) -{ - string::size_type index = zoneFullName.find(".", 0); - if (string::npos == index) { - return -1; - } - string soundName = zoneFullName.substr(0, index); - string zoneName = zoneFullName.substr(index+1); - - const CicoSCSoundZoneConf* conf = NULL; - conf = findSoundZoneConfbyName(soundName, zoneName); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getInputDevIdbyName(const string & name) -{ - const CicoSCInputDevConf* conf = NULL; - conf = findInputDevConfbyName(name); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getSwitchIdbyName(const string & inputDevName, - const string & switchName) -{ - const CicoSCSwitchConf* conf = NULL; - conf = findSwitchConfbyName(inputDevName, switchName); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getAppKindIdbyName(const string & name) -{ - const CicoSCAppKindConf* conf = NULL; - conf = findAppKindConfbyName(name); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief - * - * @param [in] - */ -//-------------------------------------------------------------------------- -int -CicoSCSystemConfig::getCategoryIdbyName(const string & name) -{ - const CicoSCCategoryConf* conf = NULL; - conf = findCategoryConfbyName(name); - if (NULL == conf) { - return -1; - } - - return conf->id; -} - -//-------------------------------------------------------------------------- -/** - * @brief get category config object class - * - * @param [in] - */ -//-------------------------------------------------------------------------- -const CicoSCCategoryConf* -CicoSCSystemConfig::getCategoryObjbyCaategoryID(int id) -{ - if (-1 == id) { - return NULL; - } - vector::iterator itr; - itr = m_categoryConfList.begin(); - for (; itr != m_categoryConfList.end(); ++itr) { - const CicoSCCategoryConf* conf = NULL; - conf = const_cast(*itr); - if (id == conf->id) { - //return const_cast(itr->pointer); - return conf; - } - } - return NULL; -} - -//-------------------------------------------------------------------------- -/** - * @brief array xml tree to vector - * - * @param [in] - */ -//-------------------------------------------------------------------------- -void getArray(ptree& t, vector& vec) -{ - vec.clear(); - BOOST_FOREACH (const ptree::value_type& child, t) { - const int value = lexical_cast(child.second.data()); - vec.push_back(value); - } -} -// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoSCSystemConfig.h b/src/homescreen/CicoSCSystemConfig.h deleted file mode 100644 index 3e8a1cd..0000000 --- a/src/homescreen/CicoSCSystemConfig.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ - -//========================================================================== -/** - * @file CicoSCSystemConfig.h - * - * @brief This file is definition of CicoSCSystemConfig class - */ -//========================================================================== -#ifndef __CICO_SC_SYSTEM_CONFIG_H__ -#define __CICO_SC_SYSTEM_CONFIG_H__ - -#include -#include -#include -#include - -#include -#include -#include -using namespace std; -using namespace boost; -using namespace boost::property_tree; - -//========================================================================== -// Forward declaration -//========================================================================== -#ifndef __CICO_SC_CONF_H__ -class CicoSCNodeConf; -class CicoSCLayerConf; -class CicoSCDisplayZoneConf; -class CicoSCDisplayConf; -class CicoSCSoundZoneConf; -class CicoSCSoundConf; -class CicoSCCategoryConf; -class CicoSCAppKindConf; -class CicoSCSwitchConf; -class CicoSCInputDevConf; -class CicoSCDefaultConf; -class CicoSCResourceConf; -class CicoSCUserConf; -#endif - -//========================================================================== -/** - * @brief This class has function of access to system config information - */ -//========================================================================== -class CicoSCSystemConfig -{ -public: - static CicoSCSystemConfig* getInstance(void); - - int load(const string & confFile); - - const vector & getNodeConfList(void) const; - const vector & getDisplayConfList(void) const; - const vector & getSoundConfList(void) const; - const vector & getInputDevConfList(void) const; - const vector & getCategoryConfList(void) const; - const vector & getAppKindConfList(void) const; - - const CicoSCNodeConf* findNodeConfbyName(const string & name); - const CicoSCDisplayConf* findDisplayConfbyName(const string & name); - const CicoSCLayerConf* findLayerConfbyName(const string & displayName, - const string & layerName); - const CicoSCDisplayZoneConf* findDisplayZoneConfbyName(const string & displayName, - const string & zoneName); - const CicoSCSoundConf* findSoundConfbyName(const string & name); - const CicoSCSoundZoneConf* findSoundZoneConfbyName(const string & soundName, - const string & zoneName); - const CicoSCInputDevConf* findInputDevConfbyName(const string & name); - const CicoSCSwitchConf* findSwitchConfbyName(const string & inputDevName, - const string & switchName); - - const CicoSCAppKindConf* findAppKindConfbyName(const string & name); - const CicoSCCategoryConf* findCategoryConfbyName(const string & name); - - const CicoSCDisplayZoneConf* findDisplayZoneConfbyId(int id); - - const CicoSCSoundZoneConf* findSoundZoneConfbyId(int id); - const CicoSCCategoryConf* findCategoryConfbyId(int id); - const CicoSCAppKindConf* findAppKindConfbyId(int id); - - const CicoSCDefaultConf* getDefaultConf(void); - - - int getNodeIdbyName(const string & name); - int getDisplayIdbyName(const string & name); - int getLayerIdfbyName(const string & displayName, - const string & layerName); - int getDizplayZoneIdbyName(const string & displayName, - const string & zoneName); - int getDizplayZoneIdbyFullName(const string & zoneFullName); - int getSoundIdbyName(const string & name); - - int getSoundZoneIdbyName(const string & soundName, - const string & zoneName); - int getSoundZoneIdbyFullName(const string & zoneFullName); - int getInputDevIdbyName(const string & name); - int getSwitchIdbyName(const string & inputDevName, - const string & switchName); - int getAppKindIdbyName(const string & name); - int getCategoryIdbyName(const string & name); - const CicoSCResourceConf* getResourceConf() const - { - return m_resourceConf; - }; - const CicoSCCategoryConf* getCategoryObjbyCaategoryID(int id); - - const CicoSCUserConf* getUserConf() const - { - return m_userConf; - }; - -private: - // default constructor - CicoSCSystemConfig(); - - // destructor - ~CicoSCSystemConfig(); - - // assignment operator - CicoSCSystemConfig& operator=(const CicoSCSystemConfig &object); - - // copy constructor - CicoSCSystemConfig(const CicoSCSystemConfig &object); - - void createNodeConfList(const ptree & root); - void createDisplayConfList(const ptree & root); - void createLayerConf(const ptree::value_type & child, - CicoSCDisplayConf* displayConf); - void createDisplayZoneConf(const ptree::value_type & child, - CicoSCDisplayConf* displayConf); - - void createSoundConfList(const ptree & root); - void createSoundZoneConf(const ptree::value_type & child, - CicoSCSoundConf* soundConf); - void createPortConf(const ptree & root); - void createCategoryConf(const ptree & root); - void createAppKindConf(const ptree & root); - void createInputDevList(const ptree & root); - void createSwitchList(const ptree::value_type & child, - CicoSCInputDevConf* inputDevConf); - void createDefaultConf(const ptree & root); - void createLogConf(const ptree & root); - void createResourceConf(const ptree & root); - void createUserConf(const ptree & root); - - int calcGeometryExpr(const string & expr, CicoSCDisplayConf* conf); - -private: - static CicoSCSystemConfig* ms_myInstance; - string m_confFile; - map m_typeTable; - map m_displayTypeTable; - map m_categoryTalbe; - map m_privilegeTable; - vector m_nodeConfList; - vector m_displayConfList; - vector m_soundConfList; - vector m_inputDevConfList; - vector m_categoryConfList; - vector m_appKindConfList; - int m_sysconPort; - int m_soundPluginPort; - int m_loglevel; - bool m_logflush; - CicoSCDefaultConf *m_defaultConf; - CicoSCResourceConf *m_resourceConf; - CicoSCUserConf *m_userConf; -}; -#endif // __CICO_SC_SYSTEM_CONFIG_H__ -// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/Cico_aul_listen_app.h b/src/homescreen/Cico_aul_listen_app.h deleted file mode 100644 index f650e3b..0000000 --- a/src/homescreen/Cico_aul_listen_app.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -/** - * @brief Homescreen application aul handler multi support - * - * @date Sep-23-2013 - */ -#ifndef CICO_AUL_LISTEN_APP_H -#define CICO_AUL_LISTEN_APP_H - -int aul_listen_app_launch_signal_add(int (*func) (int, void *), void *data); -int aul_listen_app_dead_signal_add(int (*func) (int, void *), void *data); -void initAulListenXSignal(); - -#endif diff --git a/src/homescreen/Makefile.am b/src/homescreen/Makefile.am index 0486b36..4bfbffc 100644 --- a/src/homescreen/Makefile.am +++ b/src/homescreen/Makefile.am @@ -5,116 +5,76 @@ AM_CXXFLAGS = $(GCC_CXXFLAGS) COMMON_LIBS = -lm -lwebsockets -lico-uxf-weston-plugin -lsecurity-server-client noinst_PROGRAMS = \ - HomeScreen \ - StatusBar + HomeScreen -HomeScreen_SOURCES = \ - home_screen_main.cpp \ - CicoSCAilItems.cpp \ - CicoSCAulItems.cpp \ - CicoSCSystemConfig.cpp \ - CicoSCLifeCycleController.cpp \ - CicoHSWindow.cpp \ - CicoHSWindowController.cpp \ - CicoHSMenuTouch.cpp \ - CicoHomeScreen.cpp \ - CicoHSMenuTile.cpp \ - CicoHSBackWindow.cpp \ - CicoHSControlBarWindow.cpp \ - CicoHSControlBarTouch.cpp \ - CicoHSMenuWindow.cpp \ - CicoHSAppInfo.cpp \ - CicoHomeScreenConfig.cpp \ - CicoHomeScreenResourceConfig.cpp \ - CicoHomeScreenSound.cpp \ - CicoHomeScreenSoundConfig.cpp \ - CicoHSSystemState.cpp \ - CicoHSSwipeTouch.cpp \ - CicoHSSwipeInputWindow.cpp \ - CicoHSAppHistory.cpp \ - CicoHSAppHistoryExt.cpp \ - Cico_aul_listen_app.cpp \ - CicoSound.cpp +HomeScreen_SOURCES = \ + CicoHSEFLApp.cpp \ + CicoHSCmdOpts.cpp \ + home_screen_main.cpp \ + CicoHSLifeCycleController.cpp \ + CicoHSWindow.cpp \ + CicoHSWindowController.cpp \ + CicoHSMenuTouch.cpp \ + CicoHomeScreen.cpp \ + CicoHSMenuTile.cpp \ + CicoHSBackWindow.cpp \ + CicoHSControlBarWindow.cpp \ + CicoHSControlBarTouch.cpp \ + CicoHSMenuWindow.cpp \ + CicoHSAppInfo.cpp \ + CicoHSSystemState.cpp \ + CicoHSSwipeTouch.cpp \ + CicoHSSwipeInputWindow.cpp \ + CicoHSAppHistory.cpp \ + CicoHSAppHistoryExt.cpp \ + CicoHSCommand.cpp \ + CicoHSServer.cpp \ + CicoHSMessage.cpp \ + CicoHSAppControl.cpp \ + CicoHSCommandArg.cpp -HomeScreen_CFLAGS= \ - $(EFL_CFLAGS) \ - $(OPT_CFLAGS) \ - $(WL_CFLAGS) \ - $(AUL_CFLAGS) \ - $(AIL_CFLAGS) \ - $(UWS_CFLAGS) \ - $(PKGMGR_CFLAGS) \ - -I/usr/include/ico-uxf-weston-plugin \ - -I/usr/include/ico-util -HomeScreen_CXXFLAGS= \ - $(EFL_CFLAGS) \ - $(OPT_CFLAGS) \ - $(WL_CFLAGS) \ - $(AUL_CFLAGS) \ - $(AIL_CFLAGS) \ - $(UWS_CFLAGS) \ - $(PKGMGR_CFLAGS) \ - -I/usr/include/ico-uxf-weston-plugin \ - -I/usr/include/ico-util \ - -I../../include -HomeScreen_LDADD = \ - $(EFL_LIBS) \ - $(OPT_LIBS) \ - $(WL_LIBS) \ - $(COMMON_LIBS) \ - $(UWS_LIBS) \ - $(AUL_LIBS) \ - $(AIL_LIBS) \ - -lico-util \ - -lico-uxf-weston-plugin \ - /usr/lib/libpkgmgr-client.so \ - ../../lib/apps-framework/.libs/libico-appfw.so \ - -lwayland-egl -lEGL -lGLESv2 +HomeScreen_CFLAGS= \ + @CAPIAPPFWAPPLICATION_CFLAGS@ \ + $(EFL_CFLAGS) \ + $(OPT_CFLAGS) \ + $(WL_CFLAGS) \ + $(AUL_CFLAGS) \ + $(AIL_CFLAGS) \ + $(UWS_CFLAGS) \ + $(PKGMGR_CFLAGS) \ + $(UWS_CFLAGS) \ + $(WESTONPLUGIN_CFLAGS) \ + -I../../include \ + -I../../lib/common -#OnScreen_SOURCES = \ -# on_screen.cpp \ -# CicoOnScreenAction.cpp \ -# CicoOnScreenAppList.cpp \ -# CicoOnScreenControlWindow.cpp \ -# CicoOnScreenContext.cpp \ -# CicoHomeScreenConfig.cpp \ -# CicoHomeScreenResourceConfig.cpp \ -# CicoHomeScreenSound.cpp \ -# CicoHomeScreenSoundConfig.cpp -#OnScreen_CXXFLAGS = -I../include $(EFL_CFLAGS) $(OPT_CFLAGS) $(WL_CFLAGS) $(AUL_CFLAGS) $(UWS_CFLAGS) -I/usr/include/ico-uxf-weston-plugin -I/usr/include/ico-util -#OnScreen_LDADD = $(EFL_LIBS) $(OPT_LIBS) $(WL_LIBS) $(COMMON_LIBS) $(AUL_LIBS) $(UWS_LIBS) ../apps_controller/libico_syc-apc.a ../ico-app-framework/.libs/libico-app-fw-efl.so ../ico-app-framework/.libs/libico-app-fw.so +HomeScreen_CXXFLAGS= \ + @CAPIAPPFWAPPLICATION_CFLAGS@ \ + $(EFL_CFLAGS) \ + $(OPT_CFLAGS) \ + $(WL_CFLAGS) \ + $(AUL_CFLAGS) \ + $(AIL_CFLAGS) \ + $(UWS_CFLAGS) \ + $(PKGMGR_CFLAGS) \ + $(UWS_CFLAGS) \ + $(WESTONPLUGIN_CFLAGS) \ + -I../../include \ + -I../../lib/common -StatusBar_SOURCES = \ - status_bar.cpp \ - CicoStatusBarControlWindow.cpp \ - CicoStatusBarTime.cpp \ - CicoHomeScreenConfig.cpp \ - CicoHomeScreenResourceConfig.cpp \ - CicoHomeScreenSound.cpp \ - CicoHomeScreenSoundConfig.cpp -StatusBar_CFLAGS = \ - $(EFL_CFLAGS) \ - $(OPT_CFLAGS) \ - $(WL_CFLAGS) \ - $(AUL_CFLAGS) \ - $(UWS_CFLAGS) \ - -I/usr/include/ico-uxf-weston-plugin \ - -I/usr/include/ico-util -StatusBar_CXXFLAGS = \ - $(EFL_CFLAGS) \ - $(OPT_CFLAGS) \ - $(WL_CFLAGS) \ - $(AUL_CFLAGS) \ - $(UWS_CFLAGS) \ - -I/usr/include/ico-uxf-weston-plugin \ - -I/usr/include/ico-util -StatusBar_LDADD = \ - $(EFL_LIBS) \ - $(OPT_LIBS) \ - $(WL_LIBS) \ - $(COMMON_LIBS) \ - $(AUL_LIBS) \ - $(UWS_LIBS) +HomeScreen_LDADD = \ + ../../lib/common/.libs/libico-common.a \ + @CAPIAPPFWAPPLICATION_LIBS@ \ + @PKGMGR_LIBS@ \ + $(EFL_LIBS) \ + $(OPT_LIBS) \ + $(WL_LIBS) \ + $(COMMON_LIBS) \ + $(UWS_LIBS) \ + $(AUL_LIBS) \ + $(AIL_LIBS) \ + $(UWS_LIBS) \ + ../../lib/apps-framework/.libs/libico-appfw.so \ + -lwayland-egl -lEGL -lGLESv2 SUFFIXES = .edc .edj @@ -164,4 +124,4 @@ install-exec-hook: uninstall: rm -rf $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen - rm -f $(INSTALL_ROOT)/usr/share/packages/org.tizen.ico.homescreen + rm -f $(INSTALL_ROOT)/usr/share/packages/org.tizen.ico.homescreen.xml diff --git a/src/homescreen/home_screen_main.cpp b/src/homescreen/home_screen_main.cpp index 70bfc5f..28484bd 100644 --- a/src/homescreen/home_screen_main.cpp +++ b/src/homescreen/home_screen_main.cpp @@ -6,201 +6,157 @@ * http://www.apache.org/licenses/LICENSE-2.0 * */ + +//========================================================================== /** - * @brief homescreen application main + * @file home_screen_main.cpp * - * @date Feb-15-2013 + * @brief This file is implimantion of homescreen application main function */ +//========================================================================== -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include "CicoHomeScreenConfig.h" -#include "ico_syc_public.h" -#include "CicoSCConf.h" -#include "CicoSCSystemConfig.h" -#include "Cico_aul_listen_app.h" -#include "CicoHomeScreen.h" -#include "CicoSound.h" - -using namespace std; - -string g_login_user_name; - -static Eina_Bool launchApps(void* data); -/** - * ecore timer void data typedef - */ -typedef struct t_launcApps_data { - string filePath; - string filePathD; - CicoHomeScreen *hs; -} launcApps_data_t; - - -/*--------------------------------------------------------------------------*/ +#include +#include "ico_log.h" +#include "CicoHSEFLApp.h" +#include "CicoHSCmdOpts.h" +#include "CicoGKeyFileConfig.h" + +#define ICO_CONFIG_LOG "log" +#define ICO_CONFIG_LOG_NAME "filename" +#define ICO_CONFIG_LOG_LEVEL "loglevel" +#define ICO_CONFIG_LOG_FLUSH "logflush" +#define ICO_CONFIG_LOG_ECORE "ecorelog" + +//-------------------------------------------------------------------------- /** - * @brief main - * homescreen main. initialize UXF, app manager, and ecore. - * - * @param[in] argc counts of argment - * @param[in] argv argment - * @return result - * @retval >=0 success - * @retval -1 error + * @brief setup log */ -/*--------------------------------------------------------------------------*/ -int -main(int argc, char *argv[]) +//-------------------------------------------------------------------------- +void +setupLog(void) { - int ret; + /* init configuration */ + CicoGKeyFileConfig hsConfig; + hsConfig.Initialize(ICO_HOMESCREEN_CONFIG_FILE); - eina_init(); - eina_log_level_set(EINA_LOG_LEVEL_DBG); + // ico log open + std::string name; + name = hsConfig.ConfigGetString(ICO_CONFIG_LOG, + ICO_CONFIG_LOG_NAME, + "HomeScreen"); + ico_log_open(name.c_str()); - ico_log_open("HomeScreen"); - // load system config - CicoSCSystemConfig::getInstance()->load(ICO_HS_LIFECYCLE_CONTROLLER_SETTING_PATH); + // ico log level + int log_level = 0; + std::string level = hsConfig.ConfigGetString(ICO_CONFIG_LOG, + ICO_CONFIG_LOG_LEVEL, + "all"); - /* init configuration */ - ICO_DBG("main: config initialize start"); - CicoHomeScreenConfig *config = new CicoHomeScreenConfig(); - config->Initialize(ICO_HOMESCREEN_CONFIG_FILE); - ICO_DBG("main: config initialize end"); - - /* get LOGIN-USER parameter */ - bundle *b = bundle_import_from_argv(argc, argv); // import from argc+argv - const char* valusr = bundle_get_val(b, ICO_SYC_APP_BUNDLE_KEY1); - const char* valpath = bundle_get_val(b, ICO_SYC_APP_BUNDLE_KEY2); - const char* valpathD = bundle_get_val(b, ICO_SYC_APP_BUNDLE_KEY3); - const char* valFlagPath = bundle_get_val(b, ICO_SYC_APP_BUNDLE_KEY4); - if ((NULL != valusr) && (0 != valusr)) { - g_login_user_name = valusr; + if (NULL != strstr(level.c_str(), "performance")) { + log_level |= ICO_LOG_LVL_PRF; } - else { - g_login_user_name.clear(); + + if (NULL != strstr(level.c_str(), "trace")) { + log_level |= ICO_LOG_LVL_TRA; } - launcApps_data_t x; - x.hs = NULL; - if ((NULL != valpath) && (0 != valpath)) { - x.filePath = valpath; + if (NULL != strstr(level.c_str(), "debug")) { + log_level |= ICO_LOG_LVL_DBG; } - else { - x.filePath.clear(); + + if (NULL != strstr(level.c_str(), "info")) { + log_level |= ICO_LOG_LVL_INF; } - if ((NULL != valpathD) && (0 != valpathD)) { - x.filePathD = valpathD; + if (NULL != strstr(level.c_str(), "warning")) { + log_level |= ICO_LOG_LVL_WRN; } - else { - x.filePathD.clear(); + + if (NULL != strstr(level.c_str(), "critical")) { + log_level |= ICO_LOG_LVL_CRI; } - string flagPath; - if ((NULL != valFlagPath) && (0 != valFlagPath)) { - flagPath = valFlagPath; + + if (NULL != strstr(level.c_str(), "error")) { + log_level |= ICO_LOG_LVL_ERR; + } + + std::string flush = hsConfig.ConfigGetString(ICO_CONFIG_LOG, + ICO_CONFIG_LOG_FLUSH, + "on"); + if (NULL != strstr(flush.c_str(), "on")) { + log_level |= ICO_LOG_FLUSH; } else { - flagPath.clear(); + log_level |= ICO_LOG_NOFLUSH; } - ICO_DBG("PARAM=\"%s\", \"%s\", \"%s\", \"%s\"", g_login_user_name.c_str(), - x.filePath.c_str(), x.filePathD.c_str(), flagPath.c_str()); - bundle_free(b); - valusr = valpath = valpathD = valFlagPath = NULL; - - /* init home screen soud */ - ICO_DBG("main: sound initialize start"); - CicoHomeScreenSound *sound = new CicoHomeScreenSound(); - sound->Initialize(config); - ICO_DBG("main: sound initialize end"); - - CicoSound::GetInstance()->Initialize(config); - - /*AUL Listen Signal set(launch/dead)*/ - initAulListenXSignal(); - /*create homescreen*/ - ICO_DBG("main: homescreen initialize start"); - CicoHomeScreen *home_screen = new CicoHomeScreen(); - - ret = home_screen->Initialize(ICO_ORIENTATION_VERTICAL, config); - if(ret != ICO_OK){ - ICO_ERR("main: homescreen initialize failed"); - /*clear all classes*/ - delete home_screen; - delete sound; - delete config; - exit(8); + if (NULL != strstr(level.c_str(), "none")) { + ico_log_set_level(0); + } + else if (NULL == strstr(level.c_str(), "all")) { + ico_log_set_level(log_level); } - ICO_DBG("main: homescreen initialize end"); - - ICO_DBG("main: create homescreen "); - /* application history class init. before call launchApps */ - home_screen->InitializeAppHistory(g_login_user_name, x.filePath, - x.filePathD, flagPath); - /* application history launch */ - x.hs = home_screen; - ecore_timer_add(0.01, launchApps, &x); - - /*home screen start and go into main loop*/ - home_screen->StartHomeScreen(); - - ICO_DBG("main: end homescreen"); - - /* when loop is terminated */ - /* delete homescreen */ - home_screen->Finalize(); - - /*clear all classes*/ - delete home_screen; - - delete sound; - - delete config; - return 0; + // eocre log print + std::string ecore = hsConfig.ConfigGetString(ICO_CONFIG_LOG, + ICO_CONFIG_LOG_ECORE, + "on"); + if (NULL != strstr(ecore.c_str(), "on")) { + eina_init(); + eina_log_level_set(EINA_LOG_LEVEL_DBG); + } } -/*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- /** - * @brief launch applications + * @brief homescreen main + * homescreen main. initialize UXF, app manager, and ecore. * - * @param filepath start applications list file path - * @param filepathD defalt start applications list file path - * @return bool - * @retval true success - * @retval false fail + * @param [in] argc counts of argment + * @param [in] argv argment + * @return result + * @retval 0 success + * @retval -1 error */ -/*--------------------------------------------------------------------------*/ -static Eina_Bool launchApps(void* data) +//-------------------------------------------------------------------------- +int +main(int argc, char *argv[]) { - ICO_DBG("start"); - launcApps_data_t* x = (launcApps_data_t*) data; - if ((NULL == x) || (NULL == x->hs)) { - ICO_DBG("end"); - return ECORE_CALLBACK_CANCEL; - } - - vector apps; - x->hs->readStartupApp(apps); - - int sz = apps.size(); - for (int i =sz; i > 0; i--) { - string appid = apps[i-1].first; - bool bFLAG = apps[i-1].second; - int pid = aul_launch_app(appid.c_str(), NULL); - ICO_DBG("aul_launch_app[%d]%d:%s:%d", i, pid, appid.c_str(), (int)bFLAG); - if ((0 < pid) && (NULL != x->hs)) { - x->hs->startupCheckAdd(pid, appid, bFLAG); - } - } - ICO_DBG("end"); - return ECORE_CALLBACK_CANCEL; + try { + printf("=== start HomeScreen main entry\n"); + + // setupLog + setupLog(); + ICO_INF( "START_MODULE HomeScreen" ); + + // perse command options + CicoHSCmdOpts::getInstance()->parse(argc, argv); + + // start homescreen + CicoHSEFLApp hsEFLApp; + int ret = hsEFLApp.start(argc, argv); + + ICO_DBG("ret = %d error=%s", ret, hsEFLApp.appfwErrorToString(ret)); + } + catch (const std::exception& e) { + std::cerr << e.what() << std::endl; + ICO_ERR("main: catch exception [%s]", e.what()); + return -1; + } + catch (const std::string& str) { + std::cerr << str << std::endl; + ICO_ERR("main: catch exception [%s]", str.c_str()); + return -1; + } + catch (...) { + ICO_ERR("main: catch exception unknown"); + return -1; + } + ICO_INF( "END_MODULE HomeScreen" ); + + return 0; } +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/home_screen_main.h b/src/homescreen/home_screen_main.h deleted file mode 100644 index a7817d0..0000000 --- a/src/homescreen/home_screen_main.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef __HOME_SCREEN_MAIN_H__ -#define __HOME_SCREEN_MAIN_H__ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ -/** - * @brief homescreen application main - * - * @date Feb-15-2013 - */ - -#include -#include -#include - -#include "CicoHomeScreen.h" -#include "CicoHomeScreenConfig.h" -#include "CicoHomeScreenSound.h" - -#endif - diff --git a/src/homescreen/home_screen_res.h b/src/homescreen/home_screen_res.h index 74c168e..d8dca01 100644 --- a/src/homescreen/home_screen_res.h +++ b/src/homescreen/home_screen_res.h @@ -15,8 +15,9 @@ #ifndef HOME_SCREEN_RES_H #define HOME_SCREEN_RES_H +#if 0 /* file_path */ -#define default_path "./" +//#define default_path "./" #define edj_path "/usr/apps/%s/res/edj/" #define image_path "/usr/apps/%s/res/images/" #define sound_path "/usr/apps/%s/res/sounds/" @@ -26,6 +27,7 @@ #define local_image_path "%s/res/images/" #define local_sound_path "%s/res/sounds/" #define local_manifest_path "%s/res/apps/org.tizen.ico.homescreen/" +#endif #define fname_api_all_off "api_all_off.png" #define fname_api_all_on "api_all_on.png" @@ -126,3 +128,4 @@ #define fname_colon "time_ten.png" #endif /* HOME_SCREEN_RES_H */ +// vim:set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoOnScreenAction.cpp b/src/onscreen/CicoOnScreenAction.cpp similarity index 96% rename from src/homescreen/CicoOnScreenAction.cpp rename to src/onscreen/CicoOnScreenAction.cpp index 6a1ef77..f060cfb 100644 --- a/src/homescreen/CicoOnScreenAction.cpp +++ b/src/onscreen/CicoOnScreenAction.cpp @@ -264,11 +264,11 @@ CicoOnScreenAction::TouchUpEdje(void *data, Evas *evas, Evas_Object *obj, void * /* get name from userdata */ if (data != NULL) { - ICO_DBG("CicoOnScreenAction::TouchUpEdje: user data is %s", - static_cast(data)); + ICO_PRF("TOUCH_EVENT Edje Up date=%s", + static_cast(data)); } else { - ICO_DBG("CicoOnScreenAction::TouchUpEdje: user data is NULL"); + ICO_PRF("TOUCH_EVENT Edje Up date=(NIL)"); } context->EventMessage(const_cast("%s TOUCH %s %s"), ICO_HS_MSG_HEAD_OS, edje_str, data); @@ -300,11 +300,11 @@ CicoOnScreenAction::TouchUpNext(void *data, Evas *evas, Evas_Object *obj, void * /* get name from userdata */ if (data != NULL) { - ICO_DBG("CicoOnScreenAction::TouchUpNext: user data is %s", + ICO_PRF("TOUCH_EVENT Next Up date=%s", static_cast(data)); } else { - ICO_DBG("OCicoOnScreenAction::TouchUpNext: user data is NULL"); + ICO_PRF("TOUCH_EVENT Next Up date=(NIL)"); } context->EventMessage(static_cast("%s TOUCH %s %s"), ICO_HS_MSG_HEAD_OS, edje_str, data); diff --git a/src/homescreen/CicoOnScreenAction.h b/src/onscreen/CicoOnScreenAction.h similarity index 100% rename from src/homescreen/CicoOnScreenAction.h rename to src/onscreen/CicoOnScreenAction.h diff --git a/src/homescreen/CicoOnScreenAppList.cpp b/src/onscreen/CicoOnScreenAppList.cpp similarity index 98% rename from src/homescreen/CicoOnScreenAppList.cpp rename to src/onscreen/CicoOnScreenAppList.cpp index c8c08cc..185a2b4 100644 --- a/src/homescreen/CicoOnScreenAppList.cpp +++ b/src/onscreen/CicoOnScreenAppList.cpp @@ -108,7 +108,7 @@ CicoOnScreenAppList::LoadConfig(void) int appcnt; int appidx, idx, cnt; - ICO_DBG("CicoOnScreenAppList::LoadConfig: Enter"); + ICO_TRA("CicoOnScreenAppList::LoadConfig: Enter"); appconf = const_cast(ico_uxf_getAppConfig()); appcnt = appconf->applicationNum; @@ -137,7 +137,7 @@ CicoOnScreenAppList::LoadConfig(void) app_cnt = appcnt; applist_idx = 0; - ICO_DBG("CicoOnScreenAppList::LoadConfig: Leave(appcnt=%d)", appcnt); + ICO_TRA("CicoOnScreenAppList::LoadConfig: Leave(appcnt=%d)", appcnt); return; } @@ -156,12 +156,12 @@ CicoOnScreenAppList::LoadConfig(void) void CicoOnScreenAppList::ConfigEvent(const char *appid, int type) { - ICO_DBG("CicoOnScreenAppList::LoadConfig: Enter(appid=%s, type=%d)", + ICO_TRA("CicoOnScreenAppList::LoadConfig: Enter(appid=%s, type=%d)", appid, type); LoadConfig(); - ICO_DBG("CicoOnScreenAppList::LoadConfig: Leave"); + ICO_TRA("CicoOnScreenAppList::LoadConfig: Leave"); return; } diff --git a/src/homescreen/CicoOnScreenAppList.h b/src/onscreen/CicoOnScreenAppList.h similarity index 100% rename from src/homescreen/CicoOnScreenAppList.h rename to src/onscreen/CicoOnScreenAppList.h diff --git a/src/homescreen/CicoOnScreenContext.cpp b/src/onscreen/CicoOnScreenContext.cpp similarity index 100% rename from src/homescreen/CicoOnScreenContext.cpp rename to src/onscreen/CicoOnScreenContext.cpp diff --git a/src/homescreen/CicoOnScreenContext.h b/src/onscreen/CicoOnScreenContext.h similarity index 100% rename from src/homescreen/CicoOnScreenContext.h rename to src/onscreen/CicoOnScreenContext.h diff --git a/src/homescreen/CicoOnScreenControlWindow.cpp b/src/onscreen/CicoOnScreenControlWindow.cpp similarity index 100% rename from src/homescreen/CicoOnScreenControlWindow.cpp rename to src/onscreen/CicoOnScreenControlWindow.cpp diff --git a/src/homescreen/CicoOnScreenControlWindow.h b/src/onscreen/CicoOnScreenControlWindow.h similarity index 100% rename from src/homescreen/CicoOnScreenControlWindow.h rename to src/onscreen/CicoOnScreenControlWindow.h diff --git a/src/onscreen/Makefile.am b/src/onscreen/Makefile.am new file mode 100644 index 0000000..5e62beb --- /dev/null +++ b/src/onscreen/Makefile.am @@ -0,0 +1,72 @@ +AM_CFLAGS = $(GCC_CFLAGS) +AM_CPPFLAGS = $(GCC_CXXFLAGS) +AM_CXXFLAGS = $(GCC_CXXFLAGS) + +COMMON_LIBS = -lm -lwebsockets -lico-uxf-weston-plugin -lsecurity-server-client + +noinst_PROGRAMS = \ + OnScreen + +OnScreen_SOURCES = \ + on_screen.cpp \ + CicoOnScreenAction.cpp \ + CicoOnScreenAppList.cpp \ + CicoOnScreenControlWindow.cpp \ + CicoOnScreenContext.cpp + +OnScreen_CFLAGS= \ + @CAPIAPPFWAPPLICATION_CFLAGS@ \ + $(EFL_CFLAGS) \ + $(OPT_CFLAGS) \ + $(WL_CFLAGS) \ + $(AUL_CFLAGS) \ + $(AIL_CFLAGS) \ + $(UWS_CFLAGS) \ + $(PKGMGR_CFLAGS) \ + $(UWS_CFLAGS) \ + $(WESTONPLUGIN_CFLAGS) \ + -I../../include \ + -I../../lib/common + +OnScreen_CXXFLAGS= \ + @CAPIAPPFWAPPLICATION_CFLAGS@ \ + $(EFL_CFLAGS) \ + $(OPT_CFLAGS) \ + $(WL_CFLAGS) \ + $(AUL_CFLAGS) \ + $(AIL_CFLAGS) \ + $(UWS_CFLAGS) \ + $(PKGMGR_CFLAGS) \ + $(UWS_CFLAGS) \ + $(WESTONPLUGIN_CFLAGS) \ + -I../../include \ + -I../../lib/common + +OnScreen_LDADD = \ + ../../lib/common/.libs/libico-common.a \ + @CAPIAPPFWAPPLICATION_LIBS@ \ + @PKGMGR_LIBS@ \ + $(EFL_LIBS) \ + $(OPT_LIBS) \ + $(WL_LIBS) \ + $(COMMON_LIBS) \ + $(UWS_LIBS) \ + $(AUL_LIBS) \ + $(AIL_LIBS) \ + $(UWS_LIBS) \ + ../../lib/apps-framework/.libs/libico-appfw.so \ + -lwayland-egl -lEGL -lGLESv2 + +CLEANFILES = $(BUILT_SOURCES) + +install-exec-hook: + mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.onscreen/bin + mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.onscreen/res/config + mkdir -p $(INSTALL_ROOT)/usr/share/packages + install -m 0755 OnScreen $(INSTALL_ROOT)/usr/apps/org.tizen.ico.onscreen/bin + install -m 0644 $(top_srcdir)/data/share/packages/org.tizen.ico.onscreen.xml $(INSTALL_ROOT)/usr/share/packages + install -m 0644 $(top_srcdir)/res/org.tizen.ico.onscreen/res/config/* $(INSTALL_ROOT)/usr/apps/org.tizen.ico.onscreen/res/config + +uninstall: + rm -rf $(INSTALL_ROOT)/usr/apps/org.tizen.ico.onscreen + rm -f $(INSTALL_ROOT)/usr/share/packages/org.tizen.ico.onscreen.xml diff --git a/src/homescreen/on_screen.cpp b/src/onscreen/on_screen.cpp similarity index 100% rename from src/homescreen/on_screen.cpp rename to src/onscreen/on_screen.cpp diff --git a/src/homescreen/on_screen.h b/src/onscreen/on_screen.h similarity index 100% rename from src/homescreen/on_screen.h rename to src/onscreen/on_screen.h diff --git a/src/statusbar/CicoSBConfigDef.h b/src/statusbar/CicoSBConfigDef.h new file mode 100644 index 0000000..962804f --- /dev/null +++ b/src/statusbar/CicoSBConfigDef.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ +/** + * @brief header file of homescreen resource + * + * @date Feb-15-2013 + */ + +#ifndef __CICO_SB_CONFIG_DEF_H__ +#define __CICO_SB_CONFIG_DEF_H__ + +#define ICO_SB_CONFIG_STATUSBAR "statusbar" +#define ICO_SB_CONFIG_ORIENTATION "orientation" +#define ICO_SB_CONFIG_SOUND "sound" + +#endif // __CICO_SB_CONFIG_DEF_H__ +// vim:set expandtab ts=4 sw=4: + diff --git a/src/statusbar/CicoSBResourceDef.h b/src/statusbar/CicoSBResourceDef.h new file mode 100644 index 0000000..ffed84a --- /dev/null +++ b/src/statusbar/CicoSBResourceDef.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ +/** + * @brief header file of homescreen resource + * + * @date Feb-15-2013 + */ + +#ifndef __CICO_SB_RESOURCE_DEF_H__ +#define __CICO_SB_RESOURCE_DEF_H__ + +// file name (status bar) +#define fname_logo_off "st_logo_off.png" +#define fname_logo_on "st_logo_on.png" +#define fname_am "time_am.png" +#define fname_pm "time_pm.png" +#define fname_num1 "time_1.png" +#define fname_num2 "time_2.png" +#define fname_num3 "time_3.png" +#define fname_num4 "time_4.png" +#define fname_num5 "time_5.png" +#define fname_num6 "time_6.png" +#define fname_num7 "time_7.png" +#define fname_num8 "time_8.png" +#define fname_num9 "time_9.png" +#define fname_num0 "time_0.png" +#define fname_colon "time_ten.png" + +#endif // __CICO_SB_RESOURCE_DEF_H__ +// vim:set expandtab ts=4 sw=4: + diff --git a/src/homescreen/CicoStatusBarControlWindow.cpp b/src/statusbar/CicoStatusBarControlWindow.cpp similarity index 96% rename from src/homescreen/CicoStatusBarControlWindow.cpp rename to src/statusbar/CicoStatusBarControlWindow.cpp index 4e4715c..635ced7 100644 --- a/src/homescreen/CicoStatusBarControlWindow.cpp +++ b/src/statusbar/CicoStatusBarControlWindow.cpp @@ -11,7 +11,12 @@ * * @date Feb-15-2013 */ + +#include +#include "CicoResourceConfig.h" #include "CicoStatusBarControlWindow.h" +#include "CicoSBResourceDef.h" +#include "CicoSBConfigDef.h" /*============================================================================*/ /* Declare static values */ @@ -65,17 +70,17 @@ CicoStatusBarControlWindow::~CicoStatusBarControlWindow() * @brief CicoStatusBarControlWindow::Initialize * Initialize * - * @param[in] homescreen_config_tmp pointer to instance of CicoHomeScreenConfig + * @param[in] homescreen_config_tmp pointer to instance of CicoGKeyFileConfig * @return none */ /*--------------------------------------------------------------------------*/ void -CicoStatusBarControlWindow::Initialize(CicoHomeScreenConfig *homescreen_config_tmp) +CicoStatusBarControlWindow::Initialize(CicoGKeyFileConfig *homescreen_config_tmp) { homescreen_config = homescreen_config_tmp; /* get image path*/ - CicoHomeScreenResourceConfig::GetImagePath(respath, sizeof(respath)); + CicoResourceConfig::GetImagePath(respath, sizeof(respath)); /*create instances*/ time_data[0] = new CicoStatusBarTime(fname_num0); @@ -179,7 +184,7 @@ CicoStatusBarControlWindow::StartEcoreLoop(void) void CicoStatusBarControlWindow::QuitEcoreLoop(Ecore_Evas *ee) { - ICO_DBG("CicoStatusBarControlWindow::QuitEcoreLoop: Enter"); + ICO_TRA("CicoStatusBarControlWindow::QuitEcoreLoop: Enter"); ecore_main_loop_quit(); } @@ -200,8 +205,8 @@ CicoStatusBarControlWindow::ResizeWindow(int orientation) /* load configuration */ if (homescreen_config != NULL) { - orientation = homescreen_config->ConfigGetInteger(ICO_HS_CONFIG_STATUBAR, - ICO_HS_CONFIG_ORIENTAION, + orientation = homescreen_config->ConfigGetInteger(ICO_SB_CONFIG_STATUSBAR, + ICO_SB_CONFIG_ORIENTATION, orientation); } @@ -458,9 +463,10 @@ CicoStatusBarControlWindow::ShowClock(void) void CicoStatusBarControlWindow::EvasObjectImageFileSetAndShow(Evas_Object *obj,char *icon) { - char img[ICO_HS_TEMP_BUF_SIZE]; + char img[256]; sprintf(img, icon, respath); evas_object_image_file_set(obj, img, NULL); evas_object_show(obj); } +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoStatusBarControlWindow.h b/src/statusbar/CicoStatusBarControlWindow.h similarity index 94% rename from src/homescreen/CicoStatusBarControlWindow.h rename to src/statusbar/CicoStatusBarControlWindow.h index 09f6226..0f10fbd 100644 --- a/src/homescreen/CicoStatusBarControlWindow.h +++ b/src/statusbar/CicoStatusBarControlWindow.h @@ -22,10 +22,8 @@ #include -#include "home_screen_res.h" -#include "CicoHomeScreenCommon.h" -#include "CicoHomeScreenConfig.h" -#include "CicoHomeScreenSound.h" +//#include "CicoHomeScreenCommon.h" +#include "CicoGKeyFileConfig.h" #include "CicoStatusBarTime.h" #define ICO_HS_CONFIG_ORIENTAION "orientation" @@ -89,7 +87,7 @@ class CicoStatusBarControlWindow CicoStatusBarControlWindow(); ~CicoStatusBarControlWindow(); - void Initialize(CicoHomeScreenConfig *homescreen_config_tmp); + void Initialize(CicoGKeyFileConfig *homescreen_config_tmp); void Finalize(void); int CreateEcoreEvas(void); static void StartEcoreLoop(void); @@ -123,10 +121,10 @@ class CicoStatusBarControlWindow Evas_Object *min2; char respath[ICO_SB_BUF_SIZE]; struct tm latest_time; - CicoHomeScreenConfig *homescreen_config; + CicoGKeyFileConfig *homescreen_config; protected: CicoStatusBarControlWindow operator = (const CicoStatusBarControlWindow&); CicoStatusBarControlWindow(const CicoStatusBarControlWindow&); }; #endif - +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoStatusBarTime.cpp b/src/statusbar/CicoStatusBarTime.cpp similarity index 98% rename from src/homescreen/CicoStatusBarTime.cpp rename to src/statusbar/CicoStatusBarTime.cpp index 697f473..e56fda7 100644 --- a/src/homescreen/CicoStatusBarTime.cpp +++ b/src/statusbar/CicoStatusBarTime.cpp @@ -75,4 +75,4 @@ CicoStatusBarTime::GetFileName(void) { return fname; } - +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/CicoStatusBarTime.h b/src/statusbar/CicoStatusBarTime.h similarity index 97% rename from src/homescreen/CicoStatusBarTime.h rename to src/statusbar/CicoStatusBarTime.h index c6140f5..1f8749b 100644 --- a/src/homescreen/CicoStatusBarTime.h +++ b/src/statusbar/CicoStatusBarTime.h @@ -44,6 +44,5 @@ class CicoStatusBarTime CicoStatusBarTime operator = (const CicoStatusBarTime&); CicoStatusBarTime(const CicoStatusBarTime&); }; - #endif - +// vim: set expandtab ts=4 sw=4: diff --git a/src/statusbar/Makefile.am b/src/statusbar/Makefile.am new file mode 100644 index 0000000..12c9be3 --- /dev/null +++ b/src/statusbar/Makefile.am @@ -0,0 +1,60 @@ +AM_CFLAGS = $(GCC_CFLAGS) +AM_CPPFLAGS = $(GCC_CXXFLAGS) +AM_CXXFLAGS = $(GCC_CXXFLAGS) + +COMMON_LIBS = -lm -lwebsockets -lico-uxf-weston-plugin -lsecurity-server-client + +noinst_PROGRAMS = \ + StatusBar + +StatusBar_SOURCES = \ + status_bar.cpp \ + CicoStatusBarControlWindow.cpp \ + CicoStatusBarTime.cpp + +StatusBar_CFLAGS = \ + $(EFL_CFLAGS) \ + $(OPT_CFLAGS) \ + $(WL_CFLAGS) \ + $(AUL_CFLAGS) \ + $(UWS_CFLAGS) \ + -I/usr/include/ico-uxf-weston-plugin \ + -I/usr/include/ico-util \ + -I../../include \ + -I../../lib/common + +StatusBar_CXXFLAGS = \ + $(EFL_CFLAGS) \ + $(OPT_CFLAGS) \ + $(WL_CFLAGS) \ + $(AUL_CFLAGS) \ + $(UWS_CFLAGS) \ + -I/usr/include/ico-uxf-weston-plugin \ + -I/usr/include/ico-util \ + -I../../include \ + -I../../lib/common + +StatusBar_LDADD = \ + ../../lib/common/.libs/libico-common.a \ + $(EFL_LIBS) \ + $(OPT_LIBS) \ + $(WL_LIBS) \ + $(COMMON_LIBS) \ + $(AUL_LIBS) \ + $(UWS_LIBS) + +CLEANFILES = $(BUILT_SOURCES) + +install-exec-hook: + mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/bin + mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/res/config + mkdir -p $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/res/images + mkdir -p $(INSTALL_ROOT)/usr/share/packages + install -m 0755 StatusBar $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/bin + install -m 0644 $(top_srcdir)/res/org.tizen.ico.statusbar/res/images/time*.png $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/res/images + install -m 0644 $(top_srcdir)/data/share/packages/org.tizen.ico.statusbar.xml $(INSTALL_ROOT)/usr/share/packages + install -m 0644 $(top_srcdir)/res/org.tizen.ico.statusbar/res/config/* $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar/res/config + +uninstall: + rm -rf $(INSTALL_ROOT)/usr/apps/org.tizen.ico.statusbar + rm -f $(INSTALL_ROOT)/usr/share/packages/org.tizen.ico.statusbar.xml diff --git a/src/homescreen/status_bar.cpp b/src/statusbar/status_bar.cpp similarity index 82% rename from src/homescreen/status_bar.cpp rename to src/statusbar/status_bar.cpp index 96655b7..7972050 100644 --- a/src/homescreen/status_bar.cpp +++ b/src/statusbar/status_bar.cpp @@ -11,7 +11,23 @@ * * @date Feb-15-2013 */ -#include "status_bar.h" + +#include +#include +#include + +#include + +#include + +//#include "CicoHomeScreenCommon.h" +#include "CicoGKeyFileConfig.h" +#include "CicoStatusBarControlWindow.h" + + +//#include "status_bar.h" + +#define ICO_SB_APPID_DEFAULT "org.tizen.ico.statusbar" /*--------------------------------------------------------------------------*/ /* @@ -37,8 +53,9 @@ main(int argc, char *argv[]) ico_log_open(getenv("PKG_NAME")); } else { - ico_log_open(ICO_HS_APPID_DEFAULT_SB); + ico_log_open(ICO_SB_APPID_DEFAULT); } + ICO_INF("START_MODULE Status Bar"); /* get argment */ b = bundle_import_from_argv(argc, argv); @@ -55,13 +72,9 @@ main(int argc, char *argv[]) orientation = ICO_SB_VERTICAL; /*HomeScreenConfig*/ - CicoHomeScreenConfig *homescreen_config = new CicoHomeScreenConfig(); + CicoGKeyFileConfig *homescreen_config = new CicoGKeyFileConfig(); homescreen_config->Initialize(ICO_STATUSBAR_CONFIG_FILE); - /* init home screen soud */ - CicoHomeScreenSound *sound = new CicoHomeScreenSound(); - sound->Initialize(homescreen_config); - /* controlWindow instance */ CicoStatusBarControlWindow* control_window = new CicoStatusBarControlWindow(); @@ -101,12 +114,10 @@ main(int argc, char *argv[]) control_window->Finalize(); delete control_window; - /*delete homescreen sound*/ - delete sound; - /*delete homescreen config*/ delete homescreen_config; + ICO_INF("END_MODULE Status Bar"); return 0; } - +// vim: set expandtab ts=4 sw=4: diff --git a/src/homescreen/status_bar.h b/src/statusbar/status_bar.h similarity index 76% rename from src/homescreen/status_bar.h rename to src/statusbar/status_bar.h index baad0b7..0805917 100644 --- a/src/homescreen/status_bar.h +++ b/src/statusbar/status_bar.h @@ -19,13 +19,11 @@ #include +#include -#include "home_screen_res.h" -#include "CicoLog.h" -#include "CicoHomeScreenCommon.h" -#include "CicoHomeScreenConfig.h" -#include "CicoHomeScreenSound.h" +//#include "CicoHomeScreenCommon.h" +#include "CicoGKeyFileConfig.h" #include "CicoStatusBarControlWindow.h" #endif - +// vim: set expandtab ts=4 sw=4: diff --git a/src/syscond/CicoEFLApp.cpp b/src/syscond/CicoEFLApp.cpp deleted file mode 100644 index 29c923a..0000000 --- a/src/syscond/CicoEFLApp.cpp +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ - -/*========================================================================*/ -/** - * @file CicoEFLApp.cpp - * - * @brief - */ -/*========================================================================*/ - -#include -#include -#include "Ecore.h" -#include "CicoEFLApp.h" -#include "CicoLog.h" - -/*========================================================================*/ -app_event_callback_s CicoEFLApp::m_appEventCB = { - .create = CicoEFLApp::app_create, - .terminate = CicoEFLApp::app_terminate, - .pause = CicoEFLApp::app_pause, - .resume = CicoEFLApp::app_resume, - .service = CicoEFLApp::app_service, - .low_memory = CicoEFLApp::app_low_memory, - .low_battery = CicoEFLApp::app_low_battery, - .device_orientation = CicoEFLApp::app_device_orientation, - .language_changed = CicoEFLApp::app_language_changed, - .region_format_changed = CicoEFLApp::app_region_format_changed -}; - -/*========================================================================*/ -/** - * Default Constructor - */ -CicoEFLApp::CicoEFLApp() -{ -// ICO_DBG("CicoEFLApp::CicoEFLApp Enter"); -// ICO_DBG("CicoEFLApp::CicoEFLApp Leave"); -} - -/** - * Destructor - */ -CicoEFLApp::~CicoEFLApp() -{ -// ICO_DBG("CicoEFLApp::~CicoEFLApp Enter"); -// ICO_DBG("CicoEFLApp::~CicoEFLApp Leave"); -} - -/** - * Start Main Loop - */ -int -CicoEFLApp::start(int argc, char **argv) -{ - ICO_DBG("CicoEFLApp::start Enter"); - return app_efl_main(&argc, &argv, &m_appEventCB, this); -} - -/** - * Stop Main Loop - */ -int -CicoEFLApp::stop(void) -{ - return 0; -} - -const char* -CicoEFLApp::app_error_to_string(int error) -{ - switch(error) { - case APP_ERROR_NONE: - return (const char*)"APP_ERROR_NONE"; - break; - case APP_ERROR_INVALID_PARAMETER: - return (const char*)"APP_ERROR_INVALID_PARAMETER"; - break; - case APP_ERROR_OUT_OF_MEMORY: - return (const char*)"APP_ERROR_OUT_OF_MEMORY"; - break; - case APP_ERROR_INVALID_CONTEXT: - return (const char*)"APP_ERROR_INVALID_CONTEXT"; - break; - case APP_ERROR_NO_SUCH_FILE: - return (const char*)"APP_ERROR_NO_SUCH_FILE"; - break; - case APP_ERROR_ALREADY_RUNNING: - return (const char*)"APP_ERROR_ALREADY_RUNNING"; - break; - default: - break; - } - - return (const char*)"TIZEN_ERROR_UNKNOWN"; -} - -bool -CicoEFLApp::onCreate(void *user_data) -{ - ICO_WRN("CicoEFLApp::onCreate called."); - return false; -} - -void -CicoEFLApp::onTerminate(void *user_data) -{ - ICO_WRN("CicoEFLApp::onTerminate called."); -} - -void -CicoEFLApp::onPause(void *user_data) -{ - ICO_WRN("CicoEFLApp::onPause called."); -} - -void -CicoEFLApp::onResume(void *user_data) -{ - ICO_WRN("CicoEFLApp::onResume called."); -} - -void -CicoEFLApp::onService(service_h service, void *user_data) -{ - ICO_WRN("CicoEFLApp::onService called."); -} - -void -CicoEFLApp::onLowMemory(void *user_data) -{ - ICO_WRN("CicoEFLApp::onLowMemory called."); -} - -void -CicoEFLApp::onLowBattery(void *user_data) -{ - ICO_WRN("CicoEFLApp::onLowBattery called."); -} - -void -CicoEFLApp::onDeviceOrientation(app_device_orientation_e orientation, - void *user_data) -{ - ICO_WRN("CicoEFLApp::onDeviceOrientation called."); -} - -void -CicoEFLApp::onLanguageChanged(void *user_data) -{ - ICO_WRN("CicoEFLApp::onLanguageChanged called."); -} - -void -CicoEFLApp::onRegionFormatChanged(void *user_data) -{ - ICO_WRN("CicoEFLApp::onRegionFormatChanged called."); -} - -bool -CicoEFLApp::app_create(void *user_data) -{ - ICO_DBG("CicoEFLApp::app_create Enter"); - - if (NULL == user_data) { - ICO_DBG("CicoEFLApp::app_create Leave"); - return false; - } - - int ret = static_cast(user_data)->onCreate(user_data); - - ICO_DBG("CicoEFLApp::app_create Leave(%d)", ret); - - return ret; -} - -void -CicoEFLApp::app_terminate(void *user_data) -{ - ICO_DBG("CicoEFLApp::app_terminate Enter"); - - if (NULL == user_data) { - ICO_DBG("CicoEFLApp::app_terminate Leave"); - return; - } - - static_cast(user_data)->onTerminate(user_data); - - ICO_DBG("CicoEFLApp::app_terminate Leave"); -} - -void -CicoEFLApp::app_pause(void *user_data) -{ - ICO_DBG("CicoEFLApp::app_pause Enter"); - - if (NULL == user_data) { - ICO_DBG("CicoEFLApp::app_pause Leave"); - return; - } - - static_cast(user_data)->onPause(user_data); - - ICO_DBG("CicoEFLApp::app_pause Leave"); -} - -void -CicoEFLApp::app_resume(void *user_data) -{ - ICO_DBG("CicoEFLApp::app_resume Enter"); - - if (NULL == user_data) { - ICO_DBG("CicoEFLApp::app_resume Leave"); - return; - } - - static_cast(user_data)->onResume(user_data); - - ICO_DBG("CicoEFLApp::app_resume Leave"); -} - -void -CicoEFLApp::app_service(service_h service, void *user_data) -{ - ICO_DBG("CicoEFLApp::app_service Enter"); - - if (NULL == user_data) { - ICO_DBG("CicoEFLApp::app_service Leave"); - return; - } - - static_cast(user_data)->onService(service, user_data); - - ICO_DBG("CicoEFLApp::app_service Leave"); -} - -void -CicoEFLApp::app_low_memory(void *user_data) -{ - ICO_DBG("CicoEFLApp::app_low_memory Enter"); - - if (NULL == user_data) { - ICO_DBG("CicoEFLApp::app_low_memory Leave"); - return; - } - - static_cast(user_data)->onLowMemory(user_data); - - ICO_DBG("CicoEFLApp::app_low_memory Leave"); -} - -void -CicoEFLApp::app_low_battery(void *user_data) -{ - ICO_DBG("CicoEFLApp::app_low_battery Enter"); - - if (NULL == user_data) { - ICO_DBG("CicoEFLApp::app_low_battery Leave"); - return; - } - - static_cast(user_data)->onLowBattery(user_data); - - ICO_DBG("CicoEFLApp::app_low_battery Leave"); -} - -void -CicoEFLApp::app_device_orientation(app_device_orientation_e orientation, - void *user_data) -{ - ICO_DBG("CicoEFLApp::app_device_orientation Enter"); - - if (NULL == user_data) { - ICO_DBG("CicoEFLApp::app_device_orientation Leave"); - return; - } - - static_cast(user_data)->onDeviceOrientation(orientation, - user_data); - - ICO_DBG("CicoEFLApp::app_device_orientation Leave"); -} - -void -CicoEFLApp::app_language_changed(void *user_data) -{ - ICO_DBG("CicoEFLApp::app_language_changed Enter"); - - if (NULL == user_data) { - ICO_DBG("CicoEFLApp::app_device_orientation Leave"); - return; - } - - static_cast(user_data)->onLanguageChanged(user_data); - - ICO_DBG("CicoEFLApp::app_language_changed Leave"); -} - -void -CicoEFLApp::app_region_format_changed(void *user_data) -{ - ICO_DBG("CicoEFLApp::app_region_format_changed Enter"); - - if (NULL == user_data) { - ICO_DBG("CicoEFLApp::app_device_orientation Leave"); - return; - } - - static_cast(user_data)->onRegionFormatChanged(user_data); - - ICO_DBG("CicoEFLApp::app_region_format_changed Leave"); -} -/* vim: set expandtab ts=4 sw=4: */ diff --git a/src/syscond/CicoEFLApp.h b/src/syscond/CicoEFLApp.h deleted file mode 100644 index 052e626..0000000 --- a/src/syscond/CicoEFLApp.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. - * - * This program is licensed under the terms and conditions of the - * Apache License, version 2.0. The full text of the Apache License is at - * http://www.apache.org/licenses/LICENSE-2.0 - * - */ - -/*========================================================================*/ -/** - * @file CicoEFLApp.h - * - * @brief - */ -/*========================================================================*/ -#ifndef __CICO_EFL_APP_H__ -#define __CICO_EFL_APP_H__ - -#include - -class CicoEFLApp { -public: - // default constructor - CicoEFLApp(); - - /** - * Destructor - */ - virtual ~CicoEFLApp(); - - /** - * Start Main Loop - */ int start(int argc, char **argv); - - /** - * Stop Main Loop - */ - int stop(void); - - /** - * Convert application error to string - */ - const char* app_error_to_string(int error); - - virtual bool onCreate(void *user_data); - virtual void onTerminate(void *user_data); - virtual void onPause(void *user_data); - virtual void onResume(void *user_data); - virtual void onService(service_h service, void *user_data); - virtual void onLowMemory(void *user_data); - virtual void onLowBattery(void *user_data); - virtual void onDeviceOrientation(app_device_orientation_e orientation, - void *user_data); - virtual void onLanguageChanged(void *user_data); - virtual void onRegionFormatChanged(void *user_data); - -protected: - // assignment operator - CicoEFLApp& operator=(const CicoEFLApp &object); - - // copy constructor - CicoEFLApp(const CicoEFLApp &object); - -private: - static bool app_create(void *user_data); - static void app_terminate(void *user_data); - static void app_pause(void *user_data); - static void app_resume(void *user_data); - static void app_service(service_h service, void *user_data); - static void app_low_memory(void *user_data); - static void app_low_battery(void *user_data); - static void app_device_orientation(app_device_orientation_e orientation, - void *user_data); - static void app_language_changed(void *user_data); - static void app_region_format_changed(void *user_data); - -private: - // application callbacks - static app_event_callback_s m_appEventCB; -}; -#endif /* __CICO_EFL_APP_H__ */ -/* vim:set expandtab ts=4 sw=4: */ diff --git a/src/syscond/CicoSysConDaemon.cpp b/src/syscond/CicoSysConDaemon.cpp index 9b8d81b..a8d2572 100644 --- a/src/syscond/CicoSysConDaemon.cpp +++ b/src/syscond/CicoSysConDaemon.cpp @@ -7,13 +7,13 @@ * */ -/*========================================================================*/ +//========================================================================== /** * @file CicoSysConDaemon.cpp * - * @brief + * @brief This file is implimention of CicoSysConDaemon class */ -/*========================================================================*/ +//========================================================================== #include #include @@ -22,78 +22,108 @@ #include "CicoSysConDaemon.h" #include "ico_syc_error.h" #include "CicoLog.h" -#include "CicoSCSystemConfig.h" +#include "CicoSystemConfig.h" #include "CicoSCServer.h" #include "CicoSCWayland.h" #include "CicoSCWindowController.h" #include "CicoSCInputController.h" #include "CicoSCLifeCycleController.h" +#include "CicoSCUser.h" #include "CicoSCUserManager.h" #include "CicoSCResourceManager.h" #include "Cico_aul_listen_app.h" +#include "CicoSCVInfoManager.h" +//-------------------------------------------------------------------------- /** - * Default Constructor + * @brief default constructor */ +//-------------------------------------------------------------------------- CicoSysConDaemon::CicoSysConDaemon() + : m_winctrl(NULL), m_inputctrl(NULL), m_resourcemgr(NULL) { -// ICO_DBG("CicoSysConDaemon::CicoSysConDaemon Enter"); -// ICO_DBG("CicoSysConDaemon::CicoSysConDaemon Leave"); +// ICO_TRA("CicoSysConDaemon::CicoSysConDaemon Enter"); +// ICO_TRA("CicoSysConDaemon::CicoSysConDaemon Leave"); } +//-------------------------------------------------------------------------- /** - * Destructor + * @brief callback function on create + * + * @param [in] user_data The user data passed from the callback + * registration function + * + * @return true on success, false on error */ +//-------------------------------------------------------------------------- CicoSysConDaemon::~CicoSysConDaemon() { -// ICO_DBG("CicoSysConDaemon::~CicoSysConDaemon Enter"); -// ICO_DBG("CicoSysConDaemon::~CicoSysConDaemon Leave"); +// ICO_TRA("CicoSysConDaemon::~CicoSysConDaemon Enter"); +// ICO_TRA("CicoSysConDaemon::~CicoSysConDaemon Leave"); } +//-------------------------------------------------------------------------- +/** + * @brief callback function on terminate + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- bool CicoSysConDaemon::onCreate(void *user_data) { - ICO_DBG("CicoSysConDaemon::onCreate Enter"); + ICO_TRA("CicoSysConDaemon::onCreate Enter"); try { int ret = ICO_SYC_EOK; - CicoSCSystemConfig::getInstance()->load("/usr/apps/org.tizen.ico.system-controller/res/config/system.xml"); + CicoSystemConfig::getInstance()->load("/usr/apps/org.tizen.ico.system-controller/res/config/system.xml"); initAulListenXSignal(); + CicoSCVInfoManager::getInstance()->startup(); + CicoSCLifeCycleController *lifecycle = CicoSCLifeCycleController::getInstance(); - CicoSCWindowController *winctrl = new CicoSCWindowController(); - CicoSCInputController *inputctrl = new CicoSCInputController(); + m_winctrl = new CicoSCWindowController(); + m_inputctrl = new CicoSCInputController(); - CicoSCResourceManager *resourcemgr = new CicoSCResourceManager(); - resourcemgr->setWindowController(winctrl); - resourcemgr->setInputController(inputctrl); - ret = resourcemgr->initialize(); + m_resourcemgr = new CicoSCResourceManager(); + m_resourcemgr->setWindowController(m_winctrl); + m_resourcemgr->setInputController(m_inputctrl); + ret = m_resourcemgr->initialize(); if (ICO_SYC_EOK != ret) { return false; } - winctrl->setResourceManager(resourcemgr); + m_winctrl->setResourceManager(m_resourcemgr); CicoSCUserManager *usermgr = CicoSCUserManager::getInstance(); usermgr->load("/usr/apps/org.tizen.ico.system-controller/res/config/user.xml"); CicoSCServer *server = CicoSCServer::getInstance(); - server->setWindowCtrl(winctrl); - server->setInputCtrl(inputctrl); + server->setWindowCtrl(m_winctrl); + server->setInputCtrl(m_inputctrl); server->setUserMgr(usermgr); - server->setResourceMgr(resourcemgr); - server->setPolicyMgr(resourcemgr->getPolicyManager()); + server->setResourceMgr(m_resourcemgr); + server->setPolicyMgr(m_resourcemgr->getPolicyManager()); server->startup(18081, (const char*)"ico_syc_protocol"); - ret = CicoSCWayland::getInstance()->intialize(); + ret = CicoSCWayland::getInstance()->initialize(); if (ICO_SYC_EOK != ret) { return false; } CicoSCWayland::getInstance()->addEcoreMainWlFdHandler(); - + usermgr->initialize(); + if (true == lifecycle->isAppResource()) { + const CicoSCUser* user = usermgr->getLoginUser(); + if (NULL != user) { + if (false == lifecycle->startAppResource(user->name)) { + lifecycle->createAppResourceFile(user->name); + } + } + } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; @@ -113,34 +143,75 @@ CicoSysConDaemon::onCreate(void *user_data) return false; } - ICO_DBG("CicoSysConDaemon::onCreate Leave(true)"); + ICO_TRA("CicoSysConDaemon::onCreate Leave(true)"); + ICO_PRF("SYS_STARTED Initialization is complete"); return true; } -#if 0 +//-------------------------------------------------------------------------- +/** + * @brief callback function on terminate + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- void CicoSysConDaemon::onTerminate(void *user_data) { - _DBG("CicoSysConDaemon::onTerminate entry"); + ICO_TRA("CicoSysConDaemon::onTerminate Enter"); + CicoSCUserManager *usermgr = CicoSCUserManager::getInstance(); + usermgr->cloaseUser(); + stop(); + CicoSCServer::getInstance()->teardown(); + CicoSCVInfoManager::getInstance()->teardown(); + ICO_TRA("CicoSysConDaemon::onTerminate Leave"); } +//-------------------------------------------------------------------------- +/** + * @brief callback function on pause + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- void CicoSysConDaemon::onPause(void *user_data) { - _DBG("CicoSysConDaemon::onPause entry"); + ICO_TRA("CicoSysConDaemon::onPause Enter"); + ICO_TRA("CicoSysConDaemon::onPause Leave"); } +//-------------------------------------------------------------------------- +/** + * @brief callback function on resume + * + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- void CicoSysConDaemon::onResume(void *user_data) { - _DBG("CicoSysConDaemon::onResume entry"); + ICO_TRA("CicoSysConDaemon::onResume Enter"); + ICO_TRA("CicoSysConDaemon::onResume Leave"); } +//-------------------------------------------------------------------------- +/** + * @brief callback function on service + * + * @param [in] service The handle to the service + * @param [in] user_data The user data passed from the callback + * registration function + */ +//-------------------------------------------------------------------------- void CicoSysConDaemon::onService(service_h service, void *user_data) { - _DBG("CicoSysConDaemon::onService entry"); + ICO_TRA("CicoSysConDaemon::onService Enter"); + ICO_TRA("CicoSysConDaemon::onService Leave"); } -#endif -/* vim: set expandtab ts=4 sw=4: */ +// vim: set expandtab ts=4 sw=4: diff --git a/src/syscond/CicoSysConDaemon.h b/src/syscond/CicoSysConDaemon.h index d21e892..43407ec 100644 --- a/src/syscond/CicoSysConDaemon.h +++ b/src/syscond/CicoSysConDaemon.h @@ -7,63 +7,70 @@ * */ -/*========================================================================*/ +//========================================================================== /** * @file CicoSysConDaemon.h * - * @brief + * @brief This file is definition of CicoSysConDaemon class */ -/*========================================================================*/ +//========================================================================== +#ifndef __CICO_SYS_CON_DAEMON_H__ +#define __CICO_SYS_CON_DAEMON_H__ -//#include #include #include "CicoEFLApp.h" -#ifndef __CICO_UI_SAMPLE_APP_H__ -#define __CICO_UI_SAMPLE_APP_H__ - -#ifdef __cplusplus -extern "C" { -#endif +//========================================================================== +// Forward declaration +//========================================================================== +class CicoSCWindowController; +class CicoSCInputController; +class CicoSCResourceManager; +//========================================================================== +/** + * @brief ELF Application functions for SystemController + */ +//========================================================================== class CicoSysConDaemon : public CicoEFLApp { public: - /** - * Default Constructor - */ + // default constructor CicoSysConDaemon(); - - /** - * Destructor - */ + + // destructor virtual ~CicoSysConDaemon(); - /** - * - */ + // callback function on create virtual bool onCreate(void *user_data); -#if 0 - void onTerminate(void *user_data); - void onPause(void *user_data); - void onResume(void *user_data); - void onService(service_h service, void *user_data); -#endif + + // callback function on terminate + virtual void onTerminate(void *user_data); + + // callback function on pause + virtual void onPause(void *user_data); + + // callback function on resume + virtual void onResume(void *user_data); + + // callback function on service + virtual void onService(service_h service, void *user_data); protected: - /** - * Assignment Operator - */ + // assignment operator CicoSysConDaemon& operator=(const CicoSysConDaemon &object); - /** - * Copy Constructor - */ + // copy constructor CicoSysConDaemon(const CicoSysConDaemon &object); -}; -#ifdef __cplusplus -} -#endif +private: + // CicoSCWindowController instance + CicoSCWindowController* m_winctrl; -#endif /* __CICO_UI_SAMPLE_APP_H__ */ -/* vim:set expandtab ts=4 sw=4: */ + // CicoSCInputController instance + CicoSCInputController* m_inputctrl; + + // CicoSCResourceManager instance + CicoSCResourceManager* m_resourcemgr; +}; +#endif // __CICO_SYS_CON_DAEMON_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/src/syscond/CicoSysConLogConfig.cpp b/src/syscond/CicoSysConLogConfig.cpp new file mode 100644 index 0000000..578c254 --- /dev/null +++ b/src/syscond/CicoSysConLogConfig.cpp @@ -0,0 +1,280 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +/*========================================================================*/ +/** + * @file CicoSysConLogConfig.cpp + * + * @brief This file implementation of CicoSysConLogConfig class + */ +/*========================================================================*/ + +#include +#include +#include +#include + +using namespace boost; +using namespace boost::property_tree; + +#include "CicoSysConLogConfig.h" + +//========================================================================== +// private static variable +//========================================================================== +CicoSysConLogConfig* CicoSysConLogConfig::ms_myInstance = NULL; + +//-------------------------------------------------------------------------- +/** + * @brief default constructor + */ +//-------------------------------------------------------------------------- +CicoSysConLogConfig::CicoSysConLogConfig() + : m_confFile(""), m_name("IcoSysConDaemon"), + m_levelPRF(false), m_levelTRA(false), m_levelDBG(false), + m_levelINF(false), m_levelWRN(false), m_levelCRI(false), + m_levelERR(false), m_flush(false), m_ecore(false) +{ +} + +//-------------------------------------------------------------------------- +/** + * @brief destructor + */ +//-------------------------------------------------------------------------- +CicoSysConLogConfig::~CicoSysConLogConfig() +{ +} + +//-------------------------------------------------------------------------- +/** + * @brief Get instance of CicoSysConLogConfig + * + * @return pointer of CicoSysConLogConfig object + */ +//-------------------------------------------------------------------------- +CicoSysConLogConfig* +CicoSysConLogConfig::getInstance(void) +{ + if (NULL == ms_myInstance) { + ms_myInstance = new CicoSysConLogConfig(); + } + return ms_myInstance; +} + +//-------------------------------------------------------------------------- +/** + * @brief Get instance of CicoSysConLogConfig + * + * @param [in] confFile config file name + * @return 0 on success, other on error + */ +//-------------------------------------------------------------------------- +int +CicoSysConLogConfig::load(const std::string & confFile) +{ + // load xml config file + ptree root; + read_xml(confFile, root); + + // + if (root.not_found() != root.find("system-controller.log")) { + printf("log element not found"); + return -1; + } + + ptree log = root.get_child("system-controller.log"); + + ptree child; + optional sValue; + optional bValue; + + // read + sValue = log.get_optional("name"); + if (true == sValue.is_initialized()) { + m_name = sValue.get(); + } + + // read + child = log.get_child("level.performance"); + bValue = child.get_optional(".enable"); + if (true == bValue.is_initialized()) { + m_levelPRF = bValue.get(); + } + + // read + child = log.get_child("level.trace"); + bValue = child.get_optional(".enable"); + if (true == bValue.is_initialized()) { + m_levelTRA = bValue.get(); + } + + // read + child = log.get_child("level.debug"); + bValue = child.get_optional(".enable"); + if (true == bValue.is_initialized()) { + m_levelDBG = bValue.get(); + } + + // read + child = log.get_child("level.info"); + bValue = child.get_optional(".enable"); + if (true == bValue.is_initialized()) { + m_levelINF = bValue.get(); + } + + // read + child = log.get_child("level.warning"); + bValue = child.get_optional(".enable"); + if (true == bValue.is_initialized()) { + m_levelWRN = bValue.get(); + } + + // read + child = log.get_child("level.critical"); + bValue = child.get_optional(".enable"); + if (true == bValue.is_initialized()) { + m_levelCRI = bValue.get(); + } + + // read + child = log.get_child("level.error"); + bValue = child.get_optional(".enable"); + if (true == bValue.is_initialized()) { + m_levelERR = bValue.get(); + } + + // read + child = log.get_child("flush"); + bValue = child.get_optional(".enable"); + if (true == bValue.is_initialized()) { + m_flush = bValue.get(); + } + + // read + child = log.get_child("ecore"); + bValue = child.get_optional(".enable"); + if (true == bValue.is_initialized()) { + m_ecore = bValue.get(); + } + + return 0; +} + + +//-------------------------------------------------------------------------- +/** + * @brief get log name + */ +//-------------------------------------------------------------------------- +std::string & +CicoSysConLogConfig::getLogName(void) +{ + return m_name; +} + +//-------------------------------------------------------------------------- +/** + * @brief get performance level enable state + */ +//-------------------------------------------------------------------------- +bool +CicoSysConLogConfig::isPRF(void) +{ + return m_levelPRF; +} + +//-------------------------------------------------------------------------- +/** + * @brief get trace level enable state + */ +//-------------------------------------------------------------------------- +bool +CicoSysConLogConfig::isTRA(void) +{ + return m_levelTRA; +} + +//-------------------------------------------------------------------------- +/** + * @brief get debug level enable state + */ +//-------------------------------------------------------------------------- +bool +CicoSysConLogConfig::isDBG(void) +{ + return m_levelDBG; +} + +//-------------------------------------------------------------------------- +/** + * @brief get info level enable state + */ +//-------------------------------------------------------------------------- +bool +CicoSysConLogConfig::isINF(void) +{ + return m_levelINF; +} + +//-------------------------------------------------------------------------- +/** + * @brief get warning level enable state + */ +//-------------------------------------------------------------------------- +bool +CicoSysConLogConfig::isWRN(void) +{ + return m_levelWRN; +} + +//-------------------------------------------------------------------------- +/** + * @brief get critical level enable state + */ +//-------------------------------------------------------------------------- +bool +CicoSysConLogConfig::isCRI(void) +{ + return m_levelCRI; +} + +//-------------------------------------------------------------------------- +/** + * @brief get error level enable state + */ +//-------------------------------------------------------------------------- +bool +CicoSysConLogConfig::isERR(void) +{ + return m_levelERR; +} + +//-------------------------------------------------------------------------- +/** + * @brief get flush log enable state + */ +//-------------------------------------------------------------------------- +bool +CicoSysConLogConfig::isFlush(void) +{ + return m_flush; +} + +//-------------------------------------------------------------------------- +/** + * @brief get ecore log print enalbe state + */ +//-------------------------------------------------------------------------- +bool +CicoSysConLogConfig::isEcore(void) +{ + return m_ecore; +} +// vim:set expandtab ts=4 sw=4: diff --git a/src/syscond/CicoSysConLogConfig.h b/src/syscond/CicoSysConLogConfig.h new file mode 100644 index 0000000..b54c3c4 --- /dev/null +++ b/src/syscond/CicoSysConLogConfig.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2013, TOYOTA MOTOR CORPORATION. + * + * This program is licensed under the terms and conditions of the + * Apache License, version 2.0. The full text of the Apache License is at + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +//========================================================================== +/** + * @file CicoLogConfig.h + * + * @brief This file is definition of CicoSysConLogConfig class + */ +//========================================================================== +#ifndef __CICO_SYS_CON_LOG_CONFIG_H__ +#define __CICO_SYS_CON_LOG_CONFIG_H__ + +#include + +//========================================================================== +/** + * @brief This class has function of access to my appliction log + * configuration information + */ +//========================================================================== +class CicoSysConLogConfig +{ +public: + // get my install + static CicoSysConLogConfig* getInstance(void); + + // load configuration file + int load(const std::string & confFile); + + // get log name + std::string & getLogName(void); + + // get performance level enable state + bool isPRF(void); + + // get trace level enable state + bool isTRA(void); + + // get debug level enable state + bool isDBG(void); + + // get info level enable state + bool isINF(void); + + // get warning level enable state + bool isWRN(void); + + // get critical level enable state + bool isCRI(void); + + // get error level enable state + bool isERR(void); + + // get flush log enable state + bool isFlush(void); + + // get ecore log print enalbe state + bool isEcore(void); + +private: + // default constructor + CicoSysConLogConfig(); + + // destructor + ~CicoSysConLogConfig(); + + // assignment operator + CicoSysConLogConfig& operator=(const CicoSysConLogConfig &object); + + // copy constructor + CicoSysConLogConfig(const CicoSysConLogConfig &object); + +private: + // this class instance + static CicoSysConLogConfig* ms_myInstance; + + // log file path + std::string m_confFile; + + // log name + std::string m_name; + + // performance log enable + bool m_levelPRF; + + // trace log enable + bool m_levelTRA; + + // debug log enable + bool m_levelDBG; + + // info log enable + bool m_levelINF; + + // warning log enable + bool m_levelWRN; + + // critical log enable + bool m_levelCRI; + + // error log enable + bool m_levelERR; + + // flush enable + bool m_flush; + + // ecore log print eneble + bool m_ecore; +}; +#endif // __CICO_SYSysConON_LOG_CONFIG_H__ +// vim:set expandtab ts=4 sw=4: diff --git a/src/syscond/Makefile.am b/src/syscond/Makefile.am index bf32ac9..1364aef 100644 --- a/src/syscond/Makefile.am +++ b/src/syscond/Makefile.am @@ -7,7 +7,7 @@ check_PROGRAMS = \ IcoSysconDaemon IcoSysconDaemon_SOURCES = \ - CicoEFLApp.cpp \ + CicoSysConLogConfig.cpp \ CicoSysConDaemon.cpp \ main.cpp @@ -30,11 +30,12 @@ IcoSysconDaemon_CPPFLAGS = \ $(UWS_CFLAGS) \ $(WESTONPLUGIN_CFLAGS) \ -I../../include \ - -I../../lib/system-controller - + -I../../lib/system-controller \ + -I../../lib/common IcoSysconDaemon_LDADD = \ ../../lib/system-controller/.libs/libico-system-controller.a \ + ../../lib/common/.libs/libico-common.a \ ../../lib/misc/state-machine/.libs/libico-state-machine.a \ @ECORE_LIBS@ \ @EINA_LIBS@ \ @@ -52,10 +53,7 @@ IcoSysconDaemon_LDADD = \ @MURPHYRESOURCE_LIBS@ \ @EDBUS_LIBS@ \ $(UWS_LIBS) \ - $(WESTONPLUGIN_LIBS) \ - ../../lib/misc/state-machine/.libs/libico-state-machine.so - -# -lmurphy-resolver + $(WESTONPLUGIN_LIBS) CLEANFILES = $(BUILT_SOURCES) diff --git a/src/syscond/main.cpp b/src/syscond/main.cpp index b00308a..e719149 100644 --- a/src/syscond/main.cpp +++ b/src/syscond/main.cpp @@ -7,52 +7,143 @@ * */ -/*========================================================================*/ +//========================================================================== /** * @file main.cpp * - * @brief + * @brief This file is implimantion of system-controller + * application main function */ -/*========================================================================*/ +//========================================================================== +#include +#include +#include #include #include #include #include "CicoEFLApp.h" +#include "CicoSysConLogConfig.h" #include "CicoSysConDaemon.h" #include "CicoLog.h" #include +//-------------------------------------------------------------------------- +/** + * @brief get log level + * + * @praram [in] logConf CicoSysConLogConfig instance + */ +//-------------------------------------------------------------------------- +int +getLogLevel(CicoSysConLogConfig* logConf) +{ + int level = 0; + if (true == logConf->isPRF()) { + level |= ICO_LOG_LVL_PRF; + } + if (true == logConf->isTRA()) { + level |= ICO_LOG_LVL_TRA; + } + if (true == logConf->isDBG()) { + level |= ICO_LOG_LVL_DBG; + } + if (true == logConf->isINF()) { + level |= ICO_LOG_LVL_INF; + } + if (true == logConf->isWRN()) { + level |= ICO_LOG_LVL_WRN; + } + if (true == logConf->isCRI()) { + level |= ICO_LOG_LVL_CRI; + } + if (true == logConf->isERR()) { + level |= ICO_LOG_LVL_ERR; + } + if (true == logConf->isFlush()) { + level |= ICO_LOG_FLUSH; + } + else { + level |= ICO_LOG_NOFLUSH; + } + + return level; +} + +//-------------------------------------------------------------------------- +/** + * @brief system-controller main + * + * @param [in] argc counts of argment + * @param [in] argv argment + * @return result + * @retval 0 success + * @retval -1 error + */ +//-------------------------------------------------------------------------- int main(int argc, char **argv) { - eina_init(); - eina_log_level_set(EINA_LOG_LEVEL_DBG); + int i; + + // check '--user' option + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "--user") == 0) { + i ++; + if (i < argc) { + if (strcmp(argv[i], cuserid(NULL)) != 0) { + printf("=== start IcoSysConDaemon main entry(user=%s)\n", argv[i]); + printf("=== abort IcoSysConDaemon main exit(cannot run in a '%s')\n", + cuserid(NULL)); + return 0; + } + } + } + } try { - printf("=== start IcoSysConDaemon\n"); - ico_log_open("IcoSysConDaemon"/*TOOD*/); + printf("=== start IcoSysConDaemon main entry(uid=%d)\n", getuid()); + + CicoSysConLogConfig* logConf = CicoSysConLogConfig::getInstance(); + logConf->load("/usr/apps/org.tizen.ico.system-controller/res/config/system-controller.xml"); + + // setup ecore log print + if (logConf->isEcore()) { + eina_init(); + eina_log_level_set(EINA_LOG_LEVEL_DBG); + } + + // setup ico_log print + ico_log_open(logConf->getLogName().c_str()); + ico_log_set_level(getLogLevel(logConf)); + ICO_INF("START_MODULE SystemController"); int ret = 0; CicoSysConDaemon daemon; ret = daemon.start(argc, argv); - ICO_DBG("ret = %d error=%s\n", ret, daemon.app_error_to_string(ret)); + ICO_DBG("ret = %d error=%s", ret, daemon.appfwErrorToString(ret)); + + daemon.stop(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; ICO_ERR("main: catch exception [%s]", e.what()); + return -1; } catch (const std::string& str) { std::cerr << str << std::endl; ICO_ERR("main: catch exception [%s]", str.c_str()); + return -1; } catch (...) { ICO_ERR("main: catch exception unknown"); + return -1; } + ICO_INF("END_MODULE SystemController"); return 0; } -/* vim: set expandtab ts=4 sw=4: */ +// vim: set expandtab ts=4 sw=4: diff --git a/tool/rm_autogen-file.sh b/tool/rm_autogen-file.sh index 85b8910..e1214f6 100755 --- a/tool/rm_autogen-file.sh +++ b/tool/rm_autogen-file.sh @@ -22,6 +22,9 @@ missing \ stamp-h1 \ ./lib/Makefile \ ./lib/Makefile.in \ +./lib/common/.deps \ +./lib/common/Makefile \ +./lib/common/Makefile.in \ ./lib/system-controller/.deps \ ./lib/system-controller/Makefile \ ./lib/system-controller/Makefile.in \ @@ -42,6 +45,9 @@ stamp-h1 \ ./src/homescreen/.deps \ ./src/homescreen/Makefile \ ./src/homescreen/Makefile.in \ +./src/statusbar/.deps \ +./src/statusbar/Makefile \ +./src/statusbar/Makefile.in \ ./src/syscond/.deps \ ./src/syscond/Makefile \ ./src/syscond/Makefile.in \ -- 2.7.4