diff options
author | jinwoo.shin <jw0227.shin@samsung.com> | 2015-10-07 16:05:54 +0900 |
---|---|---|
committer | jinwoo.shin <jw0227.shin@samsung.com> | 2015-10-07 16:05:54 +0900 |
commit | 49abb267df73757346e238deb4165d0591a8fe2d (patch) | |
tree | eacdcc326097e7ee1dc12e068dea688af79ad279 | |
parent | 8acd793514c8a4f3c1c515a400133d8fde4a73f8 (diff) | |
download | air_livetv-49abb267df73757346e238deb4165d0591a8fe2d.tar.gz air_livetv-49abb267df73757346e238deb4165d0591a8fe2d.tar.bz2 air_livetv-49abb267df73757346e238deb4165d0591a8fe2d.zip |
Launch Home app. when press Super_Lsubmit/tizen/20151007.073635accepted/tizen/tv/20151007.081620
Change-Id: I0acaafb8ac1957d53efb3dfac975cfca332e1deb
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
-rw-r--r-- | include/util.h | 1 | ||||
-rw-r--r-- | src/main.c | 6 | ||||
-rw-r--r-- | src/util.c | 38 |
3 files changed, 45 insertions, 0 deletions
diff --git a/include/util.h b/include/util.h index 805aec0..66ed9c0 100644 --- a/include/util.h +++ b/include/util.h @@ -30,5 +30,6 @@ Evas_Object *util_add_button(Evas_Object *parent, const char *part, Evas_Object *util_add_toast(Evas_Object *parent, char *text); void util_draw_channel_info(Evas_Object *obj, const struct tv_channel_info *channel_info); +void util_launch_home(void); #endif @@ -122,6 +122,12 @@ static Eina_Bool _event(void *data, Evas_Object *obj, Evas_Object *src, } } + if (type == EVAS_CALLBACK_KEY_DOWN && + !strcmp(keyname, KEY_SUPER_L)) { + util_launch_home(); + return EINA_TRUE; + } + return EINA_FALSE; } @@ -14,8 +14,10 @@ * limitations under the License. */ +#include <app.h> #include <Elementary.h> #include <app_debug.h> +#include <app_define.h> #include <viewmgr.h> #include "define.h" @@ -364,3 +366,39 @@ void util_draw_channel_info(Evas_Object *obj, UPDATE_TYPE_TIMER, &op); } } + +void util_launch_home(void) +{ + app_control_h app_ctrl; + int r; + + r = app_control_create(&app_ctrl); + if (r != APP_CONTROL_ERROR_NONE) { + _ERR("failed to create app control handle"); + return; + } + + r = app_control_set_operation(app_ctrl, APP_CONTROL_OPERATION_DEFAULT); + if (r != APP_CONTROL_ERROR_NONE) { + _ERR("failed to set app control operation"); + app_control_destroy(app_ctrl); + return; + } + + r = app_control_set_app_id(app_ctrl, APP_ID_HOME); + if (r != APP_CONTROL_ERROR_NONE) { + _ERR("failed to set app control app id"); + app_control_destroy(app_ctrl); + return; + } + + r = app_control_send_launch_request(app_ctrl, NULL, NULL); + if (r != APP_CONTROL_ERROR_NONE) { + _ERR("failed to send app control launch request"); + app_control_destroy(app_ctrl); + return; + } + + app_control_destroy(app_ctrl); +} + |