color, 194 194 194 127;
}
}
+
+ part {
+ name, "event";
+ type, RECT;
+ description {
+ state, "default" 0.0;
+ color, 0 0 0 0;
+ }
+ description {
+ state, "disable" 0.0;
+ inherit, "default" 0.0;
+ visible, 0;
+ }
+ }
}
programs {
program {
name, SIG_DISABLE;
signal, SIG_DISABLE;
- source, SRC_LIVETV_BTN;
+ source, "elm";
script {
set_state(PART:"elm.text", "disable", 0.0);
set_state(PART:"part.inside.line.up", "disable", 0.0);
set_state(PART:"part.inside.line.down", "disable", 0.0);
set_state(PART:"part.inside.line.left", "disable", 0.0);
set_state(PART:"part.inside.line.right", "disable", 0.0);
+ set_state(PART:"event", "disable", 0.0);
}
}
+
+ program {
+ name, "mouse_unclick_after";
+ signal, "mouse,clicked,1";
+ source, "event";
+ action, SIGNAL_EMIT "elm,action,click" "";
+ }
}
}
color, 104 104 104 127;
}
}
+
+ part {
+ name, "event";
+ type, RECT;
+ description {
+ state, "default" 0.0;
+ color, 0 0 0 0;
+ }
+ description {
+ state, "disable" 0.0;
+ inherit, "default" 0.0;
+ visible, 0;
+ }
+ }
}
programs{
}
program {
- name, SIG_BTN_DISABLE;
- signal, SIG_BTN_DISABLE;
+ name, SIG_DISABLE;
+ signal, SIG_DISABLE;
source, "elm";
script {
set_int(cur_state, STATE_DISABLE);
set_state(PART:"part.bg", "disable", 0.0);
set_state(PART:"elm.text", "disable", 0.0);
set_state(PART:"part.icon", "disable", 0.0);
+ set_state(PART:"event", "disable", 0.0);
}
}
+
+ program {
+ name, "mouse_unclick_after";
+ signal, "mouse,clicked,1";
+ source, "event";
+ action, SIGNAL_EMIT "elm,action,click" "";
+ }
}
}
#include "define.h"
#include "utils.h"
+enum button_type {
+ BTN_LIVETV = 0,
+ BTN_FAVORITE,
+ BTN_LOCK,
+ BTN_SHARE,
+};
+
struct _priv {
Evas_Object *win;
Evas_Object *base;
};
struct _action_info {
+ int id;
const char *title;
const char *style;
Eina_Bool disable;
static struct _action_info action_info[] = {
{
+ .id = BTN_FAVORITE,
.title = STR_FAVORITE,
.style = STYLE_ACTION_MENU_FAV_BTN,
.disable = EINA_FALSE
},
{
+ .id = BTN_LOCK,
.title = STR_LOCK,
.style = STYLE_ACTION_MENU_LOCK_BTN,
.disable = EINA_TRUE
},
{
+ .id = BTN_SHARE,
.title = STR_SHARE,
.style = STYLE_ACTION_MENU_SHARE_BTN,
.disable = EINA_TRUE
elm_object_focus_set(obj, EINA_TRUE);
}
-static void _livetv_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Key_Down *ev)
+static void _favorite_selected(void *data, Evas_Object *obj)
{
- if (!ev) {
- _ERR("Invalid argument.");
- return;
- }
+ /* It will be implemented later */
+}
- if (!strcmp(ev->keyname, KEY_BACK)
- || !strcmp(ev->keyname, KEY_BACK_REMOTE))
- viewmgr_hide_view(VIEW_ID_ACTION_MENU);
+static void _livetv_selected(void *data, Evas_Object *obj)
+{
+ /* It will be implemented later */
}
-static void _action_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
+static void _clicked_cb(int id, void *data, Evas_Object *obj)
+{
+
+ switch (id) {
+ case BTN_LIVETV:
+ _livetv_selected(data, obj);
+ break;
+
+ case BTN_FAVORITE:
+ _favorite_selected(data, obj);
+ break;
+
+ case BTN_LOCK:
+ /* It is not supported yet. */
+ break;
+
+ case BTN_SHARE:
+ /* It is not supported yet. */
+ break;
+
+ default:
+ _ERR("Unhandled action type.");
+ }
+}
+
+static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
Evas_Event_Key_Down *ev)
{
if (!ev) {
viewmgr_hide_view(VIEW_ID_ACTION_MENU);
}
-static input_handler _livetv_input_handler = {
- .mouse_move = _mouse_move_cb,
- .key_down = _livetv_key_down_cb
-};
-
-static input_handler _action_input_handler = {
+static input_handler _btn_input_handler = {
.mouse_move = _mouse_move_cb,
- .key_down = _action_key_down_cb
+ .clicked = _clicked_cb,
+ .key_down = _key_down_cb
};
static bool _draw_livetv_area(struct _priv *priv)
return false;
}
- inputmgr_add_callback(btn, 0, &_livetv_input_handler, priv);
+ inputmgr_add_callback(btn, BTN_LIVETV, &_btn_input_handler, priv);
elm_object_focus_next_object_set(btn, btn, ELM_FOCUS_UP);
elm_object_focus_next_object_set(btn, btn, ELM_FOCUS_LEFT);
return false;
}
- inputmgr_add_callback(btn, i, &_action_input_handler, priv);
+ inputmgr_add_callback(btn, action_info[i].id,
+ &_btn_input_handler, priv);
if (action_info[i].disable)
elm_object_disabled_set(btn, EINA_TRUE);
priv->menu_btn[0], ELM_FOCUS_LEFT);
elm_object_focus_next_object_set(priv->menu_btn[0],
priv->menu_btn[0], ELM_FOCUS_RIGHT);
+ elm_object_focus_next_object_set(priv->menu_btn[0],
+ priv->menu_btn[0], ELM_FOCUS_DOWN);
elm_object_focus_next_object_set(priv->live_btn, priv->menu_btn[0],
ELM_FOCUS_DOWN);