layoutmgr *lmgr;
struct listmgr *list_mgr;
+ Evas_Object *tab_btn;
Eina_List *sound_modes_list;
Eina_List *speakers_list;
Elm_Object_Item *selected_sound_mode;
static void _update(void *layout_data, int update_type, void *data);
static void _grid_focused(int id, void *data, Evas_Object *obj, Elm_Object_Item *item);
+static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
+ Evas_Event_Key_Down *ev);
static layout_class _lclass = {
.layout_id = LAYOUT_ID_SOUND,
};
static input_handler grid_handler = {
- .focused = _grid_focused
+ .focused = _grid_focused,
+ .key_down = _key_down_cb
};
+
+static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
+ Evas_Event_Key_Down *ev)
+{
+ SETTING_TRACE_BEGIN;
+
+ struct _priv *priv = data;
+
+ if (!ev || !priv) {
+ _ERR("Invalid argument.");
+ return;
+ }
+
+ if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_ESC)) {
+ elm_object_focus_set(priv->tab_btn, EINA_TRUE);
+ }
+}
+
layout_class *layout_sound_get_lclass(void)
{
return &_lclass;
return false;
}
- listmgr_add_inner_grid_cb(priv->list_mgr, LIST_SOUND_MODES_ID, &grid_handler, NULL);
+ listmgr_add_inner_grid_cb(priv->list_mgr, LIST_SOUND_MODES_ID, &grid_handler, priv);
if (!listmgr_add_list(priv->list_mgr, LIST_SPEAKERS_ID, get_sound_grid_class(),
_speaker_selected_cb, priv)) {
return false;
}
- listmgr_add_inner_grid_cb(priv->list_mgr, LIST_SPEAKERS_ID, &grid_handler, NULL);
+ listmgr_add_inner_grid_cb(priv->list_mgr, LIST_SPEAKERS_ID, &grid_handler, priv);
- if(data) {
+ priv->tab_btn = (Evas_Object *)data;
+ if(priv->tab_btn) {
listmgr_set_list_next_focus(priv->list_mgr, LIST_SOUND_MODES_ID,
- (Evas_Object *)data, ELM_FOCUS_UP, EINA_TRUE, ELM_FOCUS_DOWN);
+ priv->tab_btn, ELM_FOCUS_UP, EINA_TRUE, ELM_FOCUS_DOWN);
listmgr_set_list_next_focus(priv->list_mgr, LIST_SPEAKERS_ID,
- (Evas_Object *)data, ELM_FOCUS_UP, EINA_FALSE, ELM_FOCUS_UP);
+ priv->tab_btn, ELM_FOCUS_UP, EINA_FALSE, ELM_FOCUS_UP);
}
if (!_fill_lists(priv)) {
static void _btn_clicked_cb(int id, void *data, Evas_Object *obj);
static void _btn_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
+
static input_handler _input_handler = {
.clicked = _btn_clicked_cb,
.key_down = _btn_key_down_cb
};
+static input_handler _grid_input_handler = {
+ .key_down = _btn_key_down_cb
+};
+
static void _data_event_cb(enum event_type type, void *data)
{
SETTING_TRACE_BEGIN;
{
SETTING_TRACE_BEGIN;
- struct _priv *priv = data;
-
- if (!ev || !priv) {
+ if (!ev) {
_ERR("Invalid argument.");
return;
}
{
SETTING_TRACE_BEGIN;
struct _priv *priv = NULL;
- struct datamgr *dmgr = NULL;
+ struct datamgr *data_mgr = NULL;
Evas_Object *base = NULL;
- struct listmgr *listmgr = NULL;
+ struct listmgr *list_mgr = NULL;
if (!win) {
_ERR("Get window object failed.");
priv->base = base;
- dmgr = datamgr_create(get_location_data_class(), _data_event_cb, priv);
- if (!dmgr) {
+ data_mgr = datamgr_create(get_location_data_class(), _data_event_cb, priv);
+ if (!data_mgr) {
_ERR("Create datamgr failed.");
free(priv);
evas_object_del(base);
return NULL;
}
- listmgr = listmgr_create(base);
- if (!listmgr) {
+ list_mgr = listmgr_create(base);
+ if (!list_mgr) {
_ERR("Create listmgr failed.");
- datamgr_destroy(dmgr);
+ datamgr_destroy(data_mgr);
free(priv);
evas_object_del(base);
return NULL;
}
- if (!listmgr_add_list(listmgr, LOCATION_LIST_ID, get_location_grid_class(),
+ if (!listmgr_add_list(list_mgr, LOCATION_LIST_ID, get_location_grid_class(),
_country_selected_cb, priv)) {
_ERR("Add location list failed.");
- listmgr_destroy(listmgr);
- datamgr_destroy(dmgr);
+ listmgr_destroy(list_mgr);
+ datamgr_destroy(data_mgr);
free(priv);
evas_object_del(base);
return NULL;
}
+ listmgr_add_inner_grid_cb(list_mgr, LOCATION_LIST_ID, &_grid_input_handler, NULL);
priv->win = win;
- priv->list_mgr = listmgr;
- priv->country_data_mgr = dmgr;
+ priv->list_mgr = list_mgr;
+ priv->country_data_mgr = data_mgr;
if (!viewmgr_set_view_data(VIEW_LOCATION, priv)) {
_ERR("Set view data failed.");
- listmgr_destroy(listmgr);
- datamgr_destroy(dmgr);
+ listmgr_destroy(list_mgr);
+ datamgr_destroy(data_mgr);
evas_object_del(base);
free(priv);
return NULL;
}
- data_location_fill_list_data(listmgr, &priv->configured_country, NULL);
+ data_location_fill_list_data(list_mgr, &priv->configured_country, NULL);
_draw_menu_area(priv);