From c7481296537349a88e2e9abd2750cb876ddcd061 Mon Sep 17 00:00:00 2001
From: Pawel
Date: Thu, 23 Mar 2017 17:23:24 +0100
Subject: [PATCH] Action menu code removed (because of unusage).
Change-Id: Ieb5b1be054634022ac5f73a80ddf7aa1b139834c
Signed-off-by: Pawel
---
CMakeLists.txt | 1 -
include/define.h | 4 -
include/view/view_action_menu.h | 54 -----
res/settings.edc | 1 -
res/view/action_menu.edc | 248 -----------------------
src/layout/layout_picture.c | 24 ---
src/layout/layout_system.c | 32 ---
src/main.c | 1 -
src/view/view_action_menu.c | 430 ----------------------------------------
src/view/view_base.c | 23 ---
10 files changed, 818 deletions(-)
delete mode 100644 include/view/view_action_menu.h
delete mode 100644 res/view/action_menu.edc
delete mode 100644 src/view/view_action_menu.c
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b667118..eccd820 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,7 +108,6 @@ SET(SRCS
src/view/system/view_sleep_timer.c
src/view/system/view_subtitle.c
src/view/system/view_wakeup_timer.c
- src/view/view_action_menu.c
src/view/view_base.c
src/view/view_new_network.c
)
diff --git a/include/define.h b/include/define.h
index 2a523c7..478a2a5 100644
--- a/include/define.h
+++ b/include/define.h
@@ -20,9 +20,6 @@
/* View ID */
#define VIEW_BASE "VIEW_BASE"
-/* View ID - Action menu*/
-#define VIEW_ACTION_MENU "VIEW_ACTION_MENU"
-
/* View ID - Picture */
#define VIEW_PICTURE_CONTRAST "VIEW_PICTURE_CONTRAST"
#define VIEW_PICTURE_BRIGHTNESS "VIEW_PICTURE_BRIGHTNESS"
@@ -52,7 +49,6 @@
/* Group for EDC */
#define GRP_VIEW_BASE "grp.view.base"
-#define GRP_VIEW_ACTION_MENU "grp.view.action.menu"
#define GRP_VIEW_CLOCK "grp.view.clock"
#define GRP_VIEW_PIN "grp.view.pin"
#define GRP_VIEW_LOCATION "grp.view.location"
diff --git a/include/view/view_action_menu.h b/include/view/view_action_menu.h
deleted file mode 100644
index 493d45f..0000000
--- a/include/view/view_action_menu.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef VIEW_ACTION_MENU_H_
-#define VIEW_ACTION_MENU_H_
-
-#include "common/viewmgr.h"
-
-/**
-* @brief Attributes of the action menu view.
-*
-* As action menu layout differs depending on the currently focused object,
-* the parameters in the form of this structure need to be passed to the action menu view
-* each time it is to be updated.
-*/
-typedef struct {
- const char *layout_id; /**< ID of the displayed layout corresponding to
- * the currently focused menu tab, or NULL
- * if the layout's subitem has focus */
- const char *layout_subitem_id; /**< ID of currently focused layout's item, or NULL
- * if the current menu tab has focus */
- int layout_subitem_menu_id; /** < numerical ID of the currently focused layout's
- * item or of the displayed layout corresponding to
- * the currently focused menu tab */
-} action_menu_parameter;
-
-/**
-* @brief Available update types for action menu view.
-*/
-enum {
- ACT_MENU_SRC_VIEW_UPDATE
-};
-
-/**
-* @brief Get the pointer to the view_class object of action menu view.
-*
-* @return The pointer to action menu view_class object.
-*/
-view_class *view_action_menu_get_vclass(void);
-
-#endif /* VIEW_ACTION_MENU_H_ */
diff --git a/res/settings.edc b/res/settings.edc
index 60a44f8..bef6f08 100644
--- a/res/settings.edc
+++ b/res/settings.edc
@@ -48,7 +48,6 @@
collections {
base_scale: APP_BASE_SCALE;
- #include "view/action_menu.edc"
#include "view/base.edc"
#include "view/common/generic_slider_view.edc"
#include "view/common/popup_2btns.edc"
diff --git a/res/view/action_menu.edc b/res/view/action_menu.edc
deleted file mode 100644
index 556f5cc..0000000
--- a/res/view/action_menu.edc
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * 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;
- }
- }
- }
- }
- }
-}
diff --git a/src/layout/layout_picture.c b/src/layout/layout_picture.c
index 90b0fc4..a705427 100644
--- a/src/layout/layout_picture.c
+++ b/src/layout/layout_picture.c
@@ -26,7 +26,6 @@
#include "define.h"
#include "layout.h"
#include "layout/picture.h"
-#include "view/view_action_menu.h"
#define PADDING_X 26
#define PADDING_Y 26
@@ -206,29 +205,6 @@ static void _focused(void *data, int id)
static void _selected_menu(void *data, int id)
{
- action_menu_parameter am_param = {0,};
- am_param.layout_id = LAYOUT_ID_PICTURE;
- am_param.layout_subitem_menu_id = id;
-
- switch (id)
- {
- case MENU_CONTRAST:
- am_param.layout_subitem_id = VIEW_PICTURE_CONTRAST;
- break;
- case MENU_BRIGHTNESS:
- am_param.layout_subitem_id = VIEW_PICTURE_BRIGHTNESS;
- break;
- case MENU_COLOR:
- am_param.layout_subitem_id = VIEW_PICTURE_COLOR;
- break;
- case MENU_TINT:
- am_param.layout_subitem_id = VIEW_PICTURE_TINT;
- break;
- default:
- return;
- }
- viewmgr_update_view(VIEW_ACTION_MENU, ACT_MENU_SRC_VIEW_UPDATE, (void *)&am_param);
- viewmgr_show_view(VIEW_ACTION_MENU);
}
static bool _add_layout_contents(struct _priv *priv, Evas_Object *tab_button)
diff --git a/src/layout/layout_system.c b/src/layout/layout_system.c
index 54d51e0..f1af4bf 100755
--- a/src/layout/layout_system.c
+++ b/src/layout/layout_system.c
@@ -33,7 +33,6 @@
#include "view/system/view_clock.h"
#include "view/system/view_location.h"
#include "view/system/view_reset.h"
-#include "view/view_action_menu.h"
#define PADDING_X 26
#define PADDING_Y 26
@@ -321,37 +320,6 @@ static void _focused(void *data, int id)
static void _selected_menu(void *data, int id)
{
- action_menu_parameter am_param = {0,};
- am_param.layout_id = LAYOUT_ID_SYSTEM;
- am_param.layout_subitem_menu_id = id;
- switch (id)
- {
- case MENU_CLOCK:
- am_param.layout_subitem_id = VIEW_CLOCK;
- break;
- case MENU_SLEEP_TIMER:
- am_param.layout_subitem_id = VIEW_SLEEP_TIMER;
- break;
- case MENU_WAKEUP_TIMER:
- am_param.layout_subitem_id = VIEW_WAKEUP_TIMER;
- break;
- case MENU_CHANGE_PINCODE:
- am_param.layout_subitem_id = VIEW_CHANGE_PINCODE;
- break;
- case MENU_LANGUAGE:
- am_param.layout_subitem_id = VIEW_LANGUAGE;
- break;
- case MENU_SUBTITLE:
- am_param.layout_subitem_id = VIEW_SUBTITLE;
- break;
- case MENU_RESET:
- am_param.layout_subitem_id = VIEW_RESET;
- break;
- default:
- return;
- }
- viewmgr_update_view(VIEW_ACTION_MENU, ACT_MENU_SRC_VIEW_UPDATE, (void *)&am_param);
- viewmgr_show_view(VIEW_ACTION_MENU);
}
static bool _add_layout_contents(struct _priv *priv, Evas_Object *tab_button)
diff --git a/src/main.c b/src/main.c
index bd42007..55231b5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,7 +21,6 @@
#include "app_debug.h"
#include "define.h"
#include "view/view_base.h"
-#include "view/view_action_menu.h"
#include "view/picture/view_picture_contrast.h"
#include "view/picture/view_picture_brightness.h"
#include "view/picture/view_picture_color.h"
diff --git a/src/view/view_action_menu.c b/src/view/view_action_menu.c
deleted file mode 100644
index ce541bd..0000000
--- a/src/view/view_action_menu.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * 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
-#include
-
-#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);
-}
diff --git a/src/view/view_base.c b/src/view/view_base.c
index 11b9bfb..94c4b13 100755
--- a/src/view/view_base.c
+++ b/src/view/view_base.c
@@ -26,7 +26,6 @@
#include "data/settings_preferences.h"
#include "define.h"
#include "layout.h"
-#include "view/view_action_menu.h"
#include "view/view_base.h"
@@ -353,8 +352,6 @@ static void _menu_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
{
struct _priv *priv = (struct _priv *)data;
- action_menu_parameter am_param = {0,};
-
if (!obj || !ev || !priv) {
_ERR("Invalid argument.");
return;
@@ -384,17 +381,6 @@ static void _menu_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
|| !strcmp(ev->keyname, KEY_ESC) || !strcmp(ev->keyname, KEY_ESC_WAY)
)
ui_app_exit();
-
- if (!strcmp(ev->keyname, KEY_MENU) || !strcmp(ev->keyname, KEY_MENU_WAY)
- || !strcmp(ev->keyname, KEY_MENU_EMULATOR)) {
- if (id >= 0 && id < LAYOUT_MAX) {
- am_param.layout_id = _mdata_p[id]->get_lclass()->layout_id;
- viewmgr_update_view(VIEW_ACTION_MENU, ACT_MENU_SRC_VIEW_UPDATE,
- (void *)&am_param);
- viewmgr_show_view(VIEW_ACTION_MENU);
- elm_layout_signal_emit(priv->menu[id], SIG_SELECTED, "");
- }
- }
}
static void _menu_focused_cb(int id, void *data, Evas_Object *obj,
@@ -537,13 +523,6 @@ static Evas_Object *_create(Evas_Object *win, void *data)
return NULL;
}
- /* action menu: */
- if (!viewmgr_add_view(view_action_menu_get_vclass(), priv->lmgr)) {
- evas_object_del(priv->base);
- free(priv);
- return NULL;
- }
-
return priv->base;
}
@@ -632,8 +611,6 @@ static void _destroy(void *data)
}
priv = data;
- viewmgr_remove_view(VIEW_ACTION_MENU);
-
for (i = 0; i < LAYOUT_MAX; i++)
layoutmgr_remove_layout(priv->lmgr, _mdata_p[i]->layout_id);
--
2.7.4