+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* inner to white bg: */
-#define BUTTON_BG_HEIGHT 0.10
-#define ICONS_AREA_HEIGHT 0.18
-#define FAVORITES_AREA_HEIGHT 0.62
-#define STRIPE_WIDTH 0.95
-#define STRIPE_X1 ((1.0 - STRIPE_WIDTH) / 2.0)
-#define STRIPE_X2 (STRIPE_X1 + STRIPE_WIDTH)
-
-/* inner to deeper parts: */
-#define BUTTON_WIDTH 0.89
-#define BUTTON_HEIGHT 0.54
-#define BUTTON_X1 ((1.0 - BUTTON_WIDTH) / 2.0)
-#define BUTTON_X2 (BUTTON_X1 + BUTTON_WIDTH)
-#define BUTTON_Y1 ((1.0 - BUTTON_HEIGHT) / 2.0)
-#define BUTTON_Y2 (BUTTON_Y1 + BUTTON_HEIGHT)
-
-group
-{
- name: GRP_VIEW_ACTION_MENU;
- parts
- {
- part
- {
- type: RECT;
- scale: 1;
- repeat_events: 0;
- description
- {
- state: "default" 0.0;
- color: 0 0 0 0;
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 1.0;
- }
- }
- part
- {
- name: "black bg";
- type: RECT;
- scale: 1;
- description
- {
- state: "default" 0.0;
- color: 0 0 0 255;
- rel1.relative: 0.75 0.0;
- rel2.relative: 1.0 1.0;
- }
- part
- {
- name: "white bg";
- type: RECT;
- scale: 1;
- description
- {
- state: "default" 0.0;
- color: 255 255 255 255;
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 1.0;
- rel1.offset: 2 2;
- rel2.offset: -2 -2;
- }
-
- part
- {
- name: "live TV button bg";
- type: RECT;
- scale: 1;
- description
- {
- state: "default" 0.0;
- color: 255 255 255 255;
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 BUTTON_BG_HEIGHT;
- }
- part
- {
- name: PART_LIVE_TV_BTN;
- type: SWALLOW;
- scale: 1;
- description
- {
- state: "default" 0.0;
- rel1.relative: BUTTON_X1 BUTTON_Y1;
- rel2.relative: BUTTON_X2 BUTTON_Y2;
- }
- }
- }
-
- part
- {
- name: "icons area";
- type: RECT;
- scale: 1;
- description
- {
- state: "default" 0.0;
- color: 255 255 255 255;
- rel1.relative: 0.02 BUTTON_BG_HEIGHT;
- rel2.relative: 0.98 (BUTTON_BG_HEIGHT + ICONS_AREA_HEIGHT);
- }
-
- part
- {
- name: PART_ACT_MENU_ICO_BTN0;
- type: SWALLOW;
- scale: 1;
- description
- {
- state: "default" 0.0;
- rel1.relative: 0.0 0.0;
- rel2.relative: 0.25 1.0;
- align: 0.5 0.5;
- max: 116 116;
- }
- }
- part
- {
- name: PART_ACT_MENU_ICO_BTN1;
- type: SWALLOW;
- scale: 1;
- description
- {
- state: "default" 0.0;
- rel1.relative: 0.25 0.0;
- rel2.relative: 0.5 1.0;
- align: 0.5 0.5;
- max: 116 116;
- }
- }
- part
- {
- name: PART_ACT_MENU_ICO_BTN2;
- type: SWALLOW;
- scale: 1;
- description
- {
- state: "default" 0.0;
- rel1.relative: 0.5 0.0;
- rel2.relative: 0.75 1.0;
- align: 0.5 0.5;
- max: 116 116;
- }
- }
- part
- {
- name: PART_ACT_MENU_ICO_BTN3;
- type: SWALLOW;
- scale: 1;
- description
- {
- state: "default" 0.0;
- rel1.relative: 0.75 0.0;
- rel2.relative: 1.0 1.0;
- align: 0.5 0.5;
- max: 116 116;
- }
- }
- }
-
- part
- {
- name: "favorites area";
- type: SWALLOW;
- scale: 1;
- description
- {
- state: "default" 0.0;
- rel1.relative: 0.0 (BUTTON_BG_HEIGHT + ICONS_AREA_HEIGHT);
- rel2.relative: 1.0 (BUTTON_BG_HEIGHT + ICONS_AREA_HEIGHT + FAVORITES_AREA_HEIGHT);
- }
- }
-
- part
- {
- name: "More favorite button bg";
- type: RECT;
- scale: 1;
- description
- {
- state: "default" 0.0;
- color: 255 255 255 255;
- rel1.relative: 0.0 (BUTTON_BG_HEIGHT + ICONS_AREA_HEIGHT + FAVORITES_AREA_HEIGHT);
- rel2.relative: 1.0 1.0;
- }
- part
- {
- name: PART_MORE_FAV_BTN;
- type: SWALLOW;
- scale: 1;
- description
- {
- state: "default" 0.0;
- rel1.relative: BUTTON_X1 BUTTON_Y1;
- rel2.relative: BUTTON_X2 BUTTON_Y2;
- }
- }
- }
-
- part
- {
- name: "stripe under live button area";
- type: RECT;
- scale: 1;
- description
- {
- state: "default" 0.0;
- color: 194 194 194 255;
- rel1.relative: STRIPE_X1 BUTTON_BG_HEIGHT;
- rel2.relative: STRIPE_X2 BUTTON_BG_HEIGHT;
- rel1.offset: 0 -1;
- rel2.offset: 0 1;
- }
- }
-
- part
- {
- name: "stripe under icons area";
- type: RECT;
- scale: 1;
- description
- {
- state: "default" 0.0;
- color: 194 194 194 255;
- rel1.relative: STRIPE_X1 (BUTTON_BG_HEIGHT + ICONS_AREA_HEIGHT);
- rel2.relative: STRIPE_X2 (BUTTON_BG_HEIGHT + ICONS_AREA_HEIGHT);
- rel1.offset: 0 -1;
- rel2.offset: 0 1;
- }
- }
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "view/view_action_menu.h"
-#include <app_i18n.h>
-#include <eina_hash.h>
-
-#include "app_debug.h"
-#include "common/favoritemgr.h"
-#include "common/inputmgr.h"
-#include "common/layoutmgr.h"
-#include "common/utils.h"
-#include "define.h"
-
-enum {
- LIVE_TV_BUTTON_ID,
- MORE_FAV_BUTTON_ID,
- REORDER_BUTTON_ID,
- ADD_TO_FAV_BUTTON_ID,
- REM_FROM_FAV_BUTTON_ID,
- TUT_BUTTON_ID
-};
-
-enum {
- PICT_MODE_TUT_IX = 0,
- PICT_CONTR_TUT_IX,
- PICT_BRIGHT_TUT_IX,
- PICT_COLOR_TUT_IX,
- PICT_TINT_TUT_IX,
- PICT_SCR_ADJ_TUT_IX,
- CLOCK_TUT_IX,
- SLEEP_TIM_TUT_IX,
- WAKE_UP_TUT_IX,
- CHANGE_PIN_TUT_IX,
- CHANGE_LANG_TUT_IX,
- SUBTITLE_TUT_IX,
- CHANGE_LOC_TUT_IX,
- RESET_TUT_IX,
- SOUND_TUT_IX,
- CHAN_TUT_IX,
- NET_TUT_IX
-};
-
-#define ACT_MENU_ICO_BTN_STYLE "style.action.menu.icon.button"
-#define ACT_MENU_FAV_ICO_BTN_STYLE "style.action.menu.fav.icon.button"
-#define LIVE_TV_BTN_TXT "Live TV"
-#define MORE_FAVS_BTN_TXT "More Favorite"
-#define REORDER_TXT "Reorder"
-#define FAVORITE_TXT "Favorite"
-#define TUTORIAL_TXT "Tutorial"
-
-
-struct _priv {
- Evas_Object *action_menu_layout;
- Evas_Object *live_tv_btn;
- Evas_Object *more_fav_btn;
- Evas_Object *reorder_btn;
- Evas_Object *fav_btn;
- Evas_Object *tut_btn;
- Evas_Object *tut_popup;
- const char *caller_layout_id;
- const char *caller_layout_subitem_id;
- int caller_layout_subitem_menu_id;
- layoutmgr *lmgr;
- Eina_Hash *view_tut_assoc;
-};
-
-/* Class functions: */
-static Evas_Object *_create(Evas_Object *win, void *data);
-static Eina_Bool _fill_view_tut_assoc(Eina_Hash *hash);
-static void _show(void *data);
-static void _hide(void *data);
-static void _destroy(void *data);
-static void _update(void *view_data, int update_type, void *data);
-
-static void _mouse_cb(int id, void *data, Evas_Object *obj);
-static void _keypad_cb(int id, void *data, Evas *e,
- Evas_Object *obj, Evas_Event_Key_Down *ev);
-static void _popup_clicked_cb(int id, void *data, Evas_Object *obj);
-
-static view_class _vclass = {
- .view_id = VIEW_ACTION_MENU,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .destroy = _destroy,
- .update = _update
-};
-
-const char *tuts_txts[] = {
- [PICT_MODE_TUT_IX] = PICT_MODE_TUT,
- [PICT_CONTR_TUT_IX] = PICT_CONTR_TUT,
- [PICT_BRIGHT_TUT_IX] = PICT_BRIGHT_TUT,
- [PICT_COLOR_TUT_IX] = PICT_COLOR_TUT,
- [PICT_TINT_TUT_IX] = PICT_TINT_TUT,
- [PICT_SCR_ADJ_TUT_IX] = PICT_SCR_ADJ_TUT,
- [CLOCK_TUT_IX] = CLOCK_TUT,
- [SLEEP_TIM_TUT_IX] = SLEEP_TIM_TUT,
- [WAKE_UP_TUT_IX] = WAKE_UP_TUT,
- [CHANGE_PIN_TUT_IX] = CHANGE_PIN_TUT,
- [CHANGE_LANG_TUT_IX] = CHANGE_LANG_TUT,
- [SUBTITLE_TUT_IX] = SUBTITLE_TUT,
- [CHANGE_LOC_TUT_IX] = CHANGE_LOC_TUT,
- [RESET_TUT_IX] = RESET_TUT,
- [SOUND_TUT_IX] = SOUND_TUT,
- [CHAN_TUT_IX] = CHAN_TUT,
- [NET_TUT_IX] = NET_TUT
-};
-
-static input_handler _btn_handler = {
- .clicked = _mouse_cb,
- .key_down = _keypad_cb
-};
-
-static input_handler _popup_handler = {
- .clicked = _popup_clicked_cb
-};
-
-view_class *view_action_menu_get_vclass(void)
-{
- return &_vclass;
-}
-
-static Evas_Object *_create(Evas_Object *win, void *data)
-{
- struct _priv *priv = NULL;
- Evas_Object *popup_button = NULL;
-
- if (!win) {
- _ERR("Get window object failed.");
- return NULL;
- }
-
- priv = (struct _priv *)calloc(1, sizeof(struct _priv));
-
- if (!priv) {
- _ERR("Calloc failed.");
- return NULL;
- }
-
- priv->view_tut_assoc = eina_hash_string_superfast_new(NULL);
- if (!priv->view_tut_assoc || !_fill_view_tut_assoc(priv->view_tut_assoc)) {
- free(priv);
- return NULL;
- }
-
- priv->lmgr = (layoutmgr *)data;
- priv->action_menu_layout = utils_add_layout(win, GRP_VIEW_ACTION_MENU, EINA_TRUE);
-
- if (!priv->action_menu_layout) {
- eina_hash_free(priv->view_tut_assoc);
- free(priv);
- return NULL;
- }
-
- priv->live_tv_btn = utils_add_button(priv->action_menu_layout, PART_LIVE_TV_BTN, NULL, LIVE_TV_BTN_TXT);
- priv->more_fav_btn = utils_add_button(priv->action_menu_layout, PART_MORE_FAV_BTN, NULL, MORE_FAVS_BTN_TXT);
-
- priv->reorder_btn = utils_add_button(priv->action_menu_layout, NULL, ACT_MENU_ICO_BTN_STYLE, REORDER_TXT);
- priv->fav_btn = utils_add_button(priv->action_menu_layout, NULL, ACT_MENU_FAV_ICO_BTN_STYLE, NULL);
- priv->tut_btn = utils_add_button(priv->action_menu_layout, NULL, ACT_MENU_ICO_BTN_STYLE, TUTORIAL_TXT);
-
- if (!priv->live_tv_btn || !priv->more_fav_btn ||
- !priv->reorder_btn || !priv->fav_btn || !priv->tut_btn) {
- eina_hash_free(priv->view_tut_assoc);
- evas_object_del(priv->action_menu_layout);
- free(priv);
- return NULL;
- }
- evas_object_hide(priv->reorder_btn);
- evas_object_hide(priv->fav_btn);
- evas_object_hide(priv->tut_btn);
-
- priv->tut_popup = utils_add_popup(priv->action_menu_layout, NULL, STR_TUTORIAL, NULL);
- if (!priv->tut_popup) {
- eina_hash_free(priv->view_tut_assoc);
- evas_object_del(priv->action_menu_layout);
- free(priv);
- return NULL;
- }
-
- popup_button = utils_add_button(priv->tut_popup, "button1", NULL, "OK");
- if (!popup_button) {
- eina_hash_free(priv->view_tut_assoc);
- evas_object_del(priv->action_menu_layout);
- free(priv);
- return NULL;
- }
-
- inputmgr_add_callback(popup_button, 0, &_popup_handler, priv);
- inputmgr_add_callback(priv->live_tv_btn, LIVE_TV_BUTTON_ID, &_btn_handler, priv);
- inputmgr_add_callback(priv->more_fav_btn, MORE_FAV_BUTTON_ID, &_btn_handler, priv);
- inputmgr_add_callback(priv->reorder_btn, REORDER_BUTTON_ID, &_btn_handler, priv);
- inputmgr_add_callback(priv->fav_btn, ADD_TO_FAV_BUTTON_ID, &_btn_handler, priv);
- inputmgr_add_callback(priv->tut_btn, TUT_BUTTON_ID, &_btn_handler, priv);
-
- if (!viewmgr_set_view_data(VIEW_ACTION_MENU, priv)) {
- eina_hash_free(priv->view_tut_assoc);
- evas_object_del(priv->action_menu_layout);
- free(priv);
- return NULL;
- }
-
- return priv->action_menu_layout;
-}
-
-static Eina_Bool _fill_view_tut_assoc(Eina_Hash *hash)
-{
- Eina_Bool res = EINA_TRUE;
-
- res &= eina_hash_add(hash, VIEW_PICTURE_CONTRAST, (void *)tuts_txts[PICT_CONTR_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_PICTURE_BRIGHTNESS, (void *)tuts_txts[PICT_BRIGHT_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_PICTURE_COLOR, (void *)tuts_txts[PICT_COLOR_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_PICTURE_TINT, (void *)tuts_txts[PICT_TINT_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_CLOCK, (void *)tuts_txts[CLOCK_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_SLEEP_TIMER, (void *)tuts_txts[SLEEP_TIM_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_WAKEUP_TIMER, (void *)tuts_txts[WAKE_UP_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_CHANGE_PINCODE, (void *)tuts_txts[CHANGE_PIN_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_LANGUAGE, (void *)tuts_txts[CHANGE_LANG_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_SUBTITLE, (void *)tuts_txts[SUBTITLE_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_LOCATION, (void *)tuts_txts[CHANGE_LOC_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_RESET, (void *)tuts_txts[RESET_TUT_IX]);
- res &= eina_hash_add(hash, LAYOUT_ID_SOUND, (void *)tuts_txts[SOUND_TUT_IX]);
- res &= eina_hash_add(hash, LAYOUT_ID_CHANNEL, (void *)tuts_txts[CHAN_TUT_IX]);
- res &= eina_hash_add(hash, LAYOUT_ID_NETWORK, (void *)tuts_txts[NET_TUT_IX]);
-
- return res;
-}
-
-static void _show(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv) {
- _ERR("Invalid parameter.");
- return;
- }
- evas_object_show(priv->action_menu_layout);
- elm_object_focus_set(priv->live_tv_btn, EINA_TRUE);
- viewmgr_update_view(VIEW_BASE, UPDATE_DISABLE, NULL);
-}
-
-static void _hide(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv) {
- _ERR("Invalid parameter.");
- return;
- }
- priv->caller_layout_id = NULL;
- priv->caller_layout_subitem_id = NULL;
- evas_object_hide(priv->action_menu_layout);
- viewmgr_update_view(VIEW_BASE, UPDATE_ENABLE, NULL);
-}
-
-static void _destroy(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv) {
- _ERR("Invalid parameter.");
- return;
- }
- eina_hash_free(priv->view_tut_assoc);
- evas_object_del(priv->action_menu_layout);
- free(priv);
-}
-
-static void _update(void *view_data, int update_type, void *data)
-{
- action_menu_parameter *amp = NULL;
- struct _priv *vd = (struct _priv *)view_data;
- const char *tutorial_txt = NULL;
-
- if (!data || !vd)
- return;
-
- /* Unset them and hide: */
- elm_layout_content_unset(vd->action_menu_layout, PART_ACT_MENU_ICO_BTN0);
- elm_layout_content_unset(vd->action_menu_layout, PART_ACT_MENU_ICO_BTN1);
- elm_layout_content_unset(vd->action_menu_layout, PART_ACT_MENU_ICO_BTN2);
- elm_layout_content_unset(vd->action_menu_layout, PART_ACT_MENU_ICO_BTN3);
- evas_object_hide(vd->reorder_btn);
- evas_object_hide(vd->fav_btn);
- evas_object_hide(vd->tut_btn);
- evas_object_hide(vd->tut_popup);
-
- amp = (action_menu_parameter *)data;
-
- vd->caller_layout_id = amp->layout_id;
- vd->caller_layout_subitem_id = amp->layout_subitem_id;
- vd->caller_layout_subitem_menu_id = amp->layout_subitem_menu_id;
-
- /*TODO: call fav app and check if this item is added to fav database, then
- * (depending on the rsponse) display fav icon button as active or not */
- if (ACT_MENU_SRC_VIEW_UPDATE == update_type) {
-
- if(!amp->layout_subitem_id) {
- // Temporary only to test signal to change icon
- set_favorite(vd->fav_btn, EINA_TRUE);
-
- if (!strcmp(vd->caller_layout_id, LAYOUT_ID_PICTURE) ||
- !strcmp(vd->caller_layout_id, LAYOUT_ID_SYSTEM) ||
- !strcmp(vd->caller_layout_id, LAYOUT_ID_SUPPORT) ||
- !strcmp(vd->caller_layout_id, LAYOUT_ID_INFO) ||
- !strcmp(vd->caller_layout_id, LAYOUT_ID_VOICE)
- ) {
- elm_layout_content_set(vd->action_menu_layout, PART_ACT_MENU_ICO_BTN0, vd->reorder_btn);
- elm_object_focus_next_object_set(vd->live_tv_btn, vd->reorder_btn, ELM_FOCUS_DOWN);
- elm_object_focus_next_object_set(vd->more_fav_btn, vd->reorder_btn, ELM_FOCUS_UP);
- }
-
- if (!strcmp(vd->caller_layout_id, LAYOUT_ID_SOUND) ||
- !strcmp(vd->caller_layout_id, LAYOUT_ID_CHANNEL) ||
- !strcmp(vd->caller_layout_id, LAYOUT_ID_NETWORK)
- ) {
- elm_layout_content_set(vd->action_menu_layout, PART_ACT_MENU_ICO_BTN0, vd->fav_btn);
- elm_layout_content_set(vd->action_menu_layout, PART_ACT_MENU_ICO_BTN1, vd->reorder_btn);
- elm_layout_content_set(vd->action_menu_layout, PART_ACT_MENU_ICO_BTN2, vd->tut_btn);
- tutorial_txt = eina_hash_find(vd->view_tut_assoc , vd->caller_layout_id);
- elm_object_text_set(vd->tut_popup, _(tutorial_txt));
- elm_object_focus_next_object_set(vd->live_tv_btn, vd->fav_btn, ELM_FOCUS_DOWN);
- elm_object_focus_next_object_set(vd->more_fav_btn, vd->fav_btn, ELM_FOCUS_UP);
- }
- } else {
- if (!strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_CONTRAST) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_BRIGHTNESS) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_COLOR) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_TINT) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_CLOCK) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_SLEEP_TIMER) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_WAKEUP_TIMER) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_CHANGE_PINCODE) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_LANGUAGE) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_SUBTITLE) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_LOCATION) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_RESET) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_NEW_NETWORK)
- ) {
- elm_layout_content_set(vd->action_menu_layout, PART_ACT_MENU_ICO_BTN0, vd->fav_btn);
- elm_layout_content_set(vd->action_menu_layout, PART_ACT_MENU_ICO_BTN1, vd->tut_btn);
- tutorial_txt = eina_hash_find(vd->view_tut_assoc , vd->caller_layout_subitem_id);
- elm_object_text_set(vd->tut_popup, _(tutorial_txt));
- elm_object_focus_next_object_set(vd->live_tv_btn, vd->fav_btn, ELM_FOCUS_DOWN);
- elm_object_focus_next_object_set(vd->more_fav_btn, vd->fav_btn, ELM_FOCUS_UP);
- }
- }
- }
-}
-
-static void _mouse_cb(int id, void *data, Evas_Object *obj)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv) {
- _ERR("Invalid parameter.");
- return;
- }
-
- switch(id) {
- case LIVE_TV_BUTTON_ID:
- /* TODO: contact base view and ... ? */
- break;
- case MORE_FAV_BUTTON_ID:
- /* TODO: contact base view and from there fav app maybe ? */
- break;
- case REORDER_BUTTON_ID:
- viewmgr_update_view(VIEW_BASE, UPDATE_REORDER_MODE_ON, NULL);
- break;
- case ADD_TO_FAV_BUTTON_ID:
- /* TODO: contact fav app maybe and tell to set this as a fav ? */
- layoutmgr_update_layout(priv->lmgr, priv->caller_layout_id,
- UPDATE_ADDED_TO_FAV, (void *)priv->caller_layout_subitem_menu_id);
- viewmgr_update_view(VIEW_BASE, UPDATE_TOAST, VIEW_TOAST_MESSAGE_FAVORITE_ADD);
- break;
- case REM_FROM_FAV_BUTTON_ID:
- /* TODO: contact fav app maybe and tell to remove this from fav DB ? */
- layoutmgr_update_layout(priv->lmgr, priv->caller_layout_id,
- UPDATE_REMOVED_FROM_FAV, (void *)priv->caller_layout_subitem_menu_id);
- viewmgr_update_view(VIEW_BASE, UPDATE_TOAST, VIEW_TOAST_MESSAGE_FAVORITE_REMOVE);
- break;
- case TUT_BUTTON_ID:
- viewmgr_pop_view();
- evas_object_show(priv->tut_popup);
- evas_object_focus_set(elm_layout_content_get(priv->tut_popup, "button1"), EINA_TRUE);
- return;
- default:
- return;
- }
- viewmgr_pop_view();
-}
-
-static void _keypad_cb(int id, void *data, Evas *e,
- Evas_Object *obj, Evas_Event_Key_Down *ev)
-{
- if (!data|| !ev) {
- _ERR("Invalid parameter.");
- return;
- }
-
- if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_BACK_WAY)
- || !strcmp(ev->keyname, KEY_ESC) || !strcmp(ev->keyname, KEY_ESC_WAY)
- )
- viewmgr_pop_view();
-}
-
-static void _popup_clicked_cb(int id, void *data, Evas_Object *obj)
-{
- struct _priv *priv = data;
-
- if (!priv)
- return;
-
- evas_object_hide(priv->tut_popup);
- viewmgr_show_view(VIEW_ACTION_MENU);
-}