diff options
author | jinwoo.shin <jw0227.shin@samsung.com> | 2015-08-20 13:40:04 +0900 |
---|---|---|
committer | jinwoo.shin <jw0227.shin@samsung.com> | 2015-08-20 13:40:04 +0900 |
commit | 51b037c604d70eebc5cd85a71e25b86fdeef0f52 (patch) | |
tree | 9c07b14c212bdf942aa5c65ef5d9288d9450bf18 | |
parent | 5b4769622778385a51156a4a83c440f88afe8b5a (diff) | |
download | air_livetv-51b037c604d70eebc5cd85a71e25b86fdeef0f52.tar.gz air_livetv-51b037c604d70eebc5cd85a71e25b86fdeef0f52.tar.bz2 air_livetv-51b037c604d70eebc5cd85a71e25b86fdeef0f52.zip |
Add channel info on action menu
Change-Id: I9fe3f6095dc98bfda656e43efbac9e9371c72d0c
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
-rw-r--r-- | src/util.c | 24 | ||||
-rw-r--r-- | src/view_action_menu.c | 40 | ||||
-rw-r--r-- | src/view_channelinfo.c | 11 |
3 files changed, 65 insertions, 10 deletions
@@ -245,6 +245,7 @@ static void _load_program_info(Evas_Object *obj, static void _tv_program_cb(Eina_List *prog_list, void *data) { + int op; Evas_Object *obj; struct tv_program_info *prog = NULL; @@ -261,15 +262,18 @@ static void _tv_program_cb(Eina_List *prog_list, void *data) else _ERR("failed to get tv_program_info"); - viewmgr_update_view(VIEW_CHANNELINFO, - UPDATE_TYPE_TIMER, START_HIDE_TIMER); + if (viewmgr_get_view_state(VIEW_CHANNELINFO) == VIEW_STATE_VISIBLE) { + op = START_HIDE_TIMER; + viewmgr_update_view(VIEW_CHANNELINFO, + UPDATE_TYPE_TIMER, &op); + } } void util_draw_channel_info(Evas_Object *obj, const struct tv_channel_info *channel_info) { struct tv_program_request *prog_req; - int r; + int r, op; int current_service; if (!obj || !channel_info) { @@ -282,8 +286,11 @@ void util_draw_channel_info(Evas_Object *obj, if (r < 0) current_service = -1; - viewmgr_update_view(VIEW_CHANNELINFO, - UPDATE_TYPE_TIMER, (void *)STOP_HIDE_TIMER); + if (viewmgr_get_view_state(VIEW_CHANNELINFO) == VIEW_STATE_VISIBLE) { + op = STOP_HIDE_TIMER; + viewmgr_update_view(VIEW_CHANNELINFO, + UPDATE_TYPE_TIMER, &op); + } _load_channel_text(obj, channel_info); _set_icon_box(obj, channel_info); @@ -303,7 +310,10 @@ void util_draw_channel_info(Evas_Object *obj, r = tv_epg_get_program(channel_info->service_id, prog_req); } - if (r < 0) + if (r < 0 && viewmgr_get_view_state(VIEW_CHANNELINFO) == + VIEW_STATE_VISIBLE) { + op = START_HIDE_TIMER; viewmgr_update_view(VIEW_CHANNELINFO, - UPDATE_TYPE_TIMER, START_HIDE_TIMER); + UPDATE_TYPE_TIMER, &op); + } } diff --git a/src/view_action_menu.c b/src/view_action_menu.c index 1f43c6d..a332c91 100644 --- a/src/view_action_menu.c +++ b/src/view_action_menu.c @@ -42,6 +42,7 @@ enum _button_id { struct _priv { Evas_Object *base; + Evas_Object *channel_info; Evas_Object *menu_btn[BUTTON_MAX]; }; @@ -151,6 +152,38 @@ static input_handler button_handler = { .mouse_move = _button_mouse_move_cb }; +static void _update_channel_info(struct _priv *priv) +{ + const struct tv_channel_info *channel_info; + + channel_info = tv_channel_get_info(); + if (!channel_info) { + _ERR("failed to get channel info"); + return; + } + + util_draw_channel_info(priv->channel_info, channel_info); + + tv_channel_del_info(channel_info); +} + +static bool _draw_channel_info(struct _priv *priv) +{ + Evas_Object *layout; + + layout = util_add_layout(priv->base, GRP_CHANNELINFO); + if (!layout) { + _ERR("Add layout failed."); + return false; + } + + elm_object_part_content_set(priv->base, PART_CHANNELINFO, layout); + + priv->channel_info = layout; + + return true; +} + static bool _draw_top_area(struct _priv *priv) { Evas_Object *btn; @@ -257,6 +290,11 @@ static bool _draw_bottom_area(struct _priv *priv) static void _draw_view_content(struct _priv *priv) { + if (!_draw_channel_info(priv)) { + _ERR("Draw channel info failed."); + return; + } + if (!_draw_top_area(priv)) { _ERR("Draw top area failed."); return; @@ -324,6 +362,8 @@ static void _show(void *data) } priv = data; + _update_channel_info(priv); + evas_object_show(priv->base); elm_object_focus_set(priv->menu_btn[0], EINA_TRUE); diff --git a/src/view_channelinfo.c b/src/view_channelinfo.c index e720d43..6a44cbf 100644 --- a/src/view_channelinfo.c +++ b/src/view_channelinfo.c @@ -64,6 +64,7 @@ static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) { struct _priv *priv; + int op; if (!data) { _ERR("failed to get data"); @@ -80,16 +81,20 @@ static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj, !strcmp(ev->keyname, KEY_EXIT)) { viewmgr_hide_view(VIEW_CHANNELINFO); } else { + op = START_HIDE_TIMER; viewmgr_update_view(VIEW_CHANNELINFO, - UPDATE_TYPE_TIMER, START_HIDE_TIMER); + UPDATE_TYPE_TIMER, &op); } } static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev) { + int op; + + op = START_HIDE_TIMER; viewmgr_update_view(VIEW_CHANNELINFO, - UPDATE_TYPE_TIMER, START_HIDE_TIMER); + UPDATE_TYPE_TIMER, &op); } static input_handler key_handler = { @@ -240,7 +245,7 @@ static void _update(void *view_data, int type, void *data) priv = view_data; if (type == UPDATE_TYPE_TIMER) { - switch ((int) data) { + switch (*(int *) data) { case START_HIDE_TIMER: _start_hide_timer(priv); break; |